@@ -462,32 +462,6 @@ config GOLDFISH
462
462
def_bool y
463
463
depends on X86_GOLDFISH
464
464
465
- config RETPOLINE
466
- bool "Avoid speculative indirect branches in kernel"
467
- select OBJTOOL if HAVE_OBJTOOL
468
- default y
469
- help
470
- Compile kernel with the retpoline compiler options to guard against
471
- kernel-to-user data leaks by avoiding speculative indirect
472
- branches. Requires a compiler with -mindirect-branch=thunk-extern
473
- support for full protection. The kernel may run slower.
474
-
475
- config CC_HAS_SLS
476
- def_bool $(cc-option,-mharden-sls=all)
477
-
478
- config CC_HAS_RETURN_THUNK
479
- def_bool $(cc-option,-mfunction-return=thunk-extern)
480
-
481
- config SLS
482
- bool "Mitigate Straight-Line-Speculation"
483
- depends on CC_HAS_SLS && X86_64
484
- select OBJTOOL if HAVE_OBJTOOL
485
- default n
486
- help
487
- Compile the kernel with straight-line-speculation options to guard
488
- against straight line speculation. The kernel image might be slightly
489
- larger.
490
-
491
465
config X86_CPU_RESCTRL
492
466
bool "x86 CPU resource control support"
493
467
depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
@@ -2456,6 +2430,91 @@ source "kernel/livepatch/Kconfig"
2456
2430
2457
2431
endmenu
2458
2432
2433
+ config CC_HAS_SLS
2434
+ def_bool $(cc-option,-mharden-sls=all)
2435
+
2436
+ config CC_HAS_RETURN_THUNK
2437
+ def_bool $(cc-option,-mfunction-return=thunk-extern)
2438
+
2439
+ menuconfig SPECULATION_MITIGATIONS
2440
+ bool "Mitigations for speculative execution vulnerabilities"
2441
+ default y
2442
+ help
2443
+ Say Y here to enable options which enable mitigations for
2444
+ speculative execution hardware vulnerabilities.
2445
+
2446
+ If you say N, all mitigations will be disabled. You really
2447
+ should know what you are doing to say so.
2448
+
2449
+ if SPECULATION_MITIGATIONS
2450
+
2451
+ config PAGE_TABLE_ISOLATION
2452
+ bool "Remove the kernel mapping in user mode"
2453
+ default y
2454
+ depends on (X86_64 || X86_PAE)
2455
+ help
2456
+ This feature reduces the number of hardware side channels by
2457
+ ensuring that the majority of kernel addresses are not mapped
2458
+ into userspace.
2459
+
2460
+ See Documentation/x86/pti.rst for more details.
2461
+
2462
+ config RETPOLINE
2463
+ bool "Avoid speculative indirect branches in kernel"
2464
+ select OBJTOOL if HAVE_OBJTOOL
2465
+ default y
2466
+ help
2467
+ Compile kernel with the retpoline compiler options to guard against
2468
+ kernel-to-user data leaks by avoiding speculative indirect
2469
+ branches. Requires a compiler with -mindirect-branch=thunk-extern
2470
+ support for full protection. The kernel may run slower.
2471
+
2472
+ config RETHUNK
2473
+ bool "Enable return-thunks"
2474
+ depends on RETPOLINE && CC_HAS_RETURN_THUNK
2475
+ select OBJTOOL if HAVE_OBJTOOL
2476
+ default y
2477
+ help
2478
+ Compile the kernel with the return-thunks compiler option to guard
2479
+ against kernel-to-user data leaks by avoiding return speculation.
2480
+ Requires a compiler with -mfunction-return=thunk-extern
2481
+ support for full protection. The kernel may run slower.
2482
+
2483
+ config CPU_UNRET_ENTRY
2484
+ bool "Enable UNRET on kernel entry"
2485
+ depends on CPU_SUP_AMD && RETHUNK
2486
+ default y
2487
+ help
2488
+ Compile the kernel with support for the retbleed=unret mitigation.
2489
+
2490
+ config CPU_IBPB_ENTRY
2491
+ bool "Enable IBPB on kernel entry"
2492
+ depends on CPU_SUP_AMD
2493
+ default y
2494
+ help
2495
+ Compile the kernel with support for the retbleed=ibpb mitigation.
2496
+
2497
+ config CPU_IBRS_ENTRY
2498
+ bool "Enable IBRS on kernel entry"
2499
+ depends on CPU_SUP_INTEL
2500
+ default y
2501
+ help
2502
+ Compile the kernel with support for the spectre_v2=ibrs mitigation.
2503
+ This mitigates both spectre_v2 and retbleed at great cost to
2504
+ performance.
2505
+
2506
+ config SLS
2507
+ bool "Mitigate Straight-Line-Speculation"
2508
+ depends on CC_HAS_SLS && X86_64
2509
+ select OBJTOOL if HAVE_OBJTOOL
2510
+ default n
2511
+ help
2512
+ Compile the kernel with straight-line-speculation options to guard
2513
+ against straight line speculation. The kernel image might be slightly
2514
+ larger.
2515
+
2516
+ endif
2517
+
2459
2518
config ARCH_HAS_ADD_PAGES
2460
2519
def_bool y
2461
2520
depends on ARCH_ENABLE_MEMORY_HOTPLUG
0 commit comments