Skip to content

Commit d6a883c

Browse files
Dave Martinkees
authored andcommitted
s390/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: Heiko Carstens <hca@linux.ibm.com> Cc: Vasily Gorbik <gor@linux.ibm.com> Cc: Alexander Gordeev <agordeev@linux.ibm.com> Cc: Christian Borntraeger <borntraeger@linux.ibm.com> Cc: Sven Schnelle <svens@linux.ibm.com> Cc: Oleg Nesterov <oleg@redhat.com> Cc: Kees Cook <kees@kernel.org> Cc: Akihiko Odaki <akihiko.odaki@daynix.com> Cc: linux-s390@vger.kernel.org Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Link: https://lore.kernel.org/r/20250701135616.29630-18-Dave.Martin@arm.com Signed-off-by: Kees Cook <kees@kernel.org>
1 parent c9502cc commit d6a883c

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

arch/s390/kernel/ptrace.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,79 +1209,79 @@ static int s390_runtime_instr_set(struct task_struct *target,
12091209

12101210
static const struct user_regset s390_regsets[] = {
12111211
{
1212-
.core_note_type = NT_PRSTATUS,
1212+
USER_REGSET_NOTE_TYPE(PRSTATUS),
12131213
.n = sizeof(s390_regs) / sizeof(long),
12141214
.size = sizeof(long),
12151215
.align = sizeof(long),
12161216
.regset_get = s390_regs_get,
12171217
.set = s390_regs_set,
12181218
},
12191219
{
1220-
.core_note_type = NT_PRFPREG,
1220+
USER_REGSET_NOTE_TYPE(PRFPREG),
12211221
.n = sizeof(s390_fp_regs) / sizeof(long),
12221222
.size = sizeof(long),
12231223
.align = sizeof(long),
12241224
.regset_get = s390_fpregs_get,
12251225
.set = s390_fpregs_set,
12261226
},
12271227
{
1228-
.core_note_type = NT_S390_SYSTEM_CALL,
1228+
USER_REGSET_NOTE_TYPE(S390_SYSTEM_CALL),
12291229
.n = 1,
12301230
.size = sizeof(unsigned int),
12311231
.align = sizeof(unsigned int),
12321232
.regset_get = s390_system_call_get,
12331233
.set = s390_system_call_set,
12341234
},
12351235
{
1236-
.core_note_type = NT_S390_LAST_BREAK,
1236+
USER_REGSET_NOTE_TYPE(S390_LAST_BREAK),
12371237
.n = 1,
12381238
.size = sizeof(long),
12391239
.align = sizeof(long),
12401240
.regset_get = s390_last_break_get,
12411241
.set = s390_last_break_set,
12421242
},
12431243
{
1244-
.core_note_type = NT_S390_TDB,
1244+
USER_REGSET_NOTE_TYPE(S390_TDB),
12451245
.n = 1,
12461246
.size = 256,
12471247
.align = 1,
12481248
.regset_get = s390_tdb_get,
12491249
.set = s390_tdb_set,
12501250
},
12511251
{
1252-
.core_note_type = NT_S390_VXRS_LOW,
1252+
USER_REGSET_NOTE_TYPE(S390_VXRS_LOW),
12531253
.n = __NUM_VXRS_LOW,
12541254
.size = sizeof(__u64),
12551255
.align = sizeof(__u64),
12561256
.regset_get = s390_vxrs_low_get,
12571257
.set = s390_vxrs_low_set,
12581258
},
12591259
{
1260-
.core_note_type = NT_S390_VXRS_HIGH,
1260+
USER_REGSET_NOTE_TYPE(S390_VXRS_HIGH),
12611261
.n = __NUM_VXRS_HIGH,
12621262
.size = sizeof(__vector128),
12631263
.align = sizeof(__vector128),
12641264
.regset_get = s390_vxrs_high_get,
12651265
.set = s390_vxrs_high_set,
12661266
},
12671267
{
1268-
.core_note_type = NT_S390_GS_CB,
1268+
USER_REGSET_NOTE_TYPE(S390_GS_CB),
12691269
.n = sizeof(struct gs_cb) / sizeof(__u64),
12701270
.size = sizeof(__u64),
12711271
.align = sizeof(__u64),
12721272
.regset_get = s390_gs_cb_get,
12731273
.set = s390_gs_cb_set,
12741274
},
12751275
{
1276-
.core_note_type = NT_S390_GS_BC,
1276+
USER_REGSET_NOTE_TYPE(S390_GS_BC),
12771277
.n = sizeof(struct gs_cb) / sizeof(__u64),
12781278
.size = sizeof(__u64),
12791279
.align = sizeof(__u64),
12801280
.regset_get = s390_gs_bc_get,
12811281
.set = s390_gs_bc_set,
12821282
},
12831283
{
1284-
.core_note_type = NT_S390_RI_CB,
1284+
USER_REGSET_NOTE_TYPE(S390_RI_CB),
12851285
.n = sizeof(struct runtime_instr_cb) / sizeof(__u64),
12861286
.size = sizeof(__u64),
12871287
.align = sizeof(__u64),
@@ -1413,87 +1413,87 @@ static int s390_compat_last_break_set(struct task_struct *target,
14131413

14141414
static const struct user_regset s390_compat_regsets[] = {
14151415
{
1416-
.core_note_type = NT_PRSTATUS,
1416+
USER_REGSET_NOTE_TYPE(PRSTATUS),
14171417
.n = sizeof(s390_compat_regs) / sizeof(compat_long_t),
14181418
.size = sizeof(compat_long_t),
14191419
.align = sizeof(compat_long_t),
14201420
.regset_get = s390_compat_regs_get,
14211421
.set = s390_compat_regs_set,
14221422
},
14231423
{
1424-
.core_note_type = NT_PRFPREG,
1424+
USER_REGSET_NOTE_TYPE(PRFPREG),
14251425
.n = sizeof(s390_fp_regs) / sizeof(compat_long_t),
14261426
.size = sizeof(compat_long_t),
14271427
.align = sizeof(compat_long_t),
14281428
.regset_get = s390_fpregs_get,
14291429
.set = s390_fpregs_set,
14301430
},
14311431
{
1432-
.core_note_type = NT_S390_SYSTEM_CALL,
1432+
USER_REGSET_NOTE_TYPE(S390_SYSTEM_CALL),
14331433
.n = 1,
14341434
.size = sizeof(compat_uint_t),
14351435
.align = sizeof(compat_uint_t),
14361436
.regset_get = s390_system_call_get,
14371437
.set = s390_system_call_set,
14381438
},
14391439
{
1440-
.core_note_type = NT_S390_LAST_BREAK,
1440+
USER_REGSET_NOTE_TYPE(S390_LAST_BREAK),
14411441
.n = 1,
14421442
.size = sizeof(long),
14431443
.align = sizeof(long),
14441444
.regset_get = s390_compat_last_break_get,
14451445
.set = s390_compat_last_break_set,
14461446
},
14471447
{
1448-
.core_note_type = NT_S390_TDB,
1448+
USER_REGSET_NOTE_TYPE(S390_TDB),
14491449
.n = 1,
14501450
.size = 256,
14511451
.align = 1,
14521452
.regset_get = s390_tdb_get,
14531453
.set = s390_tdb_set,
14541454
},
14551455
{
1456-
.core_note_type = NT_S390_VXRS_LOW,
1456+
USER_REGSET_NOTE_TYPE(S390_VXRS_LOW),
14571457
.n = __NUM_VXRS_LOW,
14581458
.size = sizeof(__u64),
14591459
.align = sizeof(__u64),
14601460
.regset_get = s390_vxrs_low_get,
14611461
.set = s390_vxrs_low_set,
14621462
},
14631463
{
1464-
.core_note_type = NT_S390_VXRS_HIGH,
1464+
USER_REGSET_NOTE_TYPE(S390_VXRS_HIGH),
14651465
.n = __NUM_VXRS_HIGH,
14661466
.size = sizeof(__vector128),
14671467
.align = sizeof(__vector128),
14681468
.regset_get = s390_vxrs_high_get,
14691469
.set = s390_vxrs_high_set,
14701470
},
14711471
{
1472-
.core_note_type = NT_S390_HIGH_GPRS,
1472+
USER_REGSET_NOTE_TYPE(S390_HIGH_GPRS),
14731473
.n = sizeof(s390_compat_regs_high) / sizeof(compat_long_t),
14741474
.size = sizeof(compat_long_t),
14751475
.align = sizeof(compat_long_t),
14761476
.regset_get = s390_compat_regs_high_get,
14771477
.set = s390_compat_regs_high_set,
14781478
},
14791479
{
1480-
.core_note_type = NT_S390_GS_CB,
1480+
USER_REGSET_NOTE_TYPE(S390_GS_CB),
14811481
.n = sizeof(struct gs_cb) / sizeof(__u64),
14821482
.size = sizeof(__u64),
14831483
.align = sizeof(__u64),
14841484
.regset_get = s390_gs_cb_get,
14851485
.set = s390_gs_cb_set,
14861486
},
14871487
{
1488-
.core_note_type = NT_S390_GS_BC,
1488+
USER_REGSET_NOTE_TYPE(S390_GS_BC),
14891489
.n = sizeof(struct gs_cb) / sizeof(__u64),
14901490
.size = sizeof(__u64),
14911491
.align = sizeof(__u64),
14921492
.regset_get = s390_gs_bc_get,
14931493
.set = s390_gs_bc_set,
14941494
},
14951495
{
1496-
.core_note_type = NT_S390_RI_CB,
1496+
USER_REGSET_NOTE_TYPE(S390_RI_CB),
14971497
.n = sizeof(struct runtime_instr_cb) / sizeof(__u64),
14981498
.size = sizeof(__u64),
14991499
.align = sizeof(__u64),

0 commit comments

Comments
 (0)