[PATCH RFC v1 0/5] KVM: VMX: Support TscScaling and EnclsExitingBitmap whith eVMCS

From: Vitaly Kuznetsov
Date: Wed Jun 15 2022 - 08:49:37 EST


Enlightened VMCS v1 definition was updates to include fields for the
following features:
- PerfGlobalCtrl
- EnclsExitingBitmap
- TSC scaling
- GuestLbrCtl
- CET
- SSP

Add support for EnclsExitingBitmap and TSC scaling to KVM. PerfGlobalCtrl
doesn't work correctly with Win11, don't enable it yet. SSP, CET and
GuestLbrCtl are not currently supported by KVM.

RFC part: the change dropping SECONDARY_EXEC_TSC_SCALING from
EVMCS1_UNSUPPORTED_2NDEXEC likely breaks migration for Hyper-V on KVM: in
case guest which started on a 'fixed' KVM and uses TSC multiplier feature
gets migrated to an older 'unfixed' KVM the feature will become unusable.
Unfortunately, eVMCS's version is still '1' so we probably need a new
CAP in KVM to make TSC scaling an explicit opt-in.

Vitaly Kuznetsov (5):
x86/hyperv: Fix 'struct hv_enlightened_vmcs' definition
x86/hyperv: Update 'struct hv_enlightened_vmcs' definition
KVM: VMX: Define VMCS-to-EVMCS conversion for the new fields
KVM: nVMX: Support several new fields in eVMCSv1
KVM: VMX: Support TSC scaling with enlightened VMCS

arch/x86/include/asm/hyperv-tlfs.h | 19 ++++++++++++++----
arch/x86/kvm/vmx/evmcs.c | 26 +++++++++++++++++++++++++
arch/x86/kvm/vmx/evmcs.h | 11 ++++-------
arch/x86/kvm/vmx/nested.c | 31 ++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+), 11 deletions(-)

--
2.35.3