From patchwork Sun May 10 12:45:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 22797 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4ACkFBu028471 for ; Sun, 10 May 2009 12:46:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752087AbZEJMqL (ORCPT ); Sun, 10 May 2009 08:46:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752024AbZEJMqK (ORCPT ); Sun, 10 May 2009 08:46:10 -0400 Received: from mx2.redhat.com ([66.187.237.31]:50675 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752016AbZEJMqJ (ORCPT ); Sun, 10 May 2009 08:46:09 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4ACk8fx001094; Sun, 10 May 2009 08:46:08 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4ACj7sC004895; Sun, 10 May 2009 08:45:07 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4ACj6Wm000839; Sun, 10 May 2009 08:45:06 -0400 Received: from localhost.localdomain (dhcp-1-197.tlv.redhat.com [10.35.1.197]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id B0268250061; Sun, 10 May 2009 15:45:05 +0300 (IDT) From: Avi Kivity To: Anthony Liguori Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [PATCH] Work around misreported kvm cpuid features Date: Sun, 10 May 2009 15:45:05 +0300 Message-Id: <1241959505-22031-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org kvm misreports MCA, MCE, MTRR, and PAT as unsupported. This causes Vista to fail. Since QEMU does not support any version of kvm that does not actually support these features, it is safe to enable them unconditionally. These features are needed by Vista x64 to boot. Signed-off-by: Avi Kivity --- target-i386/kvm.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index fe67eed..a7b7ae3 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -88,6 +88,13 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg) break; case R_EDX: ret = cpuid->entries[i].edx; + if (function == 1) { + /* kvm misreports the following features: */ + ret |= 1 << 12; /* MTRR */ + ret |= 1 << 16; /* PAT */ + ret |= 1 << 7; /* MCE */ + ret |= 1 << 14; /* MCA */ + } if (function == 0x80000001) { /* On Intel, kvm returns cpuid according to the Intel spec, * so add missing bits according to the AMD spec: