From mboxrd@z Thu Jan 1 00:00:00 1970 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A15B2EB26F3 for ; Tue, 10 Feb 2026 17:46:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 094B16B0096; Tue, 10 Feb 2026 12:46:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0150E6B0093; Tue, 10 Feb 2026 12:46:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D647E6B0096; Tue, 10 Feb 2026 12:46:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B5EF56B0092 for ; Tue, 10 Feb 2026 12:46:01 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 646B48C29D for ; Tue, 10 Feb 2026 17:46:01 +0000 (UTC) X-FDA: 84429275322.25.7706313 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf09.hostedemail.com (Postfix) with ESMTP id 7B4FE140003; Tue, 10 Feb 2026 17:45:57 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=YGJR5mAh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=z+ejXvwi; spf=pass (imf09.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1770745557; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=xkFpBYqaCBKoS21e2h6MCANlvAIXfTUyp9NLHSLwZag=; b=8GX0jlpl/OI+oYrofpQGvVR7kzP/mNaN5LIBhV5Jp2IuCIXlRGCQ8QKp13JQDHu38DjBve 9SVbF0CDw8ufUtqx6BrfUtb+EI5Qyj5KrukpGQhblWUUYlitvDyMxNX/ZjLHCPZRzjd1qz Avf4PDLfPRJdmV6gylpogPnqyObUNRM= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2025-04-25 header.b=YGJR5mAh; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=z+ejXvwi; spf=pass (imf09.hostedemail.com: domain of lorenzo.stoakes@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=lorenzo.stoakes@oracle.com; dmarc=pass (policy=reject) header.from=oracle.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1770745558; a=rsa-sha256; cv=pass; b=16gRIxwV/Rz5SGJNSPcbVYzGg2WJRIKKA48VFx28rQtgLH97CawGCfo2MRPP99/+ExKoGm 47/6X9Kn7RiNAajh9uvkX63BUifUKHdvpfUA0FC8j0G+UOwvy0x680PCWhseZWIDWrgh6a ANnwmhA+8imvH2zLDy+EoHT0EyCGdIc= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61AGvYGt065128; Tue, 10 Feb 2026 17:45:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=corp-2025-04-25; bh=xkFpBYqaCBKoS21e2h 6MCANlvAIXfTUyp9NLHSLwZag=; b=YGJR5mAhYKdY7lJG/X50XwL6q81QbHeoPw X/kbSH1aMplyyyigwG+5lNFNqcGbk6govymunf2qoPHPcwXvZ4JEHCH4DlpqPlhA SEv4yEE75GyvCrj8DNPa0XehkZlH3mVnPydnwfA0Up+217jGUs9QH9Kpg4T6GbnV /9aCW7HgaYB6fWVGXy5PPkCtLfVDmfjUBS8dtUsxziC/Kz1hk7RG5BI/X0DVKIvy W3hh4tUeyWWynuuVQDPGdFKhUSMEHTOtfVDHvmpy+iW7MjnJEVRoPMuGsWOrABIe A4jVUOI81RK6SOV5t0V5B3fNhI6rJ9i7n60jRyN9Qi1F2QK3VTuA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 4c88n7g3bx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Feb 2026 17:45:05 +0000 (GMT) Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 61AGQQbj033798; Tue, 10 Feb 2026 17:45:04 GMT Received: from ch5pr02cu005.outbound.protection.outlook.com (mail-northcentralusazon11012021.outbound.protection.outlook.com [40.107.200.21]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 4c824538e5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 Feb 2026 17:45:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X8q43vCgjKUFnGaaiN2MVAMRApfTOxN/QBKbf4UTSTEqs7fHpU4vnEDTBDJ0svC5W4nuXgMfMJ/WBEAoZxopd7/DqSfDPiFWChgXlRrs9BPiaGKpLNutsa37pt3trjLKdjx+cbQ9C8bHSPv8qhctKZ3Vd7h3vtgrIk7mDRb5mjcsgmPdWlZ1etXBQ7k2kBsHqyw5mNkfTlBb5sT7gdB6GOSefLe9i93fERXgf753eCc1P1O2YQ7c3/ZGZe30gF6eXd8+hbY8qofer0tbT+dMyD+bgBUJldRl3EU2JVDJyx2bkJMHFZCpirzVZKAVD4oz0o2Nm/TwOPOb5JvODVWRfg== 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=xkFpBYqaCBKoS21e2h6MCANlvAIXfTUyp9NLHSLwZag=; b=KHyspZ989hP3h8eWHdUvecBPJ0VpnOcNhYBXrdUjh8KYhEtpFHA989KnCz4m+m1fdbYf3neNKkPT7P1xKciT5T5OBJ6uGGREN5XAjjZp5wFfpugfM9d+E1rrgnwd9cLZbquPBeKxezgpt/EPhGDeWcY8g7iZUh2KQCPfGa6meHr/2FM2eBkhztwGP8Q5b1dLZSa40LmKhe45KqrUk/7vrX8bIPurN97fC66qFL58cDxSuaqYF7O3uoy9UbvjsZixvgcOgcsgTKHk0WG5V5XxCt3DXjmeS+RlirOY4cLE/s1Z6cFv4ME9KfFN3gbYC/X3P1f1YakH8tFGRaSHDOAvtg== 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=xkFpBYqaCBKoS21e2h6MCANlvAIXfTUyp9NLHSLwZag=; b=z+ejXvwifwDPtUdnTjzT1i/m6g2fKqaLJ9YVRRZ4ksJ3+aLt22Wf/ghdlIsdxI5801FVAZYimXpBD/SaFFogDOvFWNwYKq8qFna5LgeszdOv+kWl73ApQ85+d3GVSzhZonXcrGkC9l6fB/rlWMrIvK1iXo3lj71vjwM1Sjctstw= Received: from DM4PR10MB8218.namprd10.prod.outlook.com (2603:10b6:8:1cc::16) by DS7PR10MB5927.namprd10.prod.outlook.com (2603:10b6:8:85::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9587.20; Tue, 10 Feb 2026 17:44:55 +0000 Received: from DM4PR10MB8218.namprd10.prod.outlook.com ([fe80::f3ea:674e:7f2e:b711]) by DM4PR10MB8218.namprd10.prod.outlook.com ([fe80::f3ea:674e:7f2e:b711%4]) with mapi id 15.20.9587.017; Tue, 10 Feb 2026 17:44:55 +0000 Date: Tue, 10 Feb 2026 17:44:55 +0000 From: Lorenzo Stoakes To: "Liam R. Howlett" , Andrew Morton , Jarkko Sakkinen , Dave Hansen , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H . Peter Anvin" , Arnd Bergmann , Greg Kroah-Hartman , Dan Williams , Vishal Verma , Dave Jiang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , Christian Koenig , Huang Rui , Matthew Auld , Matthew Brost , Alexander Viro , Christian Brauner , Jan Kara , Benjamin LaHaise , Gao Xiang , Chao Yu , Yue Hu , Jeffle Xu , Sandeep Dhavale , Hongbo Li , Chunhai Guo , Theodore Ts'o , Andreas Dilger , Muchun Song , Oscar Salvador , David Hildenbrand , Konstantin Komarov , Mike Marshall , Martin Brandenburg , Tony Luck , Reinette Chatre , Dave Martin , James Morse , Babu Moger , Carlos Maiolino , Damien Le Moal , Naohiro Aota , Johannes Thumshirn , Matthew Wilcox , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Hugh Dickins , Baolin Wang , Zi Yan , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Jann Horn , Pedro Falcato , David Howells , Paul Moore , James Morris , "Serge E . Hallyn" , Yury Norov , Rasmus Villemoes , linux-sgx@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org, ntfs3@lists.linux.dev, devel@lists.orangefs.org, linux-xfs@vger.kernel.org, keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, Jason Gunthorpe Subject: Re: [PATCH v2 11/13] tools/testing/vma: separate VMA userland tests into separate files Message-ID: <52dbc7c8-5a86-48e1-a018-7a5b8afdaaea@lucifer.local> References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO4P123CA0046.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::15) To DM4PR10MB8218.namprd10.prod.outlook.com (2603:10b6:8:1cc::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM4PR10MB8218:EE_|DS7PR10MB5927:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cfb74cc-988d-4b2f-4dc5-08de68cc19d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|1800799024|376014|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vpcgQmAo3Dn3M+1ekRw6gwg70TWgSeX1Hbu4nh/+QZ9tpWaOo8F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Uutot/yHdIatougEm4woWewwe55qad6YfJnh?= =?us-ascii?Q?XB/YIZMvM2PSsxaYRVtWwN4wRfsK1MAsqLiW+twvlumfa49MsE/GM65lRyLF?= =?us-ascii?Q?zz6YyBf93ah6oMHvbLxu3YEvzt/2OgkVrdL7PtxV2GxqktE4fHIx2g1WtrYF?= =?us-ascii?Q?Otw3TK9ISpu0KGJRCtiqT86vAKpM5Jh4/ffB0o3ZbleKfhejua7duVSzj0uQ?= =?us-ascii?Q?WDexDq0YXo8Yrvtvz6vvETK+Jl6kD27D6dOZ3zoD6yP0ks3tZcE7okggM12f?= =?us-ascii?Q?nPtexyvOen1s6dL9xvLHidgGz/lswYfOI2oG3Iu40wy8KECaMr7f/EasJn43?= =?us-ascii?Q?pcinUxAc8Mg2TuZ5iajhvz+TfFUbHjt2b0Y+iVfyuV3v2ECSR0h1PzlDber4?= =?us-ascii?Q?O++f5HhbIThO0Y8EqtB5BIEwYtL9ndBtIbOBYHoJmouRS6uQ6s/7sGaG78NU?= =?us-ascii?Q?Gnw28D2EgFgtno7TfNytUIjGzzE6bQyAuD6WAlFqOOYFo5XvnVlcfhV/CheH?= =?us-ascii?Q?IwVCYM6hv2OfmatQlM24lG8fU3FerNE1eqtNNN7LtCl+niAL1Ssy6EVlUdui?= =?us-ascii?Q?wGzZcn9+owHbfSvNVmzEJsWzkzjd6ujvqNbA3T5ghIO397gW0lHBZAmIeVa3?= =?us-ascii?Q?IMM2RbbJOiUYGZMhhhRbNk+bqCulmaGeKl55CtCW3Cvn8G4F6m+p4tEjxpa0?= =?us-ascii?Q?tg=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM4PR10MB8218.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(1800799024)(376014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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?= =?us-ascii?Q?O2Vu4at9XQ=3D=3D?= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: jJGVOnKHQk8DEjLLFT/osJ7WEGF5AoHsikUJhaOO2UjOFwJ3D5ZmJHFJNs+IRmyWVUaVGQx6U4AFPr58LLrIfHfHymyksVtTsd9R1aNG6gqam/Fv71bcw1JfHUVLVmR++RHTjyznaI58c6s1IKVbkwl/NIsE0JypRK+3tRjql7glrLxO6E89sZhPFdoiijMGANKfxzeb0BgcwvJByv/N/wubde4aWZIdjNciuVHdb5SOjZI7u23aXLg7gVvJEylD6kt1QVHpja+dVudgFt7JjrAUy+0cuAv2zusFanJU5+K/kacFX+h7+kLpey7o3/KTchj/Igo9LfLNPruO2IaUosCYxBkJiXunxK5O3rtUBf9Su+McoBH0Zwaefa+IkB0fbxWPh53EFvBGoyGIGvtWEV5fP5CGlb5gtCn9/JatMWAn+k6CgvztU2NSY9whJGcLXaOt84DLsWoePAgoD9Bjp8PFAJmKq3vMclw1tD4/o5HippRTG6wNOBZ11JaJZlxMdTMT9mnpUI+NNOxmlUCoXeN5ZZvveMvnt7QT6JRSiNXEH2qni7DeSq5WLSiXc3h3LlzHnWhIX2AfWi/zQZv62wSTpDg6TxI99gJSXXFH7OI= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cfb74cc-988d-4b2f-4dc5-08de68cc19d7 X-MS-Exchange-CrossTenant-AuthSource: DM4PR10MB8218.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2026 17:44:55.2105 (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: GQhk5C3Bc9IywdxGRyMTQSYr7wYuH8QhmlWrzHD4L5SNgn7TLSUf5I5tbwfAI0oC8nbJgWTOJN7I33KGnX4rNhLLBcTU6fHIJfNvOicxlfw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB5927 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-10_02,2026-02-10_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxscore=0 malwarescore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2601150000 definitions=main-2602100148 X-Proofpoint-ORIG-GUID: 5_rwLb71AxQC6gIlBkoP95zzhGekoNVG X-Proofpoint-GUID: 5_rwLb71AxQC6gIlBkoP95zzhGekoNVG X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjEwMDE0OCBTYWx0ZWRfX8kldw9YtRVUG vrYE9uqV02XUQqvNfXss673xKjACLx8ghb1wji5/hg8QXBS206qft0CtcALazehtT6gUZVHIqwo UrHq2tU//ahJivhgSbc8Mwfo6HFC9r8jfu/+WPloorZ85TrUPcLLdZg1ObZo/CxZN54CWs6oyS7 pvyyksoUmMNvVATRlI9XOP4uNjv8yvzEvaG/zwtp5knOBMd6zHizZ3aT/YcuN1SOy8CDzxfjvH4 Gm/iZnbU+IckbyMp/ahVjNBdgfejBvsZy+0LyZ8GY2ONcg82CQSf7lL/d8wVtPCG3iWVDeXC8N8 NBuwStEtY6W8kGelqakPYf/0FnDZNBFZVVTv28V6Q5/JIoSaTCElpWnIiPXrOeUAihqtS+Ccpsq ulGw7+5nSP03/uSnwB3YnqGhAOUZst68Ge5Y5mvjZm/L1qSkQwtfrTFXLhocBLe5na6Gjro4myA o/1SaIoYacil+bLBKQA== X-Authority-Analysis: v=2.4 cv=O5c0fR9W c=1 sm=1 tr=0 ts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NuZfY5R+kh1FzxnZWVp5vsfQYaVjlZNeuZNxjgXL1HBeFQqwbqEO7oxMVoPC2siyH6IwWx9z+Sh5AhVvyT6A== 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: On Mon, Feb 09, 2026 at 07:58:22PM +0000, Liam R. Howlett wrote: > * Lorenzo Stoakes [260122 16:06]: > > So far the userland VMA tests have been established as a rough expression > > of what's been possible. > > > > qAdapt it into a more usable form by separating out tests and shared helper > ^^^^ Typo Oops, Andrew - can you fix that up? Thanks! :) > > > > functions. > > > > Since we test functions that are declared statically in mm/vma.c, we make > > use of the trick of #include'ing kernel C files directly. > > > > In order for the tests to continue to function, we must therefore also > > this way into the tests/ directory. > > > > We try to keep as much shared logic actually modularised into a separate > > compilation unit in shared.c, however the merge_existing() and attach_vma() > > helpers rely on statically declared mm/vma.c functions so these must be > > declared in main.c. > > > > Signed-off-by: Lorenzo Stoakes > > Besides that typo, it looks good. > > Reviewed-by: Liam R. Howlett Thanks :) Cheers, Lorenzo > > > --- > > tools/testing/vma/Makefile | 4 +- > > tools/testing/vma/main.c | 55 ++++ > > tools/testing/vma/shared.c | 131 ++++++++ > > tools/testing/vma/shared.h | 114 +++++++ > > tools/testing/vma/{vma.c => tests/merge.c} | 332 +-------------------- > > tools/testing/vma/tests/mmap.c | 57 ++++ > > tools/testing/vma/tests/vma.c | 39 +++ > > tools/testing/vma/vma_internal.h | 9 - > > 8 files changed, 406 insertions(+), 335 deletions(-) > > create mode 100644 tools/testing/vma/main.c > > create mode 100644 tools/testing/vma/shared.c > > create mode 100644 tools/testing/vma/shared.h > > rename tools/testing/vma/{vma.c => tests/merge.c} (82%) > > create mode 100644 tools/testing/vma/tests/mmap.c > > create mode 100644 tools/testing/vma/tests/vma.c > > > > diff --git a/tools/testing/vma/Makefile b/tools/testing/vma/Makefile > > index 66f3831a668f..94133d9d3955 100644 > > --- a/tools/testing/vma/Makefile > > +++ b/tools/testing/vma/Makefile > > @@ -6,10 +6,10 @@ default: vma > > > > include ../shared/shared.mk > > > > -OFILES = $(SHARED_OFILES) vma.o maple-shim.o > > +OFILES = $(SHARED_OFILES) main.o shared.o maple-shim.o > > TARGETS = vma > > > > -vma.o: vma.c vma_internal.h ../../../mm/vma.c ../../../mm/vma_init.c ../../../mm/vma_exec.c ../../../mm/vma.h > > +main.o: main.c shared.c shared.h vma_internal.h tests/merge.c tests/mmap.c tests/vma.c ../../../mm/vma.c ../../../mm/vma_init.c ../../../mm/vma_exec.c ../../../mm/vma.h > > > > vma: $(OFILES) > > $(CC) $(CFLAGS) -o $@ $(OFILES) $(LDLIBS) > > diff --git a/tools/testing/vma/main.c b/tools/testing/vma/main.c > > new file mode 100644 > > index 000000000000..49b09e97a51f > > --- /dev/null > > +++ b/tools/testing/vma/main.c > > @@ -0,0 +1,55 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > + > > +#include "shared.h" > > +/* > > + * Directly import the VMA implementation here. Our vma_internal.h wrapper > > + * provides userland-equivalent functionality for everything vma.c uses. > > + */ > > +#include "../../../mm/vma_init.c" > > +#include "../../../mm/vma_exec.c" > > +#include "../../../mm/vma.c" > > + > > +/* Tests are included directly so they can test static functions in mm/vma.c. */ > > +#include "tests/merge.c" > > +#include "tests/mmap.c" > > +#include "tests/vma.c" > > + > > +/* Helper functions which utilise static kernel functions. */ > > + > > +struct vm_area_struct *merge_existing(struct vma_merge_struct *vmg) > > +{ > > + struct vm_area_struct *vma; > > + > > + vma = vma_merge_existing_range(vmg); > > + if (vma) > > + vma_assert_attached(vma); > > + return vma; > > +} > > + > > +int attach_vma(struct mm_struct *mm, struct vm_area_struct *vma) > > +{ > > + int res; > > + > > + res = vma_link(mm, vma); > > + if (!res) > > + vma_assert_attached(vma); > > + return res; > > +} > > + > > +/* Main test running which invokes tests/ *.c runners. */ > > +int main(void) > > +{ > > + int num_tests = 0, num_fail = 0; > > + > > + maple_tree_init(); > > + vma_state_init(); > > + > > + run_merge_tests(&num_tests, &num_fail); > > + run_mmap_tests(&num_tests, &num_fail); > > + run_vma_tests(&num_tests, &num_fail); > > + > > + printf("%d tests run, %d passed, %d failed.\n", > > + num_tests, num_tests - num_fail, num_fail); > > + > > + return num_fail == 0 ? EXIT_SUCCESS : EXIT_FAILURE; > > +} > > diff --git a/tools/testing/vma/shared.c b/tools/testing/vma/shared.c > > new file mode 100644 > > index 000000000000..bda578cc3304 > > --- /dev/null > > +++ b/tools/testing/vma/shared.c > > @@ -0,0 +1,131 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > + > > +#include "shared.h" > > + > > + > > +bool fail_prealloc; > > +unsigned long mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; > > +unsigned long dac_mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; > > +unsigned long stack_guard_gap = 256UL< > + > > +const struct vm_operations_struct vma_dummy_vm_ops; > > +struct anon_vma dummy_anon_vma; > > +struct task_struct __current; > > + > > +struct vm_area_struct *alloc_vma(struct mm_struct *mm, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff, vm_flags_t vm_flags) > > +{ > > + struct vm_area_struct *vma = vm_area_alloc(mm); > > + > > + if (vma == NULL) > > + return NULL; > > + > > + vma->vm_start = start; > > + vma->vm_end = end; > > + vma->vm_pgoff = pgoff; > > + vm_flags_reset(vma, vm_flags); > > + vma_assert_detached(vma); > > + > > + return vma; > > +} > > + > > +void detach_free_vma(struct vm_area_struct *vma) > > +{ > > + vma_mark_detached(vma); > > + vm_area_free(vma); > > +} > > + > > +struct vm_area_struct *alloc_and_link_vma(struct mm_struct *mm, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff, vm_flags_t vm_flags) > > +{ > > + struct vm_area_struct *vma = alloc_vma(mm, start, end, pgoff, vm_flags); > > + > > + if (vma == NULL) > > + return NULL; > > + > > + if (attach_vma(mm, vma)) { > > + detach_free_vma(vma); > > + return NULL; > > + } > > + > > + /* > > + * Reset this counter which we use to track whether writes have > > + * begun. Linking to the tree will have caused this to be incremented, > > + * which means we will get a false positive otherwise. > > + */ > > + vma->vm_lock_seq = UINT_MAX; > > + > > + return vma; > > +} > > + > > +void reset_dummy_anon_vma(void) > > +{ > > + dummy_anon_vma.was_cloned = false; > > + dummy_anon_vma.was_unlinked = false; > > +} > > + > > +int cleanup_mm(struct mm_struct *mm, struct vma_iterator *vmi) > > +{ > > + struct vm_area_struct *vma; > > + int count = 0; > > + > > + fail_prealloc = false; > > + reset_dummy_anon_vma(); > > + > > + vma_iter_set(vmi, 0); > > + for_each_vma(*vmi, vma) { > > + detach_free_vma(vma); > > + count++; > > + } > > + > > + mtree_destroy(&mm->mm_mt); > > + mm->map_count = 0; > > + return count; > > +} > > + > > +bool vma_write_started(struct vm_area_struct *vma) > > +{ > > + int seq = vma->vm_lock_seq; > > + > > + /* We reset after each check. */ > > + vma->vm_lock_seq = UINT_MAX; > > + > > + /* The vma_start_write() stub simply increments this value. */ > > + return seq > -1; > > +} > > + > > +void __vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > + struct anon_vma_chain *avc, struct anon_vma *anon_vma) > > +{ > > + vma->anon_vma = anon_vma; > > + INIT_LIST_HEAD(&vma->anon_vma_chain); > > + list_add(&avc->same_vma, &vma->anon_vma_chain); > > + avc->anon_vma = vma->anon_vma; > > +} > > + > > +void vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > + struct anon_vma_chain *avc) > > +{ > > + __vma_set_dummy_anon_vma(vma, avc, &dummy_anon_vma); > > +} > > + > > +struct task_struct *get_current(void) > > +{ > > + return &__current; > > +} > > + > > +unsigned long rlimit(unsigned int limit) > > +{ > > + return (unsigned long)-1; > > +} > > + > > +void vma_set_range(struct vm_area_struct *vma, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff) > > +{ > > + vma->vm_start = start; > > + vma->vm_end = end; > > + vma->vm_pgoff = pgoff; > > +} > > diff --git a/tools/testing/vma/shared.h b/tools/testing/vma/shared.h > > new file mode 100644 > > index 000000000000..6c64211cfa22 > > --- /dev/null > > +++ b/tools/testing/vma/shared.h > > @@ -0,0 +1,114 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > + > > +#pragma once > > + > > +#include > > +#include > > +#include > > + > > +#include "generated/bit-length.h" > > +#include "maple-shared.h" > > +#include "vma_internal.h" > > +#include "../../../mm/vma.h" > > + > > +/* Simple test runner. Assumes local num_[fail, tests] counters. */ > > +#define TEST(name) \ > > + do { \ > > + (*num_tests)++; \ > > + if (!test_##name()) { \ > > + (*num_fail)++; \ > > + fprintf(stderr, "Test " #name " FAILED\n"); \ > > + } \ > > + } while (0) > > + > > +#define ASSERT_TRUE(_expr) \ > > + do { \ > > + if (!(_expr)) { \ > > + fprintf(stderr, \ > > + "Assert FAILED at %s:%d:%s(): %s is FALSE.\n", \ > > + __FILE__, __LINE__, __FUNCTION__, #_expr); \ > > + return false; \ > > + } \ > > + } while (0) > > + > > +#define ASSERT_FALSE(_expr) ASSERT_TRUE(!(_expr)) > > +#define ASSERT_EQ(_val1, _val2) ASSERT_TRUE((_val1) == (_val2)) > > +#define ASSERT_NE(_val1, _val2) ASSERT_TRUE((_val1) != (_val2)) > > + > > +#define IS_SET(_val, _flags) ((_val & _flags) == _flags) > > + > > +extern bool fail_prealloc; > > + > > +/* Override vma_iter_prealloc() so we can choose to fail it. */ > > +#define vma_iter_prealloc(vmi, vma) \ > > + (fail_prealloc ? -ENOMEM : mas_preallocate(&(vmi)->mas, (vma), GFP_KERNEL)) > > + > > +#define CONFIG_DEFAULT_MMAP_MIN_ADDR 65536 > > + > > +extern unsigned long mmap_min_addr; > > +extern unsigned long dac_mmap_min_addr; > > +extern unsigned long stack_guard_gap; > > + > > +extern const struct vm_operations_struct vma_dummy_vm_ops; > > +extern struct anon_vma dummy_anon_vma; > > +extern struct task_struct __current; > > + > > +/* > > + * Helper function which provides a wrapper around a merge existing VMA > > + * operation. > > + * > > + * Declared in main.c as uses static VMA function. > > + */ > > +struct vm_area_struct *merge_existing(struct vma_merge_struct *vmg); > > + > > +/* > > + * Helper function to allocate a VMA and link it to the tree. > > + * > > + * Declared in main.c as uses static VMA function. > > + */ > > +int attach_vma(struct mm_struct *mm, struct vm_area_struct *vma); > > + > > +/* Helper function providing a dummy vm_ops->close() method.*/ > > +static inline void dummy_close(struct vm_area_struct *) > > +{ > > +} > > + > > +/* Helper function to simply allocate a VMA. */ > > +struct vm_area_struct *alloc_vma(struct mm_struct *mm, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff, vm_flags_t vm_flags); > > + > > +/* Helper function to detach and free a VMA. */ > > +void detach_free_vma(struct vm_area_struct *vma); > > + > > +/* Helper function to allocate a VMA and link it to the tree. */ > > +struct vm_area_struct *alloc_and_link_vma(struct mm_struct *mm, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff, vm_flags_t vm_flags); > > + > > +/* > > + * Helper function to reset the dummy anon_vma to indicate it has not been > > + * duplicated. > > + */ > > +void reset_dummy_anon_vma(void); > > + > > +/* > > + * Helper function to remove all VMAs and destroy the maple tree associated with > > + * a virtual address space. Returns a count of VMAs in the tree. > > + */ > > +int cleanup_mm(struct mm_struct *mm, struct vma_iterator *vmi); > > + > > +/* Helper function to determine if VMA has had vma_start_write() performed. */ > > +bool vma_write_started(struct vm_area_struct *vma); > > + > > +void __vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > + struct anon_vma_chain *avc, struct anon_vma *anon_vma); > > + > > +/* Provide a simple dummy VMA/anon_vma dummy setup for testing. */ > > +void vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > + struct anon_vma_chain *avc); > > + > > +/* Helper function to specify a VMA's range. */ > > +void vma_set_range(struct vm_area_struct *vma, > > + unsigned long start, unsigned long end, > > + pgoff_t pgoff); > > diff --git a/tools/testing/vma/vma.c b/tools/testing/vma/tests/merge.c > > similarity index 82% > > rename from tools/testing/vma/vma.c > > rename to tools/testing/vma/tests/merge.c > > index 93d21bc7e112..3708dc6945b0 100644 > > --- a/tools/testing/vma/vma.c > > +++ b/tools/testing/vma/tests/merge.c > > @@ -1,132 +1,5 @@ > > // SPDX-License-Identifier: GPL-2.0-or-later > > > > -#include > > -#include > > -#include > > - > > -#include "generated/bit-length.h" > > - > > -#include "maple-shared.h" > > -#include "vma_internal.h" > > - > > -/* Include so header guard set. */ > > -#include "../../../mm/vma.h" > > - > > -static bool fail_prealloc; > > - > > -/* Then override vma_iter_prealloc() so we can choose to fail it. */ > > -#define vma_iter_prealloc(vmi, vma) \ > > - (fail_prealloc ? -ENOMEM : mas_preallocate(&(vmi)->mas, (vma), GFP_KERNEL)) > > - > > -#define CONFIG_DEFAULT_MMAP_MIN_ADDR 65536 > > - > > -unsigned long mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; > > -unsigned long dac_mmap_min_addr = CONFIG_DEFAULT_MMAP_MIN_ADDR; > > -unsigned long stack_guard_gap = 256UL< > - > > -/* > > - * Directly import the VMA implementation here. Our vma_internal.h wrapper > > - * provides userland-equivalent functionality for everything vma.c uses. > > - */ > > -#include "../../../mm/vma_init.c" > > -#include "../../../mm/vma_exec.c" > > -#include "../../../mm/vma.c" > > - > > -const struct vm_operations_struct vma_dummy_vm_ops; > > -static struct anon_vma dummy_anon_vma; > > - > > -#define ASSERT_TRUE(_expr) \ > > - do { \ > > - if (!(_expr)) { \ > > - fprintf(stderr, \ > > - "Assert FAILED at %s:%d:%s(): %s is FALSE.\n", \ > > - __FILE__, __LINE__, __FUNCTION__, #_expr); \ > > - return false; \ > > - } \ > > - } while (0) > > -#define ASSERT_FALSE(_expr) ASSERT_TRUE(!(_expr)) > > -#define ASSERT_EQ(_val1, _val2) ASSERT_TRUE((_val1) == (_val2)) > > -#define ASSERT_NE(_val1, _val2) ASSERT_TRUE((_val1) != (_val2)) > > - > > -#define IS_SET(_val, _flags) ((_val & _flags) == _flags) > > - > > -static struct task_struct __current; > > - > > -struct task_struct *get_current(void) > > -{ > > - return &__current; > > -} > > - > > -unsigned long rlimit(unsigned int limit) > > -{ > > - return (unsigned long)-1; > > -} > > - > > -/* Helper function to simply allocate a VMA. */ > > -static struct vm_area_struct *alloc_vma(struct mm_struct *mm, > > - unsigned long start, > > - unsigned long end, > > - pgoff_t pgoff, > > - vm_flags_t vm_flags) > > -{ > > - struct vm_area_struct *vma = vm_area_alloc(mm); > > - > > - if (vma == NULL) > > - return NULL; > > - > > - vma->vm_start = start; > > - vma->vm_end = end; > > - vma->vm_pgoff = pgoff; > > - vm_flags_reset(vma, vm_flags); > > - vma_assert_detached(vma); > > - > > - return vma; > > -} > > - > > -/* Helper function to allocate a VMA and link it to the tree. */ > > -static int attach_vma(struct mm_struct *mm, struct vm_area_struct *vma) > > -{ > > - int res; > > - > > - res = vma_link(mm, vma); > > - if (!res) > > - vma_assert_attached(vma); > > - return res; > > -} > > - > > -static void detach_free_vma(struct vm_area_struct *vma) > > -{ > > - vma_mark_detached(vma); > > - vm_area_free(vma); > > -} > > - > > -/* Helper function to allocate a VMA and link it to the tree. */ > > -static struct vm_area_struct *alloc_and_link_vma(struct mm_struct *mm, > > - unsigned long start, > > - unsigned long end, > > - pgoff_t pgoff, > > - vm_flags_t vm_flags) > > -{ > > - struct vm_area_struct *vma = alloc_vma(mm, start, end, pgoff, vm_flags); > > - > > - if (vma == NULL) > > - return NULL; > > - > > - if (attach_vma(mm, vma)) { > > - detach_free_vma(vma); > > - return NULL; > > - } > > - > > - /* > > - * Reset this counter which we use to track whether writes have > > - * begun. Linking to the tree will have caused this to be incremented, > > - * which means we will get a false positive otherwise. > > - */ > > - vma->vm_lock_seq = UINT_MAX; > > - > > - return vma; > > -} > > - > > /* Helper function which provides a wrapper around a merge new VMA operation. */ > > static struct vm_area_struct *merge_new(struct vma_merge_struct *vmg) > > { > > @@ -146,20 +19,6 @@ static struct vm_area_struct *merge_new(struct vma_merge_struct *vmg) > > return vma; > > } > > > > -/* > > - * Helper function which provides a wrapper around a merge existing VMA > > - * operation. > > - */ > > -static struct vm_area_struct *merge_existing(struct vma_merge_struct *vmg) > > -{ > > - struct vm_area_struct *vma; > > - > > - vma = vma_merge_existing_range(vmg); > > - if (vma) > > - vma_assert_attached(vma); > > - return vma; > > -} > > - > > /* > > * Helper function which provides a wrapper around the expansion of an existing > > * VMA. > > @@ -173,8 +32,8 @@ static int expand_existing(struct vma_merge_struct *vmg) > > * Helper function to reset merge state the associated VMA iterator to a > > * specified new range. > > */ > > -static void vmg_set_range(struct vma_merge_struct *vmg, unsigned long start, > > - unsigned long end, pgoff_t pgoff, vm_flags_t vm_flags) > > +void vmg_set_range(struct vma_merge_struct *vmg, unsigned long start, > > + unsigned long end, pgoff_t pgoff, vm_flags_t vm_flags) > > { > > vma_iter_set(vmg->vmi, start); > > > > @@ -197,8 +56,8 @@ static void vmg_set_range(struct vma_merge_struct *vmg, unsigned long start, > > > > /* Helper function to set both the VMG range and its anon_vma. */ > > static void vmg_set_range_anon_vma(struct vma_merge_struct *vmg, unsigned long start, > > - unsigned long end, pgoff_t pgoff, vm_flags_t vm_flags, > > - struct anon_vma *anon_vma) > > + unsigned long end, pgoff_t pgoff, vm_flags_t vm_flags, > > + struct anon_vma *anon_vma) > > { > > vmg_set_range(vmg, start, end, pgoff, vm_flags); > > vmg->anon_vma = anon_vma; > > @@ -211,10 +70,9 @@ static void vmg_set_range_anon_vma(struct vma_merge_struct *vmg, unsigned long s > > * VMA, link it to the maple tree and return it. > > */ > > static struct vm_area_struct *try_merge_new_vma(struct mm_struct *mm, > > - struct vma_merge_struct *vmg, > > - unsigned long start, unsigned long end, > > - pgoff_t pgoff, vm_flags_t vm_flags, > > - bool *was_merged) > > + struct vma_merge_struct *vmg, unsigned long start, > > + unsigned long end, pgoff_t pgoff, vm_flags_t vm_flags, > > + bool *was_merged) > > { > > struct vm_area_struct *merged; > > > > @@ -234,72 +92,6 @@ static struct vm_area_struct *try_merge_new_vma(struct mm_struct *mm, > > return alloc_and_link_vma(mm, start, end, pgoff, vm_flags); > > } > > > > -/* > > - * Helper function to reset the dummy anon_vma to indicate it has not been > > - * duplicated. > > - */ > > -static void reset_dummy_anon_vma(void) > > -{ > > - dummy_anon_vma.was_cloned = false; > > - dummy_anon_vma.was_unlinked = false; > > -} > > - > > -/* > > - * Helper function to remove all VMAs and destroy the maple tree associated with > > - * a virtual address space. Returns a count of VMAs in the tree. > > - */ > > -static int cleanup_mm(struct mm_struct *mm, struct vma_iterator *vmi) > > -{ > > - struct vm_area_struct *vma; > > - int count = 0; > > - > > - fail_prealloc = false; > > - reset_dummy_anon_vma(); > > - > > - vma_iter_set(vmi, 0); > > - for_each_vma(*vmi, vma) { > > - detach_free_vma(vma); > > - count++; > > - } > > - > > - mtree_destroy(&mm->mm_mt); > > - mm->map_count = 0; > > - return count; > > -} > > - > > -/* Helper function to determine if VMA has had vma_start_write() performed. */ > > -static bool vma_write_started(struct vm_area_struct *vma) > > -{ > > - int seq = vma->vm_lock_seq; > > - > > - /* We reset after each check. */ > > - vma->vm_lock_seq = UINT_MAX; > > - > > - /* The vma_start_write() stub simply increments this value. */ > > - return seq > -1; > > -} > > - > > -/* Helper function providing a dummy vm_ops->close() method.*/ > > -static void dummy_close(struct vm_area_struct *) > > -{ > > -} > > - > > -static void __vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > - struct anon_vma_chain *avc, > > - struct anon_vma *anon_vma) > > -{ > > - vma->anon_vma = anon_vma; > > - INIT_LIST_HEAD(&vma->anon_vma_chain); > > - list_add(&avc->same_vma, &vma->anon_vma_chain); > > - avc->anon_vma = vma->anon_vma; > > -} > > - > > -static void vma_set_dummy_anon_vma(struct vm_area_struct *vma, > > - struct anon_vma_chain *avc) > > -{ > > - __vma_set_dummy_anon_vma(vma, avc, &dummy_anon_vma); > > -} > > - > > static bool test_simple_merge(void) > > { > > struct vm_area_struct *vma; > > @@ -1616,39 +1408,6 @@ static bool test_merge_extend(void) > > return true; > > } > > > > -static bool test_copy_vma(void) > > -{ > > - vm_flags_t vm_flags = VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE; > > - struct mm_struct mm = {}; > > - bool need_locks = false; > > - VMA_ITERATOR(vmi, &mm, 0); > > - struct vm_area_struct *vma, *vma_new, *vma_next; > > - > > - /* Move backwards and do not merge. */ > > - > > - vma = alloc_and_link_vma(&mm, 0x3000, 0x5000, 3, vm_flags); > > - vma_new = copy_vma(&vma, 0, 0x2000, 0, &need_locks); > > - ASSERT_NE(vma_new, vma); > > - ASSERT_EQ(vma_new->vm_start, 0); > > - ASSERT_EQ(vma_new->vm_end, 0x2000); > > - ASSERT_EQ(vma_new->vm_pgoff, 0); > > - vma_assert_attached(vma_new); > > - > > - cleanup_mm(&mm, &vmi); > > - > > - /* Move a VMA into position next to another and merge the two. */ > > - > > - vma = alloc_and_link_vma(&mm, 0, 0x2000, 0, vm_flags); > > - vma_next = alloc_and_link_vma(&mm, 0x6000, 0x8000, 6, vm_flags); > > - vma_new = copy_vma(&vma, 0x4000, 0x2000, 4, &need_locks); > > - vma_assert_attached(vma_new); > > - > > - ASSERT_EQ(vma_new, vma_next); > > - > > - cleanup_mm(&mm, &vmi); > > - return true; > > -} > > - > > static bool test_expand_only_mode(void) > > { > > vm_flags_t vm_flags = VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE; > > @@ -1689,73 +1448,8 @@ static bool test_expand_only_mode(void) > > return true; > > } > > > > -static bool test_mmap_region_basic(void) > > -{ > > - struct mm_struct mm = {}; > > - unsigned long addr; > > - struct vm_area_struct *vma; > > - VMA_ITERATOR(vmi, &mm, 0); > > - > > - current->mm = &mm; > > - > > - /* Map at 0x300000, length 0x3000. */ > > - addr = __mmap_region(NULL, 0x300000, 0x3000, > > - VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > - 0x300, NULL); > > - ASSERT_EQ(addr, 0x300000); > > - > > - /* Map at 0x250000, length 0x3000. */ > > - addr = __mmap_region(NULL, 0x250000, 0x3000, > > - VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > - 0x250, NULL); > > - ASSERT_EQ(addr, 0x250000); > > - > > - /* Map at 0x303000, merging to 0x300000 of length 0x6000. */ > > - addr = __mmap_region(NULL, 0x303000, 0x3000, > > - VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > - 0x303, NULL); > > - ASSERT_EQ(addr, 0x303000); > > - > > - /* Map at 0x24d000, merging to 0x250000 of length 0x6000. */ > > - addr = __mmap_region(NULL, 0x24d000, 0x3000, > > - VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > - 0x24d, NULL); > > - ASSERT_EQ(addr, 0x24d000); > > - > > - ASSERT_EQ(mm.map_count, 2); > > - > > - for_each_vma(vmi, vma) { > > - if (vma->vm_start == 0x300000) { > > - ASSERT_EQ(vma->vm_end, 0x306000); > > - ASSERT_EQ(vma->vm_pgoff, 0x300); > > - } else if (vma->vm_start == 0x24d000) { > > - ASSERT_EQ(vma->vm_end, 0x253000); > > - ASSERT_EQ(vma->vm_pgoff, 0x24d); > > - } else { > > - ASSERT_FALSE(true); > > - } > > - } > > - > > - cleanup_mm(&mm, &vmi); > > - return true; > > -} > > - > > -int main(void) > > +static void run_merge_tests(int *num_tests, int *num_fail) > > { > > - int num_tests = 0, num_fail = 0; > > - > > - maple_tree_init(); > > - vma_state_init(); > > - > > -#define TEST(name) \ > > - do { \ > > - num_tests++; \ > > - if (!test_##name()) { \ > > - num_fail++; \ > > - fprintf(stderr, "Test " #name " FAILED\n"); \ > > - } \ > > - } while (0) > > - > > /* Very simple tests to kick the tyres. */ > > TEST(simple_merge); > > TEST(simple_modify); > > @@ -1771,15 +1465,5 @@ int main(void) > > TEST(dup_anon_vma); > > TEST(vmi_prealloc_fail); > > TEST(merge_extend); > > - TEST(copy_vma); > > TEST(expand_only_mode); > > - > > - TEST(mmap_region_basic); > > - > > -#undef TEST > > - > > - printf("%d tests run, %d passed, %d failed.\n", > > - num_tests, num_tests - num_fail, num_fail); > > - > > - return num_fail == 0 ? EXIT_SUCCESS : EXIT_FAILURE; > > } > > diff --git a/tools/testing/vma/tests/mmap.c b/tools/testing/vma/tests/mmap.c > > new file mode 100644 > > index 000000000000..bded4ecbe5db > > --- /dev/null > > +++ b/tools/testing/vma/tests/mmap.c > > @@ -0,0 +1,57 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > + > > +static bool test_mmap_region_basic(void) > > +{ > > + struct mm_struct mm = {}; > > + unsigned long addr; > > + struct vm_area_struct *vma; > > + VMA_ITERATOR(vmi, &mm, 0); > > + > > + current->mm = &mm; > > + > > + /* Map at 0x300000, length 0x3000. */ > > + addr = __mmap_region(NULL, 0x300000, 0x3000, > > + VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > + 0x300, NULL); > > + ASSERT_EQ(addr, 0x300000); > > + > > + /* Map at 0x250000, length 0x3000. */ > > + addr = __mmap_region(NULL, 0x250000, 0x3000, > > + VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > + 0x250, NULL); > > + ASSERT_EQ(addr, 0x250000); > > + > > + /* Map at 0x303000, merging to 0x300000 of length 0x6000. */ > > + addr = __mmap_region(NULL, 0x303000, 0x3000, > > + VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > + 0x303, NULL); > > + ASSERT_EQ(addr, 0x303000); > > + > > + /* Map at 0x24d000, merging to 0x250000 of length 0x6000. */ > > + addr = __mmap_region(NULL, 0x24d000, 0x3000, > > + VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE, > > + 0x24d, NULL); > > + ASSERT_EQ(addr, 0x24d000); > > + > > + ASSERT_EQ(mm.map_count, 2); > > + > > + for_each_vma(vmi, vma) { > > + if (vma->vm_start == 0x300000) { > > + ASSERT_EQ(vma->vm_end, 0x306000); > > + ASSERT_EQ(vma->vm_pgoff, 0x300); > > + } else if (vma->vm_start == 0x24d000) { > > + ASSERT_EQ(vma->vm_end, 0x253000); > > + ASSERT_EQ(vma->vm_pgoff, 0x24d); > > + } else { > > + ASSERT_FALSE(true); > > + } > > + } > > + > > + cleanup_mm(&mm, &vmi); > > + return true; > > +} > > + > > +static void run_mmap_tests(int *num_tests, int *num_fail) > > +{ > > + TEST(mmap_region_basic); > > +} > > diff --git a/tools/testing/vma/tests/vma.c b/tools/testing/vma/tests/vma.c > > new file mode 100644 > > index 000000000000..6d9775aee243 > > --- /dev/null > > +++ b/tools/testing/vma/tests/vma.c > > @@ -0,0 +1,39 @@ > > +// SPDX-License-Identifier: GPL-2.0-or-later > > + > > +static bool test_copy_vma(void) > > +{ > > + vm_flags_t vm_flags = VM_READ | VM_WRITE | VM_MAYREAD | VM_MAYWRITE; > > + struct mm_struct mm = {}; > > + bool need_locks = false; > > + VMA_ITERATOR(vmi, &mm, 0); > > + struct vm_area_struct *vma, *vma_new, *vma_next; > > + > > + /* Move backwards and do not merge. */ > > + > > + vma = alloc_and_link_vma(&mm, 0x3000, 0x5000, 3, vm_flags); > > + vma_new = copy_vma(&vma, 0, 0x2000, 0, &need_locks); > > + ASSERT_NE(vma_new, vma); > > + ASSERT_EQ(vma_new->vm_start, 0); > > + ASSERT_EQ(vma_new->vm_end, 0x2000); > > + ASSERT_EQ(vma_new->vm_pgoff, 0); > > + vma_assert_attached(vma_new); > > + > > + cleanup_mm(&mm, &vmi); > > + > > + /* Move a VMA into position next to another and merge the two. */ > > + > > + vma = alloc_and_link_vma(&mm, 0, 0x2000, 0, vm_flags); > > + vma_next = alloc_and_link_vma(&mm, 0x6000, 0x8000, 6, vm_flags); > > + vma_new = copy_vma(&vma, 0x4000, 0x2000, 4, &need_locks); > > + vma_assert_attached(vma_new); > > + > > + ASSERT_EQ(vma_new, vma_next); > > + > > + cleanup_mm(&mm, &vmi); > > + return true; > > +} > > + > > +static void run_vma_tests(int *num_tests, int *num_fail) > > +{ > > + TEST(copy_vma); > > +} > > diff --git a/tools/testing/vma/vma_internal.h b/tools/testing/vma/vma_internal.h > > index 2743f12ecf32..b48ebae3927d 100644 > > --- a/tools/testing/vma/vma_internal.h > > +++ b/tools/testing/vma/vma_internal.h > > @@ -1127,15 +1127,6 @@ static inline void mapping_allow_writable(struct address_space *mapping) > > atomic_inc(&mapping->i_mmap_writable); > > } > > > > -static inline void vma_set_range(struct vm_area_struct *vma, > > - unsigned long start, unsigned long end, > > - pgoff_t pgoff) > > -{ > > - vma->vm_start = start; > > - vma->vm_end = end; > > - vma->vm_pgoff = pgoff; > > -} > > - > > static inline > > struct vm_area_struct *vma_find(struct vma_iterator *vmi, unsigned long max) > > { > > -- > > 2.52.0 > >