hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/x86/Kconfig
....@@ -60,6 +60,7 @@
6060 select ARCH_32BIT_OFF_T if X86_32
6161 select ARCH_CLOCKSOURCE_INIT
6262 select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
63
+ select ARCH_HAS_CPU_FINALIZE_INIT
6364 select ARCH_HAS_DEBUG_VIRTUAL
6465 select ARCH_HAS_DEBUG_VM_PGTABLE if !X86_PAE
6566 select ARCH_HAS_DEVMEM_IS_ALLOWED
....@@ -1336,17 +1337,16 @@
13361337 If you select this option, microcode patch loading support for AMD
13371338 processors will be enabled.
13381339
1339
-config MICROCODE_OLD_INTERFACE
1340
- bool "Ancient loading interface (DEPRECATED)"
1340
+config MICROCODE_LATE_LOADING
1341
+ bool "Late microcode loading (DANGEROUS)"
13411342 default n
13421343 depends on MICROCODE
13431344 help
1344
- DO NOT USE THIS! This is the ancient /dev/cpu/microcode interface
1345
- which was used by userspace tools like iucode_tool and microcode.ctl.
1346
- It is inadequate because it runs too late to be able to properly
1347
- load microcode on a machine and it needs special tools. Instead, you
1348
- should've switched to the early loading method with the initrd or
1349
- builtin microcode by now: Documentation/x86/microcode.rst
1345
+ Loading microcode late, when the system is up and executing instructions
1346
+ is a tricky business and should be avoided if possible. Just the sequence
1347
+ of synchronizing all cores and SMT threads is one fragile dance which does
1348
+ not guarantee that cores might not softlock after the loading. Therefore,
1349
+ use this at your own risk. Late loading taints the kernel too.
13501350
13511351 config X86_MSR
13521352 tristate "/dev/cpu/*/msr - Model-specific register support"
....@@ -2483,6 +2483,13 @@
24832483 This mitigates both spectre_v2 and retbleed at great cost to
24842484 performance.
24852485
2486
+config CPU_SRSO
2487
+ bool "Mitigate speculative RAS overflow on AMD"
2488
+ depends on CPU_SUP_AMD && X86_64 && RETHUNK
2489
+ default y
2490
+ help
2491
+ Enable the SRSO mitigation needed on AMD Zen1-4 machines.
2492
+
24862493 config SLS
24872494 bool "Mitigate Straight-Line-Speculation"
24882495 depends on CC_HAS_SLS && X86_64
....@@ -2492,6 +2499,25 @@
24922499 against straight line speculation. The kernel image might be slightly
24932500 larger.
24942501
2502
+config GDS_FORCE_MITIGATION
2503
+ bool "Force GDS Mitigation"
2504
+ depends on CPU_SUP_INTEL
2505
+ default n
2506
+ help
2507
+ Gather Data Sampling (GDS) is a hardware vulnerability which allows
2508
+ unprivileged speculative access to data which was previously stored in
2509
+ vector registers.
2510
+
2511
+ This option is equivalent to setting gather_data_sampling=force on the
2512
+ command line. The microcode mitigation is used if present, otherwise
2513
+ AVX is disabled as a mitigation. On affected systems that are missing
2514
+ the microcode any userspace code that unconditionally uses AVX will
2515
+ break with this option set.
2516
+
2517
+ Setting this option on systems not vulnerable to GDS has no effect.
2518
+
2519
+ If in doubt, say N.
2520
+
24952521 endif
24962522
24972523 config ARCH_HAS_ADD_PAGES