mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dave Martin <Dave.Martin@arm.com>
To: linux-kernel@vger.kernel.org
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Oleg Nesterov <oleg@redhat.com>, Kees Cook <kees@kernel.org>,
	Akihiko Odaki <akihiko.odaki@daynix.com>,
	linux-mips@vger.kernel.org
Subject: [PATCH 11/23] MIPS: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names
Date: Tue,  1 Jul 2025 14:56:04 +0100	[thread overview]
Message-ID: <20250701135616.29630-12-Dave.Martin@arm.com> (raw)
In-Reply-To: <20250701135616.29630-1-Dave.Martin@arm.com>

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: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Kees Cook <kees@kernel.org>
Cc: Akihiko Odaki <akihiko.odaki@daynix.com>
Cc: linux-mips@vger.kernel.org
---
 arch/mips/kernel/ptrace.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/mips/kernel/ptrace.c b/arch/mips/kernel/ptrace.c
index b890d64d352c..3f4c94c88124 100644
--- a/arch/mips/kernel/ptrace.c
+++ b/arch/mips/kernel/ptrace.c
@@ -935,7 +935,7 @@ int regs_query_register_offset(const char *name)
 
 static const struct user_regset mips_regsets[] = {
 	[REGSET_GPR] = {
-		.core_note_type	= NT_PRSTATUS,
+		USER_REGSET_NOTE_TYPE(PRSTATUS),
 		.n		= ELF_NGREG,
 		.size		= sizeof(unsigned int),
 		.align		= sizeof(unsigned int),
@@ -943,7 +943,7 @@ static const struct user_regset mips_regsets[] = {
 		.set		= gpr32_set,
 	},
 	[REGSET_DSP] = {
-		.core_note_type	= NT_MIPS_DSP,
+		USER_REGSET_NOTE_TYPE(MIPS_DSP),
 		.n		= NUM_DSP_REGS + 1,
 		.size		= sizeof(u32),
 		.align		= sizeof(u32),
@@ -953,7 +953,7 @@ static const struct user_regset mips_regsets[] = {
 	},
 #ifdef CONFIG_MIPS_FP_SUPPORT
 	[REGSET_FPR] = {
-		.core_note_type	= NT_PRFPREG,
+		USER_REGSET_NOTE_TYPE(PRFPREG),
 		.n		= ELF_NFPREG,
 		.size		= sizeof(elf_fpreg_t),
 		.align		= sizeof(elf_fpreg_t),
@@ -961,7 +961,7 @@ static const struct user_regset mips_regsets[] = {
 		.set		= fpr_set,
 	},
 	[REGSET_FP_MODE] = {
-		.core_note_type	= NT_MIPS_FP_MODE,
+		USER_REGSET_NOTE_TYPE(MIPS_FP_MODE),
 		.n		= 1,
 		.size		= sizeof(int),
 		.align		= sizeof(int),
@@ -971,7 +971,7 @@ static const struct user_regset mips_regsets[] = {
 #endif
 #ifdef CONFIG_CPU_HAS_MSA
 	[REGSET_MSA] = {
-		.core_note_type	= NT_MIPS_MSA,
+		USER_REGSET_NOTE_TYPE(MIPS_MSA),
 		.n		= NUM_FPU_REGS + 1,
 		.size		= 16,
 		.align		= 16,
@@ -995,7 +995,7 @@ static const struct user_regset_view user_mips_view = {
 
 static const struct user_regset mips64_regsets[] = {
 	[REGSET_GPR] = {
-		.core_note_type	= NT_PRSTATUS,
+		USER_REGSET_NOTE_TYPE(PRSTATUS),
 		.n		= ELF_NGREG,
 		.size		= sizeof(unsigned long),
 		.align		= sizeof(unsigned long),
@@ -1003,7 +1003,7 @@ static const struct user_regset mips64_regsets[] = {
 		.set		= gpr64_set,
 	},
 	[REGSET_DSP] = {
-		.core_note_type	= NT_MIPS_DSP,
+		USER_REGSET_NOTE_TYPE(MIPS_DSP),
 		.n		= NUM_DSP_REGS + 1,
 		.size		= sizeof(u64),
 		.align		= sizeof(u64),
@@ -1013,7 +1013,7 @@ static const struct user_regset mips64_regsets[] = {
 	},
 #ifdef CONFIG_MIPS_FP_SUPPORT
 	[REGSET_FP_MODE] = {
-		.core_note_type	= NT_MIPS_FP_MODE,
+		USER_REGSET_NOTE_TYPE(MIPS_FP_MODE),
 		.n		= 1,
 		.size		= sizeof(int),
 		.align		= sizeof(int),
@@ -1021,7 +1021,7 @@ static const struct user_regset mips64_regsets[] = {
 		.set		= fp_mode_set,
 	},
 	[REGSET_FPR] = {
-		.core_note_type	= NT_PRFPREG,
+		USER_REGSET_NOTE_TYPE(PRFPREG),
 		.n		= ELF_NFPREG,
 		.size		= sizeof(elf_fpreg_t),
 		.align		= sizeof(elf_fpreg_t),
@@ -1031,7 +1031,7 @@ static const struct user_regset mips64_regsets[] = {
 #endif
 #ifdef CONFIG_CPU_HAS_MSA
 	[REGSET_MSA] = {
-		.core_note_type	= NT_MIPS_MSA,
+		USER_REGSET_NOTE_TYPE(MIPS_MSA),
 		.n		= NUM_FPU_REGS + 1,
 		.size		= 16,
 		.align		= 16,
-- 
2.34.1


  parent reply	other threads:[~2025-07-01 13:56 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-01 13:55 [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump " Dave Martin
2025-07-01 13:55 ` [PATCH 01/23] regset: Fix kerneldoc for struct regset_get() in user_regset Dave Martin
2025-07-01 13:55 ` [PATCH 02/23] regset: Add explicit core note name in struct user_regset Dave Martin
2025-07-09 11:57   ` Alexander Gordeev
2025-07-01 13:55 ` [PATCH 03/23] binfmt_elf: Dump non-arch notes with strictly matching name and type Dave Martin
2025-07-01 13:55 ` [PATCH 04/23] ARC: ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names Dave Martin
2025-07-01 13:55 ` [PATCH 05/23] ARM: " Dave Martin
2025-07-01 13:55 ` [PATCH 06/23] arm64: " Dave Martin
2025-07-01 13:56 ` [PATCH 07/23] csky: " Dave Martin
2025-07-01 13:56 ` [PATCH 08/23] hexagon: " Dave Martin
2025-07-01 13:56 ` [PATCH 09/23] LoongArch: " Dave Martin
2025-07-01 13:56 ` [PATCH 10/23] m68k: " Dave Martin
2025-07-06  9:25   ` Geert Uytterhoeven
2025-07-07 10:54     ` Dave Martin
2025-07-01 13:56 ` Dave Martin [this message]
2025-07-01 13:56 ` [PATCH 12/23] nios2: " Dave Martin
2025-07-01 13:56 ` [PATCH 13/23] openrisc: " Dave Martin
2025-07-01 13:56 ` [PATCH 14/23] parisc: " Dave Martin
2025-07-01 13:56 ` [PATCH 15/23] powerpc/ptrace: " Dave Martin
2025-07-01 13:56 ` [PATCH 16/23] riscv: ptrace: " Dave Martin
2025-07-01 13:56 ` [PATCH 17/23] s390/ptrace: " Dave Martin
2025-07-09 11:58   ` Alexander Gordeev
2025-07-01 13:56 ` [PATCH 18/23] sh: ptrace: " Dave Martin
2025-07-01 13:56 ` [PATCH 19/23] sparc: " Dave Martin
2025-07-01 13:56 ` [PATCH 20/23] x86/ptrace: " Dave Martin
2025-07-01 13:56 ` [PATCH 21/23] um: ptrace: " Dave Martin
2025-07-04 11:58   ` Johannes Berg
2025-07-04 16:46     ` Dave Martin
2025-07-01 13:56 ` [PATCH 22/23] xtensa: " Dave Martin
2025-07-01 13:56 ` [PATCH 23/23] binfmt_elf: Warn on missing or suspicious " Dave Martin
2025-07-05 15:14   ` Kees Cook
2025-07-07 11:03     ` Dave Martin
2025-07-09  5:05 ` [PATCH 00/23] binfmt_elf,arch/*: Use elf.h for coredump " Akihiko Odaki
2025-07-15  5:37 ` Kees Cook
2025-07-15 10:32   ` Dave Martin
2025-08-10 21:12 ` patchwork-bot+linux-riscv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250701135616.29630-12-Dave.Martin@arm.com \
    --to=dave.martin@arm.com \
    --cc=akihiko.odaki@daynix.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=tsbogend@alpha.franken.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®