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: 13892789 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E02D11FC7E3; Tue, 3 Dec 2024 18:05:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733249159; cv=fail; b=nnpwT9E+8rZJujSHNn8FYqzbjU9ZZIKUGf5YWcjgDsO9XCFb2pbZ1ofoNozAvaEP+gs/G19USp+P047/FbDP7d6JR2UiOJHxc+RZ8a7u1srPJuXpXSf9tdmn4Qz4NuVy1HuhwiUVe2PC9ulUEgdyGIqJelD5dXA2Y1z3TeW1ETQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733249159; c=relaxed/simple; bh=iaclXEsnfKTcPzoSuZrfKW1NEh8nEnC1PiF9+8LHBtU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ZvqUChL3bO8CtloYaX+zLuGT+wkWoBNnooOiY1UfK7oCTa0/2FI8PQFKltyVrGWC7XtpLP4yyRN98/zm2sc8uhN+/2hCTaMxBurfmm4+aFSkfrfwwCNfHUckMoBJzF8WDpZW44UVUp5rOwqyfste0Lb0iAhV/ktJLoQpjws221w= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=X3KZS1Yb; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=PM8X86Qp; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="X3KZS1Yb"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="PM8X86Qp" 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) Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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/9w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od.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++6j9wiBC6Tfde32HXuPU+Y5mM0ljdMTCEYmra5QBVvJpTC5reiFBXymdbhzjdG9Rp/M2YJS9uzQglEW64kR5HrcS3tptE9Ua1HCf5dbJgwwjfM3qjvyyrHQByFUxxNz8pPNMA8hAU2t3+W75/KrLpUgLSN/k+FQX2iJLrtD74gT9IdSGqP9AhYyl9o+PoqzvB9QK8iA6Z3w/6/NAdbjpvZhSnFjzhUkX6Uq13RlcUllivuqV8xGX3BT2AgXTYN/fJHzNUmzwEtPqtaJLmswGjSotI1MDwsDGj1rmbtZEllVlH7dMopuvv5vUR0xy/rCAWyWeEE5YG5YNY7vQ2HTPAJXSFpSQROp4vAVEpM4ZcS+1YXhUmfV2720cYgrYDGdHRxPk2/wpP6flKMZ8b/db2AJeJPXTI6LWgR2JArUEC2SJ7gLF6ti734WeaoEJ1mN8tsJ4o16wUDuI1X/ytsGunAsr7w6DycEMb1eaG81+aXII4b5PXc9S0umIonNDlAfGaJsxGZwtGedDPzcmb0VwMI7kTL97oo3ofLwrmF9kCuvKr/62THBS/GB4rf6fnvErQVVTeZsL/aQ5VptgwhBlKxfrLUBM1hglbu5vd2nxMmrx7+dvY7cs2uUK5muYcrW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6v/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 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 */