All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-03  0:21 ` Palmer Dabbelt
  0 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2021-10-03  0:21 UTC (permalink / raw)
  To: linux-riscv, Arnd Bergmann
  Cc: Paul Walmsley, Palmer Dabbelt, aou, christian, linux-riscv,
	linux-kernel, kernel-team, Palmer Dabbelt

From: Palmer Dabbelt <palmerdabbelt@google.com>

As far as I can tell this should be enabled on rv32 as well, I'm not
sure why it's rv64-only.  checksyscalls is complaining about our lack of
clone3() on rv32.

Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
---
 arch/riscv/include/uapi/asm/unistd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
index 4b989ae15d59..8062996c2dfd 100644
--- a/arch/riscv/include/uapi/asm/unistd.h
+++ b/arch/riscv/include/uapi/asm/unistd.h
@@ -18,9 +18,10 @@
 #ifdef __LP64__
 #define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_SET_GET_RLIMIT
-#define __ARCH_WANT_SYS_CLONE3
 #endif /* __LP64__ */
 
+#define __ARCH_WANT_SYS_CLONE3
+
 #include <asm-generic/unistd.h>
 
 /*
-- 
2.33.0.800.g4c38ced690-goog


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

* [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-03  0:21 ` Palmer Dabbelt
  0 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2021-10-03  0:21 UTC (permalink / raw)
  To: linux-riscv, Arnd Bergmann
  Cc: Paul Walmsley, Palmer Dabbelt, aou, christian, linux-riscv,
	linux-kernel, kernel-team, Palmer Dabbelt

From: Palmer Dabbelt <palmerdabbelt@google.com>

As far as I can tell this should be enabled on rv32 as well, I'm not
sure why it's rv64-only.  checksyscalls is complaining about our lack of
clone3() on rv32.

Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
---
 arch/riscv/include/uapi/asm/unistd.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
index 4b989ae15d59..8062996c2dfd 100644
--- a/arch/riscv/include/uapi/asm/unistd.h
+++ b/arch/riscv/include/uapi/asm/unistd.h
@@ -18,9 +18,10 @@
 #ifdef __LP64__
 #define __ARCH_WANT_NEW_STAT
 #define __ARCH_WANT_SET_GET_RLIMIT
-#define __ARCH_WANT_SYS_CLONE3
 #endif /* __LP64__ */
 
