From patchwork Tue Jan 7 12:45:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928840 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E0BD8E77197 for ; Tue, 7 Jan 2025 12:48:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76B7C6B00AA; Tue, 7 Jan 2025 07:48:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 71BAB6B00AC; Tue, 7 Jan 2025 07:48:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5962A6B00AD; Tue, 7 Jan 2025 07:48:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 36B0F6B00AA for ; Tue, 7 Jan 2025 07:48:02 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id DEBDA16094B for ; Tue, 7 Jan 2025 12:48:01 +0000 (UTC) X-FDA: 82980633162.20.0A588C9 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf02.hostedemail.com (Postfix) with ESMTP id 04BE28000B for ; Tue, 7 Jan 2025 12:47:59 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=YngddScd; spf=pass (imf02.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254080; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=He/FF4mW6z63rm6Ez1fm+hLtPmYbF/A35f1xOajKz/c=; b=AmDebpmxcDiSTGvKrQgPrgLCF2gjQrxcZMAKpoZ31xU4M1YMujkNTtuWcj+zeppvinBYmr u3erqiiX0qleMUvYu0NxttoGzMcbAVYJYmdg10aFOofwl3th5vEzPsDz7ojqGHYCU9oocI /PDdUnNj3ju2mLw6i7ch9jNeHHKH4+g= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=YngddScd; spf=pass (imf02.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254080; a=rsa-sha256; cv=none; b=OumqzienAcehJ+rezDIi1/LdjUVX+akgjnA16ovIQlsr1u0rRezQHBifN/V6xT1e1vtBRr n3vAngPg5MnOOObb18Lv9AhVcKDVY91V6lH5UnL/oxlF2CKE/0lzZ6SPhEohlprhXGEd6Y Ad39ACHHEGeJQC727I7T/axR+Pn4KLg= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-219f8263ae0so178327745ad.0 for ; Tue, 07 Jan 2025 04:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254079; x=1736858879; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=He/FF4mW6z63rm6Ez1fm+hLtPmYbF/A35f1xOajKz/c=; b=YngddScdR+b6h4TqDGXceDWhWquFr/7jpZlxH70HiW6DW0NLd/FVCBPaZihp9ig7qp LtLp64CfmYwA3O02kc4oCJJVxDdLmrMbMHOqOVYBBg1wJRR+i1bY10wslbKRr0pz0cFm MWWjjKOsyyoouLlNFMG/HOj4POCGp9gdgk6geTqQunLkLSLCcu677HUly569NHaTDmUF CZyMTIPzlsJtqEnkdscgturWj2cNn4kOHehTfA2j+2rYm7e/sd8nFYKCyVr3qIm9VUHW B7LL2qPM38vdPH5VGw/MzyPTQYNTrd/EBTn0yGxwlReZT1kToWInjnAfLs1x/VW55nPp /vLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254079; x=1736858879; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=He/FF4mW6z63rm6Ez1fm+hLtPmYbF/A35f1xOajKz/c=; b=KcPr+MQRP8LypDxSLLtN/AWlhGbtRK9NiBiJdi+dP84o7XyB2g2t+Rzsz/3Iw7U6a3 c7pBFyoP1ltihKL10uwCni1sFeS9be4W3eSz/IrC9KnvzemHCQ5Mt3OKktdpkUECacxN 20QGE7EXQmOY2wh+VIWOmYOQvsVkWO92RFFCaTWhlRv9CDukVT47uljnHCpgJy7i6+v8 0wqrqDLMl3JNVxqiO2u7LnQNUvM6torcpXN2j/ZL9L5whw1FJjpINrx1g0x6qnzbaU1T B3ogMzU5f/qh5oDVz9RpyKn3AyoIVn+HR8XyYoQflhkzGQQDfiJOAwUnkSVKNkNZJ3nl xJBQ== X-Gm-Message-State: AOJu0YzrbGttzjaJKSPWxy456X+atLpsnuj825A6BXOOQSTIwcaQMWte UtqRt+9qEkaTNYR+7as7bMWWTzdsAaciS7zowCz2U4Pd2CQGOO27VjYH8mntEpA= X-Gm-Gg: ASbGnctYib5b0zdx0SaSH7Tv+XX3LwIwemuZKfL7yw1P65ntctUMOWY2Yh1puNgXa8f iAdqFBDeylxCKKYtmmq1Ko48X2fQQol7/AjnDzfAPzl2HJ1iGeQFigvQNradVvxQrRzig5hQCPV p2VVH61bLf96/Nn+mCIZpcEmR+eASAGMU8uGZMcDxIASoQ3v7AZHYZXUn9dYNab7cIxppUrdfP0 pPSUxo0RSlaR3+b5NlVj5PP90HGUj5Kefmo5RavzUmAQIrZpgbp3+FzLN0= X-Google-Smtp-Source: AGHT+IGj6u8NRmS4TeZ/1IMiWstql9gdjkk0bdLulE0ZZ9e8x4y5HEHvh/9HOrX1KoNRUGfFwcEprw== X-Received: by 2002:a17:902:f646:b0:216:501e:e314 with SMTP id d9443c01a7336-219e6e9fdb4mr938029515ad.20.1736254078701; Tue, 07 Jan 2025 04:47:58 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc962c05sm308643635ad.43.2025.01.07.04.47.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:47:58 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:52 +0900 Subject: [PATCH v3 1/6] elf: Define note name macros MIME-Version: 1.0 Message-Id: <20250107-elf-v3-1-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: 04BE28000B X-Stat-Signature: dc6dzs5kcgdm6a3sjp8e7a58mzxkgbjy X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736254079-414749 X-HE-Meta: U2FsdGVkX1/KSY1CE9b1TLc56PGyR/t6lncpinCim939jWHLO2IcGD5TUJoyp6yepYYvlpWEQV0G/zIrjfr23v83TukaxZPjIrIclCVBaywg8lt8DHVa/1dI1spydfiMqMLlrYHYkNcqpnUChSBftg1flMR322TWQGrBhN1IA1SFMNnvJCFQ4O7RL7RDfI6A0jYFBStCybXOFvRoVgLcyqDiKZwSDC8PR4KzWfT6vRMlyvUKYEOGCYIHWn+aw6lytzlJmnTFrazMPmy3n3RvCrsXpaIFEqiWdn37CFwAK6TFOSw2Lz7W0KGvEgXm792hs2wAgqvYnHuZOL8X0h5vSSm3W/hnSTKhr0f/ZGMobmjPAoZkrniQHuVo1ApeTZ+8KQj5kC8glFFGtPcUO3fJOTNie94wmA68CekyRRoy2g6cUos84fo+huzUcJasFBUjBXxE7YtWO0Bp31+tMsP2w34s+N8dfKgfjB1cc/bCOcWiEZ2Xsw7qPL+n2qJYG0atCutT9wtSufLgOeSpSLph0e5S3dtuNPUEh9itqa2+sUCnPbtDJQsVpz6FFx3gwQU2rgzdossmtcKGeTwV709kGgwA6x1eyzjCvOuGC1lkC77IyCeed9vHMvvRzJwONQgTKBvXJt9GhhmdeM/pHbBiCAttlh9AfZC8r9ETlUi/bvYgRO191Xi6m/4W7H7iV4OkdTFti0LB8jc7FqC5pcCLhK9C9Nmdfll5iUKOkhLEHUxxxT+IEV7IOOB0MTMzVnCqFSHrSO57//kQh59SKYG4uKsODuHxm/ahoZLzo/ORA9hkk+EQktFiz5YBz5gc53ux5PJQ2gtzrIF/aFSpc6XJZ8td5YP0DnuUXTMadBvxQRanOpQQ6lMGKeUeBZvkKCK4LlHomxb0K4eLx83A2Q3/VTb9gyDyMvKTUrwD0/fju1OLD/xemEZ1q5lfh5kM6JFRFlDl21griVLZekXH2Tt EO24nLTU n55dVUKCL1t3wpJm0wNaj3hJlYXgQrgtdbnFITqBdL+Z0z3TenPhZhG0g0T7HYmG5RpR8+8LkXBUbulCo+XXiUJdjW7+wQAk3LvearnJ9vc/BDWnuQW3xOSJ5F5tSwFtd74Ar3E3WRQoeJv69sdcfBetuB/4S2xLKbNWdud9Qzy1BNUuRK+5UqhJyjmAB6n99fs7hl6dSUmABeAdRrSSQbmtRoGMXnQWO6gW/G+CZ/kdHB8UFUrjyQl/bMOuAj/k36DcoFqCVjyReGJW7KD37Fiu1okHmn1lUP0FTpePOqCDUJFvlCnrO8valm+VC5qEFTrvYy1hvhLRG0fh33mE4NCwhJXsQtSLuwxFqgy/RXYLoDU8= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: elf.h had a comment saying: > Notes used in ET_CORE. Architectures export some of the arch register > sets using the corresponding note types via the PTRACE_GETREGSET and > PTRACE_SETREGSET requests. > The note name for these types is "LINUX", except NT_PRFPREG that is > named "CORE". However, NT_PRSTATUS is also named "CORE". It is also unclear what "these types" refers to. To fix these problems, define a name for each note type. The added definitions are macros so the kernel and userspace can directly refer to them. Signed-off-by: Akihiko Odaki Acked-by: Baoquan He --- include/uapi/linux/elf.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index b44069d29cec..343f5c40d03a 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -368,99 +368,179 @@ typedef struct elf64_shdr { #define ELF_OSABI ELFOSABI_NONE #endif +/* Note definitions: NN_ defines names. NT_ defines types. */ + /* * Notes used in ET_CORE. Architectures export some of the arch register sets * using the corresponding note types via the PTRACE_GETREGSET and * PTRACE_SETREGSET requests. - * The note name for these types is "LINUX", except NT_PRFPREG that is named - * "CORE". */ +#define NN_PRSTATUS "CORE" #define NT_PRSTATUS 1 +#define NN_PRFPREG "CORE" #define NT_PRFPREG 2 +#define NN_PRPSINFO "CORE" #define NT_PRPSINFO 3 +#define NN_TASKSTRUCT "CORE" #define NT_TASKSTRUCT 4 +#define NN_AUXV "CORE" #define NT_AUXV 6 /* * Note to userspace developers: size of NT_SIGINFO note may increase * in the future to accomodate more fields, don't assume it is fixed! */ +#define NN_SIGINFO "CORE" #define NT_SIGINFO 0x53494749 +#define NN_FILE "CORE" #define NT_FILE 0x46494c45 +#define NN_PRXFPREG "LINUX" #define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */ +#define NN_PPC_VMX "LINUX" #define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */ +#define NN_PPC_SPE "LINUX" #define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */ +#define NN_PPC_VSX "LINUX" #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ +#define NN_PPC_TAR "LINUX" #define NT_PPC_TAR 0x103 /* Target Address Register */ +#define NN_PPC_PPR "LINUX" #define NT_PPC_PPR 0x104 /* Program Priority Register */ +#define NN_PPC_DSCR "LINUX" #define NT_PPC_DSCR 0x105 /* Data Stream Control Register */ +#define NN_PPC_EBB "LINUX" #define NT_PPC_EBB 0x106 /* Event Based Branch Registers */ +#define NN_PPC_PMU "LINUX" #define NT_PPC_PMU 0x107 /* Performance Monitor Registers */ +#define NN_PPC_TM_CGPR "LINUX" #define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */ +#define NN_PPC_TM_CFPR "LINUX" #define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */ +#define NN_PPC_TM_CVMX "LINUX" #define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */ +#define NN_PPC_TM_CVSX "LINUX" #define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */ +#define NN_PPC_TM_SPR "LINUX" #define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */ +#define NN_PPC_TM_CTAR "LINUX" #define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */ +#define NN_PPC_TM_CPPR "LINUX" #define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */ +#define NN_PPC_TM_CDSCR "LINUX" #define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */ +#define NN_PPC_PKEY "LINUX" #define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */ +#define NN_PPC_DEXCR "LINUX" #define NT_PPC_DEXCR 0x111 /* PowerPC DEXCR registers */ +#define NN_PPC_HASHKEYR "LINUX" #define NT_PPC_HASHKEYR 0x112 /* PowerPC HASHKEYR register */ +#define NN_386_TLS "LINUX" #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ +#define NN_386_IOPERM "LINUX" #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ +#define NN_X86_XSTATE "LINUX" #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ /* Old binutils treats 0x203 as a CET state */ +#define NN_X86_SHSTK "LINUX" #define NT_X86_SHSTK 0x204 /* x86 SHSTK state */ +#define NN_X86_XSAVE_LAYOUT "LINUX" #define NT_X86_XSAVE_LAYOUT 0x205 /* XSAVE layout description */ +#define NN_S390_HIGH_GPRS "LINUX" #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ +#define NN_S390_TIMER "LINUX" #define NT_S390_TIMER 0x301 /* s390 timer register */ +#define NN_S390_TODCMP "LINUX" #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ +#define NN_S390_TODPREG "LINUX" #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ +#define NN_S390_CTRS "LINUX" #define NT_S390_CTRS 0x304 /* s390 control registers */ +#define NN_S390_PREFIX "LINUX" #define NT_S390_PREFIX 0x305 /* s390 prefix register */ +#define NN_S390_LAST_BREAK "LINUX" #define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */ +#define NN_S390_SYSTEM_CALL "LINUX" #define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */ +#define NN_S390_TDB "LINUX" #define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */ +#define NN_S390_VXRS_LOW "LINUX" #define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half */ +#define NN_S390_VXRS_HIGH "LINUX" #define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */ +#define NN_S390_GS_CB "LINUX" #define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */ +#define NN_S390_GS_BC "LINUX" #define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */ +#define NN_S390_RI_CB "LINUX" #define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */ +#define NN_S390_PV_CPU_DATA "LINUX" #define NT_S390_PV_CPU_DATA 0x30e /* s390 protvirt cpu dump data */ +#define NN_ARM_VFP "LINUX" #define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */ +#define NN_ARM_TLS "LINUX" #define NT_ARM_TLS 0x401 /* ARM TLS register */ +#define NN_ARM_HW_BREAK "LINUX" #define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */ +#define NN_ARM_HW_WATCH "LINUX" #define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */ +#define NN_ARM_SYSTEM_CALL "LINUX" #define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */ +#define NN_ARM_SVE "LINUX" #define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */ +#define NN_ARM_PAC_MASK "LINUX" #define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */ +#define NN_ARM_PACA_KEYS "LINUX" #define NT_ARM_PACA_KEYS 0x407 /* ARM pointer authentication address keys */ +#define NN_ARM_PACG_KEYS "LINUX" #define NT_ARM_PACG_KEYS 0x408 /* ARM pointer authentication generic key */ +#define NN_ARM_TAGGED_ADDR_CTRL "LINUX" #define NT_ARM_TAGGED_ADDR_CTRL 0x409 /* arm64 tagged address control (prctl()) */ +#define NN_ARM_PAC_ENABLED_KEYS "LINUX" #define NT_ARM_PAC_ENABLED_KEYS 0x40a /* arm64 ptr auth enabled keys (prctl()) */ +#define NN_ARM_SSVE "LINUX" #define NT_ARM_SSVE 0x40b /* ARM Streaming SVE registers */ +#define NN_ARM_ZA "LINUX" #define NT_ARM_ZA 0x40c /* ARM SME ZA registers */ +#define NN_ARM_ZT "LINUX" #define NT_ARM_ZT 0x40d /* ARM SME ZT registers */ +#define NN_ARM_FPMR "LINUX" #define NT_ARM_FPMR 0x40e /* ARM floating point mode register */ +#define NN_ARM_POE "LINUX" #define NT_ARM_POE 0x40f /* ARM POE registers */ +#define NN_ARM_GCS "LINUX" #define NT_ARM_GCS 0x410 /* ARM GCS state */ +#define NN_ARC_V2 "LINUX" #define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */ +#define NN_VMCOREDD "LINUX" #define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */ +#define NN_MIPS_DSP "LINUX" #define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */ +#define NN_MIPS_FP_MODE "LINUX" #define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */ +#define NN_MIPS_MSA "LINUX" #define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */ +#define NN_RISCV_CSR "LINUX" #define NT_RISCV_CSR 0x900 /* RISC-V Control and Status Registers */ +#define NN_RISCV_VECTOR "LINUX" #define NT_RISCV_VECTOR 0x901 /* RISC-V vector registers */ +#define NN_RISCV_TAGGED_ADDR_CTRL "LINUX" #define NT_RISCV_TAGGED_ADDR_CTRL 0x902 /* RISC-V tagged address control (prctl()) */ +#define NN_LOONGARCH_CPUCFG "LINUX" #define NT_LOONGARCH_CPUCFG 0xa00 /* LoongArch CPU config registers */ +#define NN_LOONGARCH_CSR "LINUX" #define NT_LOONGARCH_CSR 0xa01 /* LoongArch control and status registers */ +#define NN_LOONGARCH_LSX "LINUX" #define NT_LOONGARCH_LSX 0xa02 /* LoongArch Loongson SIMD Extension registers */ +#define NN_LOONGARCH_LASX "LINUX" #define NT_LOONGARCH_LASX 0xa03 /* LoongArch Loongson Advanced SIMD Extension registers */ +#define NN_LOONGARCH_LBT "LINUX" #define NT_LOONGARCH_LBT 0xa04 /* LoongArch Loongson Binary Translation registers */ +#define NN_LOONGARCH_HW_BREAK "LINUX" #define NT_LOONGARCH_HW_BREAK 0xa05 /* LoongArch hardware breakpoint registers */ +#define NN_LOONGARCH_HW_WATCH "LINUX" #define NT_LOONGARCH_HW_WATCH 0xa06 /* LoongArch hardware watchpoint registers */ -/* Note types with note name "GNU" */ +/* Note used in other file types. */ +#define NN_GNU_PROPERTY_TYPE_0 "GNU" #define NT_GNU_PROPERTY_TYPE_0 5 /* Note header in a PT_NOTE section */ From patchwork Tue Jan 7 12:45:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928841 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39FA3E77198 for ; Tue, 7 Jan 2025 12:48:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB2806B00AE; Tue, 7 Jan 2025 07:48:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B62006B00B0; Tue, 7 Jan 2025 07:48:09 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9DAB96B00B3; Tue, 7 Jan 2025 07:48:09 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7CE406B00AE for ; Tue, 7 Jan 2025 07:48:09 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id EEEFFA08F4 for ; Tue, 7 Jan 2025 12:48:08 +0000 (UTC) X-FDA: 82980633456.30.5BF586E Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf12.hostedemail.com (Postfix) with ESMTP id 10DD74000E for ; Tue, 7 Jan 2025 12:48:06 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=sdjBFVfx; dmarc=none; spf=pass (imf12.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254087; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=To6WceQOVEAdrv9VIwdrgLUfIkfIZojfYpt2+tcFAZE=; b=qkYnNKDg8wve3Vy7Ocsymb3HOIzjHQ+wDfOyO6gyj9v8NDqUzUuWqfjUiM/UbCK/kePm0E 5CGmGK1BeAWhdo6np9PJ8/QCF5/YJH0VruEghkZDMDg4rpXWpIYSAksPcwEoP9cv+2p9mY TPgED4+dMZHFU9Zr/gWxafEjxhDqN4k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254087; a=rsa-sha256; cv=none; b=uM4JMG5cNLHS8XG8LRdjjW/qmILwFnXRbYyIBwt2zlrlkZfrlfB1Vedh3JWtIoVyXl2zSt FRa527FGmdK4lZbFm9ORSItqpvYC7zHB8AUn0+lsuanB6yCx4UCeN2hhKgH/LHYgMTSwKq 7kOY/ODwFXBUnIqbIxxhqGvLPA5MHEI= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=sdjBFVfx; dmarc=none; spf=pass (imf12.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so23006414a91.0 for ; Tue, 07 Jan 2025 04:48:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254086; x=1736858886; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=To6WceQOVEAdrv9VIwdrgLUfIkfIZojfYpt2+tcFAZE=; b=sdjBFVfxocb0nKAYdUfMqrpY303G8Hu7AYJKUJM82t5oXMjdNbfxG/Nj3vo4N83kpN dBM2EpgJA7/mTLJjAkLVCOoynXHArDmBBj2wy6hjnlSxHKkv99XS4jRc0FbbA02ZXO5S St5/8gMe0vYSjqjIYmlS5p/FjZhVg4/XDXe2PxshgWeOwl4fzVSGB6CB2yubg5tdoG1f CWfsg5gcANSsYRqmwQcBBcWLHN+DKnTd/Qcbk2vPbsULhKXDE+TK4Vox1TxYXz7QrqaC IQSU2yPundNGIuoWJTz8TkW3F6b5CcCcRodaDrcBAPnbPrNUEWMh7pyDS5iYc/HAHh8Q JtUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254086; x=1736858886; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=To6WceQOVEAdrv9VIwdrgLUfIkfIZojfYpt2+tcFAZE=; b=EUsP134UOKHnZJrsKyncCiDUFF0WgSkNx0AU3JJ2xbdiCwVTLv5ZoHVwKHU5X9SPqG tL6iOrfMHbmBG5ByOLnMRTQNcaAN3HMYuu2PQolyXF1oc4MO8PkwKyBmbTNYgbYrGVFC OJJgBQAKo4ANcuaorkPLs7jemqQywKIJ5ggKOLyOzAwW4ap8meqHzmiNgjK1HEzmJGYy 9ELMTax4irxfm3dDqskHT37Ndbw3v5jScKuaYHLgWcrlWylWoT1ll+70XdtBAGp8DS81 2BSZFe3ov5fTdQblYuJr1AOm/46gDQHw6FAyz/IvNZxZLFs66eu8Qoz0bMYqtfxW3fNZ IcwA== X-Gm-Message-State: AOJu0YxSu0UbAsc7MeuAHJ5eEZk68SZyxYJRC1qchqYFqzxev9BfAjEI Rsc0U+RIZeTDIpUTzuy9fsFMVEo9CIjLNcALTg6XjWpMKcPCyaqYy4thE8eLdHw= X-Gm-Gg: ASbGncsBO07WjqQj/MG1gbadzRixLjLdHdw7+Ri75fTKmbdl/EDCsQ+a7n2v6jhFlq8 qkGMlThxhIq27nxvMkkdEcPwb7bNxu1idpq2dcxLfVQ0uzi2Ydkc7i4Y8Fp0mOnnkj4wrtcJACS BojkIVP8Hrckl+sgHoXPAhUw5gyXFg18Ll2PBp8s9uIvH6JpD6TxZJIrpdhc6FqJE25wxnqfkBm g68x5ygDW3K2+2aTI9hwGWbqc/t6CepKu1zhyhnasmQQhYngznwgvsreEo= X-Google-Smtp-Source: AGHT+IHmQrtd6DArE28HS9MI+ljcSHS0URGz6WZZfYPdopYVfnKvqXeHpkFOcVWEZed1yb1h138/0Q== X-Received: by 2002:a05:6a00:22c2:b0:725:ef4b:de33 with SMTP id d2e1a72fcca58-72abdbe4de8mr79321688b3a.0.1736254085564; Tue, 07 Jan 2025 04:48:05 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad90b338sm33355957b3a.174.2025.01.07.04.48.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:48:05 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:53 +0900 Subject: [PATCH v3 2/6] binfmt_elf: Use note name macros MIME-Version: 1.0 Message-Id: <20250107-elf-v3-2-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Stat-Signature: 6hiaank6j9jccmu49ns4gc5af31ohwpk X-Rspamd-Queue-Id: 10DD74000E X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736254086-638757 X-HE-Meta: U2FsdGVkX1+A1qCzRZ6LtJRuqEN5M+Q6EiCSurSy+bFMMYDRnrur7wkcHDOi5RrvD+EUA/u0izDcYscKVH/WGj1L49LfC7bKPVwiylLBDE/iNrumqNB2rP61mokl9aYfnp26jtUp06IHFnYJWSAX0tfpk2lal9TcckmSH5tvhwPB2oc3S5gPzrbD79hHKsymiHiyKnjl9I5kYl8phK/3hkgT9zEHEtqQS0t/TEVtEoJKVVPlIuEtyEvswaz61CDHwQLHdQ/Hv9mrxxU747aNSoVe+ZiYMYGWEEBKRGu8yMNEkeJ/Cdv2no67LkyEt/WTMp8gN3ETjclXdoQhKgxWzTyzBxWXqVNb18RNSjBAMNc5DU55QcdWqfaavDFTcN0+YOM4zkqgUoNXw8BDfnN2RbGlclQft/8sS2kuc/q0k0j5HsjGNGgWsiQlCd1BPkVWcD1JJT3a8xBRW2zlXa0EBmlVEMgE7f1E9AOH45+Tq/aQNrH+86XBHcdHMn9dO8ATsrOXnJScNH/zJQvVcHArzktnCAU6PhcVebOCc7tS4Hc2ouNhDsPKXxX4IKiHVVDXmhsskZsBP5KX+/2bpPriUATWdigsfxUDh0LOewo3A3KEDrTsBWHT1laG0Ah0T+iqoy6yE2Wt5mmoOOD0OpU+Z/4i3J0KS5jgSMhHL8RDiIduYqPkODrMoZdD7Tof0Zjlbis04tuE2LsSnezVSLj5fxJMc8DJk4+KOsdoWGo2eCc20rPX9paisesYFJJgnp/FAoDSNQLhAo+CpqP1MRAS+TLuRAnx/LCrzBDdua+FVTDOzhQIABAAC874Hv8/6/MS4gBYxm4HwdNKIwfBliDQUyca1wJ83rDDZiLmXWgQTB373Rtnfh72lOqC9TO2mQ98fP3MSBV1VaeXjkqbdJZ5vJbL4hDfns19sbvPCsYFltmK7BHI/q6iWIg9Bd5L5p5s7qDZGctrynGMYNAO4C/ xSwrd5YK xZHZVt8qXglqAS+oNvTVGIOXRHEmclNVvDGjKaaigvuzYmgq6X4U/l6I+wC1dp9u2iQWxdjh7KCr1HhOs6w/XbVgxZOqTqEtKDoyvwyAA6Il8g+IgPwTezgcwlaen10gKR5T9z7oKokHexTPO4VMr7G52+B2d6v90D56yvqqHq8YcSoJXAUQi4BYO/BZsaDBXh9qODH45qTQ3D9q1EZ6JXHqC7MTUxC3ZSdbVZpWfhQcZJDy0TEhnUXo8HhU1jfKvwuPRas2fluBZqWETVyJ/ghxuPt3xJurL5h9B9Jq9qj2R05tQy/79EgNclJfHm1sxh2usoGYDF5Hon+BRlJQT/1lRWha7LBcvj1imxP3rAFcEydgCAlTW1Rn8WMDG9qhNdvL+z1+7O02tO4CN0+Zwi96yyQ8DxJ9IZv49 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki Acked-by: Baoquan He --- fs/binfmt_elf.c | 21 ++++++++++----------- fs/binfmt_elf_fdpic.c | 8 ++++---- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 106f0e8af177..5b4a92e5e508 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -762,8 +762,7 @@ static int parse_elf_property(const char *data, size_t *off, size_t datasz, } #define NOTE_DATA_SZ SZ_1K -#define GNU_PROPERTY_TYPE_0_NAME "GNU" -#define NOTE_NAME_SZ (sizeof(GNU_PROPERTY_TYPE_0_NAME)) +#define NOTE_NAME_SZ (sizeof(NN_GNU_PROPERTY_TYPE_0)) static int parse_elf_properties(struct file *f, const struct elf_phdr *phdr, struct arch_elf_state *arch) @@ -800,7 +799,7 @@ static int parse_elf_properties(struct file *f, const struct elf_phdr *phdr, if (note.nhdr.n_type != NT_GNU_PROPERTY_TYPE_0 || note.nhdr.n_namesz != NOTE_NAME_SZ || strncmp(note.data + sizeof(note.nhdr), - GNU_PROPERTY_TYPE_0_NAME, n - sizeof(note.nhdr))) + NN_GNU_PROPERTY_TYPE_0, n - sizeof(note.nhdr))) return -ENOEXEC; off = round_up(sizeof(note.nhdr) + NOTE_NAME_SZ, @@ -1603,14 +1602,14 @@ static void fill_auxv_note(struct memelfnote *note, struct mm_struct *mm) do i += 2; while (auxv[i - 2] != AT_NULL); - fill_note(note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); + fill_note(note, NN_AUXV, NT_AUXV, i * sizeof(elf_addr_t), auxv); } static void fill_siginfo_note(struct memelfnote *note, user_siginfo_t *csigdata, const kernel_siginfo_t *siginfo) { copy_siginfo_to_external(csigdata, siginfo); - fill_note(note, "CORE", NT_SIGINFO, sizeof(*csigdata), csigdata); + fill_note(note, NN_SIGINFO, NT_SIGINFO, sizeof(*csigdata), csigdata); } /* @@ -1706,7 +1705,7 @@ static int fill_files_note(struct memelfnote *note, struct coredump_params *cprm } size = name_curpos - (char *)data; - fill_note(note, "CORE", NT_FILE, size, data); + fill_note(note, NN_FILE, NT_FILE, size, data); return 0; } @@ -1767,7 +1766,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, regset_get(t->task, &view->regsets[0], sizeof(t->prstatus.pr_reg), &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, PRSTATUS_SIZE, &t->prstatus); info->size += notesize(&t->notes[0]); @@ -1801,7 +1800,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, if (is_fpreg) SET_PR_FPVALID(&t->prstatus); - fill_note(&t->notes[note_iter], is_fpreg ? "CORE" : "LINUX", + fill_note(&t->notes[note_iter], is_fpreg ? NN_PRFPREG : "LINUX", note_type, ret, data); info->size += notesize(&t->notes[note_iter]); @@ -1821,7 +1820,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, fill_prstatus(&t->prstatus.common, p, signr); elf_core_copy_task_regs(p, &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, sizeof(t->prstatus), &(t->prstatus)); info->size += notesize(&t->notes[0]); @@ -1832,7 +1831,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t, } t->prstatus.pr_fpvalid = 1; - fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(*fpu), fpu); + fill_note(&t->notes[1], NN_PRFPREG, NT_PRFPREG, sizeof(*fpu), fpu); info->size += notesize(&t->notes[1]); return 1; @@ -1852,7 +1851,7 @@ static int fill_note_info(struct elfhdr *elf, int phdrs, psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL); if (!psinfo) return 0; - fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo); + fill_note(&info->psinfo, NN_PRPSINFO, NT_PRPSINFO, sizeof(*psinfo), psinfo); #ifdef CORE_DUMP_USE_REGSET view = task_user_regset_view(dump_task); diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index f1a7c4875c4a..96bd9d2f23d7 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1397,7 +1397,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ regset_get(p, &view->regsets[0], sizeof(t->prstatus.pr_reg), &t->prstatus.pr_reg); - fill_note(&t->notes[0], "CORE", NT_PRSTATUS, sizeof(t->prstatus), + fill_note(&t->notes[0], NN_PRSTATUS, NT_PRSTATUS, sizeof(t->prstatus), &t->prstatus); t->num_notes++; *sz += notesize(&t->notes[0]); @@ -1415,7 +1415,7 @@ static struct elf_thread_status *elf_dump_thread_status(long signr, struct task_ } if (t->prstatus.pr_fpvalid) { - fill_note(&t->notes[1], "CORE", NT_PRFPREG, sizeof(t->fpu), + fill_note(&t->notes[1], NN_PRFPREG, NT_PRFPREG, sizeof(t->fpu), &t->fpu); t->num_notes++; *sz += notesize(&t->notes[1]); @@ -1530,7 +1530,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) */ fill_psinfo(psinfo, current->group_leader, current->mm); - fill_note(&psinfo_note, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo); + fill_note(&psinfo_note, NN_PRPSINFO, NT_PRPSINFO, sizeof(*psinfo), psinfo); thread_status_size += notesize(&psinfo_note); auxv = (elf_addr_t *) current->mm->saved_auxv; @@ -1538,7 +1538,7 @@ static int elf_fdpic_core_dump(struct coredump_params *cprm) do i += 2; while (auxv[i - 2] != AT_NULL); - fill_note(&auxv_note, "CORE", NT_AUXV, i * sizeof(elf_addr_t), auxv); + fill_note(&auxv_note, NN_AUXV, NT_AUXV, i * sizeof(elf_addr_t), auxv); thread_status_size += notesize(&auxv_note); offset = sizeof(*elf); /* ELF header */ From patchwork Tue Jan 7 12:45:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928842 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95E2EE77197 for ; Tue, 7 Jan 2025 12:48:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 288B76B00B3; Tue, 7 Jan 2025 07:48:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 239976B00BF; Tue, 7 Jan 2025 07:48:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08B386B00C0; Tue, 7 Jan 2025 07:48:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DC11B6B00B3 for ; Tue, 7 Jan 2025 07:48:15 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 998CCAF2F0 for ; Tue, 7 Jan 2025 12:48:15 +0000 (UTC) X-FDA: 82980633750.03.92DCD92 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by imf15.hostedemail.com (Postfix) with ESMTP id B54EEA000D for ; Tue, 7 Jan 2025 12:48:13 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=OCj9yLAG; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254093; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NDoGkIZOBZADHox4rebBhOBkiub95NT2vaNCAf0u1/w=; b=LcqKm5ADv2IBMbLPOMptZRJeOXrUYT1sln0PzAYNZP6ztPukfBMEKRGXE8zWPT3waTsRmE wDglKJJ9rGY8govmv74HVUeR134I9U/zIGyzWdnOS42m/AJ1kpLpftTn0p3Iqx0yEzqOT7 YhkyUcahgNpTL37sygdhQRJM5Uavfl4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254093; a=rsa-sha256; cv=none; b=Hokc4CH/NiL/7pumxp4y9cQMasz2Suekd2/9wcZRcxMtDVLENCs04oc8gM31XeEgPVUA0u TjHRLAntIGfx+GW6UNVOepr48c7cCtOxVcqVxy6yma3JTwZ/yxeB2k49yEyH38bjeWPgKS /E+xocVq6ipVJCBjId2Xh+QO/je4QMI= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=OCj9yLAG; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.53 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so23006709a91.0 for ; Tue, 07 Jan 2025 04:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254092; x=1736858892; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NDoGkIZOBZADHox4rebBhOBkiub95NT2vaNCAf0u1/w=; b=OCj9yLAGUKmfc+dr0Ls7zKSon00cQkNykdPGEwXay0gSvRQQnONafKxvYyOWpbj0bK BqFMU39iSIMm3HiIpCvTzMaeSvqkEj94OscPhOeovfIgI5JkNbbEGpIdJnPdJ6Ei2Dje r26f29lhEIOR3VN+0He9SJImigv3zETjfgjd6bplBCkKFXrWjQwNWEhP0J0WliZ+aNVK w0cEAJ2/25h+pBm46PhwsScxLt3cVk+kZAB0spYyyJvh+O+LCiJKZJESLe0zjmKwX5dR B50kJcbV1U5oeumYB2NEky6wBm1PmoqhOEJniQHTZGzlHiMc4HH5Ac4uzPYvglTSB+T3 rTYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254092; x=1736858892; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NDoGkIZOBZADHox4rebBhOBkiub95NT2vaNCAf0u1/w=; b=JCxZI0B+VUoX68P0a1I6Hx20ee4nNGUpBVvBzZXg8Tsv7FaFpCNH13cQNkbbSyuwWE HD8vYtZ58X2plwVm0S/6JWa/DV+z793WgQg4bsH3F85F+JBg03xxt55FXPc3DscZg5Qj FtXMtyuXc5v5dZG9oYqPW13Fon0QK4wWv/N/seqgCdSGM5SFOf0Zw/EzX0d3uaYBQieO IJ3sNK5LrpZlT5jbsuzvG+mJ4IF8PIvPU6/TpGFMRXmrb+gvzLQBrKYN4nbVcTsEkMu2 +few1nbNrMQTaLuc/RlHZCb43qp65J59rPhMh1ukPCF5WTI73LqqgY9SMWPJdcwLypRA oP+Q== X-Gm-Message-State: AOJu0YzBPZ8Q1Yw7dWGkFE3F4jgPTCYEe+GjupiO4NR6qZdMvgusbmUX SSCVGl9GhulSshJZnrZgO8pOqNPIhnFQ0yyn/w/EX+1xJiDPV6R4czYYVjhzD2vKkeQhnj2TfWg i X-Gm-Gg: ASbGnctbZrvXT/LjXJrvnH6GPg5BeHdaiK4c4d5kfbNGdEsFM4t1o9k1loUdjIwZ85S +wPFEAmb4dikafrTdVkk/5XBlXGH+Y8L+cB6yKYQN3neQ6u7AbHVQsFDAs2ctuEkpBeOMN0oE4t dY3az7gduG2mHNr4W3N3BTcdPY2cdIdIm4s5DbPC9/LE6oOXJUCbrLJ1+sW/GQYCoy5FGhlip7o b6Hf9jqwOh+dWsoy4SpbydoACg41mXT7Jg3TONEFk9nIEkXAZ5NtsnJko0= X-Google-Smtp-Source: AGHT+IEVKBP005EvKmW5Tl+CNM3WgQ4gF7V3wiTUcNw/Hf4GbFW1YRz6KtZiTE3d5Nc2ByQmLcCTzA== X-Received: by 2002:a05:6a00:240d:b0:71e:6b8:2f4a with SMTP id d2e1a72fcca58-72abde04f6fmr85408908b3a.12.1736254092437; Tue, 07 Jan 2025 04:48:12 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad90c133sm34268685b3a.183.2025.01.07.04.48.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:48:12 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:54 +0900 Subject: [PATCH v3 3/6] powwerpc: Use note name macros MIME-Version: 1.0 Message-Id: <20250107-elf-v3-3-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Stat-Signature: 7jxk9aisn3r3ereje1aacjkbga61xjqq X-Rspamd-Queue-Id: B54EEA000D X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736254093-105586 X-HE-Meta: U2FsdGVkX19SEgZMErwfQVY9mp3wXSDXZpRQelwLZZAfKSRGuRxhyggvrKkSJ7HOKhN/VDWD6+rZtsnnOVyfJL4uyaVZlExrBWmobVMoqpE3nkUuqjt9XUXRhfW/nQtXxw+nlL/LLSnFq3+eoy20PhGWi5Hg+qFPFHAy54HfMuiu0GdKn9ureweYb8kTpbsOXLjcRlpv2CBWcKFJZb8BfD+IbAqRKv3XUcgXB/tHcA1E/1mdfAzO5R6+JE2XV09bT84NyvnqpTYmttlNGI0nQICu68EaEubHq2DvUIwsg/i0X2HTZsVXBbrvWAXJ6rTy+9m3athzEDkMaau6+aaH0vqWKFvjvaa+5444q9LA6blcPcZPN7cUValWvCiCMt0EYM7m1/L96zycCTCMCOZZ0FVpBWxJTv6KfvN2mZXdWmK7FiFcusZD4m3G1VOlVDgd9JI05UNDp/epyi/7jqs8Ge/+0eb4ek/SzQW9m2U4PjUNc6ZQ686Spwq8gXgywB9KzNB2KsAa8fb/uQdJ2i0psYHjTm/R4nzLqIrc7qzcNK459vWc7wWzb0JSun3AsC5Igup8IsuEFYTV0YuMZidAFuxnqDz1xkW3J+P8KpI0N9PcV2sVA5nDQnHKRJjnhwyfGO5h9iauCZV62H9zad43ZpMYgVdQTy9V9Fo2IsxbVINUShjt45PwwJxU39uMk/BP6I6EsMHtL2m+zczb2zfEcFbVBQzPEAo5cTqXuT/TvZluCWqpQI+1EbmNLstevkoVm+qQj6gKQPFE7rHtUtNYtUtvfhzDsgyr9a7k3rq40QeOSz8nmLiCiAYKXIo4i6Td3sDgptq1JqX6j11pk4quUqJ/vZrc4Wjp0VG/3whfVKIzQDj7Q8wURMhtBzwr2DDovVDG2rUMFpBpadloAqLI1OSd158Eg35/PMpSqcEGIYio/uYTvtwTh7p15n+wE7da2TGzwVy2DV+iZQXSx7u stGL0nVu V7tQTpeyvvmYD3xl9OmaA+/3JFYTNl0kN94tE2DGv6KysUikONI+MtAoKq6larYooC/qQ9Gtx7s7C3+OS+3lAaitH2Cpa0tK1bBUO6TSdJt+j/U4dnb5EdwhUw05oLRdjlBO7zJaXhlqAKl7p+9HGoW00htiOMpH16neDfxzSCVSw2H4HKOKQ+HzpMIXJOp5NEyfarzOnFMM+hcKaiXrUbBLYA4pP5bA+Ovq2paLS9RpglhncOkZdgAL7UCHP6Yntk0abfjLgwYWi3KRkOb7bqVl/Q5EYT8D7O5XOk6guSIJCR4vJrhnKR/bApOV1VRKyzFPHGGqx93zMe3MMIXVeyJcJL3QQeHYNXkyINV3Z4FGB1yE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use note name macros to match with the userspace's expectation. Acked-by: Baoquan He Signed-off-by: Akihiko Odaki --- arch/powerpc/kernel/fadump.c | 2 +- arch/powerpc/platforms/powernv/opal-core.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c index 4b371c738213..d44349fe8e2b 100644 --- a/arch/powerpc/kernel/fadump.c +++ b/arch/powerpc/kernel/fadump.c @@ -751,7 +751,7 @@ u32 *__init fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs) * prstatus.pr_pid = ???? */ elf_core_copy_regs(&prstatus.pr_reg, regs); - buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); return buf; } diff --git a/arch/powerpc/platforms/powernv/opal-core.c b/arch/powerpc/platforms/powernv/opal-core.c index c9a9b759cc92..a379ff86c120 100644 --- a/arch/powerpc/platforms/powernv/opal-core.c +++ b/arch/powerpc/platforms/powernv/opal-core.c @@ -149,7 +149,7 @@ static Elf64_Word *__init auxv_to_elf64_notes(Elf64_Word *buf, /* end of vector */ bufp[idx++] = cpu_to_be64(AT_NULL); - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_AUXV, + buf = append_elf64_note(buf, NN_AUXV, NT_AUXV, oc_conf->auxv_buf, AUXV_DESC_SZ); return buf; } @@ -252,7 +252,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) * crashing CPU's prstatus. */ first_cpu_note = buf; - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf64_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); for (i = 0; i < oc_conf->num_cpus; i++, bufp += size_per_thread) { @@ -279,7 +279,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) fill_prstatus(&prstatus, thread_pir, ®s); if (thread_pir != oc_conf->crashing_cpu) { - buf = append_elf64_note(buf, CRASH_CORE_NOTE_NAME, + buf = append_elf64_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); } else { @@ -287,7 +287,7 @@ static Elf64_Word * __init opalcore_append_cpu_notes(Elf64_Word *buf) * Add crashing CPU as the first NT_PRSTATUS note for * GDB to process the core file appropriately. */ - append_elf64_note(first_cpu_note, CRASH_CORE_NOTE_NAME, + append_elf64_note(first_cpu_note, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); } From patchwork Tue Jan 7 12:45:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2A724E77197 for ; Tue, 7 Jan 2025 12:48:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AC8936B00C1; Tue, 7 Jan 2025 07:48:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A7AD56B00C2; Tue, 7 Jan 2025 07:48:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8F03D6B00C3; Tue, 7 Jan 2025 07:48:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 6CC9A6B00C1 for ; Tue, 7 Jan 2025 07:48:22 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id ED922C090D for ; Tue, 7 Jan 2025 12:48:21 +0000 (UTC) X-FDA: 82980634002.24.1B7F1AC Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf05.hostedemail.com (Postfix) with ESMTP id 16AA110000C for ; Tue, 7 Jan 2025 12:48:19 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=NFzo5349; spf=pass (imf05.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254100; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=d5w0df8A0RGvduNGo/n7gECMAUl7ttjM0kfw51R7kHo=; b=240nxaodxQbSJe7TKN01/5ovXjaCZBDysDNw1Cg8fCGRTIvhj9SVpfVAJ7Udotv+AC45SG wxCn2yVh36SqYqgtOC2SNoeSqCCL8BY5xwgPgv48C+bwpXxS8jCAzzuFWsS6mLkJGqGxj/ JKZ8S26Wst5c+In4VzEF0bmhrRgHIi0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254100; a=rsa-sha256; cv=none; b=B7o++EFUbQjrg0W5d/M2W7gEy3Ez8+T3b2AD8KzQIFsYr/D3FXGVhwjPnDp1y3WaC8JzNN hfRawfIRvq/0bKLfo0Flbgohre2aDPvRbtNDm+tUI2zzA0ho6V9fXVtR17S81ilEO0Zmm2 FWCtT7BWUXeF5v14XG4tfM5lC0Jp6F0= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=NFzo5349; spf=pass (imf05.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2ee74291415so18414667a91.3 for ; Tue, 07 Jan 2025 04:48:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254099; x=1736858899; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=d5w0df8A0RGvduNGo/n7gECMAUl7ttjM0kfw51R7kHo=; b=NFzo5349mPD9tX+wqas+OyQOSBNnhB32wADsUxIwNMvjzj+Yg2QZUdoc8sJn1JjRAe bberyv+eaKds22FiiVAMgVoH0G26NpqyduO5yNW/eIqPXAPKoK3xS7FNNzT97l65qnAc eNfV/UpQ8K9/1umszTShnTJrOCcNfk0pXVkf13C5gpBLR3U14RyGZC8gkAgkl3yV5rOs hIHlqPb0wwqXJr4h2Vdq3TxZiU1B8toiHlU2zF7hVWosj6T2q4CEKwdy3JjwHwHcxAZC 2UlYiH/p1hgCi47PLjka5EdiofY6inGXAXT9C9gU4VbcfKEU5hDQtG+kvs/7Yb0sAnSA klGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254099; x=1736858899; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=d5w0df8A0RGvduNGo/n7gECMAUl7ttjM0kfw51R7kHo=; b=vBLKz3hHUzopdLXf4e/hl+O82pKePhY053CsentX41VkcegQ1NprR46SqQrUwp/M7H ioagcl87jxAjbNHJFLG/GFae/g9mqUuGxgcUn66kXPervINey3bxB2bY1SA+dSnNj1Xi mDuJe2ShZWbQx7AgsjS04l8kuAOLPI6DlfLPqKaZ7QXO0uquOmCgwZlZ5cV9cpVPriTm D0jpWtxU0AoQqkxq8ZwDO6DWokm85V3n0+ZlMjnM6uyagC3anZ1JoGXH1Kw7oI3l0nDX /onWnhTYy+2XjROYzmgPc9jkJ+102nYEQgmpC8Q0QpKc08fpPna/jD0r3K+eZBonmr3q SZZA== X-Gm-Message-State: AOJu0YzUVdnfpFdzbxoxyq57PBEFKALc70Lu+KrdHtwFeFNiOQdquy+v eazLaZwyN9T2LWECgUgB+j3B6L55y6HoY6et7kikbqaSVKHV0ICXuPpZ9IS9vGY= X-Gm-Gg: ASbGncuOjgXYtEIkC48Sm32J1ooYpHMAkSgjR5H4RKSuqiAsbPR9p+Qp39/A5+2FhTJ 9G/AKupFUUv6qfwWZoWcTGLgAL+voWK5BW8IHOQIH2nGDqmV1QDXkdEZmxScamFzjkTLrIEFYpH e3FFkusC8KCPzryNhmjWx9kdBCzYWdFR+mVcP26zjVnXzg53BLksFFftHJVMM1HmT7ua/aMtusq p/v3euVFLNjUhIu9a2wkHbBJwNFtGlBkpWQS3kR/eN4woYT4gbjIxpJBBU= X-Google-Smtp-Source: AGHT+IF4unLvSG3ozl/K+xZg50qJ9RhkOXYw+z5VR9QTjd55CxK7F8LQeDMLqnNt5CS4t8mxmL2QoA== X-Received: by 2002:a17:90b:534b:b0:2ee:a127:ba96 with SMTP id 98e67ed59e1d1-2f452ec6d35mr81063623a91.23.1736254098937; Tue, 07 Jan 2025 04:48:18 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2f2ee06dd46sm41574100a91.36.2025.01.07.04.48.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:48:18 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:55 +0900 Subject: [PATCH v3 4/6] crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250107-elf-v3-4-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: 16AA110000C X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: sacme41hc9edtoq5fbbok5rceyo1zdn1 X-HE-Tag: 1736254099-583254 X-HE-Meta: U2FsdGVkX1/ifgSKLqSKXaKIDUAbpLaAIo/Dyy82uz2iIze7kWnXH3DebUWoujbf5GWrCWDhrBTEKdDZBJwQGJHQIhrAPAmQMDKCUd30j6yVYUo9Kze0RFcPff2HZMM52KsFvlCA0TjEnut2Glo9FJwQmirMeO1JpqvBqjFQQGPCyD9dKpOSc+aU2pU8SnThgX1s9YAbx3bbfvq4eJEcnaCqU/F+JOqcEtgwZCrxlhjepkaasc52czDFJPT/sufM0rw6maBbPna/Rr/CN4ujBqGtpXQ7Qia5LNOsHMQPOQnB5V2jdsHXSxEMblHrrTNl5eQJYy5THY0a/yD9I0MKoQB3P8E3zpSKz64aBXW5RogtmAAru46z8DbPiivAUjpjEnD8Nl2YYGf0ADMgIF0YXOORlrOl6e9lHpl4nDRu7kniFb9ArrMSA1GxmhUS3ikHawr8XkQFl104xqgZclvamsdREKwt+XS2mBNkfRots/duNA7eBrlv6OIjHvhFe82kn20BNjxh1piJeikg4+n5jIPM2NtV4nc+3hM+91+7Xej8GrteAdFkp8xc+0SfoXp+6Tg9Sa0sRpDQZO6AQDpssbHlyQfTQIZsUT/KJ/56qxNcotx826EI2a5YSikB6M1BDFgCjUx8PUFVOkDC+7P/iBxG8nOrACc21bybd3EQhnrCt4PTPVDA93zh7SzJmcN2CeyvcF3hxXeKeO0afD0yOtPFui9m4TP6gOsll0r/ljc+iw9PWAzvbgbZRm4QpPegYdu/26mICJUBHRBqgGT2z2WnwAX8Yhd8X1zg/QOy4nLDsWuIK5mNfh7mROFhGWtdTpJqsCBs20v/L9d4Dvwnb8bVN//Dl/osq+4Wh7rF64LsdgMFL74QwdHH/GAp0ce4t0XAuKuNDLINx8aCkHccdBvS0J5CaGjro0HQKmmGkdY74EPo1WP5xhR8nxGKjPm36tF2Aha4AuNML/n8sg0 xSQEjll6 9z8W5DFcUocsIMchGZ1hdBckfmBZYHMn8xgQBq+zgZqmberhE0NPJ6A4xuHna513Sq5Y0LdoVBbrsobGRSRTQboGtCMLt8rjlPM48GmQ9HL3SYGqtcbQvQyHlrUj1GL4U4Qk9EPhbG0lU00FLEi0ptHiHQYB3aze5cH7tGyqEAXl+Tvs7VzTneoaaZzlU7TFDYvbGq/QSm2wbLV+xwBhA/MG3dRVzWEE+ettUfklLwncc4W5JiueqQBcS4Vauu3DgzbvQqijfgL/Mxap1BUrqnwoy0VSDiiibPj5nr6GFZUqPI6iJjlPce551jjqsLeITrQZB+eTKm0goIuT6XVfX4J0hr1GKXaXa7sQLuF5vuk64Oo4= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki Acked-by: Baoquan He --- fs/proc/kcore.c | 12 ++++++------ include/linux/vmcore_info.h | 2 +- kernel/crash_core.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index e376f48c4b8b..e5612313b8b4 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c @@ -34,8 +34,6 @@ #include #include "internal.h" -#define CORE_STR "CORE" - #ifndef ELF_CORE_EFLAGS #define ELF_CORE_EFLAGS 0 #endif @@ -119,7 +117,9 @@ static size_t get_kcore_size(int *nphdr, size_t *phdrs_len, size_t *notes_len, *phdrs_len = *nphdr * sizeof(struct elf_phdr); *notes_len = (4 * sizeof(struct elf_note) + - 3 * ALIGN(sizeof(CORE_STR), 4) + + ALIGN(sizeof(NN_PRSTATUS), 4) + + ALIGN(sizeof(NN_PRPSINFO), 4) + + ALIGN(sizeof(NN_TASKSTRUCT), 4) + VMCOREINFO_NOTE_NAME_BYTES + ALIGN(sizeof(struct elf_prstatus), 4) + ALIGN(sizeof(struct elf_prpsinfo), 4) + @@ -444,11 +444,11 @@ static ssize_t read_kcore_iter(struct kiocb *iocb, struct iov_iter *iter) goto out; } - append_kcore_note(notes, &i, CORE_STR, NT_PRSTATUS, &prstatus, + append_kcore_note(notes, &i, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); - append_kcore_note(notes, &i, CORE_STR, NT_PRPSINFO, &prpsinfo, + append_kcore_note(notes, &i, NN_PRPSINFO, NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo)); - append_kcore_note(notes, &i, CORE_STR, NT_TASKSTRUCT, current, + append_kcore_note(notes, &i, NN_TASKSTRUCT, NT_TASKSTRUCT, current, arch_task_struct_size); /* * vmcoreinfo_size is mostly constant after init time, but it diff --git a/include/linux/vmcore_info.h b/include/linux/vmcore_info.h index e1dec1a6a749..1672801fd98c 100644 --- a/include/linux/vmcore_info.h +++ b/include/linux/vmcore_info.h @@ -8,7 +8,7 @@ #define CRASH_CORE_NOTE_NAME "CORE" #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) -#define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(CRASH_CORE_NOTE_NAME), 4) +#define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(NN_PRSTATUS), 4) #define CRASH_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4) /* diff --git a/kernel/crash_core.c b/kernel/crash_core.c index 078fe5bc5a74..335b8425dd4b 100644 --- a/kernel/crash_core.c +++ b/kernel/crash_core.c @@ -436,7 +436,7 @@ void crash_save_cpu(struct pt_regs *regs, int cpu) memset(&prstatus, 0, sizeof(prstatus)); prstatus.common.pr_pid = current->pid; elf_core_copy_regs(&prstatus.pr_reg, regs); - buf = append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS, + buf = append_elf_note(buf, NN_PRSTATUS, NT_PRSTATUS, &prstatus, sizeof(prstatus)); final_note(buf); } From patchwork Tue Jan 7 12:45:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928844 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1BF5E77197 for ; Tue, 7 Jan 2025 12:48:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 548AB6B00C3; Tue, 7 Jan 2025 07:48:29 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4F7AA6B00C4; Tue, 7 Jan 2025 07:48:29 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3990D6B00C5; Tue, 7 Jan 2025 07:48:29 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1A2746B00C3 for ; Tue, 7 Jan 2025 07:48:29 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C5B2E16081E for ; Tue, 7 Jan 2025 12:48:28 +0000 (UTC) X-FDA: 82980634296.15.57CDA3F Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44]) by imf29.hostedemail.com (Postfix) with ESMTP id D904B12000C for ; Tue, 7 Jan 2025 12:48:26 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=0Y5J5ypN; spf=pass (imf29.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254106; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=8B/uoyeuY57p4F5WrCZvdn0Td4esItXL4IJBDCfsGf4=; b=JToZ4r+PQzcehabDEfuLmtP9hgltOVN7T7YwKfq0vkyPXFGywFrx4pWmEP/Q2MAqrG14Ie BYsWbbPkLUqcRKzQCBSGI7kYFM4BuOHmcbmTPJ5RfZMA4xYr1Q8hyrkt9wCVpalkmBBLKz QWuvi27jxebcv3tkJ09iUCij03A6ymE= ARC-Authentication-Results: i=1; imf29.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=0Y5J5ypN; spf=pass (imf29.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.44 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254106; a=rsa-sha256; cv=none; b=aIXPuK9kSavSEVCug55VVFuaRRmRnaDD9LomoVsjL/rHtkRRt0U9Xgad/D1GkfqgF8qetr I2GdDin4Lx1/ivlJ45Dxwwq78RMbx4BC5frI+aWheibEDPyRpPi0LL7lzg6/8FBVQhCIAW HKbm3j3qR4oAyqG3M7vHiU8OFXn6k/o= Received: by mail-pj1-f44.google.com with SMTP id 98e67ed59e1d1-2ee76befe58so22629825a91.2 for ; Tue, 07 Jan 2025 04:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254105; x=1736858905; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=8B/uoyeuY57p4F5WrCZvdn0Td4esItXL4IJBDCfsGf4=; b=0Y5J5ypN5Mk9hC5q1LtCgvKDZx3Ua+EiT4F6vYGFhkD6TtOAmmVToqE5gZKZv8U58A hhaYsgojLcLx6g2LDxIcoW6XF/fuOK7jS5C70WsDEKOEycAdSooJZ3HLTxcMnP702Ol8 5+1TRpW7G1R51ASuUJqpOv3jczV3QCo0us8uhYfWxlXn6yFsmwcR1R1ZDMhNXpnO1BLf dlGQXj3T1Q2sAxrhcBLitAcVQFjy3U9adayBCobBegxTnkEwaYmsJ0KSflcCtUrgnMSQ AzjskO4EZS6AIh4XbcpYmHuLxxostu4dPEUzyClSqi3lQ2r7h5Pd/n8XpA2E2vywzWQl jl1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254105; x=1736858905; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8B/uoyeuY57p4F5WrCZvdn0Td4esItXL4IJBDCfsGf4=; b=H2oCIRdJJpfMqlo9m8lO2NzNwkYDkqAYntDOQkRzJyYdtfx/KhItxzKV2tGBvi1oHL 2ighcXALyEpIG/0bDZtbchFHxzJAagd7MrGaLTwqMY3Ed/3T7JF8I8wcqp8sDMzjzKIn p2Us5ci696dt5ghkjG8Cb9gY2BtpH7G8Fao3vWcpp+XQjhw58uETwTe5PPo+j42HGm9w GcL4i24CcGM1lHHTiNWrzgOwqMxUViI0VElnnZXoDjFXQAEE/mVWu33NYEhQ6yn7FTKB lB7qFZ/b24cK7X+K+jOa+Y1+Cmh0tOiM/lDVcrrgU5GgngZ2QD48F6yjIRKCcNGS2Yrp zsAg== X-Gm-Message-State: AOJu0YwuqkDEfyJyALTpsMs+GPByws/F95SWLn0wJtVRHQr/KPCXEQLn B+8bNWt6IVtSEK8ZqsvSbnYX/MfryUPuFtXSVmYtK3k2FFfvB7lsolByL363ayY= X-Gm-Gg: ASbGncsaWaR4/yYiOWPWMzrBSPvLHi9HTwtVL/VK/bP2SGmGZyfbot5Lq8Ngfuvd2nl AQVrgVfYOEG3qo69QaOtl9JnljGHgOYGQjVs0TqBFqbo8sQnimNjSkuJi9dYqhEpGPuZedKTs2f kdJyGOlYv3r/ObDM3SYAIBXoVWK6LUEE9KIQBUNqznPVM9EmdYeshT2Wi5IG/nHx2J7VxJQe2jX jf18ulgE+bEW+yTg4H4ER/quie1eZf4FU/6Fr3/UyeX87EA+eUe2b0gUcA= X-Google-Smtp-Source: AGHT+IFrm4rj/MLEj5on8APad3buiaiqCoLZIEAZ2AeMT04ViEKVqkKOmnPzjy3rlA6C6aSb7vkHeg== X-Received: by 2002:a05:6a00:f96:b0:724:ed8f:4d35 with SMTP id d2e1a72fcca58-72abdedda5fmr91700514b3a.26.1736254105569; Tue, 07 Jan 2025 04:48:25 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72aad8fd7b0sm22424647b3a.139.2025.01.07.04.48.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:48:25 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:56 +0900 Subject: [PATCH v3 5/6] s390/crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250107-elf-v3-5-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Server: rspam05 X-Stat-Signature: ku6c645odfng3354fqzfy5zebprwje99 X-Rspamd-Queue-Id: D904B12000C X-Rspam-User: X-HE-Tag: 1736254106-659408 X-HE-Meta: U2FsdGVkX1/IUDHJ9qNY1xwdApwTlsqoLsoNfIpGHQRqVz94oipSowr4JFzKt4tRlcvoy9G12Ff91Ao6dxNMheELVML86vYZXYOyDcQb03Ca4aIdFn9J5Cl4Eua5Iw0ssSP875OIfskJzFkOLPlu3Y18QX3+mbNXT31SA80vNauF1bqODMqZNG8uGuD3DzUpSRfwMYP24Tg8sMf9aKaHJLsiaeCaVHvQFF22iQxDUygAucKb+s/kUyu+gf0jTkV2XP9hMa+441YCV9Y+zOmqHC2GjIQDdSZZBpUxYmINmtPzWnPtIs4QN/iWiF7O11pl3dTbgLyzqvBmI00rjletGi0QgIEKNZm8ona3l8bHB/NlruAzGmdDIWyzVof8CA6B4zCi+jJzlojILypOJ3g+Sv0jMZMsWm11rVhHOTtBYBgPjKe0g1F1JWuIk41ZNd2b4ngmuQHXloZSxmVzZuEbKxxYXumeS5hmwMEHlmhQ2xEFqjCo7NM0sfFRQ87yUE7S0cwwgS0Qqi5VPg83fkVeZxM0UpS2Br8mYsXj7vzA6UiMQJ4qMmE+wJoliCvQ/VxIhfrlpPByVxz9cJbMOkMbdQ3IebMv2s8c4az4uwG7fcgfEyPdsaHtfdYfNM0DZIoyA1+VM/N/4jTtGB0oVN79kq48jwhIklmO/SLQouwcI/Gxfw9Exz5jk/Qk2NxtuaoboY5Wokd9jnthcOT77mOLLi5u6oSZAXctl92c8J2bmeDdSY1JUWkReyl5vYdXjPgtX6OMYkRugaroyvNNOJHg7/WhuMCBgGLCqZxoPDtUsZdipkXHtVPqDSYPoNN7MXNUhcHqWiVFFfrlqZXEI9fZczG4+Mh8pM5+2awvOt4LBBAm0eBR9fYQ6nWc6Z445LFdw85iZLhK0QIkVGWk5GLyIUVx02VRiWyd0jaZ4gYnl+qgkqQG121ra2F3vCSICbN0UfRQ/JBPKm/nBvMgSE6 xcdGXD/3 teAl56eR6KJpd/M3/QhdMxhLv8ML1aUcCTRBD+elGZugSax+Wnc/G10rY/LZLAXAhTZVln6r2B4oRa7JpD1GF6BgnXsazi1PFjTl+9cmiZoDrOyqzP7NrQV3u/forCPg4BpAUS9zw+oh2+SNfFyuTKd1/bM7juIo5cmip4N0XY1xsrLn9DEfyJDq7D96xTouqveesVJA69PTdnHHnXde4DB3vMBchXTP6Er8tjkec9jeE4mibXyx3R5UufIFvrzx7FZJtnuM18jFkXUNNhHMk83e451hSySA6rFcDBirGbGzzn3A5t0nvSl+uT8AElo0v8BnA/og9W1wAWq286pRnG29yLw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use note name macros to match with the userspace's expectation. Signed-off-by: Akihiko Odaki Acked-by: Heiko Carstens --- arch/s390/kernel/crash_dump.c | 62 ++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 39 deletions(-) diff --git a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c index cd0c93a8fb8b..6359ce645756 100644 --- a/arch/s390/kernel/crash_dump.c +++ b/arch/s390/kernel/crash_dump.c @@ -248,15 +248,6 @@ bool is_kdump_kernel(void) } EXPORT_SYMBOL_GPL(is_kdump_kernel); -static const char *nt_name(Elf64_Word type) -{ - const char *name = "LINUX"; - - if (type == NT_PRPSINFO || type == NT_PRSTATUS || type == NT_PRFPREG) - name = KEXEC_CORE_NOTE_NAME; - return name; -} - /* * Initialize ELF note */ @@ -281,10 +272,8 @@ static void *nt_init_name(void *buf, Elf64_Word type, void *desc, int d_len, return PTR_ADD(buf, len); } -static inline void *nt_init(void *buf, Elf64_Word type, void *desc, int d_len) -{ - return nt_init_name(buf, type, desc, d_len, nt_name(type)); -} +#define NT_INIT(buf, type, desc) \ + (nt_init_name((buf), NT_ ## type, &(desc), sizeof(desc), NN_ ## type)) /* * Calculate the size of ELF note @@ -300,10 +289,7 @@ static size_t nt_size_name(int d_len, const char *name) return size; } -static inline size_t nt_size(Elf64_Word type, int d_len) -{ - return nt_size_name(d_len, nt_name(type)); -} +#define NT_SIZE(type, desc) (nt_size_name(sizeof(desc), NN_ ## type)) /* * Fill ELF notes for one CPU with save area registers @@ -324,18 +310,16 @@ static void *fill_cpu_elf_notes(void *ptr, int cpu, struct save_area *sa) memcpy(&nt_fpregset.fpc, &sa->fpc, sizeof(sa->fpc)); memcpy(&nt_fpregset.fprs, &sa->fprs, sizeof(sa->fprs)); /* Create ELF notes for the CPU */ - ptr = nt_init(ptr, NT_PRSTATUS, &nt_prstatus, sizeof(nt_prstatus)); - ptr = nt_init(ptr, NT_PRFPREG, &nt_fpregset, sizeof(nt_fpregset)); - ptr = nt_init(ptr, NT_S390_TIMER, &sa->timer, sizeof(sa->timer)); - ptr = nt_init(ptr, NT_S390_TODCMP, &sa->todcmp, sizeof(sa->todcmp)); - ptr = nt_init(ptr, NT_S390_TODPREG, &sa->todpreg, sizeof(sa->todpreg)); - ptr = nt_init(ptr, NT_S390_CTRS, &sa->ctrs, sizeof(sa->ctrs)); - ptr = nt_init(ptr, NT_S390_PREFIX, &sa->prefix, sizeof(sa->prefix)); + ptr = NT_INIT(ptr, PRSTATUS, nt_prstatus); + ptr = NT_INIT(ptr, PRFPREG, nt_fpregset); + ptr = NT_INIT(ptr, S390_TIMER, sa->timer); + ptr = NT_INIT(ptr, S390_TODCMP, sa->todcmp); + ptr = NT_INIT(ptr, S390_TODPREG, sa->todpreg); + ptr = NT_INIT(ptr, S390_CTRS, sa->ctrs); + ptr = NT_INIT(ptr, S390_PREFIX, sa->prefix); if (cpu_has_vx()) { - ptr = nt_init(ptr, NT_S390_VXRS_HIGH, - &sa->vxrs_high, sizeof(sa->vxrs_high)); - ptr = nt_init(ptr, NT_S390_VXRS_LOW, - &sa->vxrs_low, sizeof(sa->vxrs_low)); + ptr = NT_INIT(ptr, S390_VXRS_HIGH, sa->vxrs_high); + ptr = NT_INIT(ptr, S390_VXRS_LOW, sa->vxrs_low); } return ptr; } @@ -348,16 +332,16 @@ static size_t get_cpu_elf_notes_size(void) struct save_area *sa = NULL; size_t size; - size = nt_size(NT_PRSTATUS, sizeof(struct elf_prstatus)); - size += nt_size(NT_PRFPREG, sizeof(elf_fpregset_t)); - size += nt_size(NT_S390_TIMER, sizeof(sa->timer)); - size += nt_size(NT_S390_TODCMP, sizeof(sa->todcmp)); - size += nt_size(NT_S390_TODPREG, sizeof(sa->todpreg)); - size += nt_size(NT_S390_CTRS, sizeof(sa->ctrs)); - size += nt_size(NT_S390_PREFIX, sizeof(sa->prefix)); + size = NT_SIZE(PRSTATUS, struct elf_prstatus); + size += NT_SIZE(PRFPREG, elf_fpregset_t); + size += NT_SIZE(S390_TIMER, sa->timer); + size += NT_SIZE(S390_TODCMP, sa->todcmp); + size += NT_SIZE(S390_TODPREG, sa->todpreg); + size += NT_SIZE(S390_CTRS, sa->ctrs); + size += NT_SIZE(S390_PREFIX, sa->prefix); if (cpu_has_vx()) { - size += nt_size(NT_S390_VXRS_HIGH, sizeof(sa->vxrs_high)); - size += nt_size(NT_S390_VXRS_LOW, sizeof(sa->vxrs_low)); + size += NT_SIZE(S390_VXRS_HIGH, sa->vxrs_high); + size += NT_SIZE(S390_VXRS_LOW, sa->vxrs_low); } return size; @@ -373,7 +357,7 @@ static void *nt_prpsinfo(void *ptr) memset(&prpsinfo, 0, sizeof(prpsinfo)); prpsinfo.pr_sname = 'R'; strcpy(prpsinfo.pr_fname, "vmlinux"); - return nt_init(ptr, NT_PRPSINFO, &prpsinfo, sizeof(prpsinfo)); + return NT_INIT(ptr, PRPSINFO, prpsinfo); } /* @@ -589,7 +573,7 @@ static size_t get_elfcorehdr_size(int phdr_count) /* PT_NOTES */ size += sizeof(Elf64_Phdr); /* nt_prpsinfo */ - size += nt_size(NT_PRPSINFO, sizeof(struct elf_prpsinfo)); + size += NT_SIZE(PRPSINFO, struct elf_prpsinfo); /* regsets */ size += get_cpu_cnt() * get_cpu_elf_notes_size(); /* nt_vmcoreinfo */ From patchwork Tue Jan 7 12:45:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4364FE77197 for ; Tue, 7 Jan 2025 12:48:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C75516B00C7; Tue, 7 Jan 2025 07:48:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BFD576B00C8; Tue, 7 Jan 2025 07:48:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A77396B00C9; Tue, 7 Jan 2025 07:48:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 86F636B00C7 for ; Tue, 7 Jan 2025 07:48:35 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 48750A08C9 for ; Tue, 7 Jan 2025 12:48:35 +0000 (UTC) X-FDA: 82980634590.16.4E5794A Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf05.hostedemail.com (Postfix) with ESMTP id 5B0D1100010 for ; Tue, 7 Jan 2025 12:48:33 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=r7r16peS; spf=pass (imf05.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736254113; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hJIM5PjsK5XkECqCUUoGiieCybrsun7CzYeIZbw5syM=; b=CAsjdRnGgr0WfIytCOqDfkFT/HuA75GvQIDHiDgfssrjb373+HkfdSscgZbQ8KFaWyBZDj uWpIpx9VkBLMP9QU8Tn1z0ZtLPH5NMa2JYhM7A196xDVYapGouslKpc73Z/Sqn55BSC821 BssyAL3FxdwuVhxh8DsR6tiK8whKLKQ= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=r7r16peS; spf=pass (imf05.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254113; a=rsa-sha256; cv=none; b=5iD/VpB2ZswG8Mpa4cOvLc1iVRyyFeZ6k/W/YqZT/VhYjuYRErmkiP6YyVUSynhkWJrYVG SwjG5exQussFfEGmZFXqWMLAFg27Q5GB9tRXdNca7AhZzk4DJjs8zmRhAHfIATWetwNXMD 5A/JU2RPNDOG5BTi8slC7atyufVT1po= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2166f1e589cso6813975ad.3 for ; Tue, 07 Jan 2025 04:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254112; x=1736858912; darn=kvack.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=hJIM5PjsK5XkECqCUUoGiieCybrsun7CzYeIZbw5syM=; b=r7r16peSfGvyF9Sqou7UjVG5ba1sATY1JAi36coZFGSD0f07rV9cT4jRdEROr+uO9V KXCHg5rwrcQYpJCUFA63DLpcnX8k/Kz4RiqOK5IKdUD9nnkhkNEwaCn0Xol5k8y++MG8 6HRqdwu589depGwg3/mivu7dfeJQ9XZmwJP21QVREJ/fyk/lhaYvXvcCTVwGkB32yPVo CvRAo9UiwM/evPdclMZIojC/W9RAzcO3GQ5cxatOtOjpO8XYs83b5i9mTRvf0VljoxjS G46JraVs4+FON5VRbnbJ27nBHmwZccdXztYbKNPrTvl15QeA0Jmu+kNSRvVjOyyvaEoR lwOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254112; x=1736858912; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hJIM5PjsK5XkECqCUUoGiieCybrsun7CzYeIZbw5syM=; b=b1y/q2UIBGN06TQdHJeOyI+pfugKixrXB3tNq7gMhneo+PFZZYUS/hAkLPXZ40tBqX MYTgs5dbcTzZWNv76F9qwRqNgRXdO+z8IDk8T0VdDB1oBOLeD5boice9gHeg9KLSb8Jl iIEuoln4ZLdnva3ffMd/FUWqTT5ZqQ1osvU43QHUZsIL8xOGYdTCBFWvPkdFB6YmzZj5 HxdK1iex9k1KUc54geLjhVfMwCeFKgaduhbe1qKQkpQZzGQIFvUPy4gpK4bFWsd9gUev FRG4Iwt/bKVdEoEjh23Fv9I8Fcxph+ezTFF1+in8vopvY9A7SdJWp2yTLHwXj2XAc0SF 0Guw== X-Gm-Message-State: AOJu0YzWvl+gY6PurnzSNFS+VE7OetHhX4jXuy5hzmw7YgFFAxYc/3BT lNMZVlqMgLY3jgJ+hYSTbjwgdxxupb2z5yHbtNgkH/C3lyTmCN7ylc94qe28+Ac= X-Gm-Gg: ASbGncv4B4TdH2hXP6R1WcCsxmyOjYyJgs9Zj3Kor1i2kYdGPipPY9Z+FvQpOJ+9IR8 hUULCsLyVbwCECsjdlycTbN2O1bPfQYe8Vh13JqU2ISvZl5iuNhbeE46xrNmTBtkLOtrSIGCMS/ bCvtcngyvoie9JA8Kte1yaYIYxp4c2otucVfiUk2i4A0NGmk+jHCKnY/gg6QlhtEjPjdgZ84AxV 5KmfEvWXG5OdOFT546MbjGHrPSumEJnZ1zZ/3xhxkVpL3TPsQAx9K8npZQ= X-Google-Smtp-Source: AGHT+IEgGWm+TwbUeO+9N7FURX28AGtJrPEUj7uS49yO94eCRFf85XIQjkIdMNAyflZYWE42i4plAQ== X-Received: by 2002:a17:903:22c6:b0:216:2474:3c9f with SMTP id d9443c01a7336-219e6f38177mr919043015ad.52.1736254112256; Tue, 07 Jan 2025 04:48:32 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dca02f72sm310596305ad.249.2025.01.07.04.48.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:48:31 -0800 (PST) From: Akihiko Odaki Date: Tue, 07 Jan 2025 21:45:57 +0900 Subject: [PATCH v3 6/6] crash: Remove KEXEC_CORE_NOTE_NAME MIME-Version: 1.0 Message-Id: <20250107-elf-v3-6-99cb505b1ab2@daynix.com> References: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> In-Reply-To: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Queue-Id: 5B0D1100010 X-Stat-Signature: njapfmbuopkiuro9d1m4f34swpogjcjc X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736254113-107662 X-HE-Meta: U2FsdGVkX1/38OvbPpizIoiFi+mL1krsWEuMuGqMUlihxv4MOBFyHUmuW/Sbq3zf1l9suQyWSZch2PFo6xv5TZN7l+28Ph7PdmzOT/mLm+TWbSNASqQkhPp2+ySwCltn01oy8CTiBkEf928aMT03VDFjhMslEsBCUnGj85NouhRe+XXxXfDCWgdqoZOGtyahLhiJjYw+oLX3wZHBZr9Ao7aKYzKPbz6j/DEXVyR/KFoDIAiAhENnrX+bUpKZzKY1Lj+WJ7E8/kd7vlfqFotzeNTnpzsDI63FFQTOJ4MMN//IFBM9PAPuTDwhH5d3LFxvP7CILUrr3eQg+i6I7Wo9GvrByNJlRIA3Rv0mrDx9NbYlhmjU3jkvCrBMPygZ6eb/YUFi8jx/OTK9QB7Tm+uNaNkozBzfVAiH5ssUHqtwDRuFOP5JvRVQdrz6h55AgyXABMBjMiAhPLsyijrCg/VbaZStT57uok0ZnDU4fvItYPg9t4RvzAPTl+kj7aLlBSSKZZACT/JnkVdcKfpVgtj4qnTqj2GmnJOkkOwfr6kjaHQe8C+REbr9JZCfJFokoWNfxon/z71xb22nwQaeSECrpx0mL+tgQTdmBxL1Uuu0l4ybN9UMgfDkJxcv8DBF3v9/Sd0pAl3PvtrZhU9/ZiRGEkKgn3rv3WDo3xsmyj8HI0G2XgFRFCt/VItLxJCh1ivm/e2/T6Ou8CaW8Okq6t48xX2Hyf3330XsJD+2QqrQQAKD7BxJa8Br0tNg1+qYxTR3GmC4r4X9POV94iCHDNcsTnL968btCjPZSl/KN6a1bo+7HPNt2IeJ/3i4b7kgY3G8MnvRxjAhtgg4zkdfjvq7ehsED6FxjOxnU0KiIcQA6r0vz+av44UzyYPXjB6578qH0qgkTEomdW5Md/a0Zh9+ri7YzGhNig0/lQ8PxfYT8i298BMgnGOjcHY4PtopHwoAuUrnq7jTsygTGnMP/ZZ rOlRfbVl rPM/Sx28Acyn/82J4CwZccPg5/G53najp7VwUr33Y14dRWMTU9VHwQMAYKsL3brTvoMDrZaHhbCmx0y1dP+IkLfYSAiee0DvmKTBCPJaSVgVc6cI43yuJtOSJsHE8acUVwvQO8148QIXbZrmKiUkeWdTFIdGSwcEUzmgRF9z18qr6uGgG3DbN+O818BbC+IjZxkEwwuIxB5NuYkiNnpP+dw9W4BmsE5CN0iLXa2xLc+GrYZcQlywlhC9B5mgz7dIY6+dA24Kzp7cvUTH1tlNH1VpkmKjwDAR+0FS1aoNhqDpwKbWMcxq7ZmzwZCuc0Dh3OCHRZh6Zsnjiu/vaj5wQU+hHAJrgT13MDNPpFGmua1ho2G1okrl9Lem1hzqMQqZx+h/Ti9T9PjPQoT1ouTIJPVr8qTqkffPtwgSy X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: KEXEC_CORE_NOTE_NAME is no longer used. Signed-off-by: Akihiko Odaki Acked-by: Baoquan He --- include/linux/kexec.h | 2 -- include/linux/vmcore_info.h | 1 - 2 files changed, 3 deletions(-) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index f0e9f8eda7a3..c840431eadda 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -68,8 +68,6 @@ extern note_buf_t __percpu *crash_notes; #define KEXEC_CRASH_MEM_ALIGN PAGE_SIZE #endif -#define KEXEC_CORE_NOTE_NAME CRASH_CORE_NOTE_NAME - /* * This structure is used to hold the arguments that are used when loading * kernel binaries. diff --git a/include/linux/vmcore_info.h b/include/linux/vmcore_info.h index 1672801fd98c..37e003ae5262 100644 --- a/include/linux/vmcore_info.h +++ b/include/linux/vmcore_info.h @@ -6,7 +6,6 @@ #include #include -#define CRASH_CORE_NOTE_NAME "CORE" #define CRASH_CORE_NOTE_HEAD_BYTES ALIGN(sizeof(struct elf_note), 4) #define CRASH_CORE_NOTE_NAME_BYTES ALIGN(sizeof(NN_PRSTATUS), 4) #define CRASH_CORE_NOTE_DESC_BYTES ALIGN(sizeof(struct elf_prstatus), 4)