KVM: VMX: Handle the immediate form of MSR instructions
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest4 patches 2 repliesIn review
- v14 patches 12 repliesSuperseded
Changes in v2 from the cover letter
*) Added nested MSR bitmap check for the two new MSR-related VM exit
reasons (Chao).
*) Shortened function names that still convey enough information
(Chao & Sean).
*) Removed VCPU_EXREG_EDX_EAX as it unnecessarily exposes details of a
specific flow across KVM (Sean).
*) Implemented a separate userspace completion callback for the
immediate form RDMSR (Sean).
*) Passed MSR data directly to __kvm_emulate_wrmsr() instead of the
encoded general-purpose register containing it (Sean).
*) Merged modifications to x86.c and vmx.c within the same patch to
facilitate easier code review (Sean).
*) Moved fastpath support in a separate patch, i.e., patch 3 (Sean). *) Cleared the immediate form MSR capability in SVM in patch 4 (Sean).
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | x86/cpufeatures: Add a CPU feature bit for MSR immediate form instructionsarch/ arch/ | +2 | 0 replies | |
| 2/4 | KVM: VMX: Handle the immediate form of MSR instructionsarch/ arch/ arch/ +3 more | +101 | 2 replies | |
| 3/4 | KVM: VMX: Support the immediate form WRMSRNS in fastpatharch/ arch/ arch/ +1 more | +20 | 0 replies | |
| 4/4 | KVM: x86: Advertise support for the immediate form of MSR instructionsarch/ arch/ arch/ +1 more | +16 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/4] KVM: VMX: Handle the immediate form of MSR instructions
This patch set handles two newly introduced VM exit reasons associated with the immediate form of MSR instructions to ensure proper virtualization of these instructions.
The immediate form of MSR access instructions are primarily motivated by performance, not code size: by having the MSR number in an immediate, it is available *much* earlier in the pipeline, which allows the hardware much more leeway about how a particular MSR is handled.
For proper virtualization of the immediate form of MSR instructions, Intel VMX architecture adds the following changes:
1) The immediate form of RDMSR uses VM exit reason 84.
2) The immediate form of WRMSRNS uses VM exit reason 85.
3) For both VM exit reasons 84 and 85, the exit qualification is set to the MSR address causing the VM exit.
4) Bits 3 ~ 6 of the VM exit instruction information field represent the operand register used in the immediate form of MSR instruction.
5) The VM-exit instruction length field records the size of the immediate form of the MSR instruction.
Note: The VMX specification for the immediate form of MSR instructions was inadvertently omitted from the last published ISE, but it will be included in the upcoming edition.
Linux bare metal support of the immediate form of MSR instructions is still under development; however, the KVM support effort is proceeding independently of the bare metal implementation.
Link to v1:
https://lore.kernel.org/lkml/[email protected]/
Changes in v2:
*) Added nested MSR bitmap check for the two new MSR-related VM exit
reasons (Chao).
*) Shortened function names that still convey enough information
(Chao & Sean).
*) Removed VCPU_EXREG_EDX_EAX as it unnecessarily exposes details of a
specific flow across KVM (Sean).
*) Implemented a separate userspace completion callback for the
immediate form RDMSR (Sean).
*) Passed MSR data directly to __kvm_emulate_wrmsr() instead of the
encoded general-purpose register containing it (Sean).
*) Merged modifications to x86.c and vmx.c within the same patch to
facilitate easier code review (Sean).
*) Moved fastpath support in a separate patch, i.e., patch 3 (Sean). *) Cleared the immediate form MSR capability in SVM in patch 4 (Sean).
Xin Li (Intel) (4):
x86/cpufeatures: Add a CPU feature bit for MSR immediate form
instructions
KVM: VMX: Handle the immediate form of MSR instructions
KVM: VMX: Support the immediate form WRMSRNS in fastpath
KVM: x86: Advertise support for the immediate form of MSR instructions
arch/x86/include/asm/cpufeatures.h | 1 + arch/x86/include/asm/kvm_host.h | 4 ++ arch/x86/include/uapi/asm/vmx.h | 6 +- arch/x86/kernel/cpu/scattered.c | 1 + arch/x86/kvm/cpuid.c | 6 +- arch/x86/kvm/reverse_cpuid.h | 5 ++ arch/x86/kvm/svm/svm.c | 8 ++- arch/x86/kvm/vmx/nested.c | 13 ++++- arch/x86/kvm/vmx/vmx.c | 26 ++++++++- arch/x86/kvm/vmx/vmx.h | 5 ++ arch/x86/kvm/x86.c | 92 ++++++++++++++++++++++-------- arch/x86/kvm/x86.h | 3 +- 12 files changed, 139 insertions(+), 31 deletions(-)
base-commit: 33f843444e28920d6e624c6c24637b4bb5d3c8de
Signature · 1 line
2.50.1