bianbu-linux-6.6/arch/x86
Sean Christopherson d28b059ee4 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-22 15:38:34 +01:00
..
boot x86/boot: Don't add the EFI stub to targets, again 2024-06-21 14:38:37 +02:00
coco x86/tdx: Fix "in-kernel MMIO" check 2024-10-04 16:30:05 +02:00
configs - The first, cleanup part of the microcode loader reorg tglx has been 2023-08-28 15:55:20 -07:00
crypto crypto: x86/sha256 - Add parentheses around macros' single arguments 2024-10-10 11:57:21 +02:00
entry x86/entry_32: Clear CPU buffers after register restore in NMI return 2024-10-22 15:46:34 +02:00
events perf,x86: avoid missing caller address in stack traces captured in uprobe 2024-10-10 11:57:36 +02:00
hyperv x86/hyperv: fix kexec crash due to VP assist page corruption 2024-09-18 19:24:07 +02:00
ia32
include x86/traps: Enable UBSAN traps on x86 2024-11-08 16:28:26 +01:00
kernel x86/traps: move kmsan check after instrumentation_begin 2024-11-08 16:28:26 +01:00
kvm KVM: VMX: Bury Intel PT virtualization (guest/host mode) behind CONFIG_BROKEN 2024-11-22 15:38:34 +01:00
lib x86/kmsan: Fix hook for unaligned accesses 2024-09-12 11:11:29 +02:00
math-emu
mm x86/mm: Fix a kdump kernel failure on SME system when CONFIG_IMA_KEXEC=y 2024-11-22 15:38:33 +01:00
net bpf, x64: Fix a jit convergence issue 2024-10-17 15:24:15 +02:00
pci x86/PCI: Check pcie_find_root_port() return for NULL 2024-10-04 16:29:29 +02:00
platform x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos 2024-08-03 08:53:21 +02:00
power mm/treewide: replace pud_large() with pud_leaf() 2024-04-10 16:35:46 +02:00
purgatory x86/purgatory: Switch to the position-independent small code model 2024-06-12 11:11:43 +02:00
ras
realmode
tools x86/boot: Ignore relocations in .notes sections in walk_relocs() too 2024-06-12 11:11:36 +02:00
um um: Fix the -Wmissing-prototypes warning for get_thread_reg 2024-06-12 11:12:42 +02:00
video
virt/vmx/tdx
xen xen: allow mapping ACPI data using a different physical address 2024-10-04 16:29:43 +02:00
.gitignore
Kbuild
Kconfig x86/lam: Disable ADDRESS_MASKING in most cases 2024-11-01 01:58:33 +01:00
Kconfig.assembler x86/kconfig: Add as-instr64 macro to properly evaluate AS_WRUSS 2024-08-03 08:53:21 +02:00
Kconfig.cpu x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6 2024-02-23 09:25:10 +01:00
Kconfig.debug x86/kconfig: Select ARCH_WANT_FRAME_POINTERS again when UNWINDER_FRAME_POINTER=y 2024-06-12 11:12:46 +02:00
Makefile kbuild: unify vdso_install rules 2024-06-12 11:12:32 +02:00
Makefile.postlink
Makefile.um
Makefile_32.cpu