+#define __ARCH_WANT_SYS_CLONE3
+
 #include <asm-generic/unistd.h>
 
 /*
-- 
2.33.0.800.g4c38ced690-goog


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

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
  2021-10-03  0:21 ` Palmer Dabbelt
@ 2021-10-03 15:30   ` Arnd Bergmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2021-10-03 15:30 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: linux-riscv, Arnd Bergmann, Paul Walmsley, Albert Ou,
	Christian Brauner, Linux Kernel Mailing List,
	Android Kernel Team, Palmer Dabbelt

On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> From: Palmer Dabbelt <palmerdabbelt@google.com>
>
> As far as I can tell this should be enabled on rv32 as well, I'm not
> sure why it's rv64-only.  checksyscalls is complaining about our lack of
> clone3() on rv32.
>
> Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>

We should probably reverse the polarity of this symbol and force
architectures that don't implement it properly to say they don't
have it, but for now, it definitely makes sense to treat this the same
way on 32-bit and 64-bit risc-v.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-03 15:30   ` Arnd Bergmann
  0 siblings, 0 replies; 12+ messages in thread
From: Arnd Bergmann @ 2021-10-03 15:30 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: linux-riscv, Arnd Bergmann, Paul Walmsley, Albert Ou,
	Christian Brauner, Linux Kernel Mailing List,
	Android Kernel Team, Palmer Dabbelt

On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>
> From: Palmer Dabbelt <palmerdabbelt@google.com>
>
> As far as I can tell this should be enabled on rv32 as well, I'm not
> sure why it's rv64-only.  checksyscalls is complaining about our lack of
> clone3() on rv32.
>
> Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>

We should probably reverse the polarity of this symbol and force
architectures that don't implement it properly to say they don't
have it, but for now, it definitely makes sense to treat this the same
way on 32-bit and 64-bit risc-v.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
  2021-10-03  0:21 ` Palmer Dabbelt
@ 2021-10-04  7:15   ` Christian Brauner
  -1 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-04  7:15 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: linux-riscv, Arnd Bergmann, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team, Palmer Dabbelt

On Sat, Oct 02, 2021 at 05:21:20PM -0700, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> As far as I can tell this should be enabled on rv32 as well, I'm not
> sure why it's rv64-only.  checksyscalls is complaining about our lack of
> clone3() on rv32.
> 
> Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> ---

Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-04  7:15   ` Christian Brauner
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-04  7:15 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: linux-riscv, Arnd Bergmann, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team, Palmer Dabbelt

On Sat, Oct 02, 2021 at 05:21:20PM -0700, Palmer Dabbelt wrote:
> From: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> As far as I can tell this should be enabled on rv32 as well, I'm not
> sure why it's rv64-only.  checksyscalls is complaining about our lack of
> clone3() on rv32.
> 
> Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> ---

Thanks!
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>

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

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
  2021-10-03 15:30   ` Arnd Bergmann
@ 2021-10-04 11:17     ` Christian Brauner
  -1 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-04 11:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Palmer Dabbelt, linux-riscv, Paul Walmsley, Albert Ou,
	Christian Brauner, Linux Kernel Mailing List,
	Android Kernel Team, Palmer Dabbelt

On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
> On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> >
> > From: Palmer Dabbelt <palmerdabbelt@google.com>
> >
> > As far as I can tell this should be enabled on rv32 as well, I'm not
> > sure why it's rv64-only.  checksyscalls is complaining about our lack of
> > clone3() on rv32.
> >
> > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> We should probably reverse the polarity of this symbol and force
> architectures that don't implement it properly to say they don't
> have it, but for now, it definitely makes sense to treat this the same
> way on 32-bit and 64-bit risc-v.

I think we had that discussion back when I added it and I think I even
proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
Most likely because it fell in line with the other
__ARCH_WANT_SYS_{CLONE,FORK}.

I think at this point its alpha, ia64, nios, sparc, and sh that don't
implement it. For some it looks trivial at first glance at least (Fwiw,
nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):

diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
index 0b4bb1d41b28..6c4f45abd3ab 100644
--- a/arch/nios2/include/uapi/asm/unistd.h
+++ b/arch/nios2/include/uapi/asm/unistd.h
@@ -18,6 +18,7 @@

  #define sys_mmap2 sys_mmap_pgoff

+#define __ARCH_WANT_SYS_CLONE3
 #define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SET_GET_RLIMIT
diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
index 0794cd7803df..c1804bda8259 100644
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -396,6 +396,15 @@ ENTRY(sys_clone)
        RESTORE_SWITCH_STACK
        ret

+/*
+ * int clone3(struct clone_args __user *, uargs, size_t, size)
+ */
+ENTRY(sys_clone3)
+       SAVE_SWITCH_STACK
+       call    sys_clone3
+       RESTORE_SWITCH_STACK
+       ret
+
 ENTRY(sys_rt_sigreturn)
        SAVE_SWITCH_STACK
        mov     r4, sp


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

