]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: uapi: Drop PSR_ENDSTATE
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Wed, 14 Jan 2026 07:28:14 +0000 (08:28 +0100)
committerArnd Bergmann <arnd@arndb.de>
Fri, 30 Jan 2026 15:46:17 +0000 (16:46 +0100)
The symbol PSR_ENDSTATE is pointless for userspace. Drop it from the
UAPI headers and instead inline it into the only two callers.

As as side-effect, remove a leak of an internal kconfig symbol through
the UAPI headers.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/lkml/d2ad12f2-3d65-4bef-890c-65d78a33d790@app.fastmail.com/
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
arch/arm/include/asm/processor.h
arch/arm/include/uapi/asm/ptrace.h
arch/arm/kernel/signal.c
scripts/headers_install.sh

index 326864f79d18fe035a1e3b499b7185f8ca53caa7..bba83228bc229c96a6e898dbac0109d5afea7e04 100644 (file)
@@ -73,7 +73,8 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset,
                regs->ARM_cpsr = USR26_MODE;                            \
        if (elf_hwcap & HWCAP_THUMB && pc & 1)                          \
                regs->ARM_cpsr |= PSR_T_BIT;                            \
-       regs->ARM_cpsr |= PSR_ENDSTATE;                                 \
+       if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8))                          \
+               regs->ARM_cpsr |= PSR_E_BIT;                            \
        regs->ARM_pc = pc & ~1;         /* pc */                        \
        regs->ARM_sp = sp;              /* sp */                        \
 })
index 8896c23ccba78ed7e10c7d1b9955124314496dc6..2ef917957005cb1f9b7fc2dbcf3797a1a665a92b 100644 (file)
 #define PSR_IT_MASK    0x0600fc00      /* If-Then execution state mask */
 #define PSR_ENDIAN_MASK        0x00000200      /* Endianness state mask */
 
-/*
- * Default endianness state
- */
-#ifdef CONFIG_CPU_ENDIAN_BE8
-#define PSR_ENDSTATE   PSR_E_BIT
-#else
-#define PSR_ENDSTATE   0
-#endif
-
 /* 
  * These are 'magic' values for PTRACE_PEEKUSR that return info about where a
  * process is located in memory.
index 79a6730fa0eb7d6581343bdbbeb6834dcaabb9f8..7be9188d83d988a58980fd2184fb4e06db97af0f 100644 (file)
@@ -337,7 +337,8 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
                        return 1;
        }
 
-       cpsr |= PSR_ENDSTATE;
+       if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8))
+               cpsr |= PSR_E_BIT;
 
        /*
         * Maybe we need to deliver a 32-bit signal to a 26-bit task.
index 727f7f82c2c72142ea872cd8983ffa96097456b8..4f03521f4026c881955a465ccb75f67f067d400c 100755 (executable)
@@ -70,7 +70,6 @@ configs=$(sed -e '
 #
 # The format is <file-name>:<CONFIG-option> in each line.
 config_leak_ignores="
-arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8
 arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO
 arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT
 arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION