Skip to content

Commit c9502cc

Browse files
Dave Martinkees
authored andcommitted
riscv: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
Instead of having the core code guess the note name for each regset, use USER_REGSET_NOTE_TYPE() to pick the correct name from elf.h. Signed-off-by: Dave Martin <Dave.Martin@arm.com> Cc: Paul Walmsley <paul.walmsley@sifive.com> Cc: Palmer Dabbelt <palmer@dabbelt.com> Cc: Albert Ou <aou@eecs.berkeley.edu> Cc: Alexandre Ghiti <alex@ghiti.fr> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Kees Cook <kees@kernel.org> Cc: Akihiko Odaki <akihiko.odaki@daynix.com> Cc: linux-riscv@lists.infradead.org Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Link: https://lore.kernel.org/r/20250701135616.29630-17-Dave.Martin@arm.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 307035a commit c9502cc

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

arch/riscv/kernel/ptrace.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int tagged_addr_ctrl_set(struct task_struct *target,
186186

187187
static const struct user_regset riscv_user_regset[] = {
188188
[REGSET_X] = {
189-
.core_note_type = NT_PRSTATUS,
189+
USER_REGSET_NOTE_TYPE(PRSTATUS),
190190
.n = ELF_NGREG,
191191
.size = sizeof(elf_greg_t),
192192
.align = sizeof(elf_greg_t),
@@ -195,7 +195,7 @@ static const struct user_regset riscv_user_regset[] = {
195195
},
196196
#ifdef CONFIG_FPU
197197
[REGSET_F] = {
198-
.core_note_type = NT_PRFPREG,
198+
USER_REGSET_NOTE_TYPE(PRFPREG),
199199
.n = ELF_NFPREG,
200200
.size = sizeof(elf_fpreg_t),
201201
.align = sizeof(elf_fpreg_t),
@@ -205,7 +205,7 @@ static const struct user_regset riscv_user_regset[] = {
205205
#endif
206206
#ifdef CONFIG_RISCV_ISA_V
207207
[REGSET_V] = {
208-
.core_note_type = NT_RISCV_VECTOR,
208+
USER_REGSET_NOTE_TYPE(RISCV_VECTOR),
209209
.align = 16,
210210
.n = ((32 * RISCV_MAX_VLENB) +
211211
sizeof(struct __riscv_v_regset_state)) / sizeof(__u32),
@@ -216,7 +216,7 @@ static const struct user_regset riscv_user_regset[] = {
216216
#endif
217217
#ifdef CONFIG_RISCV_ISA_SUPM
218218
[REGSET_TAGGED_ADDR_CTRL] = {
219-
.core_note_type = NT_RISCV_TAGGED_ADDR_CTRL,
219+
USER_REGSET_NOTE_TYPE(RISCV_TAGGED_ADDR_CTRL),
220220
.n = 1,
221221
.size = sizeof(long),
222222
.align = sizeof(long),
@@ -380,7 +380,7 @@ static int compat_riscv_gpr_set(struct task_struct *target,
380380

381381
static const struct user_regset compat_riscv_user_regset[] = {
382382
[REGSET_X] = {
383-
.core_note_type = NT_PRSTATUS,
383+
USER_REGSET_NOTE_TYPE(PRSTATUS),
384384
.n = ELF_NGREG,
385385
.size = sizeof(compat_elf_greg_t),
386386
.align = sizeof(compat_elf_greg_t),
@@ -389,7 +389,7 @@ static const struct user_regset compat_riscv_user_regset[] = {
389389
},
390390
#ifdef CONFIG_FPU
391391
[REGSET_F] = {
392-
.core_note_type = NT_PRFPREG,
392+
USER_REGSET_NOTE_TYPE(PRFPREG),
393393
.n = ELF_NFPREG,
394394
.size = sizeof(elf_fpreg_t),
395395
.align = sizeof(elf_fpreg_t),

0 commit comments

Comments
 (0)