kernel_samsung_a53x/arch/x86/kvm
Sean Christopherson f1e091e52c KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN
commit aa0d42cacf093a6fcca872edc954f6f812926a17 upstream.

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: f99e3daf94ff ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-12-17 13:20:51 +01:00
..
mmu KVM: use __vcalloc for very large allocations 2024-11-18 12:12:59 +01:00
svm KVM: nSVM: Ignore nCR3[4:0] when loading PDPTEs from memory 2024-11-23 23:22:01 +01:00
vmx KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN 2024-12-17 13:20:51 +01:00
cpuid.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cpuid.h x86/cpufeatures: Add CPUID_LNX_5 to track recently added Linux-defined word 2024-11-19 09:23:11 +01:00
debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
emulate.c x86: Share definition of __is_canonical_address() 2024-11-18 11:43:11 +01:00
hyperv.c KVM: x86: hyper-v: Don't auto-enable stimer on write from user-space 2024-11-18 11:43:21 +01:00
hyperv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i8254.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i8254.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
i8259.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioapic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioapic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
irq_comm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kvm_cache_regs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kvm_emulate.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
lapic.c KVM: x86: Mask LVTPC when handling a PMI 2024-11-08 11:26:08 +01:00
lapic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mmu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mtrr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmu.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pmu.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
tss.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
x86.c KVM: x86: Clear "has_error_code", not "error_code", for RM exception injection 2024-11-19 12:26:38 +01:00
x86.h x86: Share definition of __is_canonical_address() 2024-11-18 11:43:11 +01:00