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 65491276056 for ; Tue, 1 Jul 2025 13:56:56 +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=1751378218; cv=none; b=StPEhx+GXdBuWy1ksa57E1sykvIFQeah1KSofMQFeeQjGzqcBg/hXblfIcVmiiRZzi4seofBQHRMwEJ9gDG3p8+w8SxLPGbA4905fUOaq/mZdMsSn3LtT5PMZJQ80JM19ptvlIQwLDRArDwqEFAkXUkTYlErG/l/fUTFpZCsPZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751378218; c=relaxed/simple; bh=QEecqqYm5ptJidNitchwQFGG978GrPeS1095Tw6Fcmw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=J+l4JesmjiuKh7jKhScMKoqHSkkRDooKCTzW/rriFqgo2aFuiwiUBWYzeE+jJqyfsBya8oyGXXlPgbx5DJmkm8YXD50oOD9w5SlAulweUzQl91hBCJQfxr4FUMuARNGCoT3i2n4DytdHWvAFBlw9F66jji9YsrG/ZTOrTTI2T9I= 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 AA1D22E98; Tue, 1 Jul 2025 06:56:40 -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 6CABC3F58B; Tue, 1 Jul 2025 06:56:54 -0700 (PDT) From: Dave Martin To: linux-kernel@vger.kernel.org Cc: Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Oleg Nesterov , Kees Cook , Akihiko Odaki , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 15/23] powerpc/ptrace: Use USER_REGSET_NOTE_TYPE() to specify regset note names Date: Tue, 1 Jul 2025 14:56:08 +0100 Message-Id: <20250701135616.29630-16-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: Madhavan Srinivasan Cc: Michael Ellerman Cc: Nicholas Piggin Cc: Christophe Leroy Cc: Oleg Nesterov Cc: Kees Cook Cc: Akihiko Odaki Cc: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/ptrace/ptrace-view.c | 74 ++++++++++++------------ 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/arch/powerpc/kernel/ptrace/ptrace-view.c b/arch/powerpc/kernel= /ptrace/ptrace-view.c index c1819e0a6684..0310f9097e39 100644 --- a/arch/powerpc/kernel/ptrace/ptrace-view.c +++ b/arch/powerpc/kernel/ptrace/ptrace-view.c @@ -568,114 +568,114 @@ static int pkey_set(struct task_struct *target, con= st struct user_regset *regset =20 static const struct user_regset native_regsets[] =3D { [REGSET_GPR] =3D { - .core_note_type =3D NT_PRSTATUS, .n =3D ELF_NGREG, + USER_REGSET_NOTE_TYPE(PRSTATUS), .n =3D ELF_NGREG, .size =3D sizeof(long), .align =3D sizeof(long), .regset_get =3D gpr_get, .set =3D gpr_set }, [REGSET_FPR] =3D { - .core_note_type =3D NT_PRFPREG, .n =3D ELF_NFPREG, + USER_REGSET_NOTE_TYPE(PRFPREG), .n =3D ELF_NFPREG, .size =3D sizeof(double), .align =3D sizeof(double), .regset_get =3D fpr_get, .set =3D fpr_set }, #ifdef CONFIG_ALTIVEC [REGSET_VMX] =3D { - .core_note_type =3D NT_PPC_VMX, .n =3D 34, + USER_REGSET_NOTE_TYPE(PPC_VMX), .n =3D 34, .size =3D sizeof(vector128), .align =3D sizeof(vector128), .active =3D vr_active, .regset_get =3D vr_get, .set =3D vr_set }, #endif #ifdef CONFIG_VSX [REGSET_VSX] =3D { - .core_note_type =3D NT_PPC_VSX, .n =3D 32, + USER_REGSET_NOTE_TYPE(PPC_VSX), .n =3D 32, .size =3D sizeof(double), .align =3D sizeof(double), .active =3D vsr_active, .regset_get =3D vsr_get, .set =3D vsr_set }, #endif #ifdef CONFIG_SPE [REGSET_SPE] =3D { - .core_note_type =3D NT_PPC_SPE, .n =3D 35, + USER_REGSET_NOTE_TYPE(PPC_SPE), .n =3D 35, .size =3D sizeof(u32), .align =3D sizeof(u32), .active =3D evr_active, .regset_get =3D evr_get, .set =3D evr_set }, #endif #ifdef CONFIG_PPC_TRANSACTIONAL_MEM [REGSET_TM_CGPR] =3D { - .core_note_type =3D NT_PPC_TM_CGPR, .n =3D ELF_NGREG, + USER_REGSET_NOTE_TYPE(PPC_TM_CGPR), .n =3D ELF_NGREG, .size =3D sizeof(long), .align =3D sizeof(long), .active =3D tm_cgpr_active, .regset_get =3D tm_cgpr_get, .set =3D tm_cgp= r_set }, [REGSET_TM_CFPR] =3D { - .core_note_type =3D NT_PPC_TM_CFPR, .n =3D ELF_NFPREG, + USER_REGSET_NOTE_TYPE(PPC_TM_CFPR), .n =3D ELF_NFPREG, .size =3D sizeof(double), .align =3D sizeof(double), .active =3D tm_cfpr_active, .regset_get =3D tm_cfpr_get, .set =3D tm_cfp= r_set }, [REGSET_TM_CVMX] =3D { - .core_note_type =3D NT_PPC_TM_CVMX, .n =3D ELF_NVMX, + USER_REGSET_NOTE_TYPE(PPC_TM_CVMX), .n =3D ELF_NVMX, .size =3D sizeof(vector128), .align =3D sizeof(vector128), .active =3D tm_cvmx_active, .regset_get =3D tm_cvmx_get, .set =3D tm_cvm= x_set }, [REGSET_TM_CVSX] =3D { - .core_note_type =3D NT_PPC_TM_CVSX, .n =3D ELF_NVSX, + USER_REGSET_NOTE_TYPE(PPC_TM_CVSX), .n =3D ELF_NVSX, .size =3D sizeof(double), .align =3D sizeof(double), .active =3D tm_cvsx_active, .regset_get =3D tm_cvsx_get, .set =3D tm_cvs= x_set }, [REGSET_TM_SPR] =3D { - .core_note_type =3D NT_PPC_TM_SPR, .n =3D ELF_NTMSPRREG, + USER_REGSET_NOTE_TYPE(PPC_TM_SPR), .n =3D ELF_NTMSPRREG, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_spr_active, .regset_get =3D tm_spr_get, .set =3D tm_spr_s= et }, [REGSET_TM_CTAR] =3D { - .core_note_type =3D NT_PPC_TM_CTAR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CTAR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_tar_active, .regset_get =3D tm_tar_get, .set =3D tm_tar_s= et }, [REGSET_TM_CPPR] =3D { - .core_note_type =3D NT_PPC_TM_CPPR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CPPR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_ppr_active, .regset_get =3D tm_ppr_get, .set =3D tm_ppr_s= et }, [REGSET_TM_CDSCR] =3D { - .core_note_type =3D NT_PPC_TM_CDSCR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CDSCR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_dscr_active, .regset_get =3D tm_dscr_get, .set =3D tm_dsc= r_set }, #endif #ifdef CONFIG_PPC64 [REGSET_PPR] =3D { - .core_note_type =3D NT_PPC_PPR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_PPR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D ppr_get, .set =3D ppr_set }, [REGSET_DSCR] =3D { - .core_note_type =3D NT_PPC_DSCR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_DSCR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D dscr_get, .set =3D dscr_set }, #endif #ifdef CONFIG_PPC_BOOK3S_64 [REGSET_TAR] =3D { - .core_note_type =3D NT_PPC_TAR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TAR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D tar_get, .set =3D tar_set }, [REGSET_EBB] =3D { - .core_note_type =3D NT_PPC_EBB, .n =3D ELF_NEBB, + USER_REGSET_NOTE_TYPE(PPC_EBB), .n =3D ELF_NEBB, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D ebb_active, .regset_get =3D ebb_get, .set =3D ebb_set }, [REGSET_PMR] =3D { - .core_note_type =3D NT_PPC_PMU, .n =3D ELF_NPMU, + USER_REGSET_NOTE_TYPE(PPC_PMU), .n =3D ELF_NPMU, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D pmu_active, .regset_get =3D pmu_get, .set =3D pmu_set }, [REGSET_DEXCR] =3D { - .core_note_type =3D NT_PPC_DEXCR, .n =3D ELF_NDEXCR, + USER_REGSET_NOTE_TYPE(PPC_DEXCR), .n =3D ELF_NDEXCR, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D dexcr_active, .regset_get =3D dexcr_get }, #ifdef CONFIG_CHECKPOINT_RESTORE [REGSET_HASHKEYR] =3D { - .core_note_type =3D NT_PPC_HASHKEYR, .n =3D ELF_NHASHKEYR, + USER_REGSET_NOTE_TYPE(PPC_HASHKEYR), .n =3D ELF_NHASHKEYR, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D hashkeyr_active, .regset_get =3D hashkeyr_get, .set =3D hash= keyr_set }, @@ -683,7 +683,7 @@ static const struct user_regset native_regsets[] =3D { #endif #ifdef CONFIG_PPC_MEM_KEYS [REGSET_PKEY] =3D { - .core_note_type =3D NT_PPC_PKEY, .n =3D ELF_NPKEY, + USER_REGSET_NOTE_TYPE(PPC_PKEY), .n =3D ELF_NPKEY, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D pkey_active, .regset_get =3D pkey_get, .set =3D pkey_set }, @@ -843,92 +843,92 @@ static int gpr32_set(struct task_struct *target, */ static const struct user_regset compat_regsets[] =3D { [REGSET_GPR] =3D { - .core_note_type =3D NT_PRSTATUS, .n =3D ELF_NGREG, + USER_REGSET_NOTE_TYPE(PRSTATUS), .n =3D ELF_NGREG, .size =3D sizeof(compat_long_t), .align =3D sizeof(compat_long_t), .regset_get =3D gpr32_get, .set =3D gpr32_set }, [REGSET_FPR] =3D { - .core_note_type =3D NT_PRFPREG, .n =3D ELF_NFPREG, + USER_REGSET_NOTE_TYPE(PRFPREG), .n =3D ELF_NFPREG, .size =3D sizeof(double), .align =3D sizeof(double), .regset_get =3D fpr_get, .set =3D fpr_set }, #ifdef CONFIG_ALTIVEC [REGSET_VMX] =3D { - .core_note_type =3D NT_PPC_VMX, .n =3D 34, + USER_REGSET_NOTE_TYPE(PPC_VMX), .n =3D 34, .size =3D sizeof(vector128), .align =3D sizeof(vector128), .active =3D vr_active, .regset_get =3D vr_get, .set =3D vr_set }, #endif #ifdef CONFIG_SPE [REGSET_SPE] =3D { - .core_note_type =3D NT_PPC_SPE, .n =3D 35, + USER_REGSET_NOTE_TYPE(PPC_SPE), .n =3D 35, .size =3D sizeof(u32), .align =3D sizeof(u32), .active =3D evr_active, .regset_get =3D evr_get, .set =3D evr_set }, #endif #ifdef CONFIG_PPC_TRANSACTIONAL_MEM [REGSET_TM_CGPR] =3D { - .core_note_type =3D NT_PPC_TM_CGPR, .n =3D ELF_NGREG, + USER_REGSET_NOTE_TYPE(PPC_TM_CGPR), .n =3D ELF_NGREG, .size =3D sizeof(long), .align =3D sizeof(long), .active =3D tm_cgpr_active, .regset_get =3D tm_cgpr32_get, .set =3D tm_cgpr32_set }, [REGSET_TM_CFPR] =3D { - .core_note_type =3D NT_PPC_TM_CFPR, .n =3D ELF_NFPREG, + USER_REGSET_NOTE_TYPE(PPC_TM_CFPR), .n =3D ELF_NFPREG, .size =3D sizeof(double), .align =3D sizeof(double), .active =3D tm_cfpr_active, .regset_get =3D tm_cfpr_get, .set =3D tm_cfp= r_set }, [REGSET_TM_CVMX] =3D { - .core_note_type =3D NT_PPC_TM_CVMX, .n =3D ELF_NVMX, + USER_REGSET_NOTE_TYPE(PPC_TM_CVMX), .n =3D ELF_NVMX, .size =3D sizeof(vector128), .align =3D sizeof(vector128), .active =3D tm_cvmx_active, .regset_get =3D tm_cvmx_get, .set =3D tm_cvm= x_set }, [REGSET_TM_CVSX] =3D { - .core_note_type =3D NT_PPC_TM_CVSX, .n =3D ELF_NVSX, + USER_REGSET_NOTE_TYPE(PPC_TM_CVSX), .n =3D ELF_NVSX, .size =3D sizeof(double), .align =3D sizeof(double), .active =3D tm_cvsx_active, .regset_get =3D tm_cvsx_get, .set =3D tm_cvs= x_set }, [REGSET_TM_SPR] =3D { - .core_note_type =3D NT_PPC_TM_SPR, .n =3D ELF_NTMSPRREG, + USER_REGSET_NOTE_TYPE(PPC_TM_SPR), .n =3D ELF_NTMSPRREG, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_spr_active, .regset_get =3D tm_spr_get, .set =3D tm_spr_s= et }, [REGSET_TM_CTAR] =3D { - .core_note_type =3D NT_PPC_TM_CTAR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CTAR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_tar_active, .regset_get =3D tm_tar_get, .set =3D tm_tar_s= et }, [REGSET_TM_CPPR] =3D { - .core_note_type =3D NT_PPC_TM_CPPR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CPPR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_ppr_active, .regset_get =3D tm_ppr_get, .set =3D tm_ppr_s= et }, [REGSET_TM_CDSCR] =3D { - .core_note_type =3D NT_PPC_TM_CDSCR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TM_CDSCR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D tm_dscr_active, .regset_get =3D tm_dscr_get, .set =3D tm_dsc= r_set }, #endif #ifdef CONFIG_PPC64 [REGSET_PPR] =3D { - .core_note_type =3D NT_PPC_PPR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_PPR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D ppr_get, .set =3D ppr_set }, [REGSET_DSCR] =3D { - .core_note_type =3D NT_PPC_DSCR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_DSCR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D dscr_get, .set =3D dscr_set }, #endif #ifdef CONFIG_PPC_BOOK3S_64 [REGSET_TAR] =3D { - .core_note_type =3D NT_PPC_TAR, .n =3D 1, + USER_REGSET_NOTE_TYPE(PPC_TAR), .n =3D 1, .size =3D sizeof(u64), .align =3D sizeof(u64), .regset_get =3D tar_get, .set =3D tar_set }, [REGSET_EBB] =3D { - .core_note_type =3D NT_PPC_EBB, .n =3D ELF_NEBB, + USER_REGSET_NOTE_TYPE(PPC_EBB), .n =3D ELF_NEBB, .size =3D sizeof(u64), .align =3D sizeof(u64), .active =3D ebb_active, .regset_get =3D ebb_get, .set =3D ebb_set }, --=20 2.34.1