From nobody Wed Oct 8 07:45:00 2025 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B0E52798E6; Tue, 1 Jul 2025 13:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751378211; cv=none; b=mFrnNVKNjWaGLBjVj+UpwaHTPKCbtHyLmA4IRFRDxaQBqN3NCOfiNvETdV3ABTUAqt5jVyBs3poM5vH/khP769fwaGxCwyvKxkxzkAdBubF5mmCFjVZRaf3HwP6TCZxW+CbMu6Saxlyiwq+uQ/hgi4x1RoyWrrFBTNuS8B/Zs7s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751378211; c=relaxed/simple; bh=u99rUQTMdWLVEwxqQcav+sqGA2U6uY/gTG9CZE6Ajp8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UFDUVh0xI1G5MfU27y1uguYnMYCqVB1tziwvsa//fstNEfOMVyCb3I2xqrOIPzw0M2wilnEzSIHblvy0geOZWGS+lzTzSk58p44tA2Bmdc8QnV7uY+KxYCJJ5P899vPLZYrGGbOVU4vAuPrHC4IkIrYWVfQSq3f9fOB25WrZydI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 303DF2E99; Tue, 1 Jul 2025 06:56:34 -0700 (PDT) Received: from e133380.cambridge.arm.com (e133380.arm.com [10.1.197.52]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3DE563F58B; Tue, 1 Jul 2025 06:56:48 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Thomas Bogendoerfer , Oleg Nesterov , Kees Cook , Akihiko Odaki , 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 Message-Id: <20250701135616.29630-12-Dave.Martin@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250701135616.29630-1-Dave.Martin@arm.com> References: <20250701135616.29630-1-Dave.Martin@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 Cc: Thomas Bogendoerfer Cc: Oleg Nesterov Cc: Kees Cook Cc: Akihiko Odaki 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) =20 static const struct user_regset mips_regsets[] =3D { [REGSET_GPR] =3D { - .core_note_type =3D NT_PRSTATUS, + USER_REGSET_NOTE_TYPE(PRSTATUS), .n =3D ELF_NGREG, .size =3D sizeof(unsigned int), .align =3D sizeof(unsigned int), @@ -943,7 +943,7 @@ static const struct user_regset mips_regsets[] =3D { .set =3D gpr32_set, }, [REGSET_DSP] =3D { - .core_note_type =3D NT_MIPS_DSP, + USER_REGSET_NOTE_TYPE(MIPS_DSP), .n =3D NUM_DSP_REGS + 1, .size =3D sizeof(u32), .align =3D sizeof(u32), @@ -953,7 +953,7 @@ static const struct user_regset mips_regsets[] =3D { }, #ifdef CONFIG_MIPS_FP_SUPPORT [REGSET_FPR] =3D { - .core_note_type =3D NT_PRFPREG, + USER_REGSET_NOTE_TYPE(PRFPREG), .n =3D ELF_NFPREG, .size =3D sizeof(elf_fpreg_t), .align =3D sizeof(elf_fpreg_t), @@ -961,7 +961,7 @@ static const struct user_regset mips_regsets[] =3D { .set =3D fpr_set, }, [REGSET_FP_MODE] =3D { - .core_note_type =3D NT_MIPS_FP_MODE, + USER_REGSET_NOTE_TYPE(MIPS_FP_MODE), .n =3D 1, .size =3D sizeof(int), .align =3D sizeof(int), @@ -971,7 +971,7 @@ static const struct user_regset mips_regsets[] =3D { #endif #ifdef CONFIG_CPU_HAS_MSA [REGSET_MSA] =3D { - .core_note_type =3D NT_MIPS_MSA, + USER_REGSET_NOTE_TYPE(MIPS_MSA), .n =3D NUM_FPU_REGS + 1, .size =3D 16, .align =3D 16, @@ -995,7 +995,7 @@ static const struct user_regset_view user_mips_view =3D= { =20 static const struct user_regset mips64_regsets[] =3D { [REGSET_GPR] =3D { - .core_note_type =3D NT_PRSTATUS, + USER_REGSET_NOTE_TYPE(PRSTATUS), .n =3D ELF_NGREG, .size =3D sizeof(unsigned long), .align =3D sizeof(unsigned long), @@ -1003,7 +1003,7 @@ static const struct user_regset mips64_regsets[] =3D { .set =3D gpr64_set, }, [REGSET_DSP] =3D { - .core_note_type =3D NT_MIPS_DSP, + USER_REGSET_NOTE_TYPE(MIPS_DSP), .n =3D NUM_DSP_REGS + 1, .size =3D sizeof(u64), .align =3D sizeof(u64), @@ -1013,7 +1013,7 @@ static const struct user_regset mips64_regsets[] =3D { }, #ifdef CONFIG_MIPS_FP_SUPPORT [REGSET_FP_MODE] =3D { - .core_note_type =3D NT_MIPS_FP_MODE, + USER_REGSET_NOTE_TYPE(MIPS_FP_MODE), .n =3D 1, .size =3D sizeof(int), .align =3D sizeof(int), @@ -1021,7 +1021,7 @@ static const struct user_regset mips64_regsets[] =3D { .set =3D fp_mode_set, }, [REGSET_FPR] =3D { - .core_note_type =3D NT_PRFPREG, + USER_REGSET_NOTE_TYPE(PRFPREG), .n =3D ELF_NFPREG, .size =3D sizeof(elf_fpreg_t), .align =3D sizeof(elf_fpreg_t), @@ -1031,7 +1031,7 @@ static const struct user_regset mips64_regsets[] =3D { #endif #ifdef CONFIG_CPU_HAS_MSA [REGSET_MSA] =3D { - .core_note_type =3D NT_MIPS_MSA, + USER_REGSET_NOTE_TYPE(MIPS_MSA), .n =3D NUM_FPU_REGS + 1, .size =3D 16, .align =3D 16, --=20 2.34.1