linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: simplify syscall wrapper ifdeffery
@ 2019-09-13 12:55 Mark Rutland
  2019-10-01 12:57 ` Will Deacon
  2019-10-01 16:02 ` Catalin Marinas
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Rutland @ 2019-09-13 12:55 UTC (permalink / raw)
  To: linux-arm-kernel; +Cc: Mark Rutland, Catalin Marinas, Will Deacon

Back in commit:

  4378a7d4be30ec69 ("arm64: implement syscall wrappers")

... I implemented the arm64 syscall wrapper glue following the approach
taken on x86. While doing so, I also copied across some ifdeffery that
isn't necessary on arm64.

On arm64 we don't share any of the native wrappers with compat tasks,
and unlike x86 we don't have alternative implementations of
SYSCALL_DEFINE0(), COND_SYSCALL(), or SYS_NI() defined when AArch32
compat support is enabled.

Thus we don't need to prevent multiple definitions of these macros, and
can remove the #ifndef ... #endif guards protecting them. If any of
these had been previously defined elsewhere, syscalls are unlikely to
work correctly, and we'd want the compiler to warn about the multiple
definitions.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
---
 arch/arm64/include/asm/syscall_wrapper.h | 6 ------
 1 file changed, 6 deletions(-)

Hi Will, Catalin,

This is based on Sami's patch [1] implementing a type-safe COND_SYSCALL on
arm64. I've given both a spin atop of today's arm64 for-next/core branch.

Mark.

[1] https://lore.kernel.org/r/20190910224044.100388-1-samitolvanen@google.com

diff --git a/arch/arm64/include/asm/syscall_wrapper.h b/arch/arm64/include/asm/syscall_wrapper.h
index 06d880b3526c..b383b4802a7b 100644
--- a/arch/arm64/include/asm/syscall_wrapper.h
+++ b/arch/arm64/include/asm/syscall_wrapper.h
@@ -66,24 +66,18 @@ struct pt_regs;
 	}									\
 	static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
 
-#ifndef SYSCALL_DEFINE0
 #define SYSCALL_DEFINE0(sname)							\
 	SYSCALL_METADATA(_##sname, 0);						\
 	asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused);	\
 	ALLOW_ERROR_INJECTION(__arm64_sys_##sname, ERRNO);			\
 	asmlinkage long __arm64_sys_##sname(const struct pt_regs *__unused)
-#endif
 
-#ifndef COND_SYSCALL
 #define COND_SYSCALL(name)							\
 	asmlinkage long __weak __arm64_sys_##name(const struct pt_regs *regs)	\
 	{									\
 		return sys_ni_syscall();					\
 	}
-#endif
 
-#ifndef SYS_NI
 #define SYS_NI(name) SYSCALL_ALIAS(__arm64_sys_##name, sys_ni_posix_timers);
-#endif
 
 #endif /* __ASM_SYSCALL_WRAPPER_H */
-- 
2.11.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: simplify syscall wrapper ifdeffery
  2019-09-13 12:55 [PATCH] arm64: simplify syscall wrapper ifdeffery Mark Rutland
@ 2019-10-01 12:57 ` Will Deacon
  2019-10-01 16:02 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2019-10-01 12:57 UTC (permalink / raw)
  To: Mark Rutland; +Cc: Catalin Marinas, linux-arm-kernel

On Fri, Sep 13, 2019 at 01:55:50PM +0100, Mark Rutland wrote:
> Back in commit:
> 
>   4378a7d4be30ec69 ("arm64: implement syscall wrappers")
> 
> ... I implemented the arm64 syscall wrapper glue following the approach
> taken on x86. While doing so, I also copied across some ifdeffery that
> isn't necessary on arm64.
> 
> On arm64 we don't share any of the native wrappers with compat tasks,
> and unlike x86 we don't have alternative implementations of
> SYSCALL_DEFINE0(), COND_SYSCALL(), or SYS_NI() defined when AArch32
> compat support is enabled.
> 
> Thus we don't need to prevent multiple definitions of these macros, and
> can remove the #ifndef ... #endif guards protecting them. If any of
> these had been previously defined elsewhere, syscalls are unlikely to
> work correctly, and we'd want the compiler to warn about the multiple
> definitions.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> ---
>  arch/arm64/include/asm/syscall_wrapper.h | 6 ------
>  1 file changed, 6 deletions(-)

Acked-by: Will Deacon <will@kernel.org>

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: simplify syscall wrapper ifdeffery
  2019-09-13 12:55 [PATCH] arm64: simplify syscall wrapper ifdeffery Mark Rutland
  2019-10-01 12:57 ` Will Deacon
@ 2019-10-01 16:02 ` Catalin Marinas
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2019-10-01 16:02 UTC (permalink / raw)
  To: Mark Rutland; +Cc: Will Deacon, linux-arm-kernel

On Fri, Sep 13, 2019 at 01:55:50PM +0100, Mark Rutland wrote:
> Back in commit:
> 
>   4378a7d4be30ec69 ("arm64: implement syscall wrappers")
> 
> ... I implemented the arm64 syscall wrapper glue following the approach
> taken on x86. While doing so, I also copied across some ifdeffery that
> isn't necessary on arm64.
> 
> On arm64 we don't share any of the native wrappers with compat tasks,
> and unlike x86 we don't have alternative implementations of
> SYSCALL_DEFINE0(), COND_SYSCALL(), or SYS_NI() defined when AArch32
> compat support is enabled.
> 
> Thus we don't need to prevent multiple definitions of these macros, and
> can remove the #ifndef ... #endif guards protecting them. If any of
> these had been previously defined elsewhere, syscalls are unlikely to
> work correctly, and we'd want the compiler to warn about the multiple
> definitions.
> 
> Signed-off-by: Mark Rutland <mark.rutland@arm.com>
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>

Queued for 5.5. Thanks.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-01 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 12:55 [PATCH] arm64: simplify syscall wrapper ifdeffery Mark Rutland
2019-10-01 12:57 ` Will Deacon
2019-10-01 16:02 ` Catalin Marinas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).