summaryrefslogtreecommitdiff
path: root/arch/x86/kvm/svm/pmu.c
diff options
context:
space:
mode:
authorDapeng Mi <dapeng1.mi@linux.intel.com>2024-04-30 08:52:38 +0800
committerSean Christopherson <seanjc@google.com>2024-06-03 14:23:14 -0700
commit0e102ce3d4133194a26060fe987315133736c37b (patch)
tree34444cf113919e8e643a088c67a49e979add9013 /arch/x86/kvm/svm/pmu.c
parent0c468a6a020cc7d848af053ef13254005e289dd9 (diff)
downloadlwn-0e102ce3d4133194a26060fe987315133736c37b.tar.gz
lwn-0e102ce3d4133194a26060fe987315133736c37b.zip
KVM: x86/pmu: Change ambiguous _mask suffix to _rsvd in kvm_pmu
Several '_mask' suffixed variables such as, global_ctrl_mask, are defined in kvm_pmu structure. However the _mask suffix is ambiguous and misleading since it's not a real mask with positive logic. On the contrary it represents the reserved bits of corresponding MSRs and these bits should not be accessed. Suggested-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com> Link: https://lore.kernel.org/r/20240430005239.13527-2-dapeng1.mi@linux.intel.com Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm/svm/pmu.c')
-rw-r--r--arch/x86/kvm/svm/pmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/svm/pmu.c b/arch/x86/kvm/svm/pmu.c
index dfcc38bd97d3..6e908bdc3310 100644
--- a/arch/x86/kvm/svm/pmu.c
+++ b/arch/x86/kvm/svm/pmu.c
@@ -199,8 +199,8 @@ static void amd_pmu_refresh(struct kvm_vcpu *vcpu)
kvm_pmu_cap.num_counters_gp);
if (pmu->version > 1) {
- pmu->global_ctrl_mask = ~((1ull << pmu->nr_arch_gp_counters) - 1);
- pmu->global_status_mask = pmu->global_ctrl_mask;
+ pmu->global_ctrl_rsvd = ~((1ull << pmu->nr_arch_gp_counters) - 1);
+ pmu->global_status_rsvd = pmu->global_ctrl_rsvd;
}
pmu->counter_bitmask[KVM_PMC_GP] = ((u64)1 << 48) - 1;