Skip to contentSkip to conversation

qemu-kvm: Drop redundant cpuid filtering from cpu_x86_cpuid

PATCH Applied Jan Kiszka 2 participants 3 messages Sep 28, 2011 – Oct 3, 2011 KVM

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 qemu-kvm: Drop redundant cpuid filtering from cpu_x86_cpuid

This is already done in kvm_arch_init_vcpu based on the kernel-reported supported features.

---

I'm not 100% sure, so please double-check.

 target-i386/cpuid.c |   22 ----------------------
 1 files changed, 0 insertions(+), 22 deletions(-)
target-i386/cpuid.c +0 -22
index f179999..1e8bcff 100644
@@ -1232,28 +1232,6 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count,
                 *ecx |= 1 << 1;    /* CmpLegacy bit */
             }
         }
-        if (kvm_enabled()) {
-            uint32_t h_eax, h_edx;
-
-            host_cpuid(index, 0, &h_eax, NULL, NULL, &h_edx);
-
-            /* disable CPU features that the host does not support */
-
-            /* long mode */
-            if ((h_edx & 0x20000000) == 0 /* || !lm_capable_kernel */)
-                *edx &= ~0x20000000;
-            /* syscall */
-            if ((h_edx & 0x00000800) == 0)
-                *edx &= ~0x00000800;
-            /* nx */
-            if ((h_edx & 0x00100000) == 0)
-                *edx &= ~0x00100000;
-
-            /* disable CPU features that KVM cannot support */
-
-            /* 3dnow */
-            *edx &= ~0xc0000000;
-        }
         break;
     case 0x80000002:
     case 0x80000003:
Signature · 1 line
1.7.3.4
#1 lore raw
Quoted 7 lines · Jan Kiszka

This is already done in kvm_arch_init_vcpu based on the kernel-reported supported features.

---

I'm not 100% sure, so please double-check.

Correct, trimming is done in the kernel already.