From patchwork Fri Jun 14 02:30:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13697739 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 1921EC27C4F for ; Fri, 14 Jun 2024 02:36:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3F70D6B00BE; Thu, 13 Jun 2024 22:32:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E2106B00BF; Thu, 13 Jun 2024 22:32:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 327EE6B00C0; Thu, 13 Jun 2024 22:32:12 -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 3A9EE6B00BE for ; Thu, 13 Jun 2024 22:32:11 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id E7DFB1203E7 for ; Fri, 14 Jun 2024 02:32:10 +0000 (UTC) X-FDA: 82227919620.26.A133F1C Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2041.outbound.protection.outlook.com [40.107.243.41]) by imf30.hostedemail.com (Postfix) with ESMTP id 1A6E580012 for ; Fri, 14 Jun 2024 02:32:07 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=ZzJoLkAa; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.41 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718332326; 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=lhPpRj+9yaeRdjrqVKe2AajeBxh6x9UGdGkPrZPPJ40=; b=qj5j57qopErbOXVio1DSwu/6cxITq7T4W/vPgKhTWn10SzZHlkoCRVROQGSjHTtYL4v0N7 fFhiULmZr+rPCyG5PqPeGO7PKoZUYBbsiYJex8zxclOv7yq6bPQwk+lmdMpgI1hkScUslZ WR7mz81CPPs6qc9AEBs1AlQoTZ4J02g= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718332326; a=rsa-sha256; cv=pass; b=hqcaNskTDldi6hqsfjID9jlU6ARnSX/ZEvJUOK6J8K3Ceh902N/b2Y09S6XCF+K3PiW6qi fT0H42qr1HIZkCx2Cnne62gt6MRtWYk2Z5cQwg2Sgo3Kz2Z+Yxzor01V2dVFjpWVmYsut2 YKjxOSDW/Rgz28BrG3NRzpfn7pXaV1o= ARC-Authentication-Results: i=2; imf30.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=ZzJoLkAa; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf30.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.41 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MrlaRwCq9sGJMIRlDAlDL35Rs+Cobfnf9x1DPFxh0ndYuVcEh+HsTteZ9RtlpDKVKdRC0rgHQMV8Rh+FMmbzaHQCJCT7c/ZoxaKrcfjstksA9H/o8U30yyXHgd3foz0DlWz789r5/noBJ/ZLNLhUQPiaaxkfnlQAM/6wAGzTHwy/JHo1JhM+604qLaJ6CsnbevBDJ5/G+S0UgCJloPJmLyfveSqs86kSiLj0Flr11G+s+mzV2/k2IYOT7NcMOHXR5b9FwXsctyh6U+VqtXhLMiVpEiyEouW49Hl083y2+Vl8+TfUmds/hveHckqEpEsyZjBXRplwA9/2UlJkiuPlAQ== 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=lhPpRj+9yaeRdjrqVKe2AajeBxh6x9UGdGkPrZPPJ40=; b=neuzttqk0Hav87amCCDqonemyxg+dPkVhgxgMgAEcPfwfwGonAaoIlplnAgjvBFTj22l82wfmoI9QHrmh1Yo5ScEdpdrRUtSu1Gy3Kh1F0hMAVggtVjktDtJNnl8gMXAPM+TV8GOhvXBgDsk6yVqwm9btYSBymK0B4J/O5tjhSkseW7KDuK0585eCQA8nI9aehKAQkZELLLXBTo/B+I6iCSYjB1w4fx3fhRVK2sLXeFZ8vxc9RNz1Wi0xwC8t5xxiXxZUxb3k65Iiqa8J4RDUZjB0jSKwJ7e/xuwmIs8WAdsV5E1FmoUbxKwHX01goWPNxqmYI355gVxs2DQc8OEhw== 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=lhPpRj+9yaeRdjrqVKe2AajeBxh6x9UGdGkPrZPPJ40=; b=ZzJoLkAatOrCA9jv8XrVLP5e25iqwhPyFljrlByBKPE5PP7mWgoq4rXdFF7ftuM2oCs10PPPmAMO0SrtKJLW3Srnz5eiAqgLuPx/GyqqnFJS/KZKHLdI2S1u1BocOr4uPyJePSHG/whBdG+LTxo3oT0XTMpjGeh62qyGqUoierHryOYT0dG/CIzF/AagaF1Hh6tuvoXxDWcGAjQCNdrvSogZqAfUqY+3MT878bCtt+f8eAcrZWSoSlC4983lIrFc1cxRDcaR+9J82kfwXzodYOtVbssyMBI6JNBZ83MRl3AABl/Mll7IrkWdi2RMrT0oADJtAq3XLXRUebStvg8Atw== Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH0PR12MB7932.namprd12.prod.outlook.com (2603:10b6:510:280::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Fri, 14 Jun 2024 02:30:15 +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.7633.037; Fri, 14 Jun 2024 02:30:15 +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 v2 6/6] selftests/mm: remove local __NR_* definitions Date: Thu, 13 Jun 2024 19:30:09 -0700 Message-ID: <20240614023009.221547-7-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614023009.221547-1-jhubbard@nvidia.com> References: <20240614023009.221547-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0152.namprd13.prod.outlook.com (2603:10b6:a03:2c7::7) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH0PR12MB7932:EE_ X-MS-Office365-Filtering-Correlation-Id: 09e2e3b4-b642-4139-3379-08dc8c19ec7c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|1800799019|366011|7416009|376009; X-Microsoft-Antispam-Message-Info: kKWx1pAaLwP82DmO76g6nbLUUTTJ7KGseWUTV+X0IGKwp8v0e0AyMCM/FDt+g6ZEDCaqNwOv5Qq24WpMOSbJaUZcZ3PSz+UQqzs5e7/S3vsloijaQUJBxMMuX8eNgxAbO0xFNbfymoLEuJJvgC/Bm6cFXDDomgRseiAvJEoqQEpRdqZmo7vCe1DpVmPjyrlcPnmL1ij3y721Ihu6fy04Q/JZJiezIcqSaEAt344h2PwxE0/0QuVIGAJpPEP5baVf9YxHAGHcmt80qt+QXpokBW1YDdea2y8+CkVZeiDNnMlPNqAVaQIDCHqe46Avaep6GSFI2ABw/hHC4LH7X64Zeo2G/N6f+b9jvwMRb9Eoki++tI7u3mRfU+dpEMC/GP0f/zpeLcwWejznzHBzIXoDc2kQ3Dvnab+0O0JpjEBV97DzR33KeFAPIAloYojcny2DV6NTrQJT6Gsda/4gl+iyXbTWsueculM8L5lIXUAIO+CoYUjEMiHs3Kilfs8zGkc2UsT1Xi82t+IiHejUzw3Kt0nH5pjZvRAGxpxOM4LZ1z0uwmTWGp1mGQLa8VkrknYY7uQzY9TX2JooqEcDBppFXTbkroVXLgKUd6rwzD3goGibFh0g7Ei/aGQkAHmuSeCqjxbppVAuYUG1ZYt+ZjAhAeKUFaWb7PcD7FdfRgbAVNFMqQBr0huMtf2ddqS/fzIPgjOJtGq2FtduGuBZd6ITKQrDuLMDa4pYwWOJvcrim4UNnMgdwr0LXYlWCeN0d0FuKqx+3OtqglMjwr96FXezWO3CGQVXjTE7O+CKK3SYJOfLkTdn2jK+KHE92pi75eOHPF7kNwkaf6foSjXRDz8yluXBI4s+voXU0quMSMWPg3zyPdQFHk6C3lfTbreUjFvNk8yTvjivS8O8lBeGn+BMWBWjcMkqbeJCqQWM9iWv8XZ1V80ON06N/+rfZafFaQeVK9vMxvtlclJ0gvKUpihpWs3DO5RpZxSEDEja/9UjDEM/90IeCSiMROB7A3xBNIJgRsj4ny7WRO9IJaR2PcVe2w/EpKpWzncJtwnEBuNMNAnlMyaTT9YMRD5goklXM2s90UHANNp9M0yirHQ3BdiAINBfDQiYyAZfVEcJeFAkjKB164+aZSeKICkTEaNVH1N3g7MqjVVykwpY1Mcgnd6Rm4C1UTpFRICNEKzRnsTbnLPGnB87MLo7qMejO7sMrU1CTUvHye8w/qZSMrUhJwOKs2l+T4XtKm3BfljSV3SAIPR9UoPSz5E71nxQwV/a9vc6qOiXvW8xqDrh++Tj3yFiFDoVlR1fDGsTRu9t38VMAI5QIrz6wMEWuz++nWp3kMXH 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:(13230035)(1800799019)(366011)(7416009)(376009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y0Q+qVAedrLV9rJkHNTZYKFYbT2NXzZ+OCLdZm9iu+l/TBpmUhqoSuuy2It/B7CA/99pTuAT6lwkXlUDGzXSuX9NFcO5k1qIqji82xlYCQm3r5y326J/yifB3rbN2XnTeLzvrRgPGWp2AmFT4UqeE8i8o8dwLM7oLW9oWuCyWVznVAWdrRxfgn46/TSMlMA/K9I43WgxFXDh3GmFvZrDOG01oj5rY02t6NIeIpUBmifIjYDKVxn2wBw0Y+KcPI5CG4DV2iU+aBLroiG157d6ORFQa9DDgOttKEvgXCXQaPxSzqjFE8TXyqW3QxAkHkEJhPkbUoSJ9Ky3iEXP4bGLIexwSCuGjTJUH3TxB+bpbpdNLZ/dCqKnE7YoD2LEswhC8THH+eWhMaQ/fmGC0yWjZdQliL9o9OwWqQfq/9MbvaINoxGnNuwSyf46P+e3OadFVZIjmciE4R1iMHVqRcF3o6mMyUfu+M35x7+i5TdIzKVRuO+xum5KsqKDYdoXtjs/DOiUafqAtTV8H+IMFcRTnDkMOsKyVoQcjXyWAzIV0l3RGSlwmLTGYl4QiJ2oNlUDhcikic3wZP7WyJL5ist4CZIAR2vwi0l816/j0eHq97BuctDvcCbacBdvoxSa0HbdSxduzL9+UhsUfj6j9dOQHEnr9ztSueJ1tks/vfYFZJGQZDnu0uJhD5IuphknzjeSfLILGW79LWCi4Gijq3M1we9O8N+BIcHPFc4FC2QfnzzEI0BX9wUUYX6YtV0DGPhAht/Ox1YickJvKSk6qTPNEmtb/D6S/DvdJLJ+MWtOqjFmW3wB3QWyco62UhJP80aIOs2bo3a1H97O/29qZ7GBxjSrgEQPyY4Q7VAip0UPdCxgdtsmhPxyMhAKYmU0Tn7d6SHvkiLq7WKeZ9apSkK7VtnJCQASTFtkHILVNXva296IuxoYkpFcNB6XK9w99LbbPFrcdW800c7OOIm7jmez4qikcgjYYeVAYiETVb/3X33v+U1aVBPETo0+f3PLQ9tOgenWdrkGYPspzi+m1FwiT7PO35VfJHI0SC5ztjkXpo3AS5YUwKwG+A22S8LDFjUyf9s0AefAh/Wujifj5E6hzIjNv2VSeYuwyNW4AzjFpBjhOfdj+o+vGsA1tPHIzxPahNihBEvLmPTm4mIgxRjD8cJFL9rUpcHDn8ku8EoYnwTWYmQQopwahwcnBM1ycb4ginjq+kPhfp4KZE+wpLXnLzgyqme3X1yAt9snq/Ylm3xW/bAxTSRUawmx/iBNSwr/4qmCNpYh5Nj6GpoGtLXsTvam56+3R9RFHti7xIjZOyxQxtBuP+T3Y/Oy7ojZInnFU2nVjKnEKZE4Wtle+S7+dieIr747WwlgmDND5Rdl+yVkQJhzGdq9cJAsqxW0sTbNdYGxVdpROn3EvU7BcfrYEQn67D1alJG9wq55AIUEpani7t79/ElIFcflByKdYLxpfg8aETVR9acmYxmHl3FTxdq5XdIfrEGSm3FxhRpeJie3i/jvWDUjiUVW6NQ3jezU8uW5qhJ+I/nC5SCAw0g+YdTN1jM0rZOdtrtRYtSY/7VU4/Hf55mkxqp3fUd/zh2S X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 09e2e3b4-b642-4139-3379-08dc8c19ec7c X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 02:30:15.0077 (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: zUu1l8nLqLCh39svDfAWPnpmKac4bEiuUGbYus+CVldCis4Jn0bE//QXtKlrrlzraoZxep428Z+EccwYnsqISQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7932 X-Stat-Signature: 9an6hbm6sbn81ipxk8ezsx6iduc4o5om X-Rspamd-Queue-Id: 1A6E580012 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1718332327-842061 X-HE-Meta: U2FsdGVkX18HOz6XtN39fiPaHqFTxmEZbAgTPvwjZef5HNLZyj12qh24Wif1a1goay/4nmYjP37w4Z6/7vWK25uXXWs4Z6yloY4epR2Y4ltLHauZQ1YuL9s/+i7cUDyFDIqzPaqu1GkGyeM0+VJXC324I17g/8WnW5IrRJuI+YR57ffIR6qyvk7fD4YyWzISfqAAzvUBw1djHvLv68WQOcOOrIjGf/7jRNfBwg1RzoVtBPMlWScjSw1W+ogVEcKhC9esu3S+KTpFQ51MCApQCdeTDZlrub3Y2rVAmIOPd2i4ucMoMNW0YXM9gaJLITmEHryy9IQ63/60AV5uLQ2ywg8CfTccCiOFx/czKDWXZri8bFhaXFULnMHi6pmXqn5akvLqwtoRxaIagY4NBFU27dHqr856+D8E/Jpi/VysjpFyiLUsum/mKeeKpHaws095j+gU5ELUXZxxhKDHty7lC+bWy+PeoFRI7zRGASGkkX/LOdWdt8P+/zZBGGqAZfKQuHYZd+2wQb9fWb7O+Dt+120mLYc2zube/gXvwoBFHFqc3a1HRIXQfIpuqgeYT8ZxRQGt9t6x50JrghLyv5eyVFo31MyprC0sPMYFHOCWgnd9vqjj62KV9XPTDn9UB9YnZC7YUQ+i55OXasZxL230mrY6E3Uy9TFRnVHqLiDESOQhCHT8flBxZnHiaWq26xA02IQm4ux+pK56Tydm1atNq0l2WBK2jsPTd6dn73LEQWCfnDRTkmO7855YM3BohbpXK+vzm/H1sw8+gRTGhwdaL+jlT6TsCOJtuGbjpq2lwnDZcAkMi/LBtBTOPXyO5W8eyY7K9uPn6T7PMe5KCxJzlDgIKP+POWplksF0WXdoYT4EjtMVIkdzGIOg22uLaey2Oxi7Lpgm4AmT/dwXpmmm7/YonOj9xA38LGfbFMlp8zTi6O2WmHQ4qUKVsTIMPH0EcbGPlVcqtMtkTpoC1oF Y89cDWsA fe6P2+Feat8u/DOLfjj1l+jDzfXVEQ6EXyEgWwsnatTo3fI8PA7wcp38lOZYTbmhBLslLtu9XYZVbmPVSX5M86V9Lk7k7urugVkBHpqmL2nrfHMgln2Xd5yVJRay/S/HxPnjMuT1zeBmzUxfcM2F2cq17cJd7o1+2tGhBOyB5UgxNB2rc9MybqhqOg6QJI7/OqBQIUZ1RiJ2aUy4eBQVluN82dqmagHKuM8J/5t7FJXaNLRNLgQDsBPEAOgzuGnXnCueXoy27Zz1744skWcJlOmvnUVt28KDfU8RYCyuIXSExiECug6C1CulVi72UfS5XGFatSvlyEplJbj2joCnfj/KcFVgDntL2RlTa 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") Cc: David Hildenbrand Cc: Jeff Xu Signed-off-by: John Hubbard Acked-by: David Hildenbrand --- 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/mrelease_test.c | 2 +- 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 +------------- 11 files changed, 10 insertions(+), 63 deletions(-) diff --git a/tools/testing/selftests/mm/hugepage-mremap.c b/tools/testing/selftests/mm/hugepage-mremap.c index c463d1c09c9b..2893bc002639 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..1d584a415bde 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..1fcf65c08c87 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..7dde5b9a9ef5 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..b74ddf0a2c39 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/mrelease_test.c b/tools/testing/selftests/mm/mrelease_test.c index 100370a7111d..a1b761940058 100644 --- a/tools/testing/selftests/mm/mrelease_test.c +++ b/tools/testing/selftests/mm/mrelease_test.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "vm_util.h" #include "../kselftest.h" diff --git a/tools/testing/selftests/mm/pagemap_ioctl.c b/tools/testing/selftests/mm/pagemap_ioctl.c index 2d785aca72a5..5652e5930854 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..ec968db9e6c7 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..6aff0e8cd961 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..6298a2045095 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 */