From patchwork Wed Jan 15 05:47:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939849 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 C2BF4C02183 for ; Wed, 15 Jan 2025 05:48:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 36FAF280002; Wed, 15 Jan 2025 00:48:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 31F226B0095; Wed, 15 Jan 2025 00:48:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E635280002; Wed, 15 Jan 2025 00:48:48 -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 F3AD46B0093 for ; Wed, 15 Jan 2025 00:48:47 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7C950140FDB for ; Wed, 15 Jan 2025 05:48:47 +0000 (UTC) X-FDA: 83008607094.01.06A3921 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf17.hostedemail.com (Postfix) with ESMTP id 9452B40006 for ; Wed, 15 Jan 2025 05:48:45 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="B/KVLq+O"; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920125; a=rsa-sha256; cv=none; b=TWLI/DL6DMPg9fetsvlsiBzfeh/XaA0LuvqfGMxKpAHXUNbZD5Dddl9g82G+MGVdow6c4A knWs+lz7Np+NCQSS/TfuHsqvV3JrxXvl9IcwG1ZTVK1RQTy4O3vdWX8kOJzxwxdC5Zybrf bd8kIcSIGwVCCqxwFaTCbYNfgqe7uvE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="B/KVLq+O"; dmarc=none; spf=pass (imf17.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.179 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=1736920125; 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=fZpSo6SfUC/c8jq/24P0QMTbOGHfF/+b8e/6Q9KEQLE=; b=UdQ5PPI85TdmGu+AkYIDvVX/+uxl844g2Ce8s7KDWn6ZcAtle0WaxvX0YGE48437+1pK0h ciNrPZx1vo5uhH6E3BH+vURgrsNnqr4wAAWSyEkSLPz+dHTzSefdYouCPU9h94QHdbMKyb saPjYXqQlJcYDVeC5cfyxS0CF0edeVM= Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2166360285dso111737185ad.1 for ; Tue, 14 Jan 2025 21:48:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920124; x=1737524924; 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=fZpSo6SfUC/c8jq/24P0QMTbOGHfF/+b8e/6Q9KEQLE=; b=B/KVLq+O3NGu+GiqJ/Ztgezw7O1sQvQ6hV8LTSUQ3II1bgoh7AtiRiMBF/Y2Vkph43 ISPDLkdoZ2Co2OD83pZQwDJ6kts5IBHmqf05lCSv8y7kiwU+xF/USW+Qj9alYqJkBHxv KvY1SfSBkRDKoFPOqv0XcOtSqXKSRZv1HPJ8c8wQJmLEfQYRrFF9knC7qohItbbkrkdv 4CFRTQ9krTPtT/dLGx47DMLrmrXlyM/6JpNoIPQqu79L0TxxjGEv4bFd0Liw7HGbCEDZ ypxXswP50G+n9DtuVKlUn22lVCl3Jb4UUpGA66BP9p7KJjCQpFCTOsHwlGgcce7PFF7T KkcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920124; x=1737524924; 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=fZpSo6SfUC/c8jq/24P0QMTbOGHfF/+b8e/6Q9KEQLE=; b=FtzNqsZKW6acR6shXBdB5szfXll7UVOR6pdKuijWEdoLKWDi9lFMHeiSp1uju+FFcf H/ZO0xgubF8KYO0UzFqALoppFrgQEzXEPlr/cs+dWww85aUKVqVKmu36Nf+MRnuyaN36 WcKEJTpPr47dQdPP1FlgG1PDPuLilc9VexznLrExcTcz3oP6xmDlAyZ3UcGn56dpxQh+ QE82XcskFrHGoqWLbG1S7KGl3hdYNKjZh7iXPJsaX4sAM68gBY6gfWVqEjlQeK+hLXPb Dh0Fg4s38l8lmSV8JBnVKQUQWXe6lxmhnoLN0V6mTe0UONN4AtfnXFMK0j+yNG1mCkFz WY+Q== X-Gm-Message-State: AOJu0YyJiTKHk7T5aygkh7pOJC5DxlUle4WOABzNvJ4Hx/bJAe0I0J52 S0T1/0jUS1xYftiK250FS2zIS2vWFLhmY1A43mjrSQLg/AN71YzvMY+6Bd9yFeQ= X-Gm-Gg: ASbGncu90/Uui47g2VHieB6rLSLSkCyDF1mh3cX22i6rY/DmNB/x4Q27G5dS+DWB13E K80OiGrgkqF4H3A/WYJWzpvsNxJ7rcMuI2I/JUH2K3LnsueN+0Z/NfLppHJ8LPZlA7JBVo+YytK CUB3HhhHwVg5sPEwAhyYkam7mEkLGc3lcstbAavjehG/hMysUTHV11qTShX6BzjPLJmChA1Xpuv 61TshOJPo3iAaWuuuINxeTcx6b4/ZEBb6iOHRUXwzkDLSI8c2w4pW91tAQ= X-Google-Smtp-Source: AGHT+IE9Ko/sfU4l3gRoKIw1VpifRpZPoszZMRitXvYKUHMEVA/Y6+gd5cQmHupnz5hw/xWHCrALGQ== X-Received: by 2002:a17:902:d582:b0:216:69ca:7714 with SMTP id d9443c01a7336-21a83f339damr415380795ad.11.1736920124219; Tue, 14 Jan 2025 21:48:44 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f219b7fsm75675195ad.116.2025.01.14.21.48.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:48:43 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:47:58 +0900 Subject: [PATCH v5 1/6] elf: Define note name macros MIME-Version: 1.0 Message-Id: <20250115-elf-v5-1-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 9452B40006 X-Stat-Signature: x7xmwrnwip59h84t1kj5x85b4nxj4kto X-HE-Tag: 1736920125-965934 X-HE-Meta: U2FsdGVkX1842FwxMblErCtXlcqBo2tQHUkNI3/SZh5KTdwPr+FJ+hctqQFEavewC1DC5pmyWghySshccznHqfK4sNld531fcc5waipUOX+XbobnsgqIyLFWrLHoK6++lfDwbOVL5gnW34uRmcmZQzHXQpYFVUhDZbtoe+IELypF/3CkS6zOpU3tkU3Y9T+jFYBp4TGVHxRGP/jetEm+pvlgsRIoLok5b9cLm1qckH9c/XBxr/rYrp79Qbh4Bjtnb6/4a+SSjoXIOwswTP9oMshgZi+XmHw2vj4gGL+ihc16ZZlPHv937H/knRb168xyDVR9fxSgk28E/QKNBKGHLNrsCDZDWrGMAYrJGleSkV7wYInjVenmDDiUSN7+fV2BDvOMQJa2uxAVVXhQQevGWgMs8q8gyXMQ4JarPk55/9X7fqc/4IEiuIxRv7Q/tFdoRHSCBsssQ2WxmeLwE7qbJwYUuk9LflW6PM5t6Tu1bW8vGc4RPjP3P5pI5A1D2oduICAZtYAjNfnRrvFfbun+dpvpdkMCXmmFBWakUUiPzyLh9nScRK6fEJI92auTgKGr+tso7scwONZccJsdF41zBhZZqgEReGyUamu2VQvv0N8EGCZ6NYTWjjtFH5lZSeMr7kbwDWuoKilGYeWUIVjEC2FiWb7Ut8rSGxi34+65iZkJ86TDpub9DNuEPC6giEVASTO7rkNMqI0L1WQNj/v58aZz/mZ7jJDFduhOSSUt0l1w0dTAIWmWFTUhEn6In2v1ZghMmOjQJHNUjd4Z1XSFvUQ5PO0D3ktMk4fOZ3tTfr/K+42PNqxhy46Dl6109rYsvHeHHM94fRnnhPfo0htmOZ7Fnhav9zA0CnMNKXkMvhrHwqxnTVtSPrDCUx6kM659S6VF5ddb+AS+r12GabnnOtCJ/Ec0ZebinZlUsTC0YAPYXje6zDhzQIZobNEbn0EmtU4/ncqKy7GpQvRpTQz QQ4c3kq7 otQud3aQhgc0d44ctoPZuLyQrm4s/VgzrvkTH14/2c998BbwKraTFzA6N/QJIEaxKA4RjlzKdphFZSjHJ5j2wkpJfdANiBARyAukS7di4TXoa8CrNW5cMnm6SwAkBqHUHpvs1pApYz6pKoTz1+/ck/yqrzgJpeI98/Q3SX6cdok531YaKSyGLZz1695Q0Q8Ty23/ezrUgkog1vZzcDU4tX16SgVIdOY1FNIam74ms7km5Hd280gktR+TZcsJVif6B9DmloQGxpMr4CSEcpuCTOsvQ8voNBbgPPqM2SoYx7/XWOwhBYdpTqLkF601lPmkwfk0ykjFjNxE4tpiENlruz4T//vX9RExmxzwmwVkE88CKxsQ= 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 to remove their duplicate definitions of note names. Signed-off-by: Akihiko Odaki Acked-by: Baoquan He --- include/uapi/linux/elf.h | 89 +++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h index b44069d29cec..592507aa9b3a 100644 --- a/include/uapi/linux/elf.h +++ b/include/uapi/linux/elf.h @@ -368,101 +368,180 @@ typedef struct elf64_shdr { #define ELF_OSABI ELFOSABI_NONE #endif +/* Note definitions: NN_ defines names. NT_ defines types. */ + +#define NN_GNU_PROPERTY_TYPE_0 "GNU" +#define NT_GNU_PROPERTY_TYPE_0 5 + /* * 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" */ -#define NT_GNU_PROPERTY_TYPE_0 5 - /* Note header in a PT_NOTE section */ typedef struct elf32_note { Elf32_Word n_namesz; /* Name size */ From patchwork Wed Jan 15 05:47:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939850 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 9C124C02185 for ; Wed, 15 Jan 2025 05:48:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 347BB280003; Wed, 15 Jan 2025 00:48:55 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2F71D6B0098; Wed, 15 Jan 2025 00:48:55 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C92B6B0095; Wed, 15 Jan 2025 00:48:55 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F13226B0095 for ; Wed, 15 Jan 2025 00:48:54 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 55DFF455A4 for ; Wed, 15 Jan 2025 05:48:54 +0000 (UTC) X-FDA: 83008607388.27.5AD30E7 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf19.hostedemail.com (Postfix) with ESMTP id 5E6221A0005 for ; Wed, 15 Jan 2025 05:48:52 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=zQaaIfDB; dmarc=none; spf=pass (imf19.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 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=1736920132; 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=sHzEFJeIZDo3f5k/3U0rvOC8rXQluzySCipEOCSBJIE=; b=IVPbZDiSvPTOeSvhoQ9UocYWqpFwDcYGRBRdGK8wGb+70DJxOo7NlmiB1++n4I8vKVKCm/ 9mDMOQJOQGlUJb/MdtnI2kcT9wCBCegZJfDcXcq7emBdN2lV92ArPIlEucjgEKxvndXj5z Nh9vrIISXWWziRrIF/Kvc/nRzQFkbLE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920132; a=rsa-sha256; cv=none; b=eqkKzL40CzUPbmANGgeifhy8iHZ9p+bIwcbvscyjoeQoseqexGvEk67Z7ZShjNZBSlOe9/ COvkbTbltAc5JGb4dbfIQeDGeqT7Afx5+2kQzdtFE+5MBQAyMYuF/CeGe92BRgl0HMXwzi e5WDhGBxt8YYKl2wPyFHc+rHtYF7oeo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=zQaaIfDB; dmarc=none; spf=pass (imf19.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2163bd70069so115030405ad.0 for ; Tue, 14 Jan 2025 21:48:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920131; x=1737524931; 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=sHzEFJeIZDo3f5k/3U0rvOC8rXQluzySCipEOCSBJIE=; b=zQaaIfDBO81l0F2bFicIC+QbhjJRVF4G1m8HjRkLkro0URgH33mZJdZgQwQs2EVk// jS/5TZkXZqlQgXDDI0amsfhlhuW/vV06dWfVBuKYvtnlAEoYrd56KVeM7idM1t/tsxYg x69VSBvKCAww8H2zd9XI0XYc+K4Ww3AjSgOCc0lnqBDmrrl44Ce4TUDf+aiRSVefmIzk qaIHUFKMcYPtxpe+uHVVU6iamPJ5cMNaSj+6y1tIk05X2Cg1Fh9dCbxKx4dm0VuRbPwb GjbImt6dKpWduOeHS77dv9UbFR0L/gYTNddXWSDJ7scFuyuWUOftSGmhH7upId2H76tX V6Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920131; x=1737524931; 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=sHzEFJeIZDo3f5k/3U0rvOC8rXQluzySCipEOCSBJIE=; b=u6pgj4QQmBnPhwDtpoQHvHv4r9pGOdpn0+i42l/Z3zIehieqb8i4+j6xaJE/Ae9LbA 7zssBP/b1/3dM48MP563wYOKUhE6gPqLi/90oF3a083u8P+X+wH1O+lzsYZcYJp1d63X n6Jl8y1pHSo5hrcL1Gl/1L7TTCNY2PZXVLcpPpn52U7wH3sqUtg85RVjPCjawAOTBNoi 6EGAmZ8jmAFiYesQKITEj0/I+LD496mRhFxlei+odaRa60vGhxFWvBy2n/anNxKH1y+R iKPQ10M+Kg204ciR3+4LLFODJYNiiTTdXEYAYQ+2evXq6kPosioFgkfEFbffmQatHnRT 0/2w== X-Gm-Message-State: AOJu0YwbizN2+m8Zgys3QHcQG8AUA1kjiU9k68wYFYBBX9kZ1Gr7Qk0R OeKTuJyKZqGxddFDGHOlethHejdGpJN6+gV28NNZOZyTPV00lXZq79BD+nqdDJo= X-Gm-Gg: ASbGncvxKEshbzU7fkyMXGPyTkFEIY++Ra2TFTB26Xsh5cn9EtRX0x2+trJ2r/W2kU1 hdMTMkJqzKZMw2FFeHARdwUfPGVOntXC1duC1J9U+dF76re3Qje7WvdfaWL9hLQpAB/t3mWqoim G1OQregFPnMuLvNb46a8Fq/2nalb8ul2QBJPRYO+ja/95Fcle/vs/7ivFZhYCvXf+Cv1EuJKV9B hKzwgpTZYlywhhwDwtJh9ykxxZ04q+pG9vQWHHZThOcpHAwDQCnazVkVh8= X-Google-Smtp-Source: AGHT+IE4WOueDadHkE/pTRlVlFsVpAiJG9FV/RBFhyadWkGkb4TxZaWQPSECPYbRg96If6idldoCOw== X-Received: by 2002:a05:6a00:9a3:b0:725:eacf:cfdb with SMTP id d2e1a72fcca58-72d22033ef6mr42478714b3a.24.1736920131167; Tue, 14 Jan 2025 21:48:51 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72d8bda6e9asm691573b3a.51.2025.01.14.21.48.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:48:50 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:47:59 +0900 Subject: [PATCH v5 2/6] binfmt_elf: Use note name macros MIME-Version: 1.0 Message-Id: <20250115-elf-v5-2-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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: 43tuiazxj3bxmu378jaydtdzgwotfgrm X-Rspamd-Queue-Id: 5E6221A0005 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1736920132-948355 X-HE-Meta: U2FsdGVkX1/SO0I7JErtW8pxikSpPzBrPUJ3XD1siTzH/RXbPzHn7F1CTB5r9dn2Kb5a6xcU1FjKmym/6t95v8t+AK136Y72dsZ0FGyhv8QLF4a2+QPDDyzTSoYYM3s2quayHLM8AmGpSRveiAj81IBVuxD1RuYL9hrUGb+FlH8JDcRyyL944WIc0rj2ELOmD8q7sQv6fW8mnWiLiOGuzYT2zbrLDFGIVs3LDUh80OIJOSZoduLpNvY2jFPP6bXOKNoXh8TJmt116EbDG9iMUXSmV80hw00vRzjq6Mg87wR7sfBEZvQY+Kztih1RF0c9uDcdbEpYy4DQF0bga9KO7beDesX63de0C2T54U8cCFzGhpJVJEc/HzV2NDoyUcQn/oCuCUSr5rbvV+gsTllpSm1lxsqNQSHCPyb4epeSt/Mvrb4/sKd9i92Xgq2d3DHBYEzJKEPCpaGbT8v6YFKkM48139nPN3THI4Y2iS/2hAH695biwAefprbFCD1DEBfAXG6uPuyCoI0nA8WQQXgfAqPprSMZ0J4Xf8UrV1fFj/qD+y38xXM7rqd2JrqtUXAcNMP6QC6h4lSDDDMrnbR+A0WxcEnmQREuykAWmpBezfuzQLULnkx/gyAdAzCAB0szgGf2f7N6J21qCyYZ/9KPFOCI9VT1ZTJTb79viYIY1ZcSJF+JpbYV2k09rBVtDmPMztahBRcMPfyjwSMivWOawFxi2y1xGAaYuXlPQ+QoERIi+xvok0EbRK2l8I2HwsEBVCdvNxhePjWFQsqcsFXRYkNXKCNdx2es1DOsOYjZtrLceLX3ro0+OPkjz+JAPAzdjQPY43TUHmJHLH5ZWfyYgwUsInoJrDfaC42WwvK6wxqyF2aV7tJkEwP2u3P+QBjV6EDh0qnZxLMQoRgoWjY1Loadu2eawc4dz4o5z/uP1GMwChQH13QCa6Ee1f0H5noQpMzPU32flVtql+OEXq6 bmckcEfm 2TKmord6tngypp9F/RaHzA9k5Z/d67TDTpfNrknh8WQYYnCvcevTmtyHu/3d2al706C+CvwzRI+W9t3bTjqYRkkC2DS2q8VbIXakr+cEA5dfnnuBBpX0oj9GqA7mg9STXLF4mRnYgbonyju8UbCIW9LpwyE0VWK6UjuqLIp4TCJyi4kIHyOy+3gzTxN6UQqqR6O9PLQ/Uoseo7ZZyCzy5HlMndjO7sYecQzc91L/g9PnZINP4qDYJjpmwdb6iU1Hx2Kx/AgQVGjonL72zLAwLP/uSQ7OarEs98zh+QAZ9qw0Or8MdvoI/ij6KdCwl+9S8ABsyrLkJ41upLCvsNqol2RBqpJ/3oHZaAJtseFMc1l7sWVSRRLUE5sFXHGDwY12uqcbKz7uzsUpDEHUnd/JjMGPe8DcGTp1NQxShG/mjXvXZxRwAhh34+Va9p5cTl0rlQntV901xSRcpW4qUeb9UZ2yPgg== 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 Reviewed-by: Dave Martin --- 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 Wed Jan 15 05:48:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939851 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 7D0F2C02180 for ; Wed, 15 Jan 2025 05:49:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B077280004; Wed, 15 Jan 2025 00:49:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 05FA26B0098; Wed, 15 Jan 2025 00:49:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E6938280004; Wed, 15 Jan 2025 00:49:00 -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 C8B7B6B0096 for ; Wed, 15 Jan 2025 00:49:00 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 79A18140FE7 for ; Wed, 15 Jan 2025 05:49:00 +0000 (UTC) X-FDA: 83008607640.03.F20224D Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf14.hostedemail.com (Postfix) with ESMTP id A4DE3100007 for ; Wed, 15 Jan 2025 05:48:58 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=RASwjGMe; spf=pass (imf14.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.182 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=1736920138; 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=I4SRmWOkQdk58NJ10wmqwv5TrRHdqCAxdQV3fT7eobo=; b=AcCSh4+8LchZh3humKBuJKloAFPtVtxCuSMhthd+DWEZZAxz0FDITGLJiAsgvqB74GHb6G R88vxJz6BOeLnPXX6pZS0fFC0k+0gHS4lMy54jKp4G/aadKJ7YuH0oWMlAio2K3pWLRAll JhS8EaPbuKqEFEM6h/nHB8CrmxDXYts= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920138; a=rsa-sha256; cv=none; b=f/0vfJHlUekqmzOTh3rqcPOPdEX06J2+YFz8pY50Yca5Of24sw33kZ10aBA1RYYaIii4RW UW9Xl/TWpGd2QpSgXSenRGC3S2Hzk//LP7kOJthm0j1h5Sv+q4eMCCk7GIJpM9Srhm0ydb N8ZYZypMOJGj4XGyVZFvze1mqclPQh8= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=RASwjGMe; spf=pass (imf14.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-21675fd60feso139168215ad.2 for ; Tue, 14 Jan 2025 21:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920137; x=1737524937; 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=I4SRmWOkQdk58NJ10wmqwv5TrRHdqCAxdQV3fT7eobo=; b=RASwjGMebyX/dzZX+lAGR0Glkdi+7uxosRavZleHpgiQmo7T7iAedLsluwhUzsqDYX rhfRatd6YDdkj9PlJmVHS75eg3iwq3Y9v3owhTuKRinIwFwbOap/d180bwQzW5Bf+7/D LaYR76k7/wSCTopv11nBTmJf6yBxW4MQPEjKr9npUsQ76ULHIRUpt6rl+QIsPElYPF2t abty4JEwRVEevrwZm9q3pX0j7epkdNqLAivVZo9vrZ9oAhF5x8qKFRnH6KdBE91oYnxp r1KGgkag34ucf7npt+8pl+gTFeg/CxUAHXjReXggbnf8GJHqLkkTy1cy4cAe1NpZ92C/ xxzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920137; x=1737524937; 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=I4SRmWOkQdk58NJ10wmqwv5TrRHdqCAxdQV3fT7eobo=; b=JUpXpKJF8qoRHioavhT8f9v8qTTaKBlCVvJPdC7Mhz8uJW/T5oHmHh2PkmmC2ZK2aT tdNeqjh73fFBbzS7cZs2Ew0dGP736T+HEuUiGQmcl9GACZ94FKOt7wDGqH2c640ufpfo 6I9meTf/phKbqA2nRMi7vJeJ33mTlkMT6PKSfXPENux7ueQHGmFgJ8wvN6/fbvPlwpgW cwKoarblHbka7ok3BAeCpEtfJQcgG1cRcUpbNbniXrkO0ueLHu+FtsSodoTpAbo9logV /rnRQF2MZIzP8OiNK5o24u+PzikdrR9dYICV5+pV+bTeD3xGq/Ko2f9HJS3XpU2lNfa7 lnFw== X-Gm-Message-State: AOJu0YzuyEMx1+xAZy9fm00BJTMGNQESLTVIDcsVOvkJwTKpxXNUB+Fc U96X4TZN+PWDuezstbvsgamQFKyXR4CirZEoJ8Fh0vxTvMn9GKaHSbyh5NlLoOg= X-Gm-Gg: ASbGncu+xELlSv4PmjDZGEb/p2XbkKXTS0s1E0SOs1flkffyxxam1az1HqM/W8H+1KR S8HhAQefi57ElBgKiBMlr8ZdD+clCdE0bwJNi8hn9wuFtny8IRsb7LEnGuvDbvy1AH994nrcA2p 43bcK48bp2WHaeC8538fCJnXxG3NEMTIkayGhVugYQLy3myD6AkCMhDdEXyzPUB9nD87lO3/xGA gC34GJOrLO+puCC3rXo+M/l9yEwFlDajmMph0bCZW09bVdgx+m/MjgtAGY= X-Google-Smtp-Source: AGHT+IELo9CjdL+yrG4BCg5jbLzJxkebkveFvc3aZpHyweclYXLk3OeSuIMKxGoccunx18mtoTdJlQ== X-Received: by 2002:a17:902:f644:b0:216:48f4:4f3d with SMTP id d9443c01a7336-21a83f56bdfmr398040455ad.13.1736920137397; Tue, 14 Jan 2025 21:48:57 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f111b82sm75035235ad.35.2025.01.14.21.48.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:48:57 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:48:00 +0900 Subject: [PATCH v5 3/6] powerpc: Use note name macros MIME-Version: 1.0 Message-Id: <20250115-elf-v5-3-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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: A4DE3100007 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: j4ctzkhafpu7k6h1ouim1oygfz3s7mio X-HE-Tag: 1736920138-157266 X-HE-Meta: U2FsdGVkX1/3b6fio74zNPDwYHZ+s6Jn9pJCbgyAcMgPzDG9crczi7Ct3c39nMr+OiUKAiJy/qqsqKBXWueHMqghjTD2HIWzmU3QOlLirfsRo5hxkKXWyzFY/K/Dkm0rqIOWy4oO+tPwJygDmHxW2YO84f+NVgIq2ReTKnYYy6UBkR3Cy336xdDJ1wOd1vROFENenaMd8aa2GlW7DllN5gaCKfJvh/crvWBSICa2hvUp8T+v0QiXTEkRC20kE6w9aSe+xvfY/gY5O5iDSC1doOiSCDhlaSbEip1w6KWlSRQEiK2DO2y/bf/1OqLmtevbfHEW51gr6MFjZBmhJyp4uX+fYnWSCkOZZ+8B77GZXgW+Jfrtq6KMvJsrh3L6zr6Tnmt7GsRd77mN986bpwWdKbakig6sQ92X8C3g4U1wFU/NdyWEQzsQX2jc9X4Aewm5+LhnmQlIa5osOmFYlPWB5OczR+Cg5NeAzxj6NOPbTfS0BHlBjuV/1gUK5jY8hP1O4nQIxn1T4pOJQCTu7u9fX3HRAgjvqTEduFGIgz5m6jbmUJJ0r9qMzyZt1xMoh1kEB1Fdw7rFqEBwq5dNGOtkLor/398auuSKLa+mNmEB+3H65jRXPIR4qqmt7KzlJQl+PfVkCPKA94DSlUct1l243PGlQCEijVoqkww9lvKLfvBWVREq8vXf9rNX5On5wjajoy+8Al/hGRfSDQ4TFP68gd/iA5jb99RlkNWKSEl8+CCHsgjsR8NDQ3Xo4iCkGT0gMqIty2OdSaSZSrbcwe/4DkB4QAXoo8Vdg4+Qh9v9p2FznbXSLJgY/k0qXZMYog16QztyIEkhwxGDtasco62Hnsw0hB0V0EYyHeADTuemuxBtyS6X6aQpzTTwoQwyzJY5g3iQSHQHpcXm7dTy4qW6sca8wB/GkwhPi718QQElVwC60ZC7+pjj9Bk3DHt2FOAJJH/OMpgn3dSHk7zykhv bKRb1l5G e3Eqpf5MU13TxaSJA06d5TIuIKXRN2I7lQqsgYqqfKb3VhgP3mjqFOoWBG3N8BwEahFPgQe6ptja4d3oY9XeeDQUmiZsj3jW0DjOf5OcIwlwtbTp4ZbrjuNEL1STpvFnn6jnKk3RGvbFNJnGKjafu6d+60SR2udE2oen5BakFGHZiUe8p8pr9NBlunARvMG2c/89clUN/kkas/SrVhxX1jf0xFTUJhzOXXV03G2qmvMNfsrJ2CFAREPfuL8B+jCiBD0pSJp68INhClTa/CtL9QeZk316bzzdGSBZvz7bJOo4uoSsMBm9m8wEtVyPWxd5kPnhY9XGk1D05vJ77Ac/n4PxSVKHTKMyXYy6aYxNf5bo8xVqoSCtusSa1eMPoaDaHtbzZnYDH3flq/Q1lFLgMTFRDhtaa+yLE8DE0hFD9GvFMwiw= 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 Reviewed-by: Dave Martin --- 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 Wed Jan 15 05:48:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939852 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 51B50C02183 for ; Wed, 15 Jan 2025 05:49:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA6EB280006; Wed, 15 Jan 2025 00:49:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D57D6280005; Wed, 15 Jan 2025 00:49:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF80B280006; Wed, 15 Jan 2025 00:49:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id A0D77280005 for ; Wed, 15 Jan 2025 00:49:07 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 54D04140830 for ; Wed, 15 Jan 2025 05:49:07 +0000 (UTC) X-FDA: 83008607934.23.B2BC3CB Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf19.hostedemail.com (Postfix) with ESMTP id 756031A0004 for ; Wed, 15 Jan 2025 05:49:05 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="QzZK/PE/"; spf=pass (imf19.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.41 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=1736920145; 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=D7R1Z0m4AmDiEDGrwLKGXNpW3g69MQHysWRaDTZFxP4=; b=z/JEhptfs6gucfPDcIaLhQumiypwJcf4z7ZJ78V3c8lSrQs+I4bF9lOjQ8DuajmJgoHDwa NzZuNQlY90/xjcbSeVozSdc9RWsSu2ojsxNTqNaNeOu6HspT4gh3II2+dUKLnRb0xjI9tD 2PHZKF2DogwPGqQk5NACWGmih4u1FiU= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="QzZK/PE/"; spf=pass (imf19.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920145; a=rsa-sha256; cv=none; b=26l9nAt8N1g16D6nGxNQ6VHD54K+kl+6qQWjElnfStq+AN+t4EuhFTJOBm1QVrMAged/c7 /FGc9Oz+DYxOKZrBCBaZXcX7WMCEDUxL+6K/bwGE+D9GNGgdbmj5CRaV1vxtnXkHbwWwmt 5tjNgklpxXxMZHQAo8/78cy/KhLIX4M= Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2efe25558ddso7916962a91.2 for ; Tue, 14 Jan 2025 21:49:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920144; x=1737524944; 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=D7R1Z0m4AmDiEDGrwLKGXNpW3g69MQHysWRaDTZFxP4=; b=QzZK/PE/1vswnDT0LloSg5r8xWTFNuYF6DAttzEs+WhU03/g2r1eClUqshQLPlxbIK TK0OrpLrZDHfuSLMkmDCDZK36kA2ALi4YVMkoAGJ6RAsm2WaGFpUgRzG+iawQgF4hUj6 3blfqfmNm8YPIA0H+9FUnIj2BbMQBwINU+He25o6mwSM7PraAoiQUYgjdiH/ELTdaSbS /v4SlHz7C7rnemc48nQOTA1+PsG4yXoNxz/WLLWZbDMWYfVazwSBA//dR5KMi9J74Nmj nfEk0CbgfytH7rexfRY/TCNLyB9Ud0LnCykIOPGCuGkgfR5lLQ/iUllufEiudD8gYqAF CdFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920144; x=1737524944; 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=D7R1Z0m4AmDiEDGrwLKGXNpW3g69MQHysWRaDTZFxP4=; b=MCZhR/jbeqdzL8U9eihs2oeGZ4KKMi9M/HSoG93Li4Vj9wUkKQ2+yALM0XPPrnlkzk 9uZfdYYhyG1iF7zxucP0qE9svmRdc/44fnAGKKx7f4sBt7pkP8zHxZTOVM6yXLe7O4JU 8UYCTe+7i3bGKd3tfZ/bcRq3cNZPvU+ZX3hqqPWN5CXqxeaN80Sq0XkwCdqALaPCigC1 KHwtOu4plX/qIKs+M38x+KviVx1QilyfrZ9guRlQ2KkNrHxgLsbL0UoSC4yNkoykDUnD fhJtwKuOdBJd3/P4xVrSfu1YnkSPFUiS4dUnjOOt5+LcCx24EfcTy7fjzZJXIN0sR3xa XLOA== X-Gm-Message-State: AOJu0Yz6/NNWkD7sIr8e2UunqtqxCAy701O6uw+IhDjdWl92S2RxvT5J 1bMazY8HrfN2B1quX2zEVSgeTm7ccs4PNBJfsJ4+oEYQmj4duZA+h+mXtr9q7BA= X-Gm-Gg: ASbGncup97qJDRKbnRQR6/+gIdPZjjgkI24CLQvx+AUsCFQrj2l/PLRxknZoaabfDur hjxs9hBHY1RP+f5cSV7FYK+j3YS1EBWK+qgDZLA6N15oY8NicJhdDliQOqyWdSIQzz95yyB1LlM SlrnDytPB333xL451J+ZX9AEIJ5AGQVfszfPfww99W2i3znS2aR367ZXf+v6FgudxIVj++yHpDl dfLZs5mqvN/kpKWkpkzhhD3P2eQYQiMcHs5sLmXbK+4XNDlQjLtOoD2Vs0= X-Google-Smtp-Source: AGHT+IF72SLq1My1g7dtb+6XlMl4Y+R7t/efbYmDZTCYwSHPEhtpwytSLWotlhp9pmcuYRJ5nSVCuw== X-Received: by 2002:a17:90a:dfcc:b0:2ee:ad18:b30d with SMTP id 98e67ed59e1d1-2f548e98f31mr36439035a91.6.1736920144269; Tue, 14 Jan 2025 21:49:04 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2f7085261dcsm1516002a91.0.2025.01.14.21.48.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:49:03 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:48:01 +0900 Subject: [PATCH v5 4/6] crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250115-elf-v5-4-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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: 756031A0004 X-Rspamd-Server: rspam12 X-Stat-Signature: te93ek9r3fcb6o8zauy8mjttz8c5kjrx X-Rspam-User: X-HE-Tag: 1736920145-10858 X-HE-Meta: U2FsdGVkX1/lUNFlKkvedSvmHFPrmMk0HD8GN05Q+WvsxnB0XnXFyRI0SyBFwDdmNCfJt/5Qp4W9/YFOqrxZEzuLXQsPAtoDOyJ9r8t7B+FyMwkNl8HPIrveRrDzPvzHTfk9DYbI2Eu/wlS8+g0z15PYcosEJPWrlviwVY2CVsAidb2Hry8pRPV3STb7Fz013IXA9N9HQ8/WQQfz6xi67L21/G9uFNzutx/DnCD3Vp54kaJ1AbgVgGGnfk8xfO05FJHd9+uyz5EBKOtM+SILmHRn0XVEtynFZYkqlIlmHKJ8XPJdvXxMoYYxMJ8xpuZkN6m2ikSB0mRAbZHJgzaovo/JbhIPYvDACraqbm6OMSMAvFhDvNUOUH2k5pgKeoBQg3RsELZgCAAOS3UtgVOsdCa8smUyqTzNZCcHAaQuFSOGiG+looJoEKZUU6LSAvSwRy+RBA8JrK5nuQPcIZJ2SNwNPYff/JizA/3gCkOH5HgITKwww0zup9HwN96wcVYk2pwxeHq50cR/AZClsixnHeaei1JotVZQ/QaHQ43bfMp7Dge2FsEUlRU3B8GUAV75AiqzKih6PnCrd8E+hgkzZCLxf3fX2mArbLI1GcOYFe1KQ1FS3Ifu5lDQ7CSzDDhbdv/2lQ2Redw2Jj4eJAWtM0NVvrOkiuAdwomOUnthNsMzJY5z5MR3qFNXyk9k6Hp2RLENatlthZqBjbWdYzOQKbIZkAYRwEQsPrax6W28HgM+sUFYGSDDAoyIAXMKVHV1LHMz5/a/TMaavb0OPX42Yv+qv/MOF/Xc789cwQH82Tbu4GyQY17ADmwtCorEF279fid5W38Rea6nlyppZSueMHdQ3GsYtVsdVb1djDtCyJi6GqXXlHmk5ZfILUDpTWtadi8tPXyGhv6wzCzE2uzN71XNMBzW9sjWL1Hyble5eRUgQgbqqZP+iqarSpN0+UzpNZJC0uZLa7r88va3ZqB Mn7MkdJg mnZDa5lKfBg1lTj9BMuLUrc0SLnkCYz5k9LhHQBGlYn88PgV86xuM7iOjidZMOMqLLQ6gqGl/HAaiZX1UoFBhP1ws/DWLf3O9chJwjZP7dNh6VL9Pi5LQA69UqOT6CyDfadhS6xblHsqeCnXD7NunY7lQVO6Pm0YvQEOmIBTiyMQMzONq0Srw4abdzxDKbkpMTUh6vcRdoVekxVlh4wFMjz1mHQQrzC54UBMu3U4fIFJ7aQGUapaS0WC4TEw9A5srBo11YOJMoYxzSL9Vrvshy1UzLn6NBbAjgFElv+jcIPd4IrbcI57tbuAeJRe69lvt2aJiLRFA+G/OfiDvNyJ9mRNJ+Fhz6UuBAqm1APenxV2fsTX4eAz0p0KnRYUe9fmPR8eG40IHVX8zPeeTha0V1Ocnz9K4a+hY0Ifs4j305Cxdbz0= 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 Reviewed-by: Dave Martin --- 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 Wed Jan 15 05:48:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939853 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 CDE49C02183 for ; Wed, 15 Jan 2025 05:49:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 654E9280007; Wed, 15 Jan 2025 00:49:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 60522280005; Wed, 15 Jan 2025 00:49:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A602280007; Wed, 15 Jan 2025 00:49:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2B76B280005 for ; Wed, 15 Jan 2025 00:49:14 -0500 (EST) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DCBADA0614 for ; Wed, 15 Jan 2025 05:49:13 +0000 (UTC) X-FDA: 83008608186.23.D2E1992 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf15.hostedemail.com (Postfix) with ESMTP id 07BE1A0009 for ; Wed, 15 Jan 2025 05:49:11 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=qK+TNaAg; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920152; a=rsa-sha256; cv=none; b=fBiN4Q0wRM9Uf80I12xzMgJCoO9m09Lm4BRdxcFlUQehH8WHE45ymFVzTShE2uu36GGjpc ZQqoa1mNvuehpSKDLD0CJej4bxnjEQHXZFi3VmJdq0fhAbtpwp9odDUeoEQIlt/zdNr+/S U2ZMQghV0eRhSFTM37RkGEuUQs7V6vU= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=qK+TNaAg; dmarc=none; spf=pass (imf15.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.173 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=1736920152; 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=gqxfn2Bh8pqSgpWAhYuCaH8o2BUeXgVOaRACTrcmMAY=; b=YuR6liLqWUBNm7E9G2W3E3IjmvjHRenzb6SX0VsrA/dXm7Dg1Gx6nocLC4UBbJY2IgWYS1 xLMyAGtSscTNKevGY77VNzBYOSy6pSrwxgYnsl/Sx+TQPIzeWTsPNQa0vjAYELj/ktihOs mmWhi4/ImVIRSa7+lchdeUPkxPNJtBM= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-21670dce0a7so137017485ad.1 for ; Tue, 14 Jan 2025 21:49:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920151; x=1737524951; 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=gqxfn2Bh8pqSgpWAhYuCaH8o2BUeXgVOaRACTrcmMAY=; b=qK+TNaAgHzK9YgIWx9vlu1UIBBHNvnsSwM4x02ZyOMBwnh/lZ7A+tJfcnCtUYZYsyl 7z381zOqw8i6OvaDPNP0BsjXWnPGpMFIJmuRv/LoUgN0vXFlZ4fqXo6g0IiJVipx7979 HvVATZal26HLNaXn2WNa4a12eeTmUiFpo0PlmvajY0Z9K074cId89Y2C7hVDkpb/DYVk jSeUKFTF1WI+TReE1/5jlgwEiDuRUJcEFTaADLZF2eLW/B4XLKZhyjdeN+dNvmvwN2Jc JtCzByDHdyCe71aDg+1plEPnrHnCKXg2vnOcgpqhqNdfBfD51eSZ7Z7n0r6OmPmkbABy MMpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920151; x=1737524951; 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=gqxfn2Bh8pqSgpWAhYuCaH8o2BUeXgVOaRACTrcmMAY=; b=afBASwjOKSg3yK2m6Y/c/g3a54rfIGeReQsl38aLUQ9V4a7T/Yvo1lT1RaNjw4vLOD k+JrUAymYy0SohSvSNopcUsSbgz5t5axjAFw6utmEjfIepYHbtWSYDEgrWj3xpJjE9Il xoTldGw5tNDghaVS7g69Y0dutlfyrtd8qgS28WD0i+aIeVC2tFAnWgJ/X2C0MAHtjvIs p/aAI0eaKK/hM/ODG1eqbNCz8Ea4ySrh8nvsCYIt4YX/AHDgJ41hT2HwQp7cGpHJCIl9 yL9jFEs2EDcTA5jrEpNfFNcSMLX11r9OYx7zdAhMcb2KSegHTFZS88ylPfSRuYPrs233 1KkQ== X-Gm-Message-State: AOJu0Ywfhp1HmaT6PsAraPe/rs+6U6BRshd8ZzaZ5lkiQbc0TCwyp3TB Ig68iwFUgNbmcVuPk0mRsQrZAc7pthwv0ZLrNLnh0bIEcfdZb3cJT1Q3hvK/rhc= X-Gm-Gg: ASbGnctemNW+w3JWh0+W3fxDIAEIPxU4ycFclxMfDj72TDixa98ioBYNmgoOcfutO56 6NrSGQ0ox1qe/4WDWQ7humfjTDj8jfNlyRhmBfHsQQNAtpLK0hbc6GSrqyBIpZqkanz/rdtlQZH kraQo1A3PcMrG2NRH1uoOsBQFZp9W1Y88/PUiiBES5kDWMnoE0ffex+x8MTg5GNparvvsW532z3 CNoQQ+YUz9ofcqfkp4nWSEOe10WpwHxLbVtVmL1fjufku1+JFDIcYg2fSA= X-Google-Smtp-Source: AGHT+IGEE8Fm6k+e43goXL9XR3kNG0Qk7QvIMeGK5viYe25EF4qO0xqHuY9x+AzGWdKmvE+R7dTOXQ== X-Received: by 2002:a05:6a21:1087:b0:1e1:b727:181a with SMTP id adf61e73a8af0-1e88cfd3cb1mr47297876637.24.1736920150754; Tue, 14 Jan 2025 21:49:10 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72d406a94b8sm8295174b3a.167.2025.01.14.21.49.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:49:10 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:48:02 +0900 Subject: [PATCH v5 5/6] s390/crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250115-elf-v5-5-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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 , Heiko Carstens X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 07BE1A0009 X-Stat-Signature: bqtzwfu34hajcxsxebg8y8dyczba7yfa X-Rspam-User: X-HE-Tag: 1736920151-222924 X-HE-Meta: U2FsdGVkX18dTQCiFlwIW9rm8ckRUZb4oGizb000RDEF6zoB8/OA69wAQ61KV1oEmL376fUsw5/MKxxO2GjQTl9sECUKsk8YS4xRnDyVKkY8PX7T5C8dgjbE1BXgO9vCzU3QfDVlCBvRk7BE3FR7L1f4756ARUvmL4rnOv5nk81Yu6oQ+PkeI5LL/Aodrhw2XpMZTUVuQBHv05MNRqF8bX7EYzWxLkWlfyhrt36mB0ORvMffvMXKKz09nsormsS2Gs7x/qd65CCL39kZjfNcGj50gyq20CtiuaCCKctH+aOg7UcN6rP2N5Tl3TxUWliOZxxzUthIVYudrSvTNKWq755/aNOSK8Q9SwymRku0Et3gEn8+0bpkG5NNMeavqqERkJ1UBajG+xjL/5URwMV3iyZtXJsuudeKSgSalaPj3tfL2fQsi5bGlZFyef2QiWRw56BiCYBUfAPsKOJrTI7SemZYRc6D9sZ6HGm7dK1IN+WumO3v1kf8/+/ljifAgL1wqFFklAQ/BpNgY7XJvLSpfVtt9dESzVrrJ70cLRvnIAbhyOxtFzP33Xj0d/7WPap+tX2IZd6MdoAwIalmsarN5YBiRZQYN8u+tmdme93UH76nvSmTdLOsu0PfEV/Zes4ccZasrkiKl4hyI/mKL8IypTSTUaz91EHbgeTNVdcwwOQ1Ti1QT+vcNbZuBdTaxIbnxWkaITBkhpVsYDAGzVXh0y3/MlibY46+L0L6k58yQ3bqMSyhfS7cjs8CQN5rkd6w/IAiP9S09NH3evtcMRVMzNl8zX1xL/yIyU2kUTyabMnSt+aMBTM18YjCiGV6pxO1o7bKzDqlO+enhZ9TPIBXnfFD2R3CZUKvhWEsR4wFLKn9P9KcpTrHaP/gCYhElBXFnaoSd5Sx3RCPkehwp/V/ix5DIMVy3YYZeutGg2oEMWllkXP0UE3yq1ZBzR+g+X08BTZeAnyKLfHP782MRQy qriILtEZ dkNzieGtcu4saGQasB4MwWBgT7xfQP/VEvKM30Gc8yZ4wBcTuEmIo8nJsVv4TjHvmblMV/VLW2blUQPima1DRtCElnYg/cGlliGlzyAJysCNtdl8c/Azf95uljIzcywgR9b48733iV+McJfG18WyzgeWDWXy6lsHwnluzk+xKD4dx4caOGjI2GdvWc4Va1qgr4Bhzl4Imw2ReJSzLk9/SDhE7/vCCbFKHOOE+i400hUtnH1+lDmspoVyvnq1Sz8fl3bBW5BWuiXfeZwd12Tmx+lMyFaTUGLGaVbk8w6eyr7Kb76gTEeDQ46QlyFAarnvDbIX34kmdKfvdmAXo5LqUasvco4TwCKAFUg2cg5YGAQpoDY2d0zejvTp3O23Dr+1nKe01FaDQpfp06Udc5hW9GaeVL5lGMUc75rhE5GXlocEr4ZE= 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 Reviewed-by: Dave Martin --- 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..022f4f198edf 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 Wed Jan 15 05:48:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13939854 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 5C451C02185 for ; Wed, 15 Jan 2025 05:49:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BACDE280008; Wed, 15 Jan 2025 00:49:20 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B8341280005; Wed, 15 Jan 2025 00:49:20 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A4B13280008; Wed, 15 Jan 2025 00:49:20 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 84CF4280005 for ; Wed, 15 Jan 2025 00:49:20 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3881412078E for ; Wed, 15 Jan 2025 05:49:20 +0000 (UTC) X-FDA: 83008608480.29.51293AC Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf09.hostedemail.com (Postfix) with ESMTP id 52106140006 for ; Wed, 15 Jan 2025 05:49:18 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=uyeu75I4; spf=pass (imf09.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.174 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=1736920158; 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=88SqYtXaTV08jsATT/J9IavghVGb0T0MbX3fafAbdCI=; b=ZEokYqB9dZmenxzPZncBLoxVuwz+YH3SEGXEMflASV3aAgjtXLEtGdJzybbdo6vSlxPdRr y6hv2siaSVh1+Cltyt2v1J2Pwp7SC4JPkOMONuBGhY55xfKzi5L1+f/bMV/L9jxfEulLM3 +uh7/oOL3xmFndRUiRvyMHo6AL+1JP4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736920158; a=rsa-sha256; cv=none; b=5Aua2AsGTDsK2OMzvK1tece1YAQMtzG9cyM/5D08k3T1NqjCr10aTPbtnIdASeyz6AkTrA B+rh6roP9x2237EM6qD9tsCNbq1Ql1ifi4jKQQYHw3igIK2cxKHQD1dA+1bU+xVpNiK5Af AqDJbmpI06SR6lH5oYdbnFYdxcDFWvA= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=uyeu75I4; spf=pass (imf09.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.174 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-21636268e43so148572905ad.2 for ; Tue, 14 Jan 2025 21:49:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736920157; x=1737524957; 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=88SqYtXaTV08jsATT/J9IavghVGb0T0MbX3fafAbdCI=; b=uyeu75I413IK7vXfq8+IB0rx+Yc5UqCBcGZ7O0Og+WjCddvvUpv/9ijSGPBTeIr6vi /oMi7KMrApznY4xQGSXY+pBJ481hl1udrZ/k3HCr7QAMddG8plBQVLbqwEX1nKPMgKgo EGldfG6nU7bSJAOcIWtepfL46qyGxDSRMVy1CV97PaGNuFinZC8hJ76Z6v67jfsJw6iW +PkcsFBa7pcpi18NcmkBfQoM+esxsyXBa/CCBxt0gh33Ho+2I+2/CAgfrYtZyAvh5uDR XLCCoQqFxvMPvCZHegRz5ZMJjMwhmXi3KZ64KGnawbp8/EhtHvJ7SKhjDaDWL4yRxhLf 5N2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736920157; x=1737524957; 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=88SqYtXaTV08jsATT/J9IavghVGb0T0MbX3fafAbdCI=; b=aTCBotqaYl1r2fxaeUdj6jGsJXSU7N2db/aLk/hzK9puwKjgb4NXniKUbhODn8QNAz RVnuuwkJjHpcKn8HXFgqZyHDvaErLevuBmvDUf11i1bGzjnog/k1FBWiDoQxZqzWvQb0 20M5U4pAnWGKXn6rj4NFbny7qSz4si8plw7koj7eeZk+EeS9MmR9sITkLLq8xZX/a79j HsGbd+dNGcINxGvDDuAy9d6bzVzF0dKPdNb9E9786D0hzbYdgBfDCtk1Toc45UNSkHxy O+lRcJ9BDBAViBuX2B2UQ0r6zmoZ7XubPdbDVOrOWQuLTd3AnpLrsr7sudLb0VgVXyXF oJ7A== X-Gm-Message-State: AOJu0YzGNR+eEmRqFfURi8J5itPjNBs28RRJ4YSoxvnX03N2zAT+Sa9o tIUqC8vRFwtIi2Opsd1GjWwQwRqpDMroo81YHtnlUC17S9lOlGri9DtLyLTxmms= X-Gm-Gg: ASbGnctLfaEdH8tBtFr1AeSXoKt4GZHyjisUOIw1127pu023KznNwk0ezEbfQfQ9b++ AGr8MFlWrVpnZZ64h2kRBwuh7qwkD/sAYjic9NEl5zqgXLzX7g200hxJaYcXbwixItg3EUzh+W9 So0OS07ZBbuMrlItBhWHz4w/1jkkZYGQaMhjXUTNavIk/96nxFt16D5Jwyo0u3//eGOagC7+wIf j6/u68fzpOcVI0ANQ8Ixy2DeqZXEnZn8hqCJaWeI7oFILrujtMA0bM5m9Y= X-Google-Smtp-Source: AGHT+IE7CP/5jGWZAR0IrIqQIqvoQb7g5wi9hxFsU0CFVXu0dR68h2h3F8IAezzLwnE0Rlv/Ybh8/Q== X-Received: by 2002:a17:902:d48a:b0:216:4064:53ad with SMTP id d9443c01a7336-21a840109d2mr433462125ad.48.1736920157113; Tue, 14 Jan 2025 21:49:17 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f22e591sm76124125ad.180.2025.01.14.21.49.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 21:49:16 -0800 (PST) From: Akihiko Odaki Date: Wed, 15 Jan 2025 14:48:03 +0900 Subject: [PATCH v5 6/6] crash: Remove KEXEC_CORE_NOTE_NAME MIME-Version: 1.0 Message-Id: <20250115-elf-v5-6-0f9e55bbb2fc@daynix.com> References: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> In-Reply-To: <20250115-elf-v5-0-0f9e55bbb2fc@daynix.com> To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young , LEROY Christophe 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: 52106140006 X-Rspam-User: X-Rspamd-Server: rspam07 X-Stat-Signature: wwx85jkz5wtff839cr3r19cp9z11rtxu X-HE-Tag: 1736920158-928270 X-HE-Meta: U2FsdGVkX1+FMxRVE1ksEg4XFjqBYbB2GtVH82D0/ZwDW2uocLCAamoqYp/deUPuqQNfWecnH7k5ljDo+7z9wGail1N3eKr5EViGnhWbtJ2oF0Cq0IzMZfdF+hcd/TURN1cBq1h/QsYgLH6N4PbRMvgMHo+PYE79DvQ6MvgOAeP8NAGtPqAeYxdVJ9AiJcozb+0XutRpZCT2FliFKyHdxdDEDmeMbkeg82N+Rab6x3fpMeUhCBoOXLXrP4L2Pvw6s/+pAx4DrNsapBQ/3TqU8oqs0h2fNoq4n3a/bnZTE31dvd9kW05uZYeyaVan64CTdI9gR+tBZepSdvlZarAS+bxT3lvvinQTwogml76Venj9NXKTmRKfae/UcUNmyysWsQNMbbJmidURZiRtsStI7G1LLVJBg6kUDlr/il5IwjJgQnp/Ugoq30s/ZYS492jKAMXO5AI0T+z5J0K3W7XvcD90e8EYI59W48x7t4thcbK5S9339ILPmku6Pk3Xb0p3wT8xEOk/WcGEfQAUWx18/wrQtUFfslHY2or6Wlr5EPiL84NodYUlXgt9yO8Qj2daGcte4COve9bs4pTUIeLx/VLDffqTT45fzHxB8Q7GFoBalAtAjLneEjn/mgCs1Edek5tUjVJNccS6CUMN0zTWHJGnyH+wCfAAFBce/YdKoDlIXbNX+9rqmBpg9RzDq9gISPflJApdpRSel9z82VThf7AHiYLMf9VHT0uyejFNTPkUyD61hkTm70HR8PqmCEyUQMK5ImhMc2zo61eq4Bb1UMNRMwkVoD13WwZiZQDPIF6HfN5MnGh3rn/mpmvVSohOzsd+/8K3r7CWKvD0oHTzY1oY5NjDH8D9KQPacCdhbBiHaJebNNWgm6jpy9n5mdYL0/XyrAk1fWZvIiwuI+yCu58/vK1n7IpirtjzkvvnTOYiNFtrRZt8ZJT5rNBnPAdVLYBNMTUyHAvcFjkPQk1 VrsC13Nm +W2BGjw2TR6afYXaOqWbKbi29By6b6m+Esez1mdVt6J+M1Ig0Gg8jeFM5nFi4L8ypS2mJwMvTMRnFQH9vWtx2wdgkw4/Kh/8AWVHt25b/v2CFBsvbDN1dN3hchuIXmkkMJFAi8wUUZ0hCC1xjCwAZab3KFBE6brGL8mnKNO8yRdoy/ulh6Xz66UJIEuDMHbTrE83W5bvbajs11NyEnNG7hWRErIuDXtKlZogEpgx0nbPb3mQoPyB+82L7V8V884wlwka04S9dQ1O7s3QBk0URDBjp4nctNEB3lkuxm7+z65RSaWdFxSvqHy0xkCly8SHQkciz18rBWsbcT0AvQ/Kq6Z7ibxCj7dLXENsb9byBFQMvoeAhu7TW5c0r1lfJ55DpcF6lGRXzJ1A5FqLL0EeHRM1vvqkU5VzRAvKw4BywyDo+NFdzaPjdbmmO1sp2bUpVWtlbFR3QsH5OHUTNd5R/ax2p+w== 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 Reviewed-by: Dave Martin --- 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)