RE: [RFC PATCH v3 6/8] arm64: Add a compat syscall flag to thread_info
From: David Laight <hidden>
Date: 2021-04-22 08:40:40
From: Amanieu d'Antras
quoted hunk ↗ jump to hunk
Sent: 21 April 2021 20:02 This flag is used by in_compat_syscall to handle compat syscalls coming from 64-bit tasks. Signed-off-by: Amanieu d'Antras <redacted> Co-developed-by: Ryan Houdek <redacted> Signed-off-by: Ryan Houdek <redacted> --- arch/arm64/include/asm/compat.h | 5 +++-- arch/arm64/include/asm/elf.h | 13 ++++++++++++- arch/arm64/include/asm/thread_info.h | 3 +++ 3 files changed, 18 insertions(+), 3 deletions(-)diff --git a/arch/arm64/include/asm/compat.h b/arch/arm64/include/asm/compat.h index a2f5001f7793..71de0ba8b160 100644 --- a/arch/arm64/include/asm/compat.h +++ b/arch/arm64/include/asm/compat.h@@ -190,13 +190,14 @@ static inline bool is_compat_thread(struct thread_info *thread) static inline bool in_compat_syscall(void) { - return is_compat_task(); + return is_compat_task() || + current_thread_info()->aarch64_compat_syscall; }
... Wouldn't it be better to ensure that a 'compat_task' always has aarch64_compat_syscall set. If you can't do that, just replacing the '||' with '|' will generate better code for the usual case of both flags being clear. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel