From patchwork Fri Nov 15 12:40:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13876178 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 8E874D6DDF7 for ; Fri, 15 Nov 2024 12:40:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1FBD66B007B; Fri, 15 Nov 2024 07:40:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1AB486B0085; Fri, 15 Nov 2024 07:40:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F189C6B00A5; Fri, 15 Nov 2024 07:40:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id D397B6B00A3 for ; Fri, 15 Nov 2024 07:40:33 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 96607A168A for ; Fri, 15 Nov 2024 12:40:33 +0000 (UTC) X-FDA: 82788287526.29.57482A1 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf20.hostedemail.com (Postfix) with ESMTP id CC9BB1C0005 for ; Fri, 15 Nov 2024 12:39:33 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="dn/PEFfK"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kEMCULmx; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf20.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1731674366; a=rsa-sha256; cv=pass; b=EK2tZ/lZpDNYBzanpjcxv8n+ZK85+NDp1aTCt1CSpOWg5KpA5lc5VXvAiypmE4PGl7ywaj OSUvFYuLJQhQ6LjTeYT3ZNPai42oHkGA3AfrYMYHwsUmCZAgQDv1Xjpe2YpefdnEedYCEO /3rs5JPpqaBlLWnhLoPjaWtV+C5uR3o= ARC-Authentication-Results: i=2; imf20.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b="dn/PEFfK"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=kEMCULmx; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf20.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731674366; 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: references:dkim-signature; bh=haq9W/qmdoauko/ZzHiSrwOQZijUicsgozKzOLG9egM=; b=qVe9AcPSzzQZ0ywXV8ASSsO3OBkoqpQ+g+az1AK9akrbiacJM7xjKbSIgTyZlLT+XhOZku 1NsP0PnswWEQgAwqmw5YylNP6gr5YNR14cSzlXfcUhv6cr9aeqdDPFQkCtp5QngY87z9Jx DRe42KHhf0jVtWp1MtVZ4Y7piY9YrnY= Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AFAH0Dm014169; Fri, 15 Nov 2024 12:40:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=corp-2023-11-20; bh=haq9W/qmdoauko/Z zHiSrwOQZijUicsgozKzOLG9egM=; b=dn/PEFfKmdi0OFc1PDlCqUcArYfhnPfF EfxzmG+UVBcWw1D4lf/PRineqUIt5XqDcZrm+iZhLt9jAG9AtvI5A3/Rvt+/pjFZ IOBoXaE0bbyAfAdlgV3Q8O/Buc7d3zQ5Pa9Wmo6YY859YXHr9xjKb8i4kMPwQrhT +Wpod7AnM/Z6DyufZXDSbG3yPRMaHgf5+LW4MA82ceepO+s0ZkkEYcwvyOSlr18j m5aSclTMxd1lzgJBakDzFc8dwyuGz/n0njAXz5+suiuQCUhwbEBRBybKcAS7Rj9K Ps1RXEZcVxDoNJatZnj0GtgWzAedNMwA+jXlv7vKs6L5MheQ7ou2Xw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 42t0k5k5vs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 12:40:18 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4AFCaBKh025914; Fri, 15 Nov 2024 12:40:17 GMT Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2045.outbound.protection.outlook.com [104.47.55.45]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 42sx6c5sbn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 15 Nov 2024 12:40:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DFbctFxXha1FS4/QJtjo4FD+91wzZX6wERHO+UzXmU1eQuJBNqui1yeno83eOg04vSzta5dpcN090nrm8zfinY+U+8+8c5EK1aC77yNmoqDKVhPYOXyl88kuWS3TKeXFVOZe5Frqs/d4PD6HZ7j31IqkwmDGGFCpQ7LmePPPfMCmZi7aHYhJq7NQj17JAcfPcGbNDuS1A2t87W6uEX9zdUe4rbVdJdZAYndxtFDWSLK1bAmVBGa6eTDWz3i9SVP6w6BA5MsoUSvI5HRVIEY2Z1vIPbeOQWw4aADXHYkrzT+FHJPOPe6v60yYleRwEVRqwOAfCfBCM7bRSW3mBJz6dQ== 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=haq9W/qmdoauko/ZzHiSrwOQZijUicsgozKzOLG9egM=; b=YtdV+F6TpJUXn+eV97j4IkDuiE1sx5Blt7frVlgmtC73ortC5Y70+A8UTXxw4FcFGgTBLdScruqbTLgEJI6dH7lNHuAas5UwvycMRmvVrqQSFd//71MKdC9tTwCHYs+FZhHvcOH+mNQwvhhMBi+Iy/5TVvToV0CR+2XxQ9o2xh4IsbJxESD2tX3FAXQ8qQRTzK0adOW539xB9ui4tABfhcLW6IVBC1ubate8xcGTfqM/1eBYzoQF/T45CAxgyR9mWGeN+TkWu//kvc70KHVMR6+EX7gcBkP+WINp4WDsl00bV6iQWZsfuNuAjrkqPccpJpGsz0qCy0njMfg/xDm1Ag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=haq9W/qmdoauko/ZzHiSrwOQZijUicsgozKzOLG9egM=; b=kEMCULmxRWrED+QMeKbY2uzgpMpfGruiEdbdhEKp3InZklJAbmvNjBsgV60TH2KbDAp4w4NaCgynKvZI6ZcokvM/Prq2MkLYY/zr2ABsNS2CRAjI30UI01qudZXDyr4us5JDTOUr7AVS4Iw5uDLmxeHQx6YxYztbqRbxmUX5ROs= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by DM6PR10MB4201.namprd10.prod.outlook.com (2603:10b6:5:216::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8158.20; Fri, 15 Nov 2024 12:40:14 +0000 Received: from BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9]) by BYAPR10MB3366.namprd10.prod.outlook.com ([fe80::baf2:dff1:d471:1c9%7]) with mapi id 15.20.8137.027; Fri, 15 Nov 2024 12:40:14 +0000 From: Lorenzo Stoakes To: stable@vger.kernel.org Cc: Andrew Morton , "Liam R . Howlett" , Vlastimil Babka , Jann Horn , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Peter Xu , Catalin Marinas , Will Deacon , Mark Brown , "David S . Miller" , Andreas Larsson , "James E . J . Bottomley" , Helge Deller Subject: [PATCH 6.1.y 0/4] fix error handling in mmap_region() and refactor (hotfixes) Date: Fri, 15 Nov 2024 12:40:06 +0000 Message-ID: X-Mailer: git-send-email 2.47.0 X-ClientProxiedBy: LO4P302CA0018.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:2c1::14) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|DM6PR10MB4201:EE_ X-MS-Office365-Filtering-Correlation-Id: dd14eafa-db77-4b72-d0f7-08dd0572a6d6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: NmJt6aFXd56z3C/RzOF2Qlnoz6wj9KGCRYDOpERJmNJ7OiCM38Eck3h2e3TBbaQfesGEgcfmm9WYW2GezPTfh3tDSYAncSeg/AUtaLE13as+4ij+dHvLfcyhHYuFcD02IsqUxVKYlvq/FnSA4TZpR8EmUbINoLG9wSVSk1OkT7nqMASEPbJTH8OHFoQSGhqcrCMVpywO/olIwsH4OzQJ3uigVCUJRfg9nJlzLSHxLzNWCKUJVyWZffXwisV6OwdAKBQlRF4B1Cbr69OR061Ecr/DuEhvmXHnw70zBSZpi9DFChurIVo/bkpMQUGp74VtXEEfjwwCxa02c5qhQUG9BTmJ1HLuB/+GV7GxExSCUGYchvyV6eKiNzTO4++AbvOCj+/Fc8unS5850cb9luBF8m3d4lH9J/iVgP1hmdgD7hpqiV3ndzK9Gy/KBKZAcDISr2lBpbkh+zR2wDuYi4Po/zjYNc7C+1UOjSBHpD+JF/AJonFm7A/jppC+62rQX9jjf0V2x97k6ORRIVQAy516KOtopKzTQqk8t2HXUHTJe4F7I7VqngDXYZS4eWHF3KtA5ozSiSc6cbpDzbtsmdKkLrnJvAlTFp+Ptwu6UQ534uYiO/65ne8K5gyrV9yoSYeNhXiWVW+9n2wfvuxbTAAq2TCpOXq766bIN3dTa5B8CFgjXEmCg760wamU09cPKve4t/ZdnVdFnoPehjvHlTcc4Tt8uRQNftIEj3G15RzkTMecg1XXhmqSMqdzJnB1RL8x+KpKT6hpuEbz4LEU1R/3acaKMpRGUtzRPZWxpCEvMcZvaKzPdM+acJio09uK+CqdlizmXGRnbT51VRlOezL5IoRAeSGJiDKgCPh+qbAZ4zqnmGWNtGJT6ZSAu3MLNQ6t3MWUE42BzqTzK6IFLVsgaOKxDnvEqM+Cv52bsrXeCmGaec3yDdYVUrg/tYZbp8n9Su1bbdLk3gTX/tAtLvcGYyP8uzo6t4DQBg04iCxNqFxe2c6D6wcwJgA/+yPUJ0flV5LSiuaAvcWK+ikcVy0TYq6bbW9CQS7ldUZqNVyyNRv67lURA0yGpfAxMyc4nrLYMzGAhEhSbrrqx8xLKSm5OKoEoZ32jst0gqX4vvtsjVSYmqS/RXoBncoyH9M++x4ZJVF7UzjsT/PLaLf2ZhRHKq+ryxXMfIndYoAbm9uZAi274cYwrxx/orx5Q6IooNQDeiiaQteXqh4gxLGcgYaQ7pfhGRLadmNwKMTJZIQkHtCEezLWFGgHpooBo22ZDXXVbNjON+SUUJRXDK6P0/prkTMyz/9Zy9A/0/DIySTU8SyowJ03APeY128JVXmmDWR5 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR10MB3366.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6csd9WHQ7qgflYcMJQlaqHJKY0IS4gaQx7y5CU0Wfph5SWBNJqxfbeAFKOcOGI/Kcp0DlnF+1Mzo6ZndXOKys4j+AZywyukukv1lfgW6+O/MQpxvSwDJt9wAxl/qXS8wfMKKMcH0ZIFUlrAcslrvWS6NaGgEGoJ1ahgLG23BZGNDLVIBstpQtQMki1Tu6cxuDCrr7O8buzY+VNNNW9/nz3hbgRG7AEVmvkjf5TJp4CEk5g22oRXcs0OHjExkMesKm5fe5WS9JkMqf/b/evx48f0Cp7VOsdk6uM/maNwRMsT83DPip5j9UMAvkY3kASJBs0wIizIDLg/cQVX5Alfbi2pmnAApBg/WCu6drHUXxZ6sObM83aMiqdSd+hWO1tg/vUJOeAZjY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Nob69p9+mmu1i6M6yaKzYD/0U9bJI5s7dLZXL19tb0849Q4HA+l8/ZgyUFPmTbZSIHEtJCStSrFUgdCwWWj63Z7Qg/AhLIRw/aoWN/aMSsP9CWp5jCFlaNDuGtjbl7oby9vE42/TWvTQZokktRTRTvaN9w0ASFdfX0w== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 5DamxVBdZKx585ii3atzimgjGo5sQJaLlOXR4yIdii6dvStV4zPGwWoPZ7x9fM94GDcAyMFlI5YqPjCbNYdiW9uuVNmHV7tc8i1nJ1baO3BRE+BTRrHTWHa2eoD32Vy+9CvH/az0yWCqhsYkrgdDn81WnCnDcgiySZCZE5hEZzDle/LO3cBptsVAPLjBPeHoABkdEmtqSSupMkGRfB+Z0+arh8AKyTw/VeRvSzImJmwftS4hJqER5SEc9WE2VXNQqLFqrFrGvsAXIwsXg0K7y53SEjI+WTwxdjiicfG26/mR6Hbt5v3vB9ly6DS7RmiNFssv1bYK4un+jYWXNN8P242XFCwUrt2JkNUNaO7FtoFSIIs9jn9fgCQgAHSadvF8KfanQkoZuNr3W0lD8fvNPNlPv6+u/Iludd30otEtvw3oHWiGGYC802l9kvtHXBZ7ymPk8Saiz9iNOzJFo05IaHWMOilT6cVydMynKeVOEcmMPwbFcr8cHElRTiOBMaC51Lq+SpvZxgWTcsf4BC0KT4EPgK9kQv+OtSHiHeDJMEFBhaONipa2s8KDSm13TfPDtm/IL7k4mwQ6zYymLl9/Hd2qx3wNdiQyxVwbBsgdzWM= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd14eafa-db77-4b72-d0f7-08dd0572a6d6 X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Nov 2024 12:40:14.1170 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7x/IpRvNqg5FEFNxFBj7swT6L9MnjjaakodVbjM9ORChWEL2VagOKAp4IIqggX6fdedCuA6zvjymfzb7g7I2eHHF2sHtu7GtBmhAHGgM6m4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB4201 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-11-14_05,2024-11-14_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=548 adultscore=0 spamscore=0 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2409260000 definitions=main-2411150108 X-Proofpoint-ORIG-GUID: 4ViWLTU-hk6ONoPF0yBGG2YqjZOLkZf1 X-Proofpoint-GUID: 4ViWLTU-hk6ONoPF0yBGG2YqjZOLkZf1 X-Rspam-User: X-Rspamd-Queue-Id: CC9BB1C0005 X-Rspamd-Server: rspam01 X-Stat-Signature: kamag68odwe86in68pzwugqqjuokr74j X-HE-Tag: 1731674373-302792 X-HE-Meta: U2FsdGVkX19YQxHNw0TcvQP/US8hUbbS6d8YxhsJThWo8+dOxzC2H1+2Q+HThpPv4W6k/Q4EZxpXD5wMRGNlCYWX6bdxkR84kLB6cPniBfo64BWu3Nix8f0AKv0T9x9L9+8hoK6g3k4mGXCZyqxf1/ssnUBcIRUQ26+pE8KT7KWnkAGBrGcxEuoM2YXQyEfoTiciMvc1Z+yPAjFHfLX8izjwTHTCyp99Ker3l+83oLhlywhTpd5hdQWjooblBML7aaAK2zhR7UiiwtGqYpRBU85Hk+C9YEDtC5ZIIEbwN9V01O2oZ1LMNXxOK9516yIQtpN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3hDci4aFkGkGqnXtKqarWwSLf1QxhJvIjkUEI/cDvZkyE6PrM24ewaWpRtPhIzbXOM5/q4Kw7KAtX8Cvxn/SEG/uM/ohfyu2+eE/0R317ZWdeFu5HzetoYGwFR5wzavK/cd+mD6aZ5Zxwf9SDt4AiYM3WQjG7bbry25bQHrrXUM9X5BOvlnd7ibg= 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: Critical fixes for mmap_region(), backported to 6.1.y. Some notes on differences from upstream: * We do NOT take commit 0fb4a7ad270b ("mm: refactor map_deny_write_exec()"), as this refactors code only introduced in 6.2. * We make reference in "mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling" to parisc, but the referenced functionality does not exist in this kernel. * In this kernel is_shared_maywrite() does not exist and the code uses VM_SHARED to determine whether mapping_map_writable() / mapping_unmap_writable() should be invoked. This backport therefore follows suit. * The vma_dummy_vm_ops static global doesn't exist in this kernel, so we use a local static variable in mmap_file() and vma_close(). * Each version of these series is confronted by a slightly different mmap_region(), so we must adapt the change for each stable version. The approach remains the same throughout, however, and we correctly avoid closing the VMA part way through any __mmap_region() operation. * This version of the kernel uses mas_preallocate() rather than the vma_iter_prealloc() wrapper and mas_destroy() rather than the vma_iter_free() wrapper, however the logic of rearranging the positioning of these remains the same, as well as avoiding the iterator leak we previously had on some error paths. Lorenzo Stoakes (4): mm: avoid unsafe VMA hook invocation when error arises on mmap hook mm: unconditionally close VMAs on error mm: refactor arch_calc_vm_flag_bits() and arm64 MTE handling mm: resolve faulty mmap_region() error path behaviour arch/arm64/include/asm/mman.h | 10 ++- include/linux/mman.h | 7 +- mm/internal.h | 19 ++++++ mm/mmap.c | 119 ++++++++++++++++++---------------- mm/nommu.c | 9 ++- mm/shmem.c | 3 - mm/util.c | 33 ++++++++++ 7 files changed, 129 insertions(+), 71 deletions(-) Reviewed-by: Vlastimil Babka Reviewed-by: Liam R. Howlett --- 2.47.0