[RFC][PATCH 15/24] x86/task: Hook up arch hook to detect shadow stack enabling

From: Dave Hansen

Date: Wed Oct 21 2026 - 15:54:45 EST



Provide an x86 definition for arch_kernel_shstk_enabled(), used in the
generic code to skip any attempts to clear shadow stack pages.

---

b/arch/x86/include/asm/thread_info.h | 6 ++++++
1 file changed, 6 insertions(+)

diff -puN arch/x86/include/asm/thread_info.h~x86-shadow-stacks-enabled arch/x86/include/asm/thread_info.h
--- a/arch/x86/include/asm/thread_info.h~x86-shadow-stacks-enabled 2026-10-21 12:36:39.920884876 -0700
+++ b/arch/x86/include/asm/thread_info.h 2026-10-21 12:36:39.922884879 -0700
@@ -231,6 +231,12 @@ extern void arch_setup_new_exec(void);
struct thread_stacks;
extern void arch_init_thread_stacks(struct thread_stacks *ts);
#define arch_init_thread_stacks arch_init_thread_stacks
+
+static inline bool arch_kernel_shstk_enabled(void)
+{
+ return cpu_feature_enabled(X86_FEATURE_KERN_SHSTK);
+}
+#define arch_kernel_shstk_enabled arch_kernel_shstk_enabled
#endif

#endif /* !__ASSEMBLER__ */
_