public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 00/15] KVM: x86: Add "governed" X86_FEATURE framework
@ 2023-08-15 20:36 Sean Christopherson
  2023-08-15 20:36 ` [PATCH v3 01/15] KVM: x86: Add a framework for enabling KVM-governed x86 features Sean Christopherson
                   ` (15 more replies)
  0 siblings, 16 replies; 38+ messages in thread
From: Sean Christopherson @ 2023-08-15 20:36 UTC (permalink / raw)
  To: Sean Christopherson, Paolo Bonzini, Vitaly Kuznetsov
  Cc: kvm, linux-kernel, Zeng Guang, Yuan Yao

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/20230729011608.1065019-1-seanjc@google.com
 - 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/20230217231022.816138-1-seanjc@google.com

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
-- 
2.41.0.694.ge786442a9b-goog


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2023-08-18  0:11 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-15 20:36 [PATCH v3 00/15] KVM: x86: Add "governed" X86_FEATURE framework Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 01/15] KVM: x86: Add a framework for enabling KVM-governed x86 features Sean Christopherson
2023-08-16  1:36   ` Huang, Kai
2023-08-16 14:20     ` Sean Christopherson
2023-08-16 22:46       ` Huang, Kai
2023-08-16 23:01   ` Yuan Yao
2023-08-17  2:11   ` Binbin Wu
2023-08-15 20:36 ` [PATCH v3 02/15] KVM: x86/mmu: Use KVM-governed feature framework to track "GBPAGES enabled" Sean Christopherson
2023-08-16  2:10   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 03/15] KVM: VMX: Recompute "XSAVES enabled" only after CPUID update Sean Christopherson
2023-08-16  2:26   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 04/15] KVM: VMX: Check KVM CPU caps, not just VMX MSR support, for XSAVE enabling Sean Christopherson
2023-08-16  8:07   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 05/15] KVM: VMX: Rename XSAVES control to follow KVM's preferred "ENABLE_XYZ" Sean Christopherson
2023-08-16  7:50   ` Vitaly Kuznetsov
2023-08-16 14:15     ` Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 06/15] KVM: x86: Use KVM-governed feature framework to track "XSAVES enabled" Sean Christopherson
2023-08-16  2:58   ` Yuan Yao
2023-08-16  3:21     ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 07/15] KVM: nVMX: Use KVM-governed feature framework to track "nested VMX enabled" Sean Christopherson
2023-08-16  2:25   ` Huang, Kai
2023-08-16  2:45   ` Huang, Kai
2023-08-16 14:42     ` Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 08/15] KVM: nSVM: Use KVM-governed feature framework to track "NRIPS enabled" Sean Christopherson
2023-08-16  6:18   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 09/15] KVM: nSVM: Use KVM-governed feature framework to track "TSC scaling enabled" Sean Christopherson
2023-08-16  6:35   ` Yuan Yao
2023-08-16 13:44     ` Sean Christopherson
2023-08-16 23:03       ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 10/15] KVM: nSVM: Use KVM-governed feature framework to track "vVM{SAVE,LOAD} enabled" Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 11/15] KVM: nSVM: Use KVM-governed feature framework to track "LBRv enabled" Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 12/15] KVM: nSVM: Use KVM-governed feature framework to track "Pause Filter enabled" Sean Christopherson
2023-08-16  7:24   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 13/15] KVM: nSVM: Use KVM-governed feature framework to track "vGIF enabled" Sean Christopherson
2023-08-16  7:27   ` Yuan Yao
2023-08-15 20:36 ` [PATCH v3 14/15] KVM: nSVM: Use KVM-governed feature framework to track "vNMI enabled" Sean Christopherson
2023-08-15 20:36 ` [PATCH v3 15/15] KVM: x86: Disallow guest CPUID lookups when IRQs are disabled Sean Christopherson
2023-08-18  0:09 ` [PATCH v3 00/15] KVM: x86: Add "governed" X86_FEATURE framework Sean Christopherson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox