diff options
| -rw-r--r-- | arch/x86/kvm/vmx/vmx.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 60306f19105d..0db7ded18951 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c | |||
| @@ -6866,30 +6866,6 @@ static void nested_vmx_entry_exit_ctls_update(struct kvm_vcpu *vcpu) | |||
| 6866 | } | 6866 | } |
| 6867 | } | 6867 | } |
| 6868 | 6868 | ||
| 6869 | static bool guest_cpuid_has_pmu(struct kvm_vcpu *vcpu) | ||
| 6870 | { | ||
| 6871 | struct kvm_cpuid_entry2 *entry; | ||
| 6872 | union cpuid10_eax eax; | ||
| 6873 | |||
| 6874 | entry = kvm_find_cpuid_entry(vcpu, 0xa, 0); | ||
| 6875 | if (!entry) | ||
| 6876 | return false; | ||
| 6877 | |||
| 6878 | eax.full = entry->eax; | ||
| 6879 | return (eax.split.version_id > 0); | ||
| 6880 | } | ||
| 6881 | |||
| 6882 | static void nested_vmx_procbased_ctls_update(struct kvm_vcpu *vcpu) | ||
| 6883 | { | ||
| 6884 | struct vcpu_vmx *vmx = to_vmx(vcpu); | ||
| 6885 | bool pmu_enabled = guest_cpuid_has_pmu(vcpu); | ||
| 6886 | |||
| 6887 | if (pmu_enabled) | ||
| 6888 | vmx->nested.msrs.procbased_ctls_high |= CPU_BASED_RDPMC_EXITING; | ||
| 6889 | else | ||
| 6890 | vmx->nested.msrs.procbased_ctls_high &= ~CPU_BASED_RDPMC_EXITING; | ||
| 6891 | } | ||
| 6892 | |||
| 6893 | static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) | 6869 | static void update_intel_pt_cfg(struct kvm_vcpu *vcpu) |
| 6894 | { | 6870 | { |
| 6895 | struct vcpu_vmx *vmx = to_vmx(vcpu); | 6871 | struct vcpu_vmx *vmx = to_vmx(vcpu); |
| @@ -6978,7 +6954,6 @@ static void vmx_cpuid_update(struct kvm_vcpu *vcpu) | |||
| 6978 | if (nested_vmx_allowed(vcpu)) { | 6954 | if (nested_vmx_allowed(vcpu)) { |
| 6979 | nested_vmx_cr_fixed1_bits_update(vcpu); | 6955 | nested_vmx_cr_fixed1_bits_update(vcpu); |
| 6980 | nested_vmx_entry_exit_ctls_update(vcpu); | 6956 | nested_vmx_entry_exit_ctls_update(vcpu); |
| 6981 | nested_vmx_procbased_ctls_update(vcpu); | ||
| 6982 | } | 6957 | } |
| 6983 | 6958 | ||
| 6984 | if (boot_cpu_has(X86_FEATURE_INTEL_PT) && | 6959 | if (boot_cpu_has(X86_FEATURE_INTEL_PT) && |
