Skip to content
  1. Aug 02, 2023
  2. Jul 31, 2023
  3. Aug 18, 2022
  4. Jun 01, 2022
  5. May 13, 2022
  6. May 07, 2022
  7. Mar 30, 2022
  8. Mar 28, 2022
  9. Mar 23, 2022
  10. Mar 20, 2022
  11. Mar 11, 2022
    • Guo Ren's avatar
      riscv: Fixup mix rv64 & rv32 running · e203c6aa
      Guo Ren authored
      
      
      [  559.348135] run_ltp.sh[186]: unhandled signal 11 code 0x1 at 0x00000000ff91bca0 in busybox[10000+13d000]
      [  559.358679] CPU: 0 PID: 186 Comm: run_ltp.sh Not tainted 5.10.4 #3
      [  559.365135] epc: 000000000008d67e ra : 000000000008d674 sp : 0000003fff91bca0
      [  559.372457]  gp : 0000000000150548 tp : 00000000001537a0 t0 : 0000000000000000
      [  559.379856]  t1 : 2f2f2f2f2f2f2f2f t2 : 000000000000006a s0 : 0000000000154798
      [  559.387225]  s1 : 0000000000141eef a0 : 000000000008e4a0 a1 : 00000000001547f0
      [  559.394598]  a2 : 0000000000154810 a3 : 000000000000002f a4 : 000000000000002f
      [  559.401969]  a5 : 0000000000000000 a6 : 7efefefefefefeff a7 : 00000000000000dd
      [  559.409333]  s2 : 0000000000103960 s3 : 0000000000000008 s4 : 0000000000153828
      [  559.416696]  s5 : 0000000000000000 s6 : 00000000001547d0 s7 : 0000000000000000
      [  559.425234]  s8 : 0000000000000000 s9 : 0000000000157fc0 s10: 00000000001547f0
      [  559.432662]  s11: 0000000000000001 t3 : ffffffffffffffff t4 : 0000003ff683e1a8
      [  559.440022]  t5 : 0000000000000005 t6 : ffffffffffffffff
      [  559.445504] status: 8000000100006620 badaddr: 00000000ff91bca0 cause: 000000000000000d
      Segmentation fault
      
      The status shows in UXL_32 mmde, but busybox is 64bit elf.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      e203c6aa
  12. Mar 10, 2022
  13. Jan 24, 2022
  14. Jan 15, 2022
  15. Jan 14, 2022
    • Guo Ren's avatar
      riscv: thead: Add vector compat ptrace support · 9ee341f8
      Guo Ren authored
      
      
      GDB could debug rv32 vector register.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      9ee341f8
    • Guo Ren's avatar
      riscv: thead: Fixup public qemu boot failed · c7e2253a
      Guo Ren authored
      
      
      Public qemu don't support thead custom dma sync instructions.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      c7e2253a
    • Vincent Chen's avatar
      riscv: Add 3 SBI wrapper functions to get cpu manufacturer information · bc7194b2
      Vincent Chen authored
      
      
      Add 3 wrapper functions to get vendor id, architecture id and implement id
      from M-mode
      
      Signed-off-by: default avatarVincent Chen <vincent.chen@sifive.com>
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      bc7194b2
    • Guo Ren's avatar
      riscv: compat: ptrace: Add compat_arch_ptrace implement · be50f0f4
      Guo Ren authored
      Now, you can use native gdb on riscv64 for rv32 app debugging.
      
      $ uname -a
      Linux buildroot 5.16.0-rc4-00036-gbef6b82fdf23-dirty #53 SMP Mon Dec 20 23:06:53 CST 2021 riscv64 GNU/Linux
      $ cat /proc/cpuinfo
      processor       : 0
      hart            : 0
      isa             : rv64imafdcsuh
      mmu             : sv48
      
      $ file /bin/busybox
      /bin/busybox: setuid ELF 32-bit LSB shared object, UCB RISC-V, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-riscv32-ilp32d.so.1, for GNU/Linux 5.15.0, stripped
      $ file /usr/bin/gdb
      /usr/bin/gdb: ELF 32-bit LSB shared object, UCB RISC-V, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-riscv32-ilp32d.so.1, for GNU/Linux 5.15.0, stripped
      $ /usr/bin/gdb /bin/busybox
      GNU gdb (GDB) 10.2
      Copyright (C) 2021 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
      
      >
      ...
      Reading symbols from /bin/busybox...
      (No debugging symbols found in /bin/busybox)
      (gdb) b main
      Breakpoint 1 at 0x8ddc
      (gdb) r
      Starting program: /bin/busybox
      Failed to read a valid object file image from memory.
      
      Breakpoint 1, 0x555a8ddc in main ()
      (gdb) i r
      ra             0x77df0b74       0x77df0b74
      sp             0x7fdd3d10       0x7fdd3d10
      gp             0x5567e800       0x5567e800 <bb_common_bufsiz1+160>
      tp             0x77f64280       0x77f64280
      t0             0x0      0
      t1             0x555a6fac       1431990188
      t2             0x77dd8db4       2011008436
      fp             0x7fdd3e34       0x7fdd3e34
      s1             0x7fdd3e34       2145205812
      a0             0xffffffff       -1
      a1             0x2000   8192
      a2             0x7fdd3e3c       2145205820
      a3             0x0      0
      a4             0x7fdd3d30       2145205552
      a5             0x555a8dc0       1431997888
      a6             0x77f2c170       2012397936
      a7             0x6a7c7a2f       1786542639
      s2             0x0      0
      s3             0x0      0
      s4             0x555a8dc0       1431997888
      s5             0x77f8a3a8       2012783528
      s6             0x7fdd3e3c       2145205820
      s7             0x5567cecc       1432866508
      --Type <RET> for more, q to quit, c to continue without paging--
      s8             0x1      1
      s9             0x0      0
      s10            0x55634448       1432568904
      s11            0x0      0
      t3             0x77df0bb8       2011106232
      t4             0x42fc   17148
      t5             0x0      0
      t6             0x40     64
      pc             0x555a8ddc       0x555a8ddc <main+28>
      (gdb) si
      0x555a78f0 in mallopt@plt ()
      (gdb) c
      Continuing.
      BusyBox v1.34.1 (2021-12-19 22:39:48 CST) multi-call binary.
      BusyBox is copyrighted by many authors between 1998-2015.
      Licensed under GPLv2. See source distribution for detailed
      copyright notices.
      
      Usage: busybox [function [arguments]...]
         or: busybox --list[-full]
      ...
      [Inferior 1 (process 107) exited normally]
      (gdb) q
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      be50f0f4
    • Guo Ren's avatar
      riscv: compat: signal: Add rt_frame implementation · abe76d90
      Guo Ren authored
      
      
      Implement compat_setup_rt_frame for sigcontext save & restore. The
      main process is the same with signal, but the rv32 pt_regs' size
      is different from rv64's, so we needs convert them.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      abe76d90
    • Guo Ren's avatar
      riscv: compat: vdso: Add setup additional pages implementation · 089d373f
      Guo Ren authored
      
      
      Reconstruct __setup_additional_pages() by appending vdso info
      pointer argument to meet compat_vdso_info requirement. And change
      vm_special_mapping *dm, *cm initialization into static.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      089d373f
    • Guo Ren's avatar
      riscv: compat: vdso: Add rv32 VDSO base code implementation · bbd66952
      Guo Ren authored
      
      
      There is no vgettimeofday supported in rv32 that makes simple to
      generate rv32 vdso code which only needs riscv64 compiler. Other
      architectures need change compiler or -m (machine parameter) to
      support vdso32 compiling. If rv32 support vgettimeofday (which
      cause C compile) in future, we would add CROSS_COMPILE to support
      that makes more requirement on compiler enviornment.
      
      linux-rv64/arch/riscv/kernel/compat_vdso/compat_vdso.so.dbg:
      file format elf64-littleriscv
      
      Disassembly of section .text:
      
      0000000000000800 <__vdso_rt_sigreturn>:
       800:   08b00893                li      a7,139
       804:   00000073                ecall
       808:   0000                    unimp
              ...
      
      000000000000080c <__vdso_getcpu>:
       80c:   0a800893                li      a7,168
       810:   00000073                ecall
       814:   8082                    ret
              ...
      
      0000000000000818 <__vdso_flush_icache>:
       818:   10300893                li      a7,259
       81c:   00000073                ecall
       820:   8082                    ret
      
      linux-rv32/arch/riscv/kernel/vdso/vdso.so.dbg:
      file format elf32-littleriscv
      
      Disassembly of section .text:
      
      00000800 <__vdso_rt_sigreturn>:
       800:   08b00893                li      a7,139
       804:   00000073                ecall
       808:   0000                    unimp
              ...
      
      0000080c <__vdso_getcpu>:
       80c:   0a800893                li      a7,168
       810:   00000073                ecall
       814:   8082                    ret
              ...
      
      00000818 <__vdso_flush_icache>:
       818:   10300893                li      a7,259
       81c:   00000073                ecall
       820:   8082                    ret
      
      Finally, reuse all *.S from vdso in compat_vdso that makes
      implementation clear and readable.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      bbd66952
    • Guo Ren's avatar
      riscv: compat: Add COMPAT Kbuild skeletal support · 3deee471
      Guo Ren authored
      
      
      Adds initial skeletal COMPAT Kbuild (Runing 32bit U-mode on 64bit
      S-mode) support.
       - Setup kconfig & dummy functions for compiling.
       - Implement compat_start_thread by the way.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      3deee471
  16. Jan 13, 2022