OSDN Git Service

riscv: Add ptrace vector support
authorGreentime Hu <greentime.hu@sifive.com>
Mon, 5 Jun 2023 11:07:09 +0000 (11:07 +0000)
committerPalmer Dabbelt <palmer@rivosinc.com>
Thu, 8 Jun 2023 14:16:45 +0000 (07:16 -0700)
commit0c59922c769a1361d4699ef6694b59031767a74e
treea2d8afd8e3dc5bb44ba3a4ba4cc1a28dbc0f8435
parentcd054837243b5f36ff395c21135ff153871180f1
riscv: Add ptrace vector support

This patch adds ptrace support for riscv vector. The vector registers will
be saved in datap pointer of __riscv_v_ext_state. This pointer will be set
right after the __riscv_v_ext_state data structure then it will be put in
ubuf for ptrace system call to get or set. It will check if the datap got
from ubuf is set to the correct address or not when the ptrace system call
is trying to set the vector registers.

Co-developed-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Signed-off-by: Greentime Hu <greentime.hu@sifive.com>
Signed-off-by: Andy Chiu <andy.chiu@sifive.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Palmer Dabbelt <palmer@rivosinc.com>
Link: https://lore.kernel.org/r/20230605110724.21391-13-andy.chiu@sifive.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
arch/riscv/include/uapi/asm/ptrace.h
arch/riscv/kernel/ptrace.c
include/uapi/linux/elf.h