From: Marcelo Tosatti Date: Sun, 27 Apr 2014 01:30:23 +0000 (-0300) Subject: KVM: x86: expose invariant tsc cpuid bit (v2) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e4c9a5a17567f8ea975bdcfdd1bf9d63965de6c9;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git KVM: x86: expose invariant tsc cpuid bit (v2) Invariant TSC is a property of TSC, no additional support code necessary. Signed-off-by: Marcelo Tosatti Signed-off-by: Paolo Bonzini --- diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index f47a104a749c..333b88db22fe 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -495,6 +495,13 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, entry->ecx &= kvm_supported_word6_x86_features; cpuid_mask(&entry->ecx, 6); break; + case 0x80000007: /* Advanced power management */ + /* invariant TSC is CPUID.80000007H:EDX[8] */ + entry->edx &= (1 << 8); + /* mask against host */ + entry->edx &= boot_cpu_data.x86_power; + entry->eax = entry->ebx = entry->ecx = 0; + break; case 0x80000008: { unsigned g_phys_as = (entry->eax >> 16) & 0xff; unsigned virt_as = max((entry->eax >> 8) & 0xff, 48U); @@ -525,7 +532,6 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, case 3: /* Processor serial number */ case 5: /* MONITOR/MWAIT */ case 6: /* Thermal management */ - case 0x80000007: /* Advanced power management */ case 0xC0000002: case 0xC0000003: case 0xC0000004: