summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJinrong Liang <cloudliang@tencent.com>2023-04-11 21:03:38 +0800
committerSean Christopherson <seanjc@google.com>2023-06-01 14:04:24 -0700
commit33ab767c2628136c54c2e2160e4c536c7db9c6d0 (patch)
treed5eeeba7dc6e3482f2054e7e34699dcb88300d5b /arch
parent023cfa6fc200fc179dbf8e1857cc7140fa1466f9 (diff)
downloadlinux-stable-33ab767c2628136c54c2e2160e4c536c7db9c6d0.tar.gz
linux-stable-33ab767c2628136c54c2e2160e4c536c7db9c6d0.tar.bz2
linux-stable-33ab767c2628136c54c2e2160e4c536c7db9c6d0.zip
KVM: x86/pmu: Remove redundant check for MSR_IA32_DS_AREA set handler
After commit 2de154f541fc ("KVM: x86/pmu: Provide "error" semantics for unsupported-but-known PMU MSRs"), the guest_cpuid_has(DS) check is not necessary any more since if the guest supports X86_FEATURE_DS, it never returns 1. And if the guest does not support this feature, the set_msr handler will get false from kvm_pmu_is_valid_msr() before reaching this point. Therefore, the check will not be true in all cases and can be safely removed, which also simplifies the code and improves its readability. Signed-off-by: Jinrong Liang <cloudliang@tencent.com> Link: https://lore.kernel.org/r/20230411130338.8592-1-cloudliang@tencent.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kvm/vmx/pmu_intel.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c
index 741efe2c497b..84be32d9f365 100644
--- a/arch/x86/kvm/vmx/pmu_intel.c
+++ b/arch/x86/kvm/vmx/pmu_intel.c
@@ -444,8 +444,6 @@ static int intel_pmu_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
}
break;
case MSR_IA32_DS_AREA:
- if (msr_info->host_initiated && data && !guest_cpuid_has(vcpu, X86_FEATURE_DS))
- return 1;
if (is_noncanonical_address(data, vcpu))
return 1;