KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
PATCH RESEND 1/1 KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES
Currently when kvm_update_cpuid_runtime() runs, it assumes that the KVM_CPUID_FEATURES leaf is located at 0x40000001. This is not true, however, if Hyper-V support is enabled. In this case the KVM leaves will be offset.
This patch introdues as new 'kvm_cpuid_base' field into struct kvm_vcpu_arch to track the location of the KVM leaves and function kvm_update_cpuid_base() (called from kvm_update_cpuid_runtime()) to locate the leaves using the 'KVMKVMKVM\0\0\0' signature. Adjustment of KVM_CPUID_FEATURES will hence now target the correct leaf.
---
Cc: Paolo Bonzini <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: Wanpeng Li <[email protected]>
Cc: Jim Mattson <[email protected]>
Cc: Joerg Roedel <[email protected]>
--- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/cpuid.c | 50 +++++++++++++++++++++++++++++---- 2 files changed, 46 insertions(+), 5 deletions(-)
arch/x86/include/asm/kvm_host.h +1 -0
@@ -725,6 +725,7 @@ struct kvm_vcpu_arch {int cpuid_nent;struct kvm_cpuid_entry2 *cpuid_entries; +u32 kvm_cpuid_base;u64 reserved_gpa_bits;int maxphyaddr;
arch/x86/kvm/cpuid.c +45 -5
72 lines not on this page · raw message
Signature · 1 line
2.20.1