From patchwork Tue Jun 18 02:24:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13701694 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2077.outbound.protection.outlook.com [40.107.243.77]) (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 1FA501865C; Tue, 18 Jun 2024 02:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718677479; cv=fail; b=G+aXGb9g8W4+914qsuutJrfNuetMGHMcZz8B+d+w+R2o1J91hB29OG69p7Oe0ztpEG6s80VwcPJmR2zD6+feiAy458HuDq833X/Qtc1bR1ECsyT242pYPQciMggKlkP/uK+5vNfcw45rWQZ6UM0M0R+ZTLRRXDcOo+MLsU9HmPo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718677479; c=relaxed/simple; bh=q+9YpcAlaI3uXyh3nuYNyDBif9Xmi86C6G1DTXRjHVI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=HcV6IXh1WiVXXXcwvKYV70x2uH6FeY5hkdU5DmAf68m7KGVygW0EYDwpoTMsFIM6AzQIHiNWQRkSb1Ne0ENJyU8XHhiHH6Jib5xJIGMDSa6Eh+g+fAD4SwlRBv+1d2L7w70o8e7Kege65x95atOJ6OOwvEYyGn7KamqvfYlqsSA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=unfU/2B7; arc=fail smtp.client-ip=40.107.243.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="unfU/2B7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gE5V3gwtPkzAJYHK5OTIxJ3ahRQlx7B/vzOjqFsg/FXwrQT0mQPYyJu/vbsUPzz8TfwncEpkC8VuGBNymFwlYiedC56g+N38M5UC52dNker09l2g/BXNhp/GOLGXFN6Cr0fche1FZQv3dqWGJe9kxTK9Wh3Yw02oFS5WLm4Jg4SxApknRAmlnGUvE1JI/2ayZncPwiCbPfJj4zQjIBPo1qE7Ei8w1uWLq8x76bW1rZI569N1U9ssKfsPsrbaCqHNVBFQezVU9HQjknR6jZpd1JZs+XiVx10ymVREA2Bm+AgaVHSx/3o0jdKMw+NadMvyrKkwYoY3jcUkhVtN8yzQRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=NF9Ze1k6wBxs36mbUWWURPDYNQVjIyEe/phljaLt/7o=; b=Nde/Fe+3hXJcEej4TLKpRGfzq06fMhbD1Imo0T4YijB6M0+Vo/NtFGZOmYaDXPLGsAFlxmmEYR7I8wIrTRyqwGdiReetkVX8ci6sUsRkq0IcSJog2heeWygAOEuV3SVgv/Eza35enBIzp5DzYw23LoD4NSXu6LAGRIdOP26ziBHXPCRYZnZ+ISlWfqInbCSysrQlNePkdRuygUWu56n945mJb9+7aPQkBxOx5U63ftFXr2HeTESIIKEq2gHTtvsgVD1dqB1WSJzOuE/NG0392usueDbYXTDHj2m8sodKJrGa/ovdeMztkrFlBkLZPLkqm0divtWmqOG1Rk/PYzl75g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NF9Ze1k6wBxs36mbUWWURPDYNQVjIyEe/phljaLt/7o=; b=unfU/2B7Mm9333WD/1JP64ahV+Il/GbQ0ZVRE1yMvN5vXdIRmWeY43STPfBtCAtXUOVo6aMyb/d9S3W0VDb0/iAi6MrNvK+nStAMm6Qo1OYTaGfvKYeChkdBusdYqLsyeYuARIshADhibm7EVHfGhRnV0XJQhEDGT0FP+YlmO0MYWuRXwMOBR6nubV3RnO+OYmifIUaFLgbhpGoUE96DHmiIUhTQUjW8gjPrlTV3gRWS2syuhnCEdLjuv92lTyJ+c0fyz3EbQVB6x2PoNn7MtvELsDpuCp5YGmolaEkNNh3tZ/AzT8t+p2uCqMdIfrsgtOnkCGSCm6Ys2wA6ouHrnA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by SA3PR12MB8047.namprd12.prod.outlook.com (2603:10b6:806:31b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7677.31; Tue, 18 Jun 2024 02:24:29 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7677.030; Tue, 18 Jun 2024 02:24:29 +0000 From: John Hubbard To: Andrew Morton , Jeff Xu , Shuah Khan Cc: Andrei Vagin , Axel Rasmussen , Christian Brauner , David Hildenbrand , Kees Cook , Kent Overstreet , "Liam R . Howlett" , Muhammad Usama Anjum , Peter Xu , Rich Felker , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML , John Hubbard Subject: [PATCH v3 6/6] selftests/mm: remove local __NR_* definitions Date: Mon, 17 Jun 2024 19:24:22 -0700 Message-ID: <20240618022422.804305-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240618022422.804305-1-jhubbard@nvidia.com> References: <20240618022422.804305-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BYAPR07CA0063.namprd07.prod.outlook.com (2603:10b6:a03:60::40) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|SA3PR12MB8047:EE_ X-MS-Office365-Filtering-Correlation-Id: 25746475-ecc1-478d-b6f2-08dc8f3dc814 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230037|7416011|376011|366013|1800799021; X-Microsoft-Antispam-Message-Info: gTfik7Fd8UcEX7bUPyF7gBwS4/ub/5SxjMQEizGMvN/NB10qPmN9uoYIWOaNj+eegs4PAqRtwxkN4W3nsM+7e1NRiigciM3hGMvb4KC/6dU/bK8tO1v2sD31xiNDItv1LG0EQC5KWlroofPAyTZMlGkf2RoI0nsw4KxwXn3FdGQwiC2z0yt4FtwNaZP9TEKpaHgTnrYXnU/2yGR8EKootjP5JnGzBCj1n+QL35+evFkCA5dCoMUerO1J5lco4nsviaQUDEEeuqtgUPSNsOV0fldGDLOQduWrOUj2ku7Af0l6yMWWMubgWE9m2OGbtDrbbmbzwCFHIdkqV1oozsnqpC8cRadZ2BYQdeqaXZf86MbNO8YdyjgO3IErlBHo2SIbkNDVQ7OK5fs6h/Ku+xF+dsdqLWAE+9cjCXeJnpJ/GOEGNnLL+wpKBp2pKbZzlMcP3Du+h8vKaRF6FHokhKEPouYbeM8S57tVYSWhfMvN/sfhrPU4gdGcviLCy34bo38wMUOvlKCSf1Qs5wsCvNmzNf/jucopfKpGt5RkSkVpzVcrNiVMSkiC28oKp7fMoaW8f/U7dxroZHOzYtUMvpirKaE9tTbh4dyBqd8e6o2EiVqHazcTGNJRYU+2X6RmstHFVtR+ZgA8ZB+H12QnHY0Acr/0EXW78dy5kvCmjq5qrNUiS5QQplUFz46NPRU97PHrOHCBSv72tjwJI4hMG9CSPfjUI0MiT38Btm1boPxk/3LgLgvlMQanaYixN/LfLli4RqG4PR+2ZBgciuNQHk61DkEIOVXX0zhisMzy5OKBBKNbFPWASTyDQU4u6SVErgQcVVgYWtI/8j5hgZyXmSQAOK0xSK0WaArUbadRPDMhT6D6K+Dt3WGeSu4nAXMW3EFOA5iQc8/5wBYkV9mExGXFrBoQciM8b1rCdHorzvYv73o3E3gpM2E+2/D/s4xmnTyeunyQjZa1lxTVdEf4qgLg/8imOQM+qtPMuUCFoTXMRZS8mWUqaR1nTEmXHiDDQWhYM7IC1TSVMMPGUqwGZ+KRFRvuDqhs+rfFwXFM0JI+lOP1aXmnwkXAtA6y7Hb7v6CoKQFzsuh/KyfFRDAwn00bXu+H4Ic9tl/HXMkdt9nhM1qdG/lhvaLiK0XHA5pqihXTpoS65pAYsiyW4coGglPKakV3sIbDLcMq9UjbpAHqS4FiRnCbqMLo0sb0DpATUYwuTugQX/tWteGkDoiuf5iSF2BLQvWPfBQn0Y4cl9Hr1HAgd/eMnxv19gBdT4djSN21K9QP1nQkoERh9Eo2/Jjk2HDVSjqpgjQ3W1C+UwMQAmK2x08Gk4i+drBXYhpwhERJ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230037)(7416011)(376011)(366013)(1800799021);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: M+83bU0V89Wll6783m/V5ceVo/6LGobBEwaYcRDve+nh+/e3GDx/JJq9LaI+CaAeKES9nFTeB14zoUhf2yJvZokV5sv6OVlGNwicypUZiilyjkmJP9PVxk6LrvdLUNbAOchL2AMkhJ9ejMWiok7nXQ7JmNb/NOvUJb9TstfrgrzNg6VvYpuI2EgXgtUTnl4u9kYzJHiucbqzHKbCdVyRRX/0i73NoJdUDIam81CVQfJpG+LBA4Z5iUMjWFLPud0LLP9JhXOdEavZfEuVTldWtzC2f8iOTzDUqWqYysU8LJ21sOcPCQNTN20KfWBAezhTDS6x62gW5lgzg+VsILXVnYmQvOm1wCKbCbjr1Swom5SBt3h221eLMUDgrPmZ+5kp5XZ8ffEOEpTViFtamqkp22apnFLcWTblVWgyKsyJx0GNOuX57dk8brDVwPqmFwCQXPr7zxWS9lEYG77kJmHlPexOEP03X2NSSam6iSx0h/wEhNHVkqpNQNp/zAyBgBSS3FxH4QN77UDkmsa/deSlph2U6Xxl6/YS9Uwcc98vm0BId+N+IeoRyLEyTMHvTBLhuWHXTvz4BXXHBmbk95TU9+byl/ev/W24euqk5LZHTDBlWJwVWQzMEMU0R+pfiZTAyKKlKR5sSxlbNza8DeyWhmfTIP3owbOMVjqaE/Lhltptoi8l3rTFMqd7kgbMRemm3SWHCo20pDjW9WLGynBivdAlO7Y+SHMRIznWHY++P8CMhuOET0EFa72U3rTxGKkA1dS+rkDBVJdMTigWJk6zHZtBrUYEg0OG+YW5MRhW04keAYve56sA+EOsYGJq1GQVVURGii/kqXyZNC9rS3WucZ3xY71aTGhFfVZt+R8jIfCACT7COXi2iJmgJ2ySWb48viZberBu4R6NqlVNWiAoC6fOXSjtsu30HrISegVbzwC4D+7kcS1vcp7LsK9jFVqjGZU99mbL3ewgI/O8bRZ9rYnEpp1at6ZB4rOYt/qujw+Vg6t+0y6gjeEKyULQp50rBjAyQABfxi80c8hF16WzXI41ugommQ4byv3YEC0w1jG0SzjOcWWObGXnPtlOdYDGEpab90bY4sIxvqHUUaFiJt1FlHr2ZXPJBWGRv/VPMw4NpunjOWAwbiEO/nomfxLIxNgXAqq1n6stBO2XRmAcNs+KB3NFEN7PHOMSCNoHCkHYbbcod6Mj4S3x58vzmWLFwSws7dERAOU3sMd+m4+e0u8cIXsFkn0e+VW9Mf2GkujCtgOxiOQAxf9r1BZV8KVpiQS8xx3l+XLvpWVcy1pSN4i3eOirBFfgip/cVifGO7Sf9MQ7ZdaxOOGcbqFueyu11FbRChapsT1t2i3NP+AxRmR5WbZQ6CdKlH4eG3CQI9Wxk8TGsuL7z/1mmJLr2vD8aH2VhU8//sHi/uZYAbDLdlTIPylqsZ9x9DQ6OdY/wfiiFxAdhc0FFmWNAW7TkmhEKIKIfc86L97Cx7TQWXH0kJQe/X/DY2s9COpvKuK+kLRByxFUYPyipP2fdiPcQgeN+2Z26OWtz7R0rAAT1rjUBmN8dyjZmzldOGIx5MHNP6/fG+frB7XypdFkOj0SDwIp X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 25746475-ecc1-478d-b6f2-08dc8f3dc814 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jun 2024 02:24:29.3173 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: ndPuPpq2Dx+robDDNs4oio40yWwg+c8qBZodoVSpGfwv7UKe7aeybFYG7PIDxMmN7avo30rbznTFLL2Ax8Lr6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8047 This continues the work on getting the selftests to build without requiring people to first run "make headers" [1]. Now that the system call numbers are in the correct, checked-in locations in the kernel tree (./tools/include/uapi/asm/unistd*.h), make sure that the mm selftests include that file (indirectly). Doing so provides guaranteed definitions at build time, so remove all of the checks for "ifdef __NR_xxx" in the mm selftests, because they will always be true (defined). [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Acked-by: David Hildenbrand Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/hugepage-mremap.c | 2 +- .../testing/selftests/mm/ksm_functional_tests.c | 8 +------- tools/testing/selftests/mm/memfd_secret.c | 14 +------------- tools/testing/selftests/mm/mkdirty.c | 8 +------- tools/testing/selftests/mm/mlock2.h | 1 + tools/testing/selftests/mm/pagemap_ioctl.c | 2 +- tools/testing/selftests/mm/protection_keys.c | 2 +- tools/testing/selftests/mm/uffd-common.c | 4 ---- tools/testing/selftests/mm/uffd-stress.c | 16 +--------------- tools/testing/selftests/mm/uffd-unit-tests.c | 14 +------------- 10 files changed, 9 insertions(+), 62 deletions(-) diff --git a/tools/testing/selftests/mm/hugepage-mremap.c b/tools/testing/selftests/mm/hugepage-mremap.c index c463d1c09c9b..ada9156cc497 100644 --- a/tools/testing/selftests/mm/hugepage-mremap.c +++ b/tools/testing/selftests/mm/hugepage-mremap.c @@ -15,7 +15,7 @@ #define _GNU_SOURCE #include #include -#include +#include #include #include #include /* Definition of O_* constants */ diff --git a/tools/testing/selftests/mm/ksm_functional_tests.c b/tools/testing/selftests/mm/ksm_functional_tests.c index 37de82da9be7..5cbf3f783d6c 100644 --- a/tools/testing/selftests/mm/ksm_functional_tests.c +++ b/tools/testing/selftests/mm/ksm_functional_tests.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include @@ -369,7 +369,6 @@ static void test_unmerge_discarded(void) munmap(map, size); } -#ifdef __NR_userfaultfd static void test_unmerge_uffd_wp(void) { struct uffdio_writeprotect uffd_writeprotect; @@ -430,7 +429,6 @@ static void test_unmerge_uffd_wp(void) unmap: munmap(map, size); } -#endif /* Verify that KSM can be enabled / queried with prctl. */ static void test_prctl(void) @@ -665,9 +663,7 @@ int main(int argc, char **argv) exit(test_child_ksm()); } -#ifdef __NR_userfaultfd tests++; -#endif ksft_print_header(); ksft_set_plan(tests); @@ -694,9 +690,7 @@ int main(int argc, char **argv) test_unmerge(); test_unmerge_zero_pages(); test_unmerge_discarded(); -#ifdef __NR_userfaultfd test_unmerge_uffd_wp(); -#endif test_prot_none(); diff --git a/tools/testing/selftests/mm/memfd_secret.c b/tools/testing/selftests/mm/memfd_secret.c index 9a0597310a76..74c911aa3aea 100644 --- a/tools/testing/selftests/mm/memfd_secret.c +++ b/tools/testing/selftests/mm/memfd_secret.c @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include @@ -28,8 +28,6 @@ #define pass(fmt, ...) ksft_test_result_pass(fmt, ##__VA_ARGS__) #define skip(fmt, ...) ksft_test_result_skip(fmt, ##__VA_ARGS__) -#ifdef __NR_memfd_secret - #define PATTERN 0x55 static const int prot = PROT_READ | PROT_WRITE; @@ -334,13 +332,3 @@ int main(int argc, char *argv[]) ksft_finished(); } - -#else /* __NR_memfd_secret */ - -int main(int argc, char *argv[]) -{ - printf("skip: skipping memfd_secret test (missing __NR_memfd_secret)\n"); - return KSFT_SKIP; -} - -#endif /* __NR_memfd_secret */ diff --git a/tools/testing/selftests/mm/mkdirty.c b/tools/testing/selftests/mm/mkdirty.c index b8a7efe9204e..1db134063c38 100644 --- a/tools/testing/selftests/mm/mkdirty.c +++ b/tools/testing/selftests/mm/mkdirty.c @@ -9,7 +9,7 @@ */ #include #include -#include +#include #include #include #include @@ -265,7 +265,6 @@ static void test_pte_mapped_thp(void) munmap(mmap_mem, mmap_size); } -#ifdef __NR_userfaultfd static void test_uffdio_copy(void) { struct uffdio_register uffdio_register; @@ -322,7 +321,6 @@ static void test_uffdio_copy(void) munmap(dst, pagesize); free(src); } -#endif /* __NR_userfaultfd */ int main(void) { @@ -335,9 +333,7 @@ int main(void) thpsize / 1024); tests += 3; } -#ifdef __NR_userfaultfd tests += 1; -#endif /* __NR_userfaultfd */ ksft_print_header(); ksft_set_plan(tests); @@ -367,9 +363,7 @@ int main(void) if (thpsize) test_pte_mapped_thp(); /* Placing a fresh page via userfaultfd may set the PTE dirty. */ -#ifdef __NR_userfaultfd test_uffdio_copy(); -#endif /* __NR_userfaultfd */ err = ksft_get_fail_cnt(); if (err) diff --git a/tools/testing/selftests/mm/mlock2.h b/tools/testing/selftests/mm/mlock2.h index 4417eaa5cfb7..1e5731bab499 100644 --- a/tools/testing/selftests/mm/mlock2.h +++ b/tools/testing/selftests/mm/mlock2.h @@ -3,6 +3,7 @@ #include #include #include +#include static int mlock2_(void *start, size_t len, int flags) { diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 2d785aca72a5..0e18f2ca8d93 100644 --- a/tools/testing/selftests/mm/pagemap_ioctl.c +++ b/tools/testing/selftests/mm/pagemap_ioctl.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tools/testing/selftests/mm/protection_keys.c b/tools/testing/selftests/mm/protection_keys.c index 48dc151f8fca..eaa6d1fc5328 100644 --- a/tools/testing/selftests/mm/protection_keys.c +++ b/tools/testing/selftests/mm/protection_keys.c @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include diff --git a/tools/testing/selftests/mm/uffd-common.c b/tools/testing/selftests/mm/uffd-common.c index 7ad6ba660c7d..717539eddf98 100644 --- a/tools/testing/selftests/mm/uffd-common.c +++ b/tools/testing/selftests/mm/uffd-common.c @@ -673,11 +673,7 @@ int uffd_open_dev(unsigned int flags) int uffd_open_sys(unsigned int flags) { -#ifdef __NR_userfaultfd return syscall(__NR_userfaultfd, flags); -#else - return -1; -#endif } int uffd_open(unsigned int flags) diff --git a/tools/testing/selftests/mm/uffd-stress.c b/tools/testing/selftests/mm/uffd-stress.c index f78bab0f3d45..0abb9af0fc7f 100644 --- a/tools/testing/selftests/mm/uffd-stress.c +++ b/tools/testing/selftests/mm/uffd-stress.c @@ -33,11 +33,9 @@ * pthread_mutex_lock will also verify the atomicity of the memory * transfer (UFFDIO_COPY). */ - +#include #include "uffd-common.h" -#ifdef __NR_userfaultfd - #define BOUNCE_RANDOM (1<<0) #define BOUNCE_RACINGFAULTS (1<<1) #define BOUNCE_VERIFY (1<<2) @@ -466,15 +464,3 @@ int main(int argc, char **argv) nr_pages, nr_pages_per_cpu); return userfaultfd_stress(); } - -#else /* __NR_userfaultfd */ - -#warning "missing __NR_userfaultfd definition" - -int main(void) -{ - printf("skip: Skipping userfaultfd test (missing __NR_userfaultfd)\n"); - return KSFT_SKIP; -} - -#endif /* __NR_userfaultfd */ diff --git a/tools/testing/selftests/mm/uffd-unit-tests.c b/tools/testing/selftests/mm/uffd-unit-tests.c index 21ec23206ab4..b3d21eed203d 100644 --- a/tools/testing/selftests/mm/uffd-unit-tests.c +++ b/tools/testing/selftests/mm/uffd-unit-tests.c @@ -5,12 +5,11 @@ * Copyright (C) 2015-2023 Red Hat, Inc. */ +#include #include "uffd-common.h" #include "../../../../mm/gup_test.h" -#ifdef __NR_userfaultfd - /* The unit test doesn't need a large or random size, make it 32MB for now */ #define UFFD_TEST_MEM_SIZE (32UL << 20) @@ -1554,14 +1553,3 @@ int main(int argc, char *argv[]) return ksft_get_fail_cnt() ? KSFT_FAIL : KSFT_PASS; } -#else /* __NR_userfaultfd */ - -#warning "missing __NR_userfaultfd definition" - -int main(void) -{ - printf("Skipping %s (missing __NR_userfaultfd)\n", __file__); - return KSFT_SKIP; -} - -#endif /* __NR_userfaultfd */