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: 13690817 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 7FF56C27C53 for ; Sat, 8 Jun 2024 02:10:38 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 077206B008C; Fri, 7 Jun 2024 22:10:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 027096B0092; Fri, 7 Jun 2024 22:10:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D94936B0093; Fri, 7 Jun 2024 22:10:37 -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 B928E6B008C for ; Fri, 7 Jun 2024 22:10:37 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7F5951401BD for ; Sat, 8 Jun 2024 02:10:37 +0000 (UTC) X-FDA: 82206092514.29.92BF54B Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2079.outbound.protection.outlook.com [40.107.243.79]) by imf28.hostedemail.com (Postfix) with ESMTP id B61D4C0010 for ; Sat, 8 Jun 2024 02:10:34 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=cDBEEQxo; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.79 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=1717812634; 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=ZXZfY0TcuwHIFCWojdHQyPgCzHtD2jyu75gGuiYghe8=; b=VTUYy4/LTsvWJkjLdiKpEep4wb4ssrRNSGEmW/AaYUFjUPshuqtNNefOSfOwrsw0GXKbYq t+craf42xCIp9wzdIO5frBykuGbyGZkYcu4/ix37vCXWVQvpDhSiFh5WU2H62+jRzOc92p oHicjSuqfphcOkI/XyUCdzOWdPCfA58= ARC-Authentication-Results: i=2; imf28.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=cDBEEQxo; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf28.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.79 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717812634; a=rsa-sha256; cv=pass; b=uZFUDMDJxgxFHdmeXqDtx38lseI6bEMQnbZuobIXeuCNQFd5/UBcABVhEZLCS/lS59DxmD W7PN6UV8z9Mug5O0dIUHRfW+rgm8ka16v2EreMo3qUQ31Y8rYHXTS8/Bo8FcCeMYVYzx4c G/+ST3x6otvESAHIn/99TX2h74U1GT0= 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== 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) 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 X-Stat-Signature: z6k474pge8gntsh8uz1ukc5acm5wckac X-Rspamd-Queue-Id: B61D4C0010 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1717812634-532842 X-HE-Meta: U2FsdGVkX19LDz8UEQJCu332F4dJ3Y47C/vbgE7MHc09vK68/p0BynYmuNNyBEACrjO4Xph6CJVIaIhCg60UVHy6DavBL+Ji7Ckl0v3oy47dyJzynqtHmAgeccxqcnHx9HhfaSqAT/80aYgpCheA4cEiD03qEeiEdkX1f0bhg5I04xzr4xZewPe6hH8jnlcze94CJ/Tn5tFoFgMNaspNXuFFRY22utdOvK9pSfgSAkejEfBqLHUlid/RzYW7YDXLaw1glQbvFo3EIQn8j7qpi8MLfseUTKK7hBUVdeenJJCWxmEQ13Np/iiLzrh/VyFATiz/++pJaaRwYeGdtS4L6CmhfGcAXjX6+KQptCH9I2lKn/lbzBli58toThSGn61DulxMYHJ1lY8Xokutki50H73x2KUtmbTPwA4844Br/m8Vc5pFc8tLjNpdOyTnf5j5rs5nfUv+y098YFBi75V7qUXghC/bs/GHG0/kxI97xWYkLPygxz8GN+xtYWx3+zaRJYFw0k8TCf0mZAe1LjwT39OV3oC1MdvPA2pbjF3/KHVaNfcTwbMl2gceO6GT7C3xb0gLCePwwpC0xMfVcSaBz/3W436VIVlNAJWXpX/DziEm14NRRLlABPC/QRHmUR2vMr62FKGUUugZl7bPKvwi90JK0kxrOJw1CbK7yuutT6qTL2n4YIZzRVfXAoM+sbvQnGrGxJOK+6XgAxzMjoOTi1PC26VbEt6Id+5I3NLg5KLJLnakRUQYwCXle1xQniWeQtZKBobi8Y24dgApnmXRftA8w/qiCdhTd/H0ocLduW9yHCRR32sS2D4RKGBcLdb1UmFCKe1cANEQmQZPtswPcLmSDR7X+6lSZYc2UZy385Okx3iP6QwXyk6VfSku1HDfQj/pYVNFO0SAmw161qaNiXPgtuFaHBd0JPVTYa/2Q5mp3cA6bA/bl6EhbAtX2ASofS+msbMgPGMRHZVu9Ko BwC7ArWA qoBLmqMymGgoR1gfr1cp4lHijJ3BsLhjzw21UStMS8xv86sHhxNiVP7Qjk5E5KV5S/L0Wj66IYxzfiVgDcX3rtVe64nU4/1Zq5DuiF2v0Srt6toPKl1Wn+TPacUYvHXwQm0gf4afFTO/Gh63pTaeaJeCCp7IUBGqqI35P/yTXZGGCal47gt/4HYrLj3wEX0U6ibkqT5kHuG7jQIxvSzeIzHBW+wh9+FjpttaqSp2pK1/JRxbMJSoBnbd/1w8Tu18Mkk+xSsjpeJGNSdlJ62uAEVGgkMebe7n92G5nQotKVV6uOpwHbXJ8LIvpMzYFWcIkIG5IS0UmvBYiizU= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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: 13690819 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 06E9BC27C5F for ; Sat, 8 Jun 2024 02:10:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 83FBD6B0096; Fri, 7 Jun 2024 22:10:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7F1346B0098; Fri, 7 Jun 2024 22:10:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5F4486B009A; Fri, 7 Jun 2024 22:10:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 3B6196B0096 for ; Fri, 7 Jun 2024 22:10:52 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id F203F16042B for ; Sat, 8 Jun 2024 02:10:51 +0000 (UTC) X-FDA: 82206093102.29.E69CB77 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2080.outbound.protection.outlook.com [40.107.212.80]) by imf29.hostedemail.com (Postfix) with ESMTP id 2B150120007 for ; Sat, 8 Jun 2024 02:10:47 +0000 (UTC) Authentication-Results: imf29.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=eKwGslnf; spf=pass (imf29.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.212.80 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717812648; a=rsa-sha256; cv=pass; b=HpO4uKPqhQDnlUnQzT5Nu2VATPF5tunl4EEZpN/53P0Yg6za1tN1ePsIANvYjPnx+iz9na 7EmAdPhOfBHrFWlfGfrZfadnq4BX4NIAoy39ytc0YjIl2TCy1G+X1txAN8BrDUpKtDdtSW 3GQvgUNCRLc/hYY0Ri/r2MaLCaI2CU4= ARC-Authentication-Results: i=2; imf29.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=eKwGslnf; spf=pass (imf29.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.212.80 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717812648; 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=O+/RmZSS/R2hOjv+bgtoV6Q8VTZwTejdmpBy5zRCcQc=; b=k/hjq8N0NMuyDf0NG8v9xmsWRDkd93wJva/1fMYPtuh3ifxzOu9xIiydHqGBNFapgoZ7Ff 0Dor6XyJXkD9bSPXFR1stdsw8+YpTDnLDNdANtGBS9H8sPM8NgdY3UYc7eWB6eMojOYl3/ 55Z0jsdxFPQy1SDk9jcFyjcEt1R+apc= 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== 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) 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 X-Rspamd-Queue-Id: 2B150120007 X-Rspam-User: X-Rspamd-Server: rspam12 X-Stat-Signature: yttx4iohzu88x7ooxy69tmmswripa8qh X-HE-Tag: 1717812647-585217 X-HE-Meta: U2FsdGVkX18Nrqsd5STkINVwJIZpxD+ziWU30xNHUMlE5L2Sd4FwmOlK6NOICfDCorHaVsp0WxLxNKTFIhHqnOVGZfACFCjz4lwUoNdV6bscUs3nX8JDfNr0w5TQOQxiznG6gud50flUhce8PMNei//lc6GNmQ+ZeObMGp2UYipnF/bOIr8h6ln+BzHnOSS+PzWTgtNMnBecXF7eb3R1OLvD8m0fVWPpJp0JE6eGjMtleqCw6LXhyKLESTlem40Slknp+Z0Z8sDklOBmSE2i9HX8xML/QBzyU0TAMr1h/ekMBaJkOH84FwmPjbsy9t6FlLYAnic1cR8WqfO2yh678UbrJZUBlCGL+WH01tkhUtg0aYUwTCj9f2N7Ybs+1nMrfA75wu7N5TN8HmYd0uyWHCHK14/JuGxv3zMS6O/sGJKJK0jHfQNKcZBDCmdFTKJLlcI2bEAoy7QZzH0iBTIq6E7naILJm/odQfU1uWGNn3iIUJzajUH/1WUpwJpfo+qfqkBvhHU5FpH3DDMIpskbOmROYP/xUxKhwZX3XzAglfuwpr9j8zugukNkcM8T7FjrsKq/QrasE438A5xg3/xg0UEN5MkQ02AjAUOHaIEWvnZSMA04sug0q/JRB60xVJAYg067njUnw6aOjMtOwM6eeWSV0fucBxWNfCTeg4yJeJMVoe83FVwyOGN5/er+uyN/p8h/ndlDOIL6eXcPJUxksLvnSJAK6F98bujw1vBLkFVFKBHRY0t3TPAh0V4XEzB4xNOvxODcSe/s6DsiMh+5tM08cP5y4cyrzwdvV7aL3iPPlGm6xJy1Cgk7dkzv4WN7B79eevhnhYhDWdCveXTXI9xeXgtW7freRpBTmBzKCI8vEWuSR/jA/9UMFKOrewl71I0YQ33Lt2dMgKVChDb2xRc84sUTJHWHgql3dbzcc4pVCVtt09+9hePzUNzcgC5hAtgn7TV4bxR2qIQj7iX GG/88Ob8 qpI4gFVaQUef4/52XAicNLDWZjUwJCAecI3hl2YJd5EPjwFo5Plo8xAvhSeT6HHp80nf7TnEQkz0hm2yamK/krwlOKKQW4psHbWWnvxqpbuWvyMp4PQ2rLpRNtrBrkTZiRzROnh/t0AAt6ZjlCGgFNzVs7Ce7kuvH6GODkVT3qc9meF7Y312TKD/wTpQFRg5M2YTkXm+XCDWTvBP6nm9hG6pq6jhKRbs5osNE5RgZneD5f8TLE5x1Uwq9y6pQPVZmIB+KUcratjeJESf18V6pIGeA/+X87qhW7yvvOl0xmqVLjwQIeScZck0i6ZzJK93+d2SB2hgbZeLIfEQ= 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: 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: 13690820 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 279E8C27C53 for ; Sat, 8 Jun 2024 02:12:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AD7AA6B009A; Fri, 7 Jun 2024 22:12:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A882F6B009B; Fri, 7 Jun 2024 22:12:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8DA876B009C; Fri, 7 Jun 2024 22:12:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 6D9306B009A for ; Fri, 7 Jun 2024 22:12:06 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D5D3C80520 for ; Sat, 8 Jun 2024 02:12:05 +0000 (UTC) X-FDA: 82206096210.26.0420B79 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2070.outbound.protection.outlook.com [40.107.212.70]) by imf10.hostedemail.com (Postfix) with ESMTP id 0A697C0007 for ; Sat, 8 Jun 2024 02:12:02 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=K4ofHFid; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf10.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.212.70 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=1717812723; 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=pZDWmta/WEXdEfNKbz6L8CJQ23neTi3jcvsGNZDTPnA=; b=gdFB2stsd0cwZGCXxJMRhI874MtCub/DgTHwTLhAO5jE3f8YoSO6aT0ljzgsWMTwD9uUad cGME1BcLYKe6d0qPQNl/OnWFcxLEE5XWvi81PmC1MN/dXqm1zJiuB/N1susp5wuJSeSEzZ yU2eaoNltUCP5SEvkbS1WN9hIKlBpgM= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=K4ofHFid; dmarc=pass (policy=reject) header.from=nvidia.com; spf=pass (imf10.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.212.70 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=1717812723; a=rsa-sha256; cv=pass; b=FYRDEBjQPFGxFDpWWmzQ6jDK1ChIQUOJRipqzgMiHB32t9KPTvYdIWzFQkw++ZD70nCScH HycthHrWXUr0kC3liBIec4i4eckmZZ+SBIZ+DV17P+g4lqAXlkbEQ9oxok/FPwL+AAqYEv Lem2UUam9LsKRxZXJVD9FKi8+oNqxa0= 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== 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) 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 X-Rspamd-Queue-Id: 0A697C0007 X-Stat-Signature: gm6watnq7xzyt9b3m98ykdsmndha9f9y X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1717812722-552374 X-HE-Meta: U2FsdGVkX18ERMPSw2tRYmJHyosHf4VwPbWo+xAnlR0iig1VlWDAjNExanI9zYSkq0eoMR/kyVsfbkhzwGHX8K4NZm+59P20MlqPsnobAO6/e/scqqKUDnMwmpG2ZiP2bNCyCqayT8bRylz1ozE5ltVENschh9YFfSu+uVQyLvP6E3X7v4a0uYvEf6UsQdd2WHMotoegy/PAuvo9UogVxi6tkowMLTSax2WItW1wv3eQywFcLLmGb9whhCpU15Z54LVa89Qv3HYGrkovKW4qLd5tk/51CuPAkjBAwAchadq7Sj6JeVBvsdn98NZLSrUvy3XsIqdr/wWq78JIcPanBi/eHxXGiAzrXtpyIheCBcIdRkQCaVcHJWGDOJ/YHHa+fM6ymDEHxXmb3Hsx7tkEYKQTP/6kzp/I3hIGmUe3pFazD7EjC6SbbqqtKOW97EIfgJNMa72UL4m2sGhqJFndkSoQ+YRRxSWCHnKQbd83TIb1FeOAE59TUlLK0xrdABiMUzCDbkjDVbgUwuSBU4mTGoSwh7eeFQNFNOMsibXk4OFS7HG2qrlHaqIqWlkpG4Slzt7+uFQ7xAe51OxNncH+zo1wMZ25CnAHdojWDszjXp0GkIQ/3o6qKeW7SknI0HTquVWs9jw4GJ/APz4AD2Iz2CkGWlOh4vNN5w/nvfyMLh40Rvno5T/u47JJHXbyG+tuaXU5PDqOdJqk60BDPopLpTQUv+G7PPeKpMWaEpdNUDmV/VKfkblnf77my3qU0Flcds9nQtrddw1Ue2LqXsw+ON04wrolGXT3qX7s0uChU98SsZ+7sw2lPvznqPwXRCjDPp04ImSiK7GhJogEW/TxYRYvP+rjconsDnWXH0UIygoEMsk8gSwfK8UcjJKi4WyYrt3DDlLIeQU5DubDemWH+i4Cz5GznGSyrocZIWf3fiQvXlezthG7+VmyKyFWumMY+8aQcy8v6hHFwofX/m9 DJ37ydCb PasB7/kXQovF+3VPKbOuj3DoZd/O4P0pxopr0MJcm0H6k7saEgsao0yy1ChgbrbQ0NlEZXnu3ed4+ndeG4ACFNoWvpUfPEbHQWFtTi/ovEGjieA/Ai8bjMN0zNpndkEj886j1CQ75gsCI9/Tctc/qTeJB2mwh0PropsjOZBNnkVFkqwnoeYqxMXTEEXIqcz7fdAPcrOt865nPDLia71B2bZUHxO1ukbWxjGBL 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: 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: 13690818 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 2D9C2C27C53 for ; Sat, 8 Jun 2024 02:10:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A3C016B0093; Fri, 7 Jun 2024 22:10:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9EB676B0095; Fri, 7 Jun 2024 22:10:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 83DAF6B0096; Fri, 7 Jun 2024 22:10:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 65DC86B0093 for ; Fri, 7 Jun 2024 22:10:46 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id F0BC9C08A4 for ; Sat, 8 Jun 2024 02:10:45 +0000 (UTC) X-FDA: 82206092850.15.FE91B6C Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2043.outbound.protection.outlook.com [40.107.243.43]) by imf05.hostedemail.com (Postfix) with ESMTP id 2F21C100006 for ; Sat, 8 Jun 2024 02:10:42 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=jOy7tgMz; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.43 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717812643; 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=eHcL2+kvCrCQkV4frQnNbum43yoJZFURF80YKG6CdtY=; b=RZETSdE1VEfwqVw0W30pxmkqDPGMHNomOR2fItaf65G6jhVoB8IX1cL9WBGKKYmYxLd/0Z BLTiustHRFjO8fMAKnusRGV39PlETjWtKn98HZdUxShRm6zBR/bfJ2hwMc9N1oWC1wm2yM ThRUKz2Oelu/cO/8Voer1rFeamAoVww= ARC-Authentication-Results: i=2; imf05.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=jOy7tgMz; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf05.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.43 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717812643; a=rsa-sha256; cv=pass; b=tU+otCNS9YdMTQm3dSGgDzcts9LQ15F2+7ggDPDUMe/T4G1CF+zu9cEvjLa7He9oXjUNEg NUKdCPzpw4ftHbXdmPcrb7abdEapFvKY2u2v+dDtRzUyRytitbXDYbxPfiW1c6GCo4lTRF vVWHo00av7zXlzYwMbKoHsGGesvW2u0= 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== 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) 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 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 2F21C100006 X-Stat-Signature: ccbo1ghorzurf5sxtkmeg8hd7w5xbeo7 X-HE-Tag: 1717812642-483882 X-HE-Meta: U2FsdGVkX19FRrz5xxtsZPu4Ai1pn+/34+Gk9vRUJbdsl7MUMUhWfnZoJfWsKjeHN0eB1QbCdZaubOgC6RTCTcqh89lSE5Cz8C8RPyye2hl3IiWs9oQWL9yJ3FnX4/fz0osu74y6ZvkDCKfu51tuyzQxpk8wEDrgjiv9hj0YHlHN+g9s3pIHEbRuHPW6Wi6QfvX90EYEj4ZmHEDzw3qq0coK39/2L0Pns4dCLePqy0DZMo6kJhm/dVWU1bVUS6YiqLnx3FtSqAUhsa6DJAoPPeivsROG0O4nEMwdNAkwgnz+/ENaVsHeLUm0tyKSmrlqmyqc6vcBZOafgln6v9kiNM0UYIRy4ofvWlAlNo3ufrdhj09QQfRILTdM6ic2PtawQ1lEvjS1zUrYBiebiOvRJQeH7tHx3tGnmuSiym8tddwxoTogEJ4OLLfTBOl1Xn4A3RfEsDTBoGUUfBPBY+Ws6+q8sLCm7jvXp0irMz/CHZ07YUBLWDosh8bMHaQyFknXuX5bk3qDHAUVZIvoJE27ZuUgTzn2n2XNtoVXVnkBr7VlWhpVBWQ3cPgWgOZpDQKyUk887po+1EHgrVkFhR9Hglr0EDCbg2RgTixI/NXuVPMDLjeW/gDMGE+p+QP3ARwoiNzPTgUnN2uYZZfdO1jKQTLJHpvilEL4RbYz5fCLvvnZXLtMY+TvqI9zrbg0S/V9LFJZSPSEyut/W+Rciv3VWxtC0I4VCo1MP5L4xgJIYrV4eincg7/AAnuwwcQuP5V+JY+T3UEc67YxAtDjNXCa/USoKKHRH5iW8ziFMKmPJ7oDtWu6bK8I80yLHMosxhPFrhD4lI+kn4SzmV7xgG6pqroS5dk8f4Xl2Bq6oTexCBYTwebtLjeQ5RUUq/0kvVK0dLnCq6JflIq/5GKEVmO3fIl9/CuJFuNF2q/CMPDQugjDzjlekP+4PwdRd9LipuvThVPJvR+sjNbB2zzx5lH cGpVaj6r o3mE0Bd/QHOs8FyglR7btKGwoD7s7ybJOkgdgE7hzADaxgd1YlJnYnxyUgdXSw6fmo+TflHWcLOrgn8SXmepmAlfQWWSgMpiDsgMsiMdCkfzf4egKGEGGZkGQKVFzbDPkua3cauwbYeWK45jSPGaaZ0oo0fPmrUbfumrHygkvWiBrddoaPYL5bji/Kfe2SoMTDb92lZtGzkdABwCjVfDKEI8aDpntC+CoQpn/7SYgzWpZwTIWcmx8tkk6gw2teOsynf5PSu83LiFOqszo0cLBWvocuVv8qF2lATojW5IQmEMG3qAprTRpMmzSHkFNNoZ981JsBdKhHIY6C1w= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000040, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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 Reviewed-by: Jeff Xu Tested-by: Jeff Xu --- 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: 13690821 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 D356FC27C53 for ; Sat, 8 Jun 2024 02:12:20 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61D336B009C; Fri, 7 Jun 2024 22:12:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5CD7E6B009D; Fri, 7 Jun 2024 22:12:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3F92E6B009E; Fri, 7 Jun 2024 22:12:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1BA966B009C for ; Fri, 7 Jun 2024 22:12:20 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A5AAD16014B for ; Sat, 8 Jun 2024 02:12:19 +0000 (UTC) X-FDA: 82206096798.02.4391C8E Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2045.outbound.protection.outlook.com [40.107.243.45]) by imf18.hostedemail.com (Postfix) with ESMTP id BA0851C000A for ; Sat, 8 Jun 2024 02:12:16 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=AUtP3iKo; spf=pass (imf18.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.45 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1717812736; a=rsa-sha256; cv=pass; b=M89TB78VyI6WsDGz3YuEDpz02pBfE/CHj4tI0MkSFHr6ejIto5mDP603GU0I5IEEzE804g q988fCoPQaWNUk8jUhraK2b4MBX9KaiuH4z4XPZMlX9zVqVaVUF2JiOXJSN02wndEHF58/ HrQ3Iwz0qNRrMLSPzu0oo4iRrd+SNWs= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=AUtP3iKo; spf=pass (imf18.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.243.45 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); 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=1717812736; 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=9oqGjv34FBcd1v87cGbIJRH+wqlBWpfcyFwWYrkFcN0=; b=tRYfkP1Hv0NhmVQ5jIix+jM0Yu2ON/rGdlXuKxzrHvkCwMQcHdafArV/qQmTy7CnI42Y9L mIX4dJrQWL5Q4mAEGEFKawtf6pVZrFB8MQ47SFrF6GorPamT8cSXQBvBrtBWYv4R/qRifU ITeo5khaPUHbOYa8ax7Ya4rVfs3Wkx0= 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== 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) 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 X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BA0851C000A X-Stat-Signature: cs5a6tjnmepj65xrq6audnde4wkmpje7 X-HE-Tag: 1717812736-237094 X-HE-Meta: U2FsdGVkX191cMXZUH8OBXubG8+fclfQ6ty2vHbULAge0vnatD/jfDPdk8tFuRoBYLloKYSc2Pixcp3ddYgqcjcQypfr9CeRxpVUSneKzMsdrNF7Eo9t0Zz5Sji78cqwjD7I8mEtokq8rzlRp08Sr39uDSKDYigqjiJ1kzYjO+cM+BE8yiXT4R9vvkZANCKhoR4cqbWnlm1Bpywz68nbh6LdsQkP1Y5IjtQyfHT+9qX/rljV6+Z+KoSwmm9W2hlRp38yl0XfvvnrJrImGxCUxAbug0Y5JiV3iKZBjF5fS+vXG16LWOyWkjYIAntJaZJfrcsqa4Bqsxb0vJ/+MIIuiJp8TtiKdhn60R8doQQZ8VF03DwsZmgZNivWIkMhYH7nMtXMrH+YtR2W3dPzSq2fPYVVLvys1NMXe2M9+mXraRPaLEvBRhCIhXgqMG8zyxeTwK3ly9M/mvcWaoEJmiGCwehXVrpOWcIYsd3ka6ezZOSVRKkUT0hnmV+kpDNq7oDRfBHKGeTNZhvWk4AkBF/BF0GYVUVmmu1sreNdMWFauT3ueoeolibYR9l1RtOUUEje8CGzoGvPhpzktVcUrb7lP/1lKbzk51CNtDTM6txAXxoZC6lzAXC+vdw2nx7z81G3hp0J2VsJ8GG3BTZFEzqh2plLPI3d8xbt05+FgWL9NMm4Bp3JEJkFe4fjdpJU6HVTfPH2dP9jjfPjjYmdpVStlLVeUxyxVd+EopU+ivC7WzpyCme7lbTZvEMBxgOEbMoDsGC647sFUIsyAeHchR6XPNCsQF+4j2hxyDUjX6wBRLKomBm2m9BW/USZoGGyArFR5+7Z9iNDl/9NAN6NkNKsYVl4kLV/eHSc800XhAr43wO2WeATfW2fVcc4odR/Jg9Iuf9Lbq60WnDOWJdGfeugIeGjlguhsW1TRvm6cpRt+/3NOXMfaWIgX5YJb4RrTUaVXptCn0VbVYFh4JzzYSf 64ojKo5j FCAXG5Qu97XLqa/fDZ5mmYWg1V5KD6x8Vo7fEV5Hu88F9Jln8LQo25OU5a3qKWMafaG6TZEmPtRCu6lW6bFldQnN1xF8NHUpnZdlxWocaHaAIhkLR5vPVDChSti7K1lqYvKmOF1rmDDi/MglPfyOfdntDzdQaXlZColGqrPU+pHkry311VPpwDXzrP3U4ObUqZcN1mmld5/ph0PKhdXz5KvRVcV6SZOLJDwfREMWceTuLNjr79PpAyDCbd+h/WHYXu2NqRJGcOWykVxttZYtiWcIcSgB9TRnhU46k5kPWQcuRh1eJZQ9LMj47xkMMpPnd3m+Y52d7Y7RlinI= 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: 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)