* [PATCH] Work around misreported kvm cpuid features
@ 2009-05-10 12:45 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-05-10 12:45 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, kvm
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 <avi@redhat.com>
---
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:
--
1.6.1.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [Qemu-devel] [PATCH] Work around misreported kvm cpuid features
@ 2009-05-10 12:45 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-05-10 12:45 UTC (permalink / raw)
To: Anthony Liguori; +Cc: qemu-devel, kvm
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 <avi@redhat.com>
---
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:
--
1.6.1.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [Qemu-devel] [PATCH] Work around misreported kvm cpuid features
2009-05-10 12:45 ` [Qemu-devel] " Avi Kivity
(?)
@ 2009-05-10 13:11 ` Stuart Brady
2009-05-10 13:17 ` Avi Kivity
-1 siblings, 1 reply; 4+ messages in thread
From: Stuart Brady @ 2009-05-10 13:11 UTC (permalink / raw)
To: qemu-devel
On Sun, May 10, 2009 at 03:45:05PM +0300, Avi Kivity wrote:
> These features are needed by Vista x64 to boot.
> + ret |= 1 << 12; /* MTRR */
> + ret |= 1 << 16; /* PAT */
> + ret |= 1 << 7; /* MCE */
> + ret |= 1 << 14; /* MCA */
Just curious -- is there a reason to avoid the use of CPUID_MTRR,
CPUID_PAT, CPUID_MCE and CPUID_MCA here?
Cheers,
--
Stuart Brady
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH] Work around misreported kvm cpuid features
2009-05-10 13:11 ` Stuart Brady
@ 2009-05-10 13:17 ` Avi Kivity
0 siblings, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2009-05-10 13:17 UTC (permalink / raw)
To: Stuart Brady; +Cc: qemu-devel
Stuart Brady wrote:
> On Sun, May 10, 2009 at 03:45:05PM +0300, Avi Kivity wrote:
>
>> These features are needed by Vista x64 to boot.
>>
>
>
>> + ret |= 1 << 12; /* MTRR */
>> + ret |= 1 << 16; /* PAT */
>> + ret |= 1 << 7; /* MCE */
>> + ret |= 1 << 14; /* MCA */
>>
>
> Just curious -- is there a reason to avoid the use of CPUID_MTRR,
> CPUID_PAT, CPUID_MCE and CPUID_MCA here?
>
Didn't notice those. Will send an updated patch.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-05-10 13:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-10 12:45 [PATCH] Work around misreported kvm cpuid features Avi Kivity
2009-05-10 12:45 ` [Qemu-devel] " Avi Kivity
2009-05-10 13:11 ` Stuart Brady
2009-05-10 13:17 ` Avi Kivity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.