KVM: x86: VMX: Fix MSR namespacing
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest15 patches 1 replyIn review
- v115 patches 0 repliesSuperseded
Changes in v2 from the cover letter
- Rebased to kvm/queue, commit e1ba1a15af73 ("KVM: SVM: Enable INVPCID feature on AMD").
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | KVM: x86: Rename "shared_msrs" to "user_return_msrs"arch/ arch/ arch/ | +60 | 0 replies | |
| 2/15 | KVM: VMX: Prepend "MAX_" to MSR array size definesarch/ arch/ arch/ | +9 | 0 replies | |
| 3/15 | KVM: VMX: Rename "vmx_find_msr_index" to "vmx_find_loadstore_msr_slot"arch/ arch/ arch/ | +14 | 1 reply | |
| 4/15 | KVM: VMX: Rename the "shared_msr_entry" struct to "vmx_uret_msr"arch/ arch/ arch/ | +35 | 0 replies | |
| 5/15 | KVM: VMX: Rename vcpu_vmx's "nmsrs" to "nr_uret_msrs"arch/ arch/ | +4 | 0 replies | |
| 6/15 | KVM: VMX: Rename vcpu_vmx's "save_nmsrs" to "nr_active_uret_msrs"arch/ arch/ | +12 | 0 replies | |
| 7/15 | KVM: VMX: Rename vcpu_vmx's "guest_msrs_ready" to "guest_uret_msrs_loaded"arch/ arch/ | +5 | 0 replies | |
| 8/15 | KVM: VMX: Rename "__find_msr_index" to "__vmx_find_uret_msr"arch/ | +8 | 0 replies | |
| 9/15 | KVM: VMX: Check guest support for RDTSCP before processing MSR_TSC_AUXarch/ | +5 | 0 replies | |
| 10/15 | KVM: VMX: Move uret MSR lookup into update_transition_efer()arch/ | +21 | 0 replies | |
| 11/15 | KVM: VMX: Add vmx_setup_uret_msr() to handle lookup and swaparch/ | +18 | 0 replies | |
| 12/15 | KVM: VMX: Rename "find_msr_entry" to "vmx_find_uret_msr"arch/ arch/ arch/ | +7 | 0 replies | |
| 13/15 | KVM: VMX: Rename "vmx_set_guest_msr" to "vmx_set_guest_uret_msr"arch/ | +4 | 0 replies | |
| 14/15 | KVM: VMX: Rename "vmx_msr_index" to "vmx_uret_msrs_list"arch/ | +8 | 0 replies | |
| 15/15 | KVM: VMX: Rename vmx_uret_msr's "index" to "slot"arch/ arch/ | +5 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/15] KVM: x86: VMX: Fix MSR namespacing
This series attempts to clean up VMX's MSR namespacing, which is in unimitigated disaster (keeping things PG).
There are a variety of ways VMX saves and restores guest MSRs, all with unique properties and mechanisms, but with haphazard namespacing (assuming there is any namespacing at all). Some fun collisions:
__find_msr_index(), find_msr_entry() and vmx_find_msr_index()
vmx_set_guest_msr() and vmx_set_msr()
structs vmx_msrs, vmx_msr_entry, shared_msr_entry, kvm_shared_msrs and kvm_shared_msrs_values
vcpu_vmx fields guest_msrs, msr_autoload.guest and msr_autostore.guest
Probably the most infurating/confusing nomenclature is "index", which can mean MSR's ECX index, index into one of several VMX arrays, or index into a common x86 array. __find_msr_index() even manages to mix at least three different meanings in about as many lines of code.
The biggest change is to rename the "shared MSRs" mechanism to "user return MSRs" (details in patch 1), most everything else is either derived from that rename or is fairly straightforward cleanup.
No true functional changes, although the update_transition_efer() change in patch 10 dances pretty close to being a functional change.
v2:
- Rebased to kvm/queue, commit e1ba1a15af73 ("KVM: SVM: Enable INVPCID feature on AMD").
Sean Christopherson (15):
KVM: x86: Rename "shared_msrs" to "user_return_msrs"
KVM: VMX: Prepend "MAX_" to MSR array size defines
KVM: VMX: Rename "vmx_find_msr_index" to "vmx_find_loadstore_msr_slot"
KVM: VMX: Rename the "shared_msr_entry" struct to "vmx_uret_msr"
KVM: VMX: Rename vcpu_vmx's "nmsrs" to "nr_uret_msrs"
KVM: VMX: Rename vcpu_vmx's "save_nmsrs" to "nr_active_uret_msrs"
KVM: VMX: Rename vcpu_vmx's "guest_msrs_ready" to
"guest_uret_msrs_loaded"
KVM: VMX: Rename "__find_msr_index" to "__vmx_find_uret_msr"
KVM: VMX: Check guest support for RDTSCP before processing MSR_TSC_AUX
KVM: VMX: Move uret MSR lookup into update_transition_efer()
KVM: VMX: Add vmx_setup_uret_msr() to handle lookup and swap
KVM: VMX: Rename "find_msr_entry" to "vmx_find_uret_msr"
KVM: VMX: Rename "vmx_set_guest_msr" to "vmx_set_guest_uret_msr"
KVM: VMX: Rename "vmx_msr_index" to "vmx_uret_msrs_list"
KVM: VMX: Rename vmx_uret_msr's "index" to "slot"
arch/x86/include/asm/kvm_host.h | 4 +- arch/x86/kvm/vmx/nested.c | 22 ++-- arch/x86/kvm/vmx/vmx.c | 184 ++++++++++++++++---------------- arch/x86/kvm/vmx/vmx.h | 24 ++--- arch/x86/kvm/x86.c | 101 +++++++++--------- 5 files changed, 168 insertions(+), 167 deletions(-)
Signature · 1 line
2.28.0