linux-riscv.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] riscv: Partially revert "Remove stat64 family from default syscall set"
@ 2019-02-07 22:55 Alistair Francis
  2019-02-07 23:03 ` David Abdurachmanov
  0 siblings, 1 reply; 3+ messages in thread
From: Alistair Francis @ 2019-02-07 22:55 UTC (permalink / raw)
  To: linux-riscv; +Cc: alistair23, palmer, Alistair Francis, linux-kernel

To fix systemd/sysVinit crashes enable __ARCH_WANT_STAT64.

systemd failed to start with this error for 32-bit RISC-V:
[    2.833864] Run /sbin/init as init process
/sbin/init: error while loading shared libraries: libsystemd-shared-239.so: cannot stat shared object: Error 38
[    2.933593] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
[    2.934120] CPU: 0 PID: 1 Comm: init Not tainted 5.0.0-rc4-yoctodev-standard #1
[    2.934589] Call Trace:
[    2.934919] [<c0048a30>] walk_stackframe+0x0/0xa0
[    2.935243] [<c0048c14>] show_stack+0x28/0x32
[    2.935518] [<c05fa418>] dump_stack+0x68/0x88
[    2.935788] [<c004de48>] panic+0xf0/0x252
[    2.936041] [<c0051780>] do_exit+0x7de/0x7fc
[    2.936387] [<c00517f4>] do_group_exit+0x2a/0x82
[    2.936674] [<c005185e>] __wake_up_parent+0x0/0x22
[    2.936982] [<c00475fa>] ret_from_syscall+0x0/0xe
[    2.937673] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---

sysVinit had a similar problem as well. By enabling __ARCH_WANT_STAT64
for 32-bit RISC-V the problem disapears and 32-bit RISC-V is able to
boot.

Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
This was tested with this fork of glibc to enable 32-bit RISC-V support:
https://github.com/riscv/riscv-glibc/tree/riscv-glibc-2.29
commit: 04fdd476160a55792a75375ba2bf56c761f811c2

I'm not sure if this is a glibc problem or a kernel problem, but this
commit caused the breakage between the 4.19 and 4.20 kernel so I'm
sending out a patch. Let me know your thoughts

arch/riscv/include/uapi/asm/unistd.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
index 1f3bd3ebbb0d..031b7d78e11c 100644
--- a/arch/riscv/include/uapi/asm/unistd.h
+++ b/arch/riscv/include/uapi/asm/unistd.h
@@ -20,6 +20,9 @@
 #endif /* __LP64__ */
 
 #include <asm-generic/unistd.h>
+#if __BITS_PER_LONG == 32
+#define __ARCH_WANT_STAT64
+#endif
 
 /*
  * Allows the instruction cache to be flushed from userspace.  Despite RISC-V
-- 
2.20.1


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

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

* Re: [PATCH] riscv: Partially revert "Remove stat64 family from default syscall set"
  2019-02-07 22:55 [PATCH] riscv: Partially revert "Remove stat64 family from default syscall set" Alistair Francis
@ 2019-02-07 23:03 ` David Abdurachmanov
  2019-02-07 23:12   ` Alistair Francis
  0 siblings, 1 reply; 3+ messages in thread
From: David Abdurachmanov @ 2019-02-07 23:03 UTC (permalink / raw)
  To: Alistair Francis; +Cc: alistair23, linux-riscv, palmer, linux-kernel

On Thu, Feb 7, 2019 at 11:56 PM Alistair Francis
<Alistair.Francis@wdc.com> wrote:
>
> To fix systemd/sysVinit crashes enable __ARCH_WANT_STAT64.
>
> systemd failed to start with this error for 32-bit RISC-V:
> [    2.833864] Run /sbin/init as init process
> /sbin/init: error while loading shared libraries: libsystemd-shared-239.so: cannot stat shared object: Error 38
> [    2.933593] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
> [    2.934120] CPU: 0 PID: 1 Comm: init Not tainted 5.0.0-rc4-yoctodev-standard #1
> [    2.934589] Call Trace:
> [    2.934919] [<c0048a30>] walk_stackframe+0x0/0xa0
> [    2.935243] [<c0048c14>] show_stack+0x28/0x32
> [    2.935518] [<c05fa418>] dump_stack+0x68/0x88
> [    2.935788] [<c004de48>] panic+0xf0/0x252
> [    2.936041] [<c0051780>] do_exit+0x7de/0x7fc
> [    2.936387] [<c00517f4>] do_group_exit+0x2a/0x82
> [    2.936674] [<c005185e>] __wake_up_parent+0x0/0x22
> [    2.936982] [<c00475fa>] ret_from_syscall+0x0/0xe
> [    2.937673] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---
>
> sysVinit had a similar problem as well. By enabling __ARCH_WANT_STAT64
> for 32-bit RISC-V the problem disapears and 32-bit RISC-V is able to
> boot.

Hi,

This is expected change for riscv32. More details here:
http://lists.infradead.org/pipermail/linux-riscv/2018-November/002062.html

david

>
> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> ---
> This was tested with this fork of glibc to enable 32-bit RISC-V support:
> https://github.com/riscv/riscv-glibc/tree/riscv-glibc-2.29
> commit: 04fdd476160a55792a75375ba2bf56c761f811c2
>
> I'm not sure if this is a glibc problem or a kernel problem, but this
> commit caused the breakage between the 4.19 and 4.20 kernel so I'm
> sending out a patch. Let me know your thoughts
>
> arch/riscv/include/uapi/asm/unistd.h | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
> index 1f3bd3ebbb0d..031b7d78e11c 100644
> --- a/arch/riscv/include/uapi/asm/unistd.h
> +++ b/arch/riscv/include/uapi/asm/unistd.h
> @@ -20,6 +20,9 @@
>  #endif /* __LP64__ */
>
>  #include <asm-generic/unistd.h>
> +#if __BITS_PER_LONG == 32
> +#define __ARCH_WANT_STAT64
> +#endif
>
>  /*
>   * Allows the instruction cache to be flushed from userspace.  Despite RISC-V
> --
> 2.20.1
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv

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

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

* Re: [PATCH] riscv: Partially revert "Remove stat64 family from default syscall set"
  2019-02-07 23:03 ` David Abdurachmanov
