linux-next/arch/x86/kvm/vmx
Sean Christopherson aa0d42cacf KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN
Hide KVM's pt_mode module param behind CONFIG_BROKEN, i.e. disable support
for virtualizing Intel PT via guest/host mode unless BROKEN=y.  There are
myriad bugs in the implementation, some of which are fatal to the guest,
and others which put the stability and health of the host at risk.

For guest fatalities, the most glaring issue is that KVM fails to ensure
tracing is disabled, and *stays* disabled prior to VM-Enter, which is
necessary as hardware disallows loading (the guest's) RTIT_CTL if tracing
is enabled (enforced via a VMX consistency check).  Per the SDM:

  If the logical processor is operating with Intel PT enabled (if
  IA32_RTIT_CTL.TraceEn = 1) at the time of VM entry, the "load
  IA32_RTIT_CTL" VM-entry control must be 0.

On the host side, KVM doesn't validate the guest CPUID configuration
provided by userspace, and even worse, uses the guest configuration to
decide what MSRs to save/load at VM-Enter and VM-Exit.  E.g. configuring
guest CPUID to enumerate more address ranges than are supported in hardware
will result in KVM trying to passthrough, save, and load non-existent MSRs,
which generates a variety of WARNs, ToPA ERRORs in the host, a potential
deadlock, etc.

Fixes: f99e3daf94 ("KVM: x86: Add Intel PT virtualization work mode")
Cc: stable@vger.kernel.org
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Tested-by: Adrian Hunter <adrian.hunter@intel.com>
Message-ID: <20241101185031.1799556-2-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-11-08 05:57:13 -05:00
..
capabilities.h KVM VMX: Move MSR_IA32_VMX_MISC bit defines to asm/vmx.h 2024-08-22 11:25:53 -07:00
hyperv_evmcs.c KVM: VMX: Split off hyperv_evmcs.{ch} 2023-12-07 09:34:19 -08:00
hyperv_evmcs.h KVM: VMX: Split off hyperv_evmcs.{ch} 2023-12-07 09:34:19 -08:00
hyperv.c KVM: VMX: Split off hyperv_evmcs.{ch} 2023-12-07 09:34:19 -08:00
hyperv.h KVM: nVMX: Introduce accessor to get Hyper-V eVMCS pointer 2023-12-07 09:35:08 -08:00
main.c Merge tag 'kvm-x86-misc-6.12' of https://github.com/kvm-x86/linux into HEAD 2024-09-17 11:38:23 -04:00
nested.c KVM: nVMX: Treat vpid01 as current if L2 is active, but with VPID disabled 2024-11-04 21:10:49 -08:00
nested.h Merge tag 'kvm-x86-vmx-6.12' of https://github.com/kvm-x86/linux into HEAD 2024-09-17 12:41:23 -04:00
pmu_intel.c KVM: x86/pmu: Introduce distinct macros for GP/fixed counter max number 2024-06-28 09:12:16 -07:00
posted_intr.c x86/irq: Remove bitfields in posted interrupt descriptor 2024-04-30 00:54:42 +02:00
posted_intr.h KVM: nVMX: Add a helper to get highest pending from Posted Interrupt vector 2024-06-28 08:59:03 -07:00
run_flags.h KVM/VMX: Use BT+JNC, i.e. EFLAGS.CF to select VMRESUME vs. VMLAUNCH 2024-02-19 16:31:54 -08:00
sgx.c KVM: VMX: Do not account for temporary memory allocation in ECREATE emulation 2024-08-22 11:35:15 -07:00
sgx.h KVM: VMX: Enable SGX virtualization for SGX1, SGX2 and LC 2021-04-20 04:18:56 -04:00
vmcs12.c KVM: x86: Unify pr_fmt to use module name for all KVM modules 2022-12-29 15:47:35 -05:00
vmcs12.h KVM: nVMX: Update VMCS12_REVISION comment to state it should never change 2024-06-28 08:55:00 -07:00
vmcs_shadow_fields.h KVM: Fix some out-dated function names in comment 2020-01-21 13:57:27 +01:00
vmcs.h KVM: VMX: Introduce test mode related to EPT violation VE 2024-04-19 12:15:21 -04:00
vmenter.S x86/bhi: Mitigate KVM by default 2024-04-08 19:27:06 +02:00
vmx_onhyperv.c KVM: VMX: Split off vmx_onhyperv.{ch} from hyperv.{ch} 2023-12-07 09:34:06 -08:00
vmx_onhyperv.h KVM: VMX: hyper-v: Prevent impossible NULL pointer dereference in evmcs_load() 2024-08-22 11:35:18 -07:00
vmx_ops.h KVM: VMX: Modify the BUILD_BUG_ON_MSG of the 32-bit field in the vmcs_check16 function 2024-08-22 11:35:15 -07:00
vmx.c KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN 2024-11-08 05:57:13 -05:00
vmx.h Merge tag 'kvm-x86-vmx-6.12' of https://github.com/kvm-x86/linux into HEAD 2024-09-17 12:41:23 -04:00
x86_ops.h Merge tag 'kvm-x86-misc-6.12' of https://github.com/kvm-x86/linux into HEAD 2024-09-17 11:38:23 -04:00