* Re: [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-04 11:17     ` Christian Brauner
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-04 11:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Palmer Dabbelt, linux-riscv, Paul Walmsley, Albert Ou,
	Christian Brauner, Linux Kernel Mailing List,
	Android Kernel Team, Palmer Dabbelt

On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
> On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> >
> > From: Palmer Dabbelt <palmerdabbelt@google.com>
> >
> > As far as I can tell this should be enabled on rv32 as well, I'm not
> > sure why it's rv64-only.  checksyscalls is complaining about our lack of
> > clone3() on rv32.
> >
> > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> We should probably reverse the polarity of this symbol and force
> architectures that don't implement it properly to say they don't
> have it, but for now, it definitely makes sense to treat this the same
> way on 32-bit and 64-bit risc-v.

I think we had that discussion back when I added it and I think I even
proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
Most likely because it fell in line with the other
__ARCH_WANT_SYS_{CLONE,FORK}.

I think at this point its alpha, ia64, nios, sparc, and sh that don't
implement it. For some it looks trivial at first glance at least (Fwiw,
nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):

diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
index 0b4bb1d41b28..6c4f45abd3ab 100644
--- a/arch/nios2/include/uapi/asm/unistd.h
+++ b/arch/nios2/include/uapi/asm/unistd.h
@@ -18,6 +18,7 @@

  #define sys_mmap2 sys_mmap_pgoff

+#define __ARCH_WANT_SYS_CLONE3
 #define __ARCH_WANT_RENAMEAT
 #define __ARCH_WANT_STAT64
 #define __ARCH_WANT_SET_GET_RLIMIT
diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
index 0794cd7803df..c1804bda8259 100644
--- a/arch/nios2/kernel/entry.S
+++ b/arch/nios2/kernel/entry.S
@@ -396,6 +396,15 @@ ENTRY(sys_clone)
        RESTORE_SWITCH_STACK
        ret

+/*
+ * int clone3(struct clone_args __user *, uargs, size_t, size)
+ */
+ENTRY(sys_clone3)
+       SAVE_SWITCH_STACK
+       call    sys_clone3
+       RESTORE_SWITCH_STACK
+       ret
+
 ENTRY(sys_rt_sigreturn)
        SAVE_SWITCH_STACK
        mov     r4, sp


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

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
  2021-10-04 11:17     ` Christian Brauner
@ 2021-10-05  0:35       ` Palmer Dabbelt
  -1 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2021-10-05  0:35 UTC (permalink / raw)
  To: christian.brauner
  Cc: Arnd Bergmann, linux-riscv, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team

On Mon, 04 Oct 2021 04:17:58 PDT (-0700), christian.brauner@ubuntu.com wrote:
> On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
>> On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> >
>> > From: Palmer Dabbelt <palmerdabbelt@google.com>
>> >
>> > As far as I can tell this should be enabled on rv32 as well, I'm not
>> > sure why it's rv64-only.  checksyscalls is complaining about our lack of
>> > clone3() on rv32.
>> >
>> > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
>> > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> We should probably reverse the polarity of this symbol and force
>> architectures that don't implement it properly to say they don't
>> have it, but for now, it definitely makes sense to treat this the same
>> way on 32-bit and 64-bit risc-v.
>
> I think we had that discussion back when I added it and I think I even
> proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
> Most likely because it fell in line with the other
> __ARCH_WANT_SYS_{CLONE,FORK}.
>
> I think at this point its alpha, ia64, nios, sparc, and sh that don't
> implement it. For some it looks trivial at first glance at least (Fwiw,
> nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):
>
> diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
> index 0b4bb1d41b28..6c4f45abd3ab 100644
> --- a/arch/nios2/include/uapi/asm/unistd.h
> +++ b/arch/nios2/include/uapi/asm/unistd.h
> @@ -18,6 +18,7 @@
>
>   #define sys_mmap2 sys_mmap_pgoff
>
> +#define __ARCH_WANT_SYS_CLONE3
>  #define __ARCH_WANT_RENAMEAT
>  #define __ARCH_WANT_STAT64
>  #define __ARCH_WANT_SET_GET_RLIMIT
> diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
> index 0794cd7803df..c1804bda8259 100644
> --- a/arch/nios2/kernel/entry.S
> +++ b/arch/nios2/kernel/entry.S
> @@ -396,6 +396,15 @@ ENTRY(sys_clone)
>         RESTORE_SWITCH_STACK
>         ret
>
> +/*
> + * int clone3(struct clone_args __user *, uargs, size_t, size)
> + */
> +ENTRY(sys_clone3)
> +       SAVE_SWITCH_STACK
> +       call    sys_clone3
> +       RESTORE_SWITCH_STACK
> +       ret
> +
>  ENTRY(sys_rt_sigreturn)
>         SAVE_SWITCH_STACK
>         mov     r4, sp

Thanks.

I've put this on fixes, but if you're trying to do that refactoring I've 
merged it in as a single patch on top of 5.15-rc1.  That's on 
palmer/riscv-clone3, in case it helps someone avoid a conflict when 
doing that refactoring.  I'd usually offer to do the refactoring, but 
I'm super buried right now with all the RISC-V stuff ;)

I want to call this fix because it's breaking my builds, these 
checksyscall warnings have recently turned into errors.

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-05  0:35       ` Palmer Dabbelt
  0 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2021-10-05  0:35 UTC (permalink / raw)
  To: christian.brauner
  Cc: Arnd Bergmann, linux-riscv, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team

On Mon, 04 Oct 2021 04:17:58 PDT (-0700), christian.brauner@ubuntu.com wrote:
> On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
>> On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
>> >
>> > From: Palmer Dabbelt <palmerdabbelt@google.com>
>> >
>> > As far as I can tell this should be enabled on rv32 as well, I'm not
>> > sure why it's rv64-only.  checksyscalls is complaining about our lack of
>> > clone3() on rv32.
>> >
>> > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
>> > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> We should probably reverse the polarity of this symbol and force
>> architectures that don't implement it properly to say they don't
>> have it, but for now, it definitely makes sense to treat this the same
>> way on 32-bit and 64-bit risc-v.
>
> I think we had that discussion back when I added it and I think I even
> proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
> Most likely because it fell in line with the other
> __ARCH_WANT_SYS_{CLONE,FORK}.
>
> I think at this point its alpha, ia64, nios, sparc, and sh that don't
> implement it. For some it looks trivial at first glance at least (Fwiw,
> nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):
>
> diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
> index 0b4bb1d41b28..6c4f45abd3ab 100644
> --- a/arch/nios2/include/uapi/asm/unistd.h
> +++ b/arch/nios2/include/uapi/asm/unistd.h
> @@ -18,6 +18,7 @@
>
>   #define sys_mmap2 sys_mmap_pgoff
>
> +#define __ARCH_WANT_SYS_CLONE3
>  #define __ARCH_WANT_RENAMEAT
>  #define __ARCH_WANT_STAT64
>  #define __ARCH_WANT_SET_GET_RLIMIT
> diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
> index 0794cd7803df..c1804bda8259 100644
> --- a/arch/nios2/kernel/entry.S
> +++ b/arch/nios2/kernel/entry.S
> @@ -396,6 +396,15 @@ ENTRY(sys_clone)
>         RESTORE_SWITCH_STACK
>         ret
>
> +/*
> + * int clone3(struct clone_args __user *, uargs, size_t, size)
> + */
> +ENTRY(sys_clone3)
> +       SAVE_SWITCH_STACK
> +       call    sys_clone3
> +       RESTORE_SWITCH_STACK
> +       ret
> +
>  ENTRY(sys_rt_sigreturn)
>         SAVE_SWITCH_STACK
>         mov     r4, sp

Thanks.

I've put this on fixes, but if you're trying to do that refactoring I've 
merged it in as a single patch on top of 5.15-rc1.  That's on 
palmer/riscv-clone3, in case it helps someone avoid a conflict when 
doing that refactoring.  I'd usually offer to do the refactoring, but 
I'm super buried right now with all the RISC-V stuff ;)

I want to call this fix because it's breaking my builds, these 
checksyscall warnings have recently turned into errors.

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

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
  2021-10-05  0:35       ` Palmer Dabbelt
@ 2021-10-05  9:14         ` Christian Brauner
  -1 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-05  9:14 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Arnd Bergmann, linux-riscv, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team

On Mon, Oct 04, 2021 at 05:35:40PM -0700, Palmer Dabbelt wrote:
> On Mon, 04 Oct 2021 04:17:58 PDT (-0700), christian.brauner@ubuntu.com wrote:
> > On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
> > > On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> > > >
> > > > From: Palmer Dabbelt <palmerdabbelt@google.com>
> > > >
> > > > As far as I can tell this should be enabled on rv32 as well, I'm not
> > > > sure why it's rv64-only.  checksyscalls is complaining about our lack of
> > > > clone3() on rv32.
> > > >
> > > > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> > > > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> > > 
> > > We should probably reverse the polarity of this symbol and force
> > > architectures that don't implement it properly to say they don't
> > > have it, but for now, it definitely makes sense to treat this the same
> > > way on 32-bit and 64-bit risc-v.
> > 
> > I think we had that discussion back when I added it and I think I even
> > proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
> > Most likely because it fell in line with the other
> > __ARCH_WANT_SYS_{CLONE,FORK}.
> > 
> > I think at this point its alpha, ia64, nios, sparc, and sh that don't
> > implement it. For some it looks trivial at first glance at least (Fwiw,
> > nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):
> > 
> > diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
> > index 0b4bb1d41b28..6c4f45abd3ab 100644
> > --- a/arch/nios2/include/uapi/asm/unistd.h
> > +++ b/arch/nios2/include/uapi/asm/unistd.h
> > @@ -18,6 +18,7 @@
> > 
> >   #define sys_mmap2 sys_mmap_pgoff
> > 
> > +#define __ARCH_WANT_SYS_CLONE3
> >  #define __ARCH_WANT_RENAMEAT
> >  #define __ARCH_WANT_STAT64
> >  #define __ARCH_WANT_SET_GET_RLIMIT
> > diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
> > index 0794cd7803df..c1804bda8259 100644
> > --- a/arch/nios2/kernel/entry.S
> > +++ b/arch/nios2/kernel/entry.S
> > @@ -396,6 +396,15 @@ ENTRY(sys_clone)
> >         RESTORE_SWITCH_STACK
> >         ret
> > 
> > +/*
> > + * int clone3(struct clone_args __user *, uargs, size_t, size)
> > + */
> > +ENTRY(sys_clone3)
> > +       SAVE_SWITCH_STACK
> > +       call    sys_clone3
> > +       RESTORE_SWITCH_STACK
> > +       ret
> > +
> >  ENTRY(sys_rt_sigreturn)
> >         SAVE_SWITCH_STACK
> >         mov     r4, sp
> 
> Thanks.
> 
> I've put this on fixes, but if you're trying to do that refactoring I've
> merged it in as a single patch on top of 5.15-rc1.  That's on
> palmer/riscv-clone3, in case it helps someone avoid a conflict when doing
> that refactoring.  I'd usually offer to do the refactoring, but I'm super
> buried right now with all the RISC-V stuff ;)
> 
> I want to call this fix because it's breaking my builds, these checksyscall
> warnings have recently turned into errors.

