From patchwork Thu Dec 12 08:24:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 13904809 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 E74B4E7717F for ; Thu, 12 Dec 2024 08:31:45 +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=XfqUDAc1HGc/Eow5ifXnv2NhPtfud4Qk9exkzZ64iME=; b=uUfQTKiWCpISvOBXKU8hIGEYlp hVLNHvd0ImOsS10x/xbxk5KdW10e8UM+afh5fyJmwKspXdunhd4iG/J3oLal/FBGNmQN0xWDMxV/q l2m8ziyOdkS2j1Ijx1Q2swiHV0ssqAAKW4K7UkV/i4igP6XkVyOxn5Sy1OrNbMuTkjadV95Ua7j// /YXrtw8XFitBcPP9dyMvq+COy22rPRHPDtb0zOEY23pfjIb/mmF9APL3ntiHhQla0QvzcFCkTjRoL Qy9NHAn49xyM7/cZrr0fqPVILX/LSaqyV/6bi5XsZ/hKzv7m3fgF87Tv0fL0gBFtJRm7WVRxXrpbQ 9p++09Qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tLebc-0000000HJPC-3xIj; Thu, 12 Dec 2024 08:31:32 +0000 Received: from mail-northcentralusazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c105::7] helo=CH4PR04CU002.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tLeVZ-0000000HI68-24LG for linux-arm-kernel@lists.infradead.org; Thu, 12 Dec 2024 08:25:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GGsH1UXIRAuJ5l7f3fT81p3FgIkN+64eddyzpL0xHmQUSRNtdqdugSwuDmuI35nXl9HRYPb+HsvwTYAT+cyneYNVZoWzVG8BzTYcRkjvF+VS+dK4XyO7M4umOInsXG59hVbgfiY+dBBiJYTV92cqW44bK/trVTrGGVYpwnlXO6b8s/YfhlKZVEEEdF1tYjdK17mIWHK+B7yHsdiVHM6uh4ozvH2muq6G9N0Ks4ntt/NJb74xuWhUl59gM/pWwZ5jNXZMrYeD8UE2EcUC+JpjIYiOILja8afUM2bhWwWXHirXWYsgBG6awV8XIgbcVaugTi2NJQHdpu956+eIBRKJhA== 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=XfqUDAc1HGc/Eow5ifXnv2NhPtfud4Qk9exkzZ64iME=; b=KvEncNWcY1K3xlvqiPJf55ls5YOcDETmWRl9Y9BQO5nLYoHQ6sXNsvUnOMp/rZEhPOpwdubVDxxZKoLjWtiP41alIaEnfysMfD4+RIoGkipsZTE/kfyMZiIbpLqFCnb0wOZmAYGtZ87eYZU1BlRjEhZDvjhqSCpRbGc4M22wUhWBlc1pb6ZxNxKQI6WPN1ZknN5UDQBSwEMc9+NDIpQjwfUd/j4MyMZy6Q1CwBs52MYV4UUv/lLi9TBNVb6TOGIvDvvn14oNpL7dVu5Tg2o31Dc/4EdYAnb/7ardSnmTux7du1JQVEr/wKkYrDFG62SdTHbWqVityalqAu5LVAB0TA== 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=XfqUDAc1HGc/Eow5ifXnv2NhPtfud4Qk9exkzZ64iME=; b=jnhFMmz0G1/O7NUJOQiSZ3ph6JVLXnIsZcQSu78AoG3I2tusEVHT4VUFufwIGscEFugdb1O1iZxKGecsMOIYuZuk4rkfktp3ZCmVn07AGSTiAfkpwwWYtI7bCwkdjV3nbqaiid2PIoGhp1wOQazDmoGtjVzdxAjHqG9EivmqCbM= 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 SJ2PR01MB8459.prod.exchangelabs.com (2603:10b6:a03:557::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.15; Thu, 12 Dec 2024 08:25:12 +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; Thu, 12 Dec 2024 08:25:12 +0000 From: Huang Shijie To: catalin.marinas@arm.com, will@kernel.org, anshuman.khandual@arm.com, corbet@lwn.net, ardb@kernel.org Cc: patches@amperecomputing.com, cl@linux.com, akpm@linux-foundation.org, thuth@redhat.com, rostedt@goodmis.org, xiongwei.song@windriver.com, inux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Huang Shijie Subject: [PATCH v4 2/2] arm64/Kconfig: Remove CONFIG_RODATA_FULL_DEFAULT_ENABLED Date: Thu, 12 Dec 2024 16:24:26 +0800 Message-Id: <20241212082426.4110-3-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241212082426.4110-1-shijie@os.amperecomputing.com> References: <20241212082426.4110-1-shijie@os.amperecomputing.com> X-ClientProxiedBy: MA0P287CA0003.INDP287.PROD.OUTLOOK.COM (2603:1096:a01:d9::20) To PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7975:EE_|SJ2PR01MB8459:EE_ X-MS-Office365-Filtering-Correlation-Id: 71129ff4-1382-4c30-3935-08dd1a867f10 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|376014|7416014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: 1uXJIaoDRgzZYj0WS91JiQAi+JgxfVb+8BfLZnsk7pHTAB0ut8KzjfkIr1ASaLwy6vKmuCv6RQX9TkousMiuTTDI3ASUYvZPQrq/h3+252UCmTJPZmYbl/1ZNdUAxuRENbCALt7VzS5cFlGzXOIi8d52Ll+CR308k4jAbcbOQZbKzm/n8AGsiQ8DYu/DI1UzI0bI/JrUqqdhd3kf+P21R/bmv+g183k0NhpNXoZFIJzkxyVnt4Y+oIxRRsfQsjv1Nw/KsgoEQxoBwHJ4ED5wlEFCXCBrMuD6/CTR6KcxcDNlbqQCoj3B3vZzpyqOqc4iy+XTbw/Wq6leMIVSaH6X7U+lIQgseeZ70BtITzLnXSqKPvgdqvbBbAtfKPc/svxTN/6gsNvo01/s/aVVk0Kaprl+/RI1U78PvMImyHhwKxZPLy1mRMT3ivsAUIOL5axR7IOv6Wvkq3JYIrNLiIQnn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cSDuZYLrIj/aFuSq1DEv7tcSVyV/uvvhetwpNYjcZwNjjteZa8GtUf5KsQ0pBJixPcpFYctHUwbnwmHK+7n+bBwGI39kwvXSpoBYsCcJyh0nLrbkbTRa7yiwarEHuS6qYulbxUwuHpW4KNNhTiBs/TJVsrrTDLk9P6p/svD4J+9ZMn7Q4pI0rwtglQ7+Bkh1JGHeknKezgPVkwXUEhPBkGC47aefHOSv4j0sxQMwYBwP9iaDoknAOZ3DzPkWAunMfa0/BoXnthdxv4FQCFl9TKG81/OypeyUH2eWR7N6rbDHuybaJVnL/GpzRc0wppUPtxpphG7fFl/pl5XjcNbN248r4HsY23S75L2ja21K7y7JwADm29M3rViUhkcqnH2kgZMuOLPO4z+Z4De0+qpCwJ/jhtpZL+zQxkj+cUkizKhDP0nEUvi6f7u3KCUQYEhWLF+r3qRzk6I9KiSE8fMvbeiqti29PDMqQiMBOUaqsDS6wn1oAxpWS30tnHmAdQtPe/1jmOFmdE9ar1+dYVRnaZc+aSIyipAnIQktECfpc2kZMkOi1YcjUFKgphz0UJ41b8iLLYy29L1XUZS278VQ7zl9zrw7KzMF9W/6Q/3Uk7DHgZ50wYHn8tOUUq4YIuNEOPjQtqpJGCv1cwKtmJqUHwDlJJKZXemSdR9i9dmo= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 71129ff4-1382-4c30-3935-08dd1a867f10 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7975.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2024 08:25:12.0245 (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: lh9v6/NwlOSillLrEbk90EtPFavjB0s6WRVTgrmfJ10KFW9mgz2oOZz9RS6xWVQUVOR4tuSbrIwtCPhmj888NqUjnQdMLKGGHItSa4X7zCXzVxK48OaEDI4jR01o0Rk5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8459 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241212_002517_530872_3278A3AE X-CRM114-Status: GOOD ( 11.45 ) 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. Reviewed-by: Anshuman Khandual Signed-off-by: Huang Shijie --- 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) {