From patchwork Fri Jun 14 02:30:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Hubbard X-Patchwork-Id: 13697737 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 106C5C27C4F for ; Fri, 14 Jun 2024 02:30:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91B4F6B00CC; Thu, 13 Jun 2024 22:30:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CA9B6B00CE; Thu, 13 Jun 2024 22:30:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 71DC86B00CF; Thu, 13 Jun 2024 22:30:43 -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 9183F6B00CE for ; Thu, 13 Jun 2024 22:30:42 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 49F991203E3 for ; Fri, 14 Jun 2024 02:30:42 +0000 (UTC) X-FDA: 82227915924.22.56D6F3C Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2061.outbound.protection.outlook.com [40.107.93.61]) by imf15.hostedemail.com (Postfix) with ESMTP id 88630A000D for ; Fri, 14 Jun 2024 02:30:38 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=XjtCL5M9; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.93.61 as permitted sender) smtp.mailfrom=jhubbard@nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1718332237; a=rsa-sha256; cv=pass; b=EQwyB5x4X+f5JL8qAsAzViJ1xaMPG+CM0U5uOd+AShYEz5qZ309hc5xKpmtvC2jeBbV0nG qhuMTIhJAnj9z7BYzY+0PjUkdCNDEzDfZggEfqwEe25WBzs+CogbFMzXJF42HkOTc+DRm8 VUuyFuo7uX/hihUgeD6dV1F07X5GhNo= ARC-Authentication-Results: i=2; imf15.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=XjtCL5M9; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf15.hostedemail.com: domain of jhubbard@nvidia.com designates 40.107.93.61 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=1718332237; 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=D9+g6+820LN46VxxBOfmNDi/NM5Xoh65XECL3YB/2Cw=; b=Fx5+GnGRJuXFKI8CXHuv30OuchcmMB+yETtu57dkoCzCAALjLKyc5tPrLX8C+L3JGHxVjf krGaKSukVetXIRMnEIFBbBg36s3PKKGLAMUhdgZSyUQjE6GrPc5PROYCfgHHiZ4iLZT/aZ 7yWyUuyABGU4pEr0ez5gevhK7aD9oyQ= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Yz5fNajO1Ht8QsTCJjpjqR2r2S/oevvFiYWbI8mithve+lVijMlnzrpClH4Ame7kD6YSAcqVB3+uQ5kbAzCsPDJsb7HuvsK2Hqwsd7z+/RZJrmGeYbJptuMB7CTB4dt1lBpZdauGbzIX0SLghYHwaR+TUbQ7Gz1lApmmL+TtK90GqmdATN8eC51VQLeaxOWXbfk8P1GHpsziE510XIxg8zZAjA8nmHdikrbGOLmiexsNlP+iKK0AFREAj9He/fNtE57fmWSmLqZdgUdlBcQCr4vHubehleGFXsVLs5TcF0iWwu+Xs1GyZEBnXO80SfatxOPB41gbwuKvJdAZ57cJ6g== 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=D9+g6+820LN46VxxBOfmNDi/NM5Xoh65XECL3YB/2Cw=; b=E1T6r8fvkoAo/tJej/IhbwyhkJtpUmfJZnfG+MdaI4V+a25SK6fUFNkinzDrlmSDu2oNcDqWlv2JKVLpX6KDEZMsgFWSqV1pFdjJ2LON2OrW+wF0DjynkNnNKbG73rViN0OGlNsWZWKhB3gVg20daAqCxhZfkk69HJgkRpepbVYH//Ibt+POPA8ekAgHbKN3dpYBkdIYZEblXUdqmWPo4F1FdsA1MKskxsi8dZyBGtgaSVdq89H8NTs2rrM9nRAnRczCUlTObDXV9vrINOt9XGkgKQSYRHR3KwhRjkWQj7noejiZrm7xnccawrq7/U5glPBcxR56T1PXBTDrCEY+eQ== 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=D9+g6+820LN46VxxBOfmNDi/NM5Xoh65XECL3YB/2Cw=; b=XjtCL5M9PGDDLLTjCkGUk6gMSVnzOTy9dLREMdLZAzdMjZRKGYnontHK2tNx2K0o7wpdCF/Lu4h8lwdvbTJyYRsfXdP/NPrwld7UhRwI7uOtJNDYA5+YDJp2ylX4Q9xCFwfJZdUXwBxfEms5d5JFvwCKHagWihBU1mYHXQhaef+iMm4u1ir3XVFtroNvjLrI9dqYUHq8Nuo9WkcNDC4mcjtS4cwkQxoRlmqCIT1GKapKhrDw+Xn0VrEdlhNMcyDD8TEp4seBmXNJFA4yUC8xIUC56j3hrQ1HVi6yDtS5UIEXdb+OAI8Vb7CPtKt+IfsIgVjonxGg9U0t3+C0ol7iNA== Received: from BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) by PH0PR12MB7932.namprd12.prod.outlook.com (2603:10b6:510:280::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.37; Fri, 14 Jun 2024 02:30:14 +0000 Received: from BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07]) by BY5PR12MB4130.namprd12.prod.outlook.com ([fe80::2cf4:5198:354a:cd07%4]) with mapi id 15.20.7633.037; Fri, 14 Jun 2024 02:30:14 +0000 From: John Hubbard To: Andrew Morton , Jeff Xu , Shuah Khan Cc: Andrei Vagin , Axel Rasmussen , Christian Brauner , David Hildenbrand , Kees Cook , Kent Overstreet , "Liam R . Howlett" , Muhammad Usama Anjum , Peter Xu , Rich Felker , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, LKML , John Hubbard Subject: [PATCH v2 5/6] selftests/mm: kvm, mdwe fixes to avoid requiring "make headers" Date: Thu, 13 Jun 2024 19:30:08 -0700 Message-ID: <20240614023009.221547-6-jhubbard@nvidia.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240614023009.221547-1-jhubbard@nvidia.com> References: <20240614023009.221547-1-jhubbard@nvidia.com> X-NVConfidentiality: public X-ClientProxiedBy: SJ0PR13CA0177.namprd13.prod.outlook.com (2603:10b6:a03:2c7::32) To BY5PR12MB4130.namprd12.prod.outlook.com (2603:10b6:a03:20b::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY5PR12MB4130:EE_|PH0PR12MB7932:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ecdf677-0c85-4db7-3263-08dc8c19ec3c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230035|1800799019|366011|7416009|376009; X-Microsoft-Antispam-Message-Info: ghs2kGaJxkA1ZxlsF9rnC6cFQMJ9UowF+2MhDOou8AjfYVxfqs9QP7DWXAPhXPT+1jed+QRwKrYkPYIghnU5vFgw1KLIZ9K3UTgXSO5SMtNyrAFkKOZ7lyh+b0+JkVL1a/ezAYit/5/XlNnaqFA/chC+bOVuKCmEy9I2ELP3Vk3/A4TId2PsYblpufUoyN6TDwVjviduhByXDJcSNFdIlxICIuWZakay//HOcXqUmLORuipOScpq17pOWpjULKcacQIr5nq49R4KxyCXDs/D3Gb8KmEODFsFNkdte0pgKyli3lgUtCMDQ/vvubyxDSx1YJ/EfqqrsI2HePcDEAX2+/52DKD3oBd3ltubC2tjn+wRW2DSJ+v2EfRO1/4EutK7w/6yeeVuaTAw2AoU2YF12/N2N8bONI3zXYI2AXQ6x+0O+iUtgk8kb7xZKmtivn3iPe2nIbpenRQrSHs1ML1aX7Skg6VyHuuten1flByYivYRJ18v4xkYDechquEs6u0owtUXndeboCCS/8TBaLFPBePmn6A/izx/pi0B28yXy2jV3cmkWTXfWFGnj7yDDDY7Yua6tN0y/bXjEf5gyTqTb9C3IZ83Adv7+K2cA/6UlW7T9vHp6QuiD4JW/vfDSeAn6adFRCOsuKkkmRDXK3FcZ03OaHa3ZwHqKSXKzzJPUdBpVJADoCOXFEIMVpP017SrprYXmTviUZnM7lBpPmN2fSRb4d2f7bsRU4EDgDsQ4veTDsOkFX6MqFjRtYchploeOBurnNChURmKZWRyS3Ci3PXdj2m9PQ5XAQLPQohTk4/WDujazEtB6lGxBcVlllPwFwKs54nw/lCoVz58OWQ1eTjDvhpsBoUExfMjiVv2ErE+UWjL3Scp4kv6luzLfSABlQWIvk3l/DLlemRSF3BuaTh/Z+sIquF1l1Bvuqn9ETdvcLGx0+uL3Nwh4Qf1C6OuNp9ZqHE25b8XhXpkvUZ/PG+OeIlRWhHRo9NKQIo06m1XJXSnrfnsOfP5LzeskZkoJIKQbakbh0MvpH7ubQ+bc5MS/yFr1ZBYvta1UL826jUXCUMELkrpz/30ND5AGuSiNRzqfDmUw0PhBLgHRYrEJ3yErZOqv2wQ3cqCDGavM6q6MPd+MW+yirxg5spGSEujsJbTF1vhNmUZrLCYc7OS8ZU9Wak3SvrCLlcggkAd4V8n/UBHqPhB21i5ra0eFwfKOcUtDmh23OmjzdQurtH/iXvjUwN69Ap20DaUIyt03XxvfAhQgsEuPMcJGmuVCtjbFcgIy3BtrxQ8PCw9moaj8N8yi8t/wpK6odYZTRUYb2jIuvlzzOdJdAbqFquiGDwv X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR12MB4130.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230035)(1800799019)(366011)(7416009)(376009);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AiLhD4X+TfP3MafMziNMjYJrldP6s5127O4a8h0Kv43u8gT8RL6o4WYlf+eQ2di9uOwhEHfiCcjRiP4ZAG+izyueiygbcmrP9w57ZxQ4tQZuProuudHEe6v56rx9wLuCFzdr26lMX8c3k++EsWBkWk30DDrb5BIaiFL6kkTLfZgyTFUNaDDAhf6HoJArb62mXLMGrF9uAYmz31TNO+6TcQSA1Mw2tFQvhmWJCCgN2l070SdnWC0VbQ2/VhWrQ84jh6ocMAQqV56c0Ji3S3Aj9NNvAhWdEyO4NHRm6m8BAD1Lfw0NJ+s2O0MNOlCGIml9/tYIGFWBnnecChudQLQ+Xcx0FwRVqJZeY8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AoW8/TcYa6iSrJKS6ilmUJorS/IyQHt5+vE/xkvYGwc7G70ZkKYdMlHYSwrmjRMQxPuA1zKt+hpl2XmlAqWiEvj06/HiUqW3wlGdN7B9kH+qSJbK9ttdi/o1hKGCKotsNunCa4sLITVfO429vINKZlBRxPh7ToavMLWTtXjC5+mC3OuH2Vl X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9ecdf677-0c85-4db7-3263-08dc8c19ec3c X-MS-Exchange-CrossTenant-AuthSource: BY5PR12MB4130.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2024 02:30:14.5874 (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: SPjY3FTrQ8Icnkgh7VoMj+BYMoOtR+p7sif1CvGLKvKpGYzFZebgj9tgPieW/0qg4TKPUYlCgrX7K+SqNgVGIw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7932 X-Rspamd-Queue-Id: 88630A000D X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: ewj3hz7nypy8ns7an8m1x74tfhj14qfy X-HE-Tag: 1718332238-201614 X-HE-Meta: U2FsdGVkX1/3BKy7F+wcqukuPZoZ8hokB0Q9361EMpW0hl3/ZoQlV8C3q6o59qKVzmihZ+zeoff/uJbtJQMb5rSc1sLbc41lB8ZtmsUH3QP9Yb2Rk2wMUHRBC07hb4B3nAoZx+WHcGCM2INF0aIwx1dhIUWNm4o2H/EmccBormMD5b1d5L//28FUQlvDnmbx7zKBabX6joV2pIFe6JS8ov6fcmFyWy7yTpwnV+o0JbUoDqXtmOLMMF9PRoeqxg3ZIakho7zEYjlROdna/hjVjOSvENdJhltd0mxoqyrjKNZc78/hBLzKjDk5pFpoM+wRFYKP14XyzVuxd/fcJ/CaoDu1jLpVBloNqHY+MLlYUVQ91kklWI7Y7bHk8OROyPY1WRmOoYcTyIjAs/pFCOCawSAHjp2DHCW1O5Bk+9u3qYUp9YdieieSd0CTO1XQV5rWMP2DlELIfz7tY50AfFbiDIWncrii3IY0XZ7U0iGAu/WG8+ssXDbDBQq0Z6aBypa2DITagbQ6EkhUMEhJTcMW8T2z+Rnl9s95UVZE240YHI0hOZr/C6eKyVhxtml7XQSn/j5bBmuCftDyRiFwLkyhGJLOx0D3QR3Oq8GFOuCKH2KN/nV6ECdb7gJRoHRBokY+Vh6zMC09S/BkX231YzaFk9L9Zkx7krfe3Gu9+P4T5UCaUIoykaaB8AOVgxaDMo6rP/9QyQXzoPtdzap9Wyn2Zyj4N+sRCm766tpONQrzPZSHmOP1kTOydCxrYvOZthO+rwpZ+sJQF+BIWL7Tj+elKXDGblcB4UHyT3dLGKys+OVJzuf/zUSBd6+mugDSu5OgVp6eHdM63b77S2oEFUNwJnxlY288lAdZXKrLoZiokNjWc28MPO/XOqXMVsTVSJnU5xZkernd5Viy9PKGWVAx/v+aboBhEjPKFnpfnLI4yMX2X23khTSuh22FWpAdCzQpyyiMHtN69GTOn1pgOes XLT/TKaJ PP8MYrxcaTP4JCyMtRHSLz8WoeyHDgp07hz0fYgSWaIwK85yAPioH7+h8F4SRtO30qd5p3u4xe9j7CmJzuvEYHX7F7JpPO7KfLeLLAzSUfH31E/JgdV5P0zlbJWGUCA6fHHeHrVqG5++Sfv1fpp+p3bawg+SjSMF+0ceU/IDfvPFqsFPokG9qtJzSDpv1CxNToF+27CySWxLBxwivy1vpvWmcnu1bN/KW6HSWztIEjgUfn2ZWiWAD9Qmhtw== 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. Cc: David Hildenbrand 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