From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M3907-0004R5-2p for qemu-devel@nongnu.org; Sun, 10 May 2009 09:23:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M3902-0004Q5-ND for qemu-devel@nongnu.org; Sun, 10 May 2009 09:23:30 -0400 Received: from [199.232.76.173] (port=42155 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M3902-0004Q2-JG for qemu-devel@nongnu.org; Sun, 10 May 2009 09:23:26 -0400 Received: from mx2.redhat.com ([66.187.237.31]:48283) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M3902-0002Hh-4z for qemu-devel@nongnu.org; Sun, 10 May 2009 09:23:26 -0400 From: Avi Kivity Date: Sun, 10 May 2009 16:22:21 +0300 Message-Id: <1241961741-27607-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH v2] Work around misreported kvm cpuid features List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: qemu-devel@nongnu.org, 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 --- Changes from v1: - use CPUID_* instead of open coding constants target-i386/kvm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index fe67eed..86da72d 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -88,6 +88,10 @@ 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 |= CPUID_MTRR | CPUID_PAT | CPUID_MCA | CPUID_MCE; + } if (function == 0x80000001) { /* On Intel, kvm returns cpuid according to the Intel spec, * so add missing bits according to the AMD spec: -- 1.6.0.6