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 4AB35C8303D for ; Fri, 4 Jul 2025 04:12:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E255E6B0104; Fri, 4 Jul 2025 00:11:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DFCE36B010B; Fri, 4 Jul 2025 00:11:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC4B26B0110; Fri, 4 Jul 2025 00:11:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id BB7B46B0104 for ; Fri, 4 Jul 2025 00:11:59 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 873A55F892 for ; Fri, 4 Jul 2025 04:11:57 +0000 (UTC) X-FDA: 83625259074.04.1941C39 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011033.outbound.protection.outlook.com [52.101.70.33]) by imf25.hostedemail.com (Postfix) with ESMTP id 72910A0007 for ; Fri, 4 Jul 2025 04:11:53 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=arm.com header.s=selector1 header.b="BlRd76/1"; dkim=pass header.d=arm.com header.s=selector1 header.b="BlRd76/1"; spf=pass (imf25.hostedemail.com: domain of Dev.Jain@arm.com designates 52.101.70.33 as permitted sender) smtp.mailfrom=Dev.Jain@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector10001:i=2") ARC-Authentication-Results: i=3; imf25.hostedemail.com; dkim=pass header.d=arm.com header.s=selector1 header.b="BlRd76/1"; dkim=pass header.d=arm.com header.s=selector1 header.b="BlRd76/1"; spf=pass (imf25.hostedemail.com: domain of Dev.Jain@arm.com designates 52.101.70.33 as permitted sender) smtp.mailfrom=Dev.Jain@arm.com; dmarc=pass (policy=none) header.from=arm.com; arc=pass ("microsoft.com:s=arcselector10001:i=2") ARC-Seal: i=3; s=arc-20220608; d=hostedemail.com; t=1751602313; a=rsa-sha256; cv=pass; b=UA+rBJN0lbyX9PvsfvyZuE62gtZ5KjG7IYx0XOBj4ZdBb8z2GxUp+cPx/aifNIli4OWabQ WFM+Hv+J+0FzJpmdJfTksDHX3UCvQR1kSc4b3Ox6gL4x4B5ESPynnmcpQIEes3x0E6/hEs quVLT6isubb9xxKZUk3RWA7oh0b30cE= ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1751602313; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rbtwEV2R59zjvcmyzVAmpyYit3HrNd3YtRizkBm2BF0=; b=dvY6Ux08ZhROvZTj8GoWf/6A9YAAxzUjRufj88erQLkCunpWYHa87y845rtLODtbZ7TsSX CxNgZkUjHutZTy7S0F+hVDvLhxDLMqjUCZEtakh2KGOcLlQlGI38okQ5gnpHlwdRfYxAvG /+4vBA33Um2CMuKneA+decJixVGeBEY= ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=AtDmW3T66DPgX+nr6J1g93sBMl/D4sCzJjHnB/j3FpedOtBA89lO2c50kksYsoNgKsfS4SmqhfoGCNsE/YkyPWXty2jAsZjshOkY/0wO8KGjTGihLZiZCLhCCUFPvKmNqm03DLu6SnQbaplBvoqRVuP2NLySC+qu8rMwrxBsiNNKXIsfELIIEBGzI57y4YLBMG4PhMgsVA/WY4ZJpXC+UkVjntq5Ac9fJFwZoWUy7gqDWgeM6SRCq6jdcSn+Oky1eRvve8Lu/n2ocaYIDM8VS/0GHrTXdhQFJO7AEpnqB7MMgy9b3nx9dEmaVH/1qyWqe+dauK89Qyk43Zkg6i7Q2Q== ARC-Message-Signature: i=2; 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=rbtwEV2R59zjvcmyzVAmpyYit3HrNd3YtRizkBm2BF0=; b=q4y17CPhqvfiFSgJ46sPuyGJQQTKM/GubdZetJmvRUE4lOeBP2zBt82WO3AzUF7cnKY+m8holWawuj0VeY/EyyptbxY5wQI8QqbKz1EuS8h4boumWSVQz9vggyPfNztA/oT/u6sGSdccZ/SdEMvmqW1Qx/Y26E9YE3By8xGBNxDAdjCEapkDt9GLDKzMPWtQjN3XfZEMtPncNqTa8rDgYN0Zkhe6QdgZWubxAmVeD4cRhuzASdoGWi0+LHVMqJKhFGBp0gmjG+jKBxPmnnPLv1qF9W9+FR8ax/NDiqzw1TXyhTKKCDYCSMkQ8poqF/RHbKk0sS0RdA2p1nklb+ZvsQ== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbtwEV2R59zjvcmyzVAmpyYit3HrNd3YtRizkBm2BF0=; b=BlRd76/1POOJN4cP4k14Ow3kLkviKFxh9v6+dCchEum8b5DlSn8gXZlfpe4V3ooCN+zG8a/6IY+LnyPGif2WLETrK6m8ugSOrfdgaZLP/b3bAB1q7t1SBkmrFEQLrSdNsDI8Z/6NOv6vPNiu268TD1foj1fQ2QA2czav6dpdmWY= Received: from PA7P264CA0537.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:3db::20) by DB9PR08MB9755.eurprd08.prod.outlook.com (2603:10a6:10:460::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.22; Fri, 4 Jul 2025 04:11:48 +0000 Received: from AM4PEPF00025F9C.EURPRD83.prod.outlook.com (2603:10a6:102:3db:cafe::fe) by PA7P264CA0537.outlook.office365.com (2603:10a6:102:3db::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8901.23 via Frontend Transport; Fri, 4 Jul 2025 04:11:48 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by AM4PEPF00025F9C.mail.protection.outlook.com (10.167.16.11) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8922.1 via Frontend Transport; Fri, 4 Jul 2025 04:11:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EuhKkkXEC86NokpvK7OAMmNKQzj0Uu2tfDTz+3pMttuJAay0rLCFjl5JlI8LrdbppPhxg849f5Oe8D9i3VEQ5U7iPYcO+J0Tga8g+36MJyb84kgulhw4mUtXTv9RZ1ICyfTgPJS272zwjd+M+o04NLp5bkDFPW39UGvPHvq9p7hN9/Zq6/076PxbPvdgFF8NbOaBEZTpWkV0atm5P/mgtS+BfqmdwOtSJiW6YhwlKNnvEgJ1yUOClKbnhHF0ACMhsV+bHsIjdLNUwbaVAm4zEw7qp7s92y6nLg4wDO8sjLXLe1l69yFGASkuMRPVGXA70qJz7y2bQD50FUZDBBo4CA== 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=rbtwEV2R59zjvcmyzVAmpyYit3HrNd3YtRizkBm2BF0=; b=ndSNtt0Z6Ft1+a/Hwz12QJr/9wXoCkxHBIEqCb02MV3VxuN0gKGPCB1oHqzHcYiWENQFonR88cxbaZTYyPgacEL6aoJEcg4F6Uk/WkNS+tuQDErRqW+iEklS/eLUux1jJRV9V/N97Uctq/bBbR7g/KvQbYOyM8M/rtfkH2a6rpfkv5G9qFY6JVVHsCAMQJHoUC8S04IVCNkVhKeM/jIQ61Q5MrLqlqwd7ACfZKc7+VnloCE1Sg5TnBrubL3tVvD8ygjTN4xG6zIp2n7P4SG8RC93NYLmftTAowpKRTHh3JEiaZKv+0VnMHDKeAA7r9RgK59uZBrx+Bpu+ibevukrPg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rbtwEV2R59zjvcmyzVAmpyYit3HrNd3YtRizkBm2BF0=; b=BlRd76/1POOJN4cP4k14Ow3kLkviKFxh9v6+dCchEum8b5DlSn8gXZlfpe4V3ooCN+zG8a/6IY+LnyPGif2WLETrK6m8ugSOrfdgaZLP/b3bAB1q7t1SBkmrFEQLrSdNsDI8Z/6NOv6vPNiu268TD1foj1fQ2QA2czav6dpdmWY= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AM9PR08MB7120.eurprd08.prod.outlook.com (2603:10a6:20b:3dc::22) by DU2PR08MB10186.eurprd08.prod.outlook.com (2603:10a6:10:46c::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8901.21; Fri, 4 Jul 2025 04:11:13 +0000 Received: from AM9PR08MB7120.eurprd08.prod.outlook.com ([fe80::2933:29aa:2693:d12e]) by AM9PR08MB7120.eurprd08.prod.outlook.com ([fe80::2933:29aa:2693:d12e%3]) with mapi id 15.20.8901.021; Fri, 4 Jul 2025 04:11:12 +0000 Content-Type: multipart/alternative; boundary="------------rpjoy5KudI7LPe2uZiFy0M50" Message-ID: Date: Fri, 4 Jul 2025 09:41:07 +0530 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] arm64: Enable permission change on arm64 kernel block mappings To: akpm@linux-foundation.org, david@redhat.com, catalin.marinas@arm.com, will@kernel.org Cc: lorenzo.stoakes@oracle.com, Liam.Howlett@oracle.com, vbabka@suse.cz, rppt@kernel.org, surenb@google.com, mhocko@suse.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, steven.price@arm.com, gshan@redhat.com, linux-arm-kernel@lists.infradead.org, yang@os.amperecomputing.com, ryan.roberts@arm.com, anshuman.khandual@arm.com References: <20250703151441.60325-1-dev.jain@arm.com> Content-Language: en-US From: Dev Jain In-Reply-To: <20250703151441.60325-1-dev.jain@arm.com> X-ClientProxiedBy: MA0PR01CA0079.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a01:ae::7) To AM9PR08MB7120.eurprd08.prod.outlook.com (2603:10a6:20b:3dc::22) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM9PR08MB7120:EE_|DU2PR08MB10186:EE_|AM4PEPF00025F9C:EE_|DB9PR08MB9755:EE_ X-MS-Office365-Filtering-Correlation-Id: e9902722-1c56-4936-90f4-08ddbab0e419 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|7416014|366016|1800799024|13003099007|8096899003; X-Microsoft-Antispam-Message-Info-Original: =?us-ascii?Q?u3eRRQYB/9UDI71CgFCDPrCxbsnxG/LDhjNR6O61wFi0GEMZZX+z8neg4iAy?= =?us-ascii?Q?LIfALSc+oMC9DnG2EvcDPnDwtMGc3Iri6g5eFJftoupn3fCUG57gOEe8vasr?= =?us-ascii?Q?xwgQC8MnrZwVkIwU8eoCVMZhkfo2difHxHHQy3t2KfzNV9nSnXdvkKtZ7Ce8?= =?us-ascii?Q?ILU10mW/u+w4QET5zuKoIK03uiLYA5m6+fYTKzxns/Pggjq6EfYo7KWDeYra?= =?us-ascii?Q?luj+iwnO3cTKXg6dmsJXomjNjRhAWAKGxbeeHgvt7O88g0jx1LmfI6AibOC7?= =?us-ascii?Q?HZ9Ryv+NF8IiSFNMbM/m09E/xV8elFfHFx7lZLflvOanK7joIcK2LXXiGy8F?= =?us-ascii?Q?4oimOFopZPESmU+u5eNWqMv8amFZkMiT5oFg1Sb4lUM5zULNRvTar6NWB6dD?= =?us-ascii?Q?yAdKoCUXh75GRqe27PegmiPHMAKOKp1NNw83xbg7wVDP4EIsotUDy3lPO1e8?= =?us-ascii?Q?6ZMQzXxixV0eONvoHdGQONtGTC0yioc01+oqPUG1VQqT4UHN/fvmKnn+mkc7?= =?us-ascii?Q?1KurJp/X8YEWacjHQ9sqjag4wA1I2FjTLwHOHRhATL3I7+VRHCpQhZ+xbxrK?= =?us-ascii?Q?O4VBDnXSpu1qkixI8H02yuhBLvb3/zO88WcAlCmKQazj9L86X1/xwNiZ504R?= =?us-ascii?Q?E4pnKFHpHDqU6HLBTa+N1dZdtB51A8gbv3fGYEXnXErpHBljadPqexRtOzQB?= =?us-ascii?Q?PhJ4C4/URFLuSeiE4a872fCeSmaXZHsXtGKhTmN9OFX3bPtqXwxM+Oko9UFI?= =?us-ascii?Q?PrfoJZyfTexdclk8w0zQxDbDlUfsQDDAtJHLN1IyGmAmQ6z1vTAUWeJXkB1J?= =?us-ascii?Q?M2ummAC1bF/qpuo7a53OqBaebovxiFUuK0BqLG9p1QdEX1n3ALXiMImh+lkC?= =?us-ascii?Q?Qcs2+Qrzj6ucGfRDvYxhvsk9gCPhzgw8rBfln5xl/XLaZkHhzUuXizOKTMUY?= =?us-ascii?Q?3xsCgBnUMP4Vkbkq3IA1/++nFSB+TVf5f6cvlbZ8aTlWzgsWxGq9zgeWJ3Z4?= =?us-ascii?Q?OVmMRkWCN+KS6aZEArLXDbS60x9BM56tebFTOTvdTZIY84NOSaYTp80EUutz?= =?us-ascii?Q?KL+qpNZO4I+FAqRISXeNXXQ+BKLmFUsnnqtmVGxp9PGV+rsIK0p4WLI8ksu9?= =?us-ascii?Q?zQLE92WW0LpsOJ0FDPxIQ6r7aul/OFxvmnICbAXPBmvde0RHVXVEddrVq8Lm?= =?us-ascii?Q?hxfhxw2VRhh6ctFcpPlnGyR+P8iletmhppwj5EYgEvARi/2b44957tDFcOp5?= =?us-ascii?Q?7QtAaAOe54mAjtYFSVPIyWCMVbQJfXzKxWx+LDDIwwS/teYz+AXyqGby98s7?= =?us-ascii?Q?shLUC+Burbosf9hck4z9BlE9VNcrFWfUfhW9gDojJPYSvd5mXAmnSMq5WxYT?= =?us-ascii?Q?8q1jwh055yaGyfLigMpLngZZ/HuBBnsMVXigLX+0y4+/vYm9o/1u+lUJnmGq?= =?us-ascii?Q?JgIxfv7CScE=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR08MB7120.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(7416014)(366016)(1800799024)(13003099007)(8096899003);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR08MB10186 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00025F9C.EURPRD83.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 65155ed0-1fce-485e-5244-08ddbab0d020 X-Microsoft-Antispam: BCL:0;ARA:13230040|14060799003|7416014|1800799024|376014|35042699022|36860700013|82310400026|8096899003|13003099007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?eEpUT0RLMTJ5QTJ1YVF1ZWllZWtDelBmLzBrWCsrOVpOQys4NmgrZDdnK3lJ?= =?utf-8?B?UHpQQnpXdEdtMi9GNlRZeW9rY29UcUkvQUdnblZkTzZrckhvWHdBQ2d2c3N4?= =?utf-8?B?NjNWb2l5TVd3eU9QbW0zUm9nbzZzS3pUSTQ2NjBHeDFZOHpMWDhpODlJQzRS?= =?utf-8?B?MzNRTTUvYkloSkRrdnVOamVLVTZGR2luSmtLVVFlb0w5VlhCWGtXZUs1RDJx?= =?utf-8?B?dFVBTG1Hd0tuWFR5cVAvcFpnMS9OR3R0RzZmSlRDd2Y4NFZKSVBsWUFqdWxT?= =?utf-8?B?am03Y2FrMVFsWFRrWkQ5OXlHcEVwNlJDQndSM0ZOTURzWGMzL2lNalhwWUd4?= =?utf-8?B?MEpQclJ2ZTRIRVFSNkZxeGNEcDJFVExEOE1PSkpLSnpOczJuQlFYT0xLVE1a?= =?utf-8?B?RmFNSEtTeDRzdjR3VzdnVHVKYzdKektPL2wxd2dGeStpQWsyU1E5V0Exc3Ew?= =?utf-8?B?TG12djhPZEs4azQ2b2dDNHZKMzFoUmRmNFY3QlJjcjdhRW1aTzJlYWtPSXg4?= =?utf-8?B?MzFhVVIzbWtqMm9CL21xbHNvMU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5EQ0RWYWRuU3UzUHpjSkdqaUlqOWk3QjhuSWlDRjU2Z1Fn?= =?utf-8?B?L3hsNklwc0hDSFBDWEJ6YXlXcHNxdFQzL211YlZmYkVHSkZubUgzbmYvc0tO?= =?utf-8?B?c3VMUlRCeXJ2NnBnY1pMVklSaS8rSXE2QktQbFRqSUtXUDh6VnRhUmFWUGlR?= =?utf-8?B?ZXQ4TmhkNHZUeCtTaVVhd2pvQllKZzRlNnU1cVhuSExnR2ttL3VRbm5wZXZB?= =?utf-8?B?bm9ET0xtaVVTekFRMjZtQmVrNVZqUVdVdExKRStlQWlOWnZWS3hqN2hxMXUy?= =?utf-8?B?ZFVmWjNyQU9iWGRpU0FpMGVIbGNVVklBbi9wYzFKNDQ5WnRvZmYrTXZmUWpI?= =?utf-8?B?WDV3Q2tyWXRwOVBLVHJQSWVkTVZkSVZseCtkalFvRHEvaVV3cTNFeFk3cmoz?= =?utf-8?B?QlliNkN5dkVDUHVwUW9FZldiUytiN05iQ1lpSjJIdi9vRE9SMTlBNU5xL1d6?= =?utf-8?B?YzZTYmphcnNDMEtqMC9TNWlpekYwU09NRjVSOEN0azFaeUxwZnk0MGh6Umht?= =?utf-8?B?bG9SSmd2K0pqY1AwemNQSjF6RmFERGVBNTBCRXBCYjZXNU1NRDdMcFUyT1Ey?= =?utf-8?B?b3BhSXZMcU9USEcwazArajM1WXhtaDlJU1dLZz09?= X-Forefront-Antispam-Report: CIP:4.158.2.129;CTRY:GB;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:outbound-uk1.az.dlp.m.darktrace.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(14060799003)(7416014)(1800799024)(376014)(35042699022)(36860700013)(82310400026)(8096899003)(13003099007);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2025 04:11:45.9390 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e9902722-1c56-4936-90f4-08ddbab0e419 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[4.158.2.129];Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: AM4PEPF00025F9C.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB9755 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 72910A0007 X-Stat-Signature: sdtf8q9g4ooobja34iwqqcu5xzcxjh3c X-Rspam-User: X-HE-Tag: 1751602313-658671 X-HE-Meta: U2FsdGVkX1/XdtCZtI1dkgtza7vtToTdjOKwPXydn9w3bCCsZUH9Q+JJlR6ML8oB9qbVtJzyrgY0fql6GDQDpdNnZ8fEDGC9DGRYGXYpSHwbQKQHR/Hu+7++jStie6kVQ+/E2gZmmNjLBszaYSqvC/8WZEiOYJFNtmsre/beCrHqSzhV+8/Hz4eHDzjlL2+Owm5cviv7SD7yH/ew7RHvpcW6ldXDHNwwnxqI3tXtjqJj96vJXkSm54p6nvK3ccbZoQi5fVFOj/Z/keZ3Tzm/DqFVrSKZJhRLwVbpsT24PIrLBqz3P+QgUluUFqVrNk61kezds8MM9MyRKNk9k7Y3ub4ddrlPCvlen1eWeZM1Gj+6iHw882J8CRkThDYmhgqRuwf2O31WwPhlS+V96lRHV440MwYo/tT0Hkz46oVy+oqnj8K64g0RbvCrULufROyf6292rhDubyYAoMw3kOzK3+QVts/oS21z+R7OChxNNoS30veUrQiBl4VbHcMTieb8TPRKVknWqmTtD1JV3lXs123f/nTl4rNGNvg9ut76JUF1I3fApQtqr8roAB/Bmon5kREKhM7fOjvgT/iiKCtXe6jY054d/r7sGcnB2dXzghcT7efPvqOXG3+qHs+tMi08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aDSvR78cT+gek98Nkr0uBV9kPHf+ii96JMxfRDzjXOtsE3q3MYSZEPKY+KiBgCAOXBsKnO7kOZ2wB1u5mO1x8c/aXHKU/Vn+a2hXucngxrgkk99RxEErlPR+aHO 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: --------------rpjoy5KudI7LPe2uZiFy0M50 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 03/07/25 8:44 pm, Dev Jain wrote: > This patch paves the path to enable huge mappings in vmalloc space and > linear map space by default on arm64. For this we must ensure that we can > handle any permission games on the kernel (init_mm) pagetable. Currently, > __change_memory_common() uses apply_to_page_range() which does not support > changing permissions for block mappings. We attempt to move away from this > by using the pagewalk API, similar to what riscv does right now; however, > it is the responsibility of the caller to ensure that we do not pass a > range overlapping a partial block mapping or cont mapping; in such a case, > the system must be able to support range splitting. > > This patch is tied with Yang Shi's attempt [1] at using huge mappings > in the linear mapping in case the system supports BBML2, in which case > we will be able to split the linear mapping if needed without > break-before-make. Thus, Yang's series, IIUC, will be one such user of my > patch; suppose we are changing permissions on a range of the linear map > backed by PMD-hugepages, then the sequence of operations should look > like the following: > > split_range(start) > split_range(end); > __change_memory_common(start, end); > > However, this patch can be used independently of Yang's; since currently > permission games are being played only on pte mappings (due to > apply_to_page_range not supporting otherwise), this patch provides the > mechanism for enabling huge mappings for various kernel mappings > like linear map and vmalloc. > > --------------------- > Implementation > --------------------- > > arm64 currently changes permissions on vmalloc objects locklessly, via > apply_to_page_range, whose limitation is to deny changing permissions for > block mappings. Therefore, we move away to use the generic pagewalk API, > thus paving the path for enabling huge mappings by default on kernel space > mappings, thus leading to more efficient TLB usage. However, the API > currently enforces the init_mm.mmap_lock to be held. To avoid the > unnecessary bottleneck of the mmap_lock for our usecase, this patch > extends this generic API to be used locklessly, so as to retain the > existing behaviour for changing permissions. Apart from this reason, it is > noted at [2] that KFENCE can manipulate kernel pgtable entries during > softirqs. It does this by calling set_memory_valid() -> __change_memory_common(). > This being a non-sleepable context, we cannot take the init_mm mmap lock. > > Add comments to highlight the conditions under which we can use the > lockless variant - no underlying VMA, and the user having exclusive control > over the range, thus guaranteeing no concurrent access. > > We require that the start and end of a given range do not partially overlap > block mappings, or cont mappings. Return -EINVAL in case a partial block > mapping is detected in any of the PGD/P4D/PUD/PMD levels; add a > corresponding comment in update_range_prot() to warn that eliminating > such a condition is the responsibility of the caller. > > Note that, the pte level callback may change permissions for a whole > contpte block, and that will be done one pte at a time, as opposed to > an atomic operation for the block mappings. This is fine as any access > will decode either the old or the new permission until the TLBI. > > apply_to_page_range() currently performs all pte level callbacks while in > lazy mmu mode. Since arm64 can optimize performance by batching barriers > when modifying kernel pgtables in lazy mmu mode, we would like to continue > to benefit from this optimisation. Unfortunately walk_kernel_page_table_range() > does not use lazy mmu mode. However, since the pagewalk framework is not > allocating any memory, we can safely bracket the whole operation inside > lazy mmu mode ourselves. Therefore, wrap the call to > walk_kernel_page_table_range() with the lazy MMU helpers. > > [1]https://lore.kernel.org/all/20250304222018.615808-1-yang@os.amperecomputing.com/ > [2]https://lore.kernel.org/linux-arm-kernel/89d0ad18-4772-4d8f-ae8a-7c48d26a927e@arm.com/ > > Signed-off-by: Dev Jain > --- > Forgot to carry: Reviewed-by: Ryan Roberts --------------rpjoy5KudI7LPe2uZiFy0M50 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 03/07/25 8:44 pm, Dev Jain wrote:
This patch paves the path to enable huge mappings in vmalloc space and
linear map space by default on arm64. For this we must ensure that we can
handle any permission games on the kernel (init_mm) pagetable. Currently,
__change_memory_common() uses apply_to_page_range() which does not support
changing permissions for block mappings. We attempt to move away from this
by using the pagewalk API, similar to what riscv does right now; however,
it is the responsibility of the caller to ensure that we do not pass a
range overlapping a partial block mapping or cont mapping; in such a case,
the system must be able to support range splitting.

