From patchwork Tue Nov 26 08:56:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 13885588 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 1EE61D3B7CA for ; Tue, 26 Nov 2024 09:02: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=KpjpmnTwu+M/9cfXmJeLGgllmPeWVSxYr07gRU47qW0=; b=jHpGSovv6XQP0o6Sx25dN6jcFn kYFoU69IuAJqohcF56y9qTl+BRKwaNEogqsGqnK8YxsZWUkhmiuoTpuEzAtxJMvrRcEHx4qh0F1io 8Bqo1oAzbpf4wfhpKg5W5zjpexJUv1X/bSzP06R93yAodtBjN631mKEUmrelT1OKQmkq+tYfQo1os 4wDsE0Q9ZJjYBodnU62vwRu8L0J3jd2GEy2FtKL44uA2LJJZ+KlixP7S/NUkuB1LpFaU4moVazyZK QUYLpFMIsDOv4eESnwshqFvC3ecgNkqbXiRtGnI390q3jwMR2wfpanxHMF5V2ovT3X20OGIV4+Ne3 HjTkzgdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tFrSk-0000000A27z-1Q28; Tue, 26 Nov 2024 09:02:26 +0000 Received: from mail-westcentralusazlp170100000.outbound.protection.outlook.com ([2a01:111:f403:c112::] helo=CY4PR05CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tFrOe-0000000A1IG-375i for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2024 08:58:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DLIB9o2MobmfUdDf1wFno8QU2qszPjoUe0Gz2RsuUt9Y7eC5hb+qJNZVIcAXACKxT+nLbJwusobBDrz6DjJ9sK1SlO9S1EUmc3ot1/T4kIrWbxJ+yM4R1MYMR8046KpX3+rl7GXDtvryNqJT2rXbjj10PkSLmYCUH9H8Klpzro1V5NDkOAUzGr8fkMkSHisxfAFMAs/9HgNByrlKKh9ELttTS6unKFZqYFBhJJ6er2TCnZOIZI5HYrETNL6X47rWkQKuETnmGgqK5clxYUrEhf2btElpTr65VTsRJl23qLawoIAcDOUl3j7/jNj7MbqlxLNVV2Z/XkAOXSAT+YQNpA== 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=KpjpmnTwu+M/9cfXmJeLGgllmPeWVSxYr07gRU47qW0=; b=GZMyoqC3jwkpg/e/9TzXQIH4uFgteyw/2AIiZe94E/uFQkpWLTGAOUCGZvBl0PhQpaGM9P6Awb2AQKL8d8V2focG6u/ytgVqASwWOKdBWR0MMsGhbyMIqJrqP/dw/uzC0O4rpScf9suEIAXnFCbq17Ku32qw6FAbpTvS0YGZ6YCAREvESM+Wf3Tnd2o8F4dUId5VvE0vh5lIBj0y5uCS16kiX67KjBPJ1tdouZRGQFDLzyBQRlyznc8lvt3PEZSHYMWuyjZ9GJL3e1jsCcJ4LgujHtKdLPL8SvUhaDdkQX8AEZX4Z0Sq2MTnJ6yg4GQrIta9TniyDgzp3Wq7iWzdSQ== 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=KpjpmnTwu+M/9cfXmJeLGgllmPeWVSxYr07gRU47qW0=; b=u6LStWG9Qohl4ivwLwgg4pWWyVB8I+aoB2dgb2QTo7noDnFgP7wi2FgOaQVxO9Fn+bk24MEZgk5eW7PiMCL4BA10c9/Ijtsud5yyitYdYokmUj9s9HDtIRl774n41BMKoSB5mKi3AMrPycm6MPTDhOHkE796MjRykulq78h+YgY= 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 DS7PR01MB7688.prod.exchangelabs.com (2603:10b6:8:7b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.11; Tue, 26 Nov 2024 08:58:07 +0000 Received: from PH0PR01MB7975.prod.exchangelabs.com ([fe80::6926:a627:118e:8050]) by PH0PR01MB7975.prod.exchangelabs.com ([fe80::6926:a627:118e:8050%4]) with mapi id 15.20.8207.010; Tue, 26 Nov 2024 08:58:07 +0000 From: Huang Shijie To: catalin.marinas@arm.com, will@kernel.org Cc: patches@amperecomputing.com, paulmck@kernel.org, akpm@linux-foundation.org, thuth@redhat.com, rostedt@goodmis.org, xiongwei.song@windriver.com, ardb@kernel.org, steven.price@arm.com, suzuki.poulose@arm.com, mark.rutland@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, cl@os.amperecomputing.com, Huang Shijie Subject: [PATCH v2 3/4] arm64: introduce rodata=noalias Date: Tue, 26 Nov 2024 16:56:46 +0800 Message-Id: <20241126085647.4993-4-shijie@os.amperecomputing.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20241126085647.4993-1-shijie@os.amperecomputing.com> References: <20241126085647.4993-1-shijie@os.amperecomputing.com> X-ClientProxiedBy: SI2PR01CA0004.apcprd01.prod.exchangelabs.com (2603:1096:4:191::22) To PH0PR01MB7975.prod.exchangelabs.com (2603:10b6:510:26d::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR01MB7975:EE_|DS7PR01MB7688:EE_ X-MS-Office365-Filtering-Correlation-Id: 5aa7ff68-7d43-4994-aef4-08dd0df871d2 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: TEFKcpOHtg5z5zefOYJTlvAR0QnjID3Rue1zZ7fE/h8D7H3B3aLPPSdOzKE9QITpfmPqQq/XW4CGmj5D234iK1AKEzt0RP8P46fRUKi9/W0snP2WlubaxaESxx463rM+Z72XKsCStYw/etG1+cdGj2e9wRDgt7Z57lhFpkiIi+FtmMTBa96a1hPKW6MS8iARiOJGBXPzwC55P3i+KfVb89Nz5ocGSSIrtf6Dafdqx65feITpeGisikZEypt7X5Vc+nH684NnOEHWz61nVkiDW0A1eL0vjqnE6DUt1AXthe8YKKw0fbZpHKfZH9Dz2h9NodvDUaGcDuXM+ZWMp10OIw+sKFf5CF5i6MsRpxXM50t4BR3KN5y3cRWG8NI7i2KX9jejNNrVi0kCcGf/0a7acrynKQFryQIZVdEfdS2vhIip4yK7VfNbHAjo07ei/lpl1PBzGPI9WYBv7a2A66g0oQ2kZyQB4oKcXR7JW97sE+DSkIlRYPJQjFurM/luwTBAGsGzdrJsQYAQrkJcjiFFNfbwQGW7n4XImItF/zNrlMc/fA2wy7+pCfX6vMpjAvbBlnCiRArhZDj4hWk5eBJZLk7PUW15A9rdOj1pbMvj6EezIVS6okTwR3kGYQukjDpB4n1wSLQuxtylWz7pTDPJdXlW5X8BDYfPdEbSNQrNbtXplhokWHXmxhySNWPOvrdRkL7RCv9zcH/pUSdlCyTx3aDApRRW827qSdt/AdI5UgAfl39onIa29LmbPPHw7AEb9CvLLG1NF4zSSz+RGmnmVxlbaINPzc8hmoVlHCpxkopo8Zf2DVsCSacStqxcyElo2dsmGplUZD+sStOpJbkTIolSGkwTKN43K6fOSAfTGb4CWDiV6SO4Ag+5YIB+Cz1k/hRNk2v6yOHIL8sJmO863/UzkpuK/aVWNt7vXlE8rY2DqfRHDAwtl+rEa4XxJi1lNx1LZyi0yApj4XFmASqsuUF328oTjrDPwoxv3EhGl/mNZtwb/Kt07Mc5R+rko1MExcSGAx9U/e3kHQY11DpIKEno+BFWemOl4UWSD68A2jtWPkzcauf9c4jwLltdOW258jq2UKKHx3Sg99bvOlF1VtI4CE5MnqKhFhUibTnMBLqucS5Vbj2/fsCelxN7polFoAzKMfiYcdW+9PCgmI+VSTOwEQC3SJbplJBePcL45hXE7PgDw3P5e9oZdO4iisKqSVHOeknayUJd+eZvy+g0GWK82vlMzf0ar11jjGzStUyoz82ptbqdN4xs96OpPI9dBmT/IG0UaS5QT+Kz5LxKOlNrtA4fYPjywTN93jssIXdQIPTOxQKadgi+Zq+zlvkHofZ+XdnITsO+L6qMNiw5PK71fPXvMgYFOk2GJ93h82Vv72UGaF6NpIt+hgq9IdiThNes+EAH1VZ3XmANv4GSnA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7975.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(38350700014);DI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tXIUCJbQL119oxN7rGdUFxtPLDS4pT2eLGhEnJYTqCwG+5UDX9zXQ3S7n1M8w9UwH2SnaPOvq49X2a22JTv452rcZ5BCCnAxxjFvj1VPM3/SCqfKKLDrsZUp41LaA4/stR36cpST1tHjOdZ2PlBE0jf0V4CskYkdpXhGHVH7GdjwsqldZYshpHDicKCnkK522d9261U9EV0HYAlTWaNyZUwX/wm+Er3Bai+sU+wr900Y56UWztE7OrNZOsNDNrq/66OcM60BohaNbqavANZclerS9uQYCOvqEZMoH80FMXfsFw7yoSogMfvy5uAw6UHyUjA8T1i1ZkW26qeY2lhKmh5yPdFt1zeLArgxwZNFRiTegXnYy+AyMVn4N1+gKuOJ1hsiJg8y5SWaQFmgjQOzC2z+goYJrt+jLYdOznlSOhjtVWniNn4RSWQsJOWbunaTsvwPHRjrNNB+ogG3BXBzYB/Gfzu+j7xNO6BV3DZmV6VJ143bh0wOr04BKYaMmnLSG11I23vNe0w8xoMnLDNDcIxd+6jnGO0FUrild5C/kh6kNSBDVYZiv9+qwsD1g68fN3bMcE40QFULuvuLD1Dg+KbFzKO9hiDCCTLQQiXA8bcr0+VbAhwnI= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5aa7ff68-7d43-4994-aef4-08dd0df871d2 X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7975.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Nov 2024 08:58:07.3034 (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: 5hwbCM6zqsWfqAXWnAMWjLaolP1eKV2A4T3/7vnLnYF87TO1sZxK3BI00zkG1XEDGlS46TIg4ZltML2K6cNMLk5/p40djHXAxLrnrLIBJMQd+33RRTLjpdjSyiSdqgBE X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7688 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241126_005812_778190_146DBBA0 X-CRM114-Status: GOOD ( 11.50 ) 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 The rodata=noalias is the original rodata=on. The rodata=noalias can provide us more block mappings and contiguous hits to map the linear region which minimize the TLB footprint. And the linear aliases of pages belonging to read-only mappings in vmalloc region are also marked as read-only. Also update kernel-parameters.txt for it: change "full" to "noalias" Signed-off-by: Huang Shijie --- Documentation/admin-guide/kernel-parameters.txt | 2 +- arch/arm64/include/asm/setup.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index dc663c0ca670..54b4df42e631 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -5894,7 +5894,7 @@ rodata= [KNL,EARLY] on Mark read-only kernel memory as read-only (default). off Leave read-only kernel memory writable for debugging. - full Mark read-only kernel memory and aliases as read-only + noalias Use more block mappings,may have better performance. [arm64] rockchip.usb_uart diff --git a/arch/arm64/include/asm/setup.h b/arch/arm64/include/asm/setup.h index 5ded3bd11476..3d96dde4d214 100644 --- a/arch/arm64/include/asm/setup.h +++ b/arch/arm64/include/asm/setup.h @@ -31,7 +31,7 @@ static inline bool arch_parse_debug_rodata(char *arg) return true; } - if (!strcmp(arg, "full")) { + if (!strcmp(arg, "noalias")) { rodata_enabled = true; rodata_full = false; return true;