2020-01-02 17:25:14

by Amanieu d'Antras

[permalink] [raw]
Subject: [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers

Previously this was only defined in the internal headers which
resulted in __NR_clone3 not being defined in the user headers.

Signed-off-by: Amanieu d'Antras <[email protected]>
Cc: [email protected]
Cc: <[email protected]> # 5.3.x
---
arch/arm64/include/asm/unistd.h | 1 -
arch/arm64/include/uapi/asm/unistd.h | 1 +
2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
index 2629a68b8724..5af82587909e 100644
--- a/arch/arm64/include/asm/unistd.h
+++ b/arch/arm64/include/asm/unistd.h
@@ -42,7 +42,6 @@
#endif

#define __ARCH_WANT_SYS_CLONE
-#define __ARCH_WANT_SYS_CLONE3

#ifndef __COMPAT_SYSCALL_NR
#include <uapi/asm/unistd.h>
diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
index 4703d218663a..f83a70e07df8 100644
--- a/arch/arm64/include/uapi/asm/unistd.h
+++ b/arch/arm64/include/uapi/asm/unistd.h
@@ -19,5 +19,6 @@
#define __ARCH_WANT_NEW_STAT
#define __ARCH_WANT_SET_GET_RLIMIT
#define __ARCH_WANT_TIME32_SYSCALLS
+#define __ARCH_WANT_SYS_CLONE3

#include <asm-generic/unistd.h>
--
2.24.1


2020-01-02 17:51:34

by Christian Brauner

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers

[Cc Arnd. I'd like his Ack on this]

On Thu, Jan 02, 2020 at 06:24:07PM +0100, Amanieu d'Antras wrote:
> Previously this was only defined in the internal headers which
> resulted in __NR_clone3 not being defined in the user headers.
>
> Signed-off-by: Amanieu d'Antras <[email protected]>
> Cc: [email protected]
> Cc: <[email protected]> # 5.3.x
> ---
> arch/arm64/include/asm/unistd.h | 1 -
> arch/arm64/include/uapi/asm/unistd.h | 1 +
> 2 files changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h
> index 2629a68b8724..5af82587909e 100644
> --- a/arch/arm64/include/asm/unistd.h
> +++ b/arch/arm64/include/asm/unistd.h
> @@ -42,7 +42,6 @@
> #endif
>
> #define __ARCH_WANT_SYS_CLONE
> -#define __ARCH_WANT_SYS_CLONE3
>
> #ifndef __COMPAT_SYSCALL_NR
> #include <uapi/asm/unistd.h>
> diff --git a/arch/arm64/include/uapi/asm/unistd.h b/arch/arm64/include/uapi/asm/unistd.h
> index 4703d218663a..f83a70e07df8 100644
> --- a/arch/arm64/include/uapi/asm/unistd.h
> +++ b/arch/arm64/include/uapi/asm/unistd.h
> @@ -19,5 +19,6 @@
> #define __ARCH_WANT_NEW_STAT
> #define __ARCH_WANT_SET_GET_RLIMIT
> #define __ARCH_WANT_TIME32_SYSCALLS
> +#define __ARCH_WANT_SYS_CLONE3
>
> #include <asm-generic/unistd.h>
> --
> 2.24.1
>

2020-01-02 19:26:58

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers

On Thu, Jan 2, 2020 at 6:50 PM Christian Brauner
<[email protected]> wrote:
> On Thu, Jan 02, 2020 at 06:24:07PM +0100, Amanieu d'Antras wrote:
> > Previously this was only defined in the internal headers which
> > resulted in __NR_clone3 not being defined in the user headers.
> >
> > Signed-off-by: Amanieu d'Antras <[email protected]>
> > Cc: [email protected]
> > Cc: <[email protected]> # 5.3.x
> > ---
> > arch/arm64/include/asm/unistd.h | 1 -
> > arch/arm64/include/uapi/asm/unistd.h | 1 +
> > 2 files changed, 1 insertion(+), 1 deletion(-)

Good catch, this is clearly needed, but please make the patch change
every copy of asm/unistd.h that defines this, not just the arm64 one.

Arnd

2020-01-02 19:33:56

by Amanieu d'Antras

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers

On Thu, Jan 2, 2020 at 8:25 PM Arnd Bergmann <[email protected]> wrote:
> On Thu, Jan 2, 2020 at 6:50 PM Christian Brauner
> <[email protected]> wrote:
> > On Thu, Jan 02, 2020 at 06:24:07PM +0100, Amanieu d'Antras wrote:
> > > Previously this was only defined in the internal headers which
> > > resulted in __NR_clone3 not being defined in the user headers.
> > >
> > > Signed-off-by: Amanieu d'Antras <[email protected]>
> > > Cc: [email protected]
> > > Cc: <[email protected]> # 5.3.x
> > > ---
> > > arch/arm64/include/asm/unistd.h | 1 -
> > > arch/arm64/include/uapi/asm/unistd.h | 1 +
> > > 2 files changed, 1 insertion(+), 1 deletion(-)
>
> Good catch, this is clearly needed, but please make the patch change
> every copy of asm/unistd.h that defines this, not just the arm64 one.

Actually __ARCH_WANT_SYS_CLONE3 only needs to be in the uapi headers
for architectures that use the asm-generic/unistd.h header, which uses
it to guard the definition of __NR_clone3. Architectures not using the
asm-generic header don't need this define to export __NR_clone3. The
only other architecture with clone3 that uses the asm-generic header
is riscv, which already defines __ARCH_WANT_SYS_CLONE3 in the uapi
headers.

2020-01-02 20:00:30

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 1/7] arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers

On Thu, Jan 2, 2020 at 8:33 PM Amanieu d'Antras <[email protected]> wrote:
>
> On Thu, Jan 2, 2020 at 8:25 PM Arnd Bergmann <[email protected]> wrote:
> > On Thu, Jan 2, 2020 at 6:50 PM Christian Brauner
> > <[email protected]> wrote:
> > > On Thu, Jan 02, 2020 at 06:24:07PM +0100, Amanieu d'Antras wrote:
> > > > Previously this was only defined in the internal headers which
> > > > resulted in __NR_clone3 not being defined in the user headers.
> > > >
> > > > Signed-off-by: Amanieu d'Antras <[email protected]>
> > > > Cc: [email protected]
> > > > Cc: <[email protected]> # 5.3.x
> > > > ---
> > > > arch/arm64/include/asm/unistd.h | 1 -
> > > > arch/arm64/include/uapi/asm/unistd.h | 1 +
> > > > 2 files changed, 1 insertion(+), 1 deletion(-)
> >
> > Good catch, this is clearly needed, but please make the patch change
> > every copy of asm/unistd.h that defines this, not just the arm64 one.
>
> Actually __ARCH_WANT_SYS_CLONE3 only needs to be in the uapi headers
> for architectures that use the asm-generic/unistd.h header, which uses
> it to guard the definition of __NR_clone3. Architectures not using the
> asm-generic header don't need this define to export __NR_clone3. The
> only other architecture with clone3 that uses the asm-generic header
> is riscv, which already defines __ARCH_WANT_SYS_CLONE3 in the uapi
> headers.

Ah, of course. The patch looks fine to me then.

Reviewed-by: Arnd Bergmann <[email protected]>