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: 13701701 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 17379C2BA18 for ; Tue, 18 Jun 2024 02:26:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 675728D000D; Mon, 17 Jun 2024 22:26:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 625DE8D0001; Mon, 17 Jun 2024 22:26:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4517E8D000D; Mon, 17 Jun 2024 22:26:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 21F0E8D0001 for ; Mon, 17 Jun 2024 22:26:17 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D12071202EF for ; Tue, 18 Jun 2024 02:26:16 +0000 (UTC) X-FDA: 82242419952.29.A238661 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2057.outbound.protection.outlook.com [40.107.243.57]) by imf21.hostedemail.com (Postfix) with ESMTP id EF6951C0011 for ; Tue, 18 Jun 2024 02:26:13 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b="unfU/2B7"; spf=pass (imf21.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.57 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718677565; 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=NF9Ze1k6wBxs36mbUWWURPDYNQVjIyEe/phljaLt/7o=; b=zkkfTeWI8IfZnLrzxHEVPVV4WEqUzhrNo4xtcQPyN4Rpv2eAKm3OHk08mtDVaN3ZEQZ8He kc0iu/mRTrJ0b4UGPNTFqeh7PZfrR9qApnLReRHrI+z0oIdkAIOOZu9s67v8eEg5obiGsj y1CdGPEGCpHVUIkQs3b8Vy2YvoGG3yo= ARC-Authentication-Results: i=2; imf21.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b="unfU/2B7"; spf=pass (imf21.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.57 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718677565; a=rsa-sha256; cv=pass; b=wpTXasdZFC8Tgf4PCGhcbaw2E/7bt8Ec6PhugcvwiBQTJETVyv9cexpOMQRPgBhqtdgJis bYSTq690Y2Lfca4NU7S/uN81Awx8Te2+jPam8bUrGiF3Fpk8WSvKuNMV3rJHQzYdU6k2bT YtD9dL6bYO+16rEaRQpZ3Z3EJNoEp60= 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== 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) 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 X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: EF6951C0011 X-Stat-Signature: aeqxrrgyjbo6npwjkd4cr5hfy8h7bskg X-Rspam-User: X-HE-Tag: 1718677573-678378 X-HE-Meta: U2FsdGVkX19wgyFNx1ii8OxEihaP7PHL099uSrbm98LT6gEf81mJzxbr8nC98wkR9MytvL+eqMqLYNWGjwnQSEdP0Avybl7B4cLXuKuULxxnAnY4g9moDibSEzQhBzLEqUMUCaAqTsh/t4cMV26hrC3FXldRwlKzZE+OJlQwN3z0jnM46sdhJPoQ0H+q/gfdmPgPQlcSPgp9DsDW9za15wYnf4f01rRj44cIU7EmC7Ezgk4zjVYNYy/gfJvxzHtkfxN/cjUaLxiecAvsYwovGCTY6NpxGpy+GGnwbWS8cSZJz9PYNc8SB+CL6CY3I82fIHHSWoP8bTUHSru15oNXnZMcao0EIYMonYcndEpCe/ACK2dlPLZH8Y+hyS8p2D+ylHmWH5eruEm0AOiFchFInuew7WYmzBBaHgYF43tQwCt+Oixwh52jV33peWVzCI2U3W8v6WQNkHGsw+12Q4USJmuytH5sW94imw69Cu/bP0+MSEp0D8b2dooSogD+7ttV/RFjL3IsceofyI2Ztuce5KK8SG633u/B33HuhLMEv/n45NR9hk74HqC6CHmFwodMx7JCCC1vODQyZoMOuemw9O1Pu68Kj0r/+vAz2og1wCXnECafi51XdcKBQ3sh39CWgyz/xwkhRIWTVOtB+Iw/43uY1FPZBpKrxixmZ9w9WdTd9YycSzOWWdflB6YAawXb5EnvKyyisjLI+TofEusUuqPoiFFpdcXq6ouYDXfNPJmJNIQzW5W5NbVtQ8xfQfwQmo3wSKilnC/DROGHO+ul1/s8x+Iyh/03482RlLqBtHmRn9WkNF/OvDUhmuDwG2Q18icaVeAcK/NWx3oTyUpv8KQrKmiQ4aG08NMqeB3L215aPieQDnfVDsLV7gVGiHSfNGT6yhYHrYOVBvU5zdNBiMeBkRLLHV2pF8fTJlSVnoOUufCo26rXWZdBx337yHHDPF+oNzCRrMnXFVXQvEN 0RNqjtey /rqp3cLhEOZdRvY4Qf57AnTcBm6Iur/QpfFUp9FaYsfdvoP7lvMLs8z+Cnmj/pHaQkGOjt7q/Bv2Cd+UB9iwOTPlubH7LrLv6VbUTc6iVIPshCSk93w3Q/aOzjEcPSJ1w8sX+8Ntl9zrjmFmI4xi0mK2+z7cWFUzPi0WPL3SR2QY4E78fiixwxRWhVnHsiCfiOKwt3ARVPk+yH4YzjN+zdpxY8BqaHZqmJ+tkb6sdMuJQelwEYLfeeQgWcBUX0iApTze/S+tG6YpwTxWp2B+oX+0Wd6ive0r+lr1fjI6+yy67NUF5GIfSkmEpIftvapo2Oy6Ug9nFwg+HsGT1iTljY0r4MCbui1vekSSU 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 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 */