Skip to contentSkip to conversation

fix 80000001.EDX supported bit filtering

PATCH Applied Gleb Natapov 2 participants 2 messages May 11, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix 80000001.EDX supported bit filtering

On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask used to copy bits from 1.EDX to 80000001.EDX is incorrect resulting in unsupported features passed into a guest.

target-i386/kvm.c +1 -1
index 76c1adb..6463390 100644
@@ -111,7 +111,7 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg)
                      * so add missing bits according to the AMD spec:
                      */
                     cpuid_1_edx = kvm_arch_get_supported_cpuid(env, 1, R_EDX);
-                    ret |= cpuid_1_edx & 0xdfeff7ff;
+                    ret |= cpuid_1_edx & 0x183f7ff;
                     break;
                 }
                 break;

--
Gleb.

#1 lore raw
Quoted 10 lines · Gleb Natapov

On AMD some bits from 1.EDX are reported in 80000001.EDX. The mask used to copy bits from 1.EDX to 80000001.EDX is incorrect resulting in unsupported features passed into a guest.

target-i386/kvm.c +0 -0
index 76c1adb..6463390 100644

target-i386/kvm.c uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg) · line 117

Quoted 8 lines
target-i386/kvm.c +1 -1
@@ -111,7 +111,7 @@ uint32_t kvm_arch_get_supported_cpuid(CPUState *env, uint32_t function, int reg)
                      * so add missing bits according to the AMD spec:
                      */
                     cpuid_1_edx = kvm_arch_get_supported_cpuid(env, 1, R_EDX);
-                    ret |= cpuid_1_edx & 0xdfeff7ff;
+                    ret |= cpuid_1_edx & 0x183f7ff;
                     break;
                 }
                 break;

Applied to uq/master, thanks.