From patchwork Sat Jan 11 05:48:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935788 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 97D8CE7719C for ; Sat, 11 Jan 2025 05:49:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FEA26B009C; Sat, 11 Jan 2025 00:49:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AFD46B009E; Sat, 11 Jan 2025 00:49:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 076846B00A0; Sat, 11 Jan 2025 00:49:04 -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 DE74E6B009C for ; Sat, 11 Jan 2025 00:49:04 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6D2AB44DF3 for ; Sat, 11 Jan 2025 05:49:04 +0000 (UTC) X-FDA: 82994092608.16.8E78150 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by imf18.hostedemail.com (Postfix) with ESMTP id 828261C0008 for ; Sat, 11 Jan 2025 05:49:02 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=3dZ+ZrWq; dmarc=none; spf=pass (imf18.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574542; a=rsa-sha256; cv=none; b=PmdGBaNAoLmoa2b0vBjaxCeNPUu/xxpjLLXJLBoX/AeRZ3mgwZqheMHRC5vaftkV44wzgG 7zZZp5aYJDfjP0GS3QjVrueCjYP3cfFOFvy80jn9EqKzWmDe0fCIDGPDKck1hB/pu4oX3M TJtL/qHzggphfGJl5qVOd92dwFuInzs= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=3dZ+ZrWq; dmarc=none; spf=pass (imf18.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.177 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=1736574542; 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=6Yas4DLEouY1y6k0rXhq9RraLUbBQcVznaxmx1GYAr+BA8YfV02thJ5n6ijMK24eelwORb CN6VAXbcFxcxKTVO43cNtAYcOb7nGtP4sdTioqSEhLAE5syNHcYezZ67oA2nx7SI/S3Bo5 MLpFMgDESYJEyie8JlDdqs9pfettc4I= Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-21619108a6bso46614635ad.3 for ; Fri, 10 Jan 2025 21:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574541; x=1737179341; 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=3dZ+ZrWqyjd/7A8s0vktCO/NFIU+N30WG2BlJ43n3yzpFEImyGN06Ig+wrDx7YNkTu 2CpVJ8nS2lcmlAWwUFJy8f5vL9aJ3FOUhanUNQP9LAtf1qquEpJHbzLOLED1uGycIiiE Rec2/x32l+opO7jjjJg+ptFgBQ0yri2LtxtstMV8b5IW2yu7GLqHJpbRznQ/iUpV3lwz lnCI0piQFUakJlHqRnSSnt2UJNd3wZjVlfDEQfyb8yBUDDA3md+fVeG/8XVaSrGFaXDD 84Igq+r8WTnJtwlQfHDTCRy0XyWPKDLyUIOPH/jhZSyfviOt7iEMdykVhOIhwRn9qceS tekw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574541; x=1737179341; 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=PYMYY3Ju413rJQezUGn5P+7N7mgOjPYM8iTmdr1dfHtDesHB1FWL7DV6VEeuuB+9eh ZV5YoBZNyCYRJ4hS68DmvPbTgu1JlHPcu5OKjUWQOCGZZkpfFIWr4inG5qQTUd/iKs3Y hkQ3Mjv0iu2p3f5IJE8UbyWNVucEfmfxyKKKuxBsK2YUym8WTUfzroOpmG+8OGO/ea9o 1eut0i1wcbNPGZHvuIVULLY55sgXYPtGm24rgsbbdHB0HoxfjIE6Gw9fhG4HLPYj8cbx 1+y1aYaUfFOwllSlf53ey/Awkklx5r2GWOkOHCskfXBlGPhZWyapLWPmCp1/izkIiKIG cwUA== X-Gm-Message-State: AOJu0Yy5wExRs0vTvbzvKMSpQ1ts+Ja8nTuk0nBlc5vRn1XA0M59mMZD 7nKeJ7L3MuzPjvC3YwQ8pilK9SJfjTR3Dv2twXwriRyGkOfvzr21c03lAvxM0uw= X-Gm-Gg: ASbGncsvftpSW/kf8uSQa6RsmFDy/hd8WR/rf/0tz24kXMKMym99lRPGka36jAP7f/C ifUfhcZC1Acx+beq+x2eEDMeAPiwOFXUpSGLIC3YDNpIki7Y5pbZzWAgXE8hON3epPesFSQSQhE Fp4Unq9gjxgdYTdlggC8NQSjNWvt+089Cla+TbEayheGtJIVygLKsZ/HzEFj2TybfFJMCOitcKb gcVJYpxj2tnlfMleNaTbDkHjS/b4NNQK8N5P8a/vHQMTClbZawIqkphKYw= X-Google-Smtp-Source: AGHT+IHcpmdtla8m811pOhOWUKKg3mt5D2YgMgKQAi/FtxQToiO3ZEw9yK9yhc6mlxAM0lTabpo8Kw== X-Received: by 2002:a05:6a00:cd6:b0:729:9f1:69bc with SMTP id d2e1a72fcca58-72d21f45b2fmr19552247b3a.12.1736574541182; Fri, 10 Jan 2025 21:49:01 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d2e1a72fcca58-72d405489e2sm2380384b3a.32.2025.01.10.21.48.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:00 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:44 +0900 Subject: [PATCH v4 1/6] elf: Define note name macros MIME-Version: 1.0 Message-Id: <20250111-elf-v4-1-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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: 828261C0008 X-Stat-Signature: 5t5uyss9fj1ut1zw7u1ntcjm1aacbai8 X-HE-Tag: 1736574542-538444 X-HE-Meta: U2FsdGVkX1//zY62CspDYc9nE7b4HKUIGpQZNk7azzRw1xzuG5n0oXeuh3jdao8ZxqhRNSuKIC3OuGjtnXUgEdn6dOnOvroQgT6B7+K06tXBykPfByMKD0f7DGVN48SO697b0IcNJvDwasXuI1NKAfhVJTJa2TPB/YBy1+KJXH10N/1zXrgoqXtGUnC8BQqz2fXdZU5gNHxeNB3GdZGSRDmHDEhmBBSHAmpYoM3nQsnQXedLpde+02xafi6C3WhLBklhyOoYnSbZQsQf894mBl5zOZdT8O4z2SwVvFyoZ7JvanqjapNEpPfgH2Cce1sC5mxicpNp7nm6JJw9ZG6f7Lh/nHPo21SEz6aQwiXxniNT8yT9+KQMrfq5Vmn/iYhFRVc3mox+ApDEh/+Nfkln2sEp5OLRpzibMD6r1meH3ePtRD9/EVTiui0rhc3YVvrFTqSfZYH+1Hxdg6DID7UOX7XiLjAgRT2nqbc9Xz/KtG3tZnqV4WttIo4p6KFWRSlvzkPqsj/Nmoc2Tn7MeF/cDKOJHvld4hmbvoDtI9dbUpJjZnAjHygalO+fTXyYBmwIf/ViiY42s+BkxukvKkvSynErMg2S3awvLsgcwpgTVtq1QgRHKuayzlvsYjo8nKvUH2xwFUvCQGrGaacNpa72iI83geMq3NASnIJq+XcnTpWZx2//tNaFRIOTPtiZ5YknNCo+sdJLXOQRXsAnSjIIqBKLWlqXWUS4QxThFQNrU4JDkAcaJ4Y6hX4UzbirTaR4mYhoJsx2VCfRFkytlIsOF8674vSwGx0sCMYPbgJ+6QgTLZKWiZZA2R68GIJDOi4nQvuwZfN/YYDWYYmXUZ+DO4c7zzx6MTXvCPZzVU2LgkjCmsAJVKglz5MRYQvjo53AzMwrHGMpzWuF6ol2thRPeTo5jfDjYpcDQ7HUPc7qjNYfKNc/X5mqwRf/tvjrGgWl3klQ4YraVuavxfHv1xX fJSDYqdz lgd1Vo/QNHEsDxhurH2aB6lqaotN5lJ1v8UWSNWFg/3ljaVH8ynCsgaD4Z3a0Ptcqzoe5axQ0fdC9EZ+amkfQZlMFuSxc8XcT7BY5tJi2jWzA6QHa9xLPVXcOnZPfsp0z1oC6Y/35yDBwUPMtlrpQaW5fBa/3CH8SE9gMETknIysqtHj2dNo34mSEa9TL7SOSff57PpauqFP/H2kust/X2s6kxroxsZpivqPSaHZzeCpvAtERSHrMlmkukRwF2ltQgr7CMImSRXGtMVg59L+osSzucFvMdGqJyE04Oy8L8OVH3j5XdURzpMaY3H6eT1CAcQKeqFJ2FSctnJJr029aP+n6rCLeLdzVv9W75d0+HHSFKd0= 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 Sat Jan 11 05:48:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935789 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 94CDFE7719A for ; Sat, 11 Jan 2025 05:49:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29AB16B0085; Sat, 11 Jan 2025 00:49:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 24AB06B00A0; Sat, 11 Jan 2025 00:49:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EBA26B00A1; Sat, 11 Jan 2025 00:49:12 -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 E56896B0085 for ; Sat, 11 Jan 2025 00:49:11 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id ACA3DA10D0 for ; Sat, 11 Jan 2025 05:49:11 +0000 (UTC) X-FDA: 82994092902.30.3ED09C1 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf06.hostedemail.com (Postfix) with ESMTP id C031518000A for ; Sat, 11 Jan 2025 05:49:09 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=ifRf8JjC; spf=pass (imf06.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.172 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=1736574549; 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=zCOWptfKM/cpRgAeLleAjbApjvhqUBFnInP6Qiz9ik2L75M5WzSlIk98/G/QLZqZrE5rZ6 tXjs5AM2DXiVIAGtAnhKcwX0f5HfXSbp5IvxXBFaiutHBAKwWcKIV25BEHxBmcv+gj82N6 w2lIU6Zc/WWXFwTM2H6fE8LXrMYAo+4= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574549; a=rsa-sha256; cv=none; b=52Fgrkv+ILsgkQcyAMP580l1PCmyu4IBkquG5rwxQFVTfhcbrZP+9IiyyHWvex0kwHcsb3 /DAA5xX8QWGcQa168m4wnOyulxNsWqg1I/fWhVOT57lKmliNY0W+USB6i4f0DRir7GCjZG iMvG0GowJLFdGQYaZTs/MAk6Yxym3YY= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=ifRf8JjC; spf=pass (imf06.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21669fd5c7cso47190375ad.3 for ; Fri, 10 Jan 2025 21:49:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574548; x=1737179348; 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=ifRf8JjC3kzgoQoadoSKMNtHTBL9npoSiMN/uT8q92tadHqBc3BAPoZHo/Ihb/hC/J MdFn253TH3XX7SBRt7OHn4vj6EX46xuy484HVMlJ0620BSGMEu3Q3tvQYmwulQpGbs2M XhQoabP86WjMt1VwA1tDXQfZkDDvm3xrKInI4ZeE2FrFLTy+nJBq3kqSgjRKy6HOj89N To7X8xvHLrS2dyoOOO2GkvS1uhevb9ezKQ6Gtxl0FpnjNng7LHBSsaEVPLXyYAO0Jv6a QWUISe+NMPf8LgiGKnlbzynAVNaWW3bg2RJiK0/9Yxaozh6xxWY7LDNjTdLKOV/6S+B2 H+1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574548; x=1737179348; 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=Yq+O0VRAbUDHw0F+SYBsjYIFVTx1u070iFpRj5Uc/VklTS0i/Cxaxpm8o5QPZ0IiL8 swuPMdD8WRvfLwK+9T5kUkC4Gs5SrVQF2cGGYwTwqhZtkMS/YWAQ0WFHkCDUffloculm WyOn322nMvYqd+64ufuVgIX3RPIb/g8bMQD3GLW2w6lq3pNEQG4Q9czRdB81R96xlzg1 diVWYaF2ai3+552tWU+srJv9Y3yhfFD9xFsyEQpP7Q/jjIF+iuTJzI25ZtnJoQxnOPjC U0Axnrz+r+G4Qlcan0FGu/KOPz3XmDngjtHu+d/i2KjKaSxSzc0tvxbC505VE3TgjxW2 qvLg== X-Gm-Message-State: AOJu0Yw07O6GSug0MSDcWDaiRj7+bZNQY7fv8ygnIwLrmJnnZ9dXGhpF 5KXPzOSeclYQws88t0rgIwq76TZ/VkRaTDvV4TBStJvboZxmxUCFizlJWun0Nu4= X-Gm-Gg: ASbGncs3QsJOUDNzR9lKGdVasNm/sjqwUm6T+0tWpFWXssL1aX3E0qFR/7HCbDKzNp9 FIlxplWS3cwNTPiuZdTDCJKtj8f1THHk4eV+9O4Kqa0Y5b2bJ+nat19vuYC6cqNXeebThuQySSK qMKMgczKOXss9BHP5zLt9Mg8WunPSjeZ1A/y15+KRTnePISpEqMgESfvTy5b6Y0E6lXLwbNsXMC 2T6TL8p4ZrXFQz9kYE9Y3NIJH71OX8RCnE9MNTRFmjTFuCSm6orC2H4f0A= X-Google-Smtp-Source: AGHT+IHn65rwbd4gKdhst/GRdULarDOSLx1cuK1RthFbVp937QpJuhXkw/qwAunKCMjt+dsCYzpTGw== X-Received: by 2002:a17:902:ecc7:b0:216:760c:3879 with SMTP id d9443c01a7336-21a83fdf2d0mr185892965ad.46.1736574548582; Fri, 10 Jan 2025 21:49:08 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f22d293sm21144365ad.185.2025.01.10.21.49.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:08 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:45 +0900 Subject: [PATCH v4 2/6] binfmt_elf: Use note name macros MIME-Version: 1.0 Message-Id: <20250111-elf-v4-2-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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-Server: rspam10 X-Rspamd-Queue-Id: C031518000A X-Stat-Signature: f9am6eri6toqajzzwo1fomyxzzayf3bj X-Rspam-User: X-HE-Tag: 1736574549-921961 X-HE-Meta: U2FsdGVkX19VGXH6QVb5iQRhX81x6hTWPiqK3NEGbQYaBoK9FisZ5URBo6xx3kpLdNKNVx1YMi9MYgstmoqlr1I14GFw8CWzjVcVjJncl3SZzNXEC75sTPf4Ai/9BB1aeIi3sfOkHCpyXBsabIdqhtkISLNGW9Tkjjn3VxGFP5RvCiNicvHzHSXGvVwgxDuZQg6QIZR+TEIrb60dmXspvBbKIwYFiTX3/CTGY6STOC10UDM2HgZB6eVkV02Z2zlZFLGjnTkPEsqPDmSrV4SC/EbuSFklIq5EcJInzjCz+zYS5l7O9LEBCBrt9eDEvwXGDyhqf8OU4KLxw4yt3isHIq7rumy5Yl0DEUF7FFc66bwHhyEk7QxDG8AdL6MOM/PXHJr4J3v/gpm1goqeyAmv+o7xl1VnVZnHbcOszcR7JNhB1qZcm38dz5mx6KMO3ZBFcNgxZJPjMIw7r61gWZRIiJ59icsyDVWPtTyDMlo8Eb1ZpfGWBc9qr8An/T+74+RPc5hTg0SKtsDFBg2KXZy+NHbziX1dWnSi779VtbFvF5ZSRQv//1GGFsMTkIcgIAi8nC0EH94F5Twk6sqsshCO7Ku//VRsciw4SgkIcHhqxiH8vQ51nEYGekgXP27eAIHVUse7KWBWX6qRWexyusc7ZIa1hKbtzd2zuPqqXVVrFnxxYY2PGQx20Z5iEA2uoYDWSrBQmbsF6QUFLYO5g+vH80ACMbiamXczTIDPovKLf6XEKzTaYGGKjmDBpOJeuulrh+MHQAI2/5zVXBlR4yTDRQQhdkXfiWcKAnP1Z8w/IRK8eRc3Xrpr0YT/2ZRpzoEXWIhtUnhOvzLYiyaK8byydBfYBow4Q1t4zt8zyZjofCR1lkBiMAF8RRbsrjyyKwRH0O5dCUOdvBIVDZhlWDSNtTv/2xXV93Ch6+CwPrloPZ0ks8b7sM1PHtU60riE98sQ3dsl9fc+qJQzO5YqfkY +Jnh9IkZ QlirrujT9VfEGCAO9XnmudCQLuozf4sJO/9hEriQEkpbO6CYkuHRff2BemJbqSxFluTH+QcvrQsqh+65tsBdIvLMvm7OySwHThtD1gyCT+ySTWQ95MB3YGQTi0A+hHE9DH5IlT6UzZ/3LqYmvYwt1PpjFF/JCwHhH+o3jBHvq6mtGMSvhWQn29DEf0j7JmgYnjRn27HZjf4dsxYVVR/yPZdbCeV7hje/NDOCcWd8U0I6UeEdhy70fcHnJPk/aVG+ivFM6nEIOj3Q2KyREACjYCZdEC00ulW37st7QiWowrYH/04I629IQ7w7Il5QO7Zn/O+9kSruZpnt5NuHT0eSKAaxxIubQF+nKLLITMtWbFyWkeY6C1g4QqETOETSnuKLEFXsdH6HhnbV4O17mA61yNzzUydBrhMeVg0Aw 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 Sat Jan 11 05:48:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935790 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 3A007E7719A for ; Sat, 11 Jan 2025 05:49:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BC33F8D0002; Sat, 11 Jan 2025 00:49:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B73B78D0001; Sat, 11 Jan 2025 00:49:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A3A448D0002; Sat, 11 Jan 2025 00:49:19 -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 827FD8D0001 for ; Sat, 11 Jan 2025 00:49:19 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3A7FE16110D for ; Sat, 11 Jan 2025 05:49:19 +0000 (UTC) X-FDA: 82994093238.21.6D1AD88 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by imf08.hostedemail.com (Postfix) with ESMTP id 49487160005 for ; Sat, 11 Jan 2025 05:49:17 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=QLXqq4fe; spf=pass (imf08.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.169 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=1736574557; 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=A++05IwU2hH06oTSs8Z3YzeXieKYkS+yTHs+0pIja8opuDsloGaC6aBY2rvTN0wbp/zITR LZLWS5vvBENtEAYFwEaSyhowPHhLcZMbVlbCmVA2dInMuec98XsUynBEMlvCK7vA5bggCB 24WcX3Bo+suH6KjcM6o5Mc/vz/V1KyU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=QLXqq4fe; spf=pass (imf08.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.169 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574557; a=rsa-sha256; cv=none; b=CibhsTMLcwKjvpKjBuku8zabPqgxz13eCrmrUMIxtRhjZg2J0UuSWZxsla/AJX3TxgPeq4 4MY6/UCElNeUm8tHKkT+iGCBzrAtvw12DfxlqNEtkHLcwU+mJSyA3MWFYboD82ggV+nYyu mN22/tJoD/xTCo1+K3BfVmo7InwCuX4= Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-21631789fcdso49859165ad.1 for ; Fri, 10 Jan 2025 21:49:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574556; x=1737179356; 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=QLXqq4feUnLEBxR9h8HZaA8m6NtLDPZ3WMhsFqwW/HNqZrS/pogkFz8bdyqFFykjn8 xQ9KJNyRAen3JUkgd3OVbGzuAY43jl+Gc7zKZsHBfw904+V00mpCaYpvFlA/2I9eQDrC 4DAx4w01tUuuLt/YSumhVidAWAYZa+ttoNaHfYt3JeMm59MTuuzhM3S/v3/7CdF6Vx78 cU4s4KFMSY25oh7DFF30ovJOUlzCGiDbj50ITpVxGe2hdiK5Ux9MqhlHvRUjoo5CcKRj fkQA4OGmkc/5t4upIDLKhtEZ+BxIngQG/mhA4bnuckcKYF7h8O1XkedwSoHxlA8sG8eS Vn8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574556; x=1737179356; 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=nKcep88REIn1NFrPQViPcQ8nerHM9VkCxJK8FUEyd9NKkKWw6Lz2UcTOjOGSf3RArn n/hRcQtgjOQGEwmcfC0cAVM4IVqyZKRcG5iOpktVs6je8GqXlyWwR6q8pGATSotXeL16 8teobPQ1b50uJq2FaJ2C4qHhFrnW16tKAUQqFEihFm60HzD/NIrVm14bWY3waHDgLjC0 KEfOvXxK6IbWai2WQAlX5VhhKblHLpKunkEOigC1IKIJjo0d1t1nLP742XRAP77l3hsT 1GV/n0zsbtm/xdpDknHEdVXrK25u/JbifCOYfxW8EkfTPhf5QtZLOYbCboga37WJ18g3 /bwQ== X-Gm-Message-State: AOJu0YwYZj/4I2Lz42Loj0BNeZMuQFNOewGwHBRzS8KyE9QRubjsAuaN HAb22Eyf+a3JuG5Hl2Nuxxiz1A9qv/72fzlqj7N/CxooxLAqw8WfwN+PbuJNbIw= X-Gm-Gg: ASbGncsYljq69fvXcksG7jGatmtVUemNZYMv8Qy2I/zzZax2thbcKFFJs554hz5faXA vASGAAXNMD5BMv3osMpU80r24Z6YtFH7jDkE9T8+8nX/Q8sfonVbPfYB2pzPGyGkLZ3pXJRut33 0AKRvhjM8q2MAw5/3WjrN47HNQsXw0vOPxIa28OjJa2dVcUfh0vOtb6KzbveKZdRbi6Uo9COaCk tOaSn8grqrEU5yE4Y3eVzE0fBl2rKtZDktJWQliSZrPFcV22cH7keWiJ1E= X-Google-Smtp-Source: AGHT+IGYDl29OCGY4z1owZDP0XWbhTx09xSMaaJapB97QNqOQhHfEZ2TmztXqViOu57Hf/bAEePhOw== X-Received: by 2002:a05:6a20:841d:b0:1d8:d5c0:ad74 with SMTP id adf61e73a8af0-1e89c89888cmr15576349637.1.1736574556053; Fri, 10 Jan 2025 21:49:16 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id 41be03b00d2f7-a31de806694sm3683573a12.69.2025.01.10.21.49.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:15 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:46 +0900 Subject: [PATCH v4 3/6] powerpc: Use note name macros MIME-Version: 1.0 Message-Id: <20250111-elf-v4-3-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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: 49487160005 X-Stat-Signature: uafgfyzeyohei7511i3sqb3ow49pp1st X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1736574557-402343 X-HE-Meta: U2FsdGVkX1/4ePZ9AZV/5fiJQNO0e2MgEAvKNlJOVOkUvZ99AJznFDha0H2GPL0xcQ0lfICMMLnwlthfganP4AzwuCOHRjMQ46ioZKALid3bDNsdjcYeksKEO0trwzDNiQ1fkUFOMSLFnj1sokWjF3kctb83juIssiESsjGjeg1jfHoAmzJ2e6uRUxUDep9FXASqcoquJYBCsC46Ql+lvXFw4hUcejFEJVsFGCJvMzHibwwJqi/7X+YG9Hx7dFPExziyC1MU3LNiLQSCj9LrkVpTGByj7OimBFE8RT7ENXOIal4PvkQEg0ZjK2r6A0rPBrgJayz0EFZHwo24FqVMmHUN39lV7wRK0b9Uzhr3XboxZVlsff+eT9gAquOgKzvG/ZqBF+8WnFGFu+2ECXo209gnv4ATvkBX13bZmd/ffqHV5BlY7r3goYwxgIKqW10zZSpNe47wQRhYD0NdIHOEOm0l286eWsY/4ABnCSQz3dXaPv6qLjDklcbC3hUCeVBFdOatxUS7aMdNJ2FVgYq8J9xGK550CqiIypz+XlpH2f79ke59Pz5LYo9HWboySPEWo5CKuw6iLJINztTrOEWCkq2rWSOZSYbXGcXDre1vFF8+DMKzqqF80EgCjSfdR5zi2lPeyUCA2lf2h456h9zp1nZkfaJZGt+hEIjBY+sy/C8DwAVoBO5QhyL2rZl9GIpqLzVGScTUSCwPAHlkU7QVeYbkBnbaDbOxyzc/vuVDUuV95udRV6BjPFwh2351sGz9SwHhHINXGegZqWuFg9/6etzH8uChRzv1baD/IR4EIdLNygsMF26wj04FWJJQ+ZH5eeMCcreIKAaEQ/E4itKluKhWJJGaR1PlJBVsEux6pwO/JzShTVFukQGKw6LBZw8QjypxL5aj27xIfjYc10jof6K7mtSX2yHN+TBAlsTTErSncH7rIseZ2HHGG/WnWtkku6jgCBbSivSRRd5RJR4 jfzMz7bz jjp1jJwikOxuApiG2To4U4Ag0hAu3yT8i89G3OwqiGZVCTkoxpTAAStijQSQWaJKke/sDhzcpAp+NEcUNXxckshZGhk6ruM4sbXLi4x2TAjwQTCkBE/De/K97PClCmmBCwX+T1qLcTD4qhfAySAFkw0//BR1zXxL28m3q4zOSKkXkqFOXTElO4i+AkjbFpHHMV/IVEZ9M8GTEzdmw+6BOXdUvcvHJPX2cjVKCbWY/vboe8eoUhlbmW3vg6vTwrogmz6jVYugVYttD+NgRl5u9lxIY67Kf6AyIaE8TOTgClNLhzN4FIS9bDOjyAJDNrVfUQOflZGMRf4v34QNayt2PjoAZNb+QbinpMba+DrYRwZv11gQ= 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 Sat Jan 11 05:48:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935791 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 90F2FE7719D for ; Sat, 11 Jan 2025 05:49:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 078BC8D0003; Sat, 11 Jan 2025 00:49:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 028A58D0001; Sat, 11 Jan 2025 00:49:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E32548D0003; Sat, 11 Jan 2025 00:49:26 -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 C2DEF8D0001 for ; Sat, 11 Jan 2025 00:49:26 -0500 (EST) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 86679AF352 for ; Sat, 11 Jan 2025 05:49:26 +0000 (UTC) X-FDA: 82994093532.30.805E11E Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf03.hostedemail.com (Postfix) with ESMTP id AA9C020005 for ; Sat, 11 Jan 2025 05:49:24 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=uWTmSnQw; spf=pass (imf03.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=1736574564; 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=sf5Mtwzx/Rsn5S8KGuxWCnV9W5kaTWrFDRgBE1ESuTolUYPPfrSqSKp/mXZIY5U+3VnvmR UT3OtBr0w+4oW634S/2JYeajcglXEUEh4AU4PJTtFs4a3vRIdLQfGI0VdR4pGgXHqRsuZa dUoED4We2NUKUy97pbbqlX5hjW2Manc= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=uWTmSnQw; spf=pass (imf03.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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574564; a=rsa-sha256; cv=none; b=k6Jc1ENhaMNDlV/SxBkA4MgqHMD0gzq/5KwEX5CwOKIDzYTx3LvpI7FrJIAmftlZ770Xvs ihSpUMxmC8WF8iDn8ob7b30woYe2UQ7fyMpPkWjJ/8X/KB8tlsJo9Ka/FQbpitgFN18mk2 j2wRtUMdUoLbmB1O1sw9IUrNgYKleQ4= Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2164b1f05caso47690115ad.3 for ; Fri, 10 Jan 2025 21:49:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574563; x=1737179363; 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=uWTmSnQwdsF57WWY5DVWNHLysM5vxL3hHFYwcd0xGywvCzbV21L442x4yKlKTJBb4x ZOQqbk91JRKsTfYCOZUNwB1u4eLjQTt024qaAQzHCiWgFX3dzEeVqAZrijlQJ9QSL/mB GesSYGwOARIxwbcuJcS9QtBFd4CzT7LvLHmtPpwbM7pkQKdJQhoqC/eP/4UT/um6AhHS 1EWODmjgX7vZynTNxWVsEh7jC0Ook82ORUH6LOlNAhAJ/GvOIgoR8W0OQAA1kVSkXw5x JY2YcFK6ELR/n1rjMpn0I8Is45POFfkCnoL4wblft2x3JuHpueW4EEGFsKd6hcbLlK6W qZGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574563; x=1737179363; 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=TrWiykW1MIPHobvLj2EYic9p/10eEs6AYZ83BwRoaxu+oOU9rxepwNQjoKBEGsmr0s /W5xV0ZM0eC7h6pdHlWfpkKlpRLeX56PRZ0PNFvxh+MPniqKN2hZ+o9XJmLHMr8ZtNnS JVze27yab0GAGpmGWK656QE1euY6bDuHmHdDK+q37QHvS04ZmAuxgR/6amnQWzEkkK4O HQJ3N+wtBwifvLj8+Tih/FSye55O07BiVga7yvHjTPaKJMv+Dzgnr9DPBbwtHSZ63es7 2hd706lhqhttKxDYmBpWjYh19DJF3LDR6fz2OG65IJs99Q9PIZXsYjyBFzeP/3LEA0Y3 XSnw== X-Gm-Message-State: AOJu0YwlxP/t7XqbMRgsF/loiZV/+VSy6VxmXEkSZF0+PaZDBH9ACGnT HR/RYWwdOuSQ7s8nAu17BzqCAmLiCmUzCpJCyKTvMUGIVdOlq055vftRhb/LKUk= X-Gm-Gg: ASbGnct3bw1IZnBB1XMxa6NcwAr/YdJBMq1IigfvCDm519yH6wgOCX7QiMErZRhHR7/ gFgRCtVXXx47kERzu+aTTqyW+/iAYKI+xsYwXCVdyEcvsB3N85AKzXVnfwtAveLoskB5z69iXYy rKFHT58/sqVSvKThQR2/096pNx6t3RuAXtDk3NCwOPnFwZ/v+eLebEb+/MJP5K3V9+Nr2PNI++s MrTR04wv+3W6sVTBT3MwBy9Hvv+Z7gs1VcGaYiFZSUiNFjv9yf3mlClIhw= X-Google-Smtp-Source: AGHT+IEOaK6BOPAe/MUGiXyl+EyGiYmhbaq4qeXiFxMDU90Px7X9OtnxNRV5Ifu8FHX6K2PPpo86xQ== X-Received: by 2002:a17:902:d4cf:b0:216:3466:7414 with SMTP id d9443c01a7336-21a83fcaafdmr208931985ad.44.1736574563492; Fri, 10 Jan 2025 21:49:23 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f22d0fcsm21166295ad.161.2025.01.10.21.49.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:23 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:47 +0900 Subject: [PATCH v4 4/6] crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250111-elf-v4-4-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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: AA9C020005 X-Rspamd-Server: rspam12 X-Stat-Signature: xu7dast9bxg9t5wayrtynigwqxyurhp1 X-Rspam-User: X-HE-Tag: 1736574564-390115 X-HE-Meta: U2FsdGVkX1+ztWjTJBWWHh0xzA57wfGwzfR2jBrEMBM1Qb1ZNcQvce5ELmLo/3kh0hCt/kF1AhkBhLjA0qELaeXTWHBP2ROSoJbX8kac86OduvGVFXKq4ulGAtTPIk0DvF4ln55sCEsbzDikB8momYH2HgWhY5yvAjuaTHy/SYxFt1SbaMFGMfq2oOPDOdwVWzUMcS431pCm/9poirJ0qn/1laowHkdgllDfGbDkNucPZCXuJjFnFIPNdzF2fpx3PVhPVVaxVaD5bACOYnvEVAMUI+Neo8vAsxI148SW4aEC8Nu81LXkV+UdFrnFQie1Fu4y5nTzeMCIpoFhJLaNwMDOj2AGjPPZ8rAEkfO2ZibBzb30wwcCEfT9pDW3+3iEy7r4C6EUaLukrlok7Wt5kivvMeKt4XVL27NcGf6otXvjC6Uq8VZVY9KkHHORNNG/l5oV2xb0yT7uRlVAYIqxQi0dkQAE/0/919J/Ojjad2qNfROQhffGgD2ZvehIXfO6A37A9Kpa2BW3yoFshFceh082eAw0iIaLnO+OPND9ELwGDa5hToCj7x6y9JpeZvSmGs2gSXJq6raGiDzSa7DeVvNOFtS0cJMaJbB+TQp98L4fiVI04qloNbPN3MP5uaZpr2HUEwLBkTTthsKDe5v8Qh180Pefg3ev5CSc/962mw0VCqXculSOXQyNP7ZKGqn9jBb84BkVR817WYqG7h6l+tleZ+gdJ3Cb3RRfbud/IVHW7qIKuKsHqCvyPCLid58U76e5e/8c32cLnNcRui2X5Nd3czIFKgdtOXPI7WFI3wiKrTBJWovAUm9pn132c3Gq5LwliDB98yQprXGWeJDW2wItzHccIdX2v06K+iBw/oOdV+UIwZTqeXvmJZnzXwnAUM5+1uqQRG+Rge0gFBqaxxzfRN/imwMbuumnaCiVVibQrus1AeF2izkCzwjDM6cRb5CgeZ1f8Gsx7HSQKNq F6Zj0jK2 AQ2xB5zWKTV0fDVFN9T1wbPSip+SW/mW40/kBT6YVzY2htJr7w4sUIkNDvJAxNivL14zT3Nm58fogTBM/aycH/TTCGIqhXbP1G07AyLzbaEsq75lBpfsrc7P6z8cL0lyvIPzNUOxO5KgwaqwFoNuevM0ssvuT4sj64GkFlk05MNUSUBCWAdmpi7jFm1CEyIdEvbk1nwmeuTS2VeqhvL0pBzDrbQ3roCjKgDttu5yW04V7gfnPsM37jNTuWZfcMcpJmH8ARHHcJOJXkntTBkC/yw5qrC8SfCf5FHiV31EPJZ+tpi1jWkVMY9NLQg6Pf7MedIq8njRHmBIs3NEuqth57OFYoDwLCYNriZrShvKWS7rEU1c= 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 Sat Jan 11 05:48:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935792 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 5D91DE7719A for ; Sat, 11 Jan 2025 05:49:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED22A6B0083; Sat, 11 Jan 2025 00:49:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E821A6B0099; Sat, 11 Jan 2025 00:49:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFA326B00A3; Sat, 11 Jan 2025 00:49:33 -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 AEBFE6B0083 for ; Sat, 11 Jan 2025 00:49:33 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 3895BB0417 for ; Sat, 11 Jan 2025 05:49:33 +0000 (UTC) X-FDA: 82994093826.16.4405C12 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf16.hostedemail.com (Postfix) with ESMTP id 4657F18000A for ; Sat, 11 Jan 2025 05:49:31 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="NsSG/Cu4"; spf=pass (imf16.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 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=1736574571; 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=2jKrk3bVYPr7k5YkzhCVfFSlyEMyT0et7JHsh9IpwE8=; b=V5ELbrfo0r4BX7ZFA8WJLZvntwcJmlqrP5D31dXoP3P0eCqI9o6NQJ0vjVeCSbAZqGRSdk OoleDY0+L+AFl1zX3ontGkNsBN6D6sm4W62OvP4y4P86Q4qwgc9Ckbdhs+7Hqi9eSG4FTV Rxbw6wGPbnjGTrGrS/Dygq2K6EXyDmE= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b="NsSG/Cu4"; spf=pass (imf16.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574571; a=rsa-sha256; cv=none; b=PdYAOF1WPYuZ5XY62qRWCqmu5dMXMY4Wm9cSztewmHee7F7xr9wHSTuLHQ9XKHWwi1S2vQ L+2jBHiBokfntjFNXAFreJoO1j2Jk+H68qkF83t0Sk8w0Hm5cLtS74OFgsmEowPtKnCoTQ M/KMLxaXhyyLdJ0A63JE/7XJYJVJ+R4= Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2164b662090so43418075ad.1 for ; Fri, 10 Jan 2025 21:49:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574570; x=1737179370; 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=2jKrk3bVYPr7k5YkzhCVfFSlyEMyT0et7JHsh9IpwE8=; b=NsSG/Cu4mUiK/Yxljt7XnMgvG/xVoyjQ5nR5co5l2y/lVT2jrPQyKFep0tv23srd2N tiSOjLIWZDeZg8SOcFYWn0MNZ2TMiOtBA1FDzz3ZKzksNHsAsaDiYiGNsKZ8DMuJXvGl kTSOhVUPhkPgKHwbNUJDu+Ump64uDy8quK5T9SUkscHnio8QBCBDcvcp4UeVnZOMAVEb FjX+mSNPkmXXqE76QYrw1Jx+WSRPUnVo7YD2Btys6j/QYpv6zXp0s3hVm0RnerKmN8+7 tujv1KGYQYSCg4ptBK/hBW2mcE18poAZWz0RAY89C7JjNjneekaqM2ytv+FoY67VhT4z 9E0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574570; x=1737179370; 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=2jKrk3bVYPr7k5YkzhCVfFSlyEMyT0et7JHsh9IpwE8=; b=J14Xqwi556cvm1lSELpzt+IMJBFD60oWHx7+8bNbqbg+xKVPg7wDcsiu1lAIokKorH Bu9zgQBHNiYzgzYWu/2y1hRct/JwVEI7/cTZuSkxOmRaM/7yZv5D1bJW3TgQpRoDmxQf vlXx8MsJUJtLFXdUfpDtMOJ8WZxdUPzRAf3l0nrAcwgdTdhTgiWWpD2BRXB5APppjf2B nN5oluoPmetgpEMd1hT6FudjRQmq4/D7ZtIaAD59P1gXcsaH84KvsfRKuEGpaogT6S70 AuafnrRtrPabYLqIHKw6xToQdRn3qEAPbFTJDSQF+4dztiD0O9Yf3zFz8MIoG3C1/e+J o6Vw== X-Gm-Message-State: AOJu0Yx6PNDC3xs7VeEalw1tUztez9ztSVlNiNRWzuYau/+xIBTiV7/J Mv3W8I3sBYivAerINEkWHpW3dfjsQf+m1HzavjNA2fj3aGEAEDp0hzgGwdfsBEY= X-Gm-Gg: ASbGnctMjFF12K4Swe9ads/QdcE4VGHnBzUr4MzttwkTWMHbi6I2XG4BLW3q4v+BQy8 RMFNkJK1KfEqBZdG0qkk+vsBxHmk4SgUr9bPsJ8cE9zaHpcB9i2rJIMpEL8+KDPur1QYlsOgBke qe18wCyv29Ayakn1VJOW8werei4QOUcPm/jmwHZeHcZZdCN1SXrk/fqwh+XjzHb2+yBxIMfhvch xEP00bqgEs/5Kj/OSg6COKSz3dwEuOwpm7MY3jU8hPRzoGKfuE7rUsvM4Y= X-Google-Smtp-Source: AGHT+IF/DO7Xc25oCNYWji4iMt60P0/C5k2sp2lZQdBF9bk3Ar0+kFGVzpELgHH1uV8P5GY4v7KRrA== X-Received: by 2002:a17:902:e84f:b0:216:410d:4c53 with SMTP id d9443c01a7336-21a83fc6db1mr183636355ad.41.1736574570100; Fri, 10 Jan 2025 21:49:30 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f217d56sm21372405ad.141.2025.01.10.21.49.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:29 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:48 +0900 Subject: [PATCH v4 5/6] s390/crash: Use note name macros MIME-Version: 1.0 Message-Id: <20250111-elf-v4-5-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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: rspam06 X-Rspamd-Queue-Id: 4657F18000A X-Rspam-User: X-Stat-Signature: mganr4ahf1dczpzxnuoogjunkxpjemx3 X-HE-Tag: 1736574571-926378 X-HE-Meta: U2FsdGVkX18OikMaoeiSHiWQcv6h32CJaGPP+lK2l7zPPkQMZYJZrMGitdMFyDrAK7iSjJpPoyUNL+UHQ73DKSmdwntQ1wAXPrOtb4pVjc7sSzmBUaiVZOnBqaREUHPJdSh9a9+4Kz9VNmHi7+VPfZhtUfJQ66eZ23DAYmQsZrzpMO5rewh7pg1yBhfB4+I1gK5Hq7Yr8Sx9/GknLCaKx8cVK8KsRJag37piY79yM2xn6i6gE3cBitXWTMJRDIJhD98EuQXOApheplk6rWweHpxcpaCSd4QdqZ/fg2Bhdjz+fsZLeFPko0fFBxNDoZlG+S60Sxyo38+/45QkZNIuOzkUUHCqJ1px6/CFgbMiEwEaS+k1/0QlMOYTeqGOmS8gGo9Q7Mztw6ypYFas6SoZMikrOxkdrDmQuybfETVymPdUAmjtklY+bq7htpjQehTekAzCYqhkrkSWXwHvptoNwFHb42e65ZlXH6W6c4+UcCxUJJcdFOcO8aY+3OjODncF9Is4u+qGHdfRUetlnWSOQp7WRz877nzSd8TBup5zlXa7kNAanaMdaO6XvPSpHlXpr2nLqSLNFHaE5bUaFnnNSITRE1cM9q9/26qQHEVNP5m/vwL64sYrMNYiJ8KTVwPBr+vR+nM+TNL5Zd+h0FwhsYSU2Af+ZPovAVe1V1mWzMP3XC8ZKGSnKsk4tpuey4+emo2wodBZtrR2X1fxZ4xmvzyZk3YVdD+9CNoLjX4slFQ30YfeIccix3uZ5kfItrRo+Vv1nm3LHnI+eNxGm52LCsRE0BHvywrs5et9qO8NUN1To1qwRZltaQXz3TLVG4KyMtylgXoRG+gshRqJ1BWpkwAquAcIqgfQfwws2MPYsqhKObDW5PxeC+oo2xbLl7B6fH5agAuxaA2bo21Cd/i4DR5vKK9NhYy/oES29N6erK1LOLwN54LUiRTvRhlQb3SzRsn6GCBKYOcAwfwmr93 w43kyaH9 I6JPxPxyjvTBObJoyJH0VtHIq7vFylCIPxvyjIc6/kFpgnVaEQLXxPaU0XkuLxaJcnYDW/Ty5b2pdz4e+xNyEyrrZbkBqt4O1I7oJXGj2ZQX7SRNbZPnsa5+lenNTKWvKuVRGRjNkN4iRDTgU0kZgvLl50uXX6zDOs8o2m3VpqadY/ZKIFcO3W1XRksj5NXOUwXIL8S6MsjjC7Itz5mR0fJ6yUouGcIDRFbuEjWs31PJrc9AlGcBZDkec5fpd3tJ22w3VKrg4d1fV91UAYcnFBYrChr9Ez5z03lj8RojksNM8I2mTk+mrb4+bE6zXOq9u7J6NnHmWy2i4bHvQDJ2GW1Tfo6dIEmIh/cEl282EykLefms= 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..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 Sat Jan 11 05:48:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13935793 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 5C5E3E7719A for ; Sat, 11 Jan 2025 05:49:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ED0696B00A3; Sat, 11 Jan 2025 00:49:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E80BD6B00A6; Sat, 11 Jan 2025 00:49:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D6F796B00A9; Sat, 11 Jan 2025 00:49:39 -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 B688F6B00A3 for ; Sat, 11 Jan 2025 00:49:39 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 733CA1A10B3 for ; Sat, 11 Jan 2025 05:49:39 +0000 (UTC) X-FDA: 82994094078.22.D978B14 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by imf28.hostedemail.com (Postfix) with ESMTP id 9004BC0007 for ; Sat, 11 Jan 2025 05:49:37 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=oGzLrfhW; spf=pass (imf28.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.173 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=1736574577; 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=2BcyfwvvaJ/oZYWCDbDIhdD371OiEq1BRuaB2JxcUkcFYsEZZJNtZq6injo/2Fszql+FWJ /s0XNLXPbm43J2g9CTaXlDKXKI0yTFjJyXf/ltJuDd1pCWJHMGLrluKhILsVh1L+MAyQPc DKGgyTjanUVUVJyvkX19zzN5U81hjAA= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=oGzLrfhW; spf=pass (imf28.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.173 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736574577; a=rsa-sha256; cv=none; b=j+uKgoXMJtYIVyz944kFgH/mJ9IY2vvH770DdsEQCYsXPGsA/wNB4w7xRYldr1XZoB3l3w 2+vuyG/23aBSwxEXspeTBW9ysbtSfJ5uGijxPEfB0mbbFhZ9CcqQuPM4NK+UIZWaekSwfM 7DRlFuw1MtYd/eHMSof68WBzkq4E/RU= Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-216401de828so45215575ad.3 for ; Fri, 10 Jan 2025 21:49:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736574576; x=1737179376; 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=oGzLrfhWc2PNNxkibrZV0UOoS2NNbx3Upjy9+URmUIe6lmOTm6VAnO9wKTxd4t5adS W/8IhnVZdXmmN9dvAQFR2uJnMmIQfjopcFnYWIlji3HVfaFqoiViCRaNb8MoJVZ6dTNz iC0pkZMY7mZ9MPcA9RBKqmKs3Vjk1cpetLJXRBp/nkysqBMPrSytSR9NwEHyYJcRXQgR ML6kRRGhoMvKf0I0Sn/3RfWzmtF3SW4zPGqMJW5K3Lmio8oZ1osUL6DbGKzqy7KeDQ5Y OCozSUbJeEFW3qcPmgsRZsCKS7ughPkxPzzPPDmFnrXBNSAlAr5GXAha2IWmFKAPRe3K nvZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736574576; x=1737179376; 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=Ii/kl+nPTxIJQ39rYDEH+zo5r/7iyUM4HUKNi+POEPMc84JkPPv7IC/aNSdqmLF6e+ 89wLPN3PZgGb7ffhwsllaV8J/0DQpWqjCMs9vJmXaUMLtoworJbt+WKNvQN9tekXKOh1 fx0axymUDJJXTQE8YmgGr6Pyqf/dHoUEmi/eILyFUYcphNCSgp5HRqC5GmnedhxnJNX2 vB3gK/bCtUODo0FVjm2f90NZAa+/dLppNW2EsRwt3yndAaadNr1XWg64aiC+LcnCdQbg jN45ijjIjorCSY00i0VkpM16/rkjIgMbyxSYgCFWJz2PtCfEX6s2E/hqucVVpXt5SYvs +i2A== X-Gm-Message-State: AOJu0Yw0cdbtVfArNUeC0ALdsj7DOU10pOwA0IVv2I1GD+GYyp+KpBm6 81Q8XcKdud/AsAo64En09aJYE+kNc79nhPZmWIpzG/36zjhziB0B/+AXCX+a03M= X-Gm-Gg: ASbGncvg7ts7eqe8AS+6uhloq3RRcCL3RZDjtBfRBkzksI0lTeGpwyv/RYyoSh6QoYi 8K59uIa49Sx+pOGWBbmeBRH4a80rfoRhVaKJz8+VVm8l8oKkx1kA1rDKSivETn4Km0BkFxdST17 VXVoKG6O5TlafZIJHB5QucvGY0fWB5sUHotpCABQV2QesUQTrt7TVK5k9K3FcLtFhwuDK312o7G bphrPfxJzXiCYjQB209xoiu8PNTQwx4NlHafWuHh+duSO/YkidVtBqFkx4= X-Google-Smtp-Source: AGHT+IGdQ/W+GdFqyOEQRaBJtYEIC3d/2Cs4dWBSsnFKDdtRyf3/E/GqQ6RNXv61x1Bb9PKDJOpeZw== X-Received: by 2002:a17:902:e552:b0:216:2426:7666 with SMTP id d9443c01a7336-21a83f36f14mr210827905ad.12.1736574576473; Fri, 10 Jan 2025 21:49:36 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-21a9f10ddbesm21468195ad.2.2025.01.10.21.49.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Jan 2025 21:49:36 -0800 (PST) From: Akihiko Odaki Date: Sat, 11 Jan 2025 14:48:49 +0900 Subject: [PATCH v4 6/6] crash: Remove KEXEC_CORE_NOTE_NAME MIME-Version: 1.0 Message-Id: <20250111-elf-v4-6-b3841fa0dcd9@daynix.com> References: <20250111-elf-v4-0-b3841fa0dcd9@daynix.com> In-Reply-To: <20250111-elf-v4-0-b3841fa0dcd9@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-Server: rspam06 X-Rspamd-Queue-Id: 9004BC0007 X-Rspam-User: X-Stat-Signature: w6xs4o4gd5q1ipbirakp5eadqy9s5z58 X-HE-Tag: 1736574577-14822 X-HE-Meta: U2FsdGVkX18wRU7tVrmlSW2U8Q/mEgb8sfXMjZBVkPPxwLmdLoPZz+7TYMdx8P3JpeMfIEWh24vGtCIsVomjMSpMqHhKxedjW0i0gaIbmWWK8kRbEjh/l3z029Afs3hhtu0myEs4SffYK+DMSWfUsVtnFkjX7Qzb366iQFKTkM3zGeQujNGG6NsdEGK8LRWrDaH/ryJrBBQnTK0kuwtQG3Br6O2wkXK2y8TU1rUYMu7bpFoz3auNzxdTV3pdLsAB1h1VThJ7eFhZ2hgwq1cA3lxLGHYst3Aa0AHgKYMXDw/JfyIOoTiTqTDkSBrI1emS3kjD/UHnHfDxtYHGEhIqblVMBtW4tic86xjauqO8zCzoDqzjcwx7TI4qQ2z2cU/EpAs02mQSocoa02PngMw1PlUMA574nW7MhXMP/lVsvxi9Kgq09i66nCp1waIKN0PqVcCUNL9VUc6WFx38vFfPM1LW+S2pUhq2JfCZjt9VwizriEmCAzPhTU3ACEHLE3RsAsRx5XmpkOFspHdC+kAXzSArremXtBbOaAYRh1u9udVklfS+LaxWN3EeyXhRRR1ns4OcibvxuhOKaOQkp92TeSnJomDt9YVT+552/KThF2yAsG+DsZuQ0pMKoKwvPscEqWHKmTPArEH81q6yIE/KPBWNWC8yccRusQ2z5ixJejoJOYf/uStiuyp9Z2OzoIVxF+XGG2C7bsHXgM9uzVQCiDRwdj7BorNRHZi//Admszzlvb2PX8dzLwbzKKfJgZ+KJxBvskOg1rLkRjgR3iz5sZtJTJDvGdbPD29MJQSL9VPOsD9o52kw0w9Nx/IqM3feutaNTn4e+6/En9N8wZDxrfHXm08PwRKdsUEQOcdEFg99S99FrjLe64OOnLzwwsNws1TDTMKJdpT0fPECRvQM/7zUFPqjz0bEDfH7vHRRfQyz289c2zF0ev3nmYlQfyif2C0YR8Gn0ZO1/D+Ju3A bnTAlyDg k/n8LitHPDvzAjNRKzlKtcMkHCh9UFppbl9UlSjLxvNpPj55DGvbVKuRJe8rHGm1Pipn90748Lngr5Jsv0lYK8c0U8QtKf7d2nB4Ocm7be0+GKWD6wAY0mmknhUdapqq+/GtJQSh/oW4snLRBWJw6DRshnfXbtStxnW2oPMQs/pxWAfa6yu+XOZZDGEZYQ3T1IT8WrrOPalRtPwh6nBXXHxH+ljsfDNYjTHrR3LHtj8+JsHuPx2fddQzMbZPrQvz7NLtF/A1qRt9ptKP38Jtpog5h92Rx90KPG7j4MX3mz86SvGQPqKX3/6LgzFvw/L/ndRi6qlEVNEtD/Ln2xKIGgTjNN1xGoEcucnODqWfunj5H6RsJGY0RqMATwzKJtg6M8Nwq1TEKew+4VNwDSjxKkZWWzKW9aT2DUZcK 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)