KVM: x86: Add "governed" X86_FEATURE framework
Status from this message: Applied to kvm-x86 misc, with a blurb added to the nVMX changelog to explain
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest15 patches 22 repliesApplied
- v221 patches 5 repliesSuperseded
- v112 patches 18 repliesSuperseded
Changes in v3 from the cover letter
- "Drop" TSC scaling patches (already applied).
- Remove dead xsave_enabled code (snuck into v2 by a bad conflict resolution). [Zeng]
- Make kvm_is_governed_feature() return a bool. [Zeng]
- Collect a review. [Yuan]
Patches in v3 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/15 | KVM: x86: Add a framework for enabling KVM-governed x86 featuresarch/ arch/ arch/ +1 more | +78 | 5 replies | |
| 2/15 | KVM: x86/mmu: Use KVM-governed feature framework to track "GBPAGES enabled"arch/ arch/ arch/ | +22 | 1 reply | |
| 3/15 | KVM: VMX: Recompute "XSAVES enabled" only after CPUID updatearch/ | +11 | 1 reply | |
| 4/15 | KVM: VMX: Check KVM CPU caps, not just VMX MSR support, for XSAVE enablingarch/ | +1 | 1 reply | |
| 5/15 | KVM: VMX: Rename XSAVES control to follow KVM's preferred "ENABLE_XYZ"arch/ arch/ arch/ +4 more | +9 | 2 replies | |
| 6/15 | KVM: x86: Use KVM-governed feature framework to track "XSAVES enabled"arch/ arch/ arch/ +2 more | +35 | 2 replies | |
| 7/15 | KVM: nVMX: Use KVM-governed feature framework to track "nested VMX enabled"arch/ arch/ arch/ +1 more | +11 | 3 replies | |
| 8/15 | KVM: nSVM: Use KVM-governed feature framework to track "NRIPS enabled"arch/ arch/ arch/ +1 more | +5 | 1 reply | |
| 9/15 | KVM: nSVM: Use KVM-governed feature framework to track "TSC scaling enabled"arch/ arch/ arch/ +1 more | +8 | 3 replies | |
| 10/15 | KVM: nSVM: Use KVM-governed feature framework to track "vVM{SAVE,LOAD} enabled"arch/ arch/ arch/ +1 more | +9 | 0 replies | |
| 11/15 | KVM: nSVM: Use KVM-governed feature framework to track "LBRv enabled"arch/ arch/ arch/ +1 more | +16 | 0 replies | |
| 12/15 | KVM: nSVM: Use KVM-governed feature framework to track "Pause Filter enabled"arch/ arch/ arch/ +1 more | +12 | 1 reply | |
| 13/15 | KVM: nSVM: Use KVM-governed feature framework to track "vGIF enabled"arch/ arch/ arch/ +1 more | +7 | 1 reply | |
| 14/15 | KVM: nSVM: Use KVM-governed feature framework to track "vNMI enabled"arch/ arch/ arch/ | +3 | 0 replies | |
| 15/15 | KVM: x86: Disallow guest CPUID lookups when IRQs are disabledarch/ | +13 | 0 replies |
Reviews trailers per patch
10 of 15 patches have a Reviewed-by or Acked-by.
| Patch | Yuan Yao | Kai Huang | Vitaly Kuznetsov | Binbin Wu |
|---|---|---|---|---|
| 1/15 | R-b | R-b | R-b | |
| 2/15 | R-b | |||
| 3/15 | R-b | |||
| 4/15 | R-b | |||
| 5/15 | R-b | |||
| 6/15 | R-b | |||
| 7/15 | R-b | Reviwed-by | ||
| 8/15 | R-b | |||
| 9/15 | R-b | |||
| 10/15 | ||||
| 11/15 | ||||
| 12/15 | R-b | |||
| 13/15 | ||||
| 14/15 | ||||
| 15/15 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v3 00/15] KVM: x86: Add "governed" X86_FEATURE framework
Third and hopefully final version of the framework to manage and cache KVM-governed features, i.e. CPUID based features that require explicit KVM enabling and/or need to be queried semi-frequently by KVM.
This version is just the governed features patches, as I kept the TSC scaling patches in kvm-x86/misc but blasted away the goverend features with a forced push.
My plan is again to apply this quite quickly so that it can be used as a base for other series.
v3:
- "Drop" TSC scaling patches (already applied).
- Remove dead xsave_enabled code (snuck into v2 by a bad conflict resolution). [Zeng]
- Make kvm_is_governed_feature() return a bool. [Zeng]
- Collect a review. [Yuan]
v2:
- https://lore.kernel.org/all/[email protected]
- Add patches to clean up TSC scaling.
- Add a comment explaining the virtual VMLOAD/VMLAVE vs. SYSENTER on Intel madness.
- Use a governed feature for X86_FEATURE_VMX.
- Incorporate KVM capabilities into the main check-and-set helper. [Chao]
v1: https://lore.kernel.org/all/[email protected]
Sean Christopherson (15):
KVM: x86: Add a framework for enabling KVM-governed x86 features
KVM: x86/mmu: Use KVM-governed feature framework to track "GBPAGES
enabled"
KVM: VMX: Recompute "XSAVES enabled" only after CPUID update
KVM: VMX: Check KVM CPU caps, not just VMX MSR support, for XSAVE
enabling
KVM: VMX: Rename XSAVES control to follow KVM's preferred "ENABLE_XYZ"
KVM: x86: Use KVM-governed feature framework to track "XSAVES enabled"
KVM: nVMX: Use KVM-governed feature framework to track "nested VMX
enabled"
KVM: nSVM: Use KVM-governed feature framework to track "NRIPS enabled"
KVM: nSVM: Use KVM-governed feature framework to track "TSC scaling
enabled"
KVM: nSVM: Use KVM-governed feature framework to track "vVM{SAVE,LOAD}
enabled"
KVM: nSVM: Use KVM-governed feature framework to track "LBRv enabled"
KVM: nSVM: Use KVM-governed feature framework to track "Pause Filter
enabled"
KVM: nSVM: Use KVM-governed feature framework to track "vGIF enabled"
KVM: nSVM: Use KVM-governed feature framework to track "vNMI enabled"
KVM: x86: Disallow guest CPUID lookups when IRQs are disabled
arch/x86/include/asm/kvm_host.h | 20 ++++++++- arch/x86/include/asm/vmx.h | 2 +- arch/x86/kvm/cpuid.c | 34 ++++++++++++++++ arch/x86/kvm/cpuid.h | 46 +++++++++++++++++++++ arch/x86/kvm/governed_features.h | 21 ++++++++++ arch/x86/kvm/mmu/mmu.c | 20 ++------- arch/x86/kvm/svm/nested.c | 46 ++++++++++++--------- arch/x86/kvm/svm/svm.c | 59 +++++++++++++++------------ arch/x86/kvm/svm/svm.h | 16 ++------ arch/x86/kvm/vmx/capabilities.h | 2 +- arch/x86/kvm/vmx/hyperv.c | 2 +- arch/x86/kvm/vmx/nested.c | 13 +++--- arch/x86/kvm/vmx/nested.h | 2 +- arch/x86/kvm/vmx/vmx.c | 69 ++++++++++++++------------------ arch/x86/kvm/vmx/vmx.h | 3 +- arch/x86/kvm/x86.c | 4 +- 16 files changed, 232 insertions(+), 127 deletions(-) create mode 100644 arch/x86/kvm/governed_features.h
base-commit: aaf44a3a699309c77537d0abf49411f9dc7dc523
Signature · 1 line
2.41.0.694.ge786442a9b-goog