From patchwork Sat Jan 4 14:38:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akihiko Odaki X-Patchwork-Id: 13926267 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 81BB9E77188 for ; Sat, 4 Jan 2025 14:38:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E1E506B0089; Sat, 4 Jan 2025 09:38:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DCEDE6B008A; Sat, 4 Jan 2025 09:38:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C96736B008C; Sat, 4 Jan 2025 09:38:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id AD1236B0089 for ; Sat, 4 Jan 2025 09:38:46 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2F96FA0D64 for ; Sat, 4 Jan 2025 14:38:46 +0000 (UTC) X-FDA: 82970025852.12.E6E915A Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by imf13.hostedemail.com (Postfix) with ESMTP id 4019A20002 for ; Sat, 4 Jan 2025 14:38:44 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=nuNII8LY; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.182 as permitted sender) smtp.mailfrom=akihiko.odaki@daynix.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1736001524; a=rsa-sha256; cv=none; b=rxTQl7QB25xQ0nrdaWdNXI93qIi/y/6kpYC/ZE3b5arLTaOgjAlzNcLd899oOk7I336dtN 3u23kKH8/TPseKQeMV6wnyWMRLeXIYMlAasq/vviFw43Rq4CXEh0NYJw4ws2j0Rtx5BjXl W7qiolNJUiNEd7to9diLRBePYGUkM2A= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=daynix-com.20230601.gappssmtp.com header.s=20230601 header.b=nuNII8LY; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akihiko.odaki@daynix.com designates 209.85.214.182 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=1736001524; 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=BKNiV3QEEiOj1Le3vlBLmpRmhzkmvu5zT7BlJh3wiAc=; b=vT+lBeJ8w1GmdT11JGIneW9bpMJ1zQkqcc96Fe7L7JLbLY6FTn2kY0hd3E9bBN9NS7mHxJ X978WnPrIOwD95a718UXzf7k/Qfqobf6VPhTm+vlX3XI/My/07K1tHTRkj1rbqh3NR98xX 0HGV7r8h7S2nPZbvSeb3UxYFWd2AEzA= Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-216426b0865so180194485ad.0 for ; Sat, 04 Jan 2025 06:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20230601.gappssmtp.com; s=20230601; t=1736001523; x=1736606323; 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=BKNiV3QEEiOj1Le3vlBLmpRmhzkmvu5zT7BlJh3wiAc=; b=nuNII8LYqefdQHPY/bXrFiZh1aOSw5q5dmEDFHOb87tbGdM5bv0mUTue5+vxRYRiCl Yl3d41YP/gw4AUCQDhop05vY5DUmg2IPI9G2iGF0rizn1tb6jC5GHkQiQ+tpKp4WV6E9 lfkQ6Ga1aSDh3Gdql82ztPohpgZUbUcawMiklPHbBHCXKk5YBRG4qRgJPvd0cZl+z+44 hcyhVkzcj2uxdEOGye+E1OQlBVTP13TC8mRdFHgqPCUWP90aJ7wkg4yUY08zkB13YaV5 QEYLNN0bDvP4e5o4Whu4TTpHED4c1U07bRcUTkKLsK4qPkVfc9a8b9D67LCMpzwd8OsK XGWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736001523; x=1736606323; 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=BKNiV3QEEiOj1Le3vlBLmpRmhzkmvu5zT7BlJh3wiAc=; b=AAa3QdROTb4T+ZOoRpV9lbNzkRY8Vm4lX5z9/nETbX/RJm9nZeGn3kT8P548VPu5ep NrLF/QTpGCjO2yFKEkm0sGayjk6ngQvwrObp9UflaKoN3bvTEm3WuA/nLG2RVA/is/sG DtFvVJn4tYKrtuOzYvv5IQQvLDJprnBtoYCBBBJklleAGh/4Q3NWYs6WfUXXPXaPytge K4g09ra7n3yMjZo5LzP9D6dT09HrUogLV0fxjpMeDvE+Al/qvgH/D1O/6tGy37XM9Jju wxOAeZTVbqUCdEfVgD8Vw71c4LwsW9YxDSSaKIagflxCpvA1djcX568b1s0ANbTbbv2J KlAQ== X-Gm-Message-State: AOJu0YwwzJb17n7ZW6MAWjkHm17qsPhc4HDTx5IbDiKnDID57YlXFr0Y EVu6nuMkuw7kgVLtNHP9xuF8iUodIRdBE2Ge6QIAhinC6GSkTKOzuyYpJHjq+rA= X-Gm-Gg: ASbGncu5gCza2uOPwNnHFT/mDBxZH/YzU9HsHJHPYxbLlGVsigAeqsKakguy6p4popA A0mw6QC1vi2g4ktipXZYLEhYp8sqM+O1YUuF3bOV+kVjIHeTwsgcOwLsR+06yKFJBVE+SgpXWrG +JRS3VgKKW6vLRI0DkNjP/77WQ+2wd4ezlqM+1kS/JQ9BEngb8qnKNz79R29zubxcSpEuWAP/Pb +Qbc32qxez4c+CUNT8HytREh9bJJ3b9zS+bJCS58pwXffou/EpgP7TgUs6veAM= X-Google-Smtp-Source: AGHT+IHMKqIuk9Mp4P+qfjslbof1yC0x6Ct9CbXfed2Znwm+wkFLa5rTAL+cuIXWXtg5bkhTzZKJyg== X-Received: by 2002:a17:903:2286:b0:215:b087:5d62 with SMTP id d9443c01a7336-219e6f1483fmr809248225ad.36.1736001522852; Sat, 04 Jan 2025 06:38:42 -0800 (PST) Received: from localhost ([2400:4050:b783:b00:4952:3c52:120a:27e9]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-219dc97182dsm261833855ad.82.2025.01.04.06.38.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Jan 2025 06:38:42 -0800 (PST) From: Akihiko Odaki Subject: [PATCH v2 0/5] elf: Define note name macros Date: Sat, 04 Jan 2025 23:38:33 +0900 Message-Id: <20250104-elf-v2-0-77dc2e06db4e@daynix.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAOlHeWcC/y2MywrCMBBFf6XM2kieaFz5H9JFTKZ2QFNJJLSU/ LsxuDyXe84OGRNhhsuwQ8JCmZbYQB4G8LOLD2QUGoPkUgspOMPnxO5njk5Zbb2y0J7vhBOtvXI bG8+UP0vaerSI3/r3pel+EUywk0WruTI8GH4Nbou0Hv3ygrHW+gVYO/OllwAAAA== 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, devel@daynix.com, Akihiko Odaki X-Mailer: b4 0.14-dev-fd6e3 X-Rspamd-Server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IBglHxJS G5/x7gYg 1+md/BPQL15tSVbaGPz6PrlCSqpdObNmNeMWkt1hPkvDQn4Fqco8WPiJCNRi42g/xoVyodYp9C9UG5JHbA9z7yhZ91TeiEgVuncmV3HkM5I+nX/vMiDI7ZbCwgt9lX0zRRknSq1ulMzfPwzqEZyNIkM+ljABJO1y/yjZHREfbi/kOmay/+1CSxPUtb5c5nfEHYsv78x7ZF3qylIg2Ms5YhOKQGxnyGNd9ySoP+TC2shni5CF/j85CaOT7EOMF5CDAfSHQfFKMGpl9u/U7ImTAlchokl/Ha39IPgt+R4QKcmHWjFrrj6GSb5MYabW+ld2DWu3WyeoKJR3siIeGg/axGzuvK4yq0FpS1Gd8xrpvDp4joiWcw8P2r8h6lkJN0dj3JHzxWGcIMfIeP9HYzdaGBqNGMg== 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 --- 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 (5): elf: Define note name macros binfmt_elf: Use note name macros powwerpc: Use note name macros 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 | 2 +- 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, 111 insertions(+), 35 deletions(-) --- base-commit: a32e14f8aef69b42826cf0998b068a43d486a9e9 change-id: 20241210-elf-b80ea3949c39 Best regards,