Skip to content

Commit 49d7819

Browse files
t-8charndb
authored andcommitted
ARM: uapi: Drop PSR_ENDSTATE
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>
1 parent b4171fd commit 49d7819

4 files changed

Lines changed: 4 additions & 12 deletions

File tree

arch/arm/include/asm/processor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset,
7373
regs->ARM_cpsr = USR26_MODE; \
7474
if (elf_hwcap & HWCAP_THUMB && pc & 1) \
7575
regs->ARM_cpsr |= PSR_T_BIT; \
76-
regs->ARM_cpsr |= PSR_ENDSTATE; \
76+
if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8)) \
77+
regs->ARM_cpsr |= PSR_E_BIT; \
7778
regs->ARM_pc = pc & ~1; /* pc */ \
7879
regs->ARM_sp = sp; /* sp */ \
7980
})

arch/arm/include/uapi/asm/ptrace.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,6 @@
102102
#define PSR_IT_MASK 0x0600fc00 /* If-Then execution state mask */
103103
#define PSR_ENDIAN_MASK 0x00000200 /* Endianness state mask */
104104

105-
/*
106-
* Default endianness state
107-
*/
108-
#ifdef CONFIG_CPU_ENDIAN_BE8
109-
#define PSR_ENDSTATE PSR_E_BIT
110-
#else
111-
#define PSR_ENDSTATE 0
112-
#endif
113-
114105
/*
115106
* These are 'magic' values for PTRACE_PEEKUSR that return info about where a
116107
* process is located in memory.

arch/arm/kernel/signal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
337337
return 1;
338338
}
339339

340-
cpsr |= PSR_ENDSTATE;
340+
if (IS_ENABLED(CONFIG_CPU_ENDIAN_BE8))
341+
cpsr |= PSR_E_BIT;
341342

342343
/*
343344
* Maybe we need to deliver a 32-bit signal to a 26-bit task.

scripts/headers_install.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ configs=$(sed -e '
7070
#
7171
# The format is <file-name>:<CONFIG-option> in each line.
7272
config_leak_ignores="
73-
arch/arm/include/uapi/asm/ptrace.h:CONFIG_CPU_ENDIAN_BE8
7473
arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_NO
7574
arch/nios2/include/uapi/asm/swab.h:CONFIG_NIOS2_CI_SWAB_SUPPORT
7675
arch/x86/include/uapi/asm/auxvec.h:CONFIG_IA32_EMULATION

0 commit comments

Comments
 (0)