Oh yeah, please just merge your fix here for this issue. I think
flipping the symbol isn't that pressing right now and fixing your builds
is more urgent! :)

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

* Re: [PATCH] RISC-V: Include clone3() on rv32
@ 2021-10-05  9:14         ` Christian Brauner
  0 siblings, 0 replies; 12+ messages in thread
From: Christian Brauner @ 2021-10-05  9:14 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: Arnd Bergmann, linux-riscv, Paul Walmsley, aou, christian,
	linux-kernel, kernel-team

On Mon, Oct 04, 2021 at 05:35:40PM -0700, Palmer Dabbelt wrote:
> On Mon, 04 Oct 2021 04:17:58 PDT (-0700), christian.brauner@ubuntu.com wrote:
> > On Sun, Oct 03, 2021 at 05:30:24PM +0200, Arnd Bergmann wrote:
> > > On Sun, Oct 3, 2021 at 2:58 AM Palmer Dabbelt <palmer@dabbelt.com> wrote:
> > > >
> > > > From: Palmer Dabbelt <palmerdabbelt@google.com>
> > > >
> > > > As far as I can tell this should be enabled on rv32 as well, I'm not
> > > > sure why it's rv64-only.  checksyscalls is complaining about our lack of
> > > > clone3() on rv32.
> > > >
> > > > Fixes: 56ac5e213933 ("riscv: enable sys_clone3 syscall for rv64")
> > > > Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
> > > 
> > > We should probably reverse the polarity of this symbol and force
> > > architectures that don't implement it properly to say they don't
> > > have it, but for now, it definitely makes sense to treat this the same
> > > way on 32-bit and 64-bit risc-v.
> > 
> > I think we had that discussion back when I added it and I think I even
> > proposed that or you did but then we settled on __ARCH_WANT_SYS_CLONE3.
> > Most likely because it fell in line with the other
> > __ARCH_WANT_SYS_{CLONE,FORK}.
> > 
> > I think at this point its alpha, ia64, nios, sparc, and sh that don't
> > implement it. For some it looks trivial at first glance at least (Fwiw,
> > nios implements sys_clone() but doesn't select __ARCH_WANT_SYS_CLONE3):
> > 
> > diff --git a/arch/nios2/include/uapi/asm/unistd.h b/arch/nios2/include/uapi/asm/unistd.h
> > index 0b4bb1d41b28..6c4f45abd3ab 100644
> > --- a/arch/nios2/include/uapi/asm/unistd.h
> > +++ b/arch/nios2/include/uapi/asm/unistd.h
> > @@ -18,6 +18,7 @@
> > 
> >   #define sys_mmap2 sys_mmap_pgoff
> > 
> > +#define __ARCH_WANT_SYS_CLONE3
> >  #define __ARCH_WANT_RENAMEAT
> >  #define __ARCH_WANT_STAT64
> >  #define __ARCH_WANT_SET_GET_RLIMIT
> > diff --git a/arch/nios2/kernel/entry.S b/arch/nios2/kernel/entry.S
> > index 0794cd7803df..c1804bda8259 100644
> > --- a/arch/nios2/kernel/entry.S
> > +++ b/arch/nios2/kernel/entry.S
> > @@ -396,6 +396,15 @@ ENTRY(sys_clone)
> >         RESTORE_SWITCH_STACK
> >         ret
> > 
> > +/*
> > + * int clone3(struct clone_args __user *, uargs, size_t, size)
> > + */
> > +ENTRY(sys_clone3)
> > +       SAVE_SWITCH_STACK
> > +       call    sys_clone3
> > +       RESTORE_SWITCH_STACK
> > +       ret
> > +
> >  ENTRY(sys_rt_sigreturn)
> >         SAVE_SWITCH_STACK
> >         mov     r4, sp
> 
> Thanks.
> 
> I've put this on fixes, but if you're trying to do that refactoring I've
> merged it in as a single patch on top of 5.15-rc1.  That's on
> palmer/riscv-clone3, in case it helps someone avoid a conflict when doing
> that refactoring.  I'd usually offer to do the refactoring, but I'm super
> buried right now with all the RISC-V stuff ;)
> 
> I want to call this fix because it's breaking my builds, these checksyscall
> warnings have recently turned into errors.

Oh yeah, please just merge your fix here for this issue. I think
flipping the symbol isn't that pressing right now and fixing your builds
is more urgent! :)

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

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

end of thread, other threads:[~2021-10-05  9:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-03  0:21 [PATCH] RISC-V: Include clone3() on rv32 Palmer Dabbelt
2021-10-03  0:21 ` Palmer Dabbelt
2021-10-03 15:30 ` Arnd Bergmann
2021-10-03 15:30   ` Arnd Bergmann
2021-10-04 11:17   ` Christian Brauner
2021-10-04 11:17     ` Christian Brauner
2021-10-05  0:35     ` Palmer Dabbelt
2021-10-05  0:35       ` Palmer Dabbelt
2021-10-05  9:14       ` Christian Brauner
2021-10-05  9:14         ` Christian Brauner
2021-10-04  7:15 ` Christian Brauner
2021-10-04  7:15   ` Christian Brauner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.