@ 2019-02-07 23:12   ` Alistair Francis
  0 siblings, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2019-02-07 23:12 UTC (permalink / raw)
  To: David Abdurachmanov, zongbox
  Cc: linux-riscv, palmer, Alistair Francis, linux-kernel

On Thu, Feb 7, 2019 at 3:04 PM David Abdurachmanov
<david.abdurachmanov@gmail.com> wrote:
>
> On Thu, Feb 7, 2019 at 11:56 PM Alistair Francis
> <Alistair.Francis@wdc.com> wrote:
> >
> > To fix systemd/sysVinit crashes enable __ARCH_WANT_STAT64.
> >
> > systemd failed to start with this error for 32-bit RISC-V:
> > [    2.833864] Run /sbin/init as init process
> > /sbin/init: error while loading shared libraries: libsystemd-shared-239.so: cannot stat shared object: Error 38
> > [    2.933593] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00
> > [    2.934120] CPU: 0 PID: 1 Comm: init Not tainted 5.0.0-rc4-yoctodev-standard #1
> > [    2.934589] Call Trace:
> > [    2.934919] [<c0048a30>] walk_stackframe+0x0/0xa0
> > [    2.935243] [<c0048c14>] show_stack+0x28/0x32
> > [    2.935518] [<c05fa418>] dump_stack+0x68/0x88
> > [    2.935788] [<c004de48>] panic+0xf0/0x252
> > [    2.936041] [<c0051780>] do_exit+0x7de/0x7fc
> > [    2.936387] [<c00517f4>] do_group_exit+0x2a/0x82
> > [    2.936674] [<c005185e>] __wake_up_parent+0x0/0x22
> > [    2.936982] [<c00475fa>] ret_from_syscall+0x0/0xe
> > [    2.937673] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00 ]---
> >
> > sysVinit had a similar problem as well. By enabling __ARCH_WANT_STAT64
> > for 32-bit RISC-V the problem disapears and 32-bit RISC-V is able to
> > boot.
>
> Hi,
>
> This is expected change for riscv32. More details here:
> http://lists.infradead.org/pipermail/linux-riscv/2018-November/002062.html

Thanks for the explanation.

+ Zong

Do you know what the statx implementation is in the 32-bit RISC-V
glibc submission?

Alistair

>
> david
>
> >
> > Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
> > ---
> > This was tested with this fork of glibc to enable 32-bit RISC-V support:
> > https://github.com/riscv/riscv-glibc/tree/riscv-glibc-2.29
> > commit: 04fdd476160a55792a75375ba2bf56c761f811c2
> >
> > I'm not sure if this is a glibc problem or a kernel problem, but this
> > commit caused the breakage between the 4.19 and 4.20 kernel so I'm
> > sending out a patch. Let me know your thoughts
> >
> > arch/riscv/include/uapi/asm/unistd.h | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
> > index 1f3bd3ebbb0d..031b7d78e11c 100644
> > --- a/arch/riscv/include/uapi/asm/unistd.h
> > +++ b/arch/riscv/include/uapi/asm/unistd.h
> > @@ -20,6 +20,9 @@
> >  #endif /* __LP64__ */
> >
> >  #include <asm-generic/unistd.h>
> > +#if __BITS_PER_LONG == 32
> > +#define __ARCH_WANT_STAT64
> > +#endif
> >
> >  /*
> >   * Allows the instruction cache to be flushed from userspace.  Despite RISC-V
> > --
> > 2.20.1
> >
> >
> > _______________________________________________
> > linux-riscv mailing list
> > linux-riscv@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-riscv

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

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

end of thread, other threads:[~2019-02-07 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-07 22:55 [PATCH] riscv: Partially revert "Remove stat64 family from default syscall set" Alistair Francis
2019-02-07 23:03 ` David Abdurachmanov
2019-02-07 23:12   ` Alistair Francis

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).