Skip to contentSkip to conversation

qemu-kvm: remove "KVM misreports CPUID" hack

PATCH In review Andre Przywara 2 participants 2 messages Jul 3, 2009 – Jul 4, 2009 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu-kvm: remove "KVM misreports CPUID" hack

This should be no longer necessary.
Effectively reverts 143eb2bd043e82bcf353cf82d33c127f06411d82.

---
 kvm/libkvm/libkvm-x86.c |    9 ---------
 qemu-kvm-x86.c          |    9 ---------
 2 files changed, 0 insertions(+), 18 deletions(-)

Hi Avi,

I am not sure what caused your problem back in May when you committed this, but it seems to work without this now. I booted Win7RC 64bit and WinXP 64bit and saw no problems.

Regards,
Andre.

kvm/libkvm/libkvm-x86.c +0 -9
index 9ca77d5..67f41b4 100644
@@ -639,15 +639,6 @@ uint32_t kvm_get_supported_cpuid(kvm_context_t kvm, 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 */
-                                }
-
 				/* On Intel, kvm returns cpuid according to
 				 * the Intel spec, so add missing bits
 				 * according to the AMD spec:
qemu-kvm-x86.c +0 -9
index 7505380..2811665 100644
@@ -649,15 +649,6 @@ uint32_t kvm_get_supported_cpuid(kvm_context_t kvm, 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 */
-                                }
-
 				/* On Intel, kvm returns cpuid according to
 				 * the Intel spec, so add missing bits
 				 * according to the AMD spec:
Signature · 1 line
1.6.1.3
#1 lore raw
Quoted 9 lines · Andre Przywara

This should be no longer necessary.
Effectively reverts 143eb2bd043e82bcf353cf82d33c127f06411d82.

---
  kvm/libkvm/libkvm-x86.c |    9 ---------
  qemu-kvm-x86.c          |    9 ---------
  2 files changed, 0 insertions(+), 18 deletions(-)
Quoted 6 lines

Hi Avi,

I am not sure what caused your problem back in May when you committed this, but it seems to work without this now. I booted Win7RC 64bit and WinXP 64bit and saw no problems.

It's necessary for backwards compatibility. Older kvm versions misreported these bits, so we need to fix them up in userspace.

Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.