From patchwork Tue Jan 7 12:45:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13928839 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 49051E77197 for ; Tue, 7 Jan 2025 12:47:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98CAB6B00A2; Tue, 7 Jan 2025 07:47:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 93C996B00A4; Tue, 7 Jan 2025 07:47:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 803CC6B00A6; Tue, 7 Jan 2025 07:47:56 -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 635286B00A2 for ; Tue, 7 Jan 2025 07:47:56 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 02CDA443B2 for ; Tue, 7 Jan 2025 12:47:55 +0000 (UTC) X-FDA: 82980632952.05.DF4CB69 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf10.hostedemail.com (Postfix) with ESMTP id 083D4C0016 for ; Tue, 7 Jan 2025 12:47:53 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=MiTtatiX; spf=pass (imf10.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.179 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=1736254074; 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: references:dkim-signature; bh=opIuyGFUTzWuwcM2pYQXlXkOFxHji1aKoxh7XPTxYrQ=; b=u96KSDzvhj0tt8TRdLQKyYdOu81dWq4slUZjvBVZCQDwin7OBLTz47jS63J5acfq4nid9G He2sv1vfWVT+7RII5n5KTCo2V1iyFm93FLCxtQh4V+MafzBaB4E8YFAp/gtjQHbApT+nWi 8QezFghCb9eWSzINOU/yyInhwGdQ/OI= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736254074; a=rsa-sha256; cv=none; b=tm9HDRNX04BwoQiK3AstNy3nB7FytIvecXQ4QjLfdJh4Y0858Gdv1FBCSljTUogCPy2LpQ wkIpVpYGfoBCu2JUNnMas8SXvEabj+lah+n+VyG1yPuqZZWqyZfuMEHBl8YI8MJR/9eNVE 5mDd4hNKkaWN6/b15d7Kua9U4G3WWuM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=MiTtatiX; spf=pass (imf10.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.179 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com; dmarc=none Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-21649a7bcdcso218631165ad.1 for ; Tue, 07 Jan 2025 04:47:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736254073; x=1736858873; darn=kvack.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=opIuyGFUTzWuwcM2pYQXlXkOFxHji1aKoxh7XPTxYrQ=; b=MiTtatiX8GgtuXEQ+OFtMtl1SlS9joo7xg0G/yFVwXndiQgPAHCpz92C/cSG7OTglj /G7JRiRf/8LevaOwkC8hQpxEnLWmVCrqFxJbOdJLETnLeWiNphbrML21vAbemmA14LiL OOzOsZZk0pZ3TAlhhcj+7dcsXLsd12nsIV2XKK4Jsu94V2zaDKWd9htwPTfgDU3rxFCz G5CH6S3g5B+zmVLYYzmjb0Ot5diCHQ18yfJ5KoeZlUDYJSP4ZtsumPQAa+/hnmmHPUFe bzTdHsHQJG6fFqO2r3ojAaA2xcUp8WoDIGRaNsVEy/dD/ig5sD9XwhjLbE/MMIsECEpp mR+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736254073; x=1736858873; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=opIuyGFUTzWuwcM2pYQXlXkOFxHji1aKoxh7XPTxYrQ=; b=jXbbSpm/giNYvbenr6/iAtLFGkZaIqctKcZMm8Shca/LxDkYVLklSI/URLe96jVB3H XrNx8jLXH+DIYkg9Mc2WN8ZaGYeTXkamCS7OMqDRzZ3mrAeFqdg/0yNzolsP4dU08LC3 uEcAV/kJxDTxgIKksJxd0oKXZZQS6iz2AHsZe4oNsoBD5xDvNFQC/LBC39eofbGZooIR w42xdg+/TGCEiFK/z3q9sYoM2nF5Ho/GX0djYsxa9MM3JnxDd9PTcaocK7idkMnU3OX7 1YV88NfvDa5uYIG8w1SQLlJ4S4fgG5BCpxC5OfFSSx+2ttRBmQ6u4LrZqb5wwh/WLPo5 uqSQ== X-Gm-Message-State: AOJu0Yz4ahMHli64/cKeJQ0ACsPCjiNzxEZIIcGucMNkVHsBbSDHw412 k3qBtntWADpJJYXjNhKlitHcpQcN+NjQlTOwNyGil0W6nR4wjkMujUKPDQ/y5lk= X-Gm-Gg: ASbGncs4bMJRqnxI6LOL/hyXQHtL5fUjKwl8xI8XUq9qtpwYgy7i9Rrl0AtuLn1obrY C7OR5Bib/i+IehfFbjFToA3YbGSRT8IT5WvjLJcgOeCgTtTQIk4NeSEVWO/W/TiqRX7ryW2Kg2D z4fPLQWn7+DA+mOKPU1fskJdL1KkDZPBfTbnUtxb1XpvQ4KeCV/Wupkt32OxOxgFjbfuVqVJST0 8AuKMsA+sI+o7BhAUr8QblodpYaC4z99xCrU9MYh9/vd1MMZVMWabZ6ZxU= X-Google-Smtp-Source: AGHT+IH/TI3sUb6l2+b2WaTSh1evq6vZuS5S4szn4UoWwy5hsMxR0UzHoKY9BZVjFfB8co0JCgCCAg== X-Received: by 2002:a17:903:11d2:b0:216:2f91:92c7 with SMTP id d9443c01a7336-219e6e89278mr972540505ad.12.1736254072686; Tue, 07 Jan 2025 04:47:52 -0800 (PST) Received: from localhost ([157.82.203.37]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc972b0dsm309970895ad.112.2025.01.07.04.47.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2025 04:47:52 -0800 (PST) From: Akihiko Odaki Subject: [PATCH v3 0/6] elf: Define note name macros Date: Tue, 07 Jan 2025 21:45:51 +0900 Message-Id: <20250107-elf-v3-0-99cb505b1ab2@daynix.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAP8hfWcC/1WMwQ7CIBAFf6XhLGZZwIon/8N4aGFrSbQYMKRN0 3+XVj14nJc3M7NE0VNip2pmkbJPPgwF5K5itm+GG3HvCjMEVAIFcLp3vD0CNdIoY6Vh5fmM1Pl xq1yuhXufXiFOWzSLdf36qDc/Cy54bcgokBqchrNrpsGPexsebA1k/EkaBKiPhBx4XTuLBAfXK vqTlmV5A7A3TXfMAAAA To: Eric Biederman , Kees Cook , Catalin Marinas , Mark Brown , Dave Martin , Baoquan He , Vivek Goyal , Dave Young Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, kexec@lists.infradead.org, binutils@sourceware.org, devel@daynix.com, Akihiko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o0oioFn/II8bNwsF+5q3rhOLJ1QdqaLHtX9peQpMAoC8LX hQrVMqRN JTpDN5JUACIb/KsM8h8jbe5HeOvr1Xt/IFD1wJqItjO0Yk24+rc6ry1YLWmBy8RyEi4/LKaRecpTsxYVV70Yyu5rX+aZKyaVDBcuXcKat0sTDpj0Y3LO5tPFEZgOa4xZdbUtLdggHxAGVNK6O4ui1zlkz6s1CLioxHgUqVc2/i+ho/ChxRWF0WkotH57foJFH7ezUno0TrKoLSHIWjfiHHAqPOSSX8+YGqcNQ2W7pi2g93ebZ/sHfdfU6bdvJQ2vopc0qH7AsRi0l7pfBXAV9r206TsBo5htXuUXAnd6qqa9k5jF5sa6VMp9AYGcl701WCczh0t4lGngrFSnZVwd1BQXoqASmZu9FvI6CzLYCEVn1/H0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.006621, 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. For userspace program developers --------------------------------------------------- While the main purpose of new macros is documentation, they are also hoped to be useful for userspace programs. Please check patch "elf: Define note name macros" and if you have a suggestion to make it more convenient for you, please share. I added the Binutils mailing list to the CC as it contains code to parse dumps. I'm also planning to share this series on LLVM Discourse. Signed-off-by: Akihiko Odaki --- Changes in v3: - Added patch "s390/crash: Use note name macros". - Changed to interleave note name and type macros. - Described NN_ and NT_ macros. - Link to v2: https://lore.kernel.org/r/20250104-elf-v2-0-77dc2e06db4e@daynix.com Changes in v2: - Added a macro definition for each note type instead of trying to describe in a comment. - Link to v1: https://lore.kernel.org/r/20241225-elf-v1-1-79e940350d50@daynix.com --- Akihiko Odaki (6): elf: Define note name macros binfmt_elf: Use note name macros powwerpc: Use note name macros crash: Use note name macros s390/crash: Use note name macros crash: Remove KEXEC_CORE_NOTE_NAME arch/powerpc/kernel/fadump.c | 2 +- arch/powerpc/platforms/powernv/opal-core.c | 8 +-- arch/s390/kernel/crash_dump.c | 62 ++++++++------------- fs/binfmt_elf.c | 21 ++++---- fs/binfmt_elf_fdpic.c | 8 +-- fs/proc/kcore.c | 12 ++--- include/linux/kexec.h | 2 - include/linux/vmcore_info.h | 3 +- include/uapi/linux/elf.h | 86 ++++++++++++++++++++++++++++-- kernel/crash_core.c | 2 +- 10 files changed, 133 insertions(+), 73 deletions(-) --- base-commit: a32e14f8aef69b42826cf0998b068a43d486a9e9 change-id: 20241210-elf-b80ea3949c39 Best regards,