From nobody Fri Oct 3 18:02:02 2025 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2087.outbound.protection.outlook.com [40.107.94.87]) (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 67D682D29DF; Wed, 27 Aug 2025 17:56:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756317401; cv=fail; b=ttjuFZjPYBIqulyomEHqOfoIvoRANrgUN9edFPU8axqXdng5NZMqAN/hyfa3vnLigL7ntSe2y8ZbeFukhENuvjAWmRZlEMzdBIL3AC7XFbx+j1WfMdIT15XX12mZsNnYS2YehLSdQML8eoMNcVV6KsxHLqaxqfR/v9VR+OYhrGU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756317401; c=relaxed/simple; bh=f+xr5tSYNUlgjaQQuwXDZvtPhjDyZII8cC4DTt2xQoM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RRp2gCx0F6Jmx7OoMdO0UBFVnLzh4/0UiCWvflV/l7EWxI2EWMGfmpmXp51Akm6W9psAoJZIdX1ZjM09lf3NwkSGFMXyRIjUyeaC+hfyIHkO6fcg3BF4bA1gTEmNy82HAtlGdVB5bWh1hA49PHBqOtFHiaDObjnAv502VUyWM9g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=jD0Gdc/X; arc=fail smtp.client-ip=40.107.94.87 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="jD0Gdc/X" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aEC7/5TJXHBZZC3gCYhV7+HH5/SlFdmviSE6GBgTa9q4S4LeifcFhYRBK3E/jtPGDh5faUu1FSlBSk0LF1TyZ+f9ly5URBMD+J5z2Em6gqzXld7rS7YdKaaqwiBQ/ERzI0bincxP63uNA/5cSldvsF6pB9N7DyeM7NJra5hPjgP9xZyBRvVn9WwNpt+omuGW/E0cFS2L4vQynwwfA0WrrOYb71Sei4vF/fKjSd+6N1a464d/DDK0k94fi7TI4PJDVT5fFiA2GxrzDCW6800Ohf7HNbk27mzbKuBrtpfJPbNDlyDXG9nClGyFtwGoAETVp3fNyrv5W1UFp6dgzQhgvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=lxZI0XnfKEPRmBNAqV7ZPx9xYGIyZsZhBVXBJa35aDI=; b=PH6AxBlqZ3tU1RZGPE5WLNETD1M7RCDO031JXGYVhy+stdxtUfdD0JySYGHc891PKXSQtGf6sZ+vjv7p5+L8wbRJxDDliQY+qFgYlE31KncMJ7kZwUP5wlWOmMXCiyisz9HLL1zM+hxozl5QkDdDMSHCpLPbv2YeA37ZEqj0k2WQtb1lJJOs46Thr8kklEPIj/uy13Vk5aILzCyKFrR8huJ2ViMrRrEI5KbC0oL/02Hzg0b5eGoF8hbclwhBoOGc8nh3XtWeFA0pZ47bKcIIlXNzkpXGM/rr3jxYIAvs2I9umXqw5+kbcwHTl01k7MZi4niQc22JhjRSV3gzgaBc7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lxZI0XnfKEPRmBNAqV7ZPx9xYGIyZsZhBVXBJa35aDI=; b=jD0Gdc/XPPDF/UCc7T5N0ctccleofEpAn05GYqgKbZXe4aVhMyK/lT193zyFSvsw9KFEzW+H7yFlKN9DAVZ2d60Fp5KwsI0BM6uHcVGDF22KUuhdauMbGDBNM0VQfIbwgD7kQYepMK+oE8KuYWvYVIK9NLYWI+S+e03lxhks3G8= Received: from SJ0PR13CA0136.namprd13.prod.outlook.com (2603:10b6:a03:2c6::21) by PH0PR12MB8008.namprd12.prod.outlook.com (2603:10b6:510:26f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8989.20; Wed, 27 Aug 2025 17:56:32 +0000 Received: from SJ1PEPF000023CD.namprd02.prod.outlook.com (2603:10b6:a03:2c6:cafe::18) by SJ0PR13CA0136.outlook.office365.com (2603:10b6:a03:2c6::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9073.12 via Frontend Transport; Wed, 27 Aug 2025 17:56:32 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ1PEPF000023CD.mail.protection.outlook.com (10.167.244.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.9052.8 via Frontend Transport; Wed, 27 Aug 2025 17:56:32 +0000 Received: from kaveri.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Wed, 27 Aug 2025 12:56:13 -0500 From: Shivank Garg To: , , , , , , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH kvm-next V11 3/7] mm/mempolicy: Export memory policy symbols Date: Wed, 27 Aug 2025 17:52:45 +0000 Message-ID: <20250827175247.83322-6-shivankg@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250827175247.83322-2-shivankg@amd.com> References: <20250827175247.83322-2-shivankg@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF000023CD:EE_|PH0PR12MB8008:EE_ X-MS-Office365-Filtering-Correlation-Id: ce52832b-9b33-4321-d48f-08dde5930eb9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6D+v3/Nm0j0TRH1xh4733kthLNmgOxH6pMXCiiwUvd4OpnQtP7xe9YF4C6wz?= =?us-ascii?Q?Q3nU7X82phmKJ6IU1tk2tO2Soxr2xYfTcZqoTj4brr8bHwxUTEsBXrLtUAOd?= =?us-ascii?Q?DzlGWoR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ytEurT4qm85HD?= =?us-ascii?Q?RFqmFeEjEwHnQJfyvJdWMCE6y4OnKOSa286llXfoDSQiAb7cVfs6ssAhHdgt?= =?us-ascii?Q?V0rOX5/mqNlzBNFjKw8QAV7qcOelT67eSaO9RZokwOu1EsEe+e41QylnRfrB?= =?us-ascii?Q?ijfXU7dVeHf2rzXk/p1BKNYIz04nQ7bW8ancfJ9dNWohsU4qqcqiSa0+iOLP?= =?us-ascii?Q?jaUbYqtorUkREAD/LWzodQZkmnEiy2mTDzAdaBbpAetI+XEZcgGpcZqdtZ3U?= =?us-ascii?Q?OnkGL1RNVGs9WuiYdKt5wuK0yQrilrkVu4a68XmvRnhfe9xTTpw9mS1ub7Qs?= =?us-ascii?Q?Idir/X0suU0XgBZtfbPLXFaYVuFEsTKI6bbHQ5lq70dddEV7Dkzn3GrhApqU?= =?us-ascii?Q?eOjlGnTK2VbGIEGiWBR36evloSBWfVxzK3mojJJ7aXpxhTp2mD5rrxvwpjg0?= =?us-ascii?Q?RbMVxA66U5Co2rbFRICZfhnjJ4wShWSjqT/XmODkpWF1QoNK3mHsBcO1AuQ2?= =?us-ascii?Q?mQsMWvdnJ4tJku3Gzuz4AGkCO6sKchFsJjPL?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2025 17:56:32.5138 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce52832b-9b33-4321-d48f-08dde5930eb9 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ1PEPF000023CD.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB8008 Content-Type: text/plain; charset="utf-8" KVM guest_memfd wants to implement support for NUMA policies just like shmem already does using the shared policy infrastructure. As guest_memfd currently resides in KVM module code, we have to export the relevant symbols. In the future, guest_memfd might be moved to core-mm, at which point the symbols no longer would have to be exported. When/if that happens is still unclear. Acked-by: David Hildenbrand Acked-by: Vlastimil Babka Signed-off-by: Shivank Garg --- mm/mempolicy.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index eb83cff7db8c..3d797d47a040 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -354,6 +354,7 @@ struct mempolicy *get_task_policy(struct task_struct *p) =20 return &default_policy; } +EXPORT_SYMBOL_FOR_MODULES(get_task_policy, "kvm"); =20 static const struct mempolicy_operations { int (*create)(struct mempolicy *pol, const nodemask_t *nodes); @@ -487,6 +488,7 @@ void __mpol_put(struct mempolicy *pol) return; kmem_cache_free(policy_cache, pol); } +EXPORT_SYMBOL_FOR_MODULES(__mpol_put, "kvm"); =20 static void mpol_rebind_default(struct mempolicy *pol, const nodemask_t *n= odes) { @@ -2885,6 +2887,7 @@ struct mempolicy *mpol_shared_policy_lookup(struct sh= ared_policy *sp, read_unlock(&sp->lock); return pol; } +EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_lookup, "kvm"); =20 static void sp_free(struct sp_node *n) { @@ -3170,6 +3173,7 @@ void mpol_shared_policy_init(struct shared_policy *sp= , struct mempolicy *mpol) mpol_put(mpol); /* drop our incoming ref on sb mpol */ } } +EXPORT_SYMBOL_FOR_MODULES(mpol_shared_policy_init, "kvm"); =20 int mpol_set_shared_policy(struct shared_policy *sp, struct vm_area_struct *vma, struct mempolicy *pol) @@ -3188,6 +3192,7 @@ int mpol_set_shared_policy(struct shared_policy *sp, sp_free(new); return err; } +EXPORT_SYMBOL_FOR_MODULES(mpol_set_shared_policy, "kvm"); =20 /* Free a backing policy store on inode delete. */ void mpol_free_shared_policy(struct shared_policy *sp) @@ -3206,6 +3211,7 @@ void mpol_free_shared_policy(struct shared_policy *sp) } write_unlock(&sp->lock); } +EXPORT_SYMBOL_FOR_MODULES(mpol_free_shared_policy, "kvm"); =20 #ifdef CONFIG_NUMA_BALANCING static int __initdata numabalancing_override; --=20 2.43.0