summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/kvm.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2014-01-27 13:51:44 (GMT)
committerPaolo Bonzini <pbonzini@redhat.com>2014-01-29 17:11:55 (GMT)
commit77f01bdfa5e55dc19d3eb747181d2730a9bb3ca8 (patch)
tree9f85c79d2af02145774799b31b0862dfcce5b844 /arch/x86/kernel/kvm.c
parent1c300a40772dae829b91dad634999a6a522c0829 (diff)
downloadlinux-77f01bdfa5e55dc19d3eb747181d2730a9bb3ca8.tar.xz
x86, kvm: correctly access the KVM_CPUID_FEATURES leaf at 0x40000101
When Hyper-V hypervisor leaves are present, KVM must relocate its own leaves at 0x40000100, because Windows does not look for Hyper-V leaves at indices other than 0x40000000. In this case, the KVM features are at 0x40000101, but the old code would always look at 0x40000001. Fix by using kvm_cpuid_base(). This also requires making the function non-inline, since kvm_cpuid_base() is static. Fixes: 1085ba7f552d84aa8ac0ae903fa8d0cc2ff9f79d Cc: stable@vger.kernel.org Cc: mtosatti@redhat.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kernel/kvm.c')
-rw-r--r--arch/x86/kernel/kvm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 0823003..f81cade 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -527,6 +527,11 @@ bool kvm_para_available(void)
}
EXPORT_SYMBOL_GPL(kvm_para_available);
+unsigned int kvm_arch_para_features(void)
+{
+ return cpuid_eax(kvm_cpuid_base() | KVM_CPUID_FEATURES);
+}
+
static uint32_t __init kvm_detect(void)
{
return kvm_cpuid_base();