From patchwork Thu Sep 5 23:05:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 13793076 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 C4F36CE7AA1 for ; Thu, 5 Sep 2024 23:07:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 165DA6B0088; Thu, 5 Sep 2024 19:07:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 113586B0089; Thu, 5 Sep 2024 19:07:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF7636B008C; Thu, 5 Sep 2024 19:06:59 -0400 (EDT) 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 CD79E6B0088 for ; Thu, 5 Sep 2024 19:06:59 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7E8331608D3 for ; Thu, 5 Sep 2024 23:06:59 +0000 (UTC) X-FDA: 82532221758.20.6639B6E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id A00C5140020 for ; Thu, 5 Sep 2024 23:06:57 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pvcd7lyX; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1725577592; a=rsa-sha256; cv=none; b=erRgXA57cMQpzgDVNyKANMKFL4uEbdZk14+yLqsYHB3ZJMwDtrfsUUnUcQAetqj2uXt9bY qXpAyZ1ute7oUBxsTty1z7r5ep3xEIQl2jR13P2uc9sgCD8P0BKFlbS8HbC7RCkI/i713h J6xLa8b9V16Dd0XKgYGvF4KA96TDyyU= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=pvcd7lyX; dmarc=pass (policy=quarantine) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of broonie@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=broonie@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725577592; 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=4zHDp7syHBjxaXT3ulrQR7bOowlq2bKe8z5J5/LS/iw=; b=7ibizR19y7C/q/XCVysLyXhv9O7kuheyNi3Eq9dNJW8AABlqrm9W8ka6IhKkEtztAFVQ/8 sLZkOMJHBXVE9VXixtxHH0X9HZ1cuprmKYLyGNvDMy/tVRC6WghCe98WDYfgDqO6R7ule0 ugHKWH+uEOAJiIN+5eDPZb0xzwqLnsU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id F07305C5D0D; Thu, 5 Sep 2024 23:06:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C961C4CECB; Thu, 5 Sep 2024 23:06:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725577616; bh=1CvHL3X1djqDDP3CHNqU2LnQvflMkgfKJ74BejW/qME=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=pvcd7lyX1KomLXt/dqsCYSLKNtxZbL34j7YsWjdm+D58Rn3qDSfmpe3xAEOq/2xey UKXPAVFb/SaeC7C6QJQEitBfhd/0CCKh1HRQ3H+PX9RfTmuXPE1RbiTNgEkD+1NuZJ Qa/6sFKvp8ax8EQHXPhtQ6TDtDiXR4zsheMiSmsPfSEFF0+RcQb59CdfOqwbQtOzut VIsnHQ6jAOYujY7P4/hISWe5GmHGSmkcm1ue+l05+sU+Kb7ipZmuj8AVkJiil4FokG I8v2OVLoOvJ8oECDILspnAfWKWvAtP9+u8iRL1Rw8dVm2U3UwTfgGvUbSuNZ4aOn97 zxMSKXrNT9Z+w== From: Mark Brown Date: Fri, 06 Sep 2024 00:05:24 +0100 Subject: [PATCH RFC 1/2] binfmt_elf: Wire up AT_HWCAP3 at AT_HWCAP4 MIME-Version: 1.0 Message-Id: <20240906-arm64-elf-hwcap3-v1-1-8df1a5e63508@kernel.org> References: <20240906-arm64-elf-hwcap3-v1-0-8df1a5e63508@kernel.org> In-Reply-To: <20240906-arm64-elf-hwcap3-v1-0-8df1a5e63508@kernel.org> To: Alexander Viro , Christian Brauner , Jan Kara , Eric Biederman , Kees Cook , Catalin Marinas , Will Deacon , Jonathan Corbet Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yury Khrustalev , Wilco Dijkstra , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Mark Brown X-Mailer: b4 0.15-dev-99b12 X-Developer-Signature: v=1; a=openpgp-sha256; l=2249; i=broonie@kernel.org; h=from:subject:message-id; bh=1CvHL3X1djqDDP3CHNqU2LnQvflMkgfKJ74BejW/qME=; b=owEBbQGS/pANAwAKASTWi3JdVIfQAcsmYgBm2jmHlUSCTyEan9xj94QRH1fAPoiO8sniob91kWqs wH6MgeeJATMEAAEKAB0WIQSt5miqZ1cYtZ/in+ok1otyXVSH0AUCZto5hwAKCRAk1otyXVSH0DGUB/ sFykES43Vs38+h/g2aRkA7jtFVqXh7lOkhSkwiC5Rr4cxo6nLWNN46KSAenJ8uhtF62W+4pUoxtqnI r/MAM5CrzP9nw5o7N58DXaqk6uu4Aycy28541fxl8CfoyxPbS0fI1+pxzoIJ2+xTLs8fsalDNl7INS QjY4YmTG1HUSjFhZWRD3D3jDYEYafz0KSJh/im4w994yOuWHrRzuW5pM5GQv17vsFmtiCo1DnuxPZS dpljF575hDc2xKb/MGfNkqgr//E9dy/pvF6YAg7d9flsPxHyF5INnnzXYKdt1ebM6nEhFzT1OTBdFZ hJAgfovynsR+qGSYI5lCrPuvhN9rZ+ X-Developer-Key: i=broonie@kernel.org; a=openpgp; fpr=3F2568AAC26998F9E813A1C5C3F436CA30F5D8EB X-Rspam-User: X-Rspamd-Queue-Id: A00C5140020 X-Rspamd-Server: rspam01 X-Stat-Signature: nffjnfpxfsr45snhkcwzk65f5qmx5a9r X-HE-Tag: 1725577617-465490 X-HE-Meta: U2FsdGVkX1/yY1ReGKrTKVmnhEiWhPWIKx9KNLmbAiTnKRIEwe4nWjMlo+VoQc+uhjmuxDYT/KtanwXvsX9xHmEWsE2Be4R0hnAbQLQOdVgUTJo2qS0y9Q/uT0qgfVRmC6WKKLuhmV4dtKCzY5EsqXJZ0Sy9T6hWoeN+gousfeAyO8ydHFuqeitYxoaGUaUyMiTyMU2cVpr3nqsdwv5pQu7u1gnz/vycsAVxvNnUTeW5uHDpELOgcYZS9oufucKNIcFuu54aal6Y/IZtqORq7BzWF9Ve6zyIEnleO19++KR2kkGnxWP4QneKPm7T9G+4mP4sD62ZGUrUtvRK3ybNmya2L40JoOEDNADK6rvc8aGPcDrFD9jj5z43+YxITl1bi/rTQLGxx3FZd7wwpydbaf8wxSjBl82t4xKqoOqOOPuASJ0mZQa6YJu+b/TFBCHmfotPCOT7rpq6kChuOVaJ/7A/FheKnovowixu3mousX11UPUu46MXBUMQPiXp1xuwMXnyg6xnWxD4jXCpS1n46027KmyiNcsWZh9QvtykX6hWa7d3Rjq4I97yt8tkUF/PkNd6g/9uJwMkzzncA5PaezTsGNvJlvKmJu0/dDES1TGHZiD9b5USNwV5mvbETH6c9o+UAdmtjq8jiX7EPhlisiLAMacAf1l60b1DLybvOVu5afpRXPm792JMn2CF3QLSSfY6o7WlZWAflAkloG/obslow9ySTfgnQWUqdjPvFUTrNOfr92GcCMraIKqCP0Hu/7wIt5bdvvzsnWkOzG1X6K/s0JAN8TSe9bqcsCh1OINQJDqVE/cetwqo2T7SR7/iRlaIdWnYI1Lz6ab7cX/EOmOcV4AMk3TKQltg9KRbTcuU88axawGGJm29UQmRlx9ovXSj+GzQ1Pzvwr1oSyoqs8WT/ha9pEpnhyUkszBiHBmMP3hVd8ncmC1j8r/34zoGwb3R76rnH8W2n5PBS53 RE8vX3/q gYW84Z1LgjrhbcUYfJX0CLoPY5pKwyyMhTC8JDEtS6VHJVX0qnRj50UJ4ulp8h4m+YEAZvFlMVlUnngZagxkxX0Yh8RltcMF+fzc/nB1CfoTt4ds3x+WiLnbWqSBCpjf+iWK+JL5bpDXeF88ClzErCauoEK6kvL3YqoQRpx3VbTdvGM8YaZGpRigEUe2TCwZsLhpCB6591Vhcz39G1VaUy3LIfBn7csLTfLb1hQcijklRDX4XreRjuvJisvFCrloh4436hSjBx68g8XP80k2/TLbV1IAkBGHlG8R4 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: AT_HWCAP3 and AT_HWCAP4 were recently defined for use on PowerPC in commit 3281366a8e79 ("uapi/auxvec: Define AT_HWCAP3 and AT_HWCAP4 aux vector, entries"). Since we want to start using AT_HWCAP3 on arm64 add support for exposing both these new hwcaps via binfmt_elf. Signed-off-by: Mark Brown --- fs/binfmt_elf.c | 6 ++++++ fs/binfmt_elf_fdpic.c | 6 ++++++ fs/compat_binfmt_elf.c | 15 +++++++++++++++ 3 files changed, 27 insertions(+) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 19fa49cd9907..32e45e65de8f 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -257,6 +257,12 @@ create_elf_tables(struct linux_binprm *bprm, const struct elfhdr *exec, NEW_AUX_ENT(AT_RANDOM, (elf_addr_t)(unsigned long)u_rand_bytes); #ifdef ELF_HWCAP2 NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2); +#endif +#ifdef ELF_HWCAP3 + NEW_AUX_ENT(AT_HWCAP3, ELF_HWCAP3); +#endif +#ifdef ELF_HWCAP4 + NEW_AUX_ENT(AT_HWCAP3, ELF_HWCAP4); #endif NEW_AUX_ENT(AT_EXECFN, bprm->exec); if (k_platform) { diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 28a3439f163a..9365f48598a1 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -620,6 +620,12 @@ static int create_elf_fdpic_tables(struct linux_binprm *bprm, NEW_AUX_ENT(AT_HWCAP, ELF_HWCAP); #ifdef ELF_HWCAP2 NEW_AUX_ENT(AT_HWCAP2, ELF_HWCAP2); +#endif +#ifdef ELF_HWCAP3 + NEW_AUX_ENT(AT_HWCAP3, ELF_HWCAP3); +#endif +#ifdef ELF_HWCAP3 + NEW_AUX_ENT(AT_HWCAP4, ELF_HWCAP4); #endif NEW_AUX_ENT(AT_PAGESZ, PAGE_SIZE); NEW_AUX_ENT(AT_CLKTCK, CLOCKS_PER_SEC); diff --git a/fs/compat_binfmt_elf.c b/fs/compat_binfmt_elf.c index 8f0af4f62631..0a219e26692a 100644 --- a/fs/compat_binfmt_elf.c +++ b/fs/compat_binfmt_elf.c @@ -80,6 +80,21 @@ #define ELF_HWCAP2 COMPAT_ELF_HWCAP2 #endif +#ifdef COMPAT_ELF_HWCAP3 +#undef ELF_HWCAP3 +#define ELF_HWCAP3 COMPAT_ELF_HWCAP3 +#endif + +#ifdef COMPAT_ELF_HWCAP3 +#undef ELF_HWCAP3 +#define ELF_HWCAP3 COMPAT_ELF_HWCAP3 +#endif + +#ifdef COMPAT_ELF_HWCAP4 +#undef ELF_HWCAP4 +#define ELF_HWCAP4 COMPAT_ELF_HWCAP4 +#endif + #ifdef COMPAT_ARCH_DLINFO #undef ARCH_DLINFO #define ARCH_DLINFO COMPAT_ARCH_DLINFO