From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DCD41F0E21 for ; Tue, 7 Jan 2025 12:47:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736254076; cv=none; b=Y+D3ekVUv7h/35LZG8chcjKxNp/HCugyu7CnpeAXnyCTk2zUC5Wd3SXADT8Z4544fgyQjGPqQVTJoOrXxB/0tIoeNixy1cE3lFdFKK9zMl6U/v1ThMK0V2ahddP+K/anYRmchupRqNco6jWlgTawJhIKh9jhw5ySr1BLYXokAC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736254076; c=relaxed/simple; bh=Oduf8yJfn6BPnkdQYS3faalrxm2ycKrnWGoNvF+FQtk=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=OZNJ9FLIwYHNk9WToo7zJcMXkkc3o+g6cTJi6e+RAO/RPPmqrXcWur84dWyjT6H/abxdS1gzA8hr9DC68sL61jeIrIeWDi+MFRQ31/BDnMGfFqA/9ICtdpUR7hojeD+m7P7du1dZxhclLCOiOjtDAXScWirYBOIx5ROVDUAKxbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com; spf=pass smtp.mailfrom=daynix.com; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b=CQTrywj7; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=daynix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=daynix.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=daynix-com.20230601.gappssmtp.com header.i=@daynix-com.20230601.gappssmtp.com header.b="CQTrywj7" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-219f8263ae0so178323755ad.0 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=vger.kernel.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=CQTrywj7pfsrB6zy2oh/C98ue+ctVi3i8Xn/h6DpHC+vQBzKYDkpUlqGtKPx+9EtJy KYGEcDeA15r7V3uurpFft3VnJ/eLmKvbRZA4e2HVDwJRc5kY4+1QsfngNmJi9rXh3iqC ha0VAAUkDnm8RO2DktEEMAH1tZb1JLyuOd8kMrquf5PWUPn0mGE8QmCOSZRQTQE9BsQU SxArSiLkw39ErzsJoZAZbm9HeM66k8kfLlUJX8jXMDlXBCVgajp7qHug450zqPuu969m Fcw6HhN+iGfNzVU5eDh38rCqkG30PKUPmKzeCSwYDjGeSyKPO6kqPnHvILcaODD//qqQ CnBw== 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=GSZU646hg7vM9bIRcvzx5SwGRoZ8dOXm365vR1/SzYIhIp+hPe0IB2KF/cQ6OhdI/b bY89u0TK51ujoZroMET6QK39Es+ro5yIK+O7Ihlo97RRDu0F4Teq8XRXkgUtQBMJTXRQ bXY3bi+1wzUgYl/ByF9loiXYRy7EBBTzXzMeSe2+HU2NKw1YSHW8tF3H3PaOdLDPwMEW VWPA3wN2sBJx0IE1LO6CgZIsBUDu440OCboYtcaCeZTmXh/aq6qKDsxPi6rvLb1cjUJf TQus4bhca8dZ305+t9J4z/Iu3HViLpDDjlicmph9009ij6g9ZyanzV0JVsYxXRdBT8yO Fqhg== X-Forwarded-Encrypted: i=1; AJvYcCUBNhWO6Z319i7SZIP09WpM4+8blrVijhjvgPunj0dzssYFiHY0Q5yOaYRjxPDNAmpR9Izwgw2UP9R91rw=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/GiUwh725PAggGlR3ffmH/ZdxcGcg/FieqqjRhzOFmBXDg9Ia VUQwPp3gOzIKnGLuJoKNirU04xdgz+u7gskvj2lKGKBPcsfomBCUjNihXVyqZcM= X-Gm-Gg: ASbGnct6Y9cudk1NCpcLOIcTvlNd9FWVT1ZTAIDdNiwhx1ibMVxJPBf4618nGhhQFhB xeCtZEtaXXHlHaw0Is4v/Z3X4KUy0Xpg8KxAyRHTbxBgOVsoWklY1a2qKSFONopLEL129hdzOtg Sunny0qMC2cz7GW9GJEqsVtNbLYe62D9FwgJc6IApfCcGPhTYhMvEFqd2grNDbX6arw432d33ZG m5MCQWbcCtyIqxRys8zM78TUUQFY2ZDPGhuk1EV1jAIF452RJsJfbx+9es= 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 Odaki X-Mailer: b4 0.14-dev-fd6e3 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, -- Akihiko Odaki