]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tools: Clear presence of performance-energy bias bit
authorCyrill Gorcunov <gorcunov@gmail.com>
Sun, 18 Sep 2011 07:33:33 +0000 (11:33 +0400)
committerPekka Enberg <penberg@kernel.org>
Mon, 19 Sep 2011 14:23:31 +0000 (17:23 +0300)
In case if host machine supports performance-energy bias
capability it should not be propagated to KVM hypervisor.

Otherwise the kernel tries to do read MSR_IA32_ENERGY_PERF_BIAS
register and cause kernel panic (general protection fault).

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/cpuid.c

index c3b3d58aacfe31bed2c3fd279b0f64df45676c83..64d31a3294090bee260fe9b923349f23d81ce110 100644 (file)
@@ -22,6 +22,10 @@ static void filter_cpuid(struct kvm_cpuid2 *kvm_cpuid)
                struct kvm_cpuid_entry2 *entry = &kvm_cpuid->entries[i];
 
                switch (entry->function) {
+               case 6:
+                       /* Clear presence of IA32_ENERGY_PERF_BIAS */
+                       entry->ecx      = entry->ecx & ~(1 << 3);
+                       break;
                case CPUID_FUNC_PERFMON:
                        entry->eax      = 0x00; /* disable it */
                        break;