kernel-hacking-2024-linux-s.../arch/x86/kernel
Linus Torvalds 82eac0c830 Certain AMD processors are vulnerable to a cross-thread return address
predictions bug. When running in SMT mode and one of the sibling threads
 transitions out of C0 state, the other thread gets access to twice as many
 entries in the RSB, but unfortunately the predictions of the now-halted
 logical processor are not purged.  Therefore, the executing processor
 could speculatively execute from locations that the now-halted processor
 had trained the RSB on.
 
 The Spectre v2 mitigations cover the Linux kernel, as it fills the RSB
 when context switching to the idle thread. However, KVM allows a VMM to
 prevent exiting guest mode when transitioning out of C0 using the
 KVM_CAP_X86_DISABLE_EXITS capability can be used by a VMM to change this
 behavior. To mitigate the cross-thread return address predictions bug,
 a VMM must not be allowed to override the default behavior to intercept
 C0 transitions.
 
 These patches introduce a KVM module parameter that, if set, will prevent
 the user from disabling the HLT, MWAIT and CSTATE exits.
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmPrvAAUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroMQAgf8CirL+yrngzQ+39UTFQgXj3IS1UyR
 o2mF39w3bVlQhLNf5MBHF965FUeOV/8A16x73hJGjhiiuisphtQWS/6xKR6uYbq7
 0Qi821skqN6XpRsWTWqFHMsdY+n0skr8QeXG4k/GJu7Ghb3tqs4eTGgnf2WBfI8/
 K1UgTmjd9+ikM5gKZoVLpcqZnti0gx3lM+cvZGdfrIUaXB+i+hNd2NfRTiGsTOiK
 fX7vZtLvOeje2TPoKLhzekTbh8kTU07HRWID9aVXT8bLy6Zd6tg2CHlv11noKpwv
 DFVV+RsJ1SiAQYSwT+4IvWfIG4oq4onBQ972g2a27pP2cxF+38GXzt4NQw==
 =xscg
 -----END PGP SIGNATURE-----

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm

Pull kvm fixes from Paolo Bonzini:
 "Certain AMD processors are vulnerable to a cross-thread return address
  predictions bug. When running in SMT mode and one of the sibling
  threads transitions out of C0 state, the other thread gets access to
  twice as many entries in the RSB, but unfortunately the predictions of
  the now-halted logical processor are not purged. Therefore, the
  executing processor could speculatively execute from locations that
  the now-halted processor had trained the RSB on.

  The Spectre v2 mitigations cover the Linux kernel, as it fills the RSB
  when context switching to the idle thread. However, KVM allows a VMM
  to prevent exiting guest mode when transitioning out of C0 using the
  KVM_CAP_X86_DISABLE_EXITS capability can be used by a VMM to change
  this behavior. To mitigate the cross-thread return address predictions
  bug, a VMM must not be allowed to override the default behavior to
  intercept C0 transitions.

  These patches introduce a KVM module parameter that, if set, will
  prevent the user from disabling the HLT, MWAIT and CSTATE exits"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
  Documentation/hw-vuln: Add documentation for Cross-Thread Return Predictions
  KVM: x86: Mitigate the cross-thread return address predictions bug
  x86/speculation: Identify processors vulnerable to SMT RSB predictions
