From patchwork Mon Dec 9 07:20:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 13899001 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A772AE77173 for ; Mon, 9 Dec 2024 07:24:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=F7AL4BcXa+HmHafwP1jO8SG1fRRg2L2Q13y4RXZu+3o=; b=UoLcQ7AmH3p7BFEqHoPU/90Fgn YzF/2tnew9zXgLrFvLMx2q0k5MrV9bCqbhBIvfPfCfRjqAgHUC5wc/7+SubQhrmeZ4YSuxeD6oFZN qEA8yoK6JaTyASfTuCrfW9CbEzEwykgcAQ5Uw7igLnW08maen5h00jSHuN7HZXZ0tT3cWQWj6gPbC 8zEM1Y6HQkmyilA3ALOFFOzP/ratXCZtHslXveSJkCY4xKquXNahWCsh6jT5MOuXZZpUyXEQYs8cX KOOluRUNrVEfpZPc7gSVN2jXAiyAAaix/gxNgpj4B9+qkL6cZQQSGP1ZQbxItmRKqt1G0txtH+3qo is1s9XYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tKY7j-00000006ikp-1x2j; Mon, 09 Dec 2024 07:24:07 +0000 Received: from mail-southcentralusazlp170110000.outbound.protection.outlook.com ([2a01:111:f403:c102::] helo=SA9PR02CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tKY4m-00000006huQ-0pLP for linux-arm-kernel@lists.infradead.org; Mon, 09 Dec 2024 07:21:05 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bh8f57Rv0YnLwB78STuNEbWVEezHd+boHjUCEX9SgFDvgrxPQYp92G1tOyTVnNRcYBJCdnX63dmdZlz7UhCH1ACWlP31+Q883gPYEne2lOjJyXyP/+mN8VKfuVDqd+K6g/N079uu4oYVrBwjZuhra9/9NRez4LuOFHichUFjvBnEt420vQp1DIgvnLSvmLyBsOkz7Kw6MIOwm/l0HeXxvoqdxD1mmUzYg52U8dPE6j+ZSIP5Ydoi7XR+G1biHUWP/d4svOEnDjw4eiYkbQfWnmHY5MGdir9bBt3nhzzYATU33nPxJA+9N+Gp9iW9a5LQz+VzvzBhySy6kVqtxDsS7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F7AL4BcXa+HmHafwP1jO8SG1fRRg2L2Q13y4RXZu+3o=; b=DNfCcYCMNhE1P9SNC36NpQUEHESEB8jXnV/EguIMo+jUTL1kzcs9Pdip2mR9z/O8Uvfpv3CYKIX4SSIBeAkkzyLLmA/1HUtqdBGpYeQ8pv93mOcefJyRpjW+xeSl3HMIoDI4DFWAw7QBOpxCiwQf8NIRrX2BfGUWoaVXqmxvzG8roquOXDfaeqx+XaaMpkY88QZTLPGZ3fcNuuSYVaZP7bD+YVyzIJmjXF6JxKk7QEviDb5wfKCn/3Aamut3KtCv+VkH+5t8AuADwHLoP9a7Zl9HPaSbpFmWQN8rzN39tjLklVsyHQER4gTTw5lQwBLEA6Q+xcmkX5oNVcjxL0GP2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F7AL4BcXa+HmHafwP1jO8SG1fRRg2L2Q13y4RXZu+3o=; b=pF+pjtglaaa8U7M6yY2jbHyyed1C2mkocCUehec0wpfxkcyxNGiqmrgODOcLV0X6/gbQDl+NgRhwVg/DzAsRJGRK2SI++/K/H1NA/GjSMht3VClIr5KJj+1G48sUDvRpcJ/7L2vnzRYXLKsVXWTBh3mxsUbi1KMw8EgfxZ1h5Tg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) by MN0PR01MB7876.prod.exchangelabs.com (2603:10b6:208:383::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.12; Mon, 9 Dec 2024 07:20:58 +0000 Received: from PH0PR01MB7975.prod.exchangelabs.com ([fe80::6926:a627:118e:8050]) by PH0PR01MB7975.prod.exchangelabs.com ([fe80::6926:a627:118e:8050%3]) with mapi id 15.20.8251.008; Mon, 9 Dec 2024 07:20:58 +0000 From: Huang Shijie To: catalin.marinas@arm.com, will@kernel.org, anshuman.khandual@arm.com, corbet@lwn.net Cc: patches@amperecomputing.com, cl@linux.com, akpm@linux-foundation.org, thuth@redhat.com, rostedt@goodmis.org, xiongwei.song@windriver.com, ardb@kernel.org, inux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Huang Shijie Subject: [PATCH v3 2/2] arm64: remove CONFIG_RODATA_FULL_DEFAULT_ENABLED Date: Mon, 9 Dec 2024 15:20:20 +0800 Message-Id: <20241209072020.4743-3-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241209072020.4743-1-shijie@os.amperecomputing.com> References: <20241209072020.4743-1-shijie@os.amperecomputing.com> X-ClientProxiedBy: SI1PR02CA0005.apcprd02.prod.outlook.com (2603:1096:4:1f7::13) To PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7975:EE_|MN0PR01MB7876:EE_ X-MS-Office365-Filtering-Correlation-Id: b398abf3-6905-4243-118b-08dd1822072a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: 2O8uvrOx873GhmjM9I3AVL3xLoT/8U11kEE+MkWL1fcbxdFuCod1V9/g4XKP1QSJ11LN/aQyrxDmoEfNKwfjvF39s82GWMtGyye2ICf2x2IjD05KSAVtg/RfJtCzF/g/PDd6oWA765Ul1JOw2YMI705eTV8IzCxOrmc//jmU6qEnhJgW9hxUuLLC5l6z6QrXBFxiGDcTJKM+uqeQCy78v6adlZKSv6gCO4+Eg6A8pZghhGTZwjzlnPJ96EbdpGIzjHz73XFC6Dm64vsyBaYcKzPcpSnMq8s+X/eqwQJoQG+9EN3IwlWHKNcF2SFXtJr3n9I/vGu65Egz9ZssFScZQ2oWmEK6y/3uw0rE36RyWmIMLg7I2AHyZrslkPOQf54Uv8DT4rBDEHnr8cQGicfjjcq4wVoXsrZDsQOCiYEUifBgvVqlh4mWciWSRg7WR81d1zxY3lmx05YsoqUI4J9AZW44fGFmMd5ww/y1HjX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014)(7416014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YB7YLhgy+i4Rtv4MF7Bgg27RxBjRkQkeUOHwTQHAMBNWcSLEWHxLShZqxYrhLnf2Bj4wAYmOm3/Tg36qTc/w9OUaNZx3OhPjgz8XHD4MGiLyAbnaAPY2w6BeheBAXWgxFHU0BmK9TJ+qQbiVPVcLMj8FGv0uk5kqsf630XB8933n8Jg0S42VVxWvydS7tR5WnRK86rpG80Z5Th7NasFOAvajXYgBLdZdYF+eF3EiYb8YjzDCPBWHXTi4u7MsQBDj014i1DFl4wOvgK8I2hJStASXHClmEXoVim44Ytz/83KdUZT/K+OuduCDCQdBIpYT2MWOJKIOI1pnW5jlqRu9tHNV9cSNciM51y3nqt+k3Ohv4RHmPX0FYiW5mEIaUE0b5RLvYfqmHvpJRNKxcMGoeKaW66LfRbjdmNSXQsockmYeSKnOS/nHsiEnhdRs+0CINxwV8GrRJ8+ZEEpvGIN2RP0DZKzKwMa3iYHVGFUi3FZJk3+snl8oIgPvw/yWb6MY7WUtxoL4b/uVsrmKxDfEF94Idl5I+VdV/XNfgj/V1SHAYaVLeZHJvvaswXl4eIuHo2m/F5u3kbDuoWs8LDm0QyDEekg0AKImKYO2wPACupgfLXxBcL8KXWo7uSFoLNVWcun6+41hThKCdlMmu6QPTSl0nh3hDg3yDAAnEsy7MnJgaaapms8MMt3wZIfE4LRtFpbnNkSY07w98uCntjS5eRXo9SuRbovnESA1vOzGcxPjAwWvEljrr0+Q8Gsb5f2AH9HSMLVW5tgGDm0OhdwT/PdJKSYBRjqqNluWQfJ7USIzU1SaRU6fJAbLtmB2jpkgk07BXiT+d3wAuHbtJVSzwLg3So0jLg0oxLEw1I2YykImmyQBe+zVpE3PnLmY0WN07Yh3ljXsfnP9Qo+My2dZGt8z+MNHVup/VZ6TPrqKtWoYBjccwxY+PzPtBbqHb6BkNGun9vxtB2C3M5BTYqefs+poxjj9Zg8Wi8Er93bOQfqo/xnTdAQDCv/6CZmto9xs0b3xeLq66A8zg5Y3VZ5DKamWt9AudESQn30T3rw4mUbsNhWIeQnRbavcMOGP9exeGNKRyGWO+v5KlqI7cIB8r6iJUo38PCaINzfM9bRigN3gflt1lzdikgQKrQLwpq/+3S4aMIq+BPibuGSGsqOXETEBJiPUBfjflZlJmuxJ38viQGA12PL5W0EsoAFqZ+rmo1A4qPHCqJJXaKPYlRZAnhIXscCi2gJGJmmMkAUjkUpnD2LONHomRTR3bJELPShoe9QaSuxzUW8TMWHVeTT4wy+JCnroNFX1VCYZYNO/rLOYFu1Wb8tDy6KlvF9jYs1GPDKjYhNkcrrsRUFwUmQCpRuNTs7RYCAFvvlpN1/yA9DMY9d+Bf2sv17EPQgJblDSqOu7RDizRP3ElXI608s+upPm1KKmlJn3+TE+ZguIMZ48hxnJ71vcMpGhHmoXVDC10JIyLZ0Z44njRSELs0n3HOEiV88e8Jp4E4oZWzoswupzwOpgVx4gKX8Ggvc5hxvwi97GknLhuaezeO7jeToCt/x320zIc7lIqJkFWJNnQi7ZPKppxBesK3tyHcGUt1+b25O79ah4HgezoBYEKruG20sLjS2LKmhWiOmMA5vhfDQ= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: b398abf3-6905-4243-118b-08dd1822072a X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7975.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2024 07:20:58.8408 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y/9yszKILYt9cpDTlDxw7izD+kBQb79fP9DrsscwFB61cFo0Ypy/4sDqUOYAqfibciX5V+bW6rP5xTbghEWny5jJZOl/1G4jPZPeQRV5lz23NArIcc1aPJwanoMBlu5x X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR01MB7876 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241208_232104_268748_33774DAB X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org After patch "arm64: refacotr the rodata=xxx", the "rodata=on" becomes the default. ...................................... if (!strcmp(arg, "on")) { rodata_enabled = rodata_full = true; return true; } ...................................... The rodata_full is always "true" via "rodata=on" and does not depend on the config RODATA_FULL_DEFAULT_ENABLED anymore, so it can be dropped. Signed-off-by: Huang Shijie Reviewed-by: Anshuman Khandual --- arch/arm64/Kconfig | 14 -------------- arch/arm64/mm/pageattr.c | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index cbfd357f94a6..1c69982302ed 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1666,20 +1666,6 @@ config MITIGATE_SPECTRE_BRANCH_HISTORY When taking an exception from user-space, a sequence of branches or a firmware call overwrites the branch history. -config RODATA_FULL_DEFAULT_ENABLED - bool "Apply r/o permissions of VM areas also to their linear aliases" - default y - help - Apply read-only attributes of VM areas to the linear alias of - the backing pages as well. This prevents code or read-only data - from being modified (inadvertently or intentionally) via another - mapping of the same memory page. This additional enhancement can - be turned off at runtime by passing rodata=[off|on] (and turned on - with rodata=full if this option is set to 'n') - - This requires the linear region to be mapped down to pages, - which may adversely affect performance in some cases. - config ARM64_SW_TTBR0_PAN bool "Emulate Privileged Access Never using TTBR0_EL1 switching" depends on !KCSAN diff --git a/arch/arm64/mm/pageattr.c b/arch/arm64/mm/pageattr.c index 39fd1f7ff02a..6eef08d8451e 100644 --- a/arch/arm64/mm/pageattr.c +++ b/arch/arm64/mm/pageattr.c @@ -20,7 +20,7 @@ struct page_change_data { pgprot_t clear_mask; }; -bool rodata_full __ro_after_init = IS_ENABLED(CONFIG_RODATA_FULL_DEFAULT_ENABLED); +bool rodata_full __ro_after_init = true; bool can_set_direct_map(void) {