From patchwork Tue Dec 3 18:05:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13892820 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 3BA5DE74AC9 for ; Tue, 3 Dec 2024 19:11:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9CD8C6B0082; Tue, 3 Dec 2024 14:11:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A3636B0085; Tue, 3 Dec 2024 14:11:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7CEFE6B0088; Tue, 3 Dec 2024 14:11:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 5D3926B0082 for ; Tue, 3 Dec 2024 14:11:43 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CE209140C1E for ; Tue, 3 Dec 2024 19:11:42 +0000 (UTC) X-FDA: 82854591246.09.153A0CC Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 7A4CB14001F for ; Tue, 3 Dec 2024 19:11:30 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=X3KZS1Yb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PM8X86Qp; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf23.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=1733253086; a=rsa-sha256; cv=pass; b=q68qgMbqfLwqwa6TDyGwH5uEftH6LopweHL5PF+qd5Pocx4D/dVXezmworzfB5amlqDi1n XJYp/tv85I+qWcdy1hPmeGlbk+bGd4GKXcG+1wFuTtkkPaLi72x3oEiqWBobSStnWp0rrB Do/uWFjau1oqft3Ua7hDjDqp2Fc/fSQ= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=X3KZS1Yb; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=PM8X86Qp; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf23.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=1733253086; 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:in-reply-to:references:references:dkim-signature; bh=h+C0HsktFzmPVDF+PnzGjib7ioZoAwoaSTtHI6BxIYI=; b=SJ/Ib4SEpAoyRKTFj4/knEillFAsks7R+QDv85rlzsBx2QfijW0BcPz9KIvweHq3Tg0Hbj l0WlAO7vEpQEiq9r/JHcOiEad3i+F8OVQjIXQyjFdO8b1RhXSWl35xprFnRzEo4skAsS45 DGp3ZiiEeAfwlKhoyj5tiKcSTa5pObQ= 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 4B3HtaQP012433; Tue, 3 Dec 2024 18:05:45 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= corp-2023-11-20; bh=h+C0HsktFzmPVDF+PnzGjib7ioZoAwoaSTtHI6BxIYI=; b= X3KZS1YbSPlN+2WPa1IQW4OGpkOMFmcNj/4gp0EHFLGVmTpCPtKezg3E9qFdKaNl dCB6A/SMefDnzytFF10iybdVgtB43UKY2XgVuRF+rQu1/6dU8wII1pL9U2OkpMHE mWUZHTxC12zucPDbyM5+cJPCW5edM7uKfTGk6VEYkELpedtwMz6ylHMyBlOiYSug j1lgnUScAE4KK/uXE8/D/BqIQgULqFnPVsEmzZOOjlgNboK4QAPY+Cin8lVVyOIB uYd5X35viTw7JCBqVQs3EDyWewZfTxA0OCmtRziWf1R1Wckw1IJTKRvlQwJMUl/7 Sgbw9Lzi3a5fdqPr8CyAhA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 437s4c6nss-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Dec 2024 18:05:45 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 4B3HL0w1030979; Tue, 3 Dec 2024 18:05:44 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2049.outbound.protection.outlook.com [104.47.70.49]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 437wjcuq4m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 03 Dec 2024 18:05:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bn4EvTK9Y85bRMFRnQuqhHeoS8GaepPnz5wRlsPmTCRzTAeUXXwEqGFTXYG7nnbQBxqIv1q6GPOaFQsRJM8DTtjUFIxr0BKD5BuvBczfDnuVeoj1PZiFvwg1Iz5ZqKvnCu0eE5hOGUj33YrRZ96wTkygQyhLd5V0m+2EJsV2UFR9ex2Elt4MiNLDRKiC44Y4c7EZl6KyJP+gdBZt37AFDy4y2wWqbmIz2u5kvwqoTkSdB9R+dtxQVGbaRIfn74DiGJMxPfrk9I5IBKiCAGUhHQCGZRhwUYg7pA83aS1bnBOMjbmOTUH5KgmfPXRvXJUACgMIYKUj7VcbSSh7s6ShMg== 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=h+C0HsktFzmPVDF+PnzGjib7ioZoAwoaSTtHI6BxIYI=; b=kPGoiR6MhqWostkoxqzBW0YyxeqD067PdRE85Rgeqqd6agrLR00eRdpIPCORaUUwM1JqZPIdSXdsZ4cSTfo1d6sMBqe9i2r80WanlCFL57pGbGvajgtlaNnt5ww3IOYXjGzrinEjrIls6ALFULZiv88ku+JrTDtuLaMWunZ6CQ7dNqAsoRHrkeHUXZJf/txh6G9MBEyC+5qVLXHEhYONdYEjGA0vT0PSPo58OV0X1fkQBiRyG+8OMmLRzkmrxS/2W9sw05Ky2XISQjHU2la+5psUaK/oKuvuWhQJVR+7VJVQhFg6H2ZS/EZUGbHt0AAv6D/MEQTf67hQHVfKVrWNAA== 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=h+C0HsktFzmPVDF+PnzGjib7ioZoAwoaSTtHI6BxIYI=; b=PM8X86Qph/GITLYjFkuNQaWZCGHeRmvmIkcN7X9CXzYWgIeur/iAE7B1kS29PGb08+kdVDkKsTCyFSKfEm2QaovKaF79eYTbCudcusiPBSTX0z+Kxlqyrysq/akm6iiNqah4NHeZtPnexH/cmSsPmIEIJ0E4bdVLm74x/FaW2oo= Received: from BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) by LV3PR10MB8129.namprd10.prod.outlook.com (2603:10b6:408:285::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Tue, 3 Dec 2024 18:05:42 +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.8207.017; Tue, 3 Dec 2024 18:05:42 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: "Liam R . Howlett" , Vlastimil Babka , Jann Horn , Eric Biederman , Kees Cook , Alexander Viro , Christian Brauner , Jan Kara , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] mm/vma: move __vm_munmap() to mm/vma.c Date: Tue, 3 Dec 2024 18:05:12 +0000 Message-ID: <5e5e81807c54dfbe363edb2d431eb3d7a37fcdba.1733248985.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0336.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a4::36) To BYAPR10MB3366.namprd10.prod.outlook.com (2603:10b6:a03:14f::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BYAPR10MB3366:EE_|LV3PR10MB8129:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e767d7c-4787-4440-64a5-08dd13c51a0e 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: 8YEm0AOYG1ZOkUJEdyMkJJFfA1h+pwppxEAMf+1NmbrpJbt3APGUYiV7PRZenc/c+1Sl0Qylu55Dz16Z2bAM+2yDaSpsBcHD4CNuDGp1ZATw4OKmUdz8FyM/1E1U//btC4iTGB6kKw3oT6ujMUDARORl70IX41AY+UOQtC0yuk5XpeOrFNTAw8iJPiF4jKCWqQF+V8vI8nQMmSe7uH/4xhmB6SLfUmPlYtDr2Bq9t19fnGPhCB4FBNvyHHWwI0n/Pb6VQu3zkSUu55K3iz8/o/oFYu0ymQIoxTknwQG5aY1wAzRm9JTMm8r3FzAogi13LnmeA9gKQ+pzpc58G+a69OIhH5hwy0rkt2zIp9PCcMXH35nylgiFxIjSruSQI/9wYgN3kfGF6s3by0Iuj6Xspg4k8L93B1PGdFFGU073x4M6U2QuA8o8kRZTFLlRqLTGzowGvPueNc6QN4l4cnt0/X0QoQb6l/qfyVE2d4b4pD7FaWr+V03vIEZ5qly+LRQyrk1L8vruXHXN69WN0Vt5kNc6y2haWkUfvnYV4/0BRBxOQql4x1nOIw2gfAchWhOg1zI8su9kbnFLbch6YHXU1QDK0Y2iQpI/JBJYrQvUMz+aoxgBbx3Mbc31ZJMxxnAPdHBlhD1udZtAncURgmrfhoqQiBmu2//gmGlZGQ4WAdoBkngDgM9hqQGvU8esw0Q7WanCFvD6pefr+BQEQ3MuPcvwn0eVFA9KYhkJTnawJ7qZMRm0lMyNiGDh0f1lJ4vE/hdTqLLt6WbYpu56uNXFKEcEzH/GENyTeeX1nlDA+DEgfHhlL9pbLhZBJqon7rlblFaSQjDREmCyAFmOsFKPRhToU276aYzSZGg6Ycxbca/V2dCbLOdnTcbqvXwfq9QIOH0gQ36JIde2jQG+7dv8zxZOUtGS/I0470hLPkbdpj41TwRGCSbhE0L9o1jOWEd/rr9AhSKiOBvGHH4e76g2qwdeqw303CRM9cfFZ+hN10Fqo+DDvbqy2A0orZiMJGlNODW6K3PqLWtHL/sKHt2M3VOMh1McndeA2Ol9+JfVmovnjicG8q1fL3jTHwm3mo1bJk8XOYNHnEX60r31KUkfJAr6ZbjfIHaRk7FFJ7TsBTCqyU0bXO4+VND8mbR9EtlBriBJbTqPdTG7nYpgOdldhqG0tfNkZLg+K8YuUnt+HpvNU9Kx++eW2SPSduoOhRKbsA8jT8FQxtRUopkAiEiYqh2loN/3Hhc9IWqzwMbCks9mgyAAIG0GVTseLXNquUw3xEPAEGn4j8y7zeSSw1nDegVamYBVEVdhRNsqwK6QRpvxv2AYmfhHObz/8RVhKsNs6RmbqDwINOdUqLmMTfvOvw== 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: aWCvxsMGckTL+VvGmXxRiI+uK8u3iAhG+GOsABdIZQhWj4sPlYcwEDqLpK1hhkx2btqMzj/x1l3dhiBZy/ENtZeogukvdNXbCf9+3OIkIHj6WxuIl+NPTPttDFnR00payfMUKok45bsOBdC1pcXvCwYMP5wwAFlPcgfMccuYhNPBJLV165MHBFrj3u9naNh9vAwsuhgE8Mm+JCPNTj2EK/hVIlY8EzqyO7d7WC02kYq4bSKWFCRWh8MKcypldRfp6Eu3FzjhwhIZNnTMIrQG0lI8PxSG08KIuPZFl+pKN+0nmEo3dpeajD5++6j9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IIFcIWbibZCkyf1WvAVJg7fMTLgYG2wK27Z7RlHH7pyoBB+cDNzrFU7j2lKR78PbtXLyzEFcr9e7pseW5w1ij5MeGKjhL8+cdr1lsBqWwwYL7FyvKLrZV/vCqA77KeTPNg1ZFiS5HrR8I1UD3KKys4erCiEsJI6Lvso6zkeo9WfAGtONF6xALZ7oI5J/BZqofKHIo0F8CU1UUU9AnxbSr8Bh9ZVkRmlQrfy0IrZ6vlg== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: 8q3FlgUZQmjsIS8i6MIg4XGFDqGvjiVGj7DHcD5dFlZPbZkXkszXldisogVb5vpEigBNooIwWpC2FaOcXb/C3n2I3pfOMqMlc/Vj6eeReZjWE69i2BNCM96OpgJP9iIw4rbkOlpmp/x71wHsmhfSWXMS1/XSjkSZfMUJy1tdmqQ3Ri8hw715xuHW3f/0jZEKzaZwD9fyCHW2siWSsmX8oFVwhLN88N/TFX+gczwXBxZV4IHq7RvlgyJDUhofMLPTG20z1Pttwajs/pfTtTP6neRAtiEUYY8adIcqdPLOslJP+q4GGnLWSwpq7SIoI9CnSk6v/lME9KsY75BohuCWWMofw910AmB+D7avw85H8cDiOrpPrLMc6zBBAQhJBPSZQLdEFE8SbknETn03XZlnXGDgMvkQtfWTaYPGj26p3sxgcXRjgJvkkQWw2Tv/cyS8oi9Mr8ZG9ZHijG9wpJYVsQSkXZ0z1v6I3UqFHy01X5pyLhLGWwPnHBPQpyR75e7hOQklkfUTUP9AZ7IxmTxkmpZOjSpRbPVvTREj63tFBYZCVucWT7vUUbUfIjQiPZtTfS6QHQy3aSCxHjFhbV42tS0qyQD/RbmPSwnZvM3j1Wc= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e767d7c-4787-4440-64a5-08dd13c51a0e X-MS-Exchange-CrossTenant-AuthSource: BYAPR10MB3366.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2024 18:05:42.5555 (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: TNPuZ7nJnXMrCVV8gaG/X1ZUwh37pLO1rU90z9OEx/Aw92sVxfxCvjiOyX3Ug3rZRQjA2GFX4mBMZCcQA/KVd/I4rJeF+zqDZn5Oxd19Du0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB8129 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-12-03_06,2024-12-03_03,2024-11-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxscore=0 adultscore=0 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2411120000 definitions=main-2412030151 X-Proofpoint-ORIG-GUID: x5YfrHLOjVs2IOJLTGqOk7u8lUkrr3Eh X-Proofpoint-GUID: x5YfrHLOjVs2IOJLTGqOk7u8lUkrr3Eh X-Stat-Signature: t3tkrxgkmqzztzspqbxmukxiu3xifxbz X-Rspam-User: X-Rspamd-Queue-Id: 7A4CB14001F X-Rspamd-Server: rspam08 X-HE-Tag: 1733253090-792125 X-HE-Meta: U2FsdGVkX19gd43J+jgUoKLfLMGRKm8kZ8akab0PAXZogeKQHlQlyNzY9PmLIddZgyDnmwxIfbqCu+rkkhVIKei6vl5lNAc+AB4DZ5SY/cQYtiHxhmNLHv96YAV20H4cGB5yZskQ/LNkpp28c6DEBIxdzz9EPw7a+aNK3/ihzTDvYkV0IQHM1yEEuT2NnTnybCiD08uzYoQC5XZ2klO4UXf08B3Z8fxrOBUUDA8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6WGCE5L/Q71hkgm691Betl3LUiA6npyC0GLdKBZ2BAQaTgpCK8kJ4uCP1bp1kHv52vNGlhy4PZ0pVWYegsANjfmMi+7cgrfSepPnCokUhoHNiIMnZ8DVhpGvydhr5H4abtd6FyiF94s6TusLALIilIwnbBTBRAOPhsCDW6lEXnUMFSUOxC8EBNxRt/1zSipJz4SyVw/Mxb0/tQ4HMXNuchIVC8yjsxzvP5F+5FTZ8B3u2Hq+yt3fn0DGiES268Rov7U0n8WbLFKsu8rXPSpGu6cxNt5sn//kpQtZFf37GK7AVeSgoRNfVdUA== 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: This was arbitrary left in mmap.c it makes no sense being there, move it to vma.c to render it testable. Signed-off-by: Lorenzo Stoakes --- mm/mmap.c | 18 ------------------ mm/vma.c | 18 ++++++++++++++++++ mm/vma.h | 2 ++ tools/testing/vma/vma_internal.h | 9 +++++++++ 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 55a8f2332b7c..1c6bdffa13dd 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -1044,24 +1044,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, return ret; } -static int __vm_munmap(unsigned long start, size_t len, bool unlock) -{ - int ret; - struct mm_struct *mm = current->mm; - LIST_HEAD(uf); - VMA_ITERATOR(vmi, mm, start); - - if (mmap_write_lock_killable(mm)) - return -EINTR; - - ret = do_vmi_munmap(&vmi, mm, start, len, &uf, unlock); - if (ret || !unlock) - mmap_write_unlock(mm); - - userfaultfd_unmap_complete(mm, &uf); - return ret; -} - int vm_munmap(unsigned long start, size_t len) { return __vm_munmap(start, len, false); diff --git a/mm/vma.c b/mm/vma.c index 83c79bb42675..a06747845cac 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -2874,3 +2874,21 @@ int expand_downwards(struct vm_area_struct *vma, unsigned long address) validate_mm(mm); return error; } + +int __vm_munmap(unsigned long start, size_t len, bool unlock) +{ + int ret; + struct mm_struct *mm = current->mm; + LIST_HEAD(uf); + VMA_ITERATOR(vmi, mm, start); + + if (mmap_write_lock_killable(mm)) + return -EINTR; + + ret = do_vmi_munmap(&vmi, mm, start, len, &uf, unlock); + if (ret || !unlock) + mmap_write_unlock(mm); + + userfaultfd_unmap_complete(mm, &uf); + return ret; +} diff --git a/mm/vma.h b/mm/vma.h index 6c460a120f82..295d44ea54db 100644 --- a/mm/vma.h +++ b/mm/vma.h @@ -478,4 +478,6 @@ int expand_upwards(struct vm_area_struct *vma, unsigned long address); int expand_downwards(struct vm_area_struct *vma, unsigned long address); +int __vm_munmap(unsigned long start, size_t len, bool unlock); + #endif /* __MM_VMA_H */ diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h index fab3f3bdf2f0..a7de59a0d694 100644 --- a/tools/testing/vma/vma_internal.h +++ b/tools/testing/vma/vma_internal.h @@ -906,6 +906,11 @@ static inline void mmap_write_unlock(struct mm_struct *) { } +static inline int mmap_write_lock_killable(struct mm_struct *) +{ + return 0; +} + static inline bool can_modify_mm(struct mm_struct *mm, unsigned long start, unsigned long end) @@ -1175,5 +1180,9 @@ static inline int anon_vma_prepare(struct vm_area_struct *vma) return __anon_vma_prepare(vma); } +static inline void userfaultfd_unmap_complete(struct mm_struct *mm, + struct list_head *uf) +{ +} #endif /* __MM_VMA_INTERNAL_H */