]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
arm64: remove CONFIG_VMAP_STACK checks from SDEI stack handling
authorBreno Leitao <leitao@debian.org>
Mon, 7 Jul 2025 16:01:07 +0000 (09:01 -0700)
committerWill Deacon <will@kernel.org>
Tue, 8 Jul 2025 12:41:09 +0000 (13:41 +0100)
With VMAP_STACK now always enabled on arm64, remove all
CONFIG_VMAP_STACK conditionals from SDEI stack allocation and
initialization in arch/arm64/kernel/sdei.c.

This change unconditionally defines the SDEI stack pointers and replaces
runtime checks with BUILD_BUG_ON() assertions, ensuring that the code is
only built when VMAP_STACK is enabled. This simplifies the logic and
reflects the mandatory use of VMAP_STACK for all arm64 kernel builds.

Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20250707-arm64_vmap-v1-7-8de98ca0f91c@debian.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/sdei.c

index 255d12f881c260460fb1b6fdff3e4b685bd9e9e8..6f24a0251e183756685654002b15199296d5dc27 100644 (file)
@@ -34,10 +34,8 @@ unsigned long sdei_exit_mode;
 DECLARE_PER_CPU(unsigned long *, sdei_stack_normal_ptr);
 DECLARE_PER_CPU(unsigned long *, sdei_stack_critical_ptr);
 
-#ifdef CONFIG_VMAP_STACK
 DEFINE_PER_CPU(unsigned long *, sdei_stack_normal_ptr);
 DEFINE_PER_CPU(unsigned long *, sdei_stack_critical_ptr);
-#endif
 
 DECLARE_PER_CPU(unsigned long *, sdei_shadow_call_stack_normal_ptr);
 DECLARE_PER_CPU(unsigned long *, sdei_shadow_call_stack_critical_ptr);
@@ -65,8 +63,7 @@ static void free_sdei_stacks(void)
 {
        int cpu;
 
-       if (!IS_ENABLED(CONFIG_VMAP_STACK))
-               return;
+       BUILD_BUG_ON(!IS_ENABLED(CONFIG_VMAP_STACK));
 
        for_each_possible_cpu(cpu) {
                _free_sdei_stack(&sdei_stack_normal_ptr, cpu);
@@ -91,8 +88,7 @@ static int init_sdei_stacks(void)
        int cpu;
        int err = 0;
 
-       if (!IS_ENABLED(CONFIG_VMAP_STACK))
-               return 0;
+       BUILD_BUG_ON(!IS_ENABLED(CONFIG_VMAP_STACK));
 
        for_each_possible_cpu(cpu) {
                err = _init_sdei_stack(&sdei_stack_normal_ptr, cpu);