- Aug 02, 2023
-
-
Chen Pei authored
Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
-
- Jul 31, 2023
-
-
cp0613 authored
The new THEAD XuanTie C9xx CPU has standard SVPBMT. Signed-off-by: Chen Pei <cp0613@linux.alibaba.com>
-
- Aug 18, 2022
-
-
Guo Ren authored
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Just for testing hw, not ready for toolchain. Fixup headers_install.sh with ptrace.h & VLEN_256 error: ./linux/arch/riscv/include/uapi/asm/ptrace.h: leak CONFIG_VLEN_256 to user-space ./linux/scripts/Makefile.headersinst:63: recipe for target 'usr/include/asm/ptrace.h' failed make[3]: *** [usr/include/asm/ptrace.h] Error 1 ./linux/Makefile:1205: recipe for target 'headers' failed make[2]: *** [headers] Error 2 Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Jun 01, 2022
-
-
Guo Ren authored
Add compile option for T-HEAD ISA. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- May 13, 2022
-
-
Xianting Tian authored
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
-
- May 07, 2022
-
-
Guo Ren authored
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
From 5d700a0f ("kexec: avoid compat_alloc_user_space") Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Changbin Du authored
The RISC-V special option '-mno-relax' which to disable linker relaxations is supported by GCC8+. For GCC7 and lower versions do not support this option. Fixes: fba8a867 ("RISC-V: Add kexec support") Signed-off-by: Changbin Du <changbin.du@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
Nick Kossifidis authored
raw_smp_processor_id() doesn't return the hart id as stated in arch/riscv/include/asm/smp.h, use smp_processor_id() instead to get the cpu id, and cpuid_to_hartid_map() to pass the hart id to the next kernel. This fixes kexec on HiFive Unleashed/Unmatched where cpu ids and hart ids don't match (on qemu-virt they match). Fixes: fba8a867 ("RISC-V: Add kexec support") Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Cc: stable@vger.kernel.org Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
-
Nick Kossifidis authored
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
-
Nick Kossifidis authored
This patch allows Linux to act as a crash kernel for use with kdump. Userspace will let the crash kernel know about the memory region it can use through linux,usable-memory property on the /memory node (overriding its reg property), and about the memory region where the elf core header of the previous kernel is saved, through a reserved-memory node with a compatible string of "linux,elfcorehdr". This approach is the least invasive and re-uses functionality already present. I tested this on riscv64 qemu and it works as expected, you may test it by retrieving the dmesg of the previous kernel through /proc/vmcore, using the vmcore-dmesg utility from kexec-tools. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
Nick Kossifidis authored
Signed-off-by: Xianting Tian <xianting.tian@linux.alibaba.com>
-
Nick Kossifidis authored
This patch adds support for kexec on RISC-V. On SMP systems it depends on HOTPLUG_CPU in order to be able to bring up all harts after kexec. It also needs a recent OpenSBI version that supports the HSM extension. I tested it on riscv64 QEMU on both an smp and a non-smp system. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
Nick Kossifidis authored
Add RISC-V to the list of supported kexec architectures, we need to add the definition early-on so that later patches can use it. EM_RISCV is 243 as per ELF psABI specification here: https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
Nick Kossifidis authored
This patch (previously part of my kexec/kdump series) populates /proc/iomem with the various sections of the kernel image. We need this for kexec-tools to be able to prepare the crashkernel image for kdump to work. Since resource tree initialization is not related to memory initialization I added the code to kernel/setup.c and removed the original code (derived from the arm64 tree) from mm/init.c. Signed-off-by: Nick Kossifidis <mick@ics.forth.gr> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
- Mar 30, 2022
-
-
Guo Ren authored
Some socs needn't SWIOTLB at all. For code size and mem footprint, disable it at compile time. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
The sfence.vma may have performance issues, so we use CSR_SMCIR to replace sfence.vma. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Mar 28, 2022
-
-
Guo Ren authored
When CONFIG_SMP=n, it will cause compile error. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Mar 23, 2022
-
-
Guo Ren authored
Fixup fadvise64_64 arguments error for ltp test with posix_fadvise03. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Mar 20, 2022
-
-
Guo Ren authored
Fixup Segmentation fault when rv32 exec rv64 binary. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Mar 11, 2022
-
-
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: Guo Ren <guoren@linux.alibaba.com>
-
- Mar 10, 2022
-
-
Guo Ren authored
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Jan 24, 2022
-
-
Guo Ren authored
- Fixup sysbench --test=threads performance issue Moving sys_call_table into rodata - Fixup CONFIG_COMPAT disabled compile error Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Jan 15, 2022
-
-
Guo Ren authored
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
We should use include "../vdso/xxx". arch/riscv/kernel/compat_vdso/rt_sigreturn.S:3:10: fatal error: ../vdso/rt_sigreturn.S: No such file or directory Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
- Jan 14, 2022
-
-
Guo Ren authored
GDB could debug rv32 vector register. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Public qemu don't support thead custom dma sync instructions. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Vincent Chen authored
Add 3 wrapper functions to get vendor id, architecture id and implement id from M-mode Signed-off-by: Vincent Chen <vincent.chen@sifive.com> Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
-
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: Guo Ren <guoren@linux.alibaba.com>
-
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: Guo Ren <guoren@linux.alibaba.com>
-
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: Guo Ren <guoren@linux.alibaba.com>
-
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: Guo Ren <guoren@linux.alibaba.com>
-
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: Guo Ren <guoren@linux.alibaba.com>
-
- Jan 13, 2022
-
-
Guo Ren authored
Implement necessary type and macro for compat elf. See the code comment for detail. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Implement the entry of compat_sys_call_table[] in asm. Ref to riscv-privileged spec 4.1.1 Supervisor Status Register (sstatus): BIT[32:33] = UXL[1:0]: - 1:32 - 2:64 - 3:128 Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Implement compat_syscall_table.c with compat_sys_call_table & fixup system call such as truncate64,pread64,fallocate which need two regs to indicate 64bit-arg (copied from arm64). Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Make TASK_SIZE from const to dynamic detect TIF_32BIT flag function. Refer to arm64 to implement DEFAULT_MAP_WINDOW_64 for efi-stub. Limit 32-bit compatible process in 0-2GB virtual address range (which is enough for real scenarios), because it could avoid address sign extend problem when 32-bit enter 64-bit and ease software design. The standard 32-bit TASK_SIZE is 0x9dc00000:FIXADDR_START, and compared to a compatible 32-bit, it increases 476MB for the application's virtual address. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Implement asm/compat.h for struct compat_xxx, RLIM_INFINITY, OFF_T_MAX, is_compat_task, compat_user_regset, regset convert. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-
Guo Ren authored
Make "uapi asm unistd.h" could be used for architectures' COMPAT mode. The __SYSCALL_COMPAT is first used in riscv. Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
-