Some code refactor surround CR4.UMIP virtualization
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | KVM: VMX: Rename vmx_umip_emulated() to cpu_has_vmx_desc()arch/ arch/ arch/ | +11 | 5 replies | |
| 2/3 | KVM: VMX: Remove a unnecessary cpu_has_vmx_desc() check in vmx_set_cr4()arch/ | +1 | 6 replies | |
| 3/3 | KVM: VMX: Use the canonical interface to read CR4.UMIP bitarch/ | +1 | 4 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] Some code refactor surround CR4.UMIP virtualization
This is some small code refactor/cleanup surround CR4.UMIP virtualization.
vmx_umip_emulated() is misleading, it is actually cpu_has_vmx_desc(). E.g., if host has both UMIP cap and VMX_FEATURE_DESC_EXITING feature, vmx_umip_emulated() returns true, but UMIP in fact isn't emulated. Rename it.
Also, vCPU can have UMIP feature (i.e. CR4.UMIP is valid) if and only if host has UMIP and/or VMX_FEATURE_DESC_EXITING cap, (see vmx_set_cpu_caps()); then checking cpu_has_vmx_desc() for emulating UMIP is redundant, because boot_cpu_has(X86_FEATURE_UMIP) and cpu_has_vmx_desc() must at least one be true.
===Test===
kvm-unit-test umip cases, enabled and disabled (unittests.cfg patch below), pass. But currently I have no machine with UMIP feature, so actually only emulation path is covered.
In January, test was carried out on Simics platform with UMIP. Passed.
x86/unittests.cfg +4 -0
@@ -323,6 +323,10 @@ arch = x86_64 file = umip.flat extra_params = -cpu qemu64,+umip +[umip-disabled] +file = umip.flat +extra_params = -cpu qemu64,-umip +
Robert Hoo (3):
KVM: VMX: Rename vmx_umip_emulated() to cpu_has_vmx_desc()
KVM: VMX: Remove a unnecessary cpu_has_vmx_desc() check in
vmx_set_cr4()
KVM: VMX: Use the canonical interface to read CR4.UMIP bit
arch/x86/kvm/vmx/capabilities.h | 2 +- arch/x86/kvm/vmx/nested.c | 4 ++-- arch/x86/kvm/vmx/vmx.c | 12 +++++++++--- 3 files changed, 12 insertions(+), 6 deletions(-)
base-commit: 45dd9bc75d9adc9483f0c7d662ba6e73ed698a0b
Signature · 1 line
2.31.1