This patch is tied with Yang Shi's attempt [1] at using huge mappings
in the linear mapping in case the system supports BBML2, in which case
we will be able to split the linear mapping if needed without
break-before-make. Thus, Yang's series, IIUC, will be one such user of my
patch; suppose we are changing permissions on a range of the linear map
backed by PMD-hugepages, then the sequence of operations should look
like the following:

split_range(start)
split_range(end);
__change_memory_common(start, end);

However, this patch can be used independently of Yang's; since currently
permission games are being played only on pte mappings (due to
apply_to_page_range not supporting otherwise), this patch provides the
mechanism for enabling huge mappings for various kernel mappings
like linear map and vmalloc.

---------------------
Implementation
---------------------

arm64 currently changes permissions on vmalloc objects locklessly, via
apply_to_page_range, whose limitation is to deny changing permissions for
block mappings. Therefore, we move away to use the generic pagewalk API,
thus paving the path for enabling huge mappings by default on kernel space
mappings, thus leading to more efficient TLB usage. However, the API
currently enforces the init_mm.mmap_lock to be held. To avoid the
unnecessary bottleneck of the mmap_lock for our usecase, this patch
extends this generic API to be used locklessly, so as to retain the
existing behaviour for changing permissions. Apart from this reason, it is
noted at [2] that KFENCE can manipulate kernel pgtable entries during
softirqs. It does this by calling set_memory_valid() -> __change_memory_common().
This being a non-sleepable context, we cannot take the init_mm mmap lock.

