From patchwork Sat Jun 8 02:10:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 802861 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) (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 BF3BBBA2B; Sat, 8 Jun 2024 02:10:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812634; cv=fail; b=nAqbO5yoRLmrkygnzDTZcYYcnQmZB1pxUD/ckz2FxvDN1zkNuhYuR4bF6IZRQr5RuNDGUiMYL3tYo5ssW7OwiPjSfBvLGN0a7NaPeyeOyJYab3q6GphZ3fL+db8y7yWyViiJhfYrcQjXU82n7PScnXMppgQh7DX9RnxQVVK2qKk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812634; c=relaxed/simple; bh=QvtB1loVAGwsFskc0nC5hPabySSxVEKKh4Q2qWovAKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=YWEO4Q29QCP+epXOJsdZ1JOjED3Rl0//eHd6f7HjhZuifqz8akr7mpXixdyzoWQwqvydUxcHpc5/iWKG5kDdthnSuc6XfBL2+QRmLa9wb0BcXVLmzqgBT1mc9zNjJguDFojew4PhtzrrDyuM5lTpiOig2PxsHkTqek8SzDuZCm0= 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=cDBEEQxo; arc=fail smtp.client-ip=40.107.243.73 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="cDBEEQxo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NrYZM7KYHtVcNtbQQdKshQeFGJE0HIGpKNaf2ksOiJoNQSlZ86z7Sh57IT+Q00icST7tFjK+fGam5cFMeQZ1AimayltTjPeTjottsgGYR0HkXwIr36jk5N67wVNaaTbuaZZLISTSDx2DtRrHzZfOTAGBfwUCtT2l5DZcX7kgZbbKY+CLzFc+fL5mL8iBL8NM06DIGsF0/CVtIOG7GBCgo0w6yqiOZHHsg+CQmmFJU/+AbP6dQ3sYZsnHYnin1fbNll0h6BagRdVdz8+WghcV7D2iIKGrujeEDIbE+10hyBe+vWqxVEe1A2Bb6Tb+ErvLHGxli9Fx1P7srJTPrRKGXg== 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=ZXZfY0TcuwHIFCWojdHQyPgCzHtD2jyu75gGuiYghe8=; b=BXCNmMoZvNcF7bPYHxMjTEYrpVH2bsHnAhxa4LoTA7oMx5lCdVJ0JoiLAuSZdg7tJ8dqH4mF7eoWK3mW+ED6VLwu2zJ0cRs4mtvyXv8CN4tJtDSe+dzKkoOLklLlZ1ke3hrBvJBewsPI1Jwmru67pNYYvSFweUvNm0otZiUEKvO5EHwHzEkSe3kgOsWAxfylFCbew9aoOHU3wH1P4QqyeFp6+OQLUZOhQg1r57KoREGTdEnpF+VtEZJ8C5bb17h3jvgXsmuljX2Dga6UoZTKr/BNQZvhUitb4ghpFaM7Efp01erg/4Z0Z8TQe2HLM45qgoJfFL0k2tykBfxyF1J0xw== 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=ZXZfY0TcuwHIFCWojdHQyPgCzHtD2jyu75gGuiYghe8=; b=cDBEEQxoqCMLJ/hHyOcwCI+VE/DD+/wG4jTGa5tw5jf/0OKBy37hVMe0Xq3TBdi5a+DTCdu0PdVZdaXnGa/geWdaEWxnViN9PVYpWPL2MuMDTN1UDKhea1x6lzzerDaWy2ksTwArMKaEH8yNO/dqARjStl16vBkXQ2VkJExk0HJJi3ReQLpPr3+KhWc7TeDDs0mdz229N75Jj+3ostUITi9wBsVtpZPrku8zgzZeNXUqS4ZOEewESWH00Gvqgd3l4p82sQIA01Y2t+WT1iJQ833uEAvVTKAAkNNKRGfTB9WXJQZC3W1lkA7bSoWnRNNh0AFRtF0pFS+/g3XfF95rdg== 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 BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 02:10:26 +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.036; Sat, 8 Jun 2024 02:10:26 +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 1/5] selftests/mm: mseal, self_elf: fix missing __NR_mseal Date: Fri, 7 Jun 2024 19:10:19 -0700 Message-ID: <20240608021023.176027-2-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240608021023.176027-1-jhubbard@nvidia.com> References: <20240608021023.176027-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0123.namprd13.prod.outlook.com (2603:10b6:a03:2c6::8) 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_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: 86d6ebbf-5e89-41a3-922a-08dc8760295a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: 22cqeRmmXd78Vy82N8Ruj8Gu3Vn0KZun/ZH2R/qTL+afJeulh5F2VybYVpc6Ku0J0ywyn9E3hIlQ2Qsm7NFsZ0aGqPM7YkhtOvSCgUJqa13Jf8X/Ph3tXMUAcadYegabpM3DVn8F14D5RhWDG357d8vPvWu0EOVR1sKgeLFxXd+LkNIO574RNPZSyu9f1t+XYVZ5e6PE1EtJZAFa8eXUFrdQzGX4cx2cwqNK71hQrG6kQgLDgur0+eH6zHuWXIKcI7rEFR8Ne+nTkyZ3V2Nw/DeJeTqaWfYysyY6ZtRwaFy7ScPwIY/hNstg4dsx4mDc4lLNvgsLQJEZ9A4QaLxurD/p9VZnzJZ/RFn39eYu7nbfuNBWyWDWm/S2uXxyTOTP59dNJ+7+S3Yz3S4afmVZNyCuT85A0Ceg9ID6al0RvPOUHv7D8CTnoLYc1JcBcHM8lY/mkf15fg73fgb5RwuPNMpjxvdYL5t1mKzc5OP30tR+Ky0g9Q97fch65oInNb/dqS4cZejTihPyxGJZL/4uJgFfeoBNqVlGA4PXVRv+ghd2T+NEG0mlqfHfbdDWze9UBIiaVQ2JhtHOJLwHZQ//6L3cNlIca3oMpKNaOyy4nG9+9sXlw0NlCudh02LK/BQONX1ASTbHLWTt8Lp+ndHzAVJEwf7COF+NtlfIReDrNsYNGWTNlqHkrbZOv3PPK1xx6f69+MRBBwrc9SzPMI79zTXG3vDXctSdTcSzrLet1kPo0cEF+VHF6VEY8owNXDE/fRpIgSERWQW07HVOBrrVJVBwsIYRGzBxjEnCpu7eGB/DvQc9LIXPeXAH5d7hAeXaSi3d4S+tWCNYsszaYr2MFb3ZN9+H2gaxdjMoz2j6PhpEuXnPadfVyOHS5zAoXDTsgbbtTKaDWmsrIn4xC24bzUIocGULYHulJGVAWS88PvpG8ccVJt6B9w0FH33NgHfXfR2tQDTQ1osC+387i22VTtjTOGx223HeIn0KSD7YqhFDlO5WrgiPYhh+GUKwTdH1aWOd1akC7ngKsauOz7cNTfqWHi/QbLsDsaHmCpj+qKKMI6QUm3hCr/71YdOiuB+t9PfGs+XxlstD3MZd1e9C5lwn4nF029S28mWpad9mmbxGTOFxRFAM4pG6S+V5DtdEgvLYu1QBVIJExcmWwlkssMVb9iwRrCuh83Jec1Sg2RYMeydcdXywN/i9cO5DeNXqvOr2Qag/t9SHG0rSxd5MqOoVMDfhsItFVgWb51/oklBJQTN6pJvy3L3bO471PyYPwdZrrhSI5lyL8ejZNSEy++R25QJWA9wZNv6Rg/DqQr+UQZJCk+OR5WnPptzL62+L 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:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: w8r5ksIOt68PyACMRIly7tQfNn4/x73dlkcGJXw0yoUiKB3r/nVLcRQlfzmRsIgzVhM6k2M/6mB7rXzJLqdw7QBmd3KCGFsOJpP0jbre6zbMvENwPJNEy0tmvi3IAAEV6Ak8nFtShPYDYFQfcrZ13yvG5wUEW+Gu6S2FT08evEz60lEHl87hqkgDB+cvLBryqxGFHq075rA/Jk8oU5CC+kZiSgxHS6mQMXT/J9zFXJNs6HQn7kekeHX7ylpGUDFMfbcqqfamsfg7e+Xz3Ba2Rpkbv/WpJ+kWf0n87jZMeAJU5eBe1/wSPzguzzQ696O8EMYNbckWUkD7NDoOX978MnINkSFhT3RUBLkpiLRzgLIa1TogjYpUlqMhKgW282nLkgt/uWqOD+AO/dB/9PNY2oHb1pmSDyJsRDT28RFhVU8Rl/ENVloYCBvz9GEa/V430zmQD7x6ZbCVuoPwOyAzdWDn+bZuT1CyWHFgvmZCoEyqX8pd7QAI+ZMv2mam8FNah5h0QAF4B13Ovvota38d7QRRRB3/tSApP+5AuLUF5UeAn35wBihI0FvtnSEtlLMc9Db1uBTet22+ZcnyKsMRZ+I+9ah3XdOWRBDP9vXIMx/XVfZQpq4/RpFl5/XSlBiGlzHRWu97h/9ej6kLRtQ8hiI01ePLt8VYI7QfNcGK1LsKxw4MyrFvNoY0Q0eptvgyX582/6Jn25Uz+KD6WFE+7WvzWG7DVtnJsGSAfiM+viO1uzUFq8iPhsNn43bqlLw6XJ8aceNcx1XUzk5kKJUOJVbtKlzIifi/nsZjLEbgn0544maxTXwFo5mRfS9K51GjMEN+JDkh9+v2o0+XzUKmCFaRqmpgzq0tWmzRdli6+d9X298KHzgOVAkG2wNyxCCoXNhQvmJCJxEjXJc9KDCNg+oiYUp9iXuVlZSHQndCuXtqATF3y7sg3gvjeL/0rTkiHJgfTkqyHj8gRjQ4oXcEUOZA5iYRS0clR3O9pMyOaCn10JB6XNhI53CRWwtg2wm0CHShrR0i1XwuzfU2rSUUEPIpTdbEc7NZ7pgwrKSizlILRJVgXd5gkK4NFraYxo7AQi4FN0HQepRfxOpRzMRCWVpzxDr2+culnoPLXwvu4kRS2WVFj+KKsOMfIRA+HCWT91SsgSKKl8YFIRNxgGIXfD8oDr9gTQ7lLvmx6i2oBf8voQuoLwWK5JQaAmVvg6TREFfPfglTv7VBA/QGrJkzcGxB4Okl4k9mN3G54hCELU/TMNRr2L/s8seevUU2W4OrH6ym99G2a0BqNaTuC+81Ta09wF5Pk3AIoPPlqV1GuhcZHaoRwngBdszDILBDKWr/zwiQJp6+HZH/gix0QEy353uEovOgwmuLwBM30Zv43sZ2XmgXamS76AtDqO3Bv2d8gEPXXp8lOf/WTo+dVMpNBtxBEU0CQg5MaBnEF5abeagoFCTZnVWRDte/7LUOEKBKa5g5i6aZns0IDZz8JMeAiJWqhO5cQf5LiLxkX5p7C0rUEG6ErqCFicGO42DH++iRPZRqZxBXHkUKUyNlD/Xi5Jz5xxn3he3swuxMIaZ7WXz/ponKeRmHXk8PQKc2l3fL X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86d6ebbf-5e89-41a3-922a-08dc8760295a X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 02:10:26.1187 (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: xTGPuunX/zFm+DL46ptsb/QWBaIIUcu6VW7z2wqwyIUETkEy0DUD+lZ2BP8HmaGLvQvDQDfkCbMaRMYRDcwUAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 The selftests/mm build isn't exactly "broken", according to the current documentation, which still claims that one must run "make headers", before building the kselftests. However, according to the new plan to get rid of that requirement [1], they are future-broken: attempting to build selftests/mm *without* first running "make headers" will fail due to not finding __NR_mseal. Therefore, add __NR_mseal, to a new mseal_helpers.h file. That file is small right now, but subsequent patches will add a lot more content to it. [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Fixes: 4926c7a52de7 ("selftest mm/mseal memory sealing") Cc: Jeff Xu Signed-off-by: John Hubbard Reviewed-by: Jeff Xu Tested-by: Jeff Xu --- tools/testing/selftests/mm/mseal_helpers.h | 5 +++++ tools/testing/selftests/mm/mseal_test.c | 1 + tools/testing/selftests/mm/seal_elf.c | 1 + 3 files changed, 7 insertions(+) create mode 100644 tools/testing/selftests/mm/mseal_helpers.h diff --git a/tools/testing/selftests/mm/mseal_helpers.h b/tools/testing/selftests/mm/mseal_helpers.h new file mode 100644 index 000000000000..b922d453a014 --- /dev/null +++ b/tools/testing/selftests/mm/mseal_helpers.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef __NR_mseal +#define __NR_mseal 462 +#endif diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index 41998cf1dcf5..20949617a036 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -17,6 +17,7 @@ #include #include #include +#include "mseal_helpers.h" /* * need those definition for manually build using gcc. diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index f2babec79bb6..4053951a535c 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests/mm/seal_elf.c @@ -16,6 +16,7 @@ #include #include #include +#include "mseal_helpers.h" /* * need those definition for manually build using gcc. From patchwork Sat Jun 8 02:10:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 802748 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) (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 C98A28480; Sat, 8 Jun 2024 02:10:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812634; cv=fail; b=H5SLi1KxEgx/wWcf6rCZ/UGObJEVAV5facyuuI/NdlhiSLRtYgjUzXgFdGLvL6EyQtI3za5UOV9iI3fPTuO9JVRfn4QsoqQRv4CVhIcdKdPQEIQu8wb1p+ojXe+7zrXRc+wng7pkla9zrCAZsUTWfsr93y8DkUBr8WHAJP4cA4E= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812634; c=relaxed/simple; bh=vY5WexvCZtLCeaxL7IOSc4+Jwriyrc2c27Ql9tQ0qKM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Uo4kLw/XEuB/zp6pVieKwqie9/QHgu/2b8Z3ctJ2mSk0qF/xnnkVB+PbcmSuMadrCBe9vHZlhd8UeeR0ww1lYOpY+oI/wJ90srHBeuGbKni6fLuYVLz2sDa6Qwg+KIhIJTQD71L7vqxhRaUn66eakKBERbQ0gAin7l60DLZXGkc= 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=eKwGslnf; arc=fail smtp.client-ip=40.107.243.42 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="eKwGslnf" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eJhIuFNHbGCOqPudKgGrCkwBrMZeeKd+GtCzBF95ssHy3VRGQqgvKd8qig2UBCqtoIRhemgY633j5GTs7jkrn315bqm4x9jez6RSAiUcN8D5sD8bN5MMjv2dsjS/3IfUQbv+O9aQX10s6BstF28fyyui+ooR6WCERjHJI2yZMU4lx8GJI8oaoQ7+VdxnTvZnfH+EMeKdkDhNYURjXtuZDmOPXvG0EDqyM5wofA9qLSgL0XpZoss5XsWUs4DgJMfX0KjNbg0Jj0xbHngQqv6cPjPz6mlTQPWYP/iDAe/1hKihSs4Vq4rTYngupEzZ1eEvG+3LLDmHaE1+ErQi4/cxiA== 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=O+/RmZSS/R2hOjv+bgtoV6Q8VTZwTejdmpBy5zRCcQc=; b=Eap0OewWm+Am4w/hEDjwUPQoskuzAtLdJIJ4GckAKL3gOSnnyCo5VARCPCc6uZ0S9jYMDN3p2efDd541XXbUzdBqsLar0vgG2MElnNZbG3px9wx9Hf5/Q8YUNLbB28VJDDZUNGbLXwED++snBYplDaGkeEMEG7zfSeWOg9dPSARPwAThs/+cauj3JbpVlWuWnAbRooqzmO+01hK22nE2XtK5YhOJSLS275dRiiLcVPMnkxUvdL3YFdLHyYciL404+r4QwLa6egY4j7O1vP5bRlT7D/A3HtpDth0+OTDiT0wxgRMOZmnJ11EBiS/5Bx5EcJHGMbyqx5W+B6qgsoj43A== 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=O+/RmZSS/R2hOjv+bgtoV6Q8VTZwTejdmpBy5zRCcQc=; b=eKwGslnfuv4KjT2ptRzqaKo30eWLRUhpaSJxYaZJZqF1fbd7qR0ZUmOvLyOC2IGiU+3DvQkD6+QKp0TRcLmS3WviCk5sxg9n5EgoPSm0I+Y8ibxxj53QXVazC0gUvmfXDA/5AF+lHE/4okB8Hax/dI3yxODaebxK3AIRCVRG7QGh8SzjpvxUd8zM+TQXxplUCpcZx/+ETvgu+U66LQ41zHhArbKD0m1jifyuN6V8MxTZF8vJggT6t+1M3C4EJ4J9tR2osctQTPdAgQvsaWphqBSDrvNOwRe5uagaUYS6Z+O7aj0AViuKAwTn0yh96B2xl5AVY9Fgg6J84mCLveq+NA== 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 BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 02:10:26 +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.036; Sat, 8 Jun 2024 02:10:26 +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 2/5] selftests/mm: fix vm_util.c build failures: add snapshot of fs.h Date: Fri, 7 Jun 2024 19:10:20 -0700 Message-ID: <20240608021023.176027-3-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240608021023.176027-1-jhubbard@nvidia.com> References: <20240608021023.176027-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0003.namprd05.prod.outlook.com (2603:10b6:a03:33b::8) 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_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: 73311ef6-9ef7-4c6b-2b0c-08dc876029a0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: Y/aBuxXRv6UFhbsmkbeWlgqktY4+2wV21DcILzuKu4u3t7UoNrGMjYLfxQTVtSwNYVzTw5ECHUyyDGAQyUKePiPwDlQFLtvDWFJ1c/eYPQekmWPhz9cgEjJgUaOKfg3B+HgRH7Sy6r1DxR7EeTJfUF2Uf9cZ1Xqd1qGkd+W4ZFSAtJD8W8ZwyhDdh02cefUwiscm4YPd4lVU2GuVjF7xP1xI5G9G7Nc5lgx+w05CBb+6Yq641dmUWySqU1Ksmac+0cQydCwHEdtv9Tqcoxm1k4wvwTtVElE4Ep7dDE5j5enzzm3tfGTD3fFc7PGePKdnFPXtBUjxr3jHGFDUaK2SOwPYRfleEyw0650vrC2RlghSJNzISQc43m2OqU3T40FDs1GhZTCFUwWF/G4wCQ0KSt0SKKLDtey/+i99+icImfh5sWuE+uZhp1xvPfiUXhWP2m2McLKXB/uJm5ueLZeJ/owuTWjaPpGO1ccIvAj/dsIyOeqHCkSMmHvCwhO7Fhm6JZI0qL63YU27qABlEgyTPGtQYmIyDvonnQvnGPFmgrBnxDmg2nfEV1d37v0k01toIxvbIs1zcsR8oqgQNCbs77Uqah97RXGLDovvjMi3gOM1PuvxekeZLAUba3o2z35G8NvJZJiMMd3i9nnJ46u03lZ1hf+BUP1tt84+6IBKuUAteDgCRz6UUb4vPAjC2tSLbs5UtZmQEcsqqNLV2ySoxvT/SWIwJPXgdvbEqzpxEDagsjvIWHgfvg0HwOhnAfOGC4e0/zceIoPb+Ex6cTWVvF7OHhwMu8gkOLJV/eDVyH7673f6Yh4OfQrDh7eCioag8D2xpycUhz5+At+1Tn8OynB+S1whQfz5eAkz3qNvpXC4TnCWFEavuhOhLGbesTJoIymgHbdyFVIlShGI1pgQgpQic/pm1SgnMohMtrnlLR8SE9SgNZYPBVtpRbYcCq3qjX1GsJ/BfNro7BCLNqZPMBVJHISg6TqWPQEmojtrD7geiZIBw0yOp/2QWDEW8QZB6QBome965VKGTjr94E+qWkmtXhEhh8PzUpnswCq1gofo8cS6JbLNIgze0siA5+hBCwgmYGTtr96ReuDgPEFMyz0+fsvzomIEwJpe+b7H0phZbzrjNfuJ0zLGoYECjWzR1psutc/gK0fN5SUMnTy7NaFd9cTokOW3RhSrDK3QEwrClectDOsT6ABqhLleBp7mwNtg5HEcO9JLvxqRlUEfUgN5xN1THmZ8bfGCiy7JRV3AfFcK5P/iXgWIYjMvB2sSp9+BEyn+2HQBfY6lhXmhjLvDyfHsL+s+9ZitwtVkmS+wKWgd2aZ/YlPLppSpbulx 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:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XH5m2F4v59fh0mTpYd0zBGL9l27uf8WMuK8LnswfIvRbhM2ITBobpwMsKHUjRixgShJpwAApNkcCysgLayvZs9nzSSgjoHLJWwALalKf8sEbnmzQ6cCAJdHJ4FAYny2RbqsKO9nKSFxr2/SR7ZDrzQw+mbUhxAZmKR+10nlSTrbUAdmDmR2C7XOg7hJJzYz/aN7YRMxq21/AbOYrIklXSjGM6mhh6yb0p5+6Tf2J/mmETxPA3M/B8gz5nH2eWIRcH+PGYOHKkrfwNJU5L6gvPkVNYSrrrEgXCsrH4hW/AtngDKLgaUFYt37obpn1EL4tfKagieMsT7adfk/PPAj7TObWTZUoKa514it55AdhhIpfk4+bonEu5VwLngyq0vHuc1Lv2EUft9kwIOkKUzXDZqN7gPDNmXRdRj5S1qqLdXHeWfapfr6K+pg4mhBeqXW8xAI1ubCoC3RNeNYia5ANk4lUxzQNj5QUHwgZOq9bjXtRVOmpmi+ioPt8X2c76/ieNGeQycX3XgF7WbPHPFckUNZhZIyCLEMjolWzplREQOPTl86sxzPH1mvfjI8yj5VEOBbmehm5e0grZ+a0hem6sKSMrJENWLgMCS8Y5oNHWYDVqHl+S9iAOCdpKSGoRWAq1u7IMLxIfmGQrCB5qNA1xjZ+zcYJUojNiPQsyWwc32DQZXdBMyrkVkBz8Unkz0RMUU/kgP2YMFHkT2Z16XgpZR08/3eNbxgbyXbbEIZNFagyQVVqKbYsxQWmei9KRA1Gcluhg/42nuiQWqDcAq4lF/AcXv9MorzE//DHFwk5WzDz04WJscd+77vPZhZz/guvEyhwP0qZMGhf06WX7KWRjIvi6h07gakX5bgI93c7N9DysdTB6puRYjZBlaP/xl4vJGiW+6kkxjDVzVuzoYgJJrNazLvlU4KWEwrLmUvso+JVF2irK0RVv0H9jasG+97wRJI79cL0zqWAjKjcoOn1MIxXP1j4WJCIkFzTFaRmHhS1wdqB25tLGJwjZl2Yitdr2cjz/W7PjujS2Bn7ghYveiod6GNgI/wrHo0cccazM22V6v/bJUzJk5FrkMBXXQEf81TXIkZ3bMsYUtKhGglIEa78gbQNOlkv9RX6HeULK+zmEJ1aij1JKINPXctK/DxeO+B1dPG9PmBKznNqNmOAR7zCmYP4GT7GRT70oyM+KEbL0/fH4+zD9UxXRwES5BvRCxufALXB7ci2FhUzZEiBFa67h/7Id+Gw9XpcDuNgq5Gu4/DW/owOrT/vyubxicX5hSrs3iVPN/TtbZz2lZH4AHtCEPsdaQwp+vro1Ar/MJOYSFhrvznQLsV7znD1uYXowv3oNh2j9dy7IvOtvi79FO+KRPnLYILPTc4HWeTuvNI6SQLb4uK+l3LJXJvYQfxSJry1wVkYoh9/nc8g8QxErvCBMEFlHfqz8LT7NtmQorT+0b5EhTTTY9WweqlIjJqnogHa487V7dIx+M7RDu9dfG7RBP3S5oOwITf7kDMhgxURy/NOhR8BItmepXM7oHUup/FvKNWJ+FehrX1gg54JkdwCPxdnbpC0W1R6h79sqUahmkX2ADvei5UFQDXtGWZW X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73311ef6-9ef7-4c6b-2b0c-08dc876029a0 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 02:10:26.5487 (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: sRF33lmBp2uWrvxaOXOHTIX02O1BsVinw84o2knOfWYwmmxVp5c/xwcOIe6ilErkQD/0yslST9l9FBlwL6IoeA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 On Ubuntu 23.04, on a clean git tree, the selftests/mm build fails due 10 or 20 missing items, all of which are found in fs.h, which is created via "make headers". However, as per [1], the idea is to stop requiring "make headers", and instead, take a snapshot of the files and check them in. Here are a few of the build errors: vm_util.c:34:21: error: variable has incomplete type 'struct pm_scan_arg' struct pm_scan_arg arg; ... vm_util.c:45:28: error: use of undeclared identifier 'PAGE_IS_WPALLOWED' ... vm_util.c:55:21: error: variable has incomplete type 'struct page_region' ... vm_util.c:105:20: error: use of undeclared identifier 'PAGE_IS_SOFT_DIRTY' To fix this, add fs.h, taken from a snapshot of ./usr/include/linux/fs.h after running "make headers". [1] commit e076eaca5906 ("selftests: break the dependency upon local header files") Signed-off-by: John Hubbard --- tools/include/uapi/linux/fs.h | 392 ++++++++++++++++++++++++++++++++++ 1 file changed, 392 insertions(+) create mode 100644 tools/include/uapi/linux/fs.h diff --git a/tools/include/uapi/linux/fs.h b/tools/include/uapi/linux/fs.h new file mode 100644 index 000000000000..ca9d754bae04 --- /dev/null +++ b/tools/include/uapi/linux/fs.h @@ -0,0 +1,392 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _LINUX_FS_H +#define _LINUX_FS_H + +/* + * This file has definitions for some important file table structures + * and constants and structures used by various generic file system + * ioctl's. Please do not make any changes in this file before + * sending patches for review to linux-fsdevel@vger.kernel.org and + * linux-api@vger.kernel.org. + */ + +#include +#include +#include +#include + +/* Use of MS_* flags within the kernel is restricted to core mount(2) code. */ +#include + +/* + * It's silly to have NR_OPEN bigger than NR_FILE, but you can change + * the file limit at runtime and only root can increase the per-process + * nr_file rlimit, so it's safe to set up a ridiculously high absolute + * upper limit on files-per-process. + * + * Some programs (notably those using select()) may have to be + * recompiled to take full advantage of the new limits.. + */ + +/* Fixed constants first: */ +#undef NR_OPEN +#define INR_OPEN_CUR 1024 /* Initial setting for nfile rlimits */ +#define INR_OPEN_MAX 4096 /* Hard limit for nfile rlimits */ + +#define BLOCK_SIZE_BITS 10 +#define BLOCK_SIZE (1< X-Patchwork-Id: 802747 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) (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 623A4CA4E; Sat, 8 Jun 2024 02:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812635; cv=fail; b=iJR38d5fMBNnRmEEN/nVpxx8/EN7mwf4AXAj6VNXNPkwcvT5Pf0yuMPqbCuawUoG6lxgNfJf0BO+9k6TcL64N8+ONUawresROBUUCgHt8TFTMTAZ1EOZOEBAaMBqfx4CuM0r1MAIgFwfjRBUcL6G3FBwhpcerzrQTeV3fhLXZiY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812635; c=relaxed/simple; bh=zzqEeSbHMdKVIHB/G4eL6lLIpGPR2PpOMMdSWwUgClA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=CfykS7j1gkZhaz7jE7zQnPSiidqlCNaWhtk5wZf65iimgENrJhbGWmzbIp/0D9lwPSZAX8Wo/nFD5flEVS91o1pW3UVu2KAAVk3ZI1lmsLOmy6ZJR6E6fsxA8ejlrvkpv4pmObmrwiRAUTexpe09FIkcOItnWhbf32ngZoPcbBk= 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=K4ofHFid; arc=fail smtp.client-ip=40.107.243.42 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="K4ofHFid" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K7MM/04yEVKR/HAbvqcqqlpZlevuLlfmTGPTJ5QBBJmK20hJV3t2c3ULJzYlYOt5PzqwgTyN1hkDgMzDJuMh4dA3+lBYTCtrC9FYf4pwEUbyLJD7N5Qk7pLgUp5RvgeiBPVdjX8YaSAFepx26CJuvil9SyNcuP1bO/CET3WB3DsVBTDZFy+NfNFvOl4SrsjZKAjSc/y624ou+nhCVWSjR6nM4tqmoDh1QnLfRLlJpWKWtLP767cldfCpLFayU1MfyNCWz1WPDdD1T+gPBvL3jwGxYyMaCk+tWVNzytNO8GmaPlp38FR4QsP4w3KoJinqtikpVDK1OgsWoW3thC5kfw== 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=pZDWmta/WEXdEfNKbz6L8CJQ23neTi3jcvsGNZDTPnA=; b=hA8Dl39Fo5QT1cUiM/WA9grnSE9qDHHq9L+naDEepJTFp+99AHOMVSPV/LaJI2pV/HedHUntU+rpaONqEkcwO8H9jGvMeB6O8O6BcKr/P+5KAZS1L0zETczYMh1WK86GROXp1aFsPCFL52aVBmKqK8xFyw6ttCvYirSp+CcljuvRx3yvUWn8LtxcJ7AQ3OaVuLOHr3i0ENNIzE5x3p9usP5oZko3L8eMIwLTDxupDtTg9vSpb/qytR9/8ldR8Q4F9l6L1j1Q2XSJGcVgW4UBY9JNovp9BYtvnl2rJVHpFve0F6Eok3iIskbORDCFbDHkMGFaSGNix0Gvzg9nOTAPXA== 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=pZDWmta/WEXdEfNKbz6L8CJQ23neTi3jcvsGNZDTPnA=; b=K4ofHFid38R13vXO8Lod44S1u1R3iPrv0KvAddkbmzB80JjlekbAUqgORHFAx+44KjIJdE3TWQ2DeXCpVQbbJzs8zstm+NKFa/6Zx6xhjc78HOiboQaQG27Wmvrg4aJheUk4SZqh8Oer/z/nEwD2i0IAdoVRgfiFVmZ3PswzXgHtJYC9MnJuY8GpMWsXHSjEel/VLM0PcVAyQv6ddUnUfMIq/mTtP9i4RO5JSlXw7olidIOfU8rnsUY8ajZZm6KNJWBxmvjGJSRPv1J1Z2j43Rm8fTVb8x0Rx/0A+bazn7umgb4xIA+01qO8S8bENzZX903wjH605xglCacj6Nng9g== 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 BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 02:10:27 +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.036; Sat, 8 Jun 2024 02:10:27 +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 3/5] mm/selftests: kvm, mdwe fixes to avoid requiring "make headers" Date: Fri, 7 Jun 2024 19:10:21 -0700 Message-ID: <20240608021023.176027-4-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240608021023.176027-1-jhubbard@nvidia.com> References: <20240608021023.176027-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: BY5PR16CA0011.namprd16.prod.outlook.com (2603:10b6:a03:1a0::24) 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_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: b60665d7-8178-418c-bd07-08dc876029ee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: 2qiHPAyWD8Hb6R5735J3OwTh83F1MuMFW/p67G1DfhsOtxiGYP74L05iHwht9PNc7Amae3+XrG7hEiv7vU17WzoLj88HPXYAix77HKlybPmqjjSkoahdi986lyfjhGKeMdKGtJ/bqbFdtgQJow4ZffU+qukhSR606C9Q3nQM5OQIKnr6aBflOpDjWkIBtTN8Fsd8d6WNJHEXDbU1ruEUiwriBYizIRKcwUbw6moLarsOgsZiLt4IR3JOEMba2U3yIjZvbRMbrnpqug6elmgE/lzzq3qeNZHXJMI/anUXg1M7WJs3CjlGfH5FUpefi3W9fLtYHNUHoxkbPk6UQ4bTVK6s93LaP59Wj6pRFs2aQGxNQULN0qpKMsq+gijfXYUjptiS8l+ylv26wyfrjbY/U99fV4s10ow4i6Vfi3E5/ZeRH7di3oLeCF8ATpJ8GsRFyAKU5IjTh66i0J/Pe4/KhGAm3LP1cSM2mFq3jk8/6uhPm0Q3ECVMvehp5Q94BcBRtH/i2w1NTyP+NQXAOzAdEnYW2tUvneTr65v5FyrTwa28OF0jg6RIO6xf4po6sK8B4lO8yG7GgtNZo/8qNAiD2Di9oz+EIlZL76jFosm4h4Gwqnz6UeNCoqqKhaCghj7lFuEo2E9+qvY9PJ63I2X0LEKpb4fVv3aRTBbxPpHO5R+KiiA2vaaBq0m9gGKOz3i2HKxtmVabsWtGL1LGzv+pwxSfV7tto0JPGU9SlHGA16vNAsf/UmQUltK4gLAsKynZr2xd6HinMXQWN1ny85buF/kOIiOWSw+U3s43IkfDMMUL+NcOwglPOGXZjHAQHtGFDMBUeR6uoDHPStcT3bBr/fWlmbiCHJwBEaEO+7l/k0eOlyY9KpsV0qgKTWGLadqUKfrlMQo2nHTwXMsex6N30ilmyCUu5WVLzOXMheN6bgSAof8UNYN9RWdgb8mCFooXRrgLEqMSZ5sK/pSY/BHXGtk1rMWJIbcyKppAlbaUEek/76woWxkkasFM7b5nptd20k17WD5dzSkSvB8ZmTDwMnACrUOKQJFqsZxmuZOWHhYBgEm4A8LSX7kQTBvKZ7XHqcS9s5T3PcBoVLbygL2IMFI4m+PqaApqhYyA/B61Na8dQM92ErvS+K9FwBb7S3cAj33Qmy/DC6lC86WwjVpQ3PvHDmoxmsZUni4rv3GMPRpibZ3RLfZttv+iaORjxLB9JyUI8Pfkp3sXGBaSjWuf1oH2YZcVu0MB4f99FbAeCWKZAgzD7hzwezCZrMsmvoIdWBhVqEPXxAY0QwHM1AZAd9s7MDurQB1RwunSECck1vb2OsT9Uc2vbNdgz52ukT65 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:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: XbnsU/CARXPSNyLe7X0EEvKcL0h1QilFx+346PsYtjX3QqyBLVzFHzvf9qILSMDjKRi1PfA5kgoPgFX3KrMIOPDs66lUmOSznNZEH1MAcSTf41t+zJtirGhN/ey3UEOIlHInhdX7+cflI4xBUziHYbZqB7bdinxtprUoof3dyB7ieHQ+xSGDKFtTMB3Ni4QTtklNSB8fiuCHRFxuU3uJa8x/m+/NNE+jUxg8UM/oZggupedIaU8F+9aknWhZ6EPP5XsYPrOPPkLOPYxFAhUeZDLVxRgTJE8wVjcjbYWr1MEAUrEtWBEpJDF3yeGXm1VjWrPTmKSH5aLVFDiPPwnS1wYP7JVg9E/lVkcHUSQrL867nwpNwOpTsagPlnm5uoBPWlwjmohSRdLDPKpnf+EJUTDbl4ykQy2iV24K/eCvCG1toOVxGOmKYrVBamJQ0s4MpVnnpIwnScMFmOzL3H3sdff37oPWEto2IR6pXmo0Z7Mpz/VJQdtBCG6XZXVxwaZflAjfGnqwTbVFZQjI0KpGbn24RMo4cCDMoFi7/28ZgmnZ8F+IcLU7kPRZgv/A0voBMKPLit++uS16kUImWL6jRY02xY3K7RT7DE6t3PoV9FMAD7eJuXi+moYmynXBQzF9zYqNQM1nox7e2KDjdMZmQjd10fBFhscEgipgGZf735GUgeWQKdf/Ym2oW95hhwSWR66jRW9yKe6DFLVkuOPG9Ciro/Q6aRMZwbAU9IaT/bNXytzaqzupgtHfvb6aYlPJ1EIuDfxEWTae9cqSx4WegScAmi5BS4Nw1ovfKwpxIodKAbubfv7vvaKp0y6AFZBm6mg7rovOuNqSaZHxPq2dKUiv9GsBea+VNqnD6sWf8pDvxjZvXFRt2rNg8dBtenNU1TE83YbDxy8PR09odXAbzevT3eH3//uL0cgFWBzbHD3W5Mo/KNJq1pdoxbX4daPOElkwpdUWbvx6Q4zKsOlwT5NU02FnWfQmYvnM2cEfhZGgQf9+4vKwHmHSz1yZSejwn0/SlBXwSAX12MXVxohYNNKpF1BFAIBEAzXUXugWVsOxE79FkDt5/H9xMN+O+KF1euelwm8LUjmo86lzCcE7AvgIRZTiWYO+2y1qMN3tJ2hPfHFgFun3Xm5TfSd7kDXLRZ8d1i6SNdrVw+SUaS08/zRhG2roZg69AT2QQLxV4gcBa2n76mini/BgfshvWdHPotEHEEPr5ujm/ig2aq81k529XXvCA3y93kpepEu5ulkztu7Pckz1YNX6n/UFBfRa5qW3T8118EhKDfnZeVaKB5xmNDmgJgN4pOuX1QF5E3fI0c6fLEDIhKO6AM8JVd3UQePjs9DnSoOiZ2P39PnnsVKIRTdtY2+f3AfelURcg9f0m/aI10yi3e+LiQnd+wiCMhwWx/02ZQwbJb0pCZsAN2zGaPumY72wWU0sELna3uZTD9Gll74cMSTcxc3ZLGCEuU3K+8IvDjuMDMCT71j2DpzxFeXplffPCQbPydcMJjAuJ8ozk0WaeRsDJSuzktq2Y7b0pRYQZtdEHSXZ3AKyhIuzlZsdIZcaR1STGToIhHWwK8HTQbCOaZ1cqaavDm+8 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: b60665d7-8178-418c-bd07-08dc876029ee X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 02:10:27.0586 (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: XOUiUa4bDVCqtTg5O5IzGbsoQD+nCRFIP2SLtpJmzggqelYQ4FQro5aVd/nFKV+G5Fxr6SaFajig/7Kap19dgQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 On Ubuntu 23.04, the kvm and mdwe selftests/mm build fails due to missing a few items that are found in prctl.h. Here is an excerpt of the build failures: ksm_tests.c:252:13: error: use of undeclared identifier 'PR_SET_MEMORY_MERGE' ... mdwe_test.c:26:18: error: use of undeclared identifier 'PR_SET_MDWE' mdwe_test.c:38:18: error: use of undeclared identifier 'PR_GET_MDWE' Fix these errors by adding the missing items to vm_util.h, and include vm_util.h from mdwe_test.c. Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mdwe_test.c | 1 + tools/testing/selftests/mm/vm_util.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tools/testing/selftests/mm/mdwe_test.c b/tools/testing/selftests/mm/mdwe_test.c index 200bedcdc32e..cfe0b64d1567 100644 --- a/tools/testing/selftests/mm/mdwe_test.c +++ b/tools/testing/selftests/mm/mdwe_test.c @@ -15,6 +15,7 @@ #include #include "../kselftest_harness.h" +#include "vm_util.h" #ifndef __aarch64__ # define PROT_BTI 0 diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 9007c420d52c..99cbb7c0ea9d 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -61,3 +61,18 @@ unsigned long get_free_hugepages(void); #define PAGEMAP_PRESENT(ent) (((ent) & (1ull << 63)) != 0) #define PAGEMAP_PFN(ent) ((ent) & ((1ull << 55) - 1)) + +#ifndef PR_SET_MEMORY_MERGE +#define PR_SET_MEMORY_MERGE 67 +#endif + +#ifndef PR_GET_MEMORY_MERGE +#define PR_GET_MEMORY_MERGE 68 +#endif + +#ifndef PR_SET_MDWE +#define PR_SET_MDWE 65 +#define PR_MDWE_REFUSE_EXEC_GAIN (1UL << 0) +#define PR_MDWE_NO_INHERIT (1UL << 1) +#define PR_GET_MDWE 66 +#endif From patchwork Sat Jun 8 02:10: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: 802860 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2073.outbound.protection.outlook.com [40.107.243.73]) (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 9AE4CD520; Sat, 8 Jun 2024 02:10:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812636; cv=fail; b=NbmVgrrMU5C8KGZTu5Z94TDeQSSlbihKjkFNUDLrnJJkKc2HAC69E1JJPdctZb7zo8KUYxzso60FtSxonDig/1XzSjIYi550FypvVJy4byzpL7Ov+TiKVGBQcwiVs4qHup88IM2kYPDb1Ya+BIeiEviiWFCHZrzmvsoSW3Yhbf4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812636; c=relaxed/simple; bh=BxGNrOHe2dfbHDfllX9TKbHgDuwBjx63EqJ45VYzzSA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=seC5TcTyeCrSUbw+MGf9FlNY8toBCGQN6tmhqfCfSnun2k58nE29opbqesqcvAbMPkEJWE0SQWEb/EEtB+B6Ge3GcKzPuf/0yeSUttTOuoLdTyZ1Qlm9BS3kJnf9SfxQ4/Kkrshg5cnRD4HzWNq7LM/8+TyUrq2rnmqled9K+jg= 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=jOy7tgMz; arc=fail smtp.client-ip=40.107.243.73 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="jOy7tgMz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEB86y5js6X/KNB8PRbF8oVA+3d455xhaL5mikuk5Yu8mYXzN9hZZAUoj3yez7JFKKcBkFKTJX25CNu9YT3Xz1eMxAQ712dT3kagQOEWAvx+2ERkPuxxpvxlm1rNraCJJc1OzDI5vW82t7hn+ybclRcllVEKjJglPMqeJdHJps9o+d9SyXcPqQ1RbzH92SPlNV+9djKBqsxBfw1GTdqg0m1iTSbpDfZigBptTlXl4qRrhFH72XHb4WbuRCAIHxDBJAVC9O+qK/071Zuiaz6J4KBacJSlkp2DXMhktgki6rv1VaViVziyqiLn9XuBcWeap2Xac1CsZn8SwZP/ZzTfuA== 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=eHcL2+kvCrCQkV4frQnNbum43yoJZFURF80YKG6CdtY=; b=lCNtwSYYThlUAKlOJNWDuWhUYQREIYcbcoRTfK9LMEAJ8wC1Z/6dnCXUP0X/UPvt1K8hMb6C7XWDTmqUYUQ7y8P4XWUQ/Q3lC9RcPQoRFLbYK3qDDoaM8+Panf5elsTebX0/LkUQ0E1PQSNtltlgZig2geVHrKSaKqilrHLpoUlvkisIIhQGCc+3xLw/os4aNk2VVMjcXPb+eU/KR68GGxcSJL4mUD1Vv4+xCK3Yon9PRqb6SijKBuU3kE2LsKG7xFHaedDKZtYoHw//kAIEjRn9UdAUtZvzvEQfyaN5SpB2w1bx6AszRfawbtey4ExiHkIGANlk1MCu8/1nJZouww== 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=eHcL2+kvCrCQkV4frQnNbum43yoJZFURF80YKG6CdtY=; b=jOy7tgMz4BgwvRfHPZm55TF4LrpIsOpwHRI0Y7wTv1UAUZjj/AqdVkQSkuGLFoxqSrFSnA4w1ZMviUbddoszt9c6CzKIVOc/3BUJlt7HASTpBuvCeH9mZSRXIZNMnvwLSQlaJfFyMcUCBX19RooOSD0sroNCfIiOD7B1ji+MjWpfb9JFC7bUwkRFvcMCjhB/aH59ZLMVZDdsj/qLpnvR4CgG3Dn1IeLEKeEBGQuiWBFbJuvmkr2uOJrp0Yh46J0jS5yumlCFyOSnnLcBkRkyRqtfo/3UGEJtz0TVGm3guUcdVrPQa1ZkKurUtUSvDSH5BH/8xCs9AjEBeZb3+HJqmw== 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 BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 02:10:27 +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.036; Sat, 8 Jun 2024 02:10:27 +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 4/5] selftests/mm: mseal, self_elf: factor out test macros and other duplicated items Date: Fri, 7 Jun 2024 19:10:22 -0700 Message-ID: <20240608021023.176027-5-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240608021023.176027-1-jhubbard@nvidia.com> References: <20240608021023.176027-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR05CA0022.namprd05.prod.outlook.com (2603:10b6:a03:33b::27) 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_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: 805c58f5-5edf-4422-9ef2-08dc87602a49 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: tgxsl/RdDmMXDYpHZq+XhGs26jEg6Ah1IfVxKPYWua3vDt195qKKinDnVQ24jbNsewU29RNUmDuTjW1WMXu2cS7rt51k3g/cMo7CCbxlL57prLmUuWap7Y/aRJk3LqBb1aYZ/dUAUbpAZNY7qC3n57Wkja83UJEyq+fSJ4OBVvB0S0ASB7gzw86oQL2KEYcpWgwqpdE8wWpACiFIE3rzik0yb8ChIUpTB3EH+F2JplkGJZX0uovvPv7WBY3ziHtEBf3eTlED7m9y/0z0o/tSKno2bRi4thEPXatWeGB0phafP7z6taX61QbSRCsHmJLTfLGLj0s01TvODLK5Q3cUTi8BDF28UdIKYJJLbXqlCvuJTxKKiDBHR6qshhZIIvPsmxqNXiD0Aaf6EfjKAaYJ3WQnHHWCeh0uvR5xlF619SJp4ALUIz26SPK0KcllSifK1L87Uyy+VfazH29GerWBpOKq1pk+W6CSfV78F8xPtwxDC8M1rjYAY53vqBR0MmPi492FA2xN0vOj7sYesnvbVc8BaGhDxEFyY47wqGhClfiRyoV+c0IWP7pAXCNy1AHZylrT4KuPe6bI6n2LiLvQXuSQNiVSTwG3x+qwzA93Qt+nLz99g5De5kko1Qag7MNaGlsWbUpc6Z7qrhad4I4xTU9Su5c+6f6frcdRdcJWwtQCQAbVxPROsR+hIp4OJm9O2mr3jf0kufq0k8tuSfxtsNPpoFuf0779aa/38aLaFeTyi9X69rDWDw0lxZFYro5pPhNYD4krmsZDZKrWbvyMIGz2UIuBtWD8Rpzm647AZTrFq+UikUatEoI5O3yp7QeVO1kzlfmmHhvfyu+kpBwB2SMtzDN1c6vghghdVRxvnWBWuZX/X+zZRqaC37MDGl9Itu4yAhkq5T8XwTXmGbw9RbMB1r6cPwnZSBcM1ZvI5fLZDBtnIzoLWwn5Hwid6WwGhTeaIR/OCxF64PpiwJcDWSeWVGUQFqQpccHJZnBq2mMavgNhpZlxOSwrdqHT0k7/+fG4jtB5NO7YqWZEkQu3BzbGq0DZKE4oYLzRgibVY4ebxh6IMmsYTw3D5LYno+vniTnpqSog2xxIeRqlTrSMe8duchh/uuf/GVnmAgJSiVVMCllvlU9iCiGyMfulPNnaPQ9L10UVfLtiil6063QlBUl9GPylwM3ptB40/XIAjyE9Tu/meu/rCvMk0GR8c+esYYDp02jAIhdEuHUwwOPDQS0t4r97/Y9O4aDDQ1H0/9WnkEeBavMCb7ruXAOuJi9esU09+ie8ZjP0Y4vBKP8k+MCG78DpT1+LzILeqQE5lLw= 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:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0zfjdmSUX4aQBkpu0bgfILpmm9OXrNuxzZrPBmQywLG9edQ90gCgSNhwMSPJMXTp8Fte6r1JdrpWFxF4oHQOs5a6P6vmDU/f8Ttq2dxBRqJa/mZzPxCsbVpkn71udyldX+gKy5rpGF4XtpV5FLsiWvEex5SRGz4vGgm/EAxV4q7nvlle/qYMRQ8dIKNZy33wROudMDXqTWm6rAVStAC3aS9C+tFub99fDQP0aznGRCDCgZ+KeZnGTERlej9ncIs3P6F+qbMNCIDg20lF+yXmkEKqQkz5APS2Jy/wmehvLae74wvThiT5UhOpLpz/w7Qs54iTsxlSWVZUNcrtmdos4slHewjFe+s1rCEV/y59zfvGsz1LOUHeezigARkCUu7GXYsytjTu3gqUtp56NXJoLQpaDB14MfE60HF0vb2kW+4fzubRssNt4L8NaA+/9KNa95Dn1soNbpSdHamzCnNEd2ZrjWp/sMI1PfE7ArWl93JnoLdwBssaQwLoMBML5RePMBm4waxLnb7dOyKWG7wdd2rrIsWzTcC2+EG7hb0lEwF/ziTWV9E4FqZEl7ldqwSoYUm1hOx4qk2srmkT8Fr/9PEawSvDHkvpblqvaK9dza3Jv9sKhlWLbtMXUiS/mXd6ekolY84t6rWch2YyJFrXCDiM/KDO83osf0soBg3QyMVXAKFaCVb5hZzH3oIYPznpm+7Txx02zVFre+ikV2++x9c7Fq//oIqJ/lbhZUZkWwujFnKVDxOW5VSEhqD9uDTrpm6odO6g0AlFsqSjANdCdX07ASBppPez0vI3ThhVdZTy6/jCZCsU6QHAVishjqgBsxEMnDOKWkykbOhAKSA1hkQ3g0ackjY5xnX6FOeJsQqpomFBo9G/Ecs8/+mThwGl8YPsTfNWXUNDUAh0i05AeoEhjnYtECgBCL9UkWCQX7rFR9HBZWQ5iekuu5fwES1Oe98sAuJDWd06bOBuXw+cWH9mkFMM6WXeSb8XNvEoSSLZePYIV0TzZmjeTXjNGSGUwtxUz96l+EVAi6A6nmrWhx2t7cvf0/QwpLRaosHADQyYqN7TIj+P4X4lARGgkDAwESmz9LoK1HfSGIvRPSR4seli0CvkJJsbKpJqxmAr7xBC0kZ1YRBHWGaWvBysvg9UDSt2EfChIdM1f16Ggwlno21IejYlHHqBteCStbvzjIoEj8n0y6AZH5oIg5VoIYgr1C5uLNQ5q0zn1JZHxvtPflmoSPeYgwpzHY+zqmz4SY+Rsj0f6tnfTa9i0tGrexZOnIuYxIEB84G38sSDW3Rp6x2o523zgt+6TObDeNjEMczt4ZdEbgxkreYfOtnSPWLAMEEiZm+foHsTvO0W6kWWXwUE42P3vpwfk1uWirit5dkRKfmg7DTbcGq4DeK+iB0E3imO2M2Iq8t2X3sistbJjJ+HgquJHszvBY42eMmFGtSovEUw6KTIIuRqve4h4YfMJt+czUDWHsJyl7UhTesv2LPDktNgmS6yrV0vMV6IDmjK9mWrAvdKil8bfX6ukjnMjxTKS9cJIKN6EQ8IC6y0GodazLgIkq5J76rCcGguBLiQb/2j8vpPvacL/eBCxZxi X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 805c58f5-5edf-4422-9ef2-08dc87602a49 X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 02:10:27.6512 (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: sQhEcryErW2pRq7g53oNiIkqhs7DrMWZ3sWL6lcLzVdjWgbi2OQNFyELnB9cqlRxWXtvJBpjAR93AkoeGKVBHQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 Clean up and move some copy-pasted items into mseal_helpers.h. 1. The test macros can be made safer and simpler, by observing that they are invariably called when about to return. This means that the macros do not need an intrusive label to goto; they can simply return. 2. PKEY* items. We cannot, unfortunately use pkey-helpers.h. The best we can do is to factor out these few items into mseal_helpers.h. 3. These tests still need their own definition of u64, so also move that to the header file. Cc: Jeff Xu Signed-off-by: John Hubbard --- tools/testing/selftests/mm/mseal_helpers.h | 40 ++++++++++++++++++ tools/testing/selftests/mm/mseal_test.c | 48 ---------------------- tools/testing/selftests/mm/seal_elf.c | 32 --------------- 3 files changed, 40 insertions(+), 80 deletions(-) diff --git a/tools/testing/selftests/mm/mseal_helpers.h b/tools/testing/selftests/mm/mseal_helpers.h index b922d453a014..8c3bf77dcf19 100644 --- a/tools/testing/selftests/mm/mseal_helpers.h +++ b/tools/testing/selftests/mm/mseal_helpers.h @@ -3,3 +3,43 @@ #ifndef __NR_mseal #define __NR_mseal 462 #endif + +#define FAIL_TEST_IF_FALSE(test_passed) \ + do { \ + if (!(test_passed)) { \ + ksft_test_result_fail("%s: line:%d\n", \ + __func__, __LINE__); \ + return; \ + } \ + } while (0) + +#define SKIP_TEST_IF_FALSE(test_passed) \ + do { \ + if (!(test_passed)) { \ + ksft_test_result_skip("%s: line:%d\n", \ + __func__, __LINE__); \ + return; \ + } \ + } while (0) + +#define TEST_END_CHECK() ksft_test_result_pass("%s\n", __func__) + +#ifndef PKEY_DISABLE_ACCESS +#define PKEY_DISABLE_ACCESS 0x1 +#endif + +#ifndef PKEY_DISABLE_WRITE +#define PKEY_DISABLE_WRITE 0x2 +#endif + +#ifndef PKEY_BITS_PER_PKEY +#define PKEY_BITS_PER_PKEY 2 +#endif + +#ifndef PKEY_MASK +#define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE) +#endif + +#ifndef u64 +#define u64 unsigned long long +#endif diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index 20949617a036..a29935d82027 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -19,54 +19,6 @@ #include #include "mseal_helpers.h" -/* - * need those definition for manually build using gcc. - * gcc -I ../../../../usr/include -DDEBUG -O3 -DDEBUG -O3 mseal_test.c -o mseal_test - */ -#ifndef PKEY_DISABLE_ACCESS -# define PKEY_DISABLE_ACCESS 0x1 -#endif - -#ifndef PKEY_DISABLE_WRITE -# define PKEY_DISABLE_WRITE 0x2 -#endif - -#ifndef PKEY_BITS_PER_PKEY -#define PKEY_BITS_PER_PKEY 2 -#endif - -#ifndef PKEY_MASK -#define PKEY_MASK (PKEY_DISABLE_ACCESS | PKEY_DISABLE_WRITE) -#endif - -#define FAIL_TEST_IF_FALSE(c) do {\ - if (!(c)) {\ - ksft_test_result_fail("%s, line:%d\n", __func__, __LINE__);\ - goto test_end;\ - } \ - } \ - while (0) - -#define SKIP_TEST_IF_FALSE(c) do {\ - if (!(c)) {\ - ksft_test_result_skip("%s, line:%d\n", __func__, __LINE__);\ - goto test_end;\ - } \ - } \ - while (0) - - -#define TEST_END_CHECK() {\ - ksft_test_result_pass("%s\n", __func__);\ - return;\ -test_end:\ - return;\ -} - -#ifndef u64 -#define u64 unsigned long long -#endif - static unsigned long get_vma_size(void *addr, int *prot) { FILE *maps; diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index 4053951a535c..0fd129259647 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests/mm/seal_elf.c @@ -18,38 +18,6 @@ #include #include "mseal_helpers.h" -/* - * need those definition for manually build using gcc. - * gcc -I ../../../../usr/include -DDEBUG -O3 -DDEBUG -O3 seal_elf.c -o seal_elf - */ -#define FAIL_TEST_IF_FALSE(c) do {\ - if (!(c)) {\ - ksft_test_result_fail("%s, line:%d\n", __func__, __LINE__);\ - goto test_end;\ - } \ - } \ - while (0) - -#define SKIP_TEST_IF_FALSE(c) do {\ - if (!(c)) {\ - ksft_test_result_skip("%s, line:%d\n", __func__, __LINE__);\ - goto test_end;\ - } \ - } \ - while (0) - - -#define TEST_END_CHECK() {\ - ksft_test_result_pass("%s\n", __func__);\ - return;\ -test_end:\ - return;\ -} - -#ifndef u64 -#define u64 unsigned long long -#endif - /* * define sys_xyx to call syscall directly. */ From patchwork Sat Jun 8 02:10:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 802746 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) (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 1C29C1078B; Sat, 8 Jun 2024 02:10:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.243.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812638; cv=fail; b=oV6GhBL9UFdT3ftEmPfKEI+gYDEOzGfKliaCdNRy/KhZb5FA/csibEXWDb/akApk5sY+5kt/xNm4cIRfol2y5qZMxHDAtn+ekqdRdIA02HWivJ95P8SgM85xGDFlqsrN9GIwNCJFmUxazPg+fd8ip5wd/oubGNUOe0KnK0rmyK8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717812638; c=relaxed/simple; bh=WJsPbWyU+TAIdxc7hDxCm4VLRWpjWLcKRF3TeupLkSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=XTvutejyuj3SuiJXu4kKnUmav3zfd5VtqaxzUAPqTSGOzxckEA26w29Llpdt1ze/fBtSIMaoGOFS/ceEjAtHCiue/wbFOjAhA/2OEXWV7sFcj2rc1E8XtlwWcXmkbln05OC3XjwNAvtkqHjs+BbUacTk4MGikuqZh5C5tKOAcb8= 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=AUtP3iKo; arc=fail smtp.client-ip=40.107.243.42 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="AUtP3iKo" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DT5z8Qd4j8TZoM+JRPNoY+lJwtS5jptW/e20j7SyYqQg0q9v8joK945rB9ZBfNfgoQ3oz2ZpAAW9kXNqlTmYT+eim91DJkClkXg8QzVrnBuxFpPqvrZ2LeU/IBBMANDEiQulu3w5ztxXvKF1cExbRwGIkXy0jGY4cog52vnZAlM1RGpqZ1wfJOTFZx//CrqfFH64mSWeOAJYQbvfCxF8A5ChxWALlVaMOrU7dr2YhFgGYOnqJmuDoGJuvEvpC+FWjRf4cCeJmNUm4T2mdIfa+a7UGlxwxjFDJxHprP+aGM0u25HDs/NXyv9ewfqLZvnoMkU5QV5ackn4LJcnvDSv9Q== 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=9oqGjv34FBcd1v87cGbIJRH+wqlBWpfcyFwWYrkFcN0=; b=MzAq0vGMalS7VCWQ1Drwf8+0RizrYAFr/bLiiDDJO8pNKh5oGNMtXAOJhbCrU8/p2dykw2u4qMmAvmvXZO3ygG/tdIxbdq4Jk9EeoD/iktGyN6mx2EjJIqIK0OMxg/Y2RXdBJQxfua8e8sg68vJoC/p7tmuiHHvwckRRFwYET+KF3rPOcnx4V7hDDZhzoMd4EXdrCs7edVr1XjS5ePdvsmrgjTgxT40yACT7BDZnlIVDE/gtkYcqU9djZL/75EkOrRAi8ZoFoCoXjXE7Zda97R8NQEi2gdSTxnEhoXCi80mUEgEJoMv6wHE6SrsZjEiSl0fsoMrR2CKJIbrV1joIoQ== 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=9oqGjv34FBcd1v87cGbIJRH+wqlBWpfcyFwWYrkFcN0=; b=AUtP3iKoEKUgXM2yfuVbwDQAazxsHN5jdmwgHeGlqblrXQgVW+KqH2oRkE/cMNPPsxB5V/s+ra0naeDkYPhHa+Oa6r6Y2VkIRpJGzT5mEym6l455GY6tzYf7DzG5qx3tb5vfyi1/u5l9yVo2OeoAj1RuFG71KNX47y+Albd6PPtveho87YGjpfwyRzM52TAqEsM58RI7BT/eHIcNf5rkjVxdBJ17XJeuYo6EUwl1CdSm3/kI1SubPV2zo6ptdO5/OviVbK3JCYKw/wo34Z5vS1GbiDt2jyG/6yPd5hSk0DxZivE/qzAtt7IsuOzRfDmzvO3NcUHtuoVWHj3f5O3q4g== 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 BY5PR12MB4196.namprd12.prod.outlook.com (2603:10b6:a03:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.36; Sat, 8 Jun 2024 02:10:28 +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.036; Sat, 8 Jun 2024 02:10:28 +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 5/5] selftests/mm: mseal, self_elf: rename TEST_END_CHECK to REPORT_TEST_PASS Date: Fri, 7 Jun 2024 19:10:23 -0700 Message-ID: <20240608021023.176027-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240608021023.176027-1-jhubbard@nvidia.com> References: <20240608021023.176027-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR03CA0262.namprd03.prod.outlook.com (2603:10b6:a03:3a0::27) 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_|BY5PR12MB4196:EE_ X-MS-Office365-Filtering-Correlation-Id: ce8fa89a-600f-422e-44c7-08dc87602ade X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|1800799015|7416005|376005|366007; X-Microsoft-Antispam-Message-Info: MC7ppyJdKvTeXYw4JfSKuJ2Vrm0SZGOlmr9m01GRrh/WJ8+FC7iEyZDZ8J5Ro56R/3/vRO5RyI/PtIJ33SSRW8c6u5thJfJrK35r3Hn3EBuRtpaLsM88WvvjLjLgcSZ6VnMcGVmsxW79P/rGHeIQo4qCrK8mKHIJAay6kEsh3DC14SnvTSZhvBLSC9wDpdF1ruufdVDVg0Ja9i1mCYZKpaZJDvygi/Jpv+lDto7P7inNUpmjzOqHWWgbLbh/StNxOK1smBYSzHtX/+8Hx2wMZIUbM5t7ANMnfc/qYEjeAs+NUuOpmj5DnkphGr9RgwbRIRl6HmLN/hFz3tTiLljo7+CSKYjvFvjE10alAhw6mspGC/cJnqa52pj5hXJecafIu99lmb0xL6gk4RaXKXARaN5CWYp9Nq6ktUFi0ekkbaOXchAi4Q/RBO+coWWGbuFJ1ukwlmvsX88AjNlexijXIcvqdzWoWQ+oFGwHv/lN6bLknndltugLbD/nnmGVVZSbg45Nib+OmdIne/XqG76dmqxMfldLoqk50Oa47NF/1U29Hie0xowakU7FpiEMtVCJIUSQweEhbQYKdx9+7w55BNmK2LPK8jJp8SJOo61REdBv4DkmXpswboHAnZUhmPWxiQczv+uxyitBnrftw/pqqz9J7GptU74IMuvSKLNGCUZDcEWxfYPfQF6zkOlELVblKcuXiwptvWFMuziMyXMvamBqNj+qVIw+BYlACeTrs4jiebGnauOHqXuvcYJnlTwMvSOgoeduRyzwxdwzzmZ7wQ62pd0/QmsI6b5/WDFGEmRCxC0VlM6R1NC2ZBJzrXu3Y09AYIdzNY0PHGn7DrunaFkJ9hMFO8QTKah9LtVCPzwkYZbMhWzPuY0bSzPzEDMAl85jaBIdAT9lL9iObZl0dDo5wA175N4PxyOBJSF52w9G1HNw+75LdDAuS3WypO05aw9Qlp6bmeHaNzqqO9kT9klbMAziJzGLM6Ea9fWO4eK1fv7E2H0UHfkZoHpNGtIufosFOkaGoes6VxTd8CL6TpPYo/CL2afV5XCQvEqGPVp2/H4bEI0CZbA9o1Kc0mVUszbzyOSQKL4NJOWnv/07Epf5i40XMiXj+bmFbYkRkzD57ONND+oPNFcK0RZYD07XqmUJOs7yMxsZnpybAwdn2o6fv95eH+l4LLH7eVhI6SzlqomGSuJ4eHP+OY3wYKRmx1sca40b14re5gw4W5CSZZjV1veCXSXDQ6FxBYjUgyY5VDEpXTFUcHQIkFCgEQaH+JW1gO669coCv9FRwx8uBMOyKgIWtAks0wbDvor1q9az3dsL2o/uhnqo8a/suiPN 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:(13230031)(1800799015)(7416005)(376005)(366007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: e453cPrrKhKSNiGRea5I1YhfWIM5ZNVcLwV7SGRqkthpSRoNpCuhzppJjz+ogfn4x8HpBpXHIg5Nxt+NoPAAu/0G44FUU+suRyLeY7E5glcxo2UtK/xpQtPWvo1HXDVQlsOVCfM8mYir4KSyySBZcvvPiPnL+4SUNXrIlajQXwILZNU4YFWTd6PU2WFZCdYXM39Uwho7lJqWipMrmdTMn3ZDWjIB/VnIPE5M3E3fna1Ad7qescCQoKqSYRkil+gZaezcvYNDUeV3WH1zbYxLcyKVyhETs7M5Pcv/UazcLh0m1l2NLtHehw+XRfJevIsGXUdQoBAqAxYYXJVP0FkquZV6Risfr34xFvoX9bhR6l0xcZSmEFp7RiiUQ87xFcm+Xw8T8CT2Eygirv2uFC+MwNoHSp/iBnZt9O8d9KTzBoZGb8S9BUV5vPSQCVx23BeKNUbzsDl68Uf7k7lShSrEFT+GdUaPTpAcrz9kJ5fKpkYBUaIsYa0V+opOSWVqwJnNND6cAygyyrqXZTzSFCMtxVYzkaYIEnJS68xyqcbgHCuXk0c3C3XJjK0QnDLIUC4dRRSBa/IrXDJjm05oJemmAOwtiRPIulWzkyQ/gPCZljxrIwukyasKN4Q9EV1L+OIYqLQAdciJacow08//jp7Dx2id0PLcDYrHWVUBWqwm3L9Z+2dXJQt/h6RbhStofYjh0ZnTBEtX9PMIOl4d5hsky5DgzTYUgeU88hoL6wESpT1US1AZs89alNgLuH63xRn1WJjuF9vcPlxbeth8OKfewYtIWricEYEqEjopW7NGBRsN0GEDuzmKokUflrZgP/QeeLBq6WJuLCAJac6d0hbUgCUHzwDj6c+q+o4GoZiRLXG2ZPcZddDfBwYJUMoUhXHPHHDq9TV5UeGHj+kG6rjmCyEfXApfuVKYj13/ai7QaQ9oiYwgZwOe1/qQ2slW4aWgc0eZy+m9Ez5K6ual5hZNp4EanlqgdkNmzWL0CZT6tfBT40wzcyg784x6AR189Ehc4ztGBLJWpSouLMmQ339wrIG6S6Jq7oJe+Ui9H2iENT+TWMef6+95c2BBmsV4nggLpYGqvDORgvvJMgws3cFCLA0yC/METg8J1IjcmRib4K2nEmwB5XFZoLz/JV7Dmjc2gO9DfVO3Jh23JBgAO1ks4oMr7KTzQzfcPPZ3v3Z006+rcoAUw7mTK1S/uCerfWyO36rjLOkhVZyWKbOEqVVCEdfNXmSKM+WncU7aFLJ3gxWjKKlqhsc4WymjHawn2foEQGs+u+Ij/751divkcklxhHoGwAWvveQ4JU9IV7rf7W/uo4oWk2PywxPxX7xJdN9dhRTfJeXrQLiPBRYNX1gw/2sr+s1fkJEFz8X6rr9WCUc0BSK0+isQ/VUHB+UtsR0FcTQtcFtgvVzQQCBMUdapmngQTMbak60XYaeOZUUA5rXy7KKB8f5zlg527gqPaGZWimU1fVaA3nzAnbySolCAZqv1LekwOqKXA91tx4r8bK94P1cQt6zCm9uXPqYZ28Gs7RG+U+Q8++LMQ6zAiAcByIWM6su8ejnpEZQyNM3hU+8p3uuCa8wfrTXTa14qrYA6 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce8fa89a-600f-422e-44c7-08dc87602ade X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jun 2024 02:10:28.6301 (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: EYba7BqkhXAUvows5GGdYzqgEU7hfkq1W6FncefgCaX3KTXT47pnXBp6tMpbJUsCGMXNq+GW+sN5UsoIVzmjrA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4196 Now that the test macros are factored out into their final location, and simplified, it's time to rename TEST_END_CHECK to something that represents its new functionality: REPORT_TEST_PASS. Cc: Jeff Xu Signed-off-by: John Hubbard Reviewed-by: Jeff Xu Tested-by: Jeff Xu --- tools/testing/selftests/mm/mseal_helpers.h | 2 +- tools/testing/selftests/mm/mseal_test.c | 92 +++++++++++----------- tools/testing/selftests/mm/seal_elf.c | 2 +- 3 files changed, 48 insertions(+), 48 deletions(-) diff --git a/tools/testing/selftests/mm/mseal_helpers.h b/tools/testing/selftests/mm/mseal_helpers.h index 8c3bf77dcf19..65ece62fdd0c 100644 --- a/tools/testing/selftests/mm/mseal_helpers.h +++ b/tools/testing/selftests/mm/mseal_helpers.h @@ -22,7 +22,7 @@ } \ } while (0) -#define TEST_END_CHECK() ksft_test_result_pass("%s\n", __func__) +#define REPORT_TEST_PASS() ksft_test_result_pass("%s\n", __func__) #ifndef PKEY_DISABLE_ACCESS #define PKEY_DISABLE_ACCESS 0x1 diff --git a/tools/testing/selftests/mm/mseal_test.c b/tools/testing/selftests/mm/mseal_test.c index a29935d82027..f8e1c59f298e 100644 --- a/tools/testing/selftests/mm/mseal_test.c +++ b/tools/testing/selftests/mm/mseal_test.c @@ -240,7 +240,7 @@ static void test_seal_addseal(void) ret = sys_mseal(ptr, size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_unmapped_start(void) @@ -268,7 +268,7 @@ static void test_seal_unmapped_start(void) ret = sys_mseal(ptr + 2 * page_size, 2 * page_size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_unmapped_middle(void) @@ -300,7 +300,7 @@ static void test_seal_unmapped_middle(void) ret = sys_mseal(ptr + 3 * page_size, page_size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_unmapped_end(void) @@ -329,7 +329,7 @@ static void test_seal_unmapped_end(void) ret = sys_mseal(ptr, 2 * page_size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_multiple_vmas(void) @@ -360,7 +360,7 @@ static void test_seal_multiple_vmas(void) ret = sys_mseal(ptr, size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_split_start(void) @@ -385,7 +385,7 @@ static void test_seal_split_start(void) ret = sys_mseal(ptr + page_size, 3 * page_size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_split_end(void) @@ -410,7 +410,7 @@ static void test_seal_split_end(void) ret = sys_mseal(ptr, 3 * page_size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_invalid_input(void) @@ -445,7 +445,7 @@ static void test_seal_invalid_input(void) ret = sys_mseal(ptr - page_size, 5 * page_size); FAIL_TEST_IF_FALSE(ret < 0); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_zero_length(void) @@ -469,7 +469,7 @@ static void test_seal_zero_length(void) ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_zero_address(void) @@ -495,7 +495,7 @@ static void test_seal_zero_address(void) ret = sys_mprotect(ptr, size, PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_twice(void) @@ -515,7 +515,7 @@ static void test_seal_twice(void) ret = sys_mseal(ptr, size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect(bool seal) @@ -539,7 +539,7 @@ static void test_seal_mprotect(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_start_mprotect(bool seal) @@ -569,7 +569,7 @@ static void test_seal_start_mprotect(bool seal) PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_end_mprotect(bool seal) @@ -599,7 +599,7 @@ static void test_seal_end_mprotect(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_unalign_len(bool seal) @@ -628,7 +628,7 @@ static void test_seal_mprotect_unalign_len(bool seal) PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_unalign_len_variant_2(bool seal) @@ -656,7 +656,7 @@ static void test_seal_mprotect_unalign_len_variant_2(bool seal) PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_two_vma(bool seal) @@ -691,7 +691,7 @@ static void test_seal_mprotect_two_vma(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_two_vma_with_split(bool seal) @@ -738,7 +738,7 @@ static void test_seal_mprotect_two_vma_with_split(bool seal) PROT_READ | PROT_WRITE); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_partial_mprotect(bool seal) @@ -764,7 +764,7 @@ static void test_seal_mprotect_partial_mprotect(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_two_vma_with_gap(bool seal) @@ -807,7 +807,7 @@ static void test_seal_mprotect_two_vma_with_gap(bool seal) ret = sys_mprotect(ptr + 3 * page_size, page_size, PROT_READ); FAIL_TEST_IF_FALSE(ret == 0); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_split(bool seal) @@ -844,7 +844,7 @@ static void test_seal_mprotect_split(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mprotect_merge(bool seal) @@ -878,7 +878,7 @@ static void test_seal_mprotect_merge(bool seal) ret = sys_mprotect(ptr + 2 * page_size, 2 * page_size, PROT_READ); FAIL_TEST_IF_FALSE(ret == 0); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_munmap(bool seal) @@ -903,7 +903,7 @@ static void test_seal_munmap(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } /* @@ -943,7 +943,7 @@ static void test_seal_munmap_two_vma(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } /* @@ -981,7 +981,7 @@ static void test_seal_munmap_vma_with_gap(bool seal) ret = sys_munmap(ptr, size); FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_munmap_start_freed(bool seal) @@ -1021,7 +1021,7 @@ static void test_munmap_start_freed(bool seal) FAIL_TEST_IF_FALSE(size == 0); } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_munmap_end_freed(bool seal) @@ -1051,7 +1051,7 @@ static void test_munmap_end_freed(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_munmap_middle_freed(bool seal) @@ -1095,7 +1095,7 @@ static void test_munmap_middle_freed(bool seal) FAIL_TEST_IF_FALSE(size == 0); } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_shrink(bool seal) @@ -1124,7 +1124,7 @@ static void test_seal_mremap_shrink(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_expand(bool seal) @@ -1156,7 +1156,7 @@ static void test_seal_mremap_expand(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_move(bool seal) @@ -1189,7 +1189,7 @@ static void test_seal_mremap_move(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mmap_overwrite_prot(bool seal) @@ -1217,7 +1217,7 @@ static void test_seal_mmap_overwrite_prot(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == ptr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mmap_expand(bool seal) @@ -1248,7 +1248,7 @@ static void test_seal_mmap_expand(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == ptr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mmap_shrink(bool seal) @@ -1276,7 +1276,7 @@ static void test_seal_mmap_shrink(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == ptr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_shrink_fixed(bool seal) @@ -1307,7 +1307,7 @@ static void test_seal_mremap_shrink_fixed(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == newAddr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_expand_fixed(bool seal) @@ -1338,7 +1338,7 @@ static void test_seal_mremap_expand_fixed(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == newAddr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_move_fixed(bool seal) @@ -1368,7 +1368,7 @@ static void test_seal_mremap_move_fixed(bool seal) } else FAIL_TEST_IF_FALSE(ret2 == newAddr); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_move_fixed_zero(bool seal) @@ -1400,7 +1400,7 @@ static void test_seal_mremap_move_fixed_zero(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_move_dontunmap(bool seal) @@ -1429,7 +1429,7 @@ static void test_seal_mremap_move_dontunmap(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_mremap_move_dontunmap_anyaddr(bool seal) @@ -1463,7 +1463,7 @@ static void test_seal_mremap_move_dontunmap_anyaddr(bool seal) } - TEST_END_CHECK(); + REPORT_TEST_PASS(); } @@ -1556,7 +1556,7 @@ static void test_seal_merge_and_split(void) FAIL_TEST_IF_FALSE(size == 22 * page_size); FAIL_TEST_IF_FALSE(prot == 0x4); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_discard_ro_anon_on_rw(bool seal) @@ -1585,7 +1585,7 @@ static void test_seal_discard_ro_anon_on_rw(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_discard_ro_anon_on_pkey(bool seal) @@ -1632,7 +1632,7 @@ static void test_seal_discard_ro_anon_on_pkey(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_discard_ro_anon_on_filebacked(bool seal) @@ -1669,7 +1669,7 @@ static void test_seal_discard_ro_anon_on_filebacked(bool seal) FAIL_TEST_IF_FALSE(!ret); close(fd); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_discard_ro_anon_on_shared(bool seal) @@ -1698,7 +1698,7 @@ static void test_seal_discard_ro_anon_on_shared(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } static void test_seal_discard_ro_anon(bool seal) @@ -1728,7 +1728,7 @@ static void test_seal_discard_ro_anon(bool seal) else FAIL_TEST_IF_FALSE(!ret); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } int main(int argc, char **argv) diff --git a/tools/testing/selftests/mm/seal_elf.c b/tools/testing/selftests/mm/seal_elf.c index 0fd129259647..131fc13cd422 100644 --- a/tools/testing/selftests/mm/seal_elf.c +++ b/tools/testing/selftests/mm/seal_elf.c @@ -127,7 +127,7 @@ static void test_seal_elf(void) FAIL_TEST_IF_FALSE(ret < 0); ksft_print_msg("somestr is sealed, mprotect is rejected\n"); - TEST_END_CHECK(); + REPORT_TEST_PASS(); } int main(int argc, char **argv)