x86/Kconfig: Add CONFIG_CALL_THUNKS
authorThomas Gleixner <tglx@linutronix.de>
Thu, 15 Sep 2022 11:11:17 +0000 (13:11 +0200)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 17 Oct 2022 14:41:10 +0000 (16:41 +0200)
In preparation for mitigating the Intel SKL RSB underflow issue in
software, add a new configuration symbol which allows to build the
required call thunk infrastructure conditionally.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111146.849523555@infradead.org
arch/x86/Kconfig

index f408fa87ed94760194db4f0fead0834ee17dec65..e18963e77cb1d6971230561784944b1432159699 100644 (file)
@@ -2446,6 +2446,14 @@ config CC_HAS_SLS
 config CC_HAS_RETURN_THUNK
        def_bool $(cc-option,-mfunction-return=thunk-extern)
 
+config HAVE_CALL_THUNKS
+       def_bool y
+       depends on RETHUNK && OBJTOOL
+
+config CALL_THUNKS
+       def_bool n
+       select FUNCTION_ALIGNMENT_16B
+
 menuconfig SPECULATION_MITIGATIONS
        bool "Mitigations for speculative execution vulnerabilities"
        default y