05 Oct, 2020

1 commit


19 Mar, 2020

1 commit

  • It might have the unaligned access exception when trying to exchange data
    with user space program. In this case, it failed in tty_ioctl(). Therefore
    we should enable uaccess.S for NOMMU mode since the generic code doesn't
    handle the unaligned access cases.

    0x8013a212 : ld a5,460(s1)

    [ 0.115279] Oops - load address misaligned [#1]
    [ 0.115284] CPU: 0 PID: 29 Comm: sh Not tainted 5.4.0-rc5-00020-gb4c27160d562-dirty #36
    [ 0.115294] epc: 000000008013a212 ra : 000000008013a212 sp : 000000008f48dd50
    [ 0.115303] gp : 00000000801cac28 tp : 000000008fb80000 t0 : 00000000000000e8
    [ 0.115312] t1 : 000000008f58f108 t2 : 0000000000000009 s0 : 000000008f48ddf0
    [ 0.115321] s1 : 000000008f8c6220 a0 : 0000000000000001 a1 : 000000008f48dd28
    [ 0.115330] a2 : 000000008fb80000 a3 : 00000000801a7398 a4 : 0000000000000000
    [ 0.115339] a5 : 0000000000000000 a6 : 000000008f58f0c6 a7 : 000000000000001d
    [ 0.115348] s2 : 000000008f8c6308 s3 : 000000008f78b7c8 s4 : 000000008fb834c0
    [ 0.115357] s5 : 0000000000005413 s6 : 0000000000000000 s7 : 000000008f58f2b0
    [ 0.115366] s8 : 000000008f858008 s9 : 000000008f776818 s10: 000000008f776830
    [ 0.115375] s11: 000000008fb840a8 t3 : 1999999999999999 t4 : 000000008f78704c
    [ 0.115384] t5 : 0000000000000005 t6 : 0000000000000002
    [ 0.115391] status: 0000000200001880 badaddr: 000000008f8c63ec cause: 0000000000000004
    [ 0.115401] ---[ end trace 00d490c6a8b6c9ac ]---

    This failure could be fixed after this patch applied.

    [ 0.002282] Run /init as init process
    Initializing random number generator... [ 0.005573] random: dd: uninitialized urandom read (512 bytes read)
    done.

    Welcome to Buildroot
    buildroot login: root
    Password:
    Jan 1 00:00:00 login[62]: root login on 'ttySIF0'
    ~ #

    Signed-off-by: Greentime Hu
    Reviewed-by: Palmer Dabbelt
    Signed-off-by: Palmer Dabbelt

    Greentime Hu
     

18 Nov, 2019

1 commit

  • The kernel runs in M-mode without using page tables, and thus can't run
    bare metal without help from additional firmware.

    Most of the patch is just stubbing out code not needed without page
    tables, but there is an interesting detail in the signals implementation:

    - The normal RISC-V syscall ABI only implements rt_sigreturn as VDSO
    entry point, but the ELF VDSO is not supported for nommu Linux.
    We instead copy the code to call the syscall onto the stack.

    In addition to enabling the nommu code a new defconfig for a small
    kernel image that can run in nommu mode on qemu is also provided, to run
    a kernel in qemu you can use the following command line:

    qemu-system-riscv64 -smp 2 -m 64 -machine virt -nographic \
    -kernel arch/riscv/boot/loader \
    -drive file=rootfs.ext2,format=raw,id=hd0 \
    -device virtio-blk-device,drive=hd0

    Contains contributions from Damien Le Moal .

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Anup Patel
    [paul.walmsley@sifive.com: updated to apply; add CONFIG_MMU guards
    around PCI_IOBASE definition to fix build issues; fixed checkpatch
    issues; move the PCI_IO_* and VMEMMAP address space macros along
    with the others; resolve sparse warning]
    Signed-off-by: Paul Walmsley

    Christoph Hellwig
     

09 Aug, 2019

1 commit

  • This should never have landed in the first place: it was added as part
    of 64-bit divide support for 32-bit systems, but the kernel doesn't
    allow this sort of division. I must have forgotten to remove it.

    This patch removes the support. Since this routine only worked on
    64-bit platforms but was only built on 32-bit platforms, it's
    essentially just nonsense anyway.

    Signed-off-by: Palmer Dabbelt
    Acked-by: Nicolas Pitre
    Link: https://lore.kernel.org/linux-riscv/nycvar.YSQ.7.76.1908061413360.19480@knanqh.ubzr/T/#t
    Reported-by: Eric Lin
    Signed-off-by: Paul Walmsley

    Palmer Dabbelt
     

21 May, 2019

1 commit


13 Nov, 2018

1 commit

  • Fixes the following build error from tinyconfig:

    riscv64-unknown-linux-gnu-ld: kernel/sched/fair.o: in function `.L8':
    fair.c:(.text+0x70): undefined reference to `__lshrti3'
    riscv64-unknown-linux-gnu-ld: kernel/time/clocksource.o: in function `.L0 ':
    clocksource.c:(.text+0x334): undefined reference to `__lshrti3'

    Fixes: 7f47c73b355f ("RISC-V: Build tishift only on 64-bit")
    Signed-off-by: Olof Johansson
    Signed-off-by: Palmer Dabbelt

    Olof Johansson
     

23 Oct, 2018

1 commit


13 Aug, 2018

1 commit


27 Sep, 2017

1 commit

  • This patch contains all the build infrastructure that actually enables
    the RISC-V port. This includes Makefiles, linker scripts, and Kconfig
    files. It also contains the only top-level change, which adds RISC-V to
    the list of architectures that need a sed run to produce the ARCH
    variable when building locally.

    Signed-off-by: Palmer Dabbelt

    Palmer Dabbelt