Re: [PATCH v5 2/2] RISC-V: Setup initial page tables in two stages

From: Alistair Francis
Date: Thu Aug 15 2019 - 17:32:20 EST


On Thu, 2019-08-15 at 13:29 -0700, Paul Walmsley wrote:
> On Thu, 15 Aug 2019, David Abdurachmanov wrote:
>
> > Yes, I do see those in Fedora/RISCV build farm every morning, but
> > with
> > riscv64 and 5.2.0-rc7 kernel.
>
> [...]
>
> > fedora-riscv-4 login: [178876.406122] Unable to handle kernel
> > paging
> > request at virtual address 0000000000012a28
> > fedora-riscv-7 login: [17983.074847] Unable to handle kernel paging
> > request at virtual address 0fffffdff5e14700
>
> Alistair, you're seeing panics immediately after the userspace
> transition,
> right? 100% of the time?

Yes, just after init (systemd) is started. I see this 100% of the time
with 32-bit RISC-V.

Here is an updated log with a little more context:

[ 1.227072] EXT4-fs (vda): mounted filesystem with ordered data
mode. Opts: (null)
[ 1.228148] VFS: Mounted root (ext4 filesystem) on device 254:0.
[ 1.274486] Freeing unused kernel memory: 192K
[ 1.274788] This architecture does not have kernel memory
protection.
[ 1.275298] Run /sbin/init as init process
[ 1.682749] systemd[1]: systemd 242-19-gdb2e367+ running in system
mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP
-LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS
+KMOD -IDN2 -IDN -PCRE2 default-hierarchy=hybrid)
[ 1.685536] Unable to handle kernel paging request at virtual
address 9ff00c15
[ 1.686160] Oops [#1]
[ 1.686409] Modules linked in:
[ 1.686826] CPU: 0 PID: 1 Comm: systemd Not tainted 5.3.0-rc4 #1
[ 1.687388] sepc: c05d2f74 ra : c04bd60c sp : df04fce0
[ 1.687817] gp : c07af4a8 tp : df050000 t0 : 000000fc
[ 1.688329] t1 : 00000002 t2 : 000003ef s0 : df04fcf0
[ 1.688763] s1 : df7090f8 a0 : 9ff00c15 a1 : c072f4a8
[ 1.689186] a2 : 00000000 a3 : 00000001 a4 : 00000001
[ 1.689587] a5 : df6f8138 a6 : 0000002f a7 : de62a000
[ 1.689970] s2 : c072f4a8 s3 : 00000000 s4 : 00000000
[ 1.690355] s5 : c07b1000 s6 : 00400cc0 s7 : 00000400
[ 1.690732] s8 : de496018 s9 : 00000000 s10: fffff000
[ 1.691114] s11: de496030 t3 : de62b000 t4 : 00000000
[ 1.691491] t5 : 00000000 t6 : 00000080
[ 1.691797] sstatus: 00000100 sbadaddr: 9ff00c15 scause: 0000000d
[ 1.692861] ---[ end trace 7aed3616cacc20ea ]---
[ 1.695358] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b
[ 1.696158] ---[ end Kernel panic - not syncing: Attempted to kill
init! exitcode=0x0000000b ]---

>
> If so, this is probably a different bug. Most likely the TLB
> flushing
> issue.

I'm not sure. I have tried with Atish's OpenSBI and kernel patches but
that didn't help.

Reverting just this patch does fully fix the problem though.

Alistair

>
>
> - Paul