2023-02-14 09:17:01 -08:00
..
acpi x86/acpi/cstate: Optimize ARB_DISABLE on Centaur CPUs 2022-11-11 09:42:05 -08:00
apic A set of changes for the x86 APIC code: 2022-12-12 12:30:31 -08:00
cpu x86/speculation: Identify processors vulnerable to SMT RSB predictions 2023-02-10 06:43:03 -05:00
fpu * Clarify XSAVE consistency warnings 2022-12-12 14:41:57 -08:00
kprobes x86/kprobes: Fix 1 byte conditional jump target 2023-02-08 12:03:27 -08:00
.gitignore
alternative.c New Feature: 2022-12-17 14:06:53 -06:00
amd_gart_64.c x86/mm: Remove P*D_PAGE_MASK and P*D_PAGE_SIZE macros 2022-12-15 10:37:27 -08:00
amd_nb.c x86/amd_nb: Add AMD PCI IDs for SMN communication 2022-07-20 17:35:40 +02:00
aperture_64.c x86: Fix various duplicate-word comment typos 2022-08-15 19:17:52 +02:00
apm_32.c
asm-offsets.c Linux 6.1-rc6 2022-11-21 23:01:51 +01:00
asm-offsets_32.c
asm-offsets_64.c x86: Fixup asm-offsets duplicate 2022-10-17 16:41:06 +02:00
audit_64.c
bootflag.c
callthunks.c x86/calldepth: Fix incorrect init section references 2022-12-27 12:51:58 +01:00
cfi.c x86: Add support for CONFIG_CFI_CLANG 2022-09-26 10:13:16 -07:00
check.c
cpuid.c driver core: make struct class.devnode() take a const * 2022-11-24 17:12:27 +01:00
crash.c x86/kexec: Fix double-free of elf header buffer 2023-01-02 18:56:21 +01:00
crash_core_32.c
crash_core_64.c
crash_dump_32.c vmcore: convert copy_oldmem_page() to take an iov_iter 2022-04-29 14:37:59 -07:00
crash_dump_64.c use less confusing names for iov_iter direction initializers 2022-11-25 13:01:55 -05:00
devicetree.c x86/of: Add support for boot time interrupt delivery mode configuration 2022-12-02 14:57:14 +01:00
doublefault_32.c
dumpstack.c - Yu Zhao's Multi-Gen LRU patches are here. They've been under test in 2022-10-10 17:53:04 -07:00
dumpstack_32.c x86/percpu: Move irq_stack variables next to current_task 2022-10-17 16:41:05 +02:00
dumpstack_64.c x86/percpu: Move irq_stack variables next to current_task 2022-10-17 16:41:05 +02:00
e820.c x86/kexec: Carry forward IMA measurement log on kexec 2022-07-01 15:22:16 +02:00
early-quirks.c drm/i915/rpl-p: Add PCI IDs 2022-04-19 17:14:09 -07:00
early_printk.c x86/earlyprintk: Clean up pciserial 2022-08-29 12:19:25 +02:00
ebda.c
eisa.c
espfix_64.c x86/espfix: Use get_random_long() rather than archrandom 2022-10-31 20:12:50 +01:00
ftrace.c New Feature: 2022-12-17 14:06:53 -06:00
ftrace_32.S
ftrace_64.S Merge branch 'x86/urgent' into x86/core, to resolve conflict 2022-10-22 10:06:18 +02:00
head32.c
head64.c x86/mm: Remove P*D_PAGE_MASK and P*D_PAGE_SIZE macros 2022-12-15 10:37:27 -08:00
head_32.S x86/asm/32: Remove setup_once() 2022-12-02 14:06:34 +01:00
head_64.S x86/callthunks: Add call patching for call depth tracking 2022-10-17 16:41:13 +02:00
hpet.c
hw_breakpoint.c x86/mm: Randomize per-cpu entry area 2022-12-15 10:37:26 -08:00
i8237.c
i8253.c
i8259.c x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL 2023-01-16 17:24:56 +01:00
idt.c
io_delay.c
ioport.c
irq.c
irq_32.c x86/percpu: Move irq_stack variables next to current_task 2022-10-17 16:41:05 +02:00
irq_64.c x86/percpu: Move irq_stack variables next to current_task 2022-10-17 16:41:05 +02:00
irq_work.c
irqflags.S
irqinit.c x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL 2023-01-16 17:24:56 +01:00
itmt.c
jailhouse.c
jump_label.c jump_label: make initial NOP patching the special case 2022-06-24 09:48:55 +02:00
kdebugfs.c
kexec-bzimage64.c integrity-v6.0 2022-08-02 15:21:18 -07:00
kgdb.c
ksysfs.c
kvm.c ARM64: 2022-12-15 11:12:21 -08:00
kvmclock.c x86/kvm: Don't waste kvmclock memory if there is nopv parameter 2022-04-13 13:37:19 -04:00
ldt.c
machine_kexec_32.c
machine_kexec_64.c x86/kexec: fix memory leak of elf header buffer 2022-06-01 15:57:16 -07:00
Makefile - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
mmconf-fam10h_64.c
module.c - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
mpparse.c
msr.c driver core: make struct class.devnode() take a const * 2022-11-24 17:12:27 +01:00
nmi.c x86/nmi: Make register_nmi_handler() more robust 2022-05-17 09:25:25 +02:00
nmi_selftest.c
paravirt-spinlocks.c
paravirt.c x86/paravirt: Use common macro for creating simple asm paravirt functions 2022-11-24 13:56:44 +01:00
pci-dma.c swiotlb: merge swiotlb-xen initialization into swiotlb 2022-04-18 07:21:13 +02:00
pcspeaker.c
perf_regs.c
platform-quirks.c
pmem.c x86/pmem: Fix platform-device leak in error path 2022-06-20 18:01:16 +02:00
probe_roms.c
process.c Random number generator updates for Linux 6.2-rc1. 2022-12-12 16:22:22 -08:00
process.h
process_32.c x86/percpu: Move current_top_of_stack next to current_task 2022-10-17 16:41:05 +02:00
process_64.c - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
ptrace.c x86: Improve formatting of user_regset arrays 2022-11-01 15:36:52 -07:00
pvclock.c
quirks.c
reboot.c x86: Use do_kernel_power_off() 2022-05-19 19:30:31 +02:00
reboot_fixups_32.c
relocate_kernel_32.S x86/kexec: Disable RET on kexec 2022-07-09 13:12:32 +02:00
relocate_kernel_64.S x86/callthunks: Add call patching for call depth tracking 2022-10-17 16:41:13 +02:00
resource.c x86/PCI: Tidy E820 removal messages 2022-12-10 10:33:11 -06:00
rethook.c
rtc.c x86/rtc: Rename mach_set_rtc_mmss() to mach_set_cmos_time() 2022-08-14 11:24:29 +02:00
setup.c - Split MTRR and PAT init code to accomodate at least Xen PV and TDX 2022-12-13 14:56:56 -08:00
setup_percpu.c - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
sev-shared.c Revert "x86/sev: Expose sev_es_ghcb_hv_call() for use by HyperV" 2022-07-27 18:09:13 +02:00
sev.c x86/insn: Avoid namespace clash by separating instruction decoder MMIO type from MMIO trace type 2023-01-03 18:46:06 +01:00
sev_verify_cbit.S
signal.c x86/signal/64: Move 64-bit signal code to its own file 2022-10-19 09:58:49 +02:00
signal_32.c x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
signal_64.c x86/signal/64: Move 64-bit signal code to its own file 2022-10-19 09:58:49 +02:00
signal_compat.c signal: Deliver SIGTRAP on perf event asynchronously if blocked 2022-04-22 12:14:05 +02:00
smp.c
smpboot.c - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
stacktrace.c
static_call.c static_call: Add call depth tracking support 2022-10-17 16:41:16 +02:00
step.c ptrace: Reimplement PTRACE_KILL by always sending SIGKILL 2022-05-11 14:34:28 -05:00
sys_ia32.c
sys_x86_64.c x86/mm: Cleanup the control_va_addr_alignment() __setup handler 2022-05-04 18:20:42 +02:00
tboot.c mm: remove rb tree. 2022-09-26 19:46:16 -07:00
time.c
tls.c
tls.h
topology.c x86/cpu: Switch to cpu_feature_enabled() for X86_FEATURE_XENPV 2022-11-22 16:18:19 +01:00
trace.c
trace_clock.c
tracepoint.c x86/traceponit: Fix comment about irq vector tracepoints 2022-05-26 22:03:52 -04:00
traps.c - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
tsc.c x86/tsc: Make art_related_clocksource static 2022-10-17 16:20:48 +02:00
tsc_msr.c
tsc_sync.c
umip.c
unwind_frame.c x86: kmsan: don't instrument stack walking functions 2022-10-03 14:03:25 -07:00
unwind_guess.c
unwind_orc.c Linux 6.1-rc6 2022-11-21 23:01:51 +01:00
uprobes.c uprobes/x86: Allow to probe a NOP instruction with 0x66 prefix 2022-12-05 11:55:18 +01:00
verify_cpu.S
vm86_32.c x86/32: Remove lazy GS macros 2022-04-14 14:09:43 +02:00
vmlinux.lds.S x86/ibt: Implement FineIBT 2022-11-01 13:44:10 +01:00
vsmp_64.c
x86_init.c x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00