RISC-V: Add a syscall for HW probing
authorEvan Green <evan@rivosinc.com>
Fri, 7 Apr 2023 23:10:59 +0000 (16:10 -0700)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 18 Apr 2023 22:48:14 +0000 (15:48 -0700)
commitea3de9ce8aa280c5175c835bd3e94a3a9b814b74
tree835575d48af67ab432d8e3497d9156538f8e6668
parentff77cf5b2e033d0bb5e3b7f83ebf65c5adc20d12
RISC-V: Add a syscall for HW probing

We don't have enough space for these all in ELF_HWCAP{,2} and there's no
system call that quite does this, so let's just provide an arch-specific
one to probe for hardware capabilities.  This currently just provides
m{arch,imp,vendor}id, but with the key-value pairs we can pass more in
the future.

Co-developed-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Evan Green <evan@rivosinc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Tested-by: Heiko Stuebner <heiko.stuebner@vrull.eu>
Reviewed-by: Paul Walmsley <paul.walmsley@sifive.com>
Link: https://lore.kernel.org/r/20230407231103.2622178-3-evan@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Documentation/riscv/hwprobe.rst [new file with mode: 0644]
Documentation/riscv/index.rst
arch/riscv/include/asm/hwprobe.h [new file with mode: 0644]
arch/riscv/include/asm/syscall.h
arch/riscv/include/uapi/asm/hwprobe.h [new file with mode: 0644]
arch/riscv/include/uapi/asm/unistd.h
arch/riscv/kernel/sys_riscv.c