diff options
author | Sean Christopherson <seanjc@google.com> | 2021-05-04 19:17:29 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-05-07 12:06:18 +0200 |
commit | 8ea8b8d6f869425e21f34e60bdbe7e47e6c9d6b9 (patch) | |
tree | 50f7dc3d0c4c884fc2851ef51264b22ec0722787 /arch/x86/kvm/x86.c | |
parent | KVM: VMX: Use flag to indicate "active" uret MSRs instead of sorting list (diff) | |
download | linux-8ea8b8d6f869425e21f34e60bdbe7e47e6c9d6b9.tar.xz linux-8ea8b8d6f869425e21f34e60bdbe7e47e6c9d6b9.zip |
KVM: VMX: Use common x86's uret MSR list as the one true list
Drop VMX's global list of user return MSRs now that VMX doesn't resort said
list to isolate "active" MSRs, i.e. now that VMX's list and x86's list have
the same MSRs in the same order.
In addition to eliminating the redundant list, this will also allow moving
more of the list management into common x86.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210504171734.1434054-11-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kvm/x86.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0856636efc44..d514031ed25f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -364,6 +364,18 @@ void kvm_define_user_return_msr(unsigned slot, u32 msr) } EXPORT_SYMBOL_GPL(kvm_define_user_return_msr); +int kvm_find_user_return_msr(u32 msr) +{ + int i; + + for (i = 0; i < user_return_msrs_global.nr; ++i) { + if (user_return_msrs_global.msrs[i] == msr) + return i; + } + return -1; +} +EXPORT_SYMBOL_GPL(kvm_find_user_return_msr); + static void kvm_user_return_msr_cpu_online(void) { unsigned int cpu = smp_processor_id(); |