Add comments to highlight the conditions under which we can use the
lockless variant - no underlying VMA, and the user having exclusive control
over the range, thus guaranteeing no concurrent access.

We require that the start and end of a given range do not partially overlap
block mappings, or cont mappings. Return -EINVAL in case a partial block
mapping is detected in any of the PGD/P4D/PUD/PMD levels; add a
corresponding comment in update_range_prot() to warn that eliminating
such a condition is the responsibility of the caller.

Note that, the pte level callback may change permissions for a whole
contpte block, and that will be done one pte at a time, as opposed to
an atomic operation for the block mappings. This is fine as any access
will decode either the old or the new permission until the TLBI.

apply_to_page_range() currently performs all pte level callbacks while in
lazy mmu mode. Since arm64 can optimize performance by batching barriers
when modifying kernel pgtables in lazy mmu mode, we would like to continue
to benefit from this optimisation. Unfortunately walk_kernel_page_table_range()
does not use lazy mmu mode. However, since the pagewalk framework is not
allocating any memory, we can safely bracket the whole operation inside
lazy mmu mode ourselves. Therefore, wrap the call to
walk_kernel_page_table_range() with the lazy MMU helpers.

[1] https://lore.kernel.org/all/20250304222018.615808-1-yang@os.amperecomputing.com/
[2] https://lore.kernel.org/linux-arm-kernel/89d0ad18-4772-4d8f-ae8a-7c48d26a927e@arm.com/

Signed-off-by: Dev Jain <dev.jain@arm.com>
---


Forgot to carry:

Reviewed-by: Ryan Roberts <ryan.roberts@arm.com>



    
--------------rpjoy5KudI7LPe2uZiFy0M50--