Unhandle Page Fault when Boot Linux 5.x on Spike


(John Fireman) #1

These days I try to update U SDK v1 to newer gnu tool and linux, these what I did:

  1. update buildroot: 2019.11
    need to remove BR2_PACKAGE_HOST_MKE2IMG in config
  2. update gnu tool chain gcc 9.20
    replace with the newest toolchain
    change the KERNEL_VERSION_NUMBER in makefile
  3. update Kernel to 5.0.1, but in this step, I meet the error
    [    0.163335] 9pnet: Installing 9P2000 support
    [    0.163600] Key type dns_resolver registered
    [    0.170780] Unable to handle kernel paging request at virtual address ffffffd000000000
    [    0.171240] Oops [#1]
    [    0.171375] Modules linked in:
    [    0.171555] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.3.7-57306-g600cf51b022e #5
    [    0.171995] sepc: ffffffe000cd8098 ra : ffffffe0000158b8 sp : ffffffe079a75d90
    [    0.172415]  gp : ffffffe0012c3438 tp : ffffffe079a78000 t0 : 0000000000000000
    [    0.172835]  t1 : ffffffe0010b2ac0 t2 : 0000000093978700 s0 : ffffffe079a75dd0
    [    0.173260]  s1 : ffffffe0010b1ac0 a0 : ffffffe0010b16c0 a1 : ffffffd0938786fc
    [    0.173680]  a2 : ffffffe0010b1ac0 a3 : ffffffcffffffffc a4 : 0000000000000000
    [    0.174100]  a5 : ffffffffa88493fe a6 : ffffffe0010b1ec0 a7 : ffffffe0010b22c0
    [    0.174520]  s2 : 0000000000000000 s3 : ffffffffbc652662 s4 : 0000000000000000
    [    0.174940]  s5 : 0000000000000000 s6 : 0000000000000000 s7 : ffffffe0010b16c0
    [    0.175360]  s8 : ffffffe0000002c0 s9 : ffffffe0012c3618 s10: ffffffe0012c3608
    [    0.175780]  s11: 0000000000000000 t3 : ffffffe0010b2ec0 t4 : ffffffe0010b26c0
    [    0.176200]  t5 : ffffffe0010b32c0 t6 : ffffffcfffeffffc
    [    0.176510] sstatus: 0000000200000120 sbadaddr: ffffffd000000000 scause: 000000000000000d
    [    0.177025] ---[ end trace 6c558b3bc461e566 ]---
    [    0.177340] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
    [    0.177785] SMP: stopping secondary CPUs
    [    0.178040] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---

The deconfig I still use the 4.15 old version, and with change 1 & 2 spike can boot linux 4.15, and I have no idea for this problem, thanks in advance.


(Jim Wilson) #2

The old freedom-u-sdk is a mixture of upstream stuff and non-upstream stuff. It was created before upstream buildroot had working RISC-V support. It isn’t a good idea to try to update it. If you want to continue using buildroot, you would probably be better off dropping freedom-u-sdk and just using upstream buildroot directly. I’ve never built the upstream buildroot so I don’t know what shape it is in. Hopefully someone is maintaining it and it works.

The current freedom-u-sdk is a layer for OpenEmbedded, and is reasonably up-to-date for the toolchain, glibc, linux kernel, etc. If you want a newer system that might be worth trying. I have no idea if this will work on spike though, probably not.

Unfortunately, I’m not aware of anyone maintaining a linux kernel that can boot on spike. It would be a useful thing to have, but it will exist only if someone does the work, and no one is volunteering to do that work.


(John Fireman) #3

Thanks, but the OE version is too huge, which more than 20+G… And the repositories organization is a bit messy, I prefer the v1 style :joy:
And I really want to use some tools to help me to generate the rootfs, I had succeed build a static rootfs using busybox 1.3 for linux 5.3.7 and boot successfully on spike, but it can only run elf compiled statically…
I notice my HFU board is dymanic link so I just want buildroot to help me to config busybox to support dynamic link.
Actually, if I directlly use busybox instead of buildroot and compiled dynamically I will miss the same error like above, so I agree with you, the problem may be is on buildroot, thanks.
By the way, which tool does v2 now choose to create rootfs ?


(John Fireman) #4

Wow I had successed just before, great thanks to you ! This is the best Christmas gift for me :joy:
Merry Christmas!


(Jim Wilson) #5

There are 3 versions of freedom-u-sdk. The first version was buildroot pre-RISC-V support, with external toolchain and kernel. The second version was buildroot post-RISC-V support plus external u-boot and kernel, and an optional Debian rootfs to use with u-boot instead of buildroot initramfs. The third version is an OpenEmbedded layer.