From patchwork Sat Jun 8 02:10:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13690813 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/anUXg1M7WJs3CjlGfH5FUpefi3W9fLtYHNUHoxkbPk6UQ4bTVK6s93LaP59Wj6pRFs2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.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