On Fri, Feb 24, 2023 at 05:01:10PM +0000, Andy Chiu wrote: > From: Greentime Hu <greentime.hu@xxxxxxxxxx> > > 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@xxxxxxxxxx> > Signed-off-by: Vincent Chen <vincent.chen@xxxxxxxxxx> > Signed-off-by: Greentime Hu <greentime.hu@xxxxxxxxxx> > Signed-off-by: Andy Chiu <andy.chiu@xxxxxxxxxx> > --- > +static int riscv_vr_get(struct task_struct *target, > + const struct user_regset *regset, > + struct membuf to) > +{ > + struct __riscv_v_ext_state *vstate = &target->thread.vstate; > + > + if (!riscv_v_vstate_query(task_pt_regs(target))) > + return -EINVAL; > + /* With the tiny nit of a missing newline after the return, both here and in _get(), this looks grand to me. Reviewed-by: Conor Dooley <conor.dooley@xxxxxxxxxxxxx> Thanks, Conor.
Attachment:
signature.asc
Description: PGP signature