From patchwork Thu Mar 28 03:34:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13607941 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 1C810C54E64 for ; Thu, 28 Mar 2024 03:34:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6B6AC6B0087; Wed, 27 Mar 2024 23:34:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 666E16B0088; Wed, 27 Mar 2024 23:34:31 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 506D06B0089; Wed, 27 Mar 2024 23:34:31 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 2D67B6B0087 for ; Wed, 27 Mar 2024 23:34:31 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BE70CA04D1 for ; Thu, 28 Mar 2024 03:34:30 +0000 (UTC) X-FDA: 81945030300.29.FE63AEA Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2041.outbound.protection.outlook.com [40.107.101.41]) by imf06.hostedemail.com (Postfix) with ESMTP id BBC67180007 for ; Thu, 28 Mar 2024 03:34:25 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=kRVS8fDH; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf06.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.101.41 as permitted sender) smtp.mailfrom=jhubbard@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=1711596865; 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: references:dkim-signature; bh=Q7gxAAn7soYSg8z7cnnaL809zsycy9I6Yyatx8e6YGc=; b=BYL/w897JtMfh4hIxvqz/PuEkqoFU5lX7WQoV5QRwKs8bk43Bj9sk9ejRLnxoBxms/WR9r DD3M7IVE5U6jqKHUcibsTkZBtdqz61GOUc2FlReDYMVihOTEi+/oFs89ddbYVIRDB89Ebh F3iYePlIA3TNdrZvS9vgqyW1ykKnPaI= ARC-Authentication-Results: i=2; imf06.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=kRVS8fDH; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf06.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.101.41 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1711596866; a=rsa-sha256; cv=pass; b=k5IFqvBlIWrUHIDxS81p5Rq74QRo0Lc1T+37+nAGFdRrP31w28GS6+M5y4NVoD/VNLnjQK c7rXsEDZLRKd0RzBjMu/fbRqheVhVGp0Fe62gYtEMMvfHjmizkrTBrfPYjv7dPG9IZ91gQ /1Udja4DSDokmK2cms/PdmXDmXo3THc= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=inbfI2ny1XIeLgrGSs8vINGc1a25ZX9tC7+fPr+NqxKWwrxvRfy0ZffjsYnlOcBZlhuClznKnEDpeG2BSPf1j4wXo0ZfUSFgoiYvJ8iyK2iEO24CpcWXUR1vMqi3c2ZZYfoZItzlVALU+S8WbFicaFvkZiQhk0C8hJSbiTzvJ/PYSRr7Kbl4eERWkdr1ddorYElbDSpcx4LxtgD0wxmcJ+UErgEdZpu3PHsKPXQn/Ikv+XLz2v+nS5rjrMdMRng5VeNgc4dNcyHpJlROfj311MHLdOCHzzZQmPfsN1qx8ky9A3ifFnGV3YTaS6NVB6CbCgDeieI3DscrOMNt0lYmaQ== 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=Q7gxAAn7soYSg8z7cnnaL809zsycy9I6Yyatx8e6YGc=; b=OPRNOrneoFa7gTB6kE9eSJi9H26WwNFNJE8Ephp39iAeDmPii0VmleY/Qe9EmZU1kuhvrcmxciieXyCJr0WCkowsrSgebUqh8LsEH60Rww6c4xZ7V8HYgEv7Yeqtkc7OL+FwAm6+nAw7mzfLRzJl7LckdbbhCesBBJ6FMRpJiiqlrzRjjGCG7ip3SWTjjsYfgaQ927V2JK0xcdW1jnywalJsoTbIXZUvWTMDryPC6XRLVqUD5Qr1r7aJq7mYYlZN9qfdaCvPeE6tj134HWmJzK9W2u5/DDL2gMRH6f2aDoiw4NmF/ZQZfsXjyMF0FC912Gx0xFAY8XfjeYDll1Z5Hw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=linux-foundation.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=Q7gxAAn7soYSg8z7cnnaL809zsycy9I6Yyatx8e6YGc=; b=kRVS8fDHEM49XQ2TqawJk/V6BHzX1NdWpf/6a8a4s6K2uM/TCMWL3t8+KNa5TYQdREbulP0YWonN49/0B1lPhxgfquSQct4R+iIhn+0B+RFQfrcpNP31olKT4e24z3QP2AENNm3sp479QYJfIY23mhf/LL12i21GxPBkopU0PgYrO7huCBHB4C5z0jaCVJ5WdVfCjHt9fLM96vgQfb7tNAQsdylXU+7Y9Vv8DXjFb3zglVSCTm8FxYw0/5mYLeSQJRIA8pcXHrZYrxFJwhtTgB5/ll578nC/XpDakGBXudKo1sWHTfOOq802rJQHN05MxRXObk3Cylv+dXOxcOtS1w== Received: from CH0P221CA0013.NAMP221.PROD.OUTLOOK.COM (2603:10b6:610:11c::6) by CH3PR12MB8075.namprd12.prod.outlook.com (2603:10b6:610:122::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.32; Thu, 28 Mar 2024 03:34:21 +0000 Received: from CH1PEPF0000AD74.namprd04.prod.outlook.com (2603:10b6:610:11c:cafe::9) by CH0P221CA0013.outlook.office365.com (2603:10b6:610:11c::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.13 via Frontend Transport; Thu, 28 Mar 2024 03:34:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH1PEPF0000AD74.mail.protection.outlook.com (10.167.244.52) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Thu, 28 Mar 2024 03:34:21 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Wed, 27 Mar 2024 20:34:19 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.12; Wed, 27 Mar 2024 20:34:19 -0700 Received: from blueforge.nvidia.com (10.127.8.13) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server id 15.2.1258.12 via Frontend Transport; Wed, 27 Mar 2024 20:34:19 -0700 From: John Hubbard To: Andrew Morton CC: David Hildenbrand , Peter Xu , "Shuah Khan" , Axel Rasmussen , "Andrea Arcangeli" , , , LKML , "John Hubbard" , Mark Brown , "Muhammad Usama Anjum" , Suren Baghdasaryan , Peter Zijlstra Subject: [PATCH 0/2] Fix selftests/mm build without requiring "make headers" Date: Wed, 27 Mar 2024 20:34:16 -0700 Message-ID: <20240328033418.203790-1-jhubbard@nvidia.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-NVConfidentiality: public X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH1PEPF0000AD74:EE_|CH3PR12MB8075:EE_ X-MS-Office365-Filtering-Correlation-Id: 0945e720-5ee2-4812-2e07-08dc4ed7f52c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LsDwpfxkAGwuwgDVI9WVnr2omx8SiKP9eL3G7LK9JJrWphjZ1rMgaDQr+NS5nKflYmt/v2CpJ5TWlnyFPrQN4R1w/W2dlUKf43vgSJuhPGuu0xim6i7rdXnZIPo/55531/ezJkm4wOhqkyzsHoyIyJCHigq0/eXAyhio3SEdzBgDQyGr8y3Zb4ADT6Nv7J+oCz5cPuUBLDetB8qdIlGAt7vrlHiGrLUBlVjwPlBbIiLQQhlShJ8Eq4qDv5WEkppV55Q78T7kwA6MEiPeLTRJVa4d/OS6YPhmuYKhAQY/+Jl1KAwJiKfoQeYkegQncrlDNIqd7vP9CfivC1yaZMHhrSvVj9jIj5nqPWUQ4cUqS0UgW8sBOqHP5f2sHl3AId+1UC+OdpLGee97pzwod4lPMt8kd6hARm5MwnHJQov4/n1vDmIcKh+K2tynU9WKZ5wmUXqprC6+kbSTMRqhbCnrLa3Q5Ljy3Yjg5872meTmKbxlcRzhoy28kEvUZBMU5QaLMZz/K89h+JeS2WMcw2AlWdURELvJuxAT8scBUJTrc9L+waSDNzCw3v/+faYCk0tjPD4D/ndOyrJj5RCNWK9I/Ds3KH0BESjxXxQQ626F/L83yBvTH3l5C14SmYgI/IIebjLTl2VLSclKK/+GxRSY4mwiOyzIwSXb8DEd8RGiQS69mX4re52ipo/DMlXxj2Os6UUhSss4AxwyhexMtZLl3AarvX6aG5xJTa9/t8XTLTxB3ufc68KCO0knHCUR5oX3 X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(376005)(82310400014)(7416005)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Mar 2024 03:34:21.6610 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0945e720-5ee2-4812-2e07-08dc4ed7f52c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH1PEPF0000AD74.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8075 X-Rspamd-Queue-Id: BBC67180007 X-Rspam-User: X-Rspamd-Server: rspam02 X-Stat-Signature: yo8og63csbh7j49yyia48nkcrkoiooxs X-HE-Tag: 1711596865-526496 X-HE-Meta: U2FsdGVkX1/CbsKOIcGGMNk2/DpPe0mmTUgzFKPL94NrJfKgGF4sH7HlKKD4jyoaYEOYp8bQqeRRnU0KOckrWTQJPmbvBcbR5puWOQm/BAPHRkEsAAUOdyVjBOSKDfIi01Zm8p6nmSIpBCauVYDq56kkWqyue/CRKtY4U8NuYf0tf7LefvSUOmdshNhIUSTQ6PRxt9DrWaY7GYF4T0fhYXsfpnqATitTI+kMjqSZgprzkq+Tgw4giBSxcRkV2XeuMPQUn0fEImPc6x3WQ0ii/phLaUZlc/WK1wOTsIQ0t9vGpUmJFPfajSzFJUMufk89glPF3SW7XhnC4ComUzq5gJnAmDrt/03wMsp7ps4su9xwDn2YFhw5F/tikj8aaregIiIoMV4Ptn77f2s7smmGnnHAbZzhMLPuTGMFUR7DUbvmJQr7FEms5Hvm0FMBnMtg2grmnpZq4u+0TbhWBhO3hsUYf0RCFCks2p9qJnKO83BX++2CemD72kRMt7BqzNCJi8POhEq17ob4AdlmhmfEO6UOrbdxEbm7Kn2qzZfOigEor+e4VKyeaNDQwykGml8tKySxdM7WDw7/IjdfsgFuwNSAm93dlweSk+iTtylqUaVQIfUHf6z03qblUqifM1hHFRw5NGEX76hO9c7XFezQe6Pl1TYqX1kh1p447v1fjMHHksAe6DpjKv0KEg4k8xUDdK+cHbrPAh3Vc3dMnfvKcEqccminHvYq4YgEND/5n6niHbqXTrwOsKfU2SiTNNEgR0Bw/Gz+oLHyfzRmapPv7XI8M6TA8aXgwEQEWHSku3pBZPoH1cDpl86rlYRfzpQrkmfI2WqWXaeomg8Gfr1HruwiiigRCMWK2kL3Zpf/9idpo8SjwLRK9Ar6gO/ZBseUY0h6utF2aomtS3ViF+kWaKGatX3iDK2dO4NmTe7OdmIZ4ZR7NhHDdleUrwkwEbU/3taSDsn3NCXu0xjgxCv wNdFs5nD ksyLZDUvQCtrZoM3xsA5HxOIKDDT51F2FhyC5WXkNRofG54C6l0zkF67sIMQ0pyz+Q+S7Zfn80k+rydDXU+KiCJo60lo6YrCZ4+lir2Xsplf1zoJLqzuY4c5vML77w0tRtkfTj0Kt6ORi5EMGutQBTRZwtAg+4Evj2g/xC9pe5zfk40JTCIkO/IBs+HvgazX8I8nWEOprsb4iTk6wCUHhwadtSjBHm2uVbGci9TdBpiYSqnTG0jImOW9Zxhy2vT11qb7xw7fWRb9EgrcsCN6m4aU3Mfj6dMCwY55IE8XK/JD4olAXa+Rns77uvfpMi4/RNHRrIgoFY4T7Uf5ZDxY8cxeIXlqR5HkPsOmDK1Dr0hmATKp9VDncO80nuXQLnfkEJHCGOTb0jZIu1DZzfI249h7I5NCmWKMdximsBXsRTUtLwmOxnx0zQIN83crGc8EmmbOwWkLzF0CaIue4IOxtLfFrtsrJQyONaxFuNzG0O3LGgkI+2N+FGlB83pbOgvYLtdHvFarrcy7WWPqCpcc5esI9R4hO1seWzLgbvTOHgG7IOPHXpnBSirs2pQ== 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: Hi, As mentioned in each patch, this implements the solution that we discussed in December 2023, in [1]. This turned out to be very clean and easy. It should also be quite easy to maintain. This should also make Peter Zijlstra happy, because it directly addresses the root cause of his "NAK NAK NAK" reply [2]. :) I haven't done much build testing, because selftests are not so easy to build with a cross-compiler. So it's just tested on x86 64-bit so far. [1] https://lore.kernel.org/all/783a4178-1dec-4e30-989a-5174b8176b09@redhat.com/ [2] https://lore.kernel.org/lkml/20231103121652.GA6217@noisy.programming.kicks-ass.net/ Cc: David Hildenbrand Cc: Mark Brown Cc: Muhammad Usama Anjum Cc: Suren Baghdasaryan Cc: Peter Zijlstra John Hubbard (2): selftests: break the dependency upon local header files selftests/mm: fix additional build errors for selftests tools/include/uapi/linux/memfd.h | 39 +++ tools/include/uapi/linux/userfaultfd.h | 386 +++++++++++++++++++++++++ tools/testing/selftests/lib.mk | 9 + tools/testing/selftests/mm/Makefile | 2 +- 4 files changed, 435 insertions(+), 1 deletion(-) create mode 100644 tools/include/uapi/linux/memfd.h create mode 100644 tools/include/uapi/linux/userfaultfd.h base-commit: 98560e9019851bf55b8a4073978a623a3bcf98c0