Skip to content

Commit 802145c

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: VMX: Rename vmx_uret_msr's "index" to "slot"
Rename "index" to "slot" in struct vmx_uret_msr to align with the terminology used by common x86's kvm_user_return_msrs, and to avoid conflating "MSR's ECX index" with "MSR's index into an array". No functional change intended. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Message-Id: <20200923180409.32255-16-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 14a61b6 commit 802145c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/x86/kvm/vmx/vmx.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ static inline int __vmx_find_uret_msr(struct vcpu_vmx *vmx, u32 msr)
616616
int i;
617617

618618
for (i = 0; i < vmx->nr_uret_msrs; ++i)
619-
if (vmx_uret_msrs_list[vmx->guest_uret_msrs[i].index] == msr)
619+
if (vmx_uret_msrs_list[vmx->guest_uret_msrs[i].slot] == msr)
620620
return i;
621621
return -1;
622622
}
@@ -640,7 +640,7 @@ static int vmx_set_guest_uret_msr(struct vcpu_vmx *vmx,
640640
msr->data = data;
641641
if (msr - vmx->guest_uret_msrs < vmx->nr_active_uret_msrs) {
642642
preempt_disable();
643-
ret = kvm_set_user_return_msr(msr->index, msr->data, msr->mask);
643+
ret = kvm_set_user_return_msr(msr->slot, msr->data, msr->mask);
644644
preempt_enable();
645645
if (ret)
646646
msr->data = old_msr_data;
@@ -1143,7 +1143,7 @@ void vmx_prepare_switch_to_guest(struct kvm_vcpu *vcpu)
11431143
if (!vmx->guest_uret_msrs_loaded) {
11441144
vmx->guest_uret_msrs_loaded = true;
11451145
for (i = 0; i < vmx->nr_active_uret_msrs; ++i)
1146-
kvm_set_user_return_msr(vmx->guest_uret_msrs[i].index,
1146+
kvm_set_user_return_msr(vmx->guest_uret_msrs[i].slot,
11471147
vmx->guest_uret_msrs[i].data,
11481148
vmx->guest_uret_msrs[i].mask);
11491149

@@ -6730,7 +6730,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu)
67306730
if (wrmsr_safe(index, data_low, data_high) < 0)
67316731
continue;
67326732

6733-
vmx->guest_uret_msrs[j].index = i;
6733+
vmx->guest_uret_msrs[j].slot = i;
67346734
vmx->guest_uret_msrs[j].data = 0;
67356735
switch (index) {
67366736
case MSR_IA32_TSX_CTRL:

arch/x86/kvm/vmx/vmx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct vmx_msrs {
3636
};
3737

3838
struct vmx_uret_msr {
39-
unsigned index;
39+
unsigned int slot; /* The MSR's slot in kvm_user_return_msrs. */
4040
u64 data;
4141
u64 mask;
4242
};

0 commit comments

Comments
 (0)