From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489978; cv=pass; d=zohomail.com; s=zohoarc; b=Fc9TFsbBtqJKfsfu+rMYSGTSPIFpVMYtsoMai6cnca3fcWgz7F/RxErKvN/sjDFgJMKDugrGHvYHyXDsjxRlsne2NHH1hiWtUxRTOo+9Yt1zDLOs/cuh2SRQHww0l/TOVf+WewZ7I8TAimMI2x8nrF9MAGI0CSVUvbQWjLuRaBc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489978; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=YxOcHOXvmIbr0QEYbINptXR3BM3f6TIv8bBEhB3MSPE=; b=QGINJICxJE5sbtVhiIvofE7tCvB8TG24o9zUT0wLi0ju85VKBdFhv9qwqW4flTXUxiVV4sbY6mrmo3Ji8GZljiT6MREhG+YuxNgO3chMY3mzPMFTcbaoOSU8lfbRFlFU6waFje0H6hmjWVflYsG+zHNse3neNCz7cYH8RglkcXE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757489978511900.9961512043631; Wed, 10 Sep 2025 00:39:38 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117574.1463655 (Exim 4.92) (envelope-from ) id 1uwFQ6-0006Cq-Il; Wed, 10 Sep 2025 07:39:10 +0000 Received: by outflank-mailman (output) from mailman id 1117574.1463655; Wed, 10 Sep 2025 07:39:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQ6-0006Ch-Fk; Wed, 10 Sep 2025 07:39:10 +0000 Received: by outflank-mailman (input) for mailman id 1117574; Wed, 10 Sep 2025 07:39:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQ4-0005yt-GW for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:08 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2060c.outbound.protection.outlook.com [2a01:111:f403:2414::60c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3b29f9b7-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:07 +0200 (CEST) Received: from SJ0P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::27) by CH2PR12MB9544.namprd12.prod.outlook.com (2603:10b6:610:280::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:03 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:a03:41b:cafe::60) by SJ0P220CA0017.outlook.office365.com (2603:10b6:a03:41b::27) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:03 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:03 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:38:58 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 3b29f9b7-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yjYAtNysZXPnxXPZywMkxtpRWtfpd0NwvpyfkkblJm1e59WLAj2246pYtPCzq5JFp39U54cpe3mnAjL7t2Y2jj+Y9arDj8vYaEMVDMoJBk5PRkF68ujK7tecqR22xz6tUp+3gvA/xMbto4KdDXXX5swevDphnG1eQAMdudMj2xSmAb2QVcNeTOM2jgfdsEFW6FFzEqL9O18+mNBhBcOdnnbTJQ7+9yVEGgakNtT6MZeHDQx9Fn5JWfzqcL/0Tztxq79m+YrgWtbsHOzxsanZ3erQ7dEL6pgyyb3MziswfCi1A7N/9BtN5O5tsv52TWu/8EaTVRCDNY7Yq1Nc+LSnAQ== 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=YxOcHOXvmIbr0QEYbINptXR3BM3f6TIv8bBEhB3MSPE=; b=K1hjXjn5Ga2XHPikBmzNn+vjOkL0V6r49xymlNlLHa/rExtLmz9rVlCr6VREfyBsEFLIp/dVZ8vWi+G1qxKsPo6j2OJzMqViKXW3ytP7Q5RH8iRUEigFse2as7dpfz5UGpuNrw8V/+FghSw0TQgHFb3AO9vzog83iZgeaRSTtrfvvjs7E1U/QGFnfFZTM/SKcXLwsbVmnT/7X0XQurQmOAWrBmlj5IbsvhdnxXkcpYkHCAtB9N7nIUn0yx4Q634MSgAwAhKlmwCRsjPmk/4kbCk6Bfj6n51pbjUZ0yHW8liKe6iVrLMFjPY6/CnXX9h/DN3YpiZUnp4WQBpZetVzdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=YxOcHOXvmIbr0QEYbINptXR3BM3f6TIv8bBEhB3MSPE=; b=G6oMCg++PlJB6Rd0kHxqX4agvhUXF9o26MSDdbEXyKXA+l6Ykt9E+aXcouZaeyI0ZIW8wmTlWrKRyKqpjrj1z61/qMM95aXUtJmZOwSELYa0p/XHgqY/3F9/OaZBgYnV4InWKpX6V2wAAn9wvxwolNT1rIlnZoKFvBsKBnVNTzM= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Anthony PERARD , Michal Orzel , "Julien Grall" , Stefano Stabellini Subject: [PATCH v2 01/26] xen/x86: move domctl.o out of PV_SHIM_EXCLUSIVE Date: Wed, 10 Sep 2025 15:38:02 +0800 Message-ID: <20250910073827.3622177-2-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A4:EE_|CH2PR12MB9544:EE_ X-MS-Office365-Filtering-Correlation-Id: c6b828ef-62d5-4e73-9dec-08ddf03d1d54 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?lRcMgvABeNNSS2kzOiQqAFxZsOU80Lms3fMDKFzLs8n1XXULDq3vlLz1L10w?= =?us-ascii?Q?Pso4n9h6GceDPmRuPjCQXHGwa3TLHJ9dLrge0spr1jzeC+yMK2pvs7j43piy?= =?us-ascii?Q?9m6kSBdu9OorssHsKcu0gizxqywA/+2D+KmIgKaiVxTIvEjaGUXF1S2o+0g7?= =?us-ascii?Q?aFacyBLcHQ5PuJ8f1lC/pzcE6ZZCDrtPhGAiWrrdEBh8Pp8mKxS9VUMnNKNd?= =?us-ascii?Q?OWMK7QRdeAVh1WRr/rBFx41BGpDWJJP9K3mJjOmBAKinwr1z4ashoSGhc9WY?= =?us-ascii?Q?hE91x/mUGA7uR7hCrMMf7WbGqcu6eZ//OIC53RVmhxeHyPm7kyx9KqMqtkbI?= =?us-ascii?Q?1rRliw6p6OenpUYNtGSiOMbz75+4zlJICunGwSgtNBLrbCdYQJp+xEEmenAf?= =?us-ascii?Q?1er0JD9VDGV3RrRB7b8EpEFIMBar0ulGDdfSf8k/l/pR2RfhZyYYQ9VLXMOi?= =?us-ascii?Q?Md2Y+5fJzU1TuCfXZTM5avEuqHpUmoP/foIs2fNqbZvhEyC+aCC9krY/230F?= =?us-ascii?Q?9nlM6KZjm7uwLEwNwIpl4h0WgspXgFp44EfXvAqZRm8bH6oaV5sOI+ggrkfr?= =?us-ascii?Q?7nMedc8rRVNc44WtbnIENyp8n9s/Ndt1n/uvpeZlHDY58E3311r7NnT2eBwY?= =?us-ascii?Q?GEV5tX48neYqKU29W57nhf+r/9e57x6qS104Uos2hJMRH8AJyf6x4cUNKGLt?= =?us-ascii?Q?KfcWs0ToPny9AWtR4HcNx1eGRglbNB5dUOZnB7VKKQgA4njYFd+vfIT9pz7B?= =?us-ascii?Q?5wuKmqmH2+hRj4/131I3AKaNVtDNKMHBsoXWx0CMiOuwUnQI/wO6JL1jX4PN?= =?us-ascii?Q?Q5WeBO+5Lk74cVZRviTFpePVslr3bfHsG6YFCRdwYw0rJ/SEDAeLMQ7KlJSy?= =?us-ascii?Q?h+XwJApY2ahxkyddzcCdJ/wFFOUvOKEeS1SQJ75PvB9926i5P04WqQGVx0qc?= =?us-ascii?Q?DMhQWozoGi8WCIFV351E4+lEwiQPo291LOHeSKdpI6juX+zIHd24GK2vBR38?= =?us-ascii?Q?iivnPNGayNCY2NlnKQ5UT13R5mFt3CpJwvHURAIPi4e+VRaZh6xLliMTM0xL?= =?us-ascii?Q?FSpta82ZhbuHP6ERD3XRAeLfFb2I3al//aQkvFKPviGMoaikL/mg3mDJD8oC?= =?us-ascii?Q?d4FsguwB/F9BREYDxpGT15Do7EFSHxAV30OaG7jd5lKAfJtecDSaLTSQNT9d?= =?us-ascii?Q?YSiPEvzp7Lnqlmgptku3ZNaE5I1GscGCXzlJG877n9EthVVo8LZknd17TOH9?= =?us-ascii?Q?LDY4YF0GCc+EL9h1Hwjsb3gFpN07Vxy9pgdgxfG1ghUgn8ENbbsBGUfuFsjl?= =?us-ascii?Q?R3YKO1zziwiK7PuqAnDsI1ybF5xlfnGLAgeCkKP4Uh5KJKp+WRdfJPWub4ab?= =?us-ascii?Q?Ikl2amTrP7igYbeE/dX1pDDeBMr2e4iWSzSBXEr/piIwBxNPO9+VnJGXXffz?= =?us-ascii?Q?frP2zuGPDrq5wYFnnfiBPgMRTLSlOCHkvxoswxKIDGf2TAmdiuKK51IpOmmk?= =?us-ascii?Q?ONHu8sKYB07xv2GGXaDhHglyLaJZ3VkYAPnH?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:03.1589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c6b828ef-62d5-4e73-9dec-08ddf03d1d54 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB9544 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757489981197124100 Content-Type: text/plain; charset="utf-8" In order to fix CI error of a randconfig picking both PV_SHIM_EXCLUSIVE=3Dy= and HVM=3Dy results in hvm.c being built, but domctl.c not being built, which l= eaves a few functions, like domctl_lock_acquire/release() undefined, causing link= ing to fail. To fix that, we intend to move domctl.o out of the PV_SHIM_EXCLUSIVE Makefi= le /hypercall-defs section, with this adjustment, we also need to release redundant vnuma_destroy() stub definition from PV_SHIM_EXCLUSIVE guardian, to not break compilation Above change will leave dead code in the shim binary temporarily and will be fixed with the introduction of "wrap domctl-op with CONFIG_MGMT_HYPERCALLS". Fixes: 568f806cba4c ("xen/x86: remove "depends on !PV_SHIM_EXCLUSIVE"") Reported-by: Jan Beulich Signed-off-by: Penny Zheng --- v1 -> v2: - remove paging_domctl hypercall-defs --- xen/arch/x86/Makefile | 2 +- xen/common/Makefile | 5 +---- xen/include/hypercall-defs.c | 4 +--- xen/include/xen/domain.h | 4 ---- 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index d7aed7d92c..84a83839d6 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -28,6 +28,7 @@ obj-y +=3D delay.o obj-y +=3D desc.o obj-bin-y +=3D dmi_scan.init.o obj-y +=3D domain.o +obj-y +=3D domctl.o obj-bin-y +=3D dom0_build.init.o obj-y +=3D domain_page.o obj-y +=3D e820.o @@ -79,7 +80,6 @@ obj-y +=3D vm_event.o obj-y +=3D xstate.o =20 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) -obj-y +=3D domctl.o obj-y +=3D platform_hypercall.o obj-$(CONFIG_COMPAT) +=3D x86_64/platform_hypercall.o endif diff --git a/xen/common/Makefile b/xen/common/Makefile index 0c7d0f5d46..be442a3e47 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -11,6 +11,7 @@ obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) +=3D devic= e.o obj-$(CONFIG_DEVICE_TREE_PARSE) +=3D device-tree/ obj-$(CONFIG_IOREQ_SERVER) +=3D dm.o obj-y +=3D domain.o +obj-y +=3D domctl.o obj-y +=3D domid.o obj-y +=3D event_2l.o obj-y +=3D event_channel.o @@ -70,10 +71,6 @@ obj-bin-$(CONFIG_X86) +=3D $(foreach n,decompress bunzip= 2 unxz unlzma lzo unlzo un =20 obj-$(CONFIG_COMPAT) +=3D $(addprefix compat/,domain.o memory.o multicall.= o xlat.o) =20 -ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) -obj-y +=3D domctl.o -endif - extra-y :=3D symbols-dummy.o =20 obj-$(CONFIG_COVERAGE) +=3D coverage/ diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 8370b4b289..221dc25f6f 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -200,8 +200,8 @@ sysctl(xen_sysctl_t *u_sysctl) #if defined(CONFIG_X86) && defined(CONFIG_PAGING) paging_domctl_cont(xen_domctl_t *u_domctl) #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl(xen_domctl_t *u_domctl) +#ifndef CONFIG_PV_SHIM_EXCLUSIVE platform_op(xen_platform_op_t *u_xenpf_op) #endif #ifdef CONFIG_HVM @@ -280,9 +280,7 @@ hvm_op do do do= do do #ifdef CONFIG_SYSCTL sysctl do do do do do #endif -#ifndef CONFIG_PV_SHIM_EXCLUSIVE domctl do do do do do -#endif #ifdef CONFIG_KEXEC kexec_op compat do - - - #endif diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 8aab05ae93..11d2505420 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -185,11 +185,7 @@ struct vnuma_info { struct xen_vmemrange *vmemrange; }; =20 -#ifndef CONFIG_PV_SHIM_EXCLUSIVE void vnuma_destroy(struct vnuma_info *vnuma); -#else -static inline void vnuma_destroy(struct vnuma_info *vnuma) { ASSERT(!vnuma= ); } -#endif =20 extern bool vmtrace_available; =20 --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489985; cv=pass; d=zohomail.com; s=zohoarc; b=afo39JJ1FxzvG/GrGbEBlIIQq128I13SUkCY1bdP8A312lnwu3Nog0PLUNSGiD1pnEm7o+DudsKo2jQ6u1IJ9oooLN2tzWJ/2XK+JsEmdZOMAfWwUfqJaNySTbtsJd8jxhRBnrDeGpZuc6icwzyGGJRIIH0f+md2hcsfCerobTc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489985; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=mmjjRmwBMN19DHx48HzdXSUmgXoB7lWnLJIzlZkESg8=; b=k1tlmvFPcC+v0P6mUmd/VYbOGxuFvYvm207LGR48EaueZ/PuniBzYPJgL3Jq5w7LUfBhDlcithoSDur1g55GcQEyQdyot6SeppC84Vsch+ttPLyoTtgH9FMFwKuNqca8eIai1IjFIJ2GdrmeFydbfEaemeTMtChZilZlVHa+etg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757489985448562.3890275958686; Wed, 10 Sep 2025 00:39:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117579.1463666 (Exim 4.92) (envelope-from ) id 1uwFQN-0006ej-So; Wed, 10 Sep 2025 07:39:27 +0000 Received: by outflank-mailman (output) from mailman id 1117579.1463666; Wed, 10 Sep 2025 07:39:27 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQN-0006ec-Nn; Wed, 10 Sep 2025 07:39:27 +0000 Received: by outflank-mailman (input) for mailman id 1117579; Wed, 10 Sep 2025 07:39:25 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQL-0005yo-Gz for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:25 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20617.outbound.protection.outlook.com [2a01:111:f403:2418::617]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4471cef5-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:23 +0200 (CEST) Received: from BYAPR11CA0044.namprd11.prod.outlook.com (2603:10b6:a03:80::21) by PH7PR12MB5853.namprd12.prod.outlook.com (2603:10b6:510:1d4::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:16 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::1b) by BYAPR11CA0044.outlook.office365.com (2603:10b6:a03:80::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:16 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:15 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:00 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4471cef5-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TDn/iPtAeFk2eolpwvEXxyGtiRb0z1Up5i+4L5Iv461Mx1yVqktEfmsOcLs3/dcG7EUp3vDL9HDm71a3hT+FSAR2JheFQKUoMb4j2VXxNSkr+Gd8M8+mIL+GZbe+niug3yfLC/xs45dGZ9loL3d78CZNhVdejG77eNmRNH6eJweOIGTUncFu2s2PO6kQMclnmw9dGn0apW9IOSa/aq387YrDmR7lAVTUeit9IhuV4FtwCPFIgwzhjf+LGeaR8lCuikRNWZZX0mDknD5q3Ka5eEW4Soe+cEoTOKoq6n8oUE/uJWQKEj7kVfY5w+LCTin98slKA4eoPpCd8X2nGvJNoA== 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=mmjjRmwBMN19DHx48HzdXSUmgXoB7lWnLJIzlZkESg8=; b=owPkcO50ToyKBWkA+ee4VT74Hz03nbvo3Zdeksogb3b7OLq89y3fyabihHo1Quf4Zbgw1MAhFEmMAFiz+N/7Jfrb2PurOF9JQ+4YykEAHH0nXzhjH4bLZpBNYnUom92vAnCWVico9Zbbijia7XvhvPLsNrZox2mkDnux33nldVwugvFc22qcf9W0t0tFFCjdt82ycrUZy6sSO9Pi5vKxOdqYQZ7kMTaF2eAH4U9+lR8bL+SWIPep2LQDp3MCARjLEdAf9/pCzM5rit+iizLMFpTEOjVcejjg6fYNPKOfGu65mHjCkmwr7zz/Wc7ZQ1d9aj5oNO/5BIYphcoVL7zGyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=mmjjRmwBMN19DHx48HzdXSUmgXoB7lWnLJIzlZkESg8=; b=SasBvWLOY5+BxXYlgiMYoP5TsMw3F89UZgdfFIEvVJuirpYSDcF5H1aWIamjjiFX3Y6O+EHeCltLiGhPYGj25fY2TF/S44+E/hjzFrL1PLpWrOa9h1aIcd7sRKf+HX/y24+5RbPvN/Qe/vQognVj9XAS72dZjKBd2Rq1S1rNEeM= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: , CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Bertrand Marquis" , Volodymyr Babchuk , Alistair Francis , Bob Eshleman , Connor Davis , Oleksii Kurochko , Nathan Studer , Stewart Hildebrand , "Dario Faggioli" , Juergen Gross , George Dunlap , "Daniel P. Smith" Subject: [PATCH v2 02/26] xen/sysctl: replace CONFIG_SYSCTL with CONFIG_MGMT_DOMCTL Date: Wed, 10 Sep 2025 15:38:03 +0800 Message-ID: <20250910073827.3622177-3-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|PH7PR12MB5853:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c366754-861e-47f8-4b00-08ddf03d2493 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?SDCwXseAW7duwi/8yuHhOmmJmXQY/CMRvCfTRXmjsJEJbPaHkq6wN+/50URe?= =?us-ascii?Q?RXbuNSmsZv2EkHrky+zxgsnALCFtaR8hvkIBO67W+fHcOxIp1lY9HjJ6QfTk?= =?us-ascii?Q?t4MReTCWl0jPbMnrrRaIYsWu6J2YyMchlBtGVOvHBdQJVCzZ04r4oFTImAuZ?= =?us-ascii?Q?OBhiOBoyyaCxbJ1X3Bup2WRTMrSO+PXGvR9xQauAnFG2GwiUxVs5ebhcTk15?= =?us-ascii?Q?q+DEL0Z0KFTRlQ28uIkrIJX0MZmVY4hW4e6pAHHn3P2flm2uRjFweEG3V+gb?= =?us-ascii?Q?ZxdyGtodZ8QH97lOL/gGeBc33+qZamSVpr5csxFrBBlwMiVlQtY8QLNT+G0f?= =?us-ascii?Q?fowg2B9vfMhDp81/dpYp9Yv1Yeaxh/TpYYvamenGsS71McLLPNb/ttFZClE0?= =?us-ascii?Q?I+LUgatxYBclP2Kv2v+DFWUCMtGfB5RboYa7X+LODoTtfFugVpiaWZR8UIKZ?= =?us-ascii?Q?jM6ksgXZP5eekd4hrifEjba5n/JHgW8np/MdMu6LjRVRY2FmUpTM+erCVnCv?= =?us-ascii?Q?Q7JfTsT8x48AQUGOVo+fz/bEOnqRMIqdkmyPQSwxxMTehyCn/n69zw2VYe5U?= =?us-ascii?Q?55jU4PJjTj6QdzOOv8pWXTQoQdP3oml0b7f2G5qj166TesSAHDgXsdeLS2Nw?= =?us-ascii?Q?S1CqYH4n8jamPHPH2ghtS57WdQienXODk7Aa9gwycObqX/UOuptL5cKaxbna?= =?us-ascii?Q?t8m+wGsJzRxbYVAQoEBQ79ujyYBcmkMk5UQQbU3rSyAEDIPiB16hQeV3iHvi?= =?us-ascii?Q?7iAR8ImMctE9j58DrVAIyKZRTGbepRYuBI1Q39vrUII3TYv94+bpV2kpXqyZ?= =?us-ascii?Q?Xq1WOsdgHaOT77/MunC8nCh69wxsfseloE8K9Lhex4fYYC77vzoRub7gye02?= =?us-ascii?Q?lhzLOEGS+5XJyYSqiqyjTg+7OJx1sniD6PWQYAPBzeb+qmwliV37x3gJVRUV?= =?us-ascii?Q?cAbj0O9QouXCyylZF0VdgGG3jkCLNq+eHZukt+JX0AqixvgU7o/G+4aD/xgo?= =?us-ascii?Q?lU5yXA8r4yUQTIlrzj8sInxgSn3WBjXzPnyXDR2Ei/4If2y04LFpxZba0Hro?= =?us-ascii?Q?+WepfyLX3XpICnGj7MogfC01DZhD5f5OgIM6uzTvNAbAtdz5P2NSg3qWCDuJ?= =?us-ascii?Q?tILGGIRYtiXder4Rrt8k6QXkVs0aoMl+/2JYlymeG+pZelR4R8+0BexYeOfc?= =?us-ascii?Q?OGIH2JDwGLDS38nHwFz6iG7FyZrRLQCRS8V/WE2pJI6DUB4zKroz2VsHb4FF?= =?us-ascii?Q?s7ly0VfioUP/4/oeT4ScIqSOAFgjPPX3TeuaJXoP+ODMOPIwyN8SKhVNia1R?= =?us-ascii?Q?uPjCP0xk/PCNi7k7VYbUy1KR4ti60lDEliHe/MPL94leRN5PsQ1rWc/0o1Z3?= =?us-ascii?Q?6XC8zaD1nEq6Qmrd6VnJYEFnw/5Wbe0S7CGkNY8Xy8PNL6Y5Ie0tfUVyHZmc?= =?us-ascii?Q?N8ZRZj8eahSeG/lHJibOIvaIn7gS5BnCrxIamf+wcgQsg3XBQiqhNke3Pi07?= =?us-ascii?Q?e31ZQsM0jCSoudM1506izVZCZ3KRmHJp4vaj?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:15.3094 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c366754-861e-47f8-4b00-08ddf03d2493 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5853 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757489987448124100 Content-Type: text/plain; charset="utf-8" Rename all the CONFIG_SYSCTL into a single CONFIG_MGMT_HYPERCALLS to help provide a single option to manage all unnecessary hypercalls, including sysctl, domctl, etc, in dom0less system and PV shim mode, which could also make it easier to support randconfigs. Suggested-by: Stefano Stabellini Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - new commit --- xen/Kconfig.debug | 2 +- xen/arch/arm/Makefile | 2 +- xen/arch/riscv/stubs.c | 4 ++-- xen/arch/x86/Makefile | 2 +- xen/arch/x86/configs/pvshim_defconfig | 2 +- xen/arch/x86/psr.c | 26 +++++++++++++------------- xen/common/Kconfig | 20 ++++++++------------ xen/common/Makefile | 2 +- xen/common/page_alloc.c | 8 ++++---- xen/common/perfc.c | 4 ++-- xen/common/sched/arinc653.c | 10 +++++----- xen/common/sched/core.c | 6 +++--- xen/common/sched/cpupool.c | 16 ++++++++-------- xen/common/sched/credit.c | 6 +++--- xen/common/sched/credit2.c | 6 +++--- xen/common/sched/private.h | 4 ++-- xen/common/spinlock.c | 4 ++-- xen/drivers/char/console.c | 4 ++-- xen/include/hypercall-defs.c | 4 ++-- xen/include/xsm/xsm.h | 12 ++++++------ xen/xsm/dummy.c | 6 +++--- xen/xsm/flask/hooks.c | 22 +++++++++++----------- 22 files changed, 84 insertions(+), 88 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index d900d926c5..a69615cd63 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -37,7 +37,7 @@ config SELF_TESTS =20 config COVERAGE bool "Code coverage support" - depends on SYSCTL && !LIVEPATCH + depends on MGMT_HYPERCALLS && !LIVEPATCH select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS if !ENFORCE_UNIQUE_SYMBOLS help Enable code coverage support. diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile index 7e88ddd3d7..2aff1a1630 100644 --- a/xen/arch/arm/Makefile +++ b/xen/arch/arm/Makefile @@ -51,7 +51,7 @@ obj-y +=3D setup.o obj-y +=3D shutdown.o obj-y +=3D smp.o obj-y +=3D smpboot.o -obj-$(CONFIG_SYSCTL) +=3D sysctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D sysctl.o obj-y +=3D time.o obj-y +=3D traps.o obj-y +=3D vcpreg.o diff --git a/xen/arch/riscv/stubs.c b/xen/arch/riscv/stubs.c index 1a8c86cd8d..a74e56843c 100644 --- a/xen/arch/riscv/stubs.c +++ b/xen/arch/riscv/stubs.c @@ -282,7 +282,7 @@ unsigned long raw_copy_from_guest(void *to, const void = __user *from, BUG_ON("unimplemented"); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* sysctl.c */ =20 long arch_do_sysctl(struct xen_sysctl *sysctl, @@ -295,7 +295,7 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi) { BUG_ON("unimplemented"); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* p2m.c */ =20 diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 84a83839d6..a9fdba0b4c 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -67,7 +67,7 @@ obj-y +=3D smpboot.o obj-y +=3D spec_ctrl.o obj-y +=3D srat.o obj-y +=3D string.o -obj-$(CONFIG_SYSCTL) +=3D sysctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D sysctl.o obj-y +=3D time.o obj-y +=3D traps-setup.o obj-y +=3D traps.o diff --git a/xen/arch/x86/configs/pvshim_defconfig b/xen/arch/x86/configs/p= vshim_defconfig index 24f4e4857d..d1db94df78 100644 --- a/xen/arch/x86/configs/pvshim_defconfig +++ b/xen/arch/x86/configs/pvshim_defconfig @@ -25,4 +25,4 @@ CONFIG_PDX_NONE=3Dy # CONFIG_INTEL_IOMMU is not set # CONFIG_DEBUG is not set # CONFIG_GDBSX is not set -# CONFIG_SYSCTL is not set +# CONFIG_MGMT_HYPERCALLS is not set diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index cce7020868..80ce5804b4 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -135,7 +135,7 @@ static const struct feat_props { */ enum psr_type alt_type; =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* get_feat_info is used to return feature HW info through sysctl. */ bool (*get_feat_info)(const struct feat_node *feat, uint32_t data[], unsigned int array_len); @@ -422,7 +422,7 @@ static bool mba_init_feature(const struct cpuid_leaf *r= egs, return true; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static bool cf_check cat_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) { @@ -435,7 +435,7 @@ static bool cf_check cat_get_feat_info( =20 return true; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* L3 CAT props */ static void cf_check l3_cat_write_msr( @@ -448,14 +448,14 @@ static const struct feat_props l3_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L3_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D cat_get_feat_info, #endif .write_msr =3D l3_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* L3 CDP props */ static bool cf_check l3_cdp_get_feat_info( const struct feat_node *feat, uint32_t data[], uint32_t array_len) @@ -467,7 +467,7 @@ static bool cf_check l3_cdp_get_feat_info( =20 return true; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check l3_cdp_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -483,7 +483,7 @@ static const struct feat_props l3_cdp_props =3D { .type[0] =3D PSR_TYPE_L3_DATA, .type[1] =3D PSR_TYPE_L3_CODE, .alt_type =3D PSR_TYPE_L3_CBM, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D l3_cdp_get_feat_info, #endif .write_msr =3D l3_cdp_write_msr, @@ -501,14 +501,14 @@ static const struct feat_props l2_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L2_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D cat_get_feat_info, #endif .write_msr =3D l2_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* MBA props */ static bool cf_check mba_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) @@ -523,7 +523,7 @@ static bool cf_check mba_get_feat_info( =20 return true; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check mba_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -561,7 +561,7 @@ static const struct feat_props mba_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_MBA_THRTL, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D mba_get_feat_info, #endif .write_msr =3D mba_write_msr, @@ -826,7 +826,7 @@ static struct psr_socket_info *get_socket_info(unsigned= int socket) return socket_info + socket; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS int psr_get_info(unsigned int socket, enum psr_type type, uint32_t data[], unsigned int array_len) { @@ -858,7 +858,7 @@ int psr_get_info(unsigned int socket, enum psr_type typ= e, =20 return -EINVAL; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int psr_get_val(struct domain *d, unsigned int socket, uint32_t *val, enum psr_type type) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 76f9ce705f..c1571377d3 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -508,7 +508,7 @@ config CRYPTO config LIVEPATCH bool "Live patching support" default X86 - depends on "$(XEN_HAS_BUILD_ID)" =3D "y" && SYSCTL && HAS_VMAP + depends on "$(XEN_HAS_BUILD_ID)" =3D "y" && MGMT_HYPERCALLS && HAS_VMAP select CC_SPLIT_SECTIONS help Allows a running Xen hypervisor to be dynamically patched using @@ -600,7 +600,7 @@ config DTB_FILE config TRACEBUFFER bool "Enable tracing infrastructure" if EXPERT default y - depends on SYSCTL + depends on MGMT_HYPERCALLS help Enable tracing infrastructure and pre-defined tracepoints within Xen. This will allow live information about Xen's execution and performance @@ -648,21 +648,17 @@ config SYSTEM_SUSPEND =20 If unsure, say N. =20 -menu "Supported hypercall interfaces" - visible if EXPERT - -config SYSCTL - bool "Enable sysctl hypercall" +config MGMT_HYPERCALLS + bool "Enable hypercalls under management" default y help This option shall only be disabled on some dom0less systems, or - PV shim on x86, to reduce Xen footprint. - -endmenu + PV shim on x86, to reduce Xen footprint via managing unnessary + hypercalls, like sysctl, etc. =20 config PM_OP bool "Enable Performance Management Operation" - depends on ACPI && HAS_CPUFREQ && SYSCTL + depends on ACPI && HAS_CPUFREQ && MGMT_HYPERCALLS default y help This option shall enable userspace performance management control @@ -670,7 +666,7 @@ config PM_OP =20 config PM_STATS bool "Enable Performance Management Statistics" - depends on ACPI && HAS_CPUFREQ && SYSCTL + depends on ACPI && HAS_CPUFREQ && MGMT_HYPERCALLS default y help Enable collection of performance management statistics to aid in diff --git a/xen/common/Makefile b/xen/common/Makefile index be442a3e47..fdf826f218 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -52,7 +52,7 @@ obj-y +=3D spinlock.o obj-$(CONFIG_STACK_PROTECTOR) +=3D stack-protector.o obj-y +=3D stop_machine.o obj-y +=3D symbols.o -obj-$(CONFIG_SYSCTL) +=3D sysctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D sysctl.o obj-y +=3D tasklet.o obj-y +=3D time.o obj-y +=3D timer.o diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index 1f67b88a89..26615d1e97 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -602,7 +602,7 @@ out: return ret; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS void get_outstanding_claims(uint64_t *free_pages, uint64_t *outstanding_pa= ges) { spin_lock(&heap_lock); @@ -610,7 +610,7 @@ void get_outstanding_claims(uint64_t *free_pages, uint6= 4_t *outstanding_pages) *free_pages =3D avail_heap_pages(MEMZONE_XEN + 1, NR_ZONES - 1, -1); spin_unlock(&heap_lock); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static bool __read_mostly first_node_initialised; #ifndef CONFIG_SEPARATE_XENHEAP @@ -1788,7 +1788,7 @@ int offline_page(mfn_t mfn, int broken, uint32_t *sta= tus) return 0; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* * Online the memory. * The caller should make sure end_pfn <=3D max_page, @@ -1873,7 +1873,7 @@ int query_page_offline(mfn_t mfn, uint32_t *status) =20 return 0; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * This function should only be called with valid pages from the same NUMA diff --git a/xen/common/perfc.c b/xen/common/perfc.c index 0f3b89af2c..97a94ef1fc 100644 --- a/xen/common/perfc.c +++ b/xen/common/perfc.c @@ -149,7 +149,7 @@ void cf_check perfc_reset(unsigned char key) } } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static struct xen_sysctl_perfc_desc perfc_d[NR_PERFCTRS]; static xen_sysctl_perfc_val_t *perfc_vals; static unsigned int perfc_nbr_vals; @@ -266,7 +266,7 @@ int perfc_control(struct xen_sysctl_perfc_op *pc) =20 return rc; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c index 8a4f4259d8..7d6c40d800 100644 --- a/xen/common/sched/arinc653.c +++ b/xen/common/sched/arinc653.c @@ -220,7 +220,7 @@ static void update_schedule_units(const struct schedule= r *ops) SCHED_PRIV(ops)->schedule[i].unit_id); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /** * This function is called by the adjust_global scheduler hook to put * in place a new ARINC653 schedule. @@ -335,7 +335,7 @@ arinc653_sched_get( =20 return 0; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /************************************************************************** * Scheduler callback functions * @@ -661,7 +661,7 @@ a653_switch_sched(struct scheduler *new_ops, unsigned i= nt cpu, return &sr->_lock; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /** * Xen scheduler callback function to perform a global (not domain-specifi= c) * adjustment. It is used by the ARINC 653 scheduler to put in place a new @@ -701,7 +701,7 @@ a653sched_adjust_global(const struct scheduler *ops, =20 return rc; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /** * This structure defines our scheduler for Xen. @@ -736,7 +736,7 @@ static const struct scheduler sched_arinc653_def =3D { .switch_sched =3D a653_switch_sched, =20 .adjust =3D NULL, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .adjust_global =3D a653sched_adjust_global, #endif =20 diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 2ab4313517..a0faddcb92 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2068,7 +2068,7 @@ long do_set_timer_op(s_time_t timeout) return 0; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* scheduler_id - fetch ID of current scheduler */ int scheduler_id(void) { @@ -2111,7 +2111,7 @@ long sched_adjust(struct domain *d, struct xen_domctl= _scheduler_op *op) return ret; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS long sched_adjust_global(struct xen_sysctl_scheduler_op *op) { struct cpupool *pool; @@ -2140,7 +2140,7 @@ long sched_adjust_global(struct xen_sysctl_scheduler_= op *op) =20 return rc; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void vcpu_periodic_timer_work_locked(struct vcpu *v) { diff --git a/xen/common/sched/cpupool.c b/xen/common/sched/cpupool.c index f5459c2779..51ba3cb43d 100644 --- a/xen/common/sched/cpupool.c +++ b/xen/common/sched/cpupool.c @@ -241,12 +241,12 @@ struct cpupool *cpupool_get_by_id(unsigned int poolid) return __cpupool_get_by_id(poolid, true); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static struct cpupool *cpupool_get_next_by_id(unsigned int poolid) { return __cpupool_get_by_id(poolid, false); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void cpupool_put(struct cpupool *pool) { @@ -354,7 +354,7 @@ static struct cpupool *cpupool_create(unsigned int pool= id, =20 return ERR_PTR(ret); } -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* * destroys the given cpupool * returns 0 on success, 1 else @@ -382,7 +382,7 @@ static int cpupool_destroy(struct cpupool *c) debugtrace_printk("cpupool_destroy(pool=3D%u)\n", c->cpupool_id); return 0; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Move domain to another cpupool @@ -572,7 +572,7 @@ static int cpupool_unassign_cpu_start(struct cpupool *c= , unsigned int cpu) return ret; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static long cf_check cpupool_unassign_cpu_helper(void *info) { struct cpupool *c =3D info; @@ -638,7 +638,7 @@ static int cpupool_unassign_cpu(struct cpupool *c, unsi= gned int cpu) } return continue_hypercall_on_cpu(work_cpu, cpupool_unassign_cpu_helper= , c); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * add a new domain to a cpupool @@ -816,7 +816,7 @@ static void cpupool_cpu_remove_forced(unsigned int cpu) rcu_read_unlock(&sched_res_rculock); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS /* * do cpupool related sysctl operations */ @@ -982,7 +982,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) =20 return ret; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 unsigned int cpupool_get_id(const struct domain *d) { diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index 6dcf6b2c8b..0cbec2a9c0 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -1256,7 +1256,7 @@ __csched_set_tslice(struct csched_private *prv, unsig= ned int timeslice_ms) prv->credit =3D prv->credits_per_tslice * prv->ncpus; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check csched_sys_cntl(const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc) @@ -1299,7 +1299,7 @@ csched_sys_cntl(const struct scheduler *ops, out: return rc; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void *cf_check csched_alloc_domdata(const struct scheduler *ops, struct domain *dom) @@ -2290,7 +2290,7 @@ static const struct scheduler sched_credit_def =3D { =20 .adjust =3D csched_dom_cntl, .adjust_affinity=3D csched_aff_cntl, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .adjust_global =3D csched_sys_cntl, #endif =20 diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c index 75316d42b7..307e63ebd8 100644 --- a/xen/common/sched/credit2.c +++ b/xen/common/sched/credit2.c @@ -3131,7 +3131,7 @@ csched2_aff_cntl(const struct scheduler *ops, struct = sched_unit *unit, __clear_bit(__CSFLAG_pinned, &svc->flags); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check csched2_sys_cntl( const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc) { @@ -3163,7 +3163,7 @@ static int cf_check csched2_sys_cntl( =20 return 0; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void *cf_check csched2_alloc_domdata(const struct scheduler *ops, struct domain *dom) @@ -4248,7 +4248,7 @@ static const struct scheduler sched_credit2_def =3D { =20 .adjust =3D csched2_dom_cntl, .adjust_affinity=3D csched2_aff_cntl, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .adjust_global =3D csched2_sys_cntl, #endif =20 diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index d6884550cd..b7ff67200b 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -356,7 +356,7 @@ struct scheduler { struct sched_unit *unit, const struct cpumask *hard, const struct cpumask *soft); -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS int (*adjust_global) (const struct scheduler *ops, struct xen_sysctl_scheduler_op *sc); #endif @@ -512,7 +512,7 @@ static inline int sched_adjust_dom(const struct schedul= er *s, struct domain *d, return s->adjust ? s->adjust(s, d, op) : 0; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static inline int sched_adjust_cpupool(const struct scheduler *s, struct xen_sysctl_scheduler_op *op) { diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c index 0389293b09..9d08159615 100644 --- a/xen/common/spinlock.c +++ b/xen/common/spinlock.c @@ -690,7 +690,7 @@ void cf_check spinlock_profile_reset(unsigned char key) spinlock_profile_iterate(spinlock_profile_reset_elem, NULL); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS typedef struct { struct xen_sysctl_lockprof_op *pc; int rc; @@ -750,7 +750,7 @@ int spinlock_profile_control(struct xen_sysctl_lockprof= _op *pc) =20 return rc; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void _lock_profile_register_struct( int32_t type, struct lock_profile_qhead *qhead, int32_t idx) diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 9bd5b4825d..c38b58d5fc 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -371,7 +371,7 @@ static void conring_puts(const char *str, size_t len) conringc =3D conringp - conring_size; } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS long read_console_ring(struct xen_sysctl_readconsole *op) { XEN_GUEST_HANDLE_PARAM(char) str; @@ -414,7 +414,7 @@ long read_console_ring(struct xen_sysctl_readconsole *o= p) =20 return 0; } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 =20 /* diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 221dc25f6f..cd2c801af6 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -194,7 +194,7 @@ kexec_op(unsigned long op, void *uarg) #ifdef CONFIG_IOREQ_SERVER dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_buf_t *bufs) #endif -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS sysctl(xen_sysctl_t *u_sysctl) #endif #if defined(CONFIG_X86) && defined(CONFIG_PAGING) @@ -277,7 +277,7 @@ physdev_op compat do hv= m hvm do_arm #ifdef CONFIG_HVM hvm_op do do do do do #endif -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS sysctl do do do do do #endif domctl do do do do do diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 9a23d2827c..3c960ad909 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -57,7 +57,7 @@ struct xsm_ops { int (*domain_create)(struct domain *d, uint32_t ssidref); int (*getdomaininfo)(struct domain *d); int (*domctl_scheduler_op)(struct domain *d, int op); -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS int (*sysctl_scheduler_op)(int op); #endif int (*set_target)(struct domain *d, struct domain *e); @@ -140,7 +140,7 @@ struct xsm_ops { int (*resource_setup_gsi)(int gsi); int (*resource_setup_misc)(void); =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS int (*page_offline)(uint32_t cmd); #endif int (*hypfs_op)(void); @@ -246,7 +246,7 @@ static inline int xsm_domctl_scheduler_op( return alternative_call(xsm_ops.domctl_scheduler_op, d, cmd); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static inline int xsm_sysctl_scheduler_op(xsm_default_t def, int cmd) { return alternative_call(xsm_ops.sysctl_scheduler_op, cmd); @@ -267,7 +267,7 @@ static inline int xsm_domctl(xsm_default_t def, struct = domain *d, =20 static inline int xsm_sysctl(xsm_default_t def, int cmd) { -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.sysctl, cmd); #else return -EOPNOTSUPP; @@ -276,7 +276,7 @@ static inline int xsm_sysctl(xsm_default_t def, int cmd) =20 static inline int xsm_readconsole(xsm_default_t def, uint32_t clear) { -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.readconsole, clear); #else return -EOPNOTSUPP; @@ -603,7 +603,7 @@ static inline int xsm_resource_setup_misc(xsm_default_t= def) =20 static inline int xsm_page_offline(xsm_default_t def, uint32_t cmd) { -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.page_offline, cmd); #else return -EOPNOTSUPP; diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 8b7e01b506..f5483e0709 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -19,12 +19,12 @@ static const struct xsm_ops __initconst_cf_clobber dumm= y_ops =3D { .domain_create =3D xsm_domain_create, .getdomaininfo =3D xsm_getdomaininfo, .domctl_scheduler_op =3D xsm_domctl_scheduler_op, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, #endif .set_target =3D xsm_set_target, .domctl =3D xsm_domctl, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D xsm_sysctl, .readconsole =3D xsm_readconsole, #endif @@ -98,7 +98,7 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .resource_setup_gsi =3D xsm_resource_setup_gsi, .resource_setup_misc =3D xsm_resource_setup_misc, =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .page_offline =3D xsm_page_offline, #endif .hypfs_op =3D xsm_hypfs_op, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index b0308e1b26..21914d3507 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -626,7 +626,7 @@ static int cf_check flask_domctl_scheduler_op(struct do= main *d, int op) } } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_sysctl_scheduler_op(int op) { switch ( op ) @@ -641,7 +641,7 @@ static int cf_check flask_sysctl_scheduler_op(int op) return avc_unknown_permission("sysctl_scheduler_op", op); } } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_set_target(struct domain *d, struct domain *t) { @@ -858,7 +858,7 @@ static int cf_check flask_domctl(struct domain *d, unsi= gned int cmd, } } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_sysctl(int cmd) { switch ( cmd ) @@ -946,7 +946,7 @@ static int cf_check flask_readconsole(uint32_t clear) =20 return domain_has_xen(current->domain, perms); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static inline uint32_t resource_to_perm(uint8_t access) { @@ -1208,12 +1208,12 @@ static int cf_check flask_resource_unplug_core(void) return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESO= URCE__UNPLUG, NULL); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static int flask_resource_use_core(void) { return avc_current_has_perm(SECINITSID_DOMXEN, SECCLASS_RESOURCE, RESO= URCE__USE, NULL); } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_resource_plug_pci(uint32_t machine_bdf) { @@ -1278,7 +1278,7 @@ static int cf_check flask_resource_setup_misc(void) return avc_current_has_perm(SECINITSID_XEN, SECCLASS_RESOURCE, RESOURC= E__SETUP, NULL); } =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS static inline int cf_check flask_page_offline(uint32_t cmd) { switch ( cmd ) @@ -1293,7 +1293,7 @@ static inline int cf_check flask_page_offline(uint32_= t cmd) return avc_unknown_permission("page_offline", cmd); } } -#endif /* CONFIG_SYSCTL */ +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static inline int cf_check flask_hypfs_op(void) { @@ -1889,12 +1889,12 @@ static const struct xsm_ops __initconst_cf_clobber = flask_ops =3D { .domain_create =3D flask_domain_create, .getdomaininfo =3D flask_getdomaininfo, .domctl_scheduler_op =3D flask_domctl_scheduler_op, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, #endif .set_target =3D flask_set_target, .domctl =3D flask_domctl, -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D flask_sysctl, .readconsole =3D flask_readconsole, #endif @@ -1956,7 +1956,7 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .resource_setup_gsi =3D flask_resource_setup_gsi, .resource_setup_misc =3D flask_resource_setup_misc, =20 -#ifdef CONFIG_SYSCTL +#ifdef CONFIG_MGMT_HYPERCALLS .page_offline =3D flask_page_offline, #endif .hypfs_op =3D flask_hypfs_op, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489984; cv=pass; d=zohomail.com; s=zohoarc; b=FG44bTFF0xXwCwSHpQx+l+P/GMwFqefZZvi6BzJu27JkXyDNEAZUSd6Gbtr8HmpiGgVhonde8iWmLWV/tCyZUDGBrgsMzR4xG9tEua5nzdqcVNHf+XKMtHQU07tarEqRRGmHX+pPhxEODnmxD5zlLhHozDlmz4A7SVKBEfGIxtU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489984; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=laR1vIy8iDHUWom8KybMGHOL/51jt2m++lMgJI0rWmk=; b=QU7O2ABeKI5eX8cUs5+m4EtNbbVFNQ4NQrPmP2BfL2/TGU2V9Cc6/A9yb/cbWxkdwtW93qioX1aIGyxcHlqm8V6/1R2SSVF3LYcVp2bk30Hoj/GbIVDTUI7ZaNm5nGwioTrVE1mYKay7CxhkHx8tPiRhOxGMF+NzVC/Zhp62os0= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757489984296698.1452010152742; Wed, 10 Sep 2025 00:39:44 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117581.1463671 (Exim 4.92) (envelope-from ) id 1uwFQO-0006lz-9E; Wed, 10 Sep 2025 07:39:28 +0000 Received: by outflank-mailman (output) from mailman id 1117581.1463671; Wed, 10 Sep 2025 07:39:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQO-0006kU-4u; Wed, 10 Sep 2025 07:39:28 +0000 Received: by outflank-mailman (input) for mailman id 1117581; Wed, 10 Sep 2025 07:39:26 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQM-0005yt-Pg for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:26 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on20602.outbound.protection.outlook.com [2a01:111:f403:200a::602]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4607fd1a-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:26 +0200 (CEST) Received: from BYAPR11CA0071.namprd11.prod.outlook.com (2603:10b6:a03:80::48) by CH3PR12MB7572.namprd12.prod.outlook.com (2603:10b6:610:144::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:20 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::74) by BYAPR11CA0071.outlook.office365.com (2603:10b6:a03:80::48) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:20 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:20 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:06 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4607fd1a-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Mjakr2j0FrYplPnrulqwzwuXuvkjlkBExnLjCcW4ccRE4Ql/L3oFKgBjeokP21Zqib8mTHfbfbWmlSpK9IRjAv8Dq+XfiyB8kkztBg7wGxD1cKfJQIlo3+ZbbHd0XlILD/PIyWsEIxOdKdKbgC3I0kVBv2apBwO5C52c2RRioU18BD8Q7vxHzUczyaSECOgvvF1XjusldkpSJBs6qrmAo0qa+PNu9mQ3kd3ogmLSCKxmq/HPzaqIVT6Wo6oTYz22Y9AYzkKxXClqFkJwAHgmcYP5D7IvMMRtkJkxfYtOWzsMBugtjlF6ZgaHQ2Wlu7hC28MAgCW2UVfbBI06Q3mUrA== 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=laR1vIy8iDHUWom8KybMGHOL/51jt2m++lMgJI0rWmk=; b=Flo1PdL1k0Zr8Re+0tukVLpCsWjdCUKek4UhJ+yVpX4JigoA0aNxBSNd0LZH33U0IOKFdEejix1QUxHPpp7h1pQuctgk17LzOO5wC7kUuHAbK8kbNjvkVu6PP2DF2zn/fNSnX8YuNYYUN+XJDg8+Z/fv6ncqzOL9eikOfBvC+Td6NYzKmAMaRTdiGqhIbCzbFj3Ki5HxpxXlSjljzaBrzvLE6ESwFpziF+0nOMtn4FoSwNpKBkTB2F4m8BcOVmKVnaRd1kMzA0KK+06TA3n5Czphf8zAyR0BZCdqs/jsQySxHLr8P8yoJjox/WWzJneIIUaqfr21VUL00ic9RLqFZQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=laR1vIy8iDHUWom8KybMGHOL/51jt2m++lMgJI0rWmk=; b=bW+yGkmDU+O44/PVx9RF5wfQueUWOIOjO0NHU6oF1QCvLu3aZlvOhBiAOVz4fkKoi639KImjZ/Ss4ZhnWw81ssaCCxg9wYopmpR9NPiUAQj1FBvxCtwGCgB5HeZf/depPEc08SeR2IB9xmTptwt5yh35cKZB+kkSJkAUUAoG35E= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 03/26] xen/x86: consolidate vram tracking support Date: Wed, 10 Sep 2025 15:38:04 +0800 Message-ID: <20250910073827.3622177-4-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|CH3PR12MB7572:EE_ X-MS-Office365-Filtering-Correlation-Id: ff49e5f5-b7b2-46d7-6364-08ddf03d277d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?24L5FvqOUUmcNC8p/i5aoWorGvWEoI2twO/8NTJci6MDVqgfnzN33kW1eqIA?= =?us-ascii?Q?efby8b1mQ1Rhm5rD4mf/u4Nm7DXPKSMdTm4UbEzaukS67+a0VpebhjStsLPA?= =?us-ascii?Q?N7VqVI8qrPsyRApSylJyx2zcQOxKQa2w7cQ88VKT+7UajKrqiYNqY7+OvTy7?= =?us-ascii?Q?+kCAMAH6HdEEq8TWXXcdBLyyP581G79rgm9YvCCa73TfY+c2B+mkwUFAhmtG?= =?us-ascii?Q?L98ure7P/aJAVqzdPYDhjCyq4Fk4kGWGbZTapFymPb/2iEaYpERgx4mRpjyY?= =?us-ascii?Q?QxufXPQYbVhNePjx3ELpzY7CvHZ2u0qzw9XhQ6v/pZWKEV3luswreUkpoFaf?= =?us-ascii?Q?Ic5zX9bdElt08Oe5kmKT1bgfy+2UXxo1BayBa524FlQq0SsA4g6akPwLdTC2?= =?us-ascii?Q?KLlLvRbYbGyPL+qsWChFp1lGOW009Xn/73Gq1sw8u3LSkhG+41z/Q4k0WbUx?= =?us-ascii?Q?EC6ItBT5VVJPNdJ4DK8WtZzlXmLBM/iXwhz+0kpFNrzvkYfKCgjvhDXw/wh1?= =?us-ascii?Q?QBhtNNq3dpoJFaUtmyDrUlZhPWkG2oHZTVBOkeZPG9hmF+i6teLGuHKJc/sP?= =?us-ascii?Q?fKX5YefpMJPEiXkV0WsF9KAW4iUT0fYyMOBzrQNdcsq8bnb/xaGZY9QOUd0B?= =?us-ascii?Q?DV208k4+KEHQuJ3McKCfQqil4sh3It9ovZbhQPeHy0iGE0m8KvTekujBH3Qx?= =?us-ascii?Q?RRueYCAVRqdtacua4eaMVRPsuL9oo02AiC05YQX3SVnwTo1w6rWTlqArOveA?= =?us-ascii?Q?PtDX+s4fcs+48Kbn0MP/6LTb5LQBzPe3PVxNXUSn4WhzgrYlp+k6QJdK7Aow?= =?us-ascii?Q?imw6+vy8mba7Zle9RKrfNEaYND5v9U8CLlvTqAr76mkyhOe8f7NIgAIYBFwf?= =?us-ascii?Q?leg/m7QPzHomfb/Hh/v+agyjYL2DEwxqfjbzH+gpku0982ZKSMOWYZNzPe2I?= =?us-ascii?Q?NixQFiUBW7fYRy6qZ+bZcCrwkqgbD24pinlO0d3P2nurR0aeyCbo7QYxSWCZ?= =?us-ascii?Q?hXS8bMHKJF0IXCm3gHpMTe9iGGboQWfidZQlBKFHmAXCaqft7aS4hpyAo2oB?= =?us-ascii?Q?YZEaWH6rkUwbAc2EzMbzClgT7/eU3mVMXnUrU3mBjzx/dYkuAxaEopbOaDUj?= =?us-ascii?Q?S+n2wDgXOD7AvNa2DqSxVL+aN5W8LCxWlfLnps2R33TgCb07mY0aLlr4Kj//?= =?us-ascii?Q?+CPVGO5NBqyfUmmH6JTUIczlnO7yv1qeUqAl4lkDQbGeKglGfyBPTdEKhUVJ?= =?us-ascii?Q?JJsZhwnjwvJsyY6TMnG/bwbq5fc/jGQcBq1wGadPx5x9WtAElEL+bSNNiJFP?= =?us-ascii?Q?++riAV1bKIfRTZDusJbaNuAzlVILmEOoKEAO8qtt2qQfNmJ1TwoFICkMW55Z?= =?us-ascii?Q?hh7OOtON9wxVxQ8bBYaYbfajGRvlh40+NUFpZKIGMaRMjPjW/H9c8gV3R0mJ?= =?us-ascii?Q?VPJZ9XYEE0tKqrYzrVzMMAG/CdkWBDy7mqiwDvTqmBmGbDOGzAtM8w3jY+wV?= =?us-ascii?Q?MOu/KJXBYKQiHIXrIP8WxyLoDQXvqDiQGSS6?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:20.2003 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff49e5f5-b7b2-46d7-6364-08ddf03d277d 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7572 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757489986014116600 Content-Type: text/plain; charset="utf-8" Flag PG_log_dirty is for paging log dirty support, not vram tracking suppor= t. However data structure sh_dirty_vram{} and function paging_log_dirty_range() designed for vram tracking support, are guarded with PG_log_dirty. We release both from PG_log_dirty, and also move paging_log_dirty_range(), remamed with p2m_log_dirty_range(), into p2m.c, where it logically belongs. Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- v1 -> v2: - rename paging_log_dirty_range() into p2m_log_dirty_range(), and move it to p2m.c, where it logically belongs - remove #ifdef / #endif - change int to unsigned int --- xen/arch/x86/include/asm/p2m.h | 4 ++++ xen/arch/x86/include/asm/paging.h | 32 +++++++++++++------------------ xen/arch/x86/mm/hap/hap.c | 4 ++-- xen/arch/x86/mm/p2m.c | 28 +++++++++++++++++++++++++++ xen/arch/x86/mm/paging.c | 32 ------------------------------- 5 files changed, 47 insertions(+), 53 deletions(-) diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h index 3b860e30c3..1856cc396c 100644 --- a/xen/arch/x86/include/asm/p2m.h +++ b/xen/arch/x86/include/asm/p2m.h @@ -1110,6 +1110,10 @@ static inline int p2m_entry_modify(struct p2m_domain= *p2m, p2m_type_t nt, =20 #endif /* CONFIG_HVM */ =20 +/* get the dirty bitmap for a specific range of pfns */ +void p2m_log_dirty_range(struct domain *d, unsigned long begin_pfn, + unsigned long nr, uint8_t *dirty_bitmap); + #endif /* _XEN_ASM_X86_P2M_H */ =20 /* diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/p= aging.h index 768b077ebd..1b0694bb36 100644 --- a/xen/arch/x86/include/asm/paging.h +++ b/xen/arch/x86/include/asm/paging.h @@ -133,13 +133,20 @@ struct paging_mode { (DIV_ROUND_UP(PADDR_BITS - PAGE_SHIFT - (PAGE_SHIFT + 3), \ PAGE_SHIFT - ilog2(sizeof(mfn_t))) + 1) =20 -#if PG_log_dirty +#ifdef CONFIG_HVM +/* VRAM dirty tracking support */ +struct sh_dirty_vram { + unsigned long begin_pfn; + unsigned long end_pfn; +#ifdef CONFIG_SHADOW_PAGING + paddr_t *sl1ma; + uint8_t *dirty_bitmap; + s_time_t last_dirty; +#endif +}; +#endif =20 -/* get the dirty bitmap for a specific range of pfns */ -void paging_log_dirty_range(struct domain *d, - unsigned long begin_pfn, - unsigned long nr, - uint8_t *dirty_bitmap); +#if PG_log_dirty =20 /* log dirty initialization */ void paging_log_dirty_init(struct domain *d, const struct log_dirty_ops *o= ps); @@ -171,19 +178,6 @@ bool paging_mfn_is_dirty(const struct domain *d, mfn_t= gmfn); #define L4_LOGDIRTY_IDX(pfn) ((pfn_x(pfn) >> (PAGE_SHIFT + 3 + PAGETABLE_O= RDER * 2)) & \ (LOGDIRTY_NODE_ENTRIES-1)) =20 -#ifdef CONFIG_HVM -/* VRAM dirty tracking support */ -struct sh_dirty_vram { - unsigned long begin_pfn; - unsigned long end_pfn; -#ifdef CONFIG_SHADOW_PAGING - paddr_t *sl1ma; - uint8_t *dirty_bitmap; - s_time_t last_dirty; -#endif -}; -#endif - #else /* !PG_log_dirty */ =20 static inline void paging_log_dirty_init(struct domain *d, diff --git a/xen/arch/x86/mm/hap/hap.c b/xen/arch/x86/mm/hap/hap.c index 4aec98109d..2f69ff9c7b 100644 --- a/xen/arch/x86/mm/hap/hap.c +++ b/xen/arch/x86/mm/hap/hap.c @@ -42,7 +42,7 @@ * Create a dirty vram range on demand when some [begin_pfn:begin_pfn+nr] = is * first encountered. * Collect the guest_dirty bitmask, a bit mask of the dirty vram pages, by - * calling paging_log_dirty_range(), which interrogates each vram + * calling p2m_log_dirty_range(), which interrogates each vram * page's p2m type looking for pages that have been made writable. */ =20 @@ -119,7 +119,7 @@ int hap_track_dirty_vram(struct domain *d, p2m_flush_hardware_cached_dirty(d); =20 /* get the bitmap */ - paging_log_dirty_range(d, begin_pfn, nr_frames, dirty_bitmap); + p2m_log_dirty_range(d, begin_pfn, nr_frames, dirty_bitmap); =20 domain_unpause(d); } diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index e802f2e4e6..e2a00a0efd 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2161,6 +2161,34 @@ int relinquish_p2m_mapping(struct domain *d) return rc; } =20 +void p2m_log_dirty_range(struct domain *d, unsigned long begin_pfn, + unsigned long nr, uint8_t *dirty_bitmap) +{ + struct p2m_domain *p2m =3D p2m_get_hostp2m(d); + unsigned int i; + unsigned long pfn; + + /* + * Set l1e entries of P2M table to be read-only. + * + * On first write, it page faults, its entry is changed to read-write, + * and on retry the write succeeds. + * + * We populate dirty_bitmap by looking for entries that have been + * switched to read-write. + */ + + p2m_lock(p2m); + + for ( i =3D 0, pfn =3D begin_pfn; pfn < begin_pfn + nr; i++, pfn++ ) + if ( !p2m_change_type_one(d, pfn, p2m_ram_rw, p2m_ram_logdirty) ) + dirty_bitmap[i >> 3] |=3D (1 << (i & 7)); + + p2m_unlock(p2m); + + guest_flush_tlb_mask(d, d->dirty_cpumask); +} + /* * Local variables: * mode: C diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 3aafb0990b..65455a6867 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -583,38 +583,6 @@ static int paging_log_dirty_op(struct domain *d, return rv; } =20 -#ifdef CONFIG_HVM -void paging_log_dirty_range(struct domain *d, - unsigned long begin_pfn, - unsigned long nr, - uint8_t *dirty_bitmap) -{ - struct p2m_domain *p2m =3D p2m_get_hostp2m(d); - int i; - unsigned long pfn; - - /* - * Set l1e entries of P2M table to be read-only. - * - * On first write, it page faults, its entry is changed to read-write, - * and on retry the write succeeds. - * - * We populate dirty_bitmap by looking for entries that have been - * switched to read-write. - */ - - p2m_lock(p2m); - - for ( i =3D 0, pfn =3D begin_pfn; pfn < begin_pfn + nr; i++, pfn++ ) - if ( !p2m_change_type_one(d, pfn, p2m_ram_rw, p2m_ram_logdirty) ) - dirty_bitmap[i >> 3] |=3D (1 << (i & 7)); - - p2m_unlock(p2m); - - guest_flush_tlb_mask(d, d->dirty_cpumask); -} -#endif - /* * Callers must supply log_dirty_ops for the log dirty code to call. This * function usually is invoked when paging is enabled. Check shadow_enable= () --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490004; cv=pass; d=zohomail.com; s=zohoarc; b=NkZG5qDC4jsB+sc/fTB4gjkL20grrdoMtecrVmrtysGn7U+YACT6d4/8UlWmg7pFBtP2+SVcJV7vUYKKoEPES5qAy9Oo1xFhVCUSXJObzZs8mD6Mxq5ZArJEClml8XuwCk7x6F31lxkhiuqWVltiZ4oNonC56NNEf530OcF188I= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490004; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1SvkVjnTmPEwi4ioI5p5ke75eXA6MP3pWxYaqdIpCbw=; b=EivNV1v2XrzYyNMIQomJEed9y+/TyYyASeYwO2jIICUFVPVJoO5mQeg2bxLkSmCOwfNVh6NSdoq1YJC9b5HLDNwy2AboiCKp0CCwoBUOove/AELUOgh10GqabiJy49tJ1xXOhOTKPtVpMO+lnW7rIo16aX3adY37GMzOJToQOas= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490004700759.5064494172935; Wed, 10 Sep 2025 00:40:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117588.1463696 (Exim 4.92) (envelope-from ) id 1uwFQX-0007b4-Tc; Wed, 10 Sep 2025 07:39:37 +0000 Received: by outflank-mailman (output) from mailman id 1117588.1463696; Wed, 10 Sep 2025 07:39:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQX-0007av-Oh; Wed, 10 Sep 2025 07:39:37 +0000 Received: by outflank-mailman (input) for mailman id 1117588; Wed, 10 Sep 2025 07:39:36 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQV-0005yo-Te for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:36 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20611.outbound.protection.outlook.com [2a01:111:f403:2413::611]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4ab49d7e-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:33 +0200 (CEST) Received: from BYAPR11CA0037.namprd11.prod.outlook.com (2603:10b6:a03:80::14) by MN2PR12MB4334.namprd12.prod.outlook.com (2603:10b6:208:1d1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:26 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::1b) by BYAPR11CA0037.outlook.office365.com (2603:10b6:a03:80::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Wed, 10 Sep 2025 07:39:25 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:25 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:08 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4ab49d7e-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mwst07hOzSoOjY8LqjmHZsMCrhlPKwOYHMjxyg6D3g9+HnnFPK2GLFpCOfFYY1AkzZqmkLmn/WIlOhcWihAHEtjdNtiqUzrRs7it+YGK1gq9Du10FPFiU4FXc5I61Qu0tvee9Bua+5b+0CwRaapcN+t8PY+LXYcwe+LlttSpKfh45e6L2Zc+lOyvel41bLxUPEoMdOGwTS2anvt9KWK6Gfkbdym6MLerw+eDBULmY8Vpg0+Ih7nZ+LVM+aiWhIAs/7IBv+8S45EapsRYwE2tHWXs5sUst9HlwjP6LRmYETsGrG8ASH/0jsltyIXOU4Z8krMkCdOsZB14pxthOq/Uyw== 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=1SvkVjnTmPEwi4ioI5p5ke75eXA6MP3pWxYaqdIpCbw=; b=SXda7LQZUJWxv2MVgyvrjDp0RPSOiNm/aDnyJqJcB9CFF49qCltL9MkLcUNr9wfq6L6cduqDJBEYfV7UAa0RMvUww/qlZRdwN6WsrvRTGqU5yHYExqjkFmNjZ/EwtJNKLbIDdDWCZ29T2PfoL6LIA4wTZCCR0onyd0RZAZ4oN8Kj4IM7mN2cv7/SorFq8tMXx3u8lhdqI5oqynfmzQ3Rn3CtUGS4RWGn8no1Y4E+nKbssZ+yhIIaXNnb9JaR1uVw2q1UNG6Hxt6iCpjT4yAohNn9+Ed6Fer8q0L0EKbhnDIJ6XAGRqK57FNqg7DmcGHurSoXTV0hhozOJrKH7l+8pQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=1SvkVjnTmPEwi4ioI5p5ke75eXA6MP3pWxYaqdIpCbw=; b=Hv6vHBQt8ZxKXzqMYC58SlC8nwsqfWekVozkqlJVoI/xdy7KMeXFAFyVNUPtojluFtpJ4MuzWNTX67K8/xG8BmzqnKz5BUdSgenxlgfvIZTfUxQRFbPlyrxP6/Jw8Pes2cOY70YDyJvj2VKw2eNAlfWOEF7lyMGjKzhdYqkvG/U= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Tamas K Lengyel , Alexandru Isaila , "Petre Pircalabu" , "Daniel P. Smith" Subject: [PATCH v2 04/26] xen: consolidate CONFIG_VM_EVENT Date: Wed, 10 Sep 2025 15:38:05 +0800 Message-ID: <20250910073827.3622177-5-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|MN2PR12MB4334:EE_ X-MS-Office365-Filtering-Correlation-Id: d1601738-a023-4573-46d1-08ddf03d2acc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?QQ2HpMtvMBYBUaLk/jQa7TPxm4KLaUJcFoe8X+B0Uz0Bo5JZYYC5JMbg9MyL?= =?us-ascii?Q?/0hqNQryUt3lYyoyE+YcPZVmWlyMdbd6AVqwFxAhxcU2Bar17MfDDvGnr1UO?= =?us-ascii?Q?/exBwL1OtAxgkAw9tzMpiyYNaiqFMx+ZxOIkaN1hnIl3V9lFjybJKTs6Cepl?= =?us-ascii?Q?T2cGhUIy0VxJOLvfGUPxuudnGOkr9NhqbMnH9OiakmQDWubxI0sS1p1qwQ3V?= =?us-ascii?Q?RU8QwL2g5EqdteXumchsBkWTC8zh1dc1stBKSGsgghSgZBrs5sHxuHXrOYVj?= =?us-ascii?Q?LLHDJw8P+uvFA8MvJXw+HcGYIGOa4LvURxciJRJHhAKnR+X+l2Uuqoz0KeFv?= =?us-ascii?Q?dkxE8WVEFkdePLOHOTz5lQazbKX7m5eLMDd4cQFr3FDqVFZL9b49HOtBakMv?= =?us-ascii?Q?EMEDp1dJb7GT3B6kAgXgTJW9KKV+dplnQPXlYcuG0SV34r2h8eaSjcKZF29+?= =?us-ascii?Q?nP+OJXoZOLMJmUw+iFB/DoN5Mae7csTB5FUHDlYNJ5OcPzzV/3HiFE8XJXKI?= =?us-ascii?Q?ju+gGGXR92o2LTUpoF9c5mvgD1VOYgpogDgBpRX84aQOzp7lxDP0nlHK/fwf?= =?us-ascii?Q?iJBf9HML6sxOfFFv434SX9Ymik+M+9/eQ2JJZLBkUXXnDRlHjrtKOhG+kH2P?= =?us-ascii?Q?uVSRKKGqJeEO29LKUAnIiqxWF1FC2yMJeYPFU8x/+rmW9/SODi0ELcwqubit?= =?us-ascii?Q?K239oAy4FjSSz65oWeeGuReEBYWQRYKdPHMWf1zxk551OsfuYYbPzlpNx3iW?= =?us-ascii?Q?fq7DAmw7mFhLcQ2YbGKM2s/3uw1N0Fm2/fNCC9oOdF5G25Rz4Sil5YUCjXr7?= =?us-ascii?Q?PTIml2xv9JWTUpAHQ0zOvpEOk2QOn2V+Lwb2cg3aXjN+z/mlRdZ7ue8G+CER?= =?us-ascii?Q?qpdOaj5CATWLin+RvnBuTJXePrlGc4JQLvJmkJVW0n1+JSQZNcQ7ODjWyRLm?= =?us-ascii?Q?05TGnGJIaNI2JOpGKrzWVZWmztSMd4H1Ul+HHV7Jlki8HFtOLNJpomtkvwS5?= =?us-ascii?Q?xvYrRg/13YTE/wRiAyZjP2vTXRppVsNOMZKpF43G6xx1v405uCZUQNv9QxjE?= =?us-ascii?Q?Jntr+l3mGJXD7LvT9wx7W/I/+7pg0hgutF0f3Cde8+9QG/r9ZcnuMuBYEfH6?= =?us-ascii?Q?9W9yQa7LwpzzQVAyzh4Ye25ENZkStyogf3ile9I7pmjkj1BXw55RhNJwstiG?= =?us-ascii?Q?3I/mpUsdwF2hd0s3Nlmy5ZU36fnrhjxHwgzydvF4lCag2ue2FKE581AAYV7p?= =?us-ascii?Q?k/t/ZVJx3WGkjrTJ3O8I8m6YVHEgZQp6qrFInSEt+sGA1ufhKRCvkYcIb6wO?= =?us-ascii?Q?ngscSstSOsZIkzs4uUEuWqMbgh+299mSSEoeilvKoe0iqBF6yNohvW7ZLIEz?= =?us-ascii?Q?PkrODbOrPyAhIobun1LaPxJf5d1o+tP62b2yJwiw28Vl8zT/EHGZDMMRA68g?= =?us-ascii?Q?hJy61gNTwiUJAFTFEtqJp5U26/5ohwmD5GlJEKfMDtIzyN7eubBJECVo6cfn?= =?us-ascii?Q?/btXSTYnANXrvSgY8/2zM9IoK6sZhM1s4ilj?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:25.7498 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d1601738-a023-4573-46d1-08ddf03d2acc 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4334 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490007690124100 Content-Type: text/plain; charset="utf-8" File hvm/vm_event.c and x86/vm_event.c are the extend to vm_event handling routines, and its compilation shall be guarded by CONFIG_VM_EVENT too. Futhermore, features about monitor_op and memory access are both based on vm event subsystem, so monitor.o/mem_access.o shall be wrapped under CONFIG_VM_EVENT. Although CONFIG_VM_EVENT is forcibly enabled on x86, we could disable it through disabling CONFIG_MGMT_HYPERCALLS in the future. In consequence, a few functions, like the ones defined in hvm/monitor.h, needs stub to pass compilation when CONFIG_VM_EVENT=3Dn. Remove the CONFIG_VM_EVENT wrapper for "#include ", as we need stub of "p2m_mem_access_check()" to pass compilation on CONFIG_VM_EVENT=3Dn The following functions are developed on the basis of vm event framework, or only invoked by vm_event.c/monitor.c/mem_access.c, so they all shall be wrapped with CONFIG_VM_EVENT: - hvm_toggle_singlestep - hvm_fast_singlestep - hvm_enable_msr_interception - hvm_function_table.enable_msr_interception - hvm_has_set_descriptor_access_existing - hvm_function_table.set_descriptor_access_existing Signed-off-by: Penny Zheng --- v1 -> v2: - split out XSM changes - remove unnecessary stubs - move "struct p2m_domain" declaration ahead of the #ifdef --- xen/arch/x86/Makefile | 2 +- xen/arch/x86/hvm/Makefile | 4 +- xen/arch/x86/hvm/hvm.c | 2 + xen/arch/x86/hvm/svm/svm.c | 8 +++ xen/arch/x86/hvm/vmx/vmx.c | 10 ++++ xen/arch/x86/include/asm/hvm/hvm.h | 10 ++++ xen/arch/x86/include/asm/hvm/monitor.h | 65 ++++++++++++++++++++++++- xen/arch/x86/include/asm/hvm/vm_event.h | 4 ++ xen/arch/x86/include/asm/mem_access.h | 9 ++++ xen/arch/x86/include/asm/monitor.h | 7 +++ xen/include/xen/mem_access.h | 35 +++++++++++-- xen/include/xen/monitor.h | 8 ++- xen/include/xen/vm_event.h | 24 ++++++++- 13 files changed, 176 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index a9fdba0b4c..a7bfe4c0b1 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -76,7 +76,7 @@ obj-y +=3D usercopy.o obj-y +=3D x86_emulate.o obj-$(CONFIG_TBOOT) +=3D tboot.o obj-y +=3D hpet.o -obj-y +=3D vm_event.o +obj-$(CONFIG_VM_EVENT) +=3D vm_event.o obj-y +=3D xstate.o =20 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y) diff --git a/xen/arch/x86/hvm/Makefile b/xen/arch/x86/hvm/Makefile index 6ec2c8f2db..952db00dd7 100644 --- a/xen/arch/x86/hvm/Makefile +++ b/xen/arch/x86/hvm/Makefile @@ -16,7 +16,7 @@ obj-y +=3D io.o obj-y +=3D ioreq.o obj-y +=3D irq.o obj-y +=3D mmio.o -obj-y +=3D monitor.o +obj-$(CONFIG_VM_EVENT) +=3D monitor.o obj-y +=3D mtrr.o obj-y +=3D nestedhvm.o obj-y +=3D pmtimer.o @@ -26,7 +26,7 @@ obj-y +=3D save.o obj-y +=3D stdvga.o obj-y +=3D vioapic.o obj-y +=3D vlapic.o -obj-y +=3D vm_event.o +obj-$(CONFIG_VM_EVENT) +=3D vm_event.o obj-y +=3D vmsi.o obj-y +=3D vpic.o obj-y +=3D vpt.o diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index 23bd7f078a..b044dc2ecb 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5266,6 +5266,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op) return rc; } =20 +#ifdef CONFIG_VM_EVENT void hvm_toggle_singlestep(struct vcpu *v) { ASSERT(atomic_read(&v->pause_count)); @@ -5275,6 +5276,7 @@ void hvm_toggle_singlestep(struct vcpu *v) =20 v->arch.hvm.single_step =3D !v->arch.hvm.single_step; } +#endif /* CONFIG_VM_EVENT */ =20 #ifdef CONFIG_ALTP2M void hvm_fast_singlestep(struct vcpu *v, uint16_t p2midx) diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index b54f9d9af5..b726d760d4 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -298,6 +298,7 @@ void svm_intercept_msr(struct vcpu *v, uint32_t msr, in= t flags) __clear_bit(msr * 2 + 1, msr_bit); } =20 +#ifdef CONFIG_VM_EVENT static void cf_check svm_enable_msr_interception(struct domain *d, uint32_= t msr) { struct vcpu *v; @@ -305,6 +306,7 @@ static void cf_check svm_enable_msr_interception(struct= domain *d, uint32_t msr) for_each_vcpu ( d, v ) svm_intercept_msr(v, msr, MSR_INTERCEPT_WRITE); } +#endif /* CONFIG_VM_EVENT */ =20 static void svm_save_dr(struct vcpu *v) { @@ -825,6 +827,7 @@ static void cf_check svm_set_rdtsc_exiting(struct vcpu = *v, bool enable) vmcb_set_general2_intercepts(vmcb, general2_intercepts); } =20 +#ifdef CONFIG_VM_EVENT static void cf_check svm_set_descriptor_access_exiting( struct vcpu *v, bool enable) { @@ -842,6 +845,7 @@ static void cf_check svm_set_descriptor_access_exiting( =20 vmcb_set_general1_intercepts(vmcb, general1_intercepts); } +#endif /* CONFIG_VM_EVENT */ =20 static unsigned int cf_check svm_get_insn_bytes(struct vcpu *v, uint8_t *b= uf) { @@ -2456,9 +2460,13 @@ static struct hvm_function_table __initdata_cf_clobb= er svm_function_table =3D { .fpu_dirty_intercept =3D svm_fpu_dirty_intercept, .msr_read_intercept =3D svm_msr_read_intercept, .msr_write_intercept =3D svm_msr_write_intercept, +#ifdef CONFIG_VM_EVENT .enable_msr_interception =3D svm_enable_msr_interception, +#endif .set_rdtsc_exiting =3D svm_set_rdtsc_exiting, +#ifdef CONFIG_VM_EVENT .set_descriptor_access_exiting =3D svm_set_descriptor_access_exiting, +#endif .get_insn_bytes =3D svm_get_insn_bytes, =20 .nhvm_vcpu_initialise =3D nsvm_vcpu_initialise, diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index e2b5077654..4cf5da70ad 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -1519,6 +1519,7 @@ static void cf_check vmx_set_rdtsc_exiting(struct vcp= u *v, bool enable) vmx_vmcs_exit(v); } =20 +#ifdef CONFIG_VM_EVENT static void cf_check vmx_set_descriptor_access_exiting( struct vcpu *v, bool enable) { @@ -1533,6 +1534,7 @@ static void cf_check vmx_set_descriptor_access_exitin= g( vmx_update_secondary_exec_control(v); vmx_vmcs_exit(v); } +#endif /* CONFIG_VM_EVENT */ =20 static void cf_check vmx_init_hypercall_page(void *p) { @@ -2412,6 +2414,7 @@ static void cf_check vmx_handle_eoi(uint8_t vector, i= nt isr) printk_once(XENLOG_WARNING "EOI for %02x but SVI=3D%02x\n", vector= , old_svi); } =20 +#ifdef CONFIG_VM_EVENT static void cf_check vmx_enable_msr_interception(struct domain *d, uint32_= t msr) { struct vcpu *v; @@ -2419,6 +2422,7 @@ static void cf_check vmx_enable_msr_interception(stru= ct domain *d, uint32_t msr) for_each_vcpu ( d, v ) vmx_set_msr_intercept(v, msr, VMX_MSR_W); } +#endif /* CONFIG_VM_EVENT */ =20 #ifdef CONFIG_ALTP2M =20 @@ -2870,7 +2874,9 @@ static struct hvm_function_table __initdata_cf_clobbe= r vmx_function_table =3D { .nhvm_domain_relinquish_resources =3D nvmx_domain_relinquish_resources, .update_vlapic_mode =3D vmx_vlapic_msr_changed, .nhvm_hap_walk_L1_p2m =3D nvmx_hap_walk_L1_p2m, +#ifdef CONFIG_VM_EVENT .enable_msr_interception =3D vmx_enable_msr_interception, +#endif #ifdef CONFIG_ALTP2M .altp2m_vcpu_update_p2m =3D vmx_vcpu_update_eptp, .altp2m_vcpu_update_vmfunc_ve =3D vmx_vcpu_update_vmfunc_ve, @@ -3078,9 +3084,11 @@ const struct hvm_function_table * __init start_vmx(v= oid) =20 vmx_function_table.caps.singlestep =3D cpu_has_monitor_trap_flag; =20 +#ifdef CONFIG_VM_EVENT if ( cpu_has_vmx_dt_exiting ) vmx_function_table.set_descriptor_access_exiting =3D vmx_set_descriptor_access_exiting; +#endif =20 /* * Do not enable EPT when (!cpu_has_vmx_pat), to prevent security hole @@ -3151,8 +3159,10 @@ void __init vmx_fill_funcs(void) if ( !cpu_has_xen_ibt ) return; =20 +#ifdef CONFIG_VM_EVENT vmx_function_table.set_descriptor_access_exiting =3D vmx_set_descriptor_access_exiting; +#endif =20 vmx_function_table.update_eoi_exit_bitmap =3D vmx_update_eoi_exit_bitm= ap; vmx_function_table.process_isr =3D vmx_process_isr; diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/= hvm/hvm.h index f02183691e..b2c75b733e 100644 --- a/xen/arch/x86/include/asm/hvm/hvm.h +++ b/xen/arch/x86/include/asm/hvm/hvm.h @@ -192,7 +192,9 @@ struct hvm_function_table { void (*handle_cd)(struct vcpu *v, unsigned long value); void (*set_info_guest)(struct vcpu *v); void (*set_rdtsc_exiting)(struct vcpu *v, bool enable); +#ifdef CONFIG_VM_EVENT void (*set_descriptor_access_exiting)(struct vcpu *v, bool enable); +#endif =20 /* Nested HVM */ int (*nhvm_vcpu_initialise)(struct vcpu *v); @@ -224,7 +226,9 @@ struct hvm_function_table { paddr_t *L1_gpa, unsigned int *page_order, uint8_t *p2m_acc, struct npfec npfec); =20 +#ifdef CONFIG_VM_EVENT void (*enable_msr_interception)(struct domain *d, uint32_t msr); +#endif =20 #ifdef CONFIG_ALTP2M /* Alternate p2m */ @@ -435,7 +439,11 @@ static inline bool using_svm(void) =20 static inline bool hvm_has_set_descriptor_access_exiting(void) { +#ifdef CONFIG_VM_EVENT return hvm_funcs.set_descriptor_access_exiting; +#else + return false; +#endif } =20 static inline void hvm_domain_creation_finished(struct domain *d) @@ -681,7 +689,9 @@ static inline int nhvm_hap_walk_L1_p2m( =20 static inline void hvm_enable_msr_interception(struct domain *d, uint32_t = msr) { +#ifdef CONFIG_VM_EVENT alternative_vcall(hvm_funcs.enable_msr_interception, d, msr); +#endif } =20 static inline bool hvm_is_singlestep_supported(void) diff --git a/xen/arch/x86/include/asm/hvm/monitor.h b/xen/arch/x86/include/= asm/hvm/monitor.h index 02021be47b..561ca2e585 100644 --- a/xen/arch/x86/include/asm/hvm/monitor.h +++ b/xen/arch/x86/include/asm/hvm/monitor.h @@ -17,14 +17,16 @@ enum hvm_monitor_debug_type HVM_MONITOR_DEBUG_EXCEPTION, }; =20 +#define hvm_monitor_crX(cr, new, old) \ + hvm_monitor_cr(VM_EVENT_X86_##cr, new, old) + +#ifdef CONFIG_VM_EVENT /* * Called for current VCPU on crX/MSR changes by guest. Bool return signals * whether emulation should be postponed. */ bool hvm_monitor_cr(unsigned int index, unsigned long value, unsigned long old); -#define hvm_monitor_crX(cr, new, old) \ - hvm_monitor_cr(VM_EVENT_X86_##cr, new, old) bool hvm_monitor_msr(unsigned int msr, uint64_t new_value, uint64_t old_va= lue); void hvm_monitor_descriptor_access(uint64_t exit_info, uint64_t vmx_exit_qualification, @@ -45,6 +47,65 @@ int hvm_monitor_vmexit(unsigned long exit_reason, =20 int hvm_monitor_io(unsigned int port, unsigned int bytes, bool in, bool str); +#else +static inline bool hvm_monitor_cr(unsigned int index, unsigned long value, + unsigned long old) +{ + return false; +} + +static inline bool hvm_monitor_msr(unsigned int msr, uint64_t new_value, + uint64_t old_value) +{ + return false; +} + +static inline void hvm_monitor_descriptor_access(uint64_t exit_info, + uint64_t vmx_exit_qualification, + uint8_t descriptor, bool is_write)= {} + +static inline int hvm_monitor_debug(unsigned long rip, + enum hvm_monitor_debug_type type, + unsigned int trap_type, + unsigned int insn_length, + unsigned int pending_dbg) +{ + return -EOPNOTSUPP; +} + +static inline int hvm_monitor_cpuid(unsigned long insn_length, + unsigned int leaf, unsigned int sublea= f) +{ + return -EOPNOTSUPP; +} + +static inline void hvm_monitor_interrupt(unsigned int vector, + unsigned int type, + unsigned int err, uint64_t cr2) {} + +static inline bool hvm_monitor_emul_unimplemented(void) +{ + return false; +} + +static inline bool hvm_monitor_check_p2m(unsigned long gla, gfn_t gfn, + uint32_t pfec, uint16_t kind) +{ + return false; +} + +static inline int hvm_monitor_vmexit(unsigned long exit_reason, + unsigned long exit_qualification) +{ + return -EOPNOTSUPP; +} + +static inline int hvm_monitor_io(unsigned int port, unsigned int bytes, + bool in, bool str) +{ + return -EOPNOTSUPP; +} +#endif /* CONFIG_VM_EVENT */ =20 #endif /* __ASM_X86_HVM_MONITOR_H__ */ =20 diff --git a/xen/arch/x86/include/asm/hvm/vm_event.h b/xen/arch/x86/include= /asm/hvm/vm_event.h index 506a85c774..1628230182 100644 --- a/xen/arch/x86/include/asm/hvm/vm_event.h +++ b/xen/arch/x86/include/asm/hvm/vm_event.h @@ -8,7 +8,11 @@ #ifndef __ASM_X86_HVM_VM_EVENT_H__ #define __ASM_X86_HVM_VM_EVENT_H__ =20 +#ifdef CONFIG_VM_EVENT void hvm_vm_event_do_resume(struct vcpu *v); +#else +static inline void hvm_vm_event_do_resume(struct vcpu *v) {} +#endif /* CONFIG_VM_EVENT */ =20 #endif /* __ASM_X86_HVM_VM_EVENT_H__ */ =20 diff --git a/xen/arch/x86/include/asm/mem_access.h b/xen/arch/x86/include/a= sm/mem_access.h index 1a52a10322..c786116310 100644 --- a/xen/arch/x86/include/asm/mem_access.h +++ b/xen/arch/x86/include/asm/mem_access.h @@ -14,6 +14,7 @@ #ifndef __ASM_X86_MEM_ACCESS_H__ #define __ASM_X86_MEM_ACCESS_H__ =20 +#ifdef CONFIG_VM_EVENT /* * Setup vm_event request based on the access (gla is -1ull if not availab= le). * Handles the rw2rx conversion. Boolean return value indicates if event t= ype @@ -25,6 +26,14 @@ bool p2m_mem_access_check(paddr_t gpa, unsigned long gla, struct npfec npfec, struct vm_event_st **req_ptr); +#else +static inline bool p2m_mem_access_check(paddr_t gpa, unsigned long gla, + struct npfec npfec, + struct vm_event_st **req_ptr) +{ + return false; +} +#endif /* CONFIG_VM_EVENT */ =20 /* Check for emulation and mark vcpu for skipping one instruction * upon rescheduling if required. */ diff --git a/xen/arch/x86/include/asm/monitor.h b/xen/arch/x86/include/asm/= monitor.h index 3c64d8258f..850c0798d7 100644 --- a/xen/arch/x86/include/asm/monitor.h +++ b/xen/arch/x86/include/asm/monitor.h @@ -123,7 +123,14 @@ static inline void arch_monitor_cleanup_domain(struct = domain *d) {} =20 #endif =20 +#ifdef CONFIG_VM_EVENT bool monitored_msr(const struct domain *d, u32 msr); +#else +static inline bool monitored_msr(const struct domain *d, u32 msr) +{ + return false; +} +#endif bool monitored_msr_onchangeonly(const struct domain *d, u32 msr); =20 #endif /* __ASM_X86_MONITOR_H__ */ diff --git a/xen/include/xen/mem_access.h b/xen/include/xen/mem_access.h index 4de651038d..efbb26b703 100644 --- a/xen/include/xen/mem_access.h +++ b/xen/include/xen/mem_access.h @@ -33,9 +33,7 @@ */ struct vm_event_st; =20 -#ifdef CONFIG_VM_EVENT #include -#endif =20 /* * Additional access types, which are used to further restrict @@ -74,6 +72,7 @@ typedef enum { } p2m_access_t; =20 struct p2m_domain; +#ifdef CONFIG_VM_EVENT bool xenmem_access_to_p2m_access(const struct p2m_domain *p2m, xenmem_access_t xaccess, p2m_access_t *paccess); @@ -99,10 +98,40 @@ long p2m_set_mem_access_multi(struct domain *d, int p2m_get_mem_access(struct domain *d, gfn_t gfn, xenmem_access_t *acces= s, unsigned int altp2m_idx); =20 -#ifdef CONFIG_VM_EVENT int mem_access_memop(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(xen_mem_access_op_t) arg); #else +static inline bool xenmem_access_to_p2m_access(const struct p2m_domain *p2= m, + xenmem_access_t xaccess, + p2m_access_t *paccess) +{ + return false; +} + +static inline long p2m_set_mem_access(struct domain *d, gfn_t gfn, uint32_= t nr, + uint32_t start, uint32_t mask, + xenmem_access_t access, + unsigned int altp2m_idx) +{ + return -EOPNOTSUPP; +} + +static inline long p2m_set_mem_access_multi(struct domain *d, + const XEN_GUEST_HANDLE(const_uint64) pfn_list, + const XEN_GUEST_HANDLE(const_uint8) access_lis= t, + uint32_t nr, uint32_t start, uint32_t mask, + unsigned int altp2m_idx) +{ + return -EOPNOTSUPP; +} + +static inline int p2m_get_mem_access(struct domain *d, gfn_t gfn, + xenmem_access_t *access, + unsigned int altp2m_idx) +{ + return -EOPNOTSUPP; +} + static inline int mem_access_memop(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(xen_mem_access_op_t) arg) diff --git a/xen/include/xen/monitor.h b/xen/include/xen/monitor.h index c086c4390c..1b7984909e 100644 --- a/xen/include/xen/monitor.h +++ b/xen/include/xen/monitor.h @@ -30,6 +30,7 @@ struct xen_domctl_monitor_op; #ifdef CONFIG_VM_EVENT int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop); void monitor_guest_request(void); +int monitor_traps(struct vcpu *v, bool sync, vm_event_request_t *req); #else /* !CONFIG_VM_EVENT */ static inline int monitor_domctl(struct domain *d, struct xen_domctl_monitor_op *mop) @@ -37,8 +38,11 @@ static inline int monitor_domctl(struct domain *d, return -EOPNOTSUPP; } static inline void monitor_guest_request(void) {} +static inline int monitor_traps(struct vcpu *v, bool sync, + vm_event_request_t *req) +{ + return -EOPNOTSUPP; +} #endif /* !CONFIG_VM_EVENT */ =20 -int monitor_traps(struct vcpu *v, bool sync, vm_event_request_t *req); - #endif /* __XEN_MONITOR_H__ */ diff --git a/xen/include/xen/vm_event.h b/xen/include/xen/vm_event.h index 27d0c74216..4b3d0d15ec 100644 --- a/xen/include/xen/vm_event.h +++ b/xen/include/xen/vm_event.h @@ -50,6 +50,7 @@ struct vm_event_domain unsigned int last_vcpu_wake_up; }; =20 +#ifdef CONFIG_VM_EVENT /* Returns whether a ring has been set up */ bool vm_event_check_ring(struct vm_event_domain *ved); =20 @@ -68,6 +69,20 @@ bool vm_event_check_ring(struct vm_event_domain *ved); */ int __vm_event_claim_slot(struct domain *d, struct vm_event_domain *ved, bool allow_sleep); +#else +static inline bool vm_event_check_ring(struct vm_event_domain *ved) +{ + return false; +} + +static inline int __vm_event_claim_slot(struct domain *d, + struct vm_event_domain *ved, + bool allow_sleep) +{ + return -EOPNOTSUPP; +} +#endif /* CONFIG_VM_EVENT */ + static inline int vm_event_claim_slot(struct domain *d, struct vm_event_domain *ved) { @@ -82,23 +97,28 @@ static inline int vm_event_claim_slot_nosleep(struct do= main *d, =20 void vm_event_cancel_slot(struct domain *d, struct vm_event_domain *ved); =20 +#ifdef CONFIG_VM_EVENT void vm_event_put_request(struct domain *d, struct vm_event_domain *ved, vm_event_request_t *req); =20 -#ifdef CONFIG_VM_EVENT /* Clean up on domain destruction */ void vm_event_cleanup(struct domain *d); int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec); + +void vm_event_vcpu_pause(struct vcpu *v); #else /* !CONFIG_VM_EVENT */ +static inline void vm_event_put_request(struct domain *d, + struct vm_event_domain *ved, + vm_event_request_t *req) {} static inline void vm_event_cleanup(struct domain *d) {} static inline int vm_event_domctl(struct domain *d, struct xen_domctl_vm_event_op *vec) { return -EOPNOTSUPP; } +static inline void vm_event_vcpu_pause(struct vcpu *v) {}; #endif /* !CONFIG_VM_EVENT */ =20 -void vm_event_vcpu_pause(struct vcpu *v); void vm_event_vcpu_unpause(struct vcpu *v); =20 void vm_event_fill_regs(vm_event_request_t *req); --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489996; cv=pass; d=zohomail.com; s=zohoarc; b=Qx+31BBFnB4EUGj1d1a21OtjpsEfeKkQvXzZA3Eu2AlMXEZsf2B+HZLrdoT72NXfdJyesM/9m8Om3WDUTY1S6GJwjuSSz15P0sK4Wk2YCfaVzwBmKoBzqixKawinXnj3WX65egdplcdw1emc05R2WAjULTrgPku9FkLw0UzCewI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489996; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iCvTZoNSvyoMqZzxIQR/q/ai6c9ycQYKWaEiuV+fVAQ=; b=Xco47HJEP5XXYxIzbYUfp79C4OXKdbu8x/kY1lfoGPzZDzpdhiSaNLTpb20e0QFfZPOpXEj73sBEQsfDkeoUQKcxYk60xAAsAAQgGq26xCmC3xEh6kWCGOYU00Au8gDfLnIyH8NKNT3QpkAuhggHIMOKh/kC7cWfFX2FT4X62Xo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757489996140423.3838417876357; Wed, 10 Sep 2025 00:39:56 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117586.1463685 (Exim 4.92) (envelope-from ) id 1uwFQV-0007JD-IG; Wed, 10 Sep 2025 07:39:35 +0000 Received: by outflank-mailman (output) from mailman id 1117586.1463685; Wed, 10 Sep 2025 07:39:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQV-0007Iw-EH; Wed, 10 Sep 2025 07:39:35 +0000 Received: by outflank-mailman (input) for mailman id 1117586; Wed, 10 Sep 2025 07:39:34 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQU-0005yo-1J for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:34 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2061a.outbound.protection.outlook.com [2a01:111:f403:2416::61a]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 49a78e28-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:32 +0200 (CEST) Received: from BYAPR11CA0048.namprd11.prod.outlook.com (2603:10b6:a03:80::25) by SN7PR12MB8818.namprd12.prod.outlook.com (2603:10b6:806:34b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:28 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::18) by BYAPR11CA0048.outlook.office365.com (2603:10b6:a03:80::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.23 via Frontend Transport; Wed, 10 Sep 2025 07:39:27 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:27 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:10 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 49a78e28-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JrorcKgFR778dOLrJ3ol+bAKBo0iSROGYB+mxKgpOSb9AayDrMH1WbJvcVDZFEpJfycRjHJnjMppYDRVypDCKr4Xr/tG4mYKseAfb2cuwxi4XTV4k9WbP5FloxGNhhFVc0ds4SK5kwYiFlYqcx6JIBsXEExBzdhRvNHhqMzMPE0sMTafWf8w8aGO+dEjJjIzBNb8ZjIgaGkuiVxT2aD+d0+nTPIOwtCEUymp2AyqnpzgZ/9Zh7BDd9H3hn7KKrzQcuTiO4iSeHNOG0+kMYXwdKFves0kgQaP7g6j1/b4J7z9jhAtTtQI8Tncun42nrvWH/Tpwu7PewZ76U8ybO2RdQ== 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=iCvTZoNSvyoMqZzxIQR/q/ai6c9ycQYKWaEiuV+fVAQ=; b=grPz6vCAPR9yTtltcUtjAquTuRWQ00Ol2vhrpKgMYNSCbOkKeVYvSS75H1q/bzg9sOAsaT1hhR3NmlqN9tyqdxPp7nSxoXVapus1p+Sy+9ro8wm4v/cUX5Jt4qwLGJ/k+A4JNJnC3NVNINBRSKtiyFVq58LT56etTCkxm+pWgyVAqUlhOK/Js90loNJIkEkmjWs4A+mF/XHv3/YLN6BQZ1I6x2QyHP8SxPEKNR6xl3f1GpZb2m+xujqT+iCTvVwW+tDs0iFMl3iQivdB59nia0NggtPPyiJtz/77z/kgWb2SJH4j/izsdsq68fISK2zC3TQzZwXcLzRG4dURAuckjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=iCvTZoNSvyoMqZzxIQR/q/ai6c9ycQYKWaEiuV+fVAQ=; b=icQM2M3KvL69lpINYC5BGdkniBKJfJ8hdIJBYTODmdNZsdMdUWqUbbVUwFDccox0HyrnUB9FhtlujnromDnuMcARkX5vVor5JwLTYg3Ut8rK0lEdtXEZOeHe3p+bldAL4Pxdao0WWrkUs0JFn798TlqCxy5UIYKL96iGTzBV7rI= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 05/26] xen/x86: make VM_EVENT depend on CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:06 +0800 Message-ID: <20250910073827.3622177-6-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|SN7PR12MB8818:EE_ X-MS-Office365-Filtering-Correlation-Id: a6bdd730-d856-4003-5e23-08ddf03d2c02 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?tkKWckCL/rzUqz5rahUPinHjfkjStkZThLscodxhVZ6Y6Apf1X2LeV6ygtSO?= =?us-ascii?Q?by/83KWX65qJfycm28Z766ZUUP017kLu9/5QXFWl36/GhHoVN1qbLMMOm3IO?= =?us-ascii?Q?o9xLDzPbr8SDjBFc1d/fAySbvzrrEXvAxAFneGhTZDonmk/OXx51JiDmd0fF?= =?us-ascii?Q?yJao8yQsZUOG0BqNY8Vtm384jphq9HFqeOPPoAdTn+VSh33aiXL7yThk8Joz?= =?us-ascii?Q?Xv5N/tCVteMdd1Ja4PR3Fm3N6Ld7nSG2kfUTg1GWuyRGI9iChuuxEnT2KYoj?= =?us-ascii?Q?G+pVKrtcUkYjGyFD2SYfacHLr1/EuBVdso3t2f1X+CXd01KGdkU4UYpypYeV?= =?us-ascii?Q?sfy72332UtkC4GG1Eya8/BeljiJv9lZKdS7jg13i3kPk4FQAzTcQBab8SaxN?= =?us-ascii?Q?es1vHPalmxgNz1Ebmnkj6B2sSC9lyU6wmGtTAb8tXrB+d/faf6/4/v0pdIyQ?= =?us-ascii?Q?DudmZ+gaKQ8KQdz/Rhdps3topvYAk3lJbCZwLs5CzNDfa2mqtVUlU6qCA9As?= =?us-ascii?Q?8HlYw6HW0M8EDm0CYgX9a9lTFyS4TvAW8PUX9o2+pjlXV3ou0ooZWKobeXKO?= =?us-ascii?Q?+bq3cVBuzaPg6WsOSDexNxvqWiQoWDnw/3n7kHnDkI4WV/tcof3Zja2fSyDX?= =?us-ascii?Q?U4T954vfMci3NuAe6XdWi9BESbUvrZqmlrcXOB7w2eoI4ojOSdoDME+iKl3a?= =?us-ascii?Q?cUCneZQ3K6ZmBwxoJJyNlgS6cAqHaUatcwksnhbqYaUf7aqsSv0sxovIams+?= =?us-ascii?Q?kVqMCBnkqgCyILKbNS96cMhkM8PI+pAAdtuelK6bnDtigpFEwHUWTJKEWjaJ?= =?us-ascii?Q?2DPtGYMt3gW7BqpSbmmF/XvvXjCcNMP17siBxlXFJBwUlfFvEuVjQOKnkp/X?= =?us-ascii?Q?TgKBD8nl1yQQLDivRM4fWcPJlIZqyQ79Lhm3ozJaPShgeHsg2Hp8FPkf6C13?= =?us-ascii?Q?bqgmfag2WaEk/R7fuqkPTIIKl50WqKI9wbHvWGcjGMkhJc8pmTHg3ZkZNHRu?= =?us-ascii?Q?gIBOTB16KdMXBzv8V8/r5JY0472tTC0PDnv52v6qAAXBypofG2Tq9GGbCyHI?= =?us-ascii?Q?Bo4DeNuanchrZrJK3W3lZzeU6C56iTW7b3VB+cxnmcLjbXrVasw5Zv093+pY?= =?us-ascii?Q?PHEhrQoi+SDHs08TjRuX/kp4xulaVEdI9tgHC+r69srq4PGpV5z0nKrMcxNo?= =?us-ascii?Q?AHhCwrPWxabeITtUKqWDlkfbvrcfS/KieUJ/1E2CxWl25nPwHzhbMBytOo8J?= =?us-ascii?Q?2b+GzIBV+y90GavPIugIDE4ftulkDJmtHoiaiZbJ/yppA0FAQpmrcqEM7IoO?= =?us-ascii?Q?ZD7YgMxvhKbxfJlTkYzB3Vp77Qlsnx3JtQokUDX/ioTJBbIM1qBwh6HtXRBt?= =?us-ascii?Q?kWXD8yMuDxcke3H3vFuN29VUwFZiHcjQUuW8pjAVYI100kSC0awwihhO4Spz?= =?us-ascii?Q?RIwultnzrnQ+Xzia2AFj9Zo6HctuvFbPINdfWUtyU6cyZt2gjosTxekfWyD2?= =?us-ascii?Q?LMRHvkRJedhoPL26Ow0wIboGHpThkJuPygN6?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:27.7824 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6bdd730-d856-4003-5e23-08ddf03d2c02 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB8818 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757489997576116600 Content-Type: text/plain; charset="utf-8" VM event could only be enabled/disabled via vm_event domctl-op, so CONFIG_VM_EVENT shall depend on CONFIG_MGMT_HYPERCALLS Signed-off-by: Penny Zheng Acked-by: Jan Beulich --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/common/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index c1571377d3..1aedd00b12 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -176,7 +176,7 @@ config MEM_ACCESS_ALWAYS_ON config VM_EVENT def_bool MEM_ACCESS_ALWAYS_ON prompt "Memory Access and VM events" if !MEM_ACCESS_ALWAYS_ON - depends on HVM + depends on HVM && MGMT_HYPERCALLS help =20 Framework to configure memory access types for guests and receive --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489998; cv=pass; d=zohomail.com; s=zohoarc; b=HqhFOA4XKVis4zMmmpg19h0FhvbYNC/mSrLGFhsYKsNKObKR5dRvGdBcJHJaYgGPJbP0PL3WqqcyHHEHLTm3Uf0TiyE0JjI/t8RQyoghR8ISqYF14qVB3pLK83Qr9m95bG5DyIzOjl/6NyvNrWa69S4W1gCh+DSAOW3X0cn9fMI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489998; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lTp42bSRhvcOVjyyk45wHe2EzSvJUdHkIazLuJGONW0=; b=cT50zRcWei4OVEha5MRsRwVRSYSiWcSOH5mftSwR6XYANpRgKSWbUfz2XNUI85V0E+f2FidR1QGJ+qFXIcLjdNTrqzf5nZQ+LtxeJuf8ktyU9I5hdyPy9egstsUski/6uMejj89K/SPC1Y6KSeqP/cPa3flYaJPvqkLiE/Y7zYo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757489998605721.0307754953307; Wed, 10 Sep 2025 00:39:58 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117593.1463715 (Exim 4.92) (envelope-from ) id 1uwFQa-0008B3-OF; Wed, 10 Sep 2025 07:39:40 +0000 Received: by outflank-mailman (output) from mailman id 1117593.1463715; Wed, 10 Sep 2025 07:39:40 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQa-0008Ar-K8; Wed, 10 Sep 2025 07:39:40 +0000 Received: by outflank-mailman (input) for mailman id 1117593; Wed, 10 Sep 2025 07:39:39 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQZ-0005yo-KT for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:39 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2062e.outbound.protection.outlook.com [2a01:111:f403:2416::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4da726d3-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:37 +0200 (CEST) Received: from BYAPR11CA0049.namprd11.prod.outlook.com (2603:10b6:a03:80::26) by IA1PR12MB7709.namprd12.prod.outlook.com (2603:10b6:208:423::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.19; Wed, 10 Sep 2025 07:39:31 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::d0) by BYAPR11CA0049.outlook.office365.com (2603:10b6:a03:80::26) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:30 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:30 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:13 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4da726d3-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zTZ6Qh4MTMFTbpNxxNnyEGALzfKW9QiV262qFDlKL1mXpywhu7ZQeWEA8rTWybntABpTkQdKx0VkCk4Zn/+wsbN2c/tPCcRJZ9pb+usX5qug7vlDyFtEodNvXKV0lx7t1lYXkh/b6oAOFPfA0gE27uWGSYyqwZK2ylMLpLm7VgU9nVmjF30Y/znZpUvPzJ0MRTBKH37a8PLuR3Zi6xoEKmeuCQXvTH3jC0MghgfSF5o7WvjLE1Kthm6jSL4iF0PcNEIw6OiWW5um0rHafUAU1rX4YR9spB4sOzSZYfxze74/qqkXq9pfDRlfOGzLW20t1enEth3uwEyVRkUAh8/46Q== 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=lTp42bSRhvcOVjyyk45wHe2EzSvJUdHkIazLuJGONW0=; b=rds/uSPeY8WiIi7nzMTW5acYHgbyTZeSaQioK/hJgFmwJuraL1qbVMAh2CCMXvJ7FkCAuuALhs5+dLU15M9XHFyyvSHW2XrDQw15JBRxIBnEzw2KZvgCxkShJyA5vwQp9YlG69osmqWUjQGpnboOKq1P5rBKxkNKfqUaeTKgkDGYLp/lHMn3r8KW6bSfmnqxwP6yylruC2yR2O/GkopAuKWF4d8kjWvIcqfjcx5w0WNTwFpxOhv8iv1tRB/VC1UX3Fn7wXGlH0BsCn0JTJ1AUhDcpofLDeeSCASW8fBwOzWoSZgebgT/qA7MAgOWCHPAL+r3oopMhM+z2f5kBv2gjw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=lTp42bSRhvcOVjyyk45wHe2EzSvJUdHkIazLuJGONW0=; b=NaNrqsR6V0adY+a/gwrIl7TuoBEsX3k8cvmef0oFBCFk3QN2qInkfH6cChjHOHMmIX+ytaMQK/8nWb88JsnSsJgZUNovXt9q6FPnzjJ8cO0b3XTQdozlbTy/Jq9TkQ16Gb+lKmxLoqOKPrcRQASvjXbntucbjeox5bg58YvalTc= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 06/26] xen/xsm: wrap xsm_vm_event_control() with CONFIG_VM_EVENT Date: Wed, 10 Sep 2025 15:38:07 +0800 Message-ID: <20250910073827.3622177-7-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|IA1PR12MB7709:EE_ X-MS-Office365-Filtering-Correlation-Id: 4343a5d8-9658-4a14-11a3-08ddf03d2dba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?h02Y4c5oLfnA7rjckCmcjoJuAv9ATOrf5OEH9R8o/VlA+dnjXJb76xsnXdMC?= =?us-ascii?Q?UHm4iWGTUuDhUz2WLH4UtF4zy/GAi+7Fi/2oKAAS23aOqylIlLr3nBqZu/bb?= =?us-ascii?Q?CHxic30sy/jhA9+jHSaKUNSZUwajlbdO9BisG/IBwDnv/artNPt+2z9mNdDl?= =?us-ascii?Q?AbRJRqE5OEM1vO3IvoDMEF27HYY1LBFrsGHG3KdXa/QfIPp/uYia3+7Kb7uf?= =?us-ascii?Q?YgMLdpPN57jFBQBvmWlBthPE+8OTXSLtqqlGcznp7s+m3MhKe/xbtcJPK5Vr?= =?us-ascii?Q?0xYUq1FmmzZqn0zTW4kgjO+wfmn6LzK/WipluFdA518dXQshRiwLABjsuadj?= =?us-ascii?Q?CNR7ylCzHoUGGyC89EYfkr+lA8WlGSTwMrv8Goj3aErb17DcpFIiWMHMZhcr?= =?us-ascii?Q?ArvFFJ/v5yoBxcBGnqw6idiIVWTfRQqy17Cd4eMFl5usdK0CG1ojVVgJrmt7?= =?us-ascii?Q?3Dv1QLMoA5AbFtGnmxbY1nPx2vPuot/3fnC6vrtsKdGbc00SZdFmckZy/TFO?= =?us-ascii?Q?Id+uWxYaLGPAiubaEs8BgEnorokbNylZR13tFQGvADvej4C8iYYwKTYf2Qb8?= =?us-ascii?Q?vKgkFONNaleoK+0tYylm4CsHKKeQPki66IUBjBxlqA+SyT6yVcB7TXvHs0Le?= =?us-ascii?Q?+Re7nwPvQitB3m+Za+HEXtQytFBeqYgqQQM9I8O9pl7p+0UGPcmdO17k50Dh?= =?us-ascii?Q?iRKIillq7fEIO6E1F6EhugaH15F7oih8DoxYqATYLWbzJiWQvVxHkHJZ9E+N?= =?us-ascii?Q?0o69pf111U8zOTGiNdhnKB4JPL3Qx65ID/+Thu+ikBfy3JapyG7Csh+8xwo6?= =?us-ascii?Q?cwGBb/v7hfVQLYSnEx2Yrifr3osWtw6iVYPP83U+/dgXw9khtMknUYr0awu+?= =?us-ascii?Q?EihSTKxxP9i0BG6wL1wme1GE9OlYGA8oT95gVmuxA625zPrazSVJ6H2TYYXu?= =?us-ascii?Q?nfSszLeBbOvRVn/Lyt2MMyixZex+Z4T2jrrbV8DG2Tbmd835Vt5z24aRfEAu?= =?us-ascii?Q?qXYi2Hsaftq7jViA0t7x1K70rVVTf3cHY2IuzXQtl6tlK9dz0FVi/xka0J9b?= =?us-ascii?Q?HNOXtXw2m9nfdArVWYCWxebP5TREsSxvjr5uznYgBILs9IvrXOXsJ9YK6CK5?= =?us-ascii?Q?Kl8QibM7yeUkzD6n9JooRivXf0F7WPbOhdCx3xrVyxR78SMsbP7g7gOXdkv1?= =?us-ascii?Q?FzWlw2Q/in7X5i1HKRKu3vUXbhf+9F1twJ6Pjpkn4csd3YU76PC75FXHOcN9?= =?us-ascii?Q?Xe5NL+M1+QYGS+pDJS2mVAwgfpUMasILAKQM1tCq2An/wr7XVlVmw2d/6+R8?= =?us-ascii?Q?a4eWEovTRmU2QSaBNhsbO1N8CcXP7Im1G3mBlNeBKL6NpvHs3RnmgdiAWvAG?= =?us-ascii?Q?ptaHWbxdWu50dBwOqcgSje7wlNz5sE4SAcfHiNcvQSSiEcR+yjtFUZ5hq9td?= =?us-ascii?Q?j3H5t+dw4vARIHobThzhOub/YZu6zN+m2I2i39J0ytsWw8olD7lm6amC1er9?= =?us-ascii?Q?pdd1nSt9+V+OIiS3IYWBhdyd6hrhFOJbUCn6?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:30.6639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4343a5d8-9658-4a14-11a3-08ddf03d2dba 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7709 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490001410124100 Content-Type: text/plain; charset="utf-8" Function xsm_vm_event_control() is only invoked under CONFIG_VM_EVENT, so it shall be wrapped with it Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - new commit --- xen/include/xsm/xsm.h | 4 ++-- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 3c960ad909..1e4647f7db 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -155,9 +155,9 @@ struct xsm_ops { int (*hvm_altp2mhvm_op)(struct domain *d, uint64_t mode, uint32_t op); int (*get_vnumainfo)(struct domain *d); =20 +#ifdef CONFIG_VM_EVENT int (*vm_event_control)(struct domain *d, int mode, int op); =20 -#ifdef CONFIG_VM_EVENT int (*mem_access)(struct domain *d); #endif =20 @@ -649,13 +649,13 @@ static inline int xsm_get_vnumainfo(xsm_default_t def= , struct domain *d) return alternative_call(xsm_ops.get_vnumainfo, d); } =20 +#ifdef CONFIG_VM_EVENT static inline int xsm_vm_event_control( xsm_default_t def, struct domain *d, int mode, int op) { return alternative_call(xsm_ops.vm_event_control, d, mode, op); } =20 -#ifdef CONFIG_VM_EVENT static inline int xsm_mem_access(xsm_default_t def, struct domain *d) { return alternative_call(xsm_ops.mem_access, d); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index f5483e0709..2c70b979d6 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -115,9 +115,9 @@ static const struct xsm_ops __initconst_cf_clobber dumm= y_ops =3D { .remove_from_physmap =3D xsm_remove_from_physmap, .map_gmfn_foreign =3D xsm_map_gmfn_foreign, =20 +#ifdef CONFIG_VM_EVENT .vm_event_control =3D xsm_vm_event_control, =20 -#ifdef CONFIG_VM_EVENT .mem_access =3D xsm_mem_access, #endif =20 diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 21914d3507..ec3880f631 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1365,12 +1365,12 @@ static int cf_check flask_hvm_altp2mhvm_op(struct d= omain *d, uint64_t mode, uint return current_has_perm(d, SECCLASS_HVM, HVM__ALTP2MHVM_OP); } =20 +#ifdef CONFIG_VM_EVENT static int cf_check flask_vm_event_control(struct domain *d, int mode, int= op) { return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__VM_EVENT); } =20 -#ifdef CONFIG_VM_EVENT static int cf_check flask_mem_access(struct domain *d) { return current_has_perm(d, SECCLASS_DOMAIN2, DOMAIN2__MEM_ACCESS); @@ -1967,9 +1967,9 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .do_xsm_op =3D do_flask_op, .get_vnumainfo =3D flask_get_vnumainfo, =20 +#ifdef CONFIG_VM_EVENT .vm_event_control =3D flask_vm_event_control, =20 -#ifdef CONFIG_VM_EVENT .mem_access =3D flask_mem_access, #endif =20 --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757489993; cv=pass; d=zohomail.com; s=zohoarc; b=IaNYYSM8IZ98az3lWZELgjlL7L6LgAw3JZpbJQo/1gh6AvOuggpodR8JsvfYcrPfYyzEByYQMFV5+O7g0X2NqhoR+c5AOFp9aXTbGGWcplWOaXY5uZAS86NhOoFpFHGy1PqPvkEC9rBhSKazgFjO3K8o8Uzo020Oii5jD6EURXA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757489993; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i/kOr6NWGAHtu7qRDO4SbbFA71cfMDDDWYMWSaKP9zk=; b=MXSnJumhv0jIPC9niy95IE68lt5psV/gCpogPWEbjvVfIB47OBbOGsLPAWrnFsvFmbDsY5/9OPToemWHzPCZAre8YMy3w4GC9q6vc1w/iFt6EQdRF9WgZ+v3aMOtWRjwW4DrxTKG1jwpngjnd6hQs4gsFtgnz//YSiJjbnnXMog= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 175748999365996.28424477211695; Wed, 10 Sep 2025 00:39:53 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117590.1463701 (Exim 4.92) (envelope-from ) id 1uwFQY-0007hc-Fa; Wed, 10 Sep 2025 07:39:38 +0000 Received: by outflank-mailman (output) from mailman id 1117590.1463701; Wed, 10 Sep 2025 07:39:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQY-0007ga-7m; Wed, 10 Sep 2025 07:39:38 +0000 Received: by outflank-mailman (input) for mailman id 1117590; Wed, 10 Sep 2025 07:39:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQX-0005yt-6G for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:37 +0000 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on20610.outbound.protection.outlook.com [2a01:111:f403:240a::610]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4c5dcd5e-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:36 +0200 (CEST) Received: from BYAPR11CA0072.namprd11.prod.outlook.com (2603:10b6:a03:80::49) by BY5PR12MB4067.namprd12.prod.outlook.com (2603:10b6:a03:212::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:32 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::59) by BYAPR11CA0072.outlook.office365.com (2603:10b6:a03:80::49) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:31 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:31 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:15 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4c5dcd5e-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Lg/rQlYttFe336ob4CObvp/2vWQ8I+M79Lb6bkBPjX6OFIhM0S33O2gJrM2o9nPyLCF1Frws8kh8AONbHUT7ziphAUa7fi86L9Vc4BsNKZfiE9kXIZI/c/c4JEcaVy7ONLBipSisuMqgIQ06SObdZv8FMoRGhMtPtcpaTbyLc4LxtVuEXnwb/UpaYnyY9qKvOrUV254CMiboGlc7L0OKphbfb31tc1m8bbj+tdGxkgcp8tfgaJjFIC0ELj5o/s8UIYOIIaL1uTBFPjmVvVjvqhJn4uNouL3ESNZ8Nv6VW3A8d0OTY43WdFAqG1jY+PassmpCzBNLNgCnowr7dW+gwA== 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=i/kOr6NWGAHtu7qRDO4SbbFA71cfMDDDWYMWSaKP9zk=; b=GjOedmGI3kMp3RF/JqKDhCW25x7gzCldl9A6hpTCUA9W9fqrp7sPJqyZnyhInMOwO10WOKBOlT1ekBba+eJnJuvfRrQNCP6tbUjgRgD3XjslU/KOVhZ/gVK+sYtTyIN3xc20RpTj8C5vZ6P5bTz61jC39u+SqzCAMZf0HvjrkPvHW83SKMBDbs4w5fwjMc3dwz0F/R/x/aChdUwUcETMRlvop5yFsPn5MMlHz6r91xxPeE3toi+ubmt5GmMOrDYs4bM4FU8pPrPzWzN6DyTrDDsYnHKsstUwClyfDWXX1Yyx5csSuJ2nG6+ukYOsGcjJ1cF5UBMUNc31OZQWICy1pw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=i/kOr6NWGAHtu7qRDO4SbbFA71cfMDDDWYMWSaKP9zk=; b=aIF739X5s2DHVz/S1ZXaPVJITPlcNBYlhJDZ+DJ529KjNyUb80x1W9JLN5D6fjN4NFXiOnkyie3skPvm26Pb+6TaENXa0b7zuZ7tQAnft3Z0f1NztZcd4pxWEOzS/eoNo0XVjsW5EQs1V9lHXkDlEp+BMuguh0iVkqlH7XoTIS0= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 07/26] xen/domctl: wrap domain_pause_by_systemcontroller() with MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:08 +0800 Message-ID: <20250910073827.3622177-8-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|BY5PR12MB4067:EE_ X-MS-Office365-Filtering-Correlation-Id: 51f86d3f-0d78-4c7e-566b-08ddf03d2e3d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?y04zgkfScc3igoFPAO8b28+KL1lwiiFcWZGcGg5qva1e4aFUHY/E32CyBm26?= =?us-ascii?Q?dE8Odugeg7+H6RhXss2WWtBcy/dBtI4NJX1qN4Od68RiLGKjLtXtXBzgwE9N?= =?us-ascii?Q?i6GQ3DhMttpqw+cFh/ZVTCCW4hrVcsFt/GTFFP3HKnd1Q+9rW9ZDeCYp0kJW?= =?us-ascii?Q?7ucIL2EtsCnNSPW9f7zzSV614lCJqJap4Jdbfb1sUM0CFUUlb6blaG9dCOgr?= =?us-ascii?Q?GLfTTjDQug5ARup4Cc3VKptQwkDu3znxODI+aNStkfgIMTIaJupJktKydc5I?= =?us-ascii?Q?4tlwoANDAbSdRJcXkV17mNtKqDk/29bhgoBhO34ERd60E0hhQePpBP02qCWi?= =?us-ascii?Q?ox2Re8S1wU05zNTDMyZYW7UuytmhazXSDxggVwQwFhsv9f2/QD5DSRdBVNoZ?= =?us-ascii?Q?wnJXJshwrI4ec6FMhjD3DzoEsjo+9vDOvmcQGGKh33rgzezz9xma1mbjkkwc?= =?us-ascii?Q?AzcDgMA2iuaKSnXh+ENKHYBraK7am0abuX2HxFYaCYtX06LY31JC7I9z3t0F?= =?us-ascii?Q?4SORwn07ZxFL4lbN4nnJ5ny4E1x2CAPEWM2CKRU/VZvoNXHIWuIMl+NKV8hJ?= =?us-ascii?Q?5CjJP3wX39tSKj3Y7PQtQyg7h3QY3FmanHh7VBtJgMMbTf5vlv2YZXJCfpWj?= =?us-ascii?Q?/mfNiPVORHjr5rY3u7N43UPFeCsujDz7oVUiA8AS/u0Yb/IvXk93ZJJSQ5wl?= =?us-ascii?Q?379+8R4kMS43wmzBEYKoXRLJVFP5lCF9hi1krT5HQcHnd+NRVy1s3JyNj/Mv?= =?us-ascii?Q?zUSZAvXpK5nkxkkI7brC7eELJPSb4MHKMxIpJWhoQ95CHeCasUNMwOcEQkKE?= =?us-ascii?Q?b0R2G1adsd2sRwFPQ5bwEUNDSN17S81i4kuxKYrOFzWhK5rBPFrR3rMOjMdE?= =?us-ascii?Q?KQggkqsucjz01iKsebQQo7gkiYIvFkyt+SXdg0JoiV+mpxWwVttBy/YswZQZ?= =?us-ascii?Q?zd4jnJUNeSKVQV0ZqXbqsJxKMA9h9a5n+VszvTFVVp0B2FrsTGn5jVCd5T0t?= =?us-ascii?Q?DjawL2oG8x6yf5YYqH3KbmkwAn6gomofz5Z2XhXBxljfDZFcEEa0qSG+DDv0?= =?us-ascii?Q?fu59fRCJAJYDRJ8OslRQoYSg1mSIWT7vxG4pBXanqsNEKHSV1kiOntGZyBuf?= =?us-ascii?Q?+BSmxX2E+2i+HX/07aMZzqvMO3xoBSityxERKfgjTEzbW92494o+SZ1MOLFr?= =?us-ascii?Q?tU74OdP80FpGSCdx7cJ9ltjkxU846TOX5p0ZuDG+dmWxnp9rzypNRTvTb1p9?= =?us-ascii?Q?nPZH6SKE7EXpLS97OIC+Q7V4BK72EGxYwtURzXDc7U7rlUIPMJhRK2D13gxN?= =?us-ascii?Q?b2k8Bfp2+3guvp/wLX8jJ4cDRjyOJSgxFKR5fAnn/0sbMyxR8LOtAhhFl8Kb?= =?us-ascii?Q?MMCO/zdpPuCRQm3GWn/3Bxfn5ZYWDftkCvf1waCM6pBeffpOqdEM7i5eOryW?= =?us-ascii?Q?RAOLdU3D+TF010iFSLI8nBxdX4mCyO4JEts09q4edv4gxyMtfeIisIEWkkat?= =?us-ascii?Q?hcuJqrVDNYn0CBinn7043ZKO2DiprM0WAabp?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:31.5245 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 51f86d3f-0d78-4c7e-566b-08ddf03d2e3d 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4067 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757489995264124100 Content-Type: text/plain; charset="utf-8" Function domain_pause_by_systemcontroller() is responsible for XEN_DOMCTL_pausedomain domctl-op, and shall be wrapped around with CONFIG_MGMT_HYPERCALLS. Provide transient wrapping around XEN_DOMCTL_pausedomain-case, and it will be removed on introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - provide transient wrapping around XEN_DOMCTL_pausedomain-case --- xen/common/domain.c | 2 ++ xen/common/domctl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index 775c339285..976172c7d3 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1606,10 +1606,12 @@ static int _domain_pause_by_systemcontroller(struct= domain *d, bool sync) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int domain_pause_by_systemcontroller(struct domain *d) { return _domain_pause_by_systemcontroller(d, true /* sync */); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int domain_pause_by_systemcontroller_nosync(struct domain *d) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 71e712c1f3..0061d7972a 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -390,11 +390,13 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) break; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_pausedomain: ret =3D -EINVAL; if ( d !=3D current->domain ) ret =3D domain_pause_by_systemcontroller(d); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_unpausedomain: ret =3D domain_unpause_by_systemcontroller(d); --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490008; cv=pass; d=zohomail.com; s=zohoarc; b=R3ZK1EtT9a7KG5xePfCjyzBzpkDJwO4E2aqdxMsQW7yNXpYIDsXfc0c7z0pcH4fOPnmFa9o6wFCw/sHh6BoElKRF9PBFX36h9d/55os+URDFpRC/f/I6DAOGaj28RM6jtcKOOn4JhiQC/lufduqmhU4YsQ/osnXUnW7XSInWzas= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490008; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QCQXbHre+Tmm9vrjGVCZOjoEzc5zPINt6SGXpZK2zMM=; b=ShzIZSxud5DfZ4Wq+/J9N3KBkQZYZQxJ4tLJAOb1P4ZliRlSgBcKFqxZg1du2wFj5MrUyYYzTaZKPZ0MP/qpXiUF9g1+akWtigI9evPyaM0x1gJP2MCYa0TcZAP5/yFITpNqsSb1Ws/IQ0lvZJK9+4mZt0ZlyplG0J7DxQ2Lhwc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490008104248.66499644957548; Wed, 10 Sep 2025 00:40:08 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117599.1463735 (Exim 4.92) (envelope-from ) id 1uwFQe-0000WC-Lu; Wed, 10 Sep 2025 07:39:44 +0000 Received: by outflank-mailman (output) from mailman id 1117599.1463735; Wed, 10 Sep 2025 07:39:44 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQe-0000VL-GU; Wed, 10 Sep 2025 07:39:44 +0000 Received: by outflank-mailman (input) for mailman id 1117599; Wed, 10 Sep 2025 07:39:43 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQd-0005yo-2D for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:43 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2062e.outbound.protection.outlook.com [2a01:111:f403:2414::62e]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 4fd30496-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:41 +0200 (CEST) Received: from BYAPR11CA0071.namprd11.prod.outlook.com (2603:10b6:a03:80::48) by CH3PR12MB9021.namprd12.prod.outlook.com (2603:10b6:610:173::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:35 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::4c) by BYAPR11CA0071.outlook.office365.com (2603:10b6:a03:80::48) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:35 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:35 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:17 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4fd30496-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Vt3eqbsjLnuHl9Tqeq9eFiB5JDZNUAiIz+rTob2PNRsi3EJcBPGPKmm5Vyhx85n3bo00ISF9JFpOIFZl/YSPznamt5046nZSyQBwySL8YqI5kzB4Ajvw/ARjb9MFs6lxSzZWWuDMXYOOcOUdK3xKzLTRnfVh69x+dZWnUg3AkQlR4M94wFP6kWqvOqaiytw78479Yl7M8tdvSFID9j2tR9cFQUDwnKa2XWt+7JbZWoWantOeWBusQ1y/T8cnD0DycEfM3SOz5JgvAjMRljAFFwSKe6qkIeERRORAZ30F9MZflmusUFWWvkgkkmgYLeTJnR2BbGsVbAJvCNioUo3uRQ== 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=QCQXbHre+Tmm9vrjGVCZOjoEzc5zPINt6SGXpZK2zMM=; b=HdVzcwTf6Pa0MpDEAli2Rw1VQN8Y7u/2SDytgthjpZ0Tnq2Grwt4i9OvPMJ2sBnhUZSMNOn5wE4j4H/mGpFEC1zIOKKLd6/rxe7bEkFh1qhPlHBliJTrN78mhyH2ntXVBTrg8s9on73InhrRHwfLVO49ZJLrW/+eAV+hwzx4qnrbm6CyI7kDVx++tD/sJOh6bGq3GQVO9WjVvZalTTMo4QkjBPmGyxTGQEHGjMZuh7owKSp+4IZ68y5dISbHI5xKMX4MQLGd6X3MmoRd8pgmsSL/cQW5Ny186DGV8+vM2+4ipVeyJQHUkpvc23VLJL44JTycIiGe3HIshjJNBZPf1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=QCQXbHre+Tmm9vrjGVCZOjoEzc5zPINt6SGXpZK2zMM=; b=flC3c07rnLJ4sXwUGQYY2ElrhnK8Js1c+YuxievSQw4wbf9hxIjKxEyxMYMMdTpK/M09qvSef4GLGvZmagAM7O/h9LkFDPDhcxgJ8Y0Jpqhd0qXDBAXxb/+z29v4aZtvroR9DpvKo8+1u1ijQVPDZS8F21QNSnIF8szsn3PiDBI= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Christopher Clark , "Daniel P. Smith" Subject: [PATCH v2 08/26] xen/domctl: wrap domain_soft_reset() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:09 +0800 Message-ID: <20250910073827.3622177-9-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|CH3PR12MB9021:EE_ X-MS-Office365-Filtering-Correlation-Id: 9b4fadab-e0de-4936-b6f0-08ddf03d3061 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|7416014|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FheVA+sA+CN/qpqz6PojzQPWmIjyFnVMy6OIKFPub6+4AA8cTaf3y6LZiQIX?= =?us-ascii?Q?Zj19aAfctGaYr5VrcXLkvjR1GsMGjPFTfjpZKpggO2ZwK+mAuSbpmXVD5FJA?= =?us-ascii?Q?pLbnOkDOAYlUPLdM07Uk2rkv0ZR+LWfB82vBAn/VsUF3ULHXIH/L3R6XJt/8?= =?us-ascii?Q?YQL2cwpZfkymQKP+/Vj0e26+dnqVxcoYhj24PCLzKdei6vZKv1Mi+KM9++JR?= =?us-ascii?Q?Iat4m5b4Yv+A83z3odkNz1JwQq6mvq35vL2NUamo3c8fPhmYUAb4Ic/BUkO/?= =?us-ascii?Q?OQvFmb6SQ4Di3BV89gMKjhEocHvzBWqNwzBVHh3s5roiz8lckT74Zvr/gJMU?= =?us-ascii?Q?D+pns4LFjC35mFy/FQQ1ZM664pwcSXqgnKJSquALOfDdFq7RapVc0oTrUOEQ?= =?us-ascii?Q?nP+VIJ5YB9BYkbsgskCyvi+7dAyb3VoY+hOS5ZQtVzYMx49Vi/xg++JHkL/2?= =?us-ascii?Q?9B4LdbsrxYzLufmqVjbTTS2eS7PKFY3Oykv/Pko+NRKr0pes+7l35rjuIqh5?= =?us-ascii?Q?nBA1q9d8H0IcZJkkyk1xP7FjUqrSbTf8KXvr4QxkA0adlGd4QXDjVULtK2Bs?= =?us-ascii?Q?q6zLy3+BpF1GHKJnb1SXvOYGavYh/U4KXEJESXXuPDBSkRgW1MwRu7pdxrig?= =?us-ascii?Q?HHOlCJuVpCEAhMcq9be8z1NfKMPM9m3FDXHBJW8z0Xtn8CfEzIk8a9OpUGOR?= =?us-ascii?Q?Ogf8UUfFDGKd1QfHgEMBBcIxmtNdKvfw0/udcnJUQM+neML0HO5NMbZXGSLB?= =?us-ascii?Q?6u8AQPypqAOoLpYmnYBuBmYub3BDoiF6Ucuqa8jRgPkdurOddm1zfmKl3na4?= =?us-ascii?Q?5S79AQtKrFCIh6VJybJi6nsnTo74vxekftlxoq86U9Vp6AndcPj7sTzNUH47?= =?us-ascii?Q?WRs2qxtUlmWa9y7yYl4ZqzHEbxcb4Cth26DlLOg86+OCsnvdQ3McaB/jyvQl?= =?us-ascii?Q?oGg3ZTxy9ZwSyMfF2cGxxLK4/dlB8qGnBg3nghhWshgazX6HrsGX19rGTu9g?= =?us-ascii?Q?Y51dPvDF2mp7pBwHe58C+Kuy93DrvX9eh5GYyjo8FemUREVVB4V4ZtY4vDEa?= =?us-ascii?Q?jqM2IPslQ1d2IOAXHuQS+PaDv4ZzuFTiWrbj0HSugSqahMMtHAjJD3sFt9rr?= =?us-ascii?Q?ppWVl2BUnM0bFTBE1ixWUwjYvqpuPfSdE/RLsxyi3LR0d12cs7xSjcEzQXPy?= =?us-ascii?Q?RbONNR9rAhqN94vmgHldyJ64oIgdJXJ7S7pznZ9FvCxGQrhOmQFE/ToXfU1X?= =?us-ascii?Q?cfnlsQdbG7SMEucytZ5dzMWM5boLtMHKaPlwXzcOXF3RH0artdc4BbMXGtSK?= =?us-ascii?Q?/cW1t0K7KwKcrhRXrql6hP9SqfOMCYlIUNIYPSBGTVGWsX/BntJl8D7HUeiU?= =?us-ascii?Q?yG0wQWP3W02sGMieak9DYnndzb5Tvxrc77M3ei/aadBfLr9vgGFICWpsLo/b?= =?us-ascii?Q?AmSleBh8ln0XobQNXw1kNu9h3er1P2k769CvHyyCKWzTCyMJsF1KOa0rDTzx?= =?us-ascii?Q?EwgrnFituMg7l810LYP1dD8+e072M649+Y9A?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(7416014)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:35.1189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b4fadab-e0de-4936-b6f0-08ddf03d3061 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9021 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490009769116600 Content-Type: text/plain; charset="utf-8" Function domain_soft_reset() is responsible for domain soft reset domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Tracking its calling chain, and the following functions shall also be wrapp= ed with CONFIG_MGMT_HYPERCALLS: - grant_table_warn_active_grants() - argo_soft_reset() - arch_domain_soft_reset() Wrap XEN_DOMCTL_soft_reset-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - remove unnessary wrapping in stub.c - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_soft_reset-case transiently --- xen/arch/arm/domain.c | 2 ++ xen/arch/x86/domain.c | 2 ++ xen/common/argo.c | 2 ++ xen/common/domain.c | 2 ++ xen/common/domctl.c | 2 ++ xen/common/grant_table.c | 2 ++ 6 files changed, 12 insertions(+) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 1a8585d02b..30ff9dac46 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -875,10 +875,12 @@ void arch_domain_unpause(struct domain *d) { } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int arch_domain_soft_reset(struct domain *d) { return -ENOSYS; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void arch_domain_creation_finished(struct domain *d) { diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 19fd86ce88..5b3c5e8caf 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -1030,6 +1030,7 @@ void arch_domain_unpause(struct domain *d) viridian_time_domain_thaw(d); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int arch_domain_soft_reset(struct domain *d) { struct page_info *page =3D virt_to_page(d->shared_info), *new_page; @@ -1131,6 +1132,7 @@ int arch_domain_soft_reset(struct domain *d) =20 return ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void arch_domain_creation_finished(struct domain *d) { diff --git a/xen/common/argo.c b/xen/common/argo.c index cbe8911a43..a451546d57 100644 --- a/xen/common/argo.c +++ b/xen/common/argo.c @@ -2351,6 +2351,7 @@ argo_destroy(struct domain *d) write_unlock(&L1_global_argo_rwlock); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void argo_soft_reset(struct domain *d) { @@ -2374,3 +2375,4 @@ argo_soft_reset(struct domain *d) =20 write_unlock(&L1_global_argo_rwlock); } +#endif /* CONFIG_MGMT_HYPERCALLS */ diff --git a/xen/common/domain.c b/xen/common/domain.c index 976172c7d3..678e81b400 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1689,6 +1689,7 @@ void domain_unpause_except_self(struct domain *d) domain_unpause(d); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int domain_soft_reset(struct domain *d, bool resuming) { struct vcpu *v; @@ -1726,6 +1727,7 @@ int domain_soft_reset(struct domain *d, bool resuming) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int vcpu_reset(struct vcpu *v) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 0061d7972a..1c0bfd456e 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -467,6 +467,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) break; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_soft_reset: case XEN_DOMCTL_soft_reset_cont: if ( d =3D=3D current->domain ) /* no domain_pause() */ @@ -485,6 +486,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D -EFAULT; } break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_destroydomain: ret =3D domain_kill(d); diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index cf131c43a1..24ef1205c9 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -3962,6 +3962,7 @@ int gnttab_release_mappings(struct domain *d) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void grant_table_warn_active_grants(struct domain *d) { struct grant_table *gt =3D d->grant_table; @@ -4006,6 +4007,7 @@ void grant_table_warn_active_grants(struct domain *d) =20 #undef WARN_GRANT_MAX } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void grant_table_destroy( --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490001; cv=pass; d=zohomail.com; s=zohoarc; b=byONnYl5q7d7RCJCZXqSEb6d0sC96F2rwJGYQDDbd7wYpvEjOvLJOLfJxcuWLDCteXNaJFXyvGAvCGZy5tDxu4Ydc3CIF5qurZG5SyJlQ6rKSJ5d/7z82hHpBR3gV488kpusUVcjHTRodBfQw9k2yPn9LhC5493G6UKKq9m/QAc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490001; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=z6hAYbhVRKjqwBmccO7F1sUrcRPgT0pjyjykY0wxnhw=; b=GACq/BZ3PL1NffxToxXXnndItmf2KwkeEARXUQPuthXLRdzZgodjMtNQS0NRQ604j2K5kvGHrETlGPtfWVvawjbfQXxOSctsLZ75y1wcK8EsHGASwJFyz/K8So1z1RcMWqiYcmj0tL5LHgO1e89rN7dDgK1lVBbjNdfuQj7PiQo= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490001852605.7218406606231; Wed, 10 Sep 2025 00:40:01 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117594.1463724 (Exim 4.92) (envelope-from ) id 1uwFQc-0008SW-4W; Wed, 10 Sep 2025 07:39:42 +0000 Received: by outflank-mailman (output) from mailman id 1117594.1463724; Wed, 10 Sep 2025 07:39:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQb-0008S5-V1; Wed, 10 Sep 2025 07:39:41 +0000 Received: by outflank-mailman (input) for mailman id 1117594; Wed, 10 Sep 2025 07:39:40 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQa-0005yt-Ly for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:40 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2060d.outbound.protection.outlook.com [2a01:111:f403:2413::60d]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 4e968969-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:40 +0200 (CEST) Received: from BYAPR11CA0062.namprd11.prod.outlook.com (2603:10b6:a03:80::39) by DS7PR12MB6287.namprd12.prod.outlook.com (2603:10b6:8:94::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9052.21; Wed, 10 Sep 2025 07:39:36 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::44) by BYAPR11CA0062.outlook.office365.com (2603:10b6:a03:80::39) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:36 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:35 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:21 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 4e968969-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rVUiKKCZz1pwJPp5699W7G7o3EDjcEn0Qww5nhoxmN1sBbsc1tu+L/bDRVqNNfH6FxQOz6vEsVDvOXz4uFovdSdE6waf8fFd0tA/mkyFu8DG0HSOBNz764l4TZCUYsNQBhVI4t37wk1OxBcJJqoYl5Nq/2sr/aWn8h9CWeHdOTewNeVlf6p2WKIgoCn+2/LIhABtmYpTxLAtPx58rquLRBjBXUJg20A+TBSBRpifIKZ7sV0Mek66gxt4QGjBBI2MmCcIqzU/43fk4TUNrE1sQD6wi/FrgUToStrlndx4bu0ZiZ2YQmuZU9YRriH67wihtA9qX53HqaBseJGtvdSncA== 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=z6hAYbhVRKjqwBmccO7F1sUrcRPgT0pjyjykY0wxnhw=; b=szzAevj0MhHlDtgbptDbO0iTa2YqOeiwtcUAfAoAzKUjyIOXIH6y5D1Sl8x3Ifw8HrnvCZj1qUz+xWIJ8ZTe8yKXdZ93NU4UFlaBZgTh9A3Qc6qbJFS2R3yxfwXmjU52gSfZHR9bX13hOexXQlDPZo88GvIo7b/6Iy3ATTgGlt2JEu1DKlWtN86DrzLA5OUs1YQ95ek1UGmR7MWFDn/q+fV56UhQeEaaTb8ADqfXV2D/vzUG34ABU8mZZjqj2ITw1mmXqwV4oC3ltlr3PaZzZX9dYIivxHz+Jh9KsO8va/RxkaoyQ4QYVfCWBjngWUfq3a3M3slUWpbNg6heBVo95g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=z6hAYbhVRKjqwBmccO7F1sUrcRPgT0pjyjykY0wxnhw=; b=mBSKxN87Tp76439btxPWVtaIW/nT5E5s1RaHnR/Q6ZLm5OQLJyMiEL1lkCEcUM4gnU1WpWNBP4hTvfN+fh/7BzoRHOKUlUDuyoNEFyTF28XpJvA1ts0b6pIvWKeFbcCkYi403KpTVaIWqtREGvPpzwkrbg5js7zXAPR/xKYab/M= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 09/26] xen/domctl: wrap domain_resume() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:10 +0800 Message-ID: <20250910073827.3622177-10-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|DS7PR12MB6287:EE_ X-MS-Office365-Filtering-Correlation-Id: d0f8b0d4-1f3d-4f5c-ba3b-08ddf03d30dc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?b2GM+DZx/Bf+CG8Tj43G06F7ac/a8WC6z8W6yER3g17mkfgRZie5ioROLC4s?= =?us-ascii?Q?SIfsvQEOty25H/+/GL1fSy3Gsneb9X3TDlpOqAqmvRTOEShygmY6w3d16qfG?= =?us-ascii?Q?8L7EuGv1WZR3FQ2YYGdiGMo6gslJr9uMkDLrqjRO9SS6Q33ubixvfS/Z1R/r?= =?us-ascii?Q?Q/9KJvolQOPj60v6zzfDkxCU31EGnBXR35ONH1y4AhInm5eL7uXT8CvEAJ14?= =?us-ascii?Q?CQNcsdrp2DLVJs7CA97KgQccU50qkrw7bt2/Zs5HPBNIf3Hnnjx8Hcntf7QC?= =?us-ascii?Q?BIMZlMg8ofFnOZeUOHjsSzDeq9jUpbd/aryA+WD2DiCLQh8LKL968b8lKkUS?= =?us-ascii?Q?UuoRSy+Bd8jV4YALZX7a/nR71zBObXDqPRPsNKvPfohuxGW8pMWo3oNB9sWy?= =?us-ascii?Q?Wt20j9DlIRhe7M2YCpnAU8a9faRSK03CAsn37cAA9IQjLkwkPJKab4r3Zhl9?= =?us-ascii?Q?Xm8mdbmdXZhAtLN5z3nE8uHs1oXKI1e74m4Z7/ryRN88lnS2kcT+YckLRTay?= =?us-ascii?Q?ajaOcI4XyMzqjlz0HMbsigFq/zwzzmtaiiP3qr+z0qtzs6t9RiuCaT4Iwbys?= =?us-ascii?Q?j/bGSIQ5zuuShJ00J4805EOrMhxgtiBlDG91e4IRhfJLjentucvt1lz2Lyxt?= =?us-ascii?Q?JviIvcZholuu/FDG771emVyi/tqBZU4HrMwlXOHUhqgwW+cyu5uN9C/D0tMS?= =?us-ascii?Q?Fh4E0yiJ9p+EzJQqsXq67I59wAQSaUSYdj/TTOPwg/z6CAuZqpJgrNR2/H2h?= =?us-ascii?Q?So/jmf0sP1ZPAR15vaKPvlbijjSp7uiE6+3LT0bTLYkGh9nMs1jvQ0rOHup3?= =?us-ascii?Q?ifPwID+f3eqQ92zVEuE4B92egf3kqYyuKWkrr/FvPydfz8QWL4vChvmJalml?= =?us-ascii?Q?aWHm8GoQRP/EiyCjLvfXT/42R7DGJIGNFRd+vukjt/N8xQz/8Kt3RFl8MYeF?= =?us-ascii?Q?GNxz2L4R6rFBMH3aR0/deqQ+YQnb4Lj+gDFyrzD2u5VZ3ITExnyrGAbH4Qn8?= =?us-ascii?Q?UnuW8VfDP+Gsz9Md00r6hY0akdd+6nEpfUjjT5yetDO2eXW6m1w4wkle0fY3?= =?us-ascii?Q?5HGzj8+g+tAH4NP+lHLm3zkpY3Yr4FePXcov7wHpe2a7HbORMy9TjwEtmOKz?= =?us-ascii?Q?hgzQg5PITXBuP+USZx8Ml6EINR7a0ZmNw/Itisl9xaWb4BBwkqhoYkWwkA3a?= =?us-ascii?Q?0T9/FVh8JXFyAb5W0TpFVIT1dO6xw1dhwEHNgx/JBfu5/clcIvooxCcB7am3?= =?us-ascii?Q?jx7pcWniLxxNfXx/10OfVjSEcXNQwc/L2K1tsJepvQuFLNOej8ky2/l+1cjS?= =?us-ascii?Q?OSpzwUvQPqitZKTThl+liAZZyEoqeaRNrTXVrivgEAMa6YNMkHN4cET9s9X6?= =?us-ascii?Q?oyT71onVLJOBsA7K4yPm44OgtoB03/R09F8nO2+flDA7k1NgTKPJeE/hAcrA?= =?us-ascii?Q?XGaIO13/YhEsnZu2yfijXVbfGHDifFi8TlNpNUhkG+TueDVN1hLi6Kgu1Xmp?= =?us-ascii?Q?TjVkbr2llN942L61y91w6Dcu3x2iqXGBFjZd?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:35.9241 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0f8b0d4-1f3d-4f5c-ba3b-08ddf03d30dc 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR12MB6287 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490003404124100 Content-Type: text/plain; charset="utf-8" One usage of function domain_resume() is in domain resume domctl-op, and the other is in domain_soft_reset(), which is already guarded with CONFIG_MGMT_HYPERCALLS. So we could wrap domain_soft_reset() with CONFIG_MGMT_HYPERCALLS. Wrap XEN_DOMCTL_resumedomain-case transiently with CONFIG_MGMT_HYPERCALLS, = and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - new commit --- xen/common/domain.c | 2 ++ xen/common/domctl.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/common/domain.c b/xen/common/domain.c index 678e81b400..34e2e501dc 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1351,6 +1351,7 @@ int domain_shutdown(struct domain *d, u8 reason) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void domain_resume(struct domain *d) { struct vcpu *v; @@ -1377,6 +1378,7 @@ void domain_resume(struct domain *d) =20 domain_unpause(d); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int vcpu_start_shutdown_deferral(struct vcpu *v) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 1c0bfd456e..278a00b141 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -402,12 +402,14 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) ret =3D domain_unpause_by_systemcontroller(d); break; =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_resumedomain: if ( d =3D=3D current->domain ) /* no domain_pause() */ ret =3D -EINVAL; else domain_resume(d); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_createdomain: { --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490011; cv=pass; d=zohomail.com; s=zohoarc; b=fs2xTkvYcmOBg69s6B5NIyXJFAc1lFehhTxkU0crCMJcC75rhjjipSfd5EwLQEcU+kqdAqEwmpJREHJsC8Ummulgk/OSPoDYETHIV/CNh+tMRaIVhflwsf6Z2F//A+cZhTqeg36PmhtMw7ns+kwqIg2ehe2WuqrwD8kYDmdYVmA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490011; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Tq+CA+zLJhXvuE0ShxLvIZ5qcSI/7xz/3Fi/Dd8+moA=; b=by034IoqZrcbPaHIcamQlC2pQLCRpX9ahJaUWQ0FiAcf3w/VDuh7rjPhbr8q82ZSDxhm6wGEE72+EPmtzouqLwbcG2Pv1x12JhHr0lVEyMQQsERxo1oVZPkkLZXpdWt5xnKzYElxWcg0xR6XLSIBsLDwX2FwxLBobu69UnlwlIc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490011957700.1793162826007; Wed, 10 Sep 2025 00:40:11 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117607.1463745 (Exim 4.92) (envelope-from ) id 1uwFQi-00015P-Ts; Wed, 10 Sep 2025 07:39:48 +0000 Received: by outflank-mailman (output) from mailman id 1117607.1463745; Wed, 10 Sep 2025 07:39:48 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQi-00015B-PK; Wed, 10 Sep 2025 07:39:48 +0000 Received: by outflank-mailman (input) for mailman id 1117607; Wed, 10 Sep 2025 07:39:47 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQh-0005yt-4V for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:47 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20627.outbound.protection.outlook.com [2a01:111:f403:2413::627]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5131ef70-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:44 +0200 (CEST) Received: from BYAPR11CA0058.namprd11.prod.outlook.com (2603:10b6:a03:80::35) by MN0PR12MB6269.namprd12.prod.outlook.com (2603:10b6:208:3c3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:37 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::7e) by BYAPR11CA0058.outlook.office365.com (2603:10b6:a03:80::35) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:37 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:36 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:24 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5131ef70-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TC4uUqyltw5vGItxPZ/zqEYWGhRZHIW8EK7/YP+IrMIHIiT3ftUzhy5em5ZawxvEyp7Z4SIfAbDx30DGK2sl1dyD46hPg6LF9OpS1OrFSwRBHKppMjuqYzpk7YR98eX1JW2o/ZgGLVEpPhAzxT2o+tk/VmQ54AeFv1PGdOlzJOSDGo8r0qZTRq9rBTD2ps59f7EDuq6rDORjoiRZzze/dnCGBA2lnoXl7gceUH3q8MZ4zqaf/+bQzQ5KEfnglMcOa8L0qd6a0boTJudUeNDu1rN3SfGsVW3/Cxozd7r9yumvru83s9twKQcyCoyQhr3TaN6y+bC6AxuU0nvHQN3Tpw== 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=Tq+CA+zLJhXvuE0ShxLvIZ5qcSI/7xz/3Fi/Dd8+moA=; b=qZec2R9DBjkcd4vezsazPqBZgbF2liD9S35kgCa6ycTNzlbwFh0GGazQvUPLB5QwlxvqlLXaBlYSL4MzTq+3RWdNN74O9LDtn9YCvxEer1KhzJv6sXXAZ/gx4Cw+q1GCG28vWoEJccRPEVc//9rIlTmmeYUjRG31RqCli6s/k6YcH5RnKocgEwQ0VKf1jY9CBq8F9nQs0KKauKgGUpNnWivhoVT3zli8mUYGwUN19liDTw3JH7n7EMIoo0Wwvh4WmIhbuFtHSu8XO5o4f/rD6aSTk6cRch8NvxPRnAYP5BrNamQO7jM4xz5+HyvexToUG+O5+uwQNoGOd4H6fZNODQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=Tq+CA+zLJhXvuE0ShxLvIZ5qcSI/7xz/3Fi/Dd8+moA=; b=ty/x+WBkoeJ15Ip2ZTSDEHU3e5nChCBt7wbRXCDoBWb6HiXOvjmD2Cch0NT/PbMrjFy7iFg8/Ru3IO43J8se2kxMfwdTI7Xhyg8RMAFAiddxjt529gTsfm1bMHowylw1c1nW7xb46y6SZTONwpHUWHSDpCUzGWndAd4AMRvc9fU= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Tamas K Lengyel Subject: [PATCH v2 10/26] xen/domctl: wrap domain_kill() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:11 +0800 Message-ID: <20250910073827.3622177-11-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|MN0PR12MB6269:EE_ X-MS-Office365-Filtering-Correlation-Id: 2316dd43-d060-4201-2487-08ddf03d3149 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?fObpvZwNLj+LjZmgBHhLmcdAi2r1N+RFqoUcqT9V5kyPt7V9b5gmM9hGlcNx?= =?us-ascii?Q?pN/QCF/qD+mPETgUOJhFBDxahRnyx/KXqowKNQIPnJ34U2Co7XPMxRbI7sCR?= =?us-ascii?Q?ctiLlcJagsrNNmFS4EUcL+7EU5LFRfxPdoPwlBROsolA8BkOvbWsGq6IdpQZ?= =?us-ascii?Q?Zq12/hPKoX/klFUZDH6v3bx2G6sWp1jMdR6hBXsKK21ktnIXJ3KD4dW9HXZ6?= =?us-ascii?Q?5ZO0Vdh0ss53BAfO5miythUV95Ll0FAV08iL4CLmGkYXNIvFA3hNEuNbpBlh?= =?us-ascii?Q?wQrGuYcGGQKEjphDGipN8h3h+x/rwSS0x4jnv6yexXlxVIvuSuawpd60+5RZ?= =?us-ascii?Q?TRx3YGbSsAT0hC+V1lsBPeEo54vUO7Ihtu3dVeM14tP5hnSlJJb61kpMh3Wt?= =?us-ascii?Q?nyMC6cbkEYLAmuw9o8dcpxBBVN8lGaa4TNXuGlDmdNtgOfgmfggJMra+eRiQ?= =?us-ascii?Q?dzKmVLVNVJ9N0hwdD/t7Bpsa+PMcx1w7sQG7FmP5tzqw3xZKSe1/ssJdhNvT?= =?us-ascii?Q?ifcgIAor04qMs6lEoDoRwoGIjsQ8uAbdu8BME5KXHET1cnLwSNN6j+1MEjUb?= =?us-ascii?Q?MVFvYJTUXrwePqCQZnwORU/RWxcTV/DK5e5gtHmiZYWLdwNDxtTgGqi8PAyJ?= =?us-ascii?Q?bYuk+dqHbFqycIrxvEmmQKbxVdP+hb56hnzdSHYj0VDHOXCc2BcQXl03DNcx?= =?us-ascii?Q?u+6UhxxZm1lEc1SBw68guk3PUVnbeKabNL1JtkOnxUV3jL88iwV3quFnQdtp?= =?us-ascii?Q?IyyYnN/D+MWpxP+V2c88hxE4OQOgRZ1l0+QbU+MNu5SZTd16WLqJ6ErP4+VO?= =?us-ascii?Q?3A6+rDfJnKm7mtJEwlVxpBBq+gFwPD678yOB//y1kM0HP0nvs3ktf7FeOnKU?= =?us-ascii?Q?l5WjpIfeXmnd6e3g643/6KIsxoCv8BoKdu5pYbST7tRUt3K7KYfeieDaubwf?= =?us-ascii?Q?JTgidCY3HW5vdohFcOpMVzIHAB9zhb4e4GkidtsZowkO2d+zI1PuPBUHEd7y?= =?us-ascii?Q?Y8Csa3Hga3uu7qShfVINXdzuEWdLmYacLRi85BEIyEInci+5Bcjuoqk6Nwit?= =?us-ascii?Q?hOI59Er06sZpzGge69LhJG7L6PL9jlRehrPhSbMHwbN9lGWnjHfnTOANv3/q?= =?us-ascii?Q?mDDUecP1ywQGUgGwiIVItF01FsOQatD97nt1EH5J7X6vd3SOnWUB2tgYAdwm?= =?us-ascii?Q?SF2pYwRxWDO1GcNIvzWbEbvu2O19D9jRGWNVQrG7ki9WysI38tjTJRPjZsTl?= =?us-ascii?Q?vpUyD/KZ/ADwH/etXmNOsgXeDHK45K8Iv9t57BH2j8lFKyR8NysMgExtNKpf?= =?us-ascii?Q?C95QFQpCMWr0IJ6bZ9Z/YIUbbJNkwEisd74QshNqj1MdYzfP/CiOJL+A4HQ4?= =?us-ascii?Q?TFXX4BkpZXxd8fH18IRdLW72md3WXPka86i+JrHtPtCDzYco7yPWaWw5ejxH?= =?us-ascii?Q?ACZUgn3l8X0tIIrk4Vi98m8ERiHPehvjSoJGFMJemBLW5DjHdaq7G6gyKMu4?= =?us-ascii?Q?dZkBLRjFI29OjqQgmyuaT5R5gTJPlcDczKLw?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:36.6289 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2316dd43-d060-4201-2487-08ddf03d3149 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6269 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490013733124100 Content-Type: text/plain; charset="utf-8" Function domain_kill() is responsible for killing domain and relinquish domain-held resources. and it is only invoked under XEN_DOMCTL_destroydomain-case. So it shall be wrapped with CONFIG_MGMT_HYPERCALLS. Tracking its calling chain, the following functions could also be wrapped w= ith CONFIG_MGMT_HYPERCALLS: - domain_relinquish_resource - pci_release_device - relinquish_shared_pages - paging_teardown - p2m_pod_empty_cache - relinquish_memory - pit_deinit - iommu_release_dt_devices - tee_relinquish_resources - ffa_relinquish_resources/optee_relinquish_resources - relinquish_p2m_mapping - p2m_clear_root_pages Wrap XEN_DOMCTL_destroydomain-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_destroydomain-case transiently --- xen/arch/arm/domain.c | 3 +++ xen/arch/arm/include/asm/tee/tee.h | 2 ++ xen/arch/arm/mmu/p2m.c | 4 ++++ xen/arch/arm/mpu/p2m.c | 2 ++ xen/arch/arm/tee/ffa.c | 4 ++++ xen/arch/arm/tee/optee.c | 4 ++++ xen/arch/arm/tee/tee.c | 2 ++ xen/arch/x86/domain.c | 2 ++ xen/arch/x86/emul-i8254.c | 2 ++ xen/arch/x86/mm/mem_sharing.c | 2 ++ xen/arch/x86/mm/p2m-pod.c | 2 ++ xen/arch/x86/mm/p2m.c | 2 ++ xen/arch/x86/mm/paging.c | 2 ++ xen/common/domain.c | 2 ++ xen/common/domctl.c | 2 +- xen/drivers/passthrough/device_tree.c | 2 ++ xen/drivers/passthrough/pci.c | 2 ++ 17 files changed, 40 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c index 30ff9dac46..3e7f40ab01 100644 --- a/xen/arch/arm/domain.c +++ b/xen/arch/arm/domain.c @@ -995,6 +995,7 @@ int arch_vcpu_reset(struct vcpu *v) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int relinquish_memory(struct domain *d, struct page_list_head *list) { struct page_info *page, *tmp; @@ -1145,6 +1146,8 @@ int domain_relinquish_resources(struct domain *d) =20 #undef PROGRESS =20 +#endif /* CONFIG_MGMT_HYPERCALLS */ + void arch_dump_domain_info(struct domain *d) { p2m_dump_info(d); diff --git a/xen/arch/arm/include/asm/tee/tee.h b/xen/arch/arm/include/asm/= tee/tee.h index 15d664e28d..f4187c5dc3 100644 --- a/xen/arch/arm/include/asm/tee/tee.h +++ b/xen/arch/arm/include/asm/tee/tee.h @@ -40,12 +40,14 @@ struct tee_mediator_ops { int (*domain_teardown)(struct domain *d); void (*free_domain_ctx)(struct domain *d); =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * Called during domain destruction to relinquish resources used * by mediator itself. This function can return -ERESTART to indicate * that it does not finished work and should be called again. */ int (*relinquish_resources)(struct domain *d); +#endif =20 /* Handle SMCCC call for current domain. */ bool (*handle_call)(struct cpu_user_regs *regs); diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c index 51abf3504f..30d6071e91 100644 --- a/xen/arch/arm/mmu/p2m.c +++ b/xen/arch/arm/mmu/p2m.c @@ -1243,6 +1243,7 @@ static void p2m_invalidate_table(struct p2m_domain *p= 2m, mfn_t mfn) p2m->need_flush =3D true; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * The domain will not be scheduled anymore, so in theory we should * not need to flush the TLBs. Do it for safety purpose. @@ -1262,6 +1263,7 @@ void p2m_clear_root_pages(struct p2m_domain *p2m) =20 p2m_write_unlock(p2m); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Invalidate all entries in the root page-tables. This is @@ -1556,6 +1558,7 @@ int p2m_init(struct domain *d) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * The function will go through the p2m and remove page reference when it * is required. The mapping will be removed from the p2m. @@ -1626,6 +1629,7 @@ int relinquish_p2m_mapping(struct domain *d) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Clean & invalidate RAM associated to the guest vCPU. diff --git a/xen/arch/arm/mpu/p2m.c b/xen/arch/arm/mpu/p2m.c index f7fb58ab6a..c44297a9e3 100644 --- a/xen/arch/arm/mpu/p2m.c +++ b/xen/arch/arm/mpu/p2m.c @@ -57,10 +57,12 @@ bool p2m_resolve_translation_fault(struct domain *d, gf= n_t gfn) =20 void p2m_flush_vm(struct vcpu *v) {} =20 +#ifdef CONFIG_MGMT_HYPERCALLS int relinquish_p2m_mapping(struct domain *d) { return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void p2m_domain_creation_finished(struct domain *d) {} =20 diff --git a/xen/arch/arm/tee/ffa.c b/xen/arch/arm/tee/ffa.c index 1d0239cf69..f9ba9b60bf 100644 --- a/xen/arch/arm/tee/ffa.c +++ b/xen/arch/arm/tee/ffa.c @@ -469,10 +469,12 @@ static void ffa_free_domain_ctx(struct domain *d) XFREE(d->arch.tee); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int ffa_relinquish_resources(struct domain *d) { return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void ffa_init_secondary(void) { @@ -623,7 +625,9 @@ static const struct tee_mediator_ops ffa_ops =3D .domain_init =3D ffa_domain_init, .domain_teardown =3D ffa_domain_teardown, .free_domain_ctx =3D ffa_free_domain_ctx, +#ifdef CONFIG_MGMT_HYPERCALLS .relinquish_resources =3D ffa_relinquish_resources, +#endif .handle_call =3D ffa_handle_call, }; =20 diff --git a/xen/arch/arm/tee/optee.c b/xen/arch/arm/tee/optee.c index 5151bd90ed..1ed0fd231d 100644 --- a/xen/arch/arm/tee/optee.c +++ b/xen/arch/arm/tee/optee.c @@ -632,6 +632,7 @@ static void free_optee_shm_buf_pg_list(struct optee_dom= ain *ctx, cookie); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int optee_relinquish_resources(struct domain *d) { struct arm_smccc_res resp; @@ -693,6 +694,7 @@ static int optee_relinquish_resources(struct domain *d) =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 #define PAGELIST_ENTRIES_PER_PAGE \ ((OPTEE_MSG_NONCONTIG_PAGE_SIZE / sizeof(u64)) - 1) @@ -1727,7 +1729,9 @@ static const struct tee_mediator_ops optee_ops =3D .probe =3D optee_probe, .domain_init =3D optee_domain_init, .domain_teardown =3D optee_domain_teardown, +#ifdef CONFIG_MGMT_HYPERCALLS .relinquish_resources =3D optee_relinquish_resources, +#endif .handle_call =3D optee_handle_call, }; =20 diff --git a/xen/arch/arm/tee/tee.c b/xen/arch/arm/tee/tee.c index 8501443c8e..a8e160700f 100644 --- a/xen/arch/arm/tee/tee.c +++ b/xen/arch/arm/tee/tee.c @@ -65,6 +65,7 @@ int tee_domain_teardown(struct domain *d) return cur_mediator->ops->domain_teardown(d); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int tee_relinquish_resources(struct domain *d) { if ( !cur_mediator ) @@ -72,6 +73,7 @@ int tee_relinquish_resources(struct domain *d) =20 return cur_mediator->ops->relinquish_resources(d); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 uint16_t tee_get_type(void) { diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 5b3c5e8caf..314de75d8e 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -2298,6 +2298,7 @@ void sync_vcpu_execstate(struct vcpu *v) read_atomic(&v->dirty_cpu) !=3D dirty_cpu); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int relinquish_memory( struct domain *d, struct page_list_head *list, unsigned long type) { @@ -2622,6 +2623,7 @@ int domain_relinquish_resources(struct domain *d) =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void arch_dump_domain_info(struct domain *d) { diff --git a/xen/arch/x86/emul-i8254.c b/xen/arch/x86/emul-i8254.c index 144aa168a3..f106ab794c 100644 --- a/xen/arch/x86/emul-i8254.c +++ b/xen/arch/x86/emul-i8254.c @@ -651,6 +651,7 @@ void pit_init(struct domain *d) pit_reset(d); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void pit_deinit(struct domain *d) { PITState *pit =3D domain_vpit(d); @@ -664,6 +665,7 @@ void pit_deinit(struct domain *d) destroy_periodic_time(&pit->pt0); } } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 4787b27964..d7cbf2047b 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1393,6 +1393,7 @@ int __mem_sharing_unshare_page(struct domain *d, return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int relinquish_shared_pages(struct domain *d) { int rc =3D 0; @@ -1449,6 +1450,7 @@ int relinquish_shared_pages(struct domain *d) p2m_unlock(p2m); return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int range_share(struct domain *d, struct domain *cd, struct mem_sharing_op_range *range) diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c index 05633fe2ac..4e915808f4 100644 --- a/xen/arch/x86/mm/p2m-pod.c +++ b/xen/arch/x86/mm/p2m-pod.c @@ -366,6 +366,7 @@ void p2m_pod_get_mem_target(const struct domain *d, xen= _pod_target_t *target) pod_unlock(p2m); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int p2m_pod_empty_cache(struct domain *d) { struct p2m_domain *p2m =3D p2m_get_hostp2m(d); @@ -409,6 +410,7 @@ int p2m_pod_empty_cache(struct domain *d) unlock_page_alloc(p2m); return p2m->pod.count ? -ERESTART : 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int p2m_pod_offline_or_broken_hit(struct page_info *p) diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index e2a00a0efd..c1a87cde27 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -2097,6 +2097,7 @@ int xenmem_add_to_physmap_one( return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * Remove foreign mappings from the p2m, as that drops the page reference = taken * when mapped. @@ -2160,6 +2161,7 @@ int relinquish_p2m_mapping(struct domain *d) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void p2m_log_dirty_range(struct domain *d, unsigned long begin_pfn, unsigned long nr, uint8_t *dirty_bitmap) diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 65455a6867..116389d4e9 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -768,6 +768,7 @@ void paging_vcpu_teardown(struct vcpu *v) shadow_vcpu_teardown(v); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* Call when destroying a domain */ int paging_teardown(struct domain *d) { @@ -794,6 +795,7 @@ int paging_teardown(struct domain *d) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* Call once all of the references to the domain have gone away */ void paging_final_teardown(struct domain *d) diff --git a/xen/common/domain.c b/xen/common/domain.c index 34e2e501dc..5d81ab3045 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1230,6 +1230,7 @@ int rcu_lock_live_remote_domain_by_id(domid_t dom, st= ruct domain **d) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int domain_kill(struct domain *d) { int rc =3D 0; @@ -1280,6 +1281,7 @@ int domain_kill(struct domain *d) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 =20 void __domain_crash(struct domain *d) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 278a00b141..0f20e8941b 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -488,7 +488,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D -EFAULT; } break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_destroydomain: ret =3D domain_kill(d); @@ -496,6 +495,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D hypercall_create_continuation( __HYPERVISOR_domctl, "h", u_domctl); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_setnodeaffinity: { diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthroug= h/device_tree.c index f5850a2607..015ffa15d4 100644 --- a/xen/drivers/passthrough/device_tree.c +++ b/xen/drivers/passthrough/device_tree.c @@ -108,6 +108,7 @@ int iommu_dt_domain_init(struct domain *d) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int iommu_release_dt_devices(struct domain *d) { const struct domain_iommu *hd =3D dom_iommu(d); @@ -136,6 +137,7 @@ int iommu_release_dt_devices(struct domain *d) =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int iommu_dt_xlate(struct device *dev, const struct dt_phandle_args *iommu_spec, diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 3edcfa8a04..cd855108c2 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -945,6 +945,7 @@ static int deassign_device(struct domain *d, uint16_t s= eg, uint8_t bus, return ret; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int pci_release_devices(struct domain *d) { int combined_ret; @@ -1003,6 +1004,7 @@ int pci_release_devices(struct domain *d) =20 return combined_ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 #define PCI_CLASS_BRIDGE_HOST 0x0600 #define PCI_CLASS_BRIDGE_PCI 0x0604 --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490386; cv=pass; d=zohomail.com; s=zohoarc; b=GbvkeELJp75YVO2ZB/4Q5pNr0eE8dy+9Bbhc1W2XreY/N5RfBQ1FB1RectXbXZRGUUbJHrGj2brzBUksVrDiUO+F161ICo9GeeckXu0e5CnQoGYLdg4WSKQ1A5Uimunea0GV2w6weUIngR2PamVPjqrdTbR7u33vOBvyDq8MOoQ= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490386; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ObH7PSMMf5VmUwx5E3g8pzKJFZIPGuXzQ+wIgiA+LvA=; b=WcHVkbMdlEkTtFCuRiXmGCtX+l8kaCBMlR00HzKki86ggzbW75XXAzyF0obw1pAaAxrzP7kWyBenNHwrFw6ziRnU8XHOcX4Asx/1nwhYv4vHITHYAeZa1ZBQn/RlKAMB3d0G0WWjQlV1jTfI6ABVQgkzJ7/T5gdkYWuW5lBso+Y= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490386564906.3109412393413; Wed, 10 Sep 2025 00:46:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117675.1463780 (Exim 4.92) (envelope-from ) id 1uwFWr-00052p-KT; Wed, 10 Sep 2025 07:46:09 +0000 Received: by outflank-mailman (output) from mailman id 1117675.1463780; Wed, 10 Sep 2025 07:46:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWr-000528-Fg; Wed, 10 Sep 2025 07:46:09 +0000 Received: by outflank-mailman (input) for mailman id 1117675; Wed, 10 Sep 2025 07:46:08 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQe-0005yo-DD for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:44 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20603.outbound.protection.outlook.com [2a01:111:f403:2413::603]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5000c6ac-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:42 +0200 (CEST) Received: from BYAPR11CA0052.namprd11.prod.outlook.com (2603:10b6:a03:80::29) by IA4PR12MB9761.namprd12.prod.outlook.com (2603:10b6:208:550::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:38 +0000 Received: from SN1PEPF000252A1.namprd05.prod.outlook.com (2603:10b6:a03:80:cafe::e6) by BYAPR11CA0052.outlook.office365.com (2603:10b6:a03:80::29) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:38 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A1.mail.protection.outlook.com (10.167.242.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:37 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:27 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5000c6ac-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HcaZHxMRnZA8Y/4pmRABLQd8vd2H2gqTLuqoJvPbL+TJxyjpqhb6B1Y9km4KFuDskGEAbYCHR85dfwFFFQx367oSZGAhlWR0YLvOiWI4qg78V1jvcqemZ7FiByw+xiOKm1LiaLXyk0eNBxF8Jk4MiO+cEGw0WmU3DyLZMGcHUvVPGlH1UZUkIFUnxq2+LUEM2zZcn0cilyHUHYfTuD9e/DSkAFQcAJqa9gIQenRJKIokmp3v6Sj6fZ8/gQ6ITJUIpVLOC8yslrVUslIG+a+l4bWmmWVNQUca6TXwqD3WeOfn3CzOeWFAkDfddMgeLm3kw+PUUhVYwoM7tbewWzHK9w== 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=ObH7PSMMf5VmUwx5E3g8pzKJFZIPGuXzQ+wIgiA+LvA=; b=U6TYwA5r/FnHLTVPCed+D46kPFYZQOTUvfAnNAa6Bu9ssjadQAOu2RYySyGZtDXGCjqSA7ZVHwlyHGd1znRHchG/AW+gb2VevBRwatmPUsCjP8tR9///SaaAAvyOVG2pmBS7MD956a88IcVb+xkKVqNf0UuXe3VY1cyzeQezIjfaVTFtvmjt1yDOPnKXsA/SHKU0b/pAa/Iy1yfPcwJDTetW9tjz/pXMfJvMQ97/wNbO2bYE1eAaV2j7sqYcvxR4KfFTD6bPBs+bpclJLgqrVQLL3zOP0ux9gQqiftUq4Lojlgn7Ve1InqBQF00bTts8LwbjQv367nBlE5aQdc5MtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=ObH7PSMMf5VmUwx5E3g8pzKJFZIPGuXzQ+wIgiA+LvA=; b=xxIuk57nC4L/W+Sw1bmBZuiIy0fd7ipZpvY/eMdov+1JKglbv9H3k2mZ3Mdj5zJF2fpeQcXk8alc9OhD99gUYh68PJJHv/pHjr++k340zbTEZKQSoCEms+oezXFpXGpSCzkskKlJrtsOxS4LQOiO6fd6LTrTouAxRTqWjvlj9Jc= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 11/26] xen/domctl: wrap domain_set_node_affinity() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:12 +0800 Message-ID: <20250910073827.3622177-12-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A1:EE_|IA4PR12MB9761:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b679de5-b022-408a-6c6c-08ddf03d3204 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?h71nJG8hkgIj2M9OKNziahRWDkFZ8qURrrhXsaAYPzC8qnfSgKauYMFxHhod?= =?us-ascii?Q?iIZL1bzVDmrQtmah3oJPekReRxkb8YI0FW9Ccg6pE1Y8s7aj1Qe1hCgcRX11?= =?us-ascii?Q?4x1Z6q863272xD9oIjGD0RccqxGEqYXBKUWKhn5d2K+tEX8IVcUPQIAUafAB?= =?us-ascii?Q?JLu8rgJrPXZFwewHftb3KcTvtJGjmJ1UQtPiK/jsXXqdGf6LMJMiXgCPQeSe?= =?us-ascii?Q?5O7DXzYU3boqlIlSk5lnCSVLPb5ZxWFg9wevqdoH/CIUjiO5Tfv82Wt9/XfJ?= =?us-ascii?Q?GSeh+FKTEvdRs/+9w3XCLW/uAsTt8ExATq7zGVAQVBLuq8BSrFL2osMK+eGF?= =?us-ascii?Q?C+pDcgh9i1f4xChJc8oafUyYYe7UQc3VJDGWjEaW3wJHr2bgXm002Hei4VNJ?= =?us-ascii?Q?h9qDDw1dA7W4E+ZNhzBy0zF7xEwR3rBegLZSllq8d0txA8fXJztiLpdgWjJc?= =?us-ascii?Q?BRP73Qc0P4XQdBaHRFYbDO8H9LI8HX6JU+YpUTEbsifuBD75DPJ0aB4uh6KP?= =?us-ascii?Q?flUI9mFK5d6vVvm8a9MxlT5LmIiXopoZxuuARjzOz8yUrWdxthcDzIAbtuWp?= =?us-ascii?Q?OkN+tjJ8UqSxrIj1gQcwVvLLrouTdl6pj5Lk/4Xbd7n+kJXthO3Z1aMpJvUR?= =?us-ascii?Q?s3wd1ySuGPHkgyQ9eL0em4fD0EnIwj4i8aisku2pAzTwgeOsNMm/iV10eKx7?= =?us-ascii?Q?H8nYB/mRGXyx3gzvvgSSxAsXTpS4U5RcZoSlUSBm03jmeLdQx5bKB/jJh+wI?= =?us-ascii?Q?4tozkoS8UDUCGKo8PA8Sa06482K09pCM00gluMMq/riXJd3WkU5bGNqqJvUz?= =?us-ascii?Q?sRQeBwOIjdZJ2jUfI/85s+4nCbQAXLWJOOR3JKF2jw6S0NpptChUSltCVO20?= =?us-ascii?Q?tpI09zJIRgU7zokxc1+3BL/jDcma05IQRmBQq0Gnk0DdiwWO/iu+Zq7W3hsF?= =?us-ascii?Q?HB+2TzmL3drldYZUQ56uIj5nDlIk3X40n/jr737aoi5hiUarhYBoBnxikf+p?= =?us-ascii?Q?6/xkGHfsD0LmIuKEpZAgu7Ide/eHbJ+u1cxAcER5VYoDnPhyNxeTFv0Pt/7O?= =?us-ascii?Q?7RThJ6sURKbPmAJt+Q48s1tgykM/AQQdLD5VKC1GEBgR2yt0m/mv8sXNS/Aj?= =?us-ascii?Q?ooInXOqZpGyLccU8i1LktbVJQ3SspbJOL1RgTUQ1NmJdAiZxpdrGgu+FyBPp?= =?us-ascii?Q?0MSINtsyU4QjFzp0Clp6hBuxy8b803uwsGFXatwCTzRRUvqKTvzqd58IK/Vd?= =?us-ascii?Q?n4F7vcxPWXaKdbyIya0R9gb5YH4nBJ+4KAKOJ1JzbWEhiSd+AhTzlrljdNgV?= =?us-ascii?Q?LG4/08mQXAGkftKxRUn049Aht/8F01IttBO791hCeo7zj2B+1ZJGRwtMlvg1?= =?us-ascii?Q?7akO0NeRMEDYKIl4R4/QJW7qfw2kDJkIpH1lkzFiPDxpBPvV177Rm4W/m6Zh?= =?us-ascii?Q?kYh8ZwzIdKpaj0IlCN0MkkTaQiI/HDAgORu04vCxwaBzN4ZgV4qTh0AhhKfi?= =?us-ascii?Q?GarTOafHUVLjliLtyg9a/kgkzeSxE3pWYABW?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:37.8617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1b679de5-b022-408a-6c6c-08ddf03d3204 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A1.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA4PR12MB9761 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490389562124100 Content-Type: text/plain; charset="utf-8" Function domain_set_node_affinity() is responsible for XEN_DOMCTL_setnodeaffinity domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Wrap XEN_DOMCTL_setnodeaffinity-case and xenctl_bitmap_to_nodemask() transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_setnodeaffinity-case and xenctl_bitmap_to_nodemask() transiently --- xen/common/domain.c | 2 ++ xen/common/domctl.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/xen/common/domain.c b/xen/common/domain.c index 5d81ab3045..6778dc388c 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -1105,6 +1105,7 @@ void __init setup_system_domains(void) #endif } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int domain_set_node_affinity(struct domain *d, const nodemask_t *affinity) { /* Being disjoint with the system is just wrong. */ @@ -1133,6 +1134,7 @@ out: =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* rcu_read_lock(&domlist_read_lock) must be held. */ static struct domain *domid_to_domain(domid_t dom) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 0f20e8941b..fb6fe90888 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -44,12 +44,14 @@ static int nodemask_to_xenctl_bitmap(struct xenctl_bitm= ap *xenctl_nodemap, MAX_NUMNODES); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int xenctl_bitmap_to_nodemask(nodemask_t *nodemask, const struct xenctl_bitmap *xenctl_no= demap) { return xenctl_bitmap_to_bitmap(nodemask_bits(nodemask), xenctl_nodemap, MAX_NUMNODES); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info) { @@ -495,7 +497,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D hypercall_create_continuation( __HYPERVISOR_domctl, "h", u_domctl); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_setnodeaffinity: { @@ -507,6 +508,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D domain_set_node_affinity(d, &new_affinity); break; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getnodeaffinity: ret =3D nodemask_to_xenctl_bitmap(&op->u.nodeaffinity.nodemap, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490409; cv=pass; d=zohomail.com; s=zohoarc; b=GNwvrjtroorjJoPchonjSGcJxctyzHUFPmCTiACsiz2W8mLYX5qvEBOFwcdzDyojvCXWBVCK8tojNff/RmDrfpB0lOocUEu4T8Fz6GBKFL2NXICHLhUYHYtkrbl4m9bLxT2zVISM4TWC+jfsespL1n9M4D+Yxu6NefriI1M5Mdo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490409; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OsGNmKsA7MnLndfkk3jVWl+tKOtl00t7vTpYsq/iVrE=; b=XVRc1ZH+3K8EZ+TUSH9+wrzLpwf13BDZM5aM+YQJcCrPB04PgwOOxR/6AmSHO2iPrdnWeI1M1CJ5A5RuFp0lMewBB1xkf1gmhuL/YnRdraVFGt2tqiP3v2fkpbatR9Z+D22iJj3JpVDqphWUxMa383S0q26RGyML0N+l53p3ZxI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490409117922.4536021398842; Wed, 10 Sep 2025 00:46:49 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117712.1463835 (Exim 4.92) (envelope-from ) id 1uwFX6-00075o-5g; Wed, 10 Sep 2025 07:46:24 +0000 Received: by outflank-mailman (output) from mailman id 1117712.1463835; Wed, 10 Sep 2025 07:46:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFX5-00074G-NZ; Wed, 10 Sep 2025 07:46:23 +0000 Received: by outflank-mailman (input) for mailman id 1117712; Wed, 10 Sep 2025 07:46:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQh-0005yo-BN for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:47 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20605.outbound.protection.outlook.com [2a01:111:f403:2414::605]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 52390e34-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:45 +0200 (CEST) Received: from BYAPR02CA0060.namprd02.prod.outlook.com (2603:10b6:a03:54::37) by BN5PR12MB9512.namprd12.prod.outlook.com (2603:10b6:408:2ab::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:40 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::99) by BYAPR02CA0060.outlook.office365.com (2603:10b6:a03:54::37) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:39 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:39 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:30 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 52390e34-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=j0IADLjTF2hQNtbP7VLUexv8SFMDBIEj57AGL6nctRjYqJ4xFe+voGhXP4br57CJdpfM26s8eKpVL+tdJUjGvHP5TLfUyrZpjoJGoL3y2xPfR/VBzuAZ1dfSXNrWG8xM9YishBQaieDMOl2lwq3pAH1pCHAfOk7PGApCDOKu2vHUPZE3qvPjZZno+++64l1YuvBNMwRhky3lnJsMlKg6UO3NJ62n2Gdz4bTwzA3RGdYUswUsZY7XtAI6kGQjBCEnqeg7OAx1m5qdIYf33hiN7yzC0mYfLkVBfsaZ6NwqC1/ExvAGa9Y0v6haBBVuAugapdrNHDKDEzEU9r7z3dP9aA== 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=OsGNmKsA7MnLndfkk3jVWl+tKOtl00t7vTpYsq/iVrE=; b=igr2VSw/S59+HvmSF0YJ+TuYKPHn0aoAaWn+6QUbpTLgmkXjgfv/VjhK6UYhFbth72gKPO4NvxDrDSU+Js4ywMQEV7XD9CDLl011F9af9uJtcP3JMsC8Y32XNDB1SI03DSzq7rqDxFjuIOTSOMvtvvNG92YUoAaHQPxJnxsETPXGnz+zmH8L9dA8dFtHgPz9lWal2D4Cx3mneE+E8DbfwgvN9zk38lvJeQzy13cIkhfZu9oysuILJzxIngSEhhYg2ny9L23UE8eJFJs5KMFXZnsbxLi5Pc3sI+krVsbhVksOe2vL4LIAbJV9SrBL2ZHErknEDi7n9IOC1Lm8xGT8cg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=OsGNmKsA7MnLndfkk3jVWl+tKOtl00t7vTpYsq/iVrE=; b=5VBvpJ4KoHWlsFVZgm6lza9h6TzsACHvn4GnALNJvmRMXr8509gwTVusK97CR7ZwIQndTYalhczdQ8IBHgSjMZ10Tc28SGmAqVLfd+TrhrXfj/8Ma5B69ZjbZg86l/dNA0m7L8p9v2y4TT1uuLuQZo3Zo4OkLitwXrV1Rh+Ony4= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Dario Faggioli" , Juergen Gross , George Dunlap Subject: [PATCH v2 12/26] xen/domctl: wrap vcpu_affinity_domctl() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:13 +0800 Message-ID: <20250910073827.3622177-13-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|BN5PR12MB9512:EE_ X-MS-Office365-Filtering-Correlation-Id: 41560ebf-acfc-47c9-df87-08ddf03d32b5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|376014|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qWWIPjdjrt1VFiauJmjTEZNX66fkHHxdG3VYx5ceRn2/FyyxAfPP6Z/c6bf7?= =?us-ascii?Q?9tbe7mcLOJFaebMfw8nmzeCb2vKJn5d1+TsjH5+dPnzD2HN2zZc+37jbj6RS?= =?us-ascii?Q?wq+R1uMhLSN6VZYwtXorm56Bj3EEP23hBW7EI7v5djWY0JyWkcqDowLe+Fuu?= =?us-ascii?Q?vRTHwZJ+2doVQXioanEdUL2r6BnnIORAHlk1UoWxH7SxRM3TJPFnVELkg/K9?= =?us-ascii?Q?6ol3IjV6Y6eVfLbJ2okwnoY8ZctWzibfb1TiPPloKdNq0zQhxtn7sZPwJ9Lf?= =?us-ascii?Q?pW8Wnf5wPUUKxe6e6Jd/kzuM7n06+RUN8KPdtLdwQgeSLzfER9+c3qwl44yZ?= =?us-ascii?Q?xzEr+78gXD75Xft7d9M5q9pAWwNMf3kYY2rrJodsbbFMvZQ4BSM/pYYjDSQM?= =?us-ascii?Q?nEUREymbBvho++xChpWA555+4491OcZW658NOZ+HFfZ8MeOy/QfXzUMxxqR7?= =?us-ascii?Q?qjhspg7F3ejsP9oIpTFP9nH7c21HqeMyCKhoxd5ExH8PymAJitTzxZtDF+Nz?= =?us-ascii?Q?ehOJWpktpQfk1KMiLqYED75n20DLRBLMdFW32NRR80QvtdYmTdyi5XUl6cs8?= =?us-ascii?Q?AIgr6UEISc5PjIdfo+l20oblyQh9Y/PNJB4j2G5UPuc4KELDy+SjPiC6bUY2?= =?us-ascii?Q?/3+acWyUYlXSIi3GD/G6M7lFt8k3JA4cCpsD5nduC8RNE3zSz20DIrB6Payv?= =?us-ascii?Q?ezcXugfZlprOl6PLIk+UVy5yCwt8PQmbpzl2jT6hTCy/A+nnTHSv9+v+ywbO?= =?us-ascii?Q?GacdVCeyEvOycXZMkYAReC0AKhCBwrCwT8h/XMDvUqv8c6A/PnXzJFSbYolY?= =?us-ascii?Q?WokNhb3m4k4iCY623I8mAX0RoVWMqDuBJtzuPCY/aY3JwMYHMiDsm0PyiEY4?= =?us-ascii?Q?PgDipwMAy4y/qZq+zIvYCJIMXoLTDcH9aa3lej/sI3LPGahRf0BPjBq65Zww?= =?us-ascii?Q?0/zZi0pQKWFR7qUbL8+1Gl5MhU392O3Rdy2I+5lGzjJ9j+3nDp3UKRg94p22?= =?us-ascii?Q?UnF996kzvNzuKVdEZwNl6vZzWOS2onae2JP00qcXwlSzD3r2CHOJiq/Pfoaw?= =?us-ascii?Q?+xxE7DVTw3SgsMdlr4IAu6RFjBRagFZB/Pw98zJdky8Pwk9vYpL3s4qhm2FE?= =?us-ascii?Q?0ksK52/czavVqz8bSUUtZnxENk0yXf6Xl4Dx1i1d61A//2DnWXDRwSA4JEgq?= =?us-ascii?Q?nP2ys/7DrNRKKsnR8vBW8TgPvYhOHdzv2+is40pR4rqzzLOa0eSM0Ta1dtOP?= =?us-ascii?Q?j8NOroyt/ygsLNgVrpECHaoncVWESx546VGcb39BCTrJKBKS3Apf5B0wtpO4?= =?us-ascii?Q?FnzAk3o3voC3QI1xfxQ+glnoMk9ttXOyyIwGS9FNICs+YaoHpD4R7Rt3razQ?= =?us-ascii?Q?GEDOsxwP14hSTNN6oDDUSu6k4kr2uHkktqLWNF8FD118TNBiRot7DiVznJcB?= =?us-ascii?Q?Mv33G92zbbuYLuHbU+3XlmWZu0DkPYkBwPNKpGkXaUA7hVztG/YtVA4akalm?= =?us-ascii?Q?WEWtXqOdUVwCcFiVCQ1fEw4n76jGZWAVTOW9?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(376014)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:39.0195 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 41560ebf-acfc-47c9-df87-08ddf03d32b5 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN5PR12MB9512 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490411823124100 Content-Type: text/plain; charset="utf-8" Function vcpu_affinity_domctl() is responsible for XEN_DOMCTL_{getvcpuaffinity,setvcpuaffinity} domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS. Tracking its calling chain, the following function shall be wrapped with CONFIG_MGMT_HYPERCALLS too: - vcpu_set_soft_affinity Wrap XEN_DOMCTL_{getvcpuaffinity,setvcpuaffinity}-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_{getvcpuaffinity,setvcpuaffinity}-case transiently --- xen/common/domctl.c | 2 ++ xen/common/sched/core.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index fb6fe90888..4a35c17060 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -515,10 +515,12 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) &d->node_affinity); break; =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_setvcpuaffinity: case XEN_DOMCTL_getvcpuaffinity: ret =3D vcpu_affinity_domctl(d, op->cmd, &op->u.vcpuaffinity); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_scheduler_op: ret =3D sched_adjust(d, &op->u.scheduler_op); diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index a0faddcb92..69972147db 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -1402,10 +1402,12 @@ int vcpu_set_hard_affinity(struct vcpu *v, const cp= umask_t *affinity) return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_hard_affinity= ); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int vcpu_set_soft_affinity(struct vcpu *v, const cpumask_t *affinit= y) { return vcpu_set_affinity(v, affinity, v->sched_unit->cpu_soft_affinity= ); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* Block the currently-executing domain until a pertinent event occurs. */ void vcpu_block(void) @@ -1693,6 +1695,7 @@ int vcpuaffinity_params_invalid(const struct xen_domc= tl_vcpuaffinity *vcpuaff) guest_handle_is_null(vcpuaff->cpumap_soft.bitmap)); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int vcpu_affinity_domctl(struct domain *d, uint32_t cmd, struct xen_domctl_vcpuaffinity *vcpuaff) { @@ -1802,6 +1805,7 @@ int vcpu_affinity_domctl(struct domain *d, uint32_t c= md, =20 return ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 bool alloc_affinity_masks(struct affinity_masks *affinity) { --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490419; cv=pass; d=zohomail.com; s=zohoarc; b=YRXVhYt8HDazGMj7IcPTmAA1rlcKZU/D4Xt4rcp7WkRW0loIS5NvuL9wYvcChLt8rV1JQWTjCB4cfr902X30BvlichHQW4bhmxvKRWVCIZYlpHeHzY98htc5TM/fx3+EF6Xyhjx6VP5z5NM4M1O2bZch/JeP6k9CFaeMXpjU9j4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490419; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jBscWAwzK16wFtb9z6LG5pktl/B8WuF9ILjHfhMxcXc=; b=IyGgaF+x6MknEkIzWDaujphpQI/YYM0fRnRIxPltWf221vPe4MZSOX+7Tfq5hAt0yY55916I2hSD11Y2oOUUrCi19uTWOH/phcAGXhr9yXxM81J7NSIIdNmUzVwwTce/4pnUUCG7r9up8eTSjdhlunRApB9R60w4XldHriM4vpc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490419961420.0235247844032; Wed, 10 Sep 2025 00:46:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117782.1463890 (Exim 4.92) (envelope-from ) id 1uwFXK-0001XY-RR; Wed, 10 Sep 2025 07:46:38 +0000 Received: by outflank-mailman (output) from mailman id 1117782.1463890; Wed, 10 Sep 2025 07:46:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXK-0001WY-IK; Wed, 10 Sep 2025 07:46:38 +0000 Received: by outflank-mailman (input) for mailman id 1117782; Wed, 10 Sep 2025 07:46:37 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQj-0005yo-3f for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:49 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2062f.outbound.protection.outlook.com [2a01:111:f403:2417::62f]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 53252909-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:47 +0200 (CEST) Received: from BYAPR02CA0040.namprd02.prod.outlook.com (2603:10b6:a03:54::17) by DS0PR12MB8785.namprd12.prod.outlook.com (2603:10b6:8:14c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:41 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::31) by BYAPR02CA0040.outlook.office365.com (2603:10b6:a03:54::17) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:40 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:40 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:33 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 53252909-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rLQtwpKNOKsS/CzxcatW18qakE6cQqe0QaPyQ2ljIg/zoh9hDGUuMvT6YZVPXh5sYV47HAS2MDGSq9ShHQT45SYiOWM1rZp4t4Uj6dl7E46H7teoE4D4EN7+593Z0Bb7BRbq0UrF0H0cjYU5vPU6cb4zZvMUK7ZrU7/FXSxo2qNvwOnT6PGDvzEsxsNrDZ6BVT1+cN+qZS2efqq/H2leRwcIU2e1+YN5JfP6AxAq0Ivk+iTxv+ebhExq9HBYVli/7M1BnI8AT3NLdWhMHCrf0W4PhcsU67zok+CbxUFDPjuWyalx6ZwBUqkpyT9oaX6KxdzE+SsVS2rHJrtx7VzJSg== 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=jBscWAwzK16wFtb9z6LG5pktl/B8WuF9ILjHfhMxcXc=; b=TBJmYbpONSrYGberD9I7IYWcM3s9nsei2jzfkNgI1ZMjeD3f9rdUuMuaEgnt4CPnbxSzStZZhY4rSUluWlQS5h/r4IUl/vs83WXaZE91RNoFaKGeNK754pj7Oyahol87F29mcfmwUodmD8wIHRNlnzcxb7UtiLl/l2yOemobFF7VmvkPBf+Gt/tQSzV6MCpJhQoNBe7PYyhgT7UFsN7SjExPIj+4XbXgkrXpJe/YTM6bMPc0uRvsZ37/Do2rGCUig2no58++KhNdTLQBXqgx6Yo2tH3nG7l786ex0t78NxO1azNbtC+cTiK2DCK1kH5YJ7jjWHizvLBmfsSSH06maw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=jBscWAwzK16wFtb9z6LG5pktl/B8WuF9ILjHfhMxcXc=; b=qAt17ySYEfUooD+ufmDQpeJ+ycAzKJeMVPc0NEDMgzs8XZPImH+clFqKTzpCRm2+8Jo+2mhsyA1KrHlnhIYxHT01V84Jy/fDUilFd1Oud1Osj15Epm7eRb+OB7Q3VilcpbDmMO0zKAZcIoJTMxLHwCxctcV3j9vltW1Ik8vPoaY= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: , CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Nathan Studer" , Stewart Hildebrand , Dario Faggioli , Juergen Gross , "George Dunlap" , Meng Xu , "Daniel P. Smith" Subject: [PATCH v2 13/26] xen/domctl: wrap sched_adjust() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:14 +0800 Message-ID: <20250910073827.3622177-14-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|DS0PR12MB8785:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ee1863f-a267-448b-a3e3-08ddf03d338d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024|7416014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jVXTctrDvl3wlkNfBuVVpD9gZFY2gxBQLv+0jini/bDm7TcwtIDfri6bk5fM?= =?us-ascii?Q?fAkkolFgbvCvRov7JexpIBVOaw2CYmTpFF1YeV5AQ7UR8PNRUlhUXxFDW5aG?= =?us-ascii?Q?/eJiZJRdTe5NYQX//N7xUNcaOGhn2F8iMEVF5npKx8usbCkO7UUM1SDaSarJ?= =?us-ascii?Q?v+8PqXp8hqCausEGh+I15k/Jkzaa56oiNh1q2cyFISY+FTF8dML0SQNqZmdr?= =?us-ascii?Q?0fKARLBoSkF1H7+DFdlGxTbDS4kIs1LicrD1UfrvwMBek+08avr8LsUoXX4Z?= =?us-ascii?Q?W97n4C+PpWmbyw0DNgdoEZF1ozh5BJqu19VWMjT45t38k9ja+3xNGPYeefVo?= =?us-ascii?Q?lhX0ePOOUKW2VV2uPaLyd6KCLlAlc53BrPGf5frBf+6LMzGWtrtN3M7JVgCZ?= =?us-ascii?Q?FqrKzeADv+16au7DNGlseDe61RVPohLmqyC9UMZdcuWNsi3xMJRZjnRG8Tt9?= =?us-ascii?Q?HpUO3Ws3Zx8mctqY7wly+ffXkU4kWQkcfqm3lDPZS2aEVnx1qXCR9IwxFCIg?= =?us-ascii?Q?qRUHcInoia1CRhd5r0h8l3clhoMzmG5e+oVjFWwskP1j3C9jb/xIyJ2r5wZC?= =?us-ascii?Q?XKhBbFLrfMy02wdzEqmRLnbssGfQ5LnhXcnCSY1k9fLq87kXnrpPKt7HLF4F?= =?us-ascii?Q?OcPNZFkRSrfSLH/GuAim5B2LmGCQaJI/Uu6gSIj/2xn7tde4R48fWPe1+DfV?= =?us-ascii?Q?BMFTUTLV+P23iGilznN/JuLoqsi9Ge1h++yAAPXOad/L7GnfbSgeZ8Q0mMPk?= =?us-ascii?Q?eQF7s2mH9cKlMy3yT/m/s9ksTKDqnC5Gs+zwn7agQB3YUVD8vhn5vTvrAhq4?= =?us-ascii?Q?NiWhCUPbgW5rHIfIz1cXpO1WWi1nB62oDf2WM7NFUPci72zyleO1ocV7/6nx?= =?us-ascii?Q?DrWGQQXCZC3u+T4Pk0HvmC7yiiF+F8Ty6GQhKIm7m5xjNGiSE1SXWs0ucLHD?= =?us-ascii?Q?M7VTdtWBerJcTxvi+mc9/YHV8AQ7UxzdDMx6og/Zp8UOVTPCAipkgZHmOCu9?= =?us-ascii?Q?NKM4JsHJO4UqwY2EsIgEi7IK3v4opoJQQI1CyAOA0Yxsti6ZTzs9qiYeR3aO?= =?us-ascii?Q?NpNH5RBWRF72FDPaSOUlgymZ7zPuYRVeARJW1U8wMCx8DQiaUVXmZVQfsDXt?= =?us-ascii?Q?EZ0PPOkaVLT0LBkdDqKeBiwu9dUlr7FKfcAOAEKLQEdtz++BOBsl6meS2Z3L?= =?us-ascii?Q?H9NwvH6ARIvAW6WbcIlLjaewl+l3iFoRYoclKQzQyqnI0T7nv2WaBoqrGvmB?= =?us-ascii?Q?2pwnsIE/N8Jb9vXyq+tSbB4eKr8fbrm5zwA8hcNb9z5RV1Jd8ASTd+2PAf4h?= =?us-ascii?Q?gsXv/N5joaWDpOq1uHH3TVUJ4+WuexUGCKQ6Jetls6S2NhMTm++qV/9DFrLP?= =?us-ascii?Q?Devjf6INfGrnW+x8OX+awDLo6/Xuq2oUvf7WhEiEgwdYM0jaTk/dw3sryS9j?= =?us-ascii?Q?0OaWq/Ctr2DMfGQ0B2tW9uSOxCJ4v/z5fkypmIzfFuLrXyIk1KuY19JL9aFM?= =?us-ascii?Q?kr74nWQb7qjzBcgaV/B6d2KLNTFspp5kjqvf?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024)(7416014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:40.4334 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ee1863f-a267-448b-a3e3-08ddf03d338d 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8785 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490422355116600 Content-Type: text/plain; charset="utf-8" Function sched_adjust() is responsible for XEN_DOMCTL_scheduler_op domctl-o= p, so it could be wrapped with CONFIG_MGMT_HYPERCALLS. Tracing its calling chain, the following functions shall be wrapped with CONFIG_MGMT_HYPERCALLS too: - sched_adjust_dom() - scheduler-specific .adjust() callback - xsm_sysctl_scheduler_op() Wrap XEN_DOMCTL_scheduler_op-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_scheduler_op-case transiently --- xen/common/domctl.c | 2 +- xen/common/sched/arinc653.c | 2 +- xen/common/sched/core.c | 2 -- xen/common/sched/credit.c | 4 ++++ xen/common/sched/credit2.c | 4 ++++ xen/common/sched/private.h | 4 +++- xen/common/sched/rt.c | 4 ++++ xen/include/xsm/xsm.h | 4 ++-- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 10 files changed, 22 insertions(+), 10 deletions(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 4a35c17060..6660f13e9e 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -520,12 +520,12 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) case XEN_DOMCTL_getvcpuaffinity: ret =3D vcpu_affinity_domctl(d, op->cmd, &op->u.vcpuaffinity); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_scheduler_op: ret =3D sched_adjust(d, &op->u.scheduler_op); copyback =3D 1; break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getdomaininfo: ret =3D xsm_getdomaininfo(XSM_XS_PRIV, d); diff --git a/xen/common/sched/arinc653.c b/xen/common/sched/arinc653.c index 7d6c40d800..484591a977 100644 --- a/xen/common/sched/arinc653.c +++ b/xen/common/sched/arinc653.c @@ -735,8 +735,8 @@ static const struct scheduler sched_arinc653_def =3D { =20 .switch_sched =3D a653_switch_sched, =20 - .adjust =3D NULL, #ifdef CONFIG_MGMT_HYPERCALLS + .adjust =3D NULL, .adjust_global =3D a653sched_adjust_global, #endif =20 diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c index 69972147db..8a3251ce5f 100644 --- a/xen/common/sched/core.c +++ b/xen/common/sched/core.c @@ -2078,7 +2078,6 @@ int scheduler_id(void) { return operations.sched_id; } -#endif =20 /* Adjust scheduling parameter for a given domain. */ long sched_adjust(struct domain *d, struct xen_domctl_scheduler_op *op) @@ -2115,7 +2114,6 @@ long sched_adjust(struct domain *d, struct xen_domctl= _scheduler_op *op) return ret; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS long sched_adjust_global(struct xen_sysctl_scheduler_op *op) { struct cpupool *pool; diff --git a/xen/common/sched/credit.c b/xen/common/sched/credit.c index 0cbec2a9c0..da57350cae 100644 --- a/xen/common/sched/credit.c +++ b/xen/common/sched/credit.c @@ -1183,6 +1183,7 @@ csched_unit_yield(const struct scheduler *ops, struct= sched_unit *unit) set_bit(CSCHED_FLAG_UNIT_YIELD, &svc->flags); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check csched_dom_cntl( const struct scheduler *ops, @@ -1227,6 +1228,7 @@ csched_dom_cntl( =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check csched_aff_cntl(const struct scheduler *ops, struct sched_unit *unit, @@ -2288,7 +2290,9 @@ static const struct scheduler sched_credit_def =3D { .wake =3D csched_unit_wake, .yield =3D csched_unit_yield, =20 +#ifdef CONFIG_MGMT_HYPERCALLS .adjust =3D csched_dom_cntl, +#endif .adjust_affinity=3D csched_aff_cntl, #ifdef CONFIG_MGMT_HYPERCALLS .adjust_global =3D csched_sys_cntl, diff --git a/xen/common/sched/credit2.c b/xen/common/sched/credit2.c index 307e63ebd8..73df429b42 100644 --- a/xen/common/sched/credit2.c +++ b/xen/common/sched/credit2.c @@ -2909,6 +2909,7 @@ static void cf_check csched2_unit_migrate( sched_set_res(unit, get_sched_res(new_cpu)); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check csched2_dom_cntl( const struct scheduler *ops, @@ -3114,6 +3115,7 @@ csched2_dom_cntl( =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check csched2_aff_cntl(const struct scheduler *ops, struct sched_unit *unit, @@ -4246,7 +4248,9 @@ static const struct scheduler sched_credit2_def =3D { .wake =3D csched2_unit_wake, .yield =3D csched2_unit_yield, =20 +#ifdef CONFIG_MGMT_HYPERCALLS .adjust =3D csched2_dom_cntl, +#endif .adjust_affinity=3D csched2_aff_cntl, #ifdef CONFIG_MGMT_HYPERCALLS .adjust_global =3D csched2_sys_cntl, diff --git a/xen/common/sched/private.h b/xen/common/sched/private.h index b7ff67200b..15e69f5c2d 100644 --- a/xen/common/sched/private.h +++ b/xen/common/sched/private.h @@ -349,9 +349,11 @@ struct scheduler { void (*migrate) (const struct scheduler *ops, struct sched_unit *unit, unsigned int new_cpu); +#ifdef CONFIG_MGMT_HYPERCALLS int (*adjust) (const struct scheduler *ops, struct domain *d, struct xen_domctl_scheduler_op *op); +#endif void (*adjust_affinity)(const struct scheduler *ops, struct sched_unit *unit, const struct cpumask *hard, @@ -506,13 +508,13 @@ static inline void sched_adjust_affinity(const struct= scheduler *s, s->adjust_affinity(s, unit, hard, soft); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static inline int sched_adjust_dom(const struct scheduler *s, struct domai= n *d, struct xen_domctl_scheduler_op *op) { return s->adjust ? s->adjust(s, d, op) : 0; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static inline int sched_adjust_cpupool(const struct scheduler *s, struct xen_sysctl_scheduler_op *op) { diff --git a/xen/common/sched/rt.c b/xen/common/sched/rt.c index 7b1f64a779..a42040b259 100644 --- a/xen/common/sched/rt.c +++ b/xen/common/sched/rt.c @@ -1362,6 +1362,7 @@ out: unit_schedule_unlock_irq(lock, unit); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * set/get each unit info of each domain */ @@ -1471,6 +1472,7 @@ rt_dom_cntl( =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * The replenishment timer handler picks units @@ -1572,7 +1574,9 @@ static const struct scheduler sched_rtds_def =3D { .insert_unit =3D rt_unit_insert, .remove_unit =3D rt_unit_remove, =20 +#ifdef CONFIG_MGMT_HYPERCALLS .adjust =3D rt_dom_cntl, +#endif =20 .pick_resource =3D rt_res_pick, .do_schedule =3D rt_schedule, diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 1e4647f7db..4d332ceca2 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -56,8 +56,8 @@ struct xsm_ops { struct xen_domctl_getdomaininfo *info); int (*domain_create)(struct domain *d, uint32_t ssidref); int (*getdomaininfo)(struct domain *d); - int (*domctl_scheduler_op)(struct domain *d, int op); #ifdef CONFIG_MGMT_HYPERCALLS + int (*domctl_scheduler_op)(struct domain *d, int op); int (*sysctl_scheduler_op)(int op); #endif int (*set_target)(struct domain *d, struct domain *e); @@ -240,13 +240,13 @@ static inline int xsm_get_domain_state(xsm_default_t = def, struct domain *d) return alternative_call(xsm_ops.get_domain_state, d); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static inline int xsm_domctl_scheduler_op( xsm_default_t def, struct domain *d, int cmd) { return alternative_call(xsm_ops.domctl_scheduler_op, d, cmd); } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static inline int xsm_sysctl_scheduler_op(xsm_default_t def, int cmd) { return alternative_call(xsm_ops.sysctl_scheduler_op, cmd); diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 2c70b979d6..2c878999a3 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -18,8 +18,8 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .security_domaininfo =3D xsm_security_domaininfo, .domain_create =3D xsm_domain_create, .getdomaininfo =3D xsm_getdomaininfo, - .domctl_scheduler_op =3D xsm_domctl_scheduler_op, #ifdef CONFIG_MGMT_HYPERCALLS + .domctl_scheduler_op =3D xsm_domctl_scheduler_op, .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, #endif .set_target =3D xsm_set_target, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index ec3880f631..e8a4deb2ea 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -609,6 +609,7 @@ static int cf_check flask_getdomaininfo(struct domain *= d) return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_domctl_scheduler_op(struct domain *d, int op) { switch ( op ) @@ -626,7 +627,6 @@ static int cf_check flask_domctl_scheduler_op(struct do= main *d, int op) } } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_sysctl_scheduler_op(int op) { switch ( op ) @@ -1888,8 +1888,8 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .security_domaininfo =3D flask_security_domaininfo, .domain_create =3D flask_domain_create, .getdomaininfo =3D flask_getdomaininfo, - .domctl_scheduler_op =3D flask_domctl_scheduler_op, #ifdef CONFIG_MGMT_HYPERCALLS + .domctl_scheduler_op =3D flask_domctl_scheduler_op, .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, #endif .set_target =3D flask_set_target, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490399; cv=pass; d=zohomail.com; s=zohoarc; b=SEgArFhaIiWMoYjO1Ac3Ads2gDsZMGTW/ftI67+WoZALDTN1925C68r5uaothgr2KYrjxXB1gCpnhzwGesQHp7EKjZ5gtiGsPDM3cXsBWJH+QtmWETcWd66FIl9cFW5ld9fDH0267EctobTjcePd3Rex5OjTHML0SXMuquMD+hI= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490399; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=52WwT+owHzY3V8/0eDU9osPAmiimtxakR45Na4sC7po=; b=TB6iJdLZ/yQKF676QoSNtp6Zqp1bam7ZN7/kFYFst+d2TmBc9kcAZFw9DfyYwquC5yX9VQr8WluNoTMlnmPsE0C2mwdHFSUWMNQMvV3m6BnX6x6wAWbsmsndhuBMoWO9JYWzgdVFwyRCwdk5oyWm/hHL/3sQQuXp+U/kTJhZgHI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490399348920.2191616063918; Wed, 10 Sep 2025 00:46:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117692.1463814 (Exim 4.92) (envelope-from ) id 1uwFX0-0006MF-Me; Wed, 10 Sep 2025 07:46:18 +0000 Received: by outflank-mailman (output) from mailman id 1117692.1463814; Wed, 10 Sep 2025 07:46:18 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFX0-0006M2-I4; Wed, 10 Sep 2025 07:46:18 +0000 Received: by outflank-mailman (input) for mailman id 1117692; Wed, 10 Sep 2025 07:46:17 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQn-0005yt-6H for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:53 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on20614.outbound.protection.outlook.com [2a01:111:f403:2412::614]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 51c19d12-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:46 +0200 (CEST) Received: from BYAPR02CA0061.namprd02.prod.outlook.com (2603:10b6:a03:54::38) by BN7PPF2E18BD747.namprd12.prod.outlook.com (2603:10b6:40f:fc02::6ca) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:42 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::52) by BYAPR02CA0061.outlook.office365.com (2603:10b6:a03:54::38) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:41 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:41 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:37 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 51c19d12-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=sOufc3I+ge8YE0yMAEgUAtDJhVgbXJ7Wl+eeSoCptceKysyK6JZ9MOkPY6Z2O0qyOgFKRcQosp6XLXtIQiAFzBnjATAYrWCcZXOACuXEm+7wsNvwsykvpwWszvRhi0CXK/HN9mJv2NV9MQtE7IXXlNl4X2Veh4GumdeXTev5ZChjKlxSwucm517rZOpAB9XEiJXfZeTHvpBTwMWuwmJByG2pJWeSs6252MT1kOEY5OHt6FdDfy4XKQca+ul+y5lHoROR1GwycVx5y1jOLHGpUnNk3tJCwEZzkSh+Mhqi18xRQyXIXJbRKk0tAlXK5geLcqA1g+HkVX8jSGo749sx4Q== 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=52WwT+owHzY3V8/0eDU9osPAmiimtxakR45Na4sC7po=; b=LqX0uyRXuXzVkD+HYVgFqIUDEyUexJ4QV5SAmWydovMr5ROwjJP/58L0EJcKymM/KiuSY1AIx0aCfSujVzQl+NUfg8ljR8xU5LworeEJdhb8xkkNgePqsVYf8qV/qmnpdagEwim/z/27Y+Ax61f/494/IMPz/HNfWltP7+gfyRd0bNiegoiH/8jb/MbVD1lR/4MdVaRve9uUYmXRHK7NNk077q9RRFLrnFtX8/IDqquUxl2P5OTe/ZVkgxJZN8naq3Yg+4y6EWcP1RjdL3kKS9JHsM9ZvPYZga03xKGyQXu8GQbgCasogfdJwiWHXExH+H8fryojKGsalyQKrjBy6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=52WwT+owHzY3V8/0eDU9osPAmiimtxakR45Na4sC7po=; b=5bcaKGHbxp48+EWA6cDLmuUlYuaCZqaypLRvHj9hsMSXlz+XHeIvPf3B1oEt4y7cVcQPZzstuhnDIQbKtlxjfGB6bvVGk4GOmnZTosCXLIHqidDEzvZXjKK/2YACAYubIpKHFMmLOnrtbq/7yvdzjtQgLqfFVagJ5b+5t0+p8nA= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 14/26] xen/domctl: wrap arch-specific arch_get_info_guest() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:15 +0800 Message-ID: <20250910073827.3622177-15-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|BN7PPF2E18BD747:EE_ X-MS-Office365-Filtering-Correlation-Id: 13c55dff-468f-4e98-4999-08ddf03d3423 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?u90JWf8H+Mnc+oxN3tEN5jmsWwVESsTuU6bo9qIiz4dgmpjaLLHNHnfvUdiD?= =?us-ascii?Q?TdyxbaCkeXVc0+a4oLHtmohc4bquXiaPHUXl4pr32i/xWKxsg8zAWDoZhi1j?= =?us-ascii?Q?5t+wcuWBXI8q/JMVkdDsN/2hVGMuOYImyZ/L4awOg4I3Q1BhiGYTvQfGqz9D?= =?us-ascii?Q?ZXZAlMDiZP3tkvi4EQKGcLman1/pxf3yKsvbiWdsGoqUCTf8OMt9YpLHFjRN?= =?us-ascii?Q?FHd4XKQFR2XzNyMl944bCzx3+Z5+5VrWvDsINdiciDWFyUB976iphmkGnNWE?= =?us-ascii?Q?DE7YTRVk8ozWXCp2sLnkBuF/YzHjqj6piVgLc+VSJ8WymQDdlRIgT1Wz+Ks/?= =?us-ascii?Q?kfgV3EiTmFFJr98tcaEKLTvn310ytSmgKvqvoA+NbCmZeYzNPvekLca6LfGr?= =?us-ascii?Q?Q5ZxZe+i61eyQKxrvrGLXJeN/eYyn9COpVBoNCtWu+aMJPiPLBCF0VMJ78FW?= =?us-ascii?Q?TXXBTtsSRS1a7GUlP3WuMwaT/+Dl6+J0EIBh3X0UjWhUTjZ2xI+Nf8V2Jmri?= =?us-ascii?Q?mzrcLHm1syJQ2Bfqu8sZ4Pq7DeBYzfh/x17w/ww7zFj4z4cfDODtNVF8k15E?= =?us-ascii?Q?h/IPF/iMJqmZ6VDDmdTNOUmv3NAMimH6H4LC6QUqyCCewt6DhvCsYyECCFVB?= =?us-ascii?Q?3StDyzZDsZEgkMVNhmFknmK69R+Fgd+r3/IH/VmDw61t+9kS1LPfGdXWcfxi?= =?us-ascii?Q?6DlTinEXLCb4lhGwvUjn1UdunwgIZiv/7/i3IjM/3aFN27WrwuixBmSs9/s2?= =?us-ascii?Q?5NKot9D572UXPAMbeRWsgfj3i4DYAkM+0DQYMIVq+WT3M7AinVVQpdJ+YldL?= =?us-ascii?Q?oprhDONZ7pSF9s3C0qEjxMXldXxD8aZOqpyjl+FYyzGKlaHSkWdCHo8A2OYv?= =?us-ascii?Q?kRtK4UrqO3tAWayzqABm+7ilm2Sy0XX9//tQZqloJjE03uPa47Vef7BSnYzn?= =?us-ascii?Q?t2nH0osz8iVHLWZQhU9l9iQs5uKJ0i1lrLG1ApMJEOxnXfV9PPMLtrYxaiSw?= =?us-ascii?Q?BKkj0Sz/So348orFfN1xZjyENIFK33N5Wy9iXRuy8AirM0UMaHFDF5yX2ECr?= =?us-ascii?Q?A2BJE135wFbABq2D9yzdmX5SeY82JviXafOMoQPEl6pFKtDXuXNAS8DrLVaf?= =?us-ascii?Q?u9T/JHbbGmR2mGPbGwnMuHfufw/E5ZJi2cpE77MT3QsEzS/4zuzakAODUWMX?= =?us-ascii?Q?QGsySMwiWZZlbRS29zZMljcYUkmmvtjMqmIL5E6qNxPhHPjuTLGgRGc+bYFU?= =?us-ascii?Q?N4h7KhVXT8y4wPuJe64b+ukwPz1JCTWCS9X4XVIkjgWqxeJ33ftri9BtjqPs?= =?us-ascii?Q?Diz9nhY6QEYSjQyf1BBGamttyYcq83abGbR4q80TjM5JoQZRD6wxo7FDvkAT?= =?us-ascii?Q?jIYrlatsvWweJ39dfU4msEwehIrx3lgXMrJYOVB7RkTwGl2Fy2czqT3cRExI?= =?us-ascii?Q?myUn+hHUw/0FWYrIOa6qVSfRRTRiVr874oTp9pvsHwxJuXRIRkCSBg//e1+q?= =?us-ascii?Q?ndwlJvP5KB9hkxowKSEfca0cWM1tf1kIJoG2?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:41.4143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 13c55dff-468f-4e98-4999-08ddf03d3423 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PPF2E18BD747 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490401703124100 Content-Type: text/plain; charset="utf-8" Arch-specific function arch_get_info_guest() is responsible for XEN_DOMCTL_getvcpucontext domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Wrap XEN_DOMCTL_getvcpucontext-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_getvcpucontext-case transiently --- xen/arch/arm/domctl.c | 2 ++ xen/arch/x86/domctl.c | 2 ++ xen/common/domctl.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c index ad914c915f..d3263e4d03 100644 --- a/xen/arch/arm/domctl.c +++ b/xen/arch/arm/domctl.c @@ -184,6 +184,7 @@ long arch_do_domctl(struct xen_domctl *domctl, struct d= omain *d, } } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) { struct vcpu_guest_context *ctxt =3D c.nat; @@ -199,6 +200,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_con= text_u c) if ( !test_bit(_VPF_down, &v->pause_flags) ) ctxt->flags |=3D VGCF_online; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 6153e3c07e..ea5f5b20cf 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1370,6 +1370,7 @@ long arch_do_domctl( return ret; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x @@ -1562,6 +1563,7 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_c= ontext_u c) c(vm_assist =3D d->vm_assist); #undef c } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 6660f13e9e..6048a87826 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -538,6 +538,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) copyback =3D 1; break; =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_getvcpucontext: { vcpu_guest_context_u c =3D { .nat =3D NULL }; @@ -586,6 +587,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) xfree(c.nat); break; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getvcpuinfo: { --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490390; cv=pass; d=zohomail.com; s=zohoarc; b=BaxCu6yXOLjpzJn8nnl+DH93f5/C+wOfJ6CCsFmLIA1wdq77WNSL5gj7jPy+KEqUUyKLtl6NDQ7nApYKnk1m2pPJ1q5DeWo4/gxNbLwpGrvEDitWu5vmDOLIfEh4my0HisphfxOnwfZuNp709h2ohjSvt6kiDnoMOIgTgNNTqOs= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490390; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sPLCxnD1ZJb6r1rXSz/MjuR5iKDACsR2gEr90FFhFxk=; b=iMC/BqOyTGa5P2mnBgfgFGGN+C8KABe/uIIaZQucj2HMYfUiUE6e1cG/b6l8alir6h8f7Gkr2gXYYTOr8s+n0JAoNKA757uZ3NU04NC4GyenT1sZ0dCAU0Ctz3G5W98yAeCUNV9v79cPTAul2gbT235vuYiU+m95qwRO1KmbjOc= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490390881603.027659713298; Wed, 10 Sep 2025 00:46:30 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117678.1463795 (Exim 4.92) (envelope-from ) id 1uwFWt-0005WE-Sb; Wed, 10 Sep 2025 07:46:11 +0000 Received: by outflank-mailman (output) from mailman id 1117678.1463795; Wed, 10 Sep 2025 07:46:11 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWt-0005W1-OA; Wed, 10 Sep 2025 07:46:11 +0000 Received: by outflank-mailman (input) for mailman id 1117678; Wed, 10 Sep 2025 07:46:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQm-0005yt-6J for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:52 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on20604.outbound.protection.outlook.com [2a01:111:f403:2413::604]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 52992622-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:47 +0200 (CEST) Received: from BYAPR02CA0057.namprd02.prod.outlook.com (2603:10b6:a03:54::34) by DS0PR12MB7778.namprd12.prod.outlook.com (2603:10b6:8:151::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:43 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::6f) by BYAPR02CA0057.outlook.office365.com (2603:10b6:a03:54::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:42 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:42 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:40 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 52992622-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ly7DLNkdRMxRw6S9/Y8rj/ZyB99eietlVtejRl0k6r8zacNApW8UekguDSPVI0uWl477AaFMQoJ7JVCdZkVNyesZL43ltXsngRGjE9d42f+2eP0J4T+4AwbSvMmFyRW2HQLxO1s4/zoDwRoCzG/7f7lwie/sqIJZgNlXCR2CL11BxWOUkr1/x6e+ro20RFtjhaHFiKDJrziMKCJJjpiDiDCpAzC4/QFwTN6Pypxx8eX53JQImB0ZH1qcR5R9KP8JWoStAzOpW6zmk1gEMxGUywnRArqZ6l0PxxdSFYlNq+6+1AuQXMFXLqCzj29f91SepG5iyhfRIkGXZdKWtfXAwA== 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=sPLCxnD1ZJb6r1rXSz/MjuR5iKDACsR2gEr90FFhFxk=; b=papn7aqDBMcvjvGcGClg1nriNzzStuchjIVmkjgpYsusP41MEnZRXZbnXSIkoQx2ZyHefd613XvC8gXiQg8j9t2GwZ6kdKKtmV8/e+8uDzGClX4etbniSlo6xHeHE4SxavGVaIUgCYvy0Ut5/amfH71JsLwKy0jF8y3lUCAwkbHTCm02s9eebi4IFM7UJhFXZT7ys8oF6Ut0SbSwoPEHg4hSbeT6RtNn8aNt7SQfmNR20ZRntXKQTVQ3lENmUmEOasTv9AZZ8jQPbsY3x2dzboah4SBNwdDoGP1hEUZ0cEyuzYVCl5zvIa1f9QNx9JovY4lS00nRLDp2APOBtHYU+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=sPLCxnD1ZJb6r1rXSz/MjuR5iKDACsR2gEr90FFhFxk=; b=meC+3NRmLur1NAjJxMIHSKVTr3XTskVM8Ua5wy310jeLWZmeo0aj0FRl62b0iAycXYPEUob9JVfInzkQJzQ+Veej659828d2V1+B5s9YkVXZgCw7lo8ILasJ0lgvz2p+JVSWGJ1dYdFRDU+m8iOEzThMlvQstiVd9uh6Ci5UcYM= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 15/26] xen/domctl: wrap xsm_{irq_permission,iomem_permission} with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:16 +0800 Message-ID: <20250910073827.3622177-16-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|DS0PR12MB7778:EE_ X-MS-Office365-Filtering-Correlation-Id: 274d4229-6ff2-4e03-6e8f-08ddf03d34e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Rm9v+Dp0w+e9+A7hbzulm57Gx5UmucCEiuyv8WBsVqHPa59ELVJMRnoQetyc?= =?us-ascii?Q?5G104Lua3BwoymLZ++QLWLIxhS+yLSvjbVfncJ5FxwSRi5s0kVut3dZwGokY?= =?us-ascii?Q?KcjiwknvKKnQ8lx9nGnjhQ78wNnm0oTUyTwzg9a+MaDjtMsq2Q2hGbiIvfch?= =?us-ascii?Q?uDPNvcOV7XieoO+kzeMv9guAZ0skzK9wg2fiYDiArZ2P4S9hxGngpadX+oKi?= =?us-ascii?Q?9oB/AgjJ2quqxR7qQ9aCfpA8XY72BRHljW+ue+mokVhPRgcmvj79qntFlr+X?= =?us-ascii?Q?iVAgLSZGTsTymPtxSn/1KXwjxwKiCCJ7XrvH3EnFZpSZguSUHbq+Z1PY8bXz?= =?us-ascii?Q?qJojJ6spwlO5PCusOQ2kTvZxSpMKGn2lGuEZCgkPi/sdQEtDkCreMUN4deG1?= =?us-ascii?Q?N4oabXDHYVD6SF9keaFRLan/x4QIOVQ9x3JFwN5h8dkrF7qPkgvxtUNmRPIc?= =?us-ascii?Q?32WeB38T9xE0ZiLnyD4aToKWJB0D6XYtg6+RTAaJyc++G/M7R4WZTvygOgFD?= =?us-ascii?Q?9rHb7pt06ZhcD7iLDLLBZQCsKjrcdeWTZbcOs/JSP5xm8/SgAq9N9M3ZZ6KQ?= =?us-ascii?Q?VNJ2n9wCCFODF3y6DSRnN+K9KgLNHwHRD3jbOUpMt1odPCDHAzCeT5vRuNgX?= =?us-ascii?Q?Wk6MwxnLCSoTcXJwONuQdJBBG7qWlmbXAz7GyOh9qox0HSL1i4f81REnA4QW?= =?us-ascii?Q?WCsKDpKa35tvxxyIspOnG91boTYuK4g6WTR7lf/1mWtXejjTt5wzM/9O8KQR?= =?us-ascii?Q?x2fo4nIVXetMLGXH/9Xe9xGRbew3tfIHo+CJ0K4yrG8sAUIXXZO8y3UHRrWL?= =?us-ascii?Q?uu7f2IcHArm+pDGsx7ClsyGCJm46/4XRawoRtqJ0vOT9BbZg18G/1zbf4dJg?= =?us-ascii?Q?w25SUvLhPOcFKwnMoGkJjFZrR6Y2nm+z3ZWc97rTssiWSGLxvndkv/b5VR4F?= =?us-ascii?Q?WtttbRyfTxYLS6iZd/vBhcn1R4rKFh/QPDiue4Fa9s0Sh3K+ouWOInR2CcJb?= =?us-ascii?Q?T3kvWeCrF/JECHX08xK9i/8C2bDjuZXO4UN/Yg6avSwe+PkC2epK8GdymGdE?= =?us-ascii?Q?ftgVvHN0O3BI1NxiPivV8Lu6jGV7pctfej0qwMDtYDgvXUpIT7CpSmcVFWTO?= =?us-ascii?Q?JDNoPsbtcrMpuNWTcdKAcZON7sXZjzhrhTX3fxuQ7ucKZtfQhhgaT7BTI0rI?= =?us-ascii?Q?KhD6CEzjUP9UjWeJatzCLoM6KScCRWmem97dVO1yobDjP9CGnzucHXHysKpB?= =?us-ascii?Q?mVZc+V6AdJ9Q7IVDzjvL6N4VVh14IFCrNz07w2S80yjPpT1LvGQl1b5BSdWG?= =?us-ascii?Q?WWemsnhqiVH62mtW5dBy1uqpeLrOxRLUp/Mi83ndq3tbw8Xd+8DmTTx52301?= =?us-ascii?Q?WEBWUr5Bs7mCJKI1dFEmkZuj4G9X8RD5YN81BtikhFD0pI4RVCKIsUYgk5k9?= =?us-ascii?Q?a+AUFJQWB+9JD+9HpTDEeiGu8w1uXBDqGwfT2FPaaX28pF0mVuSBojZDpa22?= =?us-ascii?Q?2n/4qYbYAqcsl3c6zSkrhiIc7zHgWEf1ud4u?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:42.6747 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 274d4229-6ff2-4e03-6e8f-08ddf03d34e3 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB7778 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490391779116600 Content-Type: text/plain; charset="utf-8" The following functions are invoked only under XEN_DOMCTL_{irq_permission,iomem_permission} domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS: - xsm_irq_permission - xsm_iomem_permission Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/include/xsm/xsm.h | 10 ++++++++++ xen/xsm/dummy.c | 2 ++ xen/xsm/flask/hooks.c | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 4d332ceca2..1fcd945336 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -113,9 +113,11 @@ struct xsm_ops { int (*unmap_domain_irq)(struct domain *d, int irq, const void *data); int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bi= nd); int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *= bind); +#ifdef CONFIG_MGMT_HYPERCALLS int (*irq_permission)(struct domain *d, int pirq, uint8_t allow); int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e, uint8_t allow); +#endif int (*iomem_mapping)(struct domain *d, uint64_t s, uint64_t e, uint8_t allow); int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf, @@ -508,13 +510,21 @@ static inline int xsm_unbind_pt_irq( static inline int xsm_irq_permission( xsm_default_t def, struct domain *d, int pirq, uint8_t allow) { +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.irq_permission, d, pirq, allow); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_iomem_permission( xsm_default_t def, struct domain *d, uint64_t s, uint64_t e, uint8_t a= llow) { +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.iomem_permission, d, s, e, allow); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_iomem_mapping( diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 2c878999a3..b216894579 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -73,8 +73,10 @@ static const struct xsm_ops __initconst_cf_clobber dummy= _ops =3D { .unmap_domain_irq =3D xsm_unmap_domain_irq, .bind_pt_irq =3D xsm_bind_pt_irq, .unbind_pt_irq =3D xsm_unbind_pt_irq, +#ifdef CONFIG_MGMT_HYPERCALLS .irq_permission =3D xsm_irq_permission, .iomem_permission =3D xsm_iomem_permission, +#endif .iomem_mapping =3D xsm_iomem_mapping, .pci_config_permission =3D xsm_pci_config_permission, .get_vnumainfo =3D xsm_get_vnumainfo, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index e8a4deb2ea..198053be77 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1111,12 +1111,14 @@ static int cf_check flask_unbind_pt_irq( return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_irq_permission( struct domain *d, int pirq, uint8_t access) { /* the PIRQ number is not useful; real IRQ is checked during mapping */ return current_has_perm(d, SECCLASS_RESOURCE, resource_to_perm(access)= ); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 struct iomem_has_perm_data { uint32_t ssid; @@ -1943,8 +1945,10 @@ static const struct xsm_ops __initconst_cf_clobber f= lask_ops =3D { .unmap_domain_irq =3D flask_unmap_domain_irq, .bind_pt_irq =3D flask_bind_pt_irq, .unbind_pt_irq =3D flask_unbind_pt_irq, +#ifdef CONFIG_MGMT_HYPERCALLS .irq_permission =3D flask_irq_permission, .iomem_permission =3D flask_iomem_permission, +#endif .iomem_mapping =3D flask_iomem_mapping, .pci_config_permission =3D flask_pci_config_permission, =20 --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490396; cv=pass; d=zohomail.com; s=zohoarc; b=fQOiDJCLTi39zdYHAXfw1mqlBWVhW+CW1biWjcJQsJCdr5Bvde3L33ZVYRjXOX5XtTlAW/E2aogNc7fsinD53EQiguHyz+5jNELM6pe9rDHB7WHs7Y+2q7vsbx2QAnN7ehiglwKQOgjYg6y+sz//yzfGdpeL73kzTILt9wsGC5c= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490396; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zkokiDvf/GT2g8eWcD+vSGI07NbkAbkWkG3C6DWEVjg=; b=Ht1AsljUNjdoDOOiXiMEShe+4I42yqhCe3xI50soq77aCQk8fwGEbhlMhldRiKbOsPNO6SA1S109EzEkyE2PMqey6rqljiXjiPzgH8vYw60KnBfPCAOpWi9JNRe2pEm3T+A3ZwhbuwxBSbSkiXWXUUp0puPFLCGHny27NU95dNk= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490396141853.9742758625841; Wed, 10 Sep 2025 00:46:36 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117685.1463805 (Exim 4.92) (envelope-from ) id 1uwFWw-0005sT-Cm; Wed, 10 Sep 2025 07:46:14 +0000 Received: by outflank-mailman (output) from mailman id 1117685.1463805; Wed, 10 Sep 2025 07:46:14 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWw-0005s7-86; Wed, 10 Sep 2025 07:46:14 +0000 Received: by outflank-mailman (input) for mailman id 1117685; Wed, 10 Sep 2025 07:46:13 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQs-0005yt-7K for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:58 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20629.outbound.protection.outlook.com [2a01:111:f403:2418::629]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 56205dc0-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:52 +0200 (CEST) Received: from BYAPR02CA0047.namprd02.prod.outlook.com (2603:10b6:a03:54::24) by SN7PR12MB6690.namprd12.prod.outlook.com (2603:10b6:806:272::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9031.34; Wed, 10 Sep 2025 07:39:46 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::12) by BYAPR02CA0047.outlook.office365.com (2603:10b6:a03:54::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:46 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:46 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:42 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 56205dc0-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rFhzBuSoEqGo1qfmYewzY2UDPyyD1XOvaCgJ/Oe0sh/CWf15by+aBzZBf8H4bApY7q7bm3isd51+EbqDoVxAZprboRFpwg7smhH00J2UVo34C88MfnjNKvVL/oQXVYxh0qV+agk6v7g/BNeBjmC92AQQ9LFJskpakbPr3pmUHNrhZ+/0+dxINzgpxM2Y4x91f0aW+oj86X0V1hgM6twM2r3zU1T6Doi/CeZX823mcgYVzJCTUnt6hZI0dx8NfsFd73dje+Uvn+zMyw8Qz1bq5B/uiCC2ivHjnBl3SxCDaSeDPn5a4bdQtiPCOcVy5B+XU3HUzDrcG1YySIveURVQVg== 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=zkokiDvf/GT2g8eWcD+vSGI07NbkAbkWkG3C6DWEVjg=; b=erIj7X08HTx3JEqR+EiUBdvqPVsBNcp5hl4FvpNg8kYP4livdjI3ZcfsWRahkc6VA2XZsU5V1SJAEJzA3NIlYumVmLIWo0pAJ74ZlnatdIQgDX2ZTDqOCSC9aUljggHhSoYMP5jTlACYFDNMsMSfwbP7pk7bgkh5p8taiXs247MeWYlsCr41088E5KDk2cJfn1qW4VDpLePIJ9rBdseKaWCmFUryA/LeLYRcNIwZs0eO3kW68EKZq243Xr0kzuyFyqhN+WrLZ3NXAMgYbFUmuwIdO3gs1bBa7rCCo6K+Rg3CrocNvs0iNDTHA5+R6FMKnXq1z1NzO+xYTSlOOto73g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=zkokiDvf/GT2g8eWcD+vSGI07NbkAbkWkG3C6DWEVjg=; b=CqYunTH/CciNKIrKwijIzmwrADepuLsVJpR9h/k0scVLZ9rCCg3r0BciC0/qgHSRe2+sU1ZLZyNqayrCF4MyW6ZEu099XJCk5etH/XCIFE0VA4yB+a1gSRXU2Ini6X5xBLpoJTmH/+NylDkDKJ/cn/zmaV3VsFs3oXj6hiHu40E= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 16/26] xen/domctl: wrap arch-specific domain_set_time_offset() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:17 +0800 Message-ID: <20250910073827.3622177-17-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|SN7PR12MB6690:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a24d557-f83a-4dd1-fc8f-08ddf03d3729 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?3vhuvEjMv/cpVb/VAqf3IpSIPlbny3JZsTOL8KONxHr7UEMtnZU5jw3PpXhg?= =?us-ascii?Q?W+U6i0YDgJf69lFf9Di4z1ZgDTB1R+bh9l5fui92ha6Y7PPUSYqgrg8A3SjC?= =?us-ascii?Q?AZqS/Cqgg5uw/e+5YIKYaT9+omdSEvVhFYr1aQsY1DlGprgbTOXkyMX7f4ft?= =?us-ascii?Q?76QkTx3EW7z2pznpsp06+2u07DXgj1nTUHtFWMGSKZcY1alPitOuTaEd8ivo?= =?us-ascii?Q?NW6WxX5Waqw+DXP89YHbF4zxScogxSwY5uloHPqtkyusDwzdsZfnyWeq5h2+?= =?us-ascii?Q?fQ1R9Sw689a9vQFFyGCBby/CwqAlIe1USLnEIEEqSMm9Lu68SuxaJdCksVUj?= =?us-ascii?Q?TG6kvfSmgt1A+buRZKsP7SMNwOYUi9mgRNbLTKMPRKMCCqWSOrDynN5fnC4t?= =?us-ascii?Q?O3ZRbwtRfCoImr2mudqTS+56jROFJG4xGrskYpjnVRP7p5YLjGVB4ilF9cUq?= =?us-ascii?Q?OfRwQreFDHCWpGI6Kcs3VR1jMvZ27L9k5yVC6DN1KBgd6YsGJapRUOmGfgjc?= =?us-ascii?Q?sNaWboh/Vh+pkdOrHSJ9UU6zP2mNFcRECL5xWAwXsOEZWG70uvNe6b2R+vL+?= =?us-ascii?Q?HEXbl179UVRkT8G1rwiszoAVYe6q5WBRMl2cbtCe3npyqSkHUYz5JsPM9FDP?= =?us-ascii?Q?soxUMAUQlHYx+xdRh9jhfbOCALi662DQmOKbww7TYTBhDUlcv2h0FW84KBs6?= =?us-ascii?Q?2RplZX78z0/rmxZK3wra7aVWNxyumlp87tE1krEWuPstWoLlXx+NVYJNVzlm?= =?us-ascii?Q?79YKpo0aP2nVTiq3LUehdIA6Q+Fj3Zfoa67cVeEAzVn8Urn1FMHS+OcFfyQv?= =?us-ascii?Q?UIIrbTgduK0QPAdUXQ5RLKJavRnkAWnrz7EZyRls8HLKGVmpGV/ZQAyEyr33?= =?us-ascii?Q?46eu0apmll0gDJj4gotwXVmVSYzdf3Zl4NmiZilwx7ZCKAh0iVFoV3MHSXuF?= =?us-ascii?Q?7k8aazlkJ7UW/Oldsxx/L1rFLEcT7QTJPXRGvIgA9MJ4+FF4Hi0NGAALFi1M?= =?us-ascii?Q?wRMIf813TxNg+lMBQUODJP6q3ScpADIgl6Qo/q7xm65MQfkteNa3NLfY4qkC?= =?us-ascii?Q?CDXJhIdonC892Mnn4LKTzFu0SD73E+7U57ripeX9KrgIBtyo5K49oyZs9RuC?= =?us-ascii?Q?R1bDRhF6xHziyyEA0qva8gqQ9swi424BAQ1W5b5NwaKhDUQT4kanhP4S8/lL?= =?us-ascii?Q?X9/Brszy/Ua1v2nswqRtDSIWKVcwOkcEjakIsJeUgD6f/UwEtWFEFjQeUZhf?= =?us-ascii?Q?DTqa8XAuqbZKxH8NfcT2/c+DOkPd9i6LwADd+R2WvoW02bdujZV540sM+ImV?= =?us-ascii?Q?WJktsgGYe0tImxdiRrxbv8bbsNgEbpOZf0CzQQ6vFMlqr6S7e8ZDQWCGoBH+?= =?us-ascii?Q?7DLghzNLR6dQFpgmk7FlfD3s4LXvYhQy983P+FPQ0Xb4f8gO/F0LP6kln5Ki?= =?us-ascii?Q?wNnEI+ccrT1GhZBDpVgvn7PrH775cvjcv0mdq0ATPn9DEXx60Cop2uEgAEdO?= =?us-ascii?Q?JrIRqrYISNOuN9JfXhNcJh7ApLAb1EnYzvgF?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:46.4922 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a24d557-f83a-4dd1-fc8f-08ddf03d3729 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6690 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490397629124100 Content-Type: text/plain; charset="utf-8" Arch-specific domain_set_time_offset() is responisble for XEN_DOMCTL_settimeoffset domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Wrap XEN_DOMCTL_settimeoffset-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Acked-by: Jan Beulich # x86 Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_settimeoffset-case transiently --- xen/arch/arm/time.c | 2 ++ xen/arch/x86/time.c | 2 ++ xen/common/domctl.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/xen/arch/arm/time.c b/xen/arch/arm/time.c index e74d30d258..dfed0b0ab8 100644 --- a/xen/arch/arm/time.c +++ b/xen/arch/arm/time.c @@ -365,12 +365,14 @@ void force_update_vcpu_system_time(struct vcpu *v) update_vcpu_system_time(v); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds) { d->time_offset.seconds =3D time_offset_seconds; d->time_offset.set =3D true; /* XXX update guest visible wallclock time */ } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cpu_time_callback(struct notifier_block *nfb, unsigned long action, diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 59129f419d..e7394ce8cf 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -1841,6 +1841,7 @@ static void update_domain_rtc(void) rcu_read_unlock(&domlist_read_lock); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void domain_set_time_offset(struct domain *d, int64_t time_offset_seconds) { d->time_offset.seconds =3D time_offset_seconds; @@ -1849,6 +1850,7 @@ void domain_set_time_offset(struct domain *d, int64_t= time_offset_seconds) rtc_update_clock(d); update_domain_wallclock_time(d); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int cpu_frequency_change(u64 freq) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 6048a87826..776bf7b8e2 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -748,9 +748,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_settimeoffset: domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_set_target: { --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490405; cv=pass; d=zohomail.com; s=zohoarc; b=jjVpB0LwzabvtSDEOslIikong0+4J/Hd3+guXlHH+sItO8RJZx1SeXeEy7XQAWV9j4+2ai2GG8M0UCncZEA1eS6BFya7B53ey6qRywvXSy3TCpusZZXPnGKEcSZUSFOUXaRT7pEpCEYz4VVvStayplBY5bf6wTixW5QdMx06Poo= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490405; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dsmFgRDA4WFTLrqEIuLxOXiyrzOrGFpurXCsxhnftMA=; b=WoNZDn1De6n6US3MzOFEjm6sA51PRakhzfEc2cDZcDpSfHUAmwMjd14Om8ATAlfneyYnv4yoB7s738/JRZhC0u8aiL6EE4nmtVSOmkaBs5Jr3OLKMh865CnHrF5d4KfxhQQmIdbA6YZ230qVGeGEwLzJWWcwSN6c+VwZ9FUP4YI= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490405456481.20100350651853; Wed, 10 Sep 2025 00:46:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117704.1463826 (Exim 4.92) (envelope-from ) id 1uwFX5-0006yL-7H; Wed, 10 Sep 2025 07:46:23 +0000 Received: by outflank-mailman (output) from mailman id 1117704.1463826; Wed, 10 Sep 2025 07:46:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFX4-0006xl-To; Wed, 10 Sep 2025 07:46:22 +0000 Received: by outflank-mailman (input) for mailman id 1117704; Wed, 10 Sep 2025 07:46:21 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQo-0005yo-9d for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:39:54 +0000 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on20622.outbound.protection.outlook.com [2a01:111:f403:240a::622]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 554308fb-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:52 +0200 (CEST) Received: from BYAPR02CA0053.namprd02.prod.outlook.com (2603:10b6:a03:54::30) by MN0PR12MB6126.namprd12.prod.outlook.com (2603:10b6:208:3c6::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:47 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:a03:54:cafe::f1) by BYAPR02CA0053.outlook.office365.com (2603:10b6:a03:54::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:47 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:47 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:45 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 554308fb-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gundG3Imx6ihamTOiGDIoBSl4+M9m3E90m+DSvXZwP1k0rdrfg9q0ow1T9eeTQIFnshBo5IjebCS0SYQhYEqID18O8GyAajoKDffPyXpHSZWX2uQ2jxt9PeDHq2ry9ZSMaWC9U9xmgAxS75Nq3cFRcJJSuxhIsQ1ikahwQTYeaq01lmjiaSDKU3pmlFQwC5ximcp29c0r1oV0JVx9w0xqJjklBhkOw8Hc6DVPSEQc+E0InwN9hc7waVoJ9Zr7DXxLpoOzLIYM7HWCYA4L7569pnKrnh/sHV6aQO92HJ68sx8rLAVyltb3Nwgk7WgEPVTyaRSqpBo6ERgvEaWPokqEQ== 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=dsmFgRDA4WFTLrqEIuLxOXiyrzOrGFpurXCsxhnftMA=; b=buRt3pol+wnP9OX6fcBs3HaKn05AEk6MUaP46Yjr+Kyz0lbY8i1n3iSYuDnvX2wf0eOAHNqkOoFT4u6ZJD+tkvGB8GtGOZD24AbpoE/ZOcSji9AbCm9fgVLHwSzLPUem53vS8nsOLgaUG9zokN4Px4MvhIIZ/3J7+deRXw/MgIyZPHgpFGJ+k/FWs4ls4NU2SxX/nAcxG+ca55wwN7NRu45c/0HiqO83IxfX00g+UfpaTM36P3pw+X1Xo8dxl2eBKeG0z6gSDBcYK1DAEo+ZVUccVW13P5svBvFWoIai4BsweUKClL/9if+TLH2i+efYzPWvBIstgftGrKkv374DsA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=dsmFgRDA4WFTLrqEIuLxOXiyrzOrGFpurXCsxhnftMA=; b=EoPjfOnxqcoJmG/3W7DgG8em7FNQL1xZJIgnbFwvUm6TPRXrSiGJxZsrb7/dJV82syhpQ52Fi90bfcoNgst/wfg75Z2AszOlPHdgXzFTt+Sw+2Kgjlm1hugKUOC85NUl7s09ZlvUAPS7fOtRHc2b5Ahi+NQP4SDTG8GBGNkOsgc= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 17/26] xen/domctl: wrap xsm_set_target() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:18 +0800 Message-ID: <20250910073827.3622177-18-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|MN0PR12MB6126:EE_ X-MS-Office365-Filtering-Correlation-Id: 6c74ed39-fce7-4469-b6c9-08ddf03d378c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Wz1ZR9o3RS35/bobW7WRwWgc7f1Ag/Iq68r3HhSmQ7ETfJFsJx57bio9JSed?= =?us-ascii?Q?rQxmx3Og9Ep7AyJi/lL8zN2Sr/aGl+CXsWJQyuJn0lJfWEKtRpmYNbuWDqMZ?= =?us-ascii?Q?31Lw/f9V7GoEZfptFzxbNAnkQnQZXKrieEaawqL5SwPaO4tgYvV/UePz4BcW?= =?us-ascii?Q?mcIfgb6IVbvmBzyjEhjdow9qx0nOHWp8C9vRRY9koHFO7gbxnrsqR5SjORQh?= =?us-ascii?Q?Q/LxKWiDY7F8hxp/lfqZq++ATtNoRtfMNEKUSE0nYzKLwP7VbnzZTRlSEVe/?= =?us-ascii?Q?TrWddusO4gNqROECbl6ZqS/uLhRvtvA1UaCp9jf8jwOVg23q9Ln7gJa4BFbo?= =?us-ascii?Q?l7pXYhxJ9VwXlozc/MU0kaY5zESqLyObZ3quWQTP9rsoEpnV29CpTE5OTo8D?= =?us-ascii?Q?U29juWRa2V8HupYArkEQ9qv3PY3tlnLKWBCLgXxtoI1d3RfBS1IIaO9X6nTR?= =?us-ascii?Q?CVaGm7LJmxgqQRzKrYgxHjHWEUTKaMP+eWzA8Rglu4ETITBEeLZKkxE6psq/?= =?us-ascii?Q?fxU+rFHbC/9cgcQtNA5dazZ659jCMCtgqcn0rJwnxDcfCvRCKjfZpHVs0XLw?= =?us-ascii?Q?FUEIjiMygQ6fnfwE9AfqPhqqsvxYVvuqn9a3OAWmrMpbo5ooxsIvm+D4nxy9?= =?us-ascii?Q?pAC0Lw623G+ay0GaK1jSZwKiBtNaVmroiEkIjWe6tFJ0QKezBsylhwHdHQGm?= =?us-ascii?Q?kxrmsstHEaYUFmXK8Bmron3OtVJRvSaaMShNyvbPfxbQxS2j7Hfd4JPbFuNv?= =?us-ascii?Q?0A3uhtXMaJYBPgEBF51z3elhrHx8st6VEJ08KX7YS94SuzlqxvDpA0S8GkeX?= =?us-ascii?Q?lrSW8iYBm8PD1XSPhD/BWDX8I0tkI3xys70VeB2Qy5I0tfbLPjEMhtGMUUe3?= =?us-ascii?Q?7UuB842C4n3QTQmPrHK43JLTWJKlmGMuPgOYFznHLyQehahZrB6ibBhmLcpg?= =?us-ascii?Q?z1QrQztbn3vczfYnvvXvpi2QgpFsyK1Tz5RTV6icp6DziWu0t3KI35HcWWiu?= =?us-ascii?Q?+QPdKosgjDMg/41xvV+z9sYpMourgFgQXUcbc6K00Q7FvHI0U1YDkrNy8rn2?= =?us-ascii?Q?amLLBkPsFpdY/ESXJzUTxateISJeXv3DIoS9KouJc9X2VQnbJ29Q5US9MMTJ?= =?us-ascii?Q?DihZ1fBYHL/70JJc9Vt+y72kOTq+2wcCj3wO6FtRytPBNROjYxYcjKZWo2eA?= =?us-ascii?Q?FBCdpNz3rYtmkE/Zq/NhXKQ4lV/K2NX3XpzS2HGIWCN6RWIPsia4l6O7fD1Y?= =?us-ascii?Q?PiHwYDYYyasPmnQ9p/ozkXGKtseo5lxXgoAkljPF1k4EnivA09MNNK/M4ohr?= =?us-ascii?Q?grwjqQavdF63G1kJIj/J95rIWQaYdpayACJhGcwL2DFDNFuukNu1GjsALejj?= =?us-ascii?Q?zMwJN0bmW8Iqj2ZCsgrA7JRXG6ExTCh+9jrzCPcLNPHDY9uFVUbvc9WxpdCP?= =?us-ascii?Q?y2fPft48n0ZTrqFfSDqBA2zFUT518jDKioFv6V86Fwfs1LT1oM5pgiZatvTA?= =?us-ascii?Q?bu5l7fTfmz6MbbVTBClwh73JQOUHZpvO4ktl?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:47.1394 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6c74ed39-fce7-4469-b6c9-08ddf03d378c 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6126 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490407906116600 Content-Type: text/plain; charset="utf-8" Function xsm_set_target() is only invoked under XEN_DOMCTL_set_target domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS. Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/include/xsm/xsm.h | 6 +++++- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 1fcd945336..678cb0f346 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -59,8 +59,8 @@ struct xsm_ops { #ifdef CONFIG_MGMT_HYPERCALLS int (*domctl_scheduler_op)(struct domain *d, int op); int (*sysctl_scheduler_op)(int op); -#endif int (*set_target)(struct domain *d, struct domain *e); +#endif int (*domctl)(struct domain *d, unsigned int cmd, uint32_t ssidref); int (*sysctl)(int cmd); int (*readconsole)(uint32_t clear); @@ -258,7 +258,11 @@ static inline int xsm_sysctl_scheduler_op(xsm_default_= t def, int cmd) static inline int xsm_set_target( xsm_default_t def, struct domain *d, struct domain *e) { +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.set_target, d, e); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_domctl(xsm_default_t def, struct domain *d, diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index b216894579..f6986dd2bb 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -21,8 +21,8 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { #ifdef CONFIG_MGMT_HYPERCALLS .domctl_scheduler_op =3D xsm_domctl_scheduler_op, .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, -#endif .set_target =3D xsm_set_target, +#endif .domctl =3D xsm_domctl, #ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D xsm_sysctl, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 198053be77..ed4e466302 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -641,7 +641,6 @@ static int cf_check flask_sysctl_scheduler_op(int op) return avc_unknown_permission("sysctl_scheduler_op", op); } } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_set_target(struct domain *d, struct domain *t) { @@ -666,6 +665,7 @@ static int cf_check flask_set_target(struct domain *d, = struct domain *t) &dsec->target_sid); return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_domctl(struct domain *d, unsigned int cmd, uint32_t ssidref) @@ -1893,8 +1893,8 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { #ifdef CONFIG_MGMT_HYPERCALLS .domctl_scheduler_op =3D flask_domctl_scheduler_op, .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, -#endif .set_target =3D flask_set_target, +#endif .domctl =3D flask_domctl, #ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D flask_sysctl, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490405; cv=pass; d=zohomail.com; s=zohoarc; b=UoftVyxgGwuRV24e1htpqADxeaVwWXOQp88NNOVoGe8JLLY2lkJAEX0i9TDvUV2UqpSRNs0S8ZIeLCPNtsBjIQxQiXpvIIDiqastXNWukBk/0xAXX/cy50rMS+l3mo7BErxId57WqnzH6F1N9l+xHpLBDrpv8tVunupOjnzrZtc= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490405; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VtXIKsaoo6fvEkspM37p5TMDLQUd1SnKg2qpc54XTls=; b=WSDeaNPyjqEW7Uy9BUY03GUndC1eUEyAplYPh9YQ0AX/JoxpQUrsjOjs/BAPGCN7hPfn2uoMUVPUhmfy+A6A91hCUKFxytj9oS/f1ymjf7rpTN4MBhpKlM5XIY11bJ4PEMZggZ7GtQO5jrAESsV61pYSLmZLYrRwRJHcUoCgGRw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490405454436.7879820129989; Wed, 10 Sep 2025 00:46:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117741.1463855 (Exim 4.92) (envelope-from ) id 1uwFXC-0008Oz-08; Wed, 10 Sep 2025 07:46:30 +0000 Received: by outflank-mailman (output) from mailman id 1117741.1463855; Wed, 10 Sep 2025 07:46:29 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXB-0008Oc-MI; Wed, 10 Sep 2025 07:46:29 +0000 Received: by outflank-mailman (input) for mailman id 1117741; Wed, 10 Sep 2025 07:46:29 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQw-0005yt-7q for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:02 +0000 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20629.outbound.protection.outlook.com [2a01:111:f403:2408::629]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 58eb3ce0-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:39:57 +0200 (CEST) Received: from SA1P222CA0037.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::18) by SJ5PPF01781787B.namprd12.prod.outlook.com (2603:10b6:a0f:fc02::986) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:49 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:2d0:cafe::8d) by SA1P222CA0037.outlook.office365.com (2603:10b6:806:2d0::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:39:48 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:48 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:47 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 58eb3ce0-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jk+GyVe5CV2zvlAw75YQ9sj2jIF/qmqWkKSxL6tXt3I5wjcw4fILKXx92n5Y2NMLAOPfQ1BF4Zywd+oNYXV4IUOmu2a5y5W4rxZ999tSkOqSJD/YAUm5ztPft6j9QFiQwQuq/eObybmlEX1UqUHTUb0r78tJsO+/WOVXAbnJZ8IOgAunol5Oiu8HQ56DhtfcgCnuj4RfM2nW3zKjQxCf1z1Cw1H+7CaA2aw3k6VBxZNDB+BQmhM1Y2vdm7NOP4xqlUHgbkdsvbjjyqr8rhl7SY8tvvjP8cF9qzkxzU8Da3ij82Rjc+T53ZRiLVO/rPhnpSj8bvfYgXzVUQRs8EsSaQ== 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=VtXIKsaoo6fvEkspM37p5TMDLQUd1SnKg2qpc54XTls=; b=RSALfKEfzfT4e0SZMThSybXWSBtQcLMdoUk6HQiuLxPii1cwPOvyNljmqquNVwf7abN/4lQjhcawWEOKoXNCnUwXaKdM4nAbfC73/lNs1BljdtN9I7sceFJ+9Vh3Iqvc4l+mHN0vTUJ6o69ESxiiUD8HtP1RxwReR0W8f1pepcbaKZ+hIgV0xygnyCdQKSzfqKLbkEicaVa9Q4+wkldPfp3y+zM3SCzHqrZuqNjPEPL/Ih7o9/UD/RxS7Entk24z8nUfO+/z840Ahu60WGK81RCQcjPbrLtWklShkXc3iUlfIMg+zVY9ATYwo4FQalCAfd/Iu8ivxMzf8pNoe6Y6xQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=VtXIKsaoo6fvEkspM37p5TMDLQUd1SnKg2qpc54XTls=; b=QhLBv6JqYKJCMCoCEHkhS3GDU6YczdmQTcVAadYSbauCBGKdUkMp6p9NvPCZXZPs6AqXLi9nJPShJy+em2Pz6w/uZqsIyTOqNy6yzVPP8decrfQej6bYbrUBwOVGwSC6lLHafT36Sq9oOgUVsudAau/1q8sZLuk+h5zJ2R0emSQ= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 18/26] xen/domctl: wrap xsm_getdomaininfo() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:19 +0800 Message-ID: <20250910073827.3622177-19-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|SJ5PPF01781787B:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e943df5-406f-4760-a8aa-08ddf03d388d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9jZHMu8Ju168MCTHwrbORcohN5rYy2Iv+ZnZC6Rj1NWCc8UCM0Qua1GjjdCf?= =?us-ascii?Q?L9qQuLpfJHvYBXiX9SXFcWWk4498Lu1zEGzs9pOu0apuGF2WqOzOuKbhP61a?= =?us-ascii?Q?53sGo2vZFzQupgW56Qk7EYsXzI4wROZyjb2mZAPZq11+eqzGiqNt+kCXz7ep?= =?us-ascii?Q?Dv3dh1wTWcsV4g/l9UB4pup6BGjfKLf4v25w7FySupZgDC2Y8Cg2G4113ltk?= =?us-ascii?Q?t7PUgo0RW1psbkPu0Q2iBdPoe4uuFP/tdGKoZC/fMF2drFlZW0YSHvd1g0XA?= =?us-ascii?Q?oYbSWalIRYCQ2myF1dL6wvePysC5gyIoWOJBdYL9pU+Re/JllEYb5weHnOaq?= =?us-ascii?Q?3vgSopUrjCNZBEt1QyEbUdiVUE09tysAMKMXwGdM2hv2zdzmz83Oj0A6GG/L?= =?us-ascii?Q?zFhw1jb0Gc0wOvgG0PYCV1scuKF32XreGk2rVMRVQvIutn63oaC2mD96bQ2K?= =?us-ascii?Q?tmlRedzY9fiWl4EfRVorobPLRfAdF+BhJLnWBMLbS2TLUrWdO6QjEXeMtDma?= =?us-ascii?Q?NHpM1l9Quk0kio0Qdshdr1U3AHg8jcoZGuFaJ/nwQn7j91pm9n5R1kEiSAx6?= =?us-ascii?Q?B6jsUq+/ehJQ5iWGN3j/5z3MD3lB98tJabbkiZZ/E35r4kpgFQbL1CFK9LjN?= =?us-ascii?Q?bySHT7mN+cSpiVlIgkpNJYvh8FWAvRMKjCtrmHKuR7zyuSarxtogm367fRel?= =?us-ascii?Q?/8QBp9lzAC2vp/AUFSODqAa9MIm6w1nnAthQdrdTtBFTG/LWmgLiGHFw6kn+?= =?us-ascii?Q?i9NCdW1zP3lcy51cxKrHfDOAEUo0qdJR1sf+No/VJG3ogNWCSz+vCoIvSi2P?= =?us-ascii?Q?L8D53ryNJ+Ip+1zw44sJ0JL/bz3gI1/zbl3sdUd9br87eol2Dad7p3/q3S9z?= =?us-ascii?Q?SGNWrE2xM8d3ZvXQhWccw0NjoLqF5Fuu2G9/1P7N4tUa05nxXryvOnA9r6O4?= =?us-ascii?Q?jAcmnaDp4Z20EDeHvfNalHEdF1mDj54lnID8mH4bQoVofgV5UQJsaLhXZBw9?= =?us-ascii?Q?InwgXdnbvLVGBT5ksA65um9+8ODqFmDugDPuJnuJjkQYCHr+7wfBd7ZbFMre?= =?us-ascii?Q?6wAnMJavOqb1C1NliuiBx8E+9WDbca+T6pP+k1+0PmgeSIjgZ8sY/0kxHSEK?= =?us-ascii?Q?zg9f8hiR3kGxvnBLfAPzClN8D0KJmzs8HkZ8zIaY8TWOcEwg145fy6edqnYP?= =?us-ascii?Q?/8MCXQAzmovFpl0Zt/BODjel8+sij+e24g7rCv5SJnsheXTg3B4eoXBhSWvg?= =?us-ascii?Q?ZjWWSEn9wkC8kIW5L1USNMysNNHCOxX/IHrvXVM+P5A4Tx2OjNf1qmIlmK3W?= =?us-ascii?Q?iapgqY5IvHd2q4tuMCcfBc4E+H36hbGyThXdcai6JNKFvrVvGODk2DGZV8mf?= =?us-ascii?Q?77QwjhOYyXjJhCy9fDK/NXGbJBibjEngrwvTuEGE8yZCwWYhCCuxS5HUqJPe?= =?us-ascii?Q?/+85whZryOCeZnI1D8M64rasVORhufA0vShR1W692TpGy537kq7j37UvgiUq?= =?us-ascii?Q?JCrFiVNxvtvP28nTWG7+5fkCnL2lHQdz7eIR?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:48.8238 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e943df5-406f-4760-a8aa-08ddf03d388d 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ5PPF01781787B X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490405922116601 Content-Type: text/plain; charset="utf-8" Function xsm_getdomaininfo() is only invoked in XEN_DOMCTL_getdomaininfo domctl-op, and it shall be wrapped with CONFIG_MGMT_HYPERCALLS Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/include/xsm/xsm.h | 6 +++++- xen/xsm/dummy.c | 2 +- xen/xsm/flask/hooks.c | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 678cb0f346..2a107b2cde 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -55,8 +55,8 @@ struct xsm_ops { void (*security_domaininfo)(struct domain *d, struct xen_domctl_getdomaininfo *info); int (*domain_create)(struct domain *d, uint32_t ssidref); - int (*getdomaininfo)(struct domain *d); #ifdef CONFIG_MGMT_HYPERCALLS + int (*getdomaininfo)(struct domain *d); int (*domctl_scheduler_op)(struct domain *d, int op); int (*sysctl_scheduler_op)(int op); int (*set_target)(struct domain *d, struct domain *e); @@ -234,7 +234,11 @@ static inline int xsm_domain_create( =20 static inline int xsm_getdomaininfo(xsm_default_t def, struct domain *d) { +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.getdomaininfo, d); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_get_domain_state(xsm_default_t def, struct domain *d) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index f6986dd2bb..7c4e6176aa 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -17,8 +17,8 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .set_system_active =3D xsm_set_system_active, .security_domaininfo =3D xsm_security_domaininfo, .domain_create =3D xsm_domain_create, - .getdomaininfo =3D xsm_getdomaininfo, #ifdef CONFIG_MGMT_HYPERCALLS + .getdomaininfo =3D xsm_getdomaininfo, .domctl_scheduler_op =3D xsm_domctl_scheduler_op, .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, .set_target =3D xsm_set_target, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index ed4e466302..7392e95e55 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -604,12 +604,12 @@ static int cf_check flask_domain_create(struct domain= *d, uint32_t ssidref) return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_getdomaininfo(struct domain *d) { return current_has_perm(d, SECCLASS_DOMAIN, DOMAIN__GETDOMAININFO); } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_domctl_scheduler_op(struct domain *d, int op) { switch ( op ) @@ -1889,8 +1889,8 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .set_system_active =3D flask_set_system_active, .security_domaininfo =3D flask_security_domaininfo, .domain_create =3D flask_domain_create, - .getdomaininfo =3D flask_getdomaininfo, #ifdef CONFIG_MGMT_HYPERCALLS + .getdomaininfo =3D flask_getdomaininfo, .domctl_scheduler_op =3D flask_domctl_scheduler_op, .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, .set_target =3D flask_set_target, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490407; cv=pass; d=zohomail.com; s=zohoarc; b=fx7QCQ3ikO7fBulkXIfTU1e08Kt85bIRCkUUgKN8BQSMAaTmxewnUm1m47kbFY4qu4ZyDZkHw1vS/ezkkX+G1o5D6o8OCvhHaC6g7iPLRdcAVUbU9F+0TYOa0zlBNNSltgVY79PYddbXhnByn3U8iYfctppUdej2KUCj4O12gi4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490407; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZGyZbWaZfEIBYiIhPUBicJ7ty970xz/buEsqX2eLXCg=; b=hmrLUDbKaDxRq3bEr/BhAeUCojlrDYI8m4fd0vY0hkqVO2bkUgnUoL+sy2TQATf046o0zp3c1Fh3H7M96/GVZlzihpDa4kq5INOMay3WNsLZo2tLqwlHJMrBqcAcRkqm4aBI6BVgdacNgLqiLpVqQP+JnTwvse0iI8ktnIE/NXM= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490407724302.37230615827605; Wed, 10 Sep 2025 00:46:47 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117756.1463871 (Exim 4.92) (envelope-from ) id 1uwFXF-0000VQ-6Z; Wed, 10 Sep 2025 07:46:33 +0000 Received: by outflank-mailman (output) from mailman id 1117756.1463871; Wed, 10 Sep 2025 07:46:33 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXE-0000U5-Q3; Wed, 10 Sep 2025 07:46:32 +0000 Received: by outflank-mailman (input) for mailman id 1117756; Wed, 10 Sep 2025 07:46:31 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFQu-0005yo-3n for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:00 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2061c.outbound.protection.outlook.com [2a01:111:f403:2417::61c]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 57c69ddc-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:39:55 +0200 (CEST) Received: from SA1P222CA0047.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::20) by DM4PR12MB7549.namprd12.prod.outlook.com (2603:10b6:8:10f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:52 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:2d0:cafe::86) by SA1P222CA0047.outlook.office365.com (2603:10b6:806:2d0::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.16 via Frontend Transport; Wed, 10 Sep 2025 07:39:51 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:51 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:48 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 57c69ddc-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Oi1oEnzCXoywaEC4Krshfh+wk40FigGtYgLQpurH0kNhmVYbRvEN0klh0TddLzk/KFL3plUkfX4CoUZW1sX8YzOzudSyi9rAsHewpBUO5SP2OyDY3MJHYHByXJeuBx3GGZQzr0jRzMu0TUNaiFr+iqegVYY+Dw2k3Nymqm82ZeOOFB/vXRcsfiSfBWWuTCL0OsR3+J8FgIs2cZzqiJUUoK0kqFh2/exQ4OhiDle7wc2eKR1M1m24nJKy/KrvYBZOXw7BeHTbe7ubpfURBLH1d8uVmov1kJFBrbHYwirtXJegLnmwzdlQP/EUo6J/Mk7i7lGPuyDmNTQvC8Dzg2/bzw== 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=ZGyZbWaZfEIBYiIhPUBicJ7ty970xz/buEsqX2eLXCg=; b=Tcmzjg3cOilBkuaLwYaE+lMGIbeijHA9lDgMbvdVRe5F/rmHa+884XoEyRQ21WQs/14zBEKVJVFPHCmxNknENuLLw2X51ehXr2iTNIOdwuzKo0+kYh3o8GmwDhj3IfR20VrP1naehgLetM773+xsEWS91LCpnCPZ0AuXJdCgqxzajm7CGbGKSBcAKlFS3VT9tb4wprR9VMZzBRFHatL0pQWk/cigBlwtc0FnSf6CBgwUwfrDVZZb8jYW2u6mYWPXBeec7iaXRUi+cp5lkidHw4vt9rLKrQCnu4NnB1vqrKvJOU9GSFgqwhhi56doLnpoH5B0MpKg2RJGggyke8rFAQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=ZGyZbWaZfEIBYiIhPUBicJ7ty970xz/buEsqX2eLXCg=; b=0sq8xIeTBqqObh2NU121hzp/yNyZ9TWkdp4VQH/Tp7CmbvLotV5w6gJaT3grNf+PTq+r8OaRoQXJXg8U6NsCYOIWKYGZOmNbspAEQc7B1WQAtO+bLagq8WT+PYmseyktb21pKPHtfFXgJh7w0jxwIVAuRaAlztF3vVtfy9L9+9U= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 19/26] xen/domctl: wrap set_global_virq_handler() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:20 +0800 Message-ID: <20250910073827.3622177-20-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|DM4PR12MB7549:EE_ X-MS-Office365-Filtering-Correlation-Id: fe2d45ae-03c3-4073-dfd1-08ddf03d3a60 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?qT2NZjLdFfcQ9P54WrIz1xqSJc90Sbh29bQ+4yvC9P7k1KsIIEkJ215hCBgr?= =?us-ascii?Q?UFRC3mnRf3t93y51aJR6vHoBPy004qNGUywwGfQ6HQ2sJ/5j+o4nfgDKVovS?= =?us-ascii?Q?q55Yy9vkygNIxRaUr4Nfdfrg+6zQMA5dg8zQJzvIs5jEJLr5wJf9FehZQIPi?= =?us-ascii?Q?DN7MC3clyCTuse5tBFdq22zF0X3U1L1xeTqkMlMVbvEdVqhvh7h2FDYBd45N?= =?us-ascii?Q?FDgPyTpfbz7/wIHzYLXcDgo9Yqqy9Hu31MUsPSGA0i2NcIi2d48pPZF2C23w?= =?us-ascii?Q?vX/paTARys4HGoNVndTfdKPHeUINqQsBUNKI6nsp+Ykl9530hubkriYScks5?= =?us-ascii?Q?xmseX0wHnOANgx2AJYYEedN4OQU6704+/xuhOTrlOYnSRnfAKtSv7HjL8rk3?= =?us-ascii?Q?xa97YKOlamz09sX4XeeyKT7GodIs2XKqxPE129Z25mtKqgw8l9Uyp9kzzXAu?= =?us-ascii?Q?NTPHoeGN1pkMht/c4UH6jOYcLCOYwLP8PaDbbqbEr3SgPDG7aNK9RBa2OUDS?= =?us-ascii?Q?4uCc6Lsq0zx+/B66/0wLW1vmEwFogMFXw/o2aV9h9t2bzE06OJHVtVPBGCaa?= =?us-ascii?Q?zQVjv3lC2tRKKU2WKqT87nFDaXKcIju2UQMNH2W4eQAP7ccvTlbhENhy7jbU?= =?us-ascii?Q?z2t1hCoG24mLtR5GExQEM1EsIlzHtguPaLC21Gzn6nMIFV5NnBWhfmx+S0Pp?= =?us-ascii?Q?8Bxt4Kv6FG4LTEmZPE+qnpQP2MJo7Av7UrzfcwRjnbdRZ4bYIWs6ZwhtE2i6?= =?us-ascii?Q?C5pMXw7Z+Iw/ffToHEOzo9NihgzO6PqXTRfMZBwi0xlbelORn09dMpWcGfZG?= =?us-ascii?Q?dz7/ZZ/hI5rzU0QYjcAdlM6DLWH2GECaF1KhRdx6LIif0oH98LDKk04tJWOm?= =?us-ascii?Q?3S0pOWJMnoT5+T3ttVMC2FhE7PLzFoIcmz7y/E2xgbGCHIuKn5hVUJdJ516h?= =?us-ascii?Q?cJ/Tytzud7EJwyWj4mUk1R8otP18WklVBxlHSpk7X63+EeZcUTq41YDlE4cm?= =?us-ascii?Q?/G7tbi05GcxQB+xpwiKAKOckN1RFmJ1881z5gOmFkIkb3TKr80W5M48EGicE?= =?us-ascii?Q?D5sMSjUBzDuzBGw+OhqI2uacaKTxJFD0b01jn/2C0AqiAP23SYWKNwnPjAef?= =?us-ascii?Q?nY4MDogSajAO/3NAU4cOVeX7JoHazH1e+iRuCB16UnI2fADvvG984R58XRnI?= =?us-ascii?Q?uQ3clXsVDlh+6FWoPP88zewGJB6cPLyjGHfDoG/CnXt543+lodpi0effQg3T?= =?us-ascii?Q?uplO/HCLYeT20TE2gvly6MJ34OYBTSSUJrDM9I3bcKgRAWQy6cX74JEEDaV+?= =?us-ascii?Q?7VCUEMx169Ziur4wGfmUtDCxv+2MSlFgFjw8TODd5i92WvREcilpCiP4AvJ8?= =?us-ascii?Q?5a3O0mS9/78/EWckiQFPpUBwvmdLKZYIYFnnmDDw0MKOxthLrVCmUEnLT8xT?= =?us-ascii?Q?uhbNwjUtjxqB9BjmBBtvIqLjkshRIXqFuUjnQD4ILDYnaYO1Th1IfHDK3Mp5?= =?us-ascii?Q?bYh75cDVpndq49Ytwvup8lAd1E1KrKeVyO7X?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:51.8857 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fe2d45ae-03c3-4073-dfd1-08ddf03d3a60 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB7549 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490409884116600 Content-Type: text/plain; charset="utf-8" Function set_global_virq_handler() is reponsible for XEN_DOMCTL_set_virq_handler domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS. Wrap XEN_DOMCTL_set_virq_handler-case transiently with CONFIG_MGMT_HYPERCAL= LS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_set_virq_handler-case transiently --- xen/common/domctl.c | 2 ++ xen/common/event_channel.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 776bf7b8e2..736ad52265 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -808,9 +808,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; #endif =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_set_virq_handler: ret =3D set_global_virq_handler(d, op->u.set_virq_handler.virq); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_setvnumainfo: { diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 67700b050a..bb53dc1fb0 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -1006,6 +1006,7 @@ void send_global_virq(uint32_t virq) send_guest_domain_virq(get_global_virq_handler(virq), virq); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int set_global_virq_handler(struct domain *d, uint32_t virq) { struct domain *old, *hdl; @@ -1068,6 +1069,7 @@ int set_global_virq_handler(struct domain *d, uint32_= t virq) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void clear_global_virq_handlers(struct domain *d) { --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490385; cv=pass; d=zohomail.com; s=zohoarc; b=hmk6JIVIngMYYTA7sw5FnkSHhc6apKwQCGtLE+3zirtu/QcBXodCKP+JtKwwOhKaUneGAsHmum99KqCurfOpYNai3xop5nKif3ZYfYQ0K5CJL7gMmSeYjR87z7VBzRH2dis4JBQNgvi9Hf7hFHQFryzQ9R6r1fwbidA/qyfTX9c= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490385; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=jW923e2M3GzF3ljplSHb2j/zzkbSspIlyd89Yjzbzwo=; b=k12ibFFiY2HIgQoHfSaM6mV4qA3ANGT4OD92+YgPveU1HnSFxf6Nw3Ib7cjGms6G/d/WzX+C3MTCKQ6hZTJug/pttqnMPAo0WJNEhlGokQY8uh6FI88g0QgyIjidjIYlG4Kb59THdpRomYxLS1QZQaJVn6iUrjuhmwO7JEuPb9w= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490385975175.08864112050526; Wed, 10 Sep 2025 00:46:25 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117671.1463765 (Exim 4.92) (envelope-from ) id 1uwFWo-0004ih-W5; Wed, 10 Sep 2025 07:46:06 +0000 Received: by outflank-mailman (output) from mailman id 1117671.1463765; Wed, 10 Sep 2025 07:46:06 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWo-0004iY-Sq; Wed, 10 Sep 2025 07:46:06 +0000 Received: by outflank-mailman (input) for mailman id 1117671; Wed, 10 Sep 2025 07:46:06 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFR1-0005yo-5D for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:07 +0000 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on20630.outbound.protection.outlook.com [2a01:111:f403:2409::630]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5ac635c2-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:40:00 +0200 (CEST) Received: from SA1P222CA0042.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::16) by CH1PR12MB9720.namprd12.prod.outlook.com (2603:10b6:610:2b2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:55 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:2d0:cafe::a4) by SA1P222CA0042.outlook.office365.com (2603:10b6:806:2d0::16) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.16 via Frontend Transport; Wed, 10 Sep 2025 07:39:55 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:55 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:51 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5ac635c2-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=OU0H91HF6Ua+E/82kCav35yGWM/O9FArr2e01xAMpp6nrks1Zoui1rG84cdvj7Spb/Y6eCacSDjt6XHPhUyUhT4aZnhbRpqSyJr5ygrRjIKMOpoDaSNqlxwefXz9cg0LSs9qzroeAo52JHSULrrJGvLvk/EdVYo5Pws3SMd8yRCX+jnlNIdOPmaW6vwvq5DUx19hJs1iA3NUy/sLfRUtIvkvuFdVg+Y2gOMTVSYTYqW8vOOQ03trX9DphskyM+5fVip/Q2cUy+qsMQXjn2FkgoVUsKbbAqShA8MjGNbj/0s7uZp+CCWLOwZyp9daPeiaIOT3widijjGoBOBQ1qRX6g== 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=jW923e2M3GzF3ljplSHb2j/zzkbSspIlyd89Yjzbzwo=; b=rujnfxTKthQG75Ura5YjFW9LFY6mEZSleZhS3OFzLZImq6T0usY/xEF3mEzo73JMoXbbQXo6bFYZHe+qA58ZOWNAK9pyVCbO9VKLWDDQzcnDpqUAllI7yQzDqUlsL/6cLPAnYEkqle3Jwou0gmAv9y+CUqiwg0DwBAAAitu1bA+40/JsGdXOBS75jfgK1QC9a9cj8dKQ+JCw+5ZZnODwsqicJD9+vxufwQ8d99GS0AfxgnEphfCdcCqm6nVNKYUg7JNdGmV+UhNRNN/r0QCWIOBhfUfb7oK1MVM0B/NWcR17tXqosRHokoMd9zO/EpKa4B0IZddpjAhcaezxWVq6tA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=jW923e2M3GzF3ljplSHb2j/zzkbSspIlyd89Yjzbzwo=; b=QdwvlenUwEWgaQjxur6h5UoJLhQgI8TQ5yaI8hqhuLyIOpqdmcxPyOViWcaGJk4UlrGq24CCIFOFNBspDrJiukDpJcutuwngmsMU7JoHyLdrDRK3YGxf77q/rNHsYHbVpZ/5gnlz0/HDqp3Uwf0xo+d8OHI24ZXuHdN7K2Hp5PE= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Andrew Cooper" , Anthony PERARD , Jan Beulich , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , "Volodymyr Babchuk" , Rahul Singh Subject: [PATCH v2 20/26] xen/domctl: wrap iommu-related domctl op with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:21 +0800 Message-ID: <20250910073827.3622177-21-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|CH1PR12MB9720:EE_ X-MS-Office365-Filtering-Correlation-Id: d7651a22-fe8b-4a97-f6a6-08ddf03d3c3e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?otpdfLhyKYa7lrIOKNubZg58mEhy15hYbv4gwS0yGffMjFVNZlivS1B/0qvu?= =?us-ascii?Q?hw6A3zMreK5aSUQzg/TwowuCmGHxHan9B/qzcx6NpSYRRN4ZB4GJZi9niLop?= =?us-ascii?Q?MYPubV3Tjuct+zwDqlSWmtJacfNprcwjXgLNv9bgngdtycYxnPwd1cMI4uPw?= =?us-ascii?Q?nKdTggiGPpx3zyRQ8QXi2rGznFS/QwI1pPOV6kyzyCGKeEhkP8yIG1Y6/y1F?= =?us-ascii?Q?0JgitxrymVuEykCXTGaIErw62BQPQpv3dTSyMazRh3msGhExk2BnT6VO9rfT?= =?us-ascii?Q?2iQfZPVcexH91lTqHU2yCTc0lLcPWLy7d8Hui6Nd+8ICyLZS5eE9hr9+bCBM?= =?us-ascii?Q?eAJJphYPo/kD1ZGuLVNo91Dg2l0143Jd3StPiQSBWeVbGJK1Qjj82hLIh6wS?= =?us-ascii?Q?23EPjhdbKcU1RnsfTnr875KKh3EaXHrVOK4OEZt0oqxd3A+dgc7JLkpFxK9y?= =?us-ascii?Q?LaNmo5VHcMYh6wFwP+MKRsgbufxlid28A4Yo1dcC3+3MjSnijHRhlFY9bQZ8?= =?us-ascii?Q?RgztQAln6I163FmDyDe35Q0lTGqfVUB7IuC3y7QIHyXoP7/FTO+Gl2F0kVvH?= =?us-ascii?Q?+euwAhrJqNjzzciNvRM14ncLQE1WC1V9AmWc3U5QcPJpE5U3o4u6cOt9thMv?= =?us-ascii?Q?TpwVqelc5ToBo4eJFuK+3/nXSKoPFLXJQTdWqCCPkuQ/u26/pzDk/FsswL4+?= =?us-ascii?Q?KlKRjYw1KJWAvcTk3ZtbqQbdCVzx1duvOqaVjrB8jowmBlk0fcBNFmlltSRX?= =?us-ascii?Q?gNUmTjJaOwOM+iIgI+6T0mq+KMcXLe5/QMxn3nf8XRqyibQ3KphqjKK5hTGf?= =?us-ascii?Q?qVOsStNrGzbwAk8oHemERIenE80HlN4S+YQDdgfUxn5BIe+i7HCLMLk/g0Dw?= =?us-ascii?Q?TcUPmUVHlYHTupTHjcOB4vh93CKyF/LviC+cuVPdLz08fo9q5kL8mPj+bS+I?= =?us-ascii?Q?m5nxxY1aO8vb6GGN4zDZx+N5c03aw9LnGVqN/A/hVkf3q1d5V1kglvwGZwOU?= =?us-ascii?Q?foi93AhGKd21f+uWODEN+oSbFMIIDRwNqC9NBIBAYqJZENQctXyYejKNIfUV?= =?us-ascii?Q?wti9FDChoV4WuClElBdbdmM7TGeHjf4YXS9o+0gMQqLxnWQASf+oG5qOfZoP?= =?us-ascii?Q?CA04mWQixIuxiwud7zKVssiNfYwP1qK7IY2lNp6ZV69Dkem7Wr2vWiDcGkVB?= =?us-ascii?Q?aTtQil0hmByi7VqyuA52DMKUI6xMYAki6pLuhvT2K6dFtGvC5kgfjxqZhR/2?= =?us-ascii?Q?W852tHcfXGHVGFlWZdnbWALDqGtQ0VX4NIdG0bT1YVLVkQgYu3WBHM9MuGl9?= =?us-ascii?Q?Ln91FrhobHVoJ59gO8BsGqXNIXYuhOMPJnVar8VtaWsAe42zMGdcmROlG3dv?= =?us-ascii?Q?3XZoEho2ICBFbE7bF0QZPrhB/x/qoLmbjsZU2qoDQt2MIokHyMtWyglwixhC?= =?us-ascii?Q?55e4ZRux9aZXvWO89NMUc3KQQpoE0wtVnMqD1qGlNgU02V0lOdRMKl0pRPkz?= =?us-ascii?Q?qDsSJQLLrNQgA/F0+oaeLGpcK0yWod1RiEtF?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:55.0176 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7651a22-fe8b-4a97-f6a6-08ddf03d3c3e 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH1PR12MB9720 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490387485124100 Content-Type: text/plain; charset="utf-8" Function iommu_do_domctl() is the main entry for all iommu-related domctl-o= p, and shall be wrapped with CONFIG_MGMT_HYPERCALLS. Tracking its calling chain, the following functions shall all be wrapped with CONFIG_MGMT_HYPERCALLS: - iommu_do_pci_domctl - iommu_get_device_group - amd_iommu_group_id/intel_iommu_group_id - device_assigned - assign_device - intel_iommu_assign_device/amd_iommu_assign_device - deassign_device - reassign_device_ownership/reassign_device - iommu_do_dt_domctl - iommu_deassign_dt_device - arm_smmu_reassign_dev/arm_smmu_reassign_dev - ipmmu_reassign_dev - ipmmu_deassign_dev - ipmmu_detach_dev - dt_find_node_by_gpath Wrap XEN_DOMCTL_assign_device{test_assign_device,deassign_device, get_device_group}-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the whole domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_assign_device{test_assign_device,deassign_device, get_device_group}-case transiently --- xen/common/device-tree/device-tree.c | 2 ++ xen/common/domctl.c | 2 ++ xen/drivers/passthrough/amd/pci_amd_iommu.c | 8 ++++++++ xen/drivers/passthrough/arm/ipmmu-vmsa.c | 6 ++++++ xen/drivers/passthrough/arm/smmu-v3.c | 4 ++++ xen/drivers/passthrough/arm/smmu.c | 4 ++++ xen/drivers/passthrough/device_tree.c | 4 ++++ xen/drivers/passthrough/iommu.c | 2 ++ xen/drivers/passthrough/pci.c | 6 +++++- xen/drivers/passthrough/vtd/iommu.c | 6 ++++++ 10 files changed, 43 insertions(+), 1 deletion(-) diff --git a/xen/common/device-tree/device-tree.c b/xen/common/device-tree/= device-tree.c index 0b5375f151..70bd8e7da5 100644 --- a/xen/common/device-tree/device-tree.c +++ b/xen/common/device-tree/device-tree.c @@ -371,6 +371,7 @@ struct dt_device_node *dt_find_node_by_path_from(struct= dt_device_node *from, return np; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path, uint32_t u_plen, struct dt_device_node **node) { @@ -386,6 +387,7 @@ int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path= , uint32_t u_plen, =20 return (*node =3D=3D NULL) ? -ESRCH : 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 struct dt_device_node *dt_find_node_by_alias(const char *alias) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 736ad52265..d36885aeea 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -840,12 +840,14 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) copyback =3D 1; break; =20 +#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_assign_device: case XEN_DOMCTL_test_assign_device: case XEN_DOMCTL_deassign_device: case XEN_DOMCTL_get_device_group: ret =3D iommu_do_domctl(op, d, u_domctl); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_get_paging_mempool_size: ret =3D arch_get_paging_mempool_size(d, &op->u.paging_mempool.size= ); diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/pass= through/amd/pci_amd_iommu.c index 3a14770855..5786bf0c59 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -461,6 +461,7 @@ static void amd_iommu_disable_domain_device(const struc= t domain *domain, spin_unlock_irqrestore(&iommu->lock, flags); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check reassign_device( struct domain *source, struct domain *target, u8 devfn, struct pci_dev *pdev) @@ -550,6 +551,7 @@ static int cf_check amd_iommu_assign_device( =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check amd_iommu_clear_root_pgtable(struct domain *d) { @@ -698,12 +700,14 @@ static int cf_check amd_iommu_remove_device(u8 devfn,= struct pci_dev *pdev) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check amd_iommu_group_id(u16 seg, u8 bus, u8 devfn) { unsigned int bdf =3D PCI_BDF(bus, devfn); =20 return (bdf < ivrs_bdf_entries) ? get_dma_requestor_id(seg, bdf) : bdf; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 #include =20 @@ -772,14 +776,18 @@ static const struct iommu_ops __initconst_cf_clobber = _iommu_ops =3D { .quarantine_init =3D amd_iommu_quarantine_init, .add_device =3D amd_iommu_add_device, .remove_device =3D amd_iommu_remove_device, +#ifdef CONFIG_MGMT_HYPERCALLS .assign_device =3D amd_iommu_assign_device, +#endif .teardown =3D amd_iommu_domain_destroy, .clear_root_pgtable =3D amd_iommu_clear_root_pgtable, .map_page =3D amd_iommu_map_page, .unmap_page =3D amd_iommu_unmap_page, .iotlb_flush =3D amd_iommu_flush_iotlb_pages, +#ifdef CONFIG_MGMT_HYPERCALLS .reassign_device =3D reassign_device, .get_device_group_id =3D amd_iommu_group_id, +#endif .enable_x2apic =3D iov_enable_xt, .update_ire_from_apic =3D amd_iommu_ioapic_update_ire, .update_ire_from_msi =3D amd_iommu_msi_msg_update_ire, diff --git a/xen/drivers/passthrough/arm/ipmmu-vmsa.c b/xen/drivers/passthr= ough/arm/ipmmu-vmsa.c index ea9fa9ddf3..ec85b2fbdd 100644 --- a/xen/drivers/passthrough/arm/ipmmu-vmsa.c +++ b/xen/drivers/passthrough/arm/ipmmu-vmsa.c @@ -739,6 +739,7 @@ static int ipmmu_attach_device(struct ipmmu_vmsa_domain= *domain, return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static void ipmmu_detach_device(struct ipmmu_vmsa_domain *domain, struct device *dev) { @@ -748,6 +749,7 @@ static void ipmmu_detach_device(struct ipmmu_vmsa_domai= n *domain, for ( i =3D 0; i < fwspec->num_ids; ++i ) ipmmu_utlb_disable(domain, fwspec->ids[i]); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int ipmmu_init_platform_device(struct device *dev, const struct dt_phandle_args *args) @@ -1254,6 +1256,7 @@ out: return ret; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int ipmmu_deassign_device(struct domain *d, struct device *dev) { struct ipmmu_vmsa_xen_domain *xen_domain =3D dom_iommu(d)->arch.priv; @@ -1309,6 +1312,7 @@ static int ipmmu_reassign_device(struct domain *s, st= ruct domain *t, =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int ipmmu_dt_xlate(struct device *dev, const struct dt_phandle_args *spec) @@ -1487,7 +1491,9 @@ static const struct iommu_ops ipmmu_iommu_ops =3D .teardown =3D ipmmu_iommu_domain_teardown, .iotlb_flush =3D ipmmu_iotlb_flush, .assign_device =3D ipmmu_assign_device, +#ifdef CONFIG_MGMT_HYPERCALLS .reassign_device =3D ipmmu_reassign_device, +#endif .map_page =3D arm_iommu_map_page, .unmap_page =3D arm_iommu_unmap_page, .dt_xlate =3D ipmmu_dt_xlate, diff --git a/xen/drivers/passthrough/arm/smmu-v3.c b/xen/drivers/passthroug= h/arm/smmu-v3.c index bf153227db..49cd37ff57 100644 --- a/xen/drivers/passthrough/arm/smmu-v3.c +++ b/xen/drivers/passthrough/arm/smmu-v3.c @@ -2799,6 +2799,7 @@ static int arm_smmu_deassign_dev(struct domain *d, ui= nt8_t devfn, struct device return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int arm_smmu_reassign_dev(struct domain *s, struct domain *t, u8 devfn, struct device *dev) { @@ -2826,6 +2827,7 @@ static int arm_smmu_reassign_dev(struct domain *s, st= ruct domain *t, =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int arm_smmu_iommu_xen_domain_init(struct domain *d) { @@ -2862,7 +2864,9 @@ static const struct iommu_ops arm_smmu_iommu_ops =3D { .teardown =3D arm_smmu_iommu_xen_domain_teardown, .iotlb_flush =3D arm_smmu_iotlb_flush, .assign_device =3D arm_smmu_assign_dev, +#ifdef CONFIG_MGMT_HYPERCALLS .reassign_device =3D arm_smmu_reassign_dev, +#endif .map_page =3D arm_iommu_map_page, .unmap_page =3D arm_iommu_unmap_page, .dt_xlate =3D arm_smmu_dt_xlate, diff --git a/xen/drivers/passthrough/arm/smmu.c b/xen/drivers/passthrough/a= rm/smmu.c index 22d306d0cb..b7f01fbf89 100644 --- a/xen/drivers/passthrough/arm/smmu.c +++ b/xen/drivers/passthrough/arm/smmu.c @@ -2891,6 +2891,7 @@ static int arm_smmu_deassign_dev(struct domain *d, ui= nt8_t devfn, return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int arm_smmu_reassign_dev(struct domain *s, struct domain *t, u8 devfn, struct device *dev) { @@ -2918,6 +2919,7 @@ static int arm_smmu_reassign_dev(struct domain *s, st= ruct domain *t, =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int arm_smmu_iommu_domain_init(struct domain *d) { @@ -2956,7 +2958,9 @@ static const struct iommu_ops arm_smmu_iommu_ops =3D { .teardown =3D arm_smmu_iommu_domain_teardown, .iotlb_flush =3D arm_smmu_iotlb_flush, .assign_device =3D arm_smmu_assign_dev, +#ifdef CONFIG_MGMT_HYPERCALLS .reassign_device =3D arm_smmu_reassign_dev, +#endif .map_page =3D arm_iommu_map_page, .unmap_page =3D arm_iommu_unmap_page, .dt_xlate =3D arm_smmu_dt_xlate_generic, diff --git a/xen/drivers/passthrough/device_tree.c b/xen/drivers/passthroug= h/device_tree.c index 015ffa15d4..5c2122ba9f 100644 --- a/xen/drivers/passthrough/device_tree.c +++ b/xen/drivers/passthrough/device_tree.c @@ -59,6 +59,7 @@ fail: return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int iommu_deassign_dt_device(struct domain *d, struct dt_device_node *dev) { const struct domain_iommu *hd =3D dom_iommu(d); @@ -86,6 +87,7 @@ fail: =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static bool iommu_dt_device_is_assigned_locked(const struct dt_device_node= *dev) { @@ -320,6 +322,7 @@ int iommu_add_dt_device(struct dt_device_node *np) return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int iommu_do_dt_domctl(struct xen_domctl *domctl, struct domain *d, XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) { @@ -431,3 +434,4 @@ int iommu_do_dt_domctl(struct xen_domctl *domctl, struc= t domain *d, =20 return ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iomm= u.c index c9425d6971..8812e38174 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -625,6 +625,7 @@ void iommu_resume(void) iommu_vcall(iommu_get_ops(), resume); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int iommu_do_domctl( struct xen_domctl *domctl, struct domain *d, XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) @@ -645,6 +646,7 @@ int iommu_do_domctl( =20 return ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void iommu_crash_shutdown(void) { diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index cd855108c2..aa07a7e748 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -877,6 +877,7 @@ int pci_remove_device(u16 seg, u8 bus, u8 devfn) return ret; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* Caller should hold the pcidevs_lock */ static int deassign_device(struct domain *d, uint16_t seg, uint8_t bus, uint8_t devfn) @@ -945,7 +946,6 @@ static int deassign_device(struct domain *d, uint16_t s= eg, uint8_t bus, return ret; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS int pci_release_devices(struct domain *d) { int combined_ret; @@ -1483,6 +1483,7 @@ static int iommu_remove_device(struct pci_dev *pdev) return iommu_call(hd->platform_ops, remove_device, devfn, pci_to_dev(p= dev)); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int device_assigned(u16 seg, u8 bus, u8 devfn) { struct pci_dev *pdev; @@ -1646,6 +1647,7 @@ static int iommu_get_device_group( =20 return i; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void iommu_dev_iotlb_flush_timeout(struct domain *d, struct pci_dev *pdev) { @@ -1671,6 +1673,7 @@ void iommu_dev_iotlb_flush_timeout(struct domain *d, = struct pci_dev *pdev) pcidevs_unlock(); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int iommu_do_pci_domctl( struct xen_domctl *domctl, struct domain *d, XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl) @@ -1804,6 +1807,7 @@ int iommu_do_pci_domctl( =20 return ret; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 struct segment_iter { int (*handler)(struct pci_dev *pdev, void *arg); diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/= vtd/iommu.c index b4105163cc..8913dd4d5f 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -2731,6 +2731,7 @@ static int __init cf_check vtd_setup(void) return ret; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check reassign_device_ownership( struct domain *source, struct domain *target, @@ -2926,6 +2927,7 @@ static int cf_check intel_iommu_group_id(u16 seg, u8 = bus, u8 devfn) =20 return PCI_BDF(bus, devfn); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int __must_check cf_check vtd_suspend(void) { @@ -3234,14 +3236,18 @@ static const struct iommu_ops __initconst_cf_clobbe= r vtd_ops =3D { .add_device =3D intel_iommu_add_device, .enable_device =3D intel_iommu_enable_device, .remove_device =3D intel_iommu_remove_device, +#ifdef CONFIG_MGMT_HYPERCALLS .assign_device =3D intel_iommu_assign_device, +#endif .teardown =3D iommu_domain_teardown, .clear_root_pgtable =3D iommu_clear_root_pgtable, .map_page =3D intel_iommu_map_page, .unmap_page =3D intel_iommu_unmap_page, .lookup_page =3D intel_iommu_lookup_page, +#ifdef CONFIG_MGMT_HYPERCALLS .reassign_device =3D reassign_device_ownership, .get_device_group_id =3D intel_iommu_group_id, +#endif .enable_x2apic =3D intel_iommu_enable_eim, .disable_x2apic =3D intel_iommu_disable_eim, .update_ire_from_apic =3D io_apic_write_remap_rte, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490419; cv=pass; d=zohomail.com; s=zohoarc; b=W1P9BsYZqAeS3WY1QZL88I+48r9O41KjG4Y0DLxB+rmauxDb5vtHo+H4+Nqy/L3SWLuVfj9K0YRxF8MdHF6cHpJ3VAgw3B3V1unM+hcuR5QH/+VVQQ2CbIT6zA/7OrtG2OdYGvLo1B+G5MzEfb337Su+Y1Rh7q8WnkekqaF4I/E= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490419; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iJfzE4HwZb5sVihZocpi8ewX0y4oS0xM9b4IWEsHGt0=; b=CUGa20dPWM2C7UqN0lV76SLOrIRXY90PCgEeqR6xASiPlRCkxXySu7MIExL7yXmUL/M1gaWxZFuHahJQG58SoFjgJg9F7iZaeQOLZ80N3hEegnp38bpo0Do+3q0vUbVdonVXTsVFB30b+enre6vGreAjZFlGupqP86dwy6iQToQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490419255423.18914564467764; Wed, 10 Sep 2025 00:46:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117780.1463885 (Exim 4.92) (envelope-from ) id 1uwFXK-0001TU-CP; Wed, 10 Sep 2025 07:46:38 +0000 Received: by outflank-mailman (output) from mailman id 1117780.1463885; Wed, 10 Sep 2025 07:46:38 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXK-0001TA-5p; Wed, 10 Sep 2025 07:46:38 +0000 Received: by outflank-mailman (input) for mailman id 1117780; Wed, 10 Sep 2025 07:46:36 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFR0-0005yt-94 for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:06 +0000 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on20610.outbound.protection.outlook.com [2a01:111:f403:2408::610]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 5c3444b8-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:40:02 +0200 (CEST) Received: from SA1P222CA0041.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::15) by MN2PR12MB4205.namprd12.prod.outlook.com (2603:10b6:208:198::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:39:57 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:2d0:cafe::b7) by SA1P222CA0041.outlook.office365.com (2603:10b6:806:2d0::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.16 via Frontend Transport; Wed, 10 Sep 2025 07:39:57 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:57 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:54 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5c3444b8-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KqBPYcF+RKgCzD8AbvT4f+rcbgu9knei3BvSOYtE1ybXUFghYm4mESW/rO8YYWEzYH8ltkO5l12OEgzdTzHNhWhFGJq1JgJbpZLEuNd3TdMb/++RAAVHmPu7FiWxs9bVZZQ9dNmNukRnLsFZnUysGyimbo3ipNFUDLgao6+tSuieEvDIc/5pjQ3vDMSpXB7JQozuV8hzuLo3y2ZpOjoMVxnrsGqahyxbqNnBdKAcC88DrEFW4tFC3yzg0dU8C1sFD3gjYL18nEj9imzagW332DpXApXhGi/kXKv1pSjk/Lo2bNn3eSkGQOhrNXovoc1sXozUkqlWGXsQZCWuqQK7SA== 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=iJfzE4HwZb5sVihZocpi8ewX0y4oS0xM9b4IWEsHGt0=; b=lkZAarVVClCAEsVGn7VrAavyEl15skNJQjiOGUDj5JNpCozs8pxtFtkJJylcxZ6EYr+WsSIWXF8ctkpamCtvJzO6kjQSLvJQIASJtLpDNKZubmP4QGgChn3f+FUduZMlZxssfLYWbiYtvOSAQ4/5UvXlita50WZK93vGI8U047W7h+RcW11NgLIVombVrs3dBW5H7IatsgPrQiOCR6g8ODprvOPwi38+kghHQ1ppwko2o7LAEy0jrttB/hGC35sRGdSBaGOshqtXeFe7tgX5lug+vn1kXQJmlneexowjIS6wOiG/J8WHgPz0O5QRMzUCWLaw9x+8GKKR/ECfznbWIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=iJfzE4HwZb5sVihZocpi8ewX0y4oS0xM9b4IWEsHGt0=; b=e6oyERvrzddm3Aw1s1m9T4ueHchzMjZfJ9rtbfpauYVdnU5IKcp3y1V/j3glFSHoN+0opzCp+7itksDb3SgxPcqpw8szuI81BwOkMER3w+jCOpd8canA5zGu6rH23rNdyfdnMv8pWlp1/cQ+rXfAj/mHy9F63MeEobQg85togDM= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 21/26] xen/xsm: wrap xsm-iommu-related functions with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:22 +0800 Message-ID: <20250910073827.3622177-22-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|MN2PR12MB4205:EE_ X-MS-Office365-Filtering-Correlation-Id: 550f3be7-1fc4-4f66-dc17-08ddf03d3d98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?6ydOHPw1pzXH7GR+ozWSShGISrmGMUlAZfyYSoK2g1I/6ZzJ0oEz2qOtpOcK?= =?us-ascii?Q?Npm2hJwYDzwDw3nCz3FSCH138j7eu5OQO28CEuFtlPGtEFTa29oicXbBvL3V?= =?us-ascii?Q?dAQRIn2nz83+w+Vvv3V18m0IP4yCPnXg0PBWSd5mSXsazrv+JiOmJHxp8RlN?= =?us-ascii?Q?Az9mMN2EgzUAplaDJNfbcJpTAS9LUlwJnEWxbxH8FcRnWGXT0Zg2pOiO7PDN?= =?us-ascii?Q?KEOCv0lYE6D9XYxcxDGhwW+et3Aczb3Xo+9veG0ksCG9q7W2t5CqvSZY0Ixm?= =?us-ascii?Q?NKuRwqXh0mOZp1MWif9HM+gFKBoeROEYlTgKONASglg+RiVAOnRbj4uHckUX?= =?us-ascii?Q?yMvjeGKxBCK9A71sFBj317ulapd/s5Tr6eo0cnHoXGUkS+chYgYLlSqQ0spR?= =?us-ascii?Q?GuZGci5Yq8fhfko2nKs0EpSIBlBV1VYdTqlwYiVEgTHFsxe02ZyTs7uNGlGR?= =?us-ascii?Q?nRr2frhss9CiXroQ59Ii+PcM+r3C6t2B18fj6zbhc09EUUPUwtok/ce4dqlc?= =?us-ascii?Q?dErHpChW9EkYG0hn/OYpEYiPmL6plRRt3o7Um5mNda4o1WamosOFcH+hJjnP?= =?us-ascii?Q?O24sT9xTuxEW0o27Wgbv9hgYl+XrRcd15EUMZBaoF7oVi97x8hFDZ98t80Tr?= =?us-ascii?Q?6UZ0CehyiyqWZ5NhOjEJ7ydrzQxKcNyVq09xHV5ekJdvOCGTzvoy4vHFjtuR?= =?us-ascii?Q?L9GtqYVyHzMw+5yb5Q87tpZ+1nIQdqDACuQRy8juCXzlGd0fDlsEdRzVpBrZ?= =?us-ascii?Q?+gD/q6tqeMS93/39c99gzfpXb2Eu0zhghH1bCoAE2fFylHxlZPXRF8bf2BVY?= =?us-ascii?Q?UyAYcyt9aBA/dc4NqzC5GYr59LplZWlilZMqtuM8ktceahshIxgaxtCfXnx3?= =?us-ascii?Q?3yEqqFs1v5nsATzZdzV1T8uhcw5af2pK4GuSlEN1nLzy9x2sLcjMT2xXp8F8?= =?us-ascii?Q?shSKHj/ssZEDj6/jFc63IuEqe9CVr8mhmFNeRfF+gK9OJR2ld+bWb+aX2M0C?= =?us-ascii?Q?udgX6TX+lIOd9d8EoB/na6OGd79churSEXnY7+RwCD+BoU/rGpW4gOKaCfKV?= =?us-ascii?Q?0WLAgsCFiOwiOtfVhvtvw1JUji1+4K/mbpINB4E7FdZr+s8vZupvtASa1/85?= =?us-ascii?Q?rzwWEl5467sAoKEcf2TgXIhQbf6EfACobVmXydo+byZp0eV1r/FYIKU0jCYb?= =?us-ascii?Q?X/PCfkAFKuA636FFCRfw9yzt5jOryQ6PyD/72VZjq7jbPt/BQ8pdwUM+afb2?= =?us-ascii?Q?eEQa4oqNSAzCtQHsX0iWwBiLVr/tN/asMSHPWJCKQsGg6xjUGbfBaEPHUfr9?= =?us-ascii?Q?nQZBRdlP7uVdFpBAswUmXelrzrft0bUrtihXiLKpxVvDeP4XccLQGrommCKu?= =?us-ascii?Q?7TCMIHiclH737hVLuPiB90G/nA+sBiERlbf+eYQ5c48yDh+E79ZmH8fhfmZ7?= =?us-ascii?Q?QMF2VnJQJ8Uy51wwOucQHiVsTPVySmhAR8dSbgz6PaZovv2WSID6p6SNix3u?= =?us-ascii?Q?nszFOAwKxcD+fkoLqxTTZhjuC1X0SAt3qhJb?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:57.2843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 550f3be7-1fc4-4f66-dc17-08ddf03d3d98 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4205 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490422022124100 Content-Type: text/plain; charset="utf-8" The following functions are xsm-related and only invoked under iommu-related domctl-op and shall all be wrapped with CONFIG_MGMT_HYPERCALLS: - xsm_get_device_group - xsm_assign_device - xsm_deassign_device - xsm_assign_dtdevice - xsm_deassign_dtdevice Signed-off-by: Penny Zheng --- v1 -> v2: - new commit --- xen/include/xsm/xsm.h | 12 ++++++------ xen/xsm/dummy.c | 4 ++-- xen/xsm/flask/hooks.c | 12 ++++++------ 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 2a107b2cde..542488bd44 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -123,13 +123,13 @@ struct xsm_ops { int (*pci_config_permission)(struct domain *d, uint32_t machine_bdf, uint16_t start, uint16_t end, uint8_t acc= ess); =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) && defined(= CONFIG_MGMT_HYPERCALLS) int (*get_device_group)(uint32_t machine_bdf); int (*assign_device)(struct domain *d, uint32_t machine_bdf); int (*deassign_device)(struct domain *d, uint32_t machine_bdf); #endif =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) && defined(CONFIG_MGMT_HYPERCALLS) int (*assign_dtdevice)(struct domain *d, const char *dtpath); int (*deassign_dtdevice)(struct domain *d, const char *dtpath); #endif @@ -548,7 +548,7 @@ static inline int xsm_pci_config_permission( return alternative_call(xsm_ops.pci_config_permission, d, machine_bdf,= start, end, access); } =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) && defined(= CONFIG_MGMT_HYPERCALLS) static inline int xsm_get_device_group(xsm_default_t def, uint32_t machine= _bdf) { return alternative_call(xsm_ops.get_device_group, machine_bdf); @@ -565,9 +565,9 @@ static inline int xsm_deassign_device( { return alternative_call(xsm_ops.deassign_device, d, machine_bdf); } -#endif /* HAS_PASSTHROUGH && HAS_PCI) */ +#endif /* HAS_PASSTHROUGH && HAS_PCI && CONFIG_MGMT_HYPERCALLS */ =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) && defined(CONFIG_MGMT_HYPERCALLS) static inline int xsm_assign_dtdevice( xsm_default_t def, struct domain *d, const char *dtpath) { @@ -580,7 +580,7 @@ static inline int xsm_deassign_dtdevice( return alternative_call(xsm_ops.deassign_dtdevice, d, dtpath); } =20 -#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */ +#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY && CONFIG_MGMT_HYPE= RCALLS */ =20 static inline int xsm_resource_plug_pci(xsm_default_t def, uint32_t machin= e_bdf) { diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 7c4e6176aa..2c8e0725b6 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -81,13 +81,13 @@ static const struct xsm_ops __initconst_cf_clobber dumm= y_ops =3D { .pci_config_permission =3D xsm_pci_config_permission, .get_vnumainfo =3D xsm_get_vnumainfo, =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) && defined(= CONFIG_MGMT_HYPERCALLS) .get_device_group =3D xsm_get_device_group, .assign_device =3D xsm_assign_device, .deassign_device =3D xsm_deassign_device, #endif =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) && defined(CONFIG_MGMT_HYPERCALLS) .assign_dtdevice =3D xsm_assign_dtdevice, .deassign_dtdevice =3D xsm_deassign_dtdevice, #endif diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 7392e95e55..66d8bfda3a 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -1393,7 +1393,7 @@ static int cf_check flask_mem_sharing(struct domain *= d) } #endif =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) && defined(= CONFIG_MGMT_HYPERCALLS) static int cf_check flask_get_device_group(uint32_t machine_bdf) { uint32_t rsid; @@ -1464,9 +1464,9 @@ static int cf_check flask_deassign_device( =20 return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_= DEVICE, NULL); } -#endif /* HAS_PASSTHROUGH && HAS_PCI */ +#endif /* HAS_PASSTHROUGH && HAS_PCI && MGMT_HYPERCALLS */ =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) && defined(CONFIG_MGMT_HYPERCALLS) static int flask_test_assign_dtdevice(const char *dtpath) { uint32_t rsid; @@ -1527,7 +1527,7 @@ static int cf_check flask_deassign_dtdevice( return avc_current_has_perm(rsid, SECCLASS_RESOURCE, RESOURCE__REMOVE_= DEVICE, NULL); } -#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY */ +#endif /* HAS_PASSTHROUGH && HAS_DEVICE_TREE_DISCOVERY && MGMT_HYPERCALLS = */ =20 static int cf_check flask_platform_op(uint32_t op) { @@ -1993,13 +1993,13 @@ static const struct xsm_ops __initconst_cf_clobber = flask_ops =3D { .remove_from_physmap =3D flask_remove_from_physmap, .map_gmfn_foreign =3D flask_map_gmfn_foreign, =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_PCI) && defined(= CONFIG_MGMT_HYPERCALLS) .get_device_group =3D flask_get_device_group, .assign_device =3D flask_assign_device, .deassign_device =3D flask_deassign_device, #endif =20 -#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) +#if defined(CONFIG_HAS_PASSTHROUGH) && defined(CONFIG_HAS_DEVICE_TREE_DISC= OVERY) && defined(CONFIG_MGMT_HYPERCALLS) .assign_dtdevice =3D flask_assign_dtdevice, .deassign_dtdevice =3D flask_deassign_dtdevice, #endif --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490419; cv=pass; d=zohomail.com; s=zohoarc; b=HKWUbfgPlxBeCWiY10oGmOm0Z22Yp/A/fbjKUx8SxRQnVTEyghjmO1j8D8/i52Xttr5koM+7yN+lgAviBYALV3kMVEOCOSqpZ3yYeW/mcuNayl6t52KQ1uHZ8oAbX7NpvHa8x+ypkL7SM6dpO87lGmewMiPJuI3gQFS+0SnsHYU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490419; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=n0emPBHP6D/uzkCR8knCpz7UD/iYNoUnbmeDyfDnSzM=; b=Bzr1527I/m2EAD4FFN18tiQH0ZHVQlAXTuF/NymkHxKB07Gm4y135bfP4RCiK2lNuEyWA9Pq9GxKjFYl5b9MScpZwZnT9CMC+dok6iZsuXQyAb+xwIdQq+Vb5aVUyKXPQVUI3qMLzVgnfhuX2vu1ro+45uI9A4MIlX9GqUcbGqw= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490419501709.2973438624522; Wed, 10 Sep 2025 00:46:59 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117752.1463866 (Exim 4.92) (envelope-from ) id 1uwFXE-0000PY-Jv; Wed, 10 Sep 2025 07:46:32 +0000 Received: by outflank-mailman (output) from mailman id 1117752.1463866; Wed, 10 Sep 2025 07:46:32 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXE-0000PA-Bs; Wed, 10 Sep 2025 07:46:32 +0000 Received: by outflank-mailman (input) for mailman id 1117752; Wed, 10 Sep 2025 07:46:30 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFR9-0005yo-5r for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:15 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on20625.outbound.protection.outlook.com [2a01:111:f403:2418::625]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 5db3a281-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:40:04 +0200 (CEST) Received: from BYAPR11CA0084.namprd11.prod.outlook.com (2603:10b6:a03:f4::25) by CY3PR12MB9701.namprd12.prod.outlook.com (2603:10b6:930:103::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:40:00 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:a03:f4:cafe::2f) by BYAPR11CA0084.outlook.office365.com (2603:10b6:a03:f4::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:40:00 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:39:59 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:56 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 5db3a281-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jgu+ly3WHhWEfO+7cVsxDUP9ug7MuTnD5JAOQwCLKpWRStQM9BTfG9IEzgFFsF95krzso2z2OF2/zRKnqxgLoMz1Fdxn3S/6flwObMwnsX2YLJckCpAyOPFd5NiNEQ7D7KhsVmZHwzd2ntLoA0TVlJF//2sR4o0nS+kYznoZLMLbEVawcEMuAT0WcBpm01iMZmvw4IkHKDR4G7C8oX1g8b0ZhYMoxHmf0uaiBpgZdX+OLv+uDGQSWbTlec0K+Mek0Ps6Q7jTkCj6Fvd0ncBHAciM1eBLiI7HrXozmK0WDr6rnfCBTPhsVQPCJjTskKfbzp9ryBrifES4eJwPoOrseQ== 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=n0emPBHP6D/uzkCR8knCpz7UD/iYNoUnbmeDyfDnSzM=; b=WkTZc73o5HiOSi/vtdpfiAEuzxgf+k2QKAVWHt1btHbYhrHm2zoyRlCprretj51umAI3jzSbOsSyryrbXaziK+03r7twyfW8V3YfRSH0TKfvfczmwyyoFm07Fl43nZ6QI0WQHs/Su9pvcQudfTLix7QdrhyHN7wjnMhBqC80sgqaYLfI9mnMRDn0+NvAJqyJPDGV8s8WJrPboHet7I5g3HDE3NzMH0bcIGRhgj8DPZWRbAt7cVN6HVGLOU9OSwHu5uDRu2oVvRviT5iCBc8RiL3gnsQoXLo3m3GJta6o8JepHzjKu1PaRu4aKy+e0qbwoxOO7+RwewZHIi2CQIEBmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=n0emPBHP6D/uzkCR8knCpz7UD/iYNoUnbmeDyfDnSzM=; b=cwJPvFlkMxumyY+YgRNaUVD3kRI2D2jA1gWyIsRhI3SdWjiW6NsRY8frLwypXgABEeUNDmSvtBghUSsEonnT9pOQ6//Oe2tUtp7alJ078oaaAAITfgdUFYzu9KEbQiRiuAZCmXyMUrE4dCxYq75EWEevzqw4EJlN/rEHDIVJaC0= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Stefano Stabellini , Julien Grall , Bertrand Marquis , Michal Orzel , "Volodymyr Babchuk" , Andrew Cooper , Anthony PERARD , "Jan Beulich" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 22/26] xen/domctl: wrap arch_{get,set}_paging_mempool_size() with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:23 +0800 Message-ID: <20250910073827.3622177-23-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529E:EE_|CY3PR12MB9701:EE_ X-MS-Office365-Filtering-Correlation-Id: 88974cb0-b7be-48c3-1a99-08ddf03d3f28 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|1800799024|82310400026|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?AoJEheD0KJ92csIToANpgaQcgwi1piMbvsblZZoQSH74qS4ObPRrDEkUTqZM?= =?us-ascii?Q?JHmu1y8WS3XbAgyYS4ONhnAVghMzs6X3Va9jJUskyLuvKyLIleSsDjxagxcH?= =?us-ascii?Q?ldgQd75begAZ/oBoOWnQHEvhk7Gsb6gEcoglnFu3qj5d+/0DOP7vTmhL+fn4?= =?us-ascii?Q?wWKYZd0kpaSShqPyN3BHTM+aQYrUEwTvPxTGXKjzePfYsBoLY0Pq/SsXhTxC?= =?us-ascii?Q?ITJZL+lpK7rLK07pwMgOVHNfS7lJZY3nJL8jOsze7W1yImw182fZ2w841f/P?= =?us-ascii?Q?GZLiCeDJt9x77+HRqZ17Z4af57c3aC5pegWHHoTmagBPhulwd8v7c266cyGy?= =?us-ascii?Q?69K3vSDtPgYwPFGM+zaIq5/RvywEcy1Qa+ajadGSUuDRb2Ky9f9cgO7meFws?= =?us-ascii?Q?XqvfuHArqOoh+YJ11jnMivQ7g1oLCymcyKyajwZqFsgQneX1y7VPpNyWikEu?= =?us-ascii?Q?kxtRKGbZnUtsqeuLu2NFaFVIX0iDs1vin0gUvmj7IpDyBS8LHu6kO7bKS1xf?= =?us-ascii?Q?LSbZqIWkpSXwfQ+bju9JSCAZPSFEaTFcsqsB8zl0Au+pMgiU8p8Hq88f8S9H?= =?us-ascii?Q?0Q0Ux6rMjJnGFEk+SBhpWjQl1Xilks1v5LhG4ufmwrp1plcOqogedtt4vvvK?= =?us-ascii?Q?krzPxhqzf5+L6QiFUsKtVwuEbPeYPzJA/DCO9FlCWk1YaatcnmDpM4Wg8VyU?= =?us-ascii?Q?KxQhu2ODJc/bR5LoGGOswIOaWhKMlq/XEaJxvvIb0qgLW3SQ0Ni4rakEIgVI?= =?us-ascii?Q?jlXeXQiMbt8y9piltWpJGliLlOeMR75/LPSTfUAN6zU++axPfURUKhZGueXO?= =?us-ascii?Q?4RQuSdNzAPHQJvP+DXx3aW229oWIzmuj/E6Ms95nk3UsGGCO092oFt25Hut6?= =?us-ascii?Q?3XLoZbFOvPhaPky34YveQ3jLmxjf/CxXj2wW191Ru8pHmUUp6DHKQlHDnsKh?= =?us-ascii?Q?CcPQlIobny7pNoklWjjcwEnB9z1w08KzE7F1Q8/DID6kVuqRi1rDpYpArp9h?= =?us-ascii?Q?PoD5wjmjC8rJ+kpuZllBx9kz+fdaohgggH1HWPgp2/20qOLlCg6zaDDyLHnw?= =?us-ascii?Q?dZ3/+Ox7tKku8nApTVs2uLCsqGdJyCS0A0C6bm/IxoD1XHaiavFWSz+q7S0O?= =?us-ascii?Q?UlkjlYfKTTrCC0cqD1C2rGhi+F2iyInFZ/tEnmj43d/6vWK7H70rWvnHnPJ7?= =?us-ascii?Q?NtBC1xmFsy+PHhY8atebWbfNy0MLMpt4HUkcLGJNAwLRScTCMNyEUQDlzwpQ?= =?us-ascii?Q?Ss+NtebgDKBHpLIM0uJdPAoDHIrDRfb5KCLTX7abAOGUakl+XBJbE9cyTDYF?= =?us-ascii?Q?IG6ZqzEyJIzftFJ1mAH1Qna01wUlI/tTHEqfpZU8rEbhRNmvxu3irPGrNk0O?= =?us-ascii?Q?Asmosg6n0brihE3hz7fxRlY+4OJ4RHmr4QuytZi3SXoGHyYSbj/gl14Y1UZV?= =?us-ascii?Q?snLRPolH8bJccLCfVRJAD9Cxpx5ePXND1dZw81F1RL+gt3Bz+nkuNHWlW7oW?= =?us-ascii?Q?M46CnjzHAwp4WJw3rbpDQfVSHyMKffFETyQq?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(1800799024)(82310400026)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:39:59.9070 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88974cb0-b7be-48c3-1a99-08ddf03d3f28 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY3PR12MB9701 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490420097116600 Content-Type: text/plain; charset="utf-8" Arch-specific arch_{get,set}_paging_mempool_size() is responsible for XEN_DOMCTL_{get,set}_paging_mempool_size domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Wrap XEN_DOMCTL_{get,set}_paging_mempool_size-case transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng Acked-by: Jan Beulich # x86 Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap XEN_DOMCTL_{get,set}_paging_mempool_size-case transiently --- xen/arch/arm/mmu/p2m.c | 4 ++++ xen/arch/x86/mm/paging.c | 2 ++ xen/common/domctl.c | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/xen/arch/arm/mmu/p2m.c b/xen/arch/arm/mmu/p2m.c index 30d6071e91..4caa5844e4 100644 --- a/xen/arch/arm/mmu/p2m.c +++ b/xen/arch/arm/mmu/p2m.c @@ -58,12 +58,14 @@ static void p2m_free_page(struct domain *d, struct page= _info *pg) } } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* Return the size of the pool, in bytes. */ int arch_get_paging_mempool_size(struct domain *d, uint64_t *size) { *size =3D (uint64_t)ACCESS_ONCE(d->arch.paging.p2m_total_pages) << PAG= E_SHIFT; return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Set the pool of pages to the required number of pages. @@ -122,6 +124,7 @@ int p2m_set_allocation(struct domain *d, unsigned long = pages, bool *preempted) return 0; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int arch_set_paging_mempool_size(struct domain *d, uint64_t size) { unsigned long pages =3D size >> PAGE_SHIFT; @@ -140,6 +143,7 @@ int arch_set_paging_mempool_size(struct domain *d, uint= 64_t size) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int p2m_teardown_allocation(struct domain *d) { diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 116389d4e9..c6e3996093 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -949,6 +949,7 @@ int __init paging_set_allocation(struct domain *d, unsi= gned int pages, } #endif =20 +#ifdef CONFIG_MGMT_HYPERCALLS int arch_get_paging_mempool_size(struct domain *d, uint64_t *size) { unsigned long pages; @@ -991,6 +992,7 @@ int arch_set_paging_mempool_size(struct domain *d, uint= 64_t size) =20 return preempted ? -ERESTART : rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/common/domctl.c b/xen/common/domctl.c index d36885aeea..c87c28cea2 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -847,7 +847,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) case XEN_DOMCTL_get_device_group: ret =3D iommu_do_domctl(op, d, u_domctl); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_get_paging_mempool_size: ret =3D arch_get_paging_mempool_size(d, &op->u.paging_mempool.size= ); @@ -862,6 +861,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D hypercall_create_continuation( __HYPERVISOR_domctl, "h", u_domctl); break; +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_set_llc_colors: if ( op->u.set_llc_colors.pad ) --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490386; cv=pass; d=zohomail.com; s=zohoarc; b=J9RRGtaDGg9ER6LhLjauGLWabuL+h2ldVBsYOnKQ6RKnfCbo9F8Sa3HwiOW15gcCuA23dhEyYxTLmAcytpRVJZ1CdcrILv4bkUcXD2AiTkNNvx+lIOJkkYjyzW+XdwqLhT42oN2rK+A3Aog2bekQuR2Xn2h9r9goa7F2mm6QAjk= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490386; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/tKDNAZvqvuPmF10rFrm9o444l6QmZ2SjcvG0/5ayxc=; b=Ap6mh1Wcyj/2saBwtThaPdoe/mTCFLWP76wozMxEz9iF+f8z8gK1UFKp8/cHRhlFT9wa1cV/j/29gYiTOF6dQnyMbmZxmjybCgMY9NGzckKyGRCgScmwUQQq2I3jeE1CMKGrbK0fbd5lIQ5b4dbUGvzfqedYglXN1KtaSFtUYXs= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490386925580.8527776327795; Wed, 10 Sep 2025 00:46:26 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117673.1463774 (Exim 4.92) (envelope-from ) id 1uwFWr-0004z9-A1; Wed, 10 Sep 2025 07:46:09 +0000 Received: by outflank-mailman (output) from mailman id 1117673.1463774; Wed, 10 Sep 2025 07:46:09 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWr-0004z2-7C; Wed, 10 Sep 2025 07:46:09 +0000 Received: by outflank-mailman (input) for mailman id 1117673; Wed, 10 Sep 2025 07:46:08 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFR4-0005yt-N5 for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:10 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on20609.outbound.protection.outlook.com [2a01:111:f403:2009::609]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 60d28b3f-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:40:09 +0200 (CEST) Received: from SA1P222CA0050.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::25) by IA1PR12MB6115.namprd12.prod.outlook.com (2603:10b6:208:3e9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:40:05 +0000 Received: from SN1PEPF000252A3.namprd05.prod.outlook.com (2603:10b6:806:2d0:cafe::e6) by SA1P222CA0050.outlook.office365.com (2603:10b6:806:2d0::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:40:03 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A3.mail.protection.outlook.com (10.167.242.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:40:05 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:39:59 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 60d28b3f-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uRICTrNU67ZZpg+NMZAoAEAty63a7dMpNWSparigDqIak/bGRTuMFmtBZADeIYeP9xoknkWhGufme7DFQQrA7nbJJDniNDl80CqX6pgPCYFS0S03ERjsZWtvaWtZGdLVKK32Yu6D9K0fpXt09bNFDEu9Uv4PEw5XFFY6u4Eb4Kz7zO2At0lLvAR6q3qBUKFr46Fgmk+z62MgpLuzKdxO3wlX0RV2KQy0BiCszYeUO7CVF3Cfjp4srjgnLZaoILUDUcQO89OvAiZ6iQ4/0lw2QmGXB4yqQzaNAie2qlrjO3zgeoTe7XYtqOblFGcjncdMathPq60Nx5NmH1g5L6/BJA== 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=/tKDNAZvqvuPmF10rFrm9o444l6QmZ2SjcvG0/5ayxc=; b=WZV6A6I1IFfZC6biKICiGX8FS8RrZoUDNY59OgPAWAsGwgdjN8bgSUs1MOkb8vwJc7DZ5vkZprYwNur6/YEa5yJZvxTF6SSdlLCkVb144N9U3vyr3O5wth4kcTuPd7xfXIoCyCZkD6Rl7J3aS3aihKTEhWyOB+dtTYi4Kd7nFLaytFBg1l4v6bpPgzMzegi3miNmfEibWwaFGCtdQQ0/H4mgSjXqTLbcTTN4TfJaIXDS/qb5nWvnKODp7NCaVmzuI+ODVmApZLc92n4i3P6NQi7XUcogTOboDQC/MNMSsoOlW4xinxxg42JQmI2ZzRQUffrEqZ37yyjKTx8IyWEgMw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=/tKDNAZvqvuPmF10rFrm9o444l6QmZ2SjcvG0/5ayxc=; b=s0iZflX9s3YyVO20yYjbrYOgX8GXitBswvZzPDZvykYxD5s4W6pWnH0duK1DrFNK5BDqm3KWsIPeq9r7tW3yTg2XkiRV0BZA8H61ShHox2y8vIOUs9a9PrBqzxKJgNzBYpxsB1tJqZU6eoWlHCAiRRKeVJWI5Uo9K9xdymR/2lk= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Jan Beulich , Andrew Cooper , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [PATCH v2 23/26] xen/x86: make CONFIG_X86_PSR depend on CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:24 +0800 Message-ID: <20250910073827.3622177-24-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A3:EE_|IA1PR12MB6115:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c214b1f-f8a1-4d6a-7ff2-08ddf03d4262 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?IfSMDZiEiwg+FaFrka9ZjgB2LTHGlltIkvQVALxlCJH4Tm7rtkdeyUlrktKB?= =?us-ascii?Q?v6Mi1zFiJIIU5hR9QYIPOzScUcN1obqRJFxzTJJIcCLO1fsrkxvnzucIWaAm?= =?us-ascii?Q?3aT4K7//oj+gMzMbR8UAwX4SR98UMHs/CcX3DUPJ9+9jwRWbCn4tu/XqShcB?= =?us-ascii?Q?+NtyirfjshJTMG9vCgNGnuvzBL1n41aLQArOo1rgFxZMuOgUxcxtNqpf1i2k?= =?us-ascii?Q?WPUk11QP53MHGKCMFJzj5SvNUN45sInqylVNDXNKtIGCfS27grLCM65fMhjo?= =?us-ascii?Q?MqeBu2HIpzx4wruUmsCpYzzrQj915xi+Ls9jCVReZ/+JxE0q3IQ9+gLbeayq?= =?us-ascii?Q?DBmjqrzICRtEEYWaCvEBeu9JY2oBCzEMpoqIHoq2KpCCxoF8Vy6bmr4Wz/zq?= =?us-ascii?Q?la6PvTu5h7nI4mK2wW786HxUSicXg2QuMzkCYj9J+9TzJ6Eqsy6QDBFsA5hV?= =?us-ascii?Q?OY0Pg3s5JAteK17uG0HwwmcQMcAXWVn3YmvhYsqpfQsbzjjUvu6j1j0Qyw53?= =?us-ascii?Q?NyVhbqWKZHvLX0rDnqZoBaUKu04/zWsah6k4L+l3V7DGjRU/Ve6WQjCHunhq?= =?us-ascii?Q?tYCC+qM0ZkW2gUAVcUGKsWZzkiwHeCIujRa2eKKqX5c3TwqZ2DD+guVQVUC4?= =?us-ascii?Q?B09EFfTFD51OpAXhGM9cNOH3CHrRT/iW1v+0Irsi5R3ttzshn5HL0sz0OZgw?= =?us-ascii?Q?LrY34IZKeGOFQ1hh+zhKRpNT5s/1q5rjo7DB4GzbdEKyLCF10hAcfUfuQ4eG?= =?us-ascii?Q?DFXNadw2pD4+3wwXSL7i/n47z666Uca9erj2IpuXNX1WsBuGNe/zp5IC6nUh?= =?us-ascii?Q?jzgnGR50BY+Ns3LcTlg7cHY5YKj8c6tkZZxvvEsA8DdeJX4+bR2rUSXXuo2p?= =?us-ascii?Q?9WqPMNcJht0rJ7aR17ak5sopVGjJxhkUKYuNDkUFH3z7p1pcYyqt9FzbLfi3?= =?us-ascii?Q?olIH+KRZJHSj+UtRTAGgbXAfeO3Gb3Ey4RIVYX+Af0JxyWm99TRgOAZDu04+?= =?us-ascii?Q?b1l6gyaqHth08oenAdM1bIrg7L3XSmumB8pGl4yOug5d4dBn9zokPo/ub1DE?= =?us-ascii?Q?A4mZu0CX3Su7SujlxTEpEj2or+3ygDlsOv7lMw03tm08Y/BJwHC9ynUOWmcR?= =?us-ascii?Q?vrg3UxgaVczfLsl3ba/EFVL99qAELTigICUIiu4t0OcvW76WG52BM8w9Xb/S?= =?us-ascii?Q?b1TfllTjnsg/jyvPc+KZhTxEQhgp7/htXOKdbo7lAujE3eCzTbXPk329lARU?= =?us-ascii?Q?38QrJ/8FmQMiPdHLLEH49DVYZTcydd9RVpikbF6n0ZE48T704U0DHLGK8iab?= =?us-ascii?Q?OtOhnDDIwxBCFhnrylBSx6o6klhCRQKXb/NH0bgeLP3+QpZ0WBdSB5csCAEw?= =?us-ascii?Q?M+9Cwbn9siAINKkYIwUv+fcTotlEp1g9ifWQME9uGH2EcSTBGj+QiFzzZAp+?= =?us-ascii?Q?zTZpEp8emWRU/vK8pNMQfw/UShmM59xPoU+9jSSiAdXvku7P6zFlLU4Ij2wn?= =?us-ascii?Q?cB0vqpDL9dE71ILyOOc4CbH7hxKZMpXv1SAW?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:40:05.3309 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c214b1f-f8a1-4d6a-7ff2-08ddf03d4262 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A3.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6115 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490389594124100 Content-Type: text/plain; charset="utf-8" Users control/monitor Intel Platform Shared Resource (PSR) through related domctl-op or sysctl-op, so CONFIG_X86_PSR can be put under MGMT_HYPERCALLS. With this change, we could remove MGMT_HYPERCALLS-wrapping in psr.c Signed-off-by: Penny Zheng Acked-by: Jan Beulich Reviewed-by: Stefano Stabellini --- v1 -> v2: - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/arch/x86/Kconfig | 1 + xen/arch/x86/psr.c | 18 ------------------ 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 3f0f3a0f3a..21da8c1a69 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -190,6 +190,7 @@ config TBOOT config X86_PSR bool "Platform Shared Resource support" if EXPERT default INTEL + depends on MGMT_HYPERCALLS help Support of Platform Shared Resource technology, which is basis for monitoring and control of resources like cache and memory bandwidth. diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 80ce5804b4..4f2c2d0042 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -135,11 +135,9 @@ static const struct feat_props { */ enum psr_type alt_type; =20 -#ifdef CONFIG_MGMT_HYPERCALLS /* get_feat_info is used to return feature HW info through sysctl. */ bool (*get_feat_info)(const struct feat_node *feat, uint32_t data[], unsigned int array_len); -#endif =20 /* write_msr is used to write out feature MSR register. */ void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type); @@ -422,7 +420,6 @@ static bool mba_init_feature(const struct cpuid_leaf *r= egs, return true; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static bool cf_check cat_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) { @@ -435,7 +432,6 @@ static bool cf_check cat_get_feat_info( =20 return true; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* L3 CAT props */ static void cf_check l3_cat_write_msr( @@ -448,14 +444,11 @@ static const struct feat_props l3_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L3_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D cat_get_feat_info, -#endif .write_msr =3D l3_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 -#ifdef CONFIG_MGMT_HYPERCALLS /* L3 CDP props */ static bool cf_check l3_cdp_get_feat_info( const struct feat_node *feat, uint32_t data[], uint32_t array_len) @@ -467,7 +460,6 @@ static bool cf_check l3_cdp_get_feat_info( =20 return true; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check l3_cdp_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -483,9 +475,7 @@ static const struct feat_props l3_cdp_props =3D { .type[0] =3D PSR_TYPE_L3_DATA, .type[1] =3D PSR_TYPE_L3_CODE, .alt_type =3D PSR_TYPE_L3_CBM, -#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D l3_cdp_get_feat_info, -#endif .write_msr =3D l3_cdp_write_msr, .sanitize =3D cat_check_cbm, }; @@ -501,14 +491,11 @@ static const struct feat_props l2_cat_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_L2_CBM, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D cat_get_feat_info, -#endif .write_msr =3D l2_cat_write_msr, .sanitize =3D cat_check_cbm, }; =20 -#ifdef CONFIG_MGMT_HYPERCALLS /* MBA props */ static bool cf_check mba_get_feat_info( const struct feat_node *feat, uint32_t data[], unsigned int array_len) @@ -523,7 +510,6 @@ static bool cf_check mba_get_feat_info( =20 return true; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static void cf_check mba_write_msr( unsigned int cos, uint32_t val, enum psr_type type) @@ -561,9 +547,7 @@ static const struct feat_props mba_props =3D { .cos_num =3D 1, .type[0] =3D PSR_TYPE_MBA_THRTL, .alt_type =3D PSR_TYPE_UNKNOWN, -#ifdef CONFIG_MGMT_HYPERCALLS .get_feat_info =3D mba_get_feat_info, -#endif .write_msr =3D mba_write_msr, .sanitize =3D mba_sanitize_thrtl, }; @@ -826,7 +810,6 @@ static struct psr_socket_info *get_socket_info(unsigned= int socket) return socket_info + socket; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS int psr_get_info(unsigned int socket, enum psr_type type, uint32_t data[], unsigned int array_len) { @@ -858,7 +841,6 @@ int psr_get_info(unsigned int socket, enum psr_type typ= e, =20 return -EINVAL; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int psr_get_val(struct domain *d, unsigned int socket, uint32_t *val, enum psr_type type) --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490424; cv=pass; d=zohomail.com; s=zohoarc; b=JFfX+J2dilhBwU++X0JaNu2T8CRE/RfVG0plzhMjjpe2YLfU8cdNjOQrkoFtmp01ALUPYxV2WGCqnEHGqqE/3CWuc6+LmkZhBBK6My64GK7MczI8nt2MuDxgYaR8eJ0v4LEL/LVssVh+FzFxDrkqcpicmy1XZ6LwJf+xiO7qxYU= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490424; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cPpP+b+/IukhAi2FKipdO0pKRRyw4rGNMr68r7YHWug=; b=eeUVsYJRwJqGG56S6DRNKmy8NR7QTfe37yDl7AYVVbyXbR2cQzGOIkSDjGUsPZZ/OGCzqKYkZd67qllZyC5K+d+j0cDD+EkifBvAc8PNBcCI1q2SnJ4UgyA6akASndt1Y/nZD4nFEeKJ8Cfh+EGymF60lrZB/HeUflQn+oPW/gg= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490424983190.73854491930888; Wed, 10 Sep 2025 00:47:04 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117785.1463896 (Exim 4.92) (envelope-from ) id 1uwFXL-0001ez-FU; Wed, 10 Sep 2025 07:46:39 +0000 Received: by outflank-mailman (output) from mailman id 1117785.1463896; Wed, 10 Sep 2025 07:46:39 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFXL-0001by-2s; Wed, 10 Sep 2025 07:46:39 +0000 Received: by outflank-mailman (input) for mailman id 1117785; Wed, 10 Sep 2025 07:46:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFRH-0005yt-7R for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:23 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2060b.outbound.protection.outlook.com [2a01:111:f403:2418::60b]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 67af338e-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:40:22 +0200 (CEST) Received: from SN6PR01CA0009.prod.exchangelabs.com (2603:10b6:805:b6::22) by PH7PR12MB8124.namprd12.prod.outlook.com (2603:10b6:510:2ba::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:40:15 +0000 Received: from SN1PEPF000252A0.namprd05.prod.outlook.com (2603:10b6:805:b6:cafe::da) by SN6PR01CA0009.outlook.office365.com (2603:10b6:805:b6::22) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:40:33 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A0.mail.protection.outlook.com (10.167.242.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:40:14 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:40:01 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 67af338e-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mGYKk8no+4KzoG7QdOuvFHB3+G/uKkJIJ2ZWJvcNWvjyuCfgSEmP2MZMDu2gk4VGL2qJgYteunEkbOTUmdQOYC48yg+dsZoHM3BMUl5nV4EG45XvWVZzJ02xkSUb+ttG+1QZEJxStdWl5ZNpub83o9pbPKmepP2g+OTtpXAuqDPKUyYIH8FWNErRR9CtMrFq3MOG2WTxkkQ9oWa+8qsxNn95yToCcK2+qfBnWsg8mzh5SI6BaWsMLdZvStGgNykX7jxT+ZfOivMwPfQ3ZCWpUi3Wu6U32k1pU9wapfhjXGlH3mz20b3yvDuAC0SXLPny2KvM8+V+VF4stAqb3psvPg== 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=cPpP+b+/IukhAi2FKipdO0pKRRyw4rGNMr68r7YHWug=; b=xn8iP5Am4moSGR5Gf8YYehMyAwpguOiME3F72L/oHDSQNhDJI40b/S0mk+dqwTerZ2uydeeOjjMczf8R8AvNJ7+5tiMIE4zOmcoMO3TqrYBJOxl5AHOGSG/B0/6bmsGHOWctFmXRQ2nSO6QToXponc526wu88LkfwKpNCfzoihguG7zacDPqJJFx4xk7aHvKvMUnDMNaOMIIvfMKC2ub9ZtCzBgxfGcCQMVTfbX7AHPTknsqQ98QnisA1Ca9vTL6wkq6NP8My+KDu1Mo+nw3kr7LC3YgTlaIg6LfQ5nlakdmTLDXyml5EcDPd+/XNNiqOxyzosJpgEFWbb7pYS5e8g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=cPpP+b+/IukhAi2FKipdO0pKRRyw4rGNMr68r7YHWug=; b=fUqJYcMC7yNDw9AdbnqiiRG6BpSN1c6IisbZiQWwnFwZEXL7qatF8ZgTAQ8PqfycX+SUvzN762DrQavtVDMalxGNGv0FgvYERjwg3D0c4P8TVH0efmkETLaglL313/6egK826KZVYnaVxXcXmEphIoUrW2FaPcnvVo2ng+74S1s= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini , "Bertrand Marquis" , Volodymyr Babchuk , Tamas K Lengyel , "Daniel P. Smith" Subject: [PATCH v2 24/26] xen/domctl: wrap arch-specific domctl-op with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:25 +0800 Message-ID: <20250910073827.3622177-25-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A0:EE_|PH7PR12MB8124:EE_ X-MS-Office365-Filtering-Correlation-Id: e4723181-0433-465e-761e-08ddf03d478e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|7416014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?T+U/ja/36brzF1BhhqMUoODrhA+e9rvnfX3iYu6HLuD1Jlioo44m7Bm1vnul?= =?us-ascii?Q?nkO6w/yZjYRM7u77YhzvcH/v11j57153AiN/WxPoh+Cn/GbSlj+sIkVNF9Z+?= =?us-ascii?Q?HIpRmHb5OyQqTHBrmKgGhf6dBD1YkEEMEW1pKZyjEv1oY4tO5FODlRQvInFB?= =?us-ascii?Q?UjmxjDJ5iT3ssGPbw6se6UTefnuY3Sq/kK8qIsDyPBTOmxetUoe5pAZAT2aB?= =?us-ascii?Q?havpM2YzuJXcEIOCwxosyOGnYPfBCfEMggnUrM9i/EloHnbM0vJeYjMBtw/t?= =?us-ascii?Q?rdxSqeYCduuMrQpF2+NlqeoocNxnGVOE+DRgIPjZAS4UDRcEJMiC4p4zWOkl?= =?us-ascii?Q?Y6RuDkw/k9mEwXU6JDtVEq9RVXRyaCzMcmxJgujCxKPrsH/NzI2NNY9qSL3H?= =?us-ascii?Q?wrmDyZG50tUWCaWK3wdUiTUrwEe7knnIFndMDyttypdl3OK24lW5enpZExSo?= =?us-ascii?Q?gmR9gLc/5NvIRf8oxhdAyGRLq6g41Og4efkZnP313MnTD/FMOo8gbOjElYqo?= =?us-ascii?Q?phQy0B/RE3Dp/5c/kOniO4I/KY8JTWEqye2OZsP1CQqT63lnzdUCEBqTQT3g?= =?us-ascii?Q?NYqhKct734JHLAbBG1ad0WbmU7rODuj3ni8PvK8TbjEDXc91HNjaFxfjIbfe?= =?us-ascii?Q?zoJ1aXTRTkNob+OuNArJU23JiewoEilTbtiIC3bwpAJrPUUSTSiqESBBP+iT?= =?us-ascii?Q?sa43Aym0QuEXLYNugIyfOVFe7mLVgu1Yfems3WOc5EdNU8dAthOuMjaZacij?= =?us-ascii?Q?ac3fI0iK0QuJQeVvwWnboiMsDszvlcfGxB4NR54y6F83yJ3J5N14pUwUBpgw?= =?us-ascii?Q?mW8HUXbQRHZItsYl+z2neo33OFQx8XAdC7Ek3yNi6D1+Y6KxjGRwxKWRuDzg?= =?us-ascii?Q?QcguEJ02+Va1wHIDEL1xMf0+C3BGUGS+de5oY9zpr1tga1x6R57aMKh2o5At?= =?us-ascii?Q?buPxxcOtx9QO18iEDN1Gaf1qXUI8U9zj5HCX2MA54a6NJ9YzOcSY4H1c3AiG?= =?us-ascii?Q?rxM6L2zOuSkBFie6eV5ytzqnE9ZXPAaVyY5OayO2sLG5aPYU8lCOE+DAuUcm?= =?us-ascii?Q?rXCj4EnWzsLy3vozUdbtUxbaC9yk6+jWqfZ5mrVBBzjaU/jp8aFJ8XQuXZYz?= =?us-ascii?Q?AVougIevW9KlxN0H0HmHgh0qYxUAGocB2rRNmX6g+6zSigcs84VCbPzl/f6e?= =?us-ascii?Q?jrPTfpat9/xXctIKZTckJ+nR+r5Nofi4W81TzuWUfg4xIrCcsrXNmLMwPapw?= =?us-ascii?Q?u7rmMpLGuNFzSJlZt4Zl/lk3BiqAOylpvgrd8Kr8K+CziWqDqxCC8wdd3q0H?= =?us-ascii?Q?YywcbnVIQw6mo9NQ4wUUZ4YDQ7cMb0qven+BhDos6R31oaB3WCy+hTAQSI8/?= =?us-ascii?Q?zVsds4EANhzwc+wWHhuhFjW+CwBiDoxKGz43KpG3ZAagkJ5/LWCT7ZkA6f2T?= =?us-ascii?Q?a+B0ZYMBspwNWKe0fzZDsmLFf2ziZR5tyfzcHttiSr5qYFQjV9710qsiSTM9?= =?us-ascii?Q?eIpXSi9uBkRhEZtYvUtHoyFn6O1sefdxdl/y?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(7416014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:40:14.0060 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4723181-0433-465e-761e-08ddf03d478e 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A0.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8124 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490426135124100 Content-Type: text/plain; charset="utf-8" Function arch_do_domctl() is responsible for arch-specific domctl-op, and shall be wrapped with CONFIG_MGMT_HYPERCALLS Tracking its calling chain and the following functions shall be wrapped with CONFIG_MGMT_HYPERCALLS: For x86: - hvm_save_one - hvm_acpi_power_button - hvm_acpi_sleep_button - hvm_debug_op - mem_sharing_domctl - make P2M_AUDIT depend on CONFIG_MGMT_HYPERCALLS - make PG_log_dirty depend on CONFIG_MGMT_HYPERCALLS - make policy.o depend on CONFIG_MGMT_HYPERCALLS - do_vmtrace_op - hvm_vmtrace_control - hvm_funcs.vmtrace_control - hvm_vmtrace_get_option - hvm_funcs.vmtrace_get_option - hvm_vmtrace_set_option - hvm_funcs.vmtrace_set_option - paging_domctl_cont For ARM: - subarch_do_domctl Also, remove all #ifdef CONFIG_MGMT_HYPERCALLS-s in arch-specific domctl.c,= as we put the guardian in Makefile for the whole file. Wrap default-case and arch_get_domain_info() transiently with CONFIG_MGMT_HYPERCALLS, and it will be removed when introducing CONFIG_MGMT_HYPERCALLS on the common/domctl.c in the last. Signed-off-by: Penny Zheng --- v1 -> v2: - split out xsm parts - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" - wrap default-case and arch_get_domain_info() transiently --- xen/Kconfig.debug | 2 +- xen/arch/arm/arm32/Makefile | 2 +- xen/arch/arm/arm64/Makefile | 2 +- xen/arch/arm/domctl.c | 2 -- xen/arch/x86/Makefile | 2 +- xen/arch/x86/domctl.c | 2 -- xen/arch/x86/hvm/hvm.c | 2 ++ xen/arch/x86/hvm/pmtimer.c | 2 ++ xen/arch/x86/hvm/save.c | 2 ++ xen/arch/x86/hvm/vmx/vmx.c | 6 ++++++ xen/arch/x86/include/asm/hvm/hvm.h | 10 ++++++++++ xen/arch/x86/include/asm/p2m.h | 2 +- xen/arch/x86/include/asm/paging.h | 2 +- xen/arch/x86/mm/mem_sharing.c | 2 ++ xen/common/domctl.c | 6 ++++++ xen/include/hypercall-defs.c | 4 ++-- xen/lib/x86/Makefile | 2 +- 17 files changed, 39 insertions(+), 13 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index a69615cd63..0dd44d2b10 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -15,7 +15,7 @@ if DEBUG || EXPERT =20 config GDBSX bool "Guest debugging with gdbsx" - depends on X86 + depends on X86 && MGMT_HYPERCALLS default y help If you want to enable support for debugging guests from dom0 via diff --git a/xen/arch/arm/arm32/Makefile b/xen/arch/arm/arm32/Makefile index 531168f58a..f8cbf14211 100644 --- a/xen/arch/arm/arm32/Makefile +++ b/xen/arch/arm/arm32/Makefile @@ -4,7 +4,7 @@ obj-$(CONFIG_MPU) +=3D mpu/ =20 obj-y +=3D cache.o obj-$(CONFIG_EARLY_PRINTK) +=3D debug.o -obj-y +=3D domctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D domctl.o obj-y +=3D domain.o obj-y +=3D entry.o obj-y +=3D head.o diff --git a/xen/arch/arm/arm64/Makefile b/xen/arch/arm/arm64/Makefile index 6491c5350b..6b77a15abe 100644 --- a/xen/arch/arm/arm64/Makefile +++ b/xen/arch/arm/arm64/Makefile @@ -6,7 +6,7 @@ obj-y +=3D cache.o obj-y +=3D cpufeature.o obj-$(CONFIG_HARDEN_BRANCH_PREDICTOR) +=3D bpi.o obj-$(CONFIG_EARLY_PRINTK) +=3D debug.o -obj-y +=3D domctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D domctl.o obj-y +=3D domain.o obj-y +=3D entry.o obj-y +=3D head.o diff --git a/xen/arch/arm/domctl.c b/xen/arch/arm/domctl.c index d3263e4d03..ad914c915f 100644 --- a/xen/arch/arm/domctl.c +++ b/xen/arch/arm/domctl.c @@ -184,7 +184,6 @@ long arch_do_domctl(struct xen_domctl *domctl, struct d= omain *d, } } =20 -#ifdef CONFIG_MGMT_HYPERCALLS void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) { struct vcpu_guest_context *ctxt =3D c.nat; @@ -200,7 +199,6 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_con= text_u c) if ( !test_bit(_VPF_down, &v->pause_flags) ) ctxt->flags |=3D VGCF_online; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index a7bfe4c0b1..8427dc52fd 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -28,7 +28,7 @@ obj-y +=3D delay.o obj-y +=3D desc.o obj-bin-y +=3D dmi_scan.init.o obj-y +=3D domain.o -obj-y +=3D domctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D domctl.o obj-bin-y +=3D dom0_build.init.o obj-y +=3D domain_page.o obj-y +=3D e820.o diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index ea5f5b20cf..6153e3c07e 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1370,7 +1370,6 @@ long arch_do_domctl( return ret; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS #ifdef CONFIG_COMPAT #define xen_vcpu_guest_context vcpu_guest_context #define fpu_ctxt fpu_ctxt.x @@ -1563,7 +1562,6 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_c= ontext_u c) c(vm_assist =3D d->vm_assist); #undef c } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Local variables: diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index b044dc2ecb..08bb1ba857 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -5223,6 +5223,7 @@ long do_hvm_op(unsigned long op, XEN_GUEST_HANDLE_PAR= AM(void) arg) return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int hvm_debug_op(struct vcpu *v, int32_t op) { int rc =3D 0; @@ -5265,6 +5266,7 @@ int hvm_debug_op(struct vcpu *v, int32_t op) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 #ifdef CONFIG_VM_EVENT void hvm_toggle_singlestep(struct vcpu *v) diff --git a/xen/arch/x86/hvm/pmtimer.c b/xen/arch/x86/hvm/pmtimer.c index 87a7a01c9f..f080f7561d 100644 --- a/xen/arch/x86/hvm/pmtimer.c +++ b/xen/arch/x86/hvm/pmtimer.c @@ -56,6 +56,7 @@ static void pmt_update_sci(PMTState *s) hvm_isa_irq_deassert(s->vcpu->domain, SCI_IRQ); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS void hvm_acpi_power_button(struct domain *d) { PMTState *s =3D &d->arch.hvm.pl_time->vpmt; @@ -81,6 +82,7 @@ void hvm_acpi_sleep_button(struct domain *d) pmt_update_sci(s); spin_unlock(&s->lock); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* Set the correct value in the timer, accounting for time elapsed * since the last time we did that. */ diff --git a/xen/arch/x86/hvm/save.c b/xen/arch/x86/hvm/save.c index 8ab6405706..0d966911a2 100644 --- a/xen/arch/x86/hvm/save.c +++ b/xen/arch/x86/hvm/save.c @@ -121,6 +121,7 @@ size_t hvm_save_size(struct domain *d) return sz; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS /* * Extract a single instance of a save record, by marshalling all records = of * that type and copying out the one we need. @@ -195,6 +196,7 @@ int hvm_save_one(struct domain *d, unsigned int typecod= e, unsigned int instance, xfree(ctxt.data); return rv; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 int hvm_save(struct domain *d, hvm_domain_context_t *h) { diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 4cf5da70ad..056f46673e 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2585,6 +2585,7 @@ static bool cf_check vmx_get_pending_event( (RTIT_STATUS_FILTER_EN | RTIT_STATUS_CONTEXT_EN | RTIT_STATUS_TRIGGER_= EN | \ RTIT_STATUS_ERROR | RTIT_STATUS_STOPPED) =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check vmtrace_get_option( struct vcpu *v, uint64_t key, uint64_t *output) { @@ -2693,6 +2694,7 @@ static int cf_check vmtrace_control(struct vcpu *v, b= ool enable, bool reset) =20 return 0; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check vmtrace_output_position(struct vcpu *v, uint64_t *pos) { @@ -2883,10 +2885,14 @@ static struct hvm_function_table __initdata_cf_clob= ber vmx_function_table =3D { .altp2m_vcpu_emulate_ve =3D vmx_vcpu_emulate_ve, .altp2m_vcpu_emulate_vmfunc =3D vmx_vcpu_emulate_vmfunc, #endif +#ifdef CONFIG_MGMT_HYPERCALLS .vmtrace_control =3D vmtrace_control, +#endif .vmtrace_output_position =3D vmtrace_output_position, +#ifdef CONFIG_MGMT_HYPERCALLS .vmtrace_set_option =3D vmtrace_set_option, .vmtrace_get_option =3D vmtrace_get_option, +#endif .vmtrace_reset =3D vmtrace_reset, =20 .get_reg =3D vmx_get_reg, diff --git a/xen/arch/x86/include/asm/hvm/hvm.h b/xen/arch/x86/include/asm/= hvm/hvm.h index b2c75b733e..6e5ec65a8e 100644 --- a/xen/arch/x86/include/asm/hvm/hvm.h +++ b/xen/arch/x86/include/asm/hvm/hvm.h @@ -239,10 +239,14 @@ struct hvm_function_table { #endif =20 /* vmtrace */ +#ifdef CONFIG_MGMT_HYPERCALLS int (*vmtrace_control)(struct vcpu *v, bool enable, bool reset); +#endif int (*vmtrace_output_position)(struct vcpu *v, uint64_t *pos); +#ifdef CONFIG_MGMT_HYPERCALLS int (*vmtrace_set_option)(struct vcpu *v, uint64_t key, uint64_t value= ); int (*vmtrace_get_option)(struct vcpu *v, uint64_t key, uint64_t *valu= e); +#endif int (*vmtrace_reset)(struct vcpu *v); =20 uint64_t (*get_reg)(struct vcpu *v, unsigned int reg); @@ -747,8 +751,10 @@ bool altp2m_vcpu_emulate_ve(struct vcpu *v); =20 static inline int hvm_vmtrace_control(struct vcpu *v, bool enable, bool re= set) { +#ifdef CONFIG_MGMT_HYPERCALLS if ( hvm_funcs.vmtrace_control ) return alternative_call(hvm_funcs.vmtrace_control, v, enable, rese= t); +#endif =20 return -EOPNOTSUPP; } @@ -765,8 +771,10 @@ static inline int hvm_vmtrace_output_position(struct v= cpu *v, uint64_t *pos) static inline int hvm_vmtrace_set_option( struct vcpu *v, uint64_t key, uint64_t value) { +#ifdef CONFIG_MGMT_HYPERCALLS if ( hvm_funcs.vmtrace_set_option ) return alternative_call(hvm_funcs.vmtrace_set_option, v, key, valu= e); +#endif =20 return -EOPNOTSUPP; } @@ -774,8 +782,10 @@ static inline int hvm_vmtrace_set_option( static inline int hvm_vmtrace_get_option( struct vcpu *v, uint64_t key, uint64_t *value) { +#ifdef CONFIG_MGMT_HYPERCALLS if ( hvm_funcs.vmtrace_get_option ) return alternative_call(hvm_funcs.vmtrace_get_option, v, key, valu= e); +#endif =20 return -EOPNOTSUPP; } diff --git a/xen/arch/x86/include/asm/p2m.h b/xen/arch/x86/include/asm/p2m.h index 1856cc396c..f29605df54 100644 --- a/xen/arch/x86/include/asm/p2m.h +++ b/xen/arch/x86/include/asm/p2m.h @@ -20,7 +20,7 @@ #include /* for pagetable_t */ =20 /* Debugging and auditing of the P2M code? */ -#if !defined(NDEBUG) && defined(CONFIG_HVM) +#if !defined(NDEBUG) && defined(CONFIG_HVM) && defined(CONFIG_MGMT_HYPERCA= LLS) #define P2M_AUDIT 1 #else #define P2M_AUDIT 0 diff --git a/xen/arch/x86/include/asm/paging.h b/xen/arch/x86/include/asm/p= aging.h index 1b0694bb36..db3e5b8f31 100644 --- a/xen/arch/x86/include/asm/paging.h +++ b/xen/arch/x86/include/asm/paging.h @@ -55,7 +55,7 @@ #define PG_translate 0 #define PG_external 0 #endif -#ifdef CONFIG_PAGING +#if defined(CONFIG_PAGING) && defined(CONFIG_MGMT_HYPERCALLS) /* Enable log dirty mode */ #define PG_log_dirty (XEN_DOMCTL_SHADOW_ENABLE_LOG_DIRTY << PG_mode_shif= t) #else diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index d7cbf2047b..3210cf5553 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -2319,6 +2319,7 @@ out: return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS int mem_sharing_domctl(struct domain *d, struct xen_domctl_mem_sharing_op = *mec) { int rc; @@ -2336,6 +2337,7 @@ int mem_sharing_domctl(struct domain *d, struct xen_d= omctl_mem_sharing_op *mec) =20 return rc; } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void arch_dump_shared_mem_info(void) { diff --git a/xen/common/domctl.c b/xen/common/domctl.c index c87c28cea2..5657b95089 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -114,7 +114,9 @@ void getdomaininfo(struct domain *d, struct xen_domctl_= getdomaininfo *info) =20 memcpy(info->handle, d->handle, sizeof(xen_domain_handle_t)); =20 +#ifdef CONFIG_MGMT_HYPERCALLS arch_get_domain_info(d, info); +#endif } =20 bool domctl_lock_acquire(void) @@ -882,7 +884,11 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; =20 default: +#ifdef CONFIG_MGMT_HYPERCALLS ret =3D arch_do_domctl(op, d, u_domctl); +#else + ret =3D -EOPNOTSUPP; +#endif /* CONFIG_MGMT_HYPERCALLS */ break; } =20 diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index cd2c801af6..02d7b93e80 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -197,7 +197,7 @@ dm_op(domid_t domid, unsigned int nr_bufs, xen_dm_op_bu= f_t *bufs) #ifdef CONFIG_MGMT_HYPERCALLS sysctl(xen_sysctl_t *u_sysctl) #endif -#if defined(CONFIG_X86) && defined(CONFIG_PAGING) +#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && defined(CONFIG_MGMT_H= YPERCALLS) paging_domctl_cont(xen_domctl_t *u_domctl) #endif domctl(xen_domctl_t *u_domctl) @@ -296,7 +296,7 @@ dm_op compat do co= mpat do do hypfs_op do do do do do #endif mca do do - - - -#if defined(CONFIG_X86) && defined(CONFIG_PAGING) +#if defined(CONFIG_X86) && defined(CONFIG_PAGING) && defined(CONFIG_MGMT_H= YPERCALLS) paging_domctl_cont do do do do - #endif =20 diff --git a/xen/lib/x86/Makefile b/xen/lib/x86/Makefile index 780ea05db1..ee5bec225e 100644 --- a/xen/lib/x86/Makefile +++ b/xen/lib/x86/Makefile @@ -1,3 +1,3 @@ obj-y +=3D cpuid.o obj-y +=3D msr.o -obj-y +=3D policy.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D policy.o --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490381; cv=pass; d=zohomail.com; s=zohoarc; b=HoJv+wVQchLx7kV3E4Nn1kMhPosDPyyl0dBgbBTdwflDrYXSLpOquWA25CJZw7K09+OA1RjmCc/It9cnFq5ifIdNZCjKgZHIJQA3siU9fCHH2Lz1PLBYAASPLwGfdduQ0J5Nz4pdNfecuU5zDiHpBO+njYgQv+GFWASNomsRv14= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490381; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hWuX102tq8N0iGW1Xc/rVxB+j69uluf4R+r4Cnb/XwU=; b=aqEjJQjtp3oz1u/5bdSs/LGUzH4tnJYsV0snxc3lvu/E6sS4U1Jb+qV31bhz8+j4xh9pw7DmC2bKYcYJnYtrz7vAcV96UMWIQgTpO+7c63Qz/SAHQlAph9kOu3H20QeyakWqtkPdvQ5OsFOXkIr+F202e4EmzrTzr/py9nDzSk4= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490381670253.5325604937483; Wed, 10 Sep 2025 00:46:21 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117664.1463755 (Exim 4.92) (envelope-from ) id 1uwFWl-0004RL-P5; Wed, 10 Sep 2025 07:46:03 +0000 Received: by outflank-mailman (output) from mailman id 1117664.1463755; Wed, 10 Sep 2025 07:46:03 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFWl-0004RE-MA; Wed, 10 Sep 2025 07:46:03 +0000 Received: by outflank-mailman (input) for mailman id 1117664; Wed, 10 Sep 2025 07:46:02 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFRG-0005yo-Qx for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:22 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on20608.outbound.protection.outlook.com [2a01:111:f403:2417::608]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 66ce359c-8e19-11f0-9809-7dc792cee155; Wed, 10 Sep 2025 09:40:20 +0200 (CEST) Received: from BYAPR11CA0082.namprd11.prod.outlook.com (2603:10b6:a03:f4::23) by IA0PR12MB8645.namprd12.prod.outlook.com (2603:10b6:208:48f::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:40:15 +0000 Received: from SN1PEPF0002529E.namprd05.prod.outlook.com (2603:10b6:a03:f4:cafe::91) by BYAPR11CA0082.outlook.office365.com (2603:10b6:a03:f4::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9094.22 via Frontend Transport; Wed, 10 Sep 2025 07:40:14 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF0002529E.mail.protection.outlook.com (10.167.242.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:40:14 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:40:04 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 66ce359c-8e19-11f0-9809-7dc792cee155 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ps8wEh1u+KGi+t09RPAtHWmZRRNbgiW4Z+dWSJbExQRZL8APK6owBNqnFi3XfBYPxeSeMyUcpLzeIuOog7js9yuR8ClvmBaFumu5vp8zLeMEju7vQIk4Wbh6ph6RLaeke8DbIFPz3tTND79cvgKOrUWF7BkM19FgnmbP+m9KXEvzGALNJAxDYcnF+TJuLRgiS/Tdf1QRcxY0n3OgB1LoEB6q9aGWLvrg8reY7eCx89F51gbctUcCmE1BOFxKp0F/GZXvPJ8XZ6vXUSHaDndRY5nx/OMrwaeflYUued1ogBsn5VTQfSAE0ZHrdalJ2swZb/Svuopvt+mbcj+W9OA8CQ== 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=hWuX102tq8N0iGW1Xc/rVxB+j69uluf4R+r4Cnb/XwU=; b=iKv5W3CgikRHbc9XWII0F+gSF9sZDdLpHgqYlepAsVROQQRaMHhGfjxpYj/tZvIxNs9YDEAusjY9v4AvgF/jZ3OVA6reZaGv6wSDF4YBk+CIOvFVbRoWB6N/uOC8FqT15U8JIKOiJdhkz0NDG7QhgoYPwAiWjpLz1VxPXmLm0ImcFUAXD8eBesDhDCBoZdt/rQCyJOOKpU+KrJpkYV1zZtr5LWioTnGUCT7y1716EzmW6DWwFkx8lq3Gkq1qz1ydRtYbOsz04GLJQvCZRkLPoK3DuronUBANdcEsP/Wn1Kz2Ed59KvRoew4nQcrBiSmoni8R/nn3QGmN2W5MJBQzzQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=hWuX102tq8N0iGW1Xc/rVxB+j69uluf4R+r4Cnb/XwU=; b=fvGfr/0tX9Uz3aOqC9LAhPG8N5q8lc1dak5VQgBM8u81m+OlmV7Ltqh0eXbYWYt4zf80zj668sSN+B47eUWmEur4teh8FmhdxyV6LZnRtAFe0D7dn/37adQolkEUfXMFfTdZNQa5ZlSeBZC5SJGmtDb2tGwD1wRS2tIxBrJUDpk= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , "Daniel P. Smith" Subject: [PATCH v2 25/26] xen/xsm: wrap xsm functions with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:26 +0800 Message-ID: <20250910073827.3622177-26-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002529E:EE_|IA0PR12MB8645:EE_ X-MS-Office365-Filtering-Correlation-Id: e8af2545-45c3-4072-4ecb-08ddf03d47d2 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?uYgqoPTuaLZ9fVwkGZSjOlr9byLe1Bzai8rMquUZPLD5J4ILNARx2aAMfCsI?= =?us-ascii?Q?7vIhOjaPGFdZUNgh8dj0TH8t9+9wCiqMP43ZjeOB7ztVfJOiYOcRZIUPbrCA?= =?us-ascii?Q?mY/+CRhzxw6CwQ3WWKd7e4dTglB4jq6qJl0yVNCTjKtwVOVWwnnVEvCfIDFy?= =?us-ascii?Q?NrLPipS+QpZHyEaykhfLV0DIlAO57KiFmJxjRRlATQhR/syWoDOaEBTkvkEm?= =?us-ascii?Q?yu2dyyWL3mH7SyZKc0tLO+Cc2NaqqWjONqkWsw+TAybXSSYOQchy6ZV3fFnB?= =?us-ascii?Q?NCwDk7syRnpx+HUJWgk9cvCOK2E0yt7WFIO4toaBdHZKQF9SMTGXBgPy+s8c?= =?us-ascii?Q?I+TZWQQ7//nGOcAeJZQUjL5V9ENqlp+rOugpPB00vzZnPFvVZM8a7S2AcOzu?= =?us-ascii?Q?KHMXw4E1xBS0TOFpKidyr9sQ/FhpeMNy3m9s2ttEcYJJOBagYp2JHTIAiLbm?= =?us-ascii?Q?oaJBDSqq6R53Ko9wLRImQA5O8FoInWTY+qVYf8PwnNJ7ZNEzyUOKY8BpR50j?= =?us-ascii?Q?mXxndP4IrpurepQ1DW082mhOSKHUBKUL7FBvYIjv/Ux7hJqPMm2Er8N+IYpj?= =?us-ascii?Q?xphy8GxwO2YoFElrN98+6/5KaEDCM119ON/EtT5f1GOTBFo+73NzEAMr/sG2?= =?us-ascii?Q?AIHzOVEm/YV2eaX1mz+3ReQGr/PiEjyPdWOb4Kd+IZYwZ0VLd9j3JJw5lmBe?= =?us-ascii?Q?N/vUMp5fO2BrOEReFymZyTRWg426xXnDEmBKkbWn5KRZu/rKx4qD/qRnGLp4?= =?us-ascii?Q?QMUVgjy+jERryBQIfvlDNb9CoKcZxU527WGoCpjWdi/VbxMNxPZ2znM3Dyub?= =?us-ascii?Q?nDdm/bhnYMN9s5TqDAHRM1vhubBKfpxyWgD6q+ivorxX2guU8Uzfxq+GTnJ7?= =?us-ascii?Q?zfr1QEl9Br5KvXn7IvWSV/e99sHBPOmEQw6Dn5XGanuuDJlDqiWEQWT7MZJd?= =?us-ascii?Q?qiLJU+P/tBBVxGUyDqRGqWMANhSe8ISSS6cDFIhqFPPj+McxMLsoKCH5Hm8P?= =?us-ascii?Q?zCu/jge+NjK5QCNWVGn+DThzwtQ5/SdGp9duuOqlm1A1sfvFevVBGQ7UTn58?= =?us-ascii?Q?XSTUrBZG+QpQpJoeRcOxYu6wrwlkcpnnlvErr8nBhqvnWbYh2KK/nE6HByvH?= =?us-ascii?Q?NpBrYmjSqqeWzyt3DyeATZmFEUw3eIW7InNxU/Mlo5mnFxQBQRTs8M5fuBXR?= =?us-ascii?Q?Isy79lE/kWwDt3c1OlaQR6VwF1dOaErBdunK46I1+df8NERKndf9xsSSoxzP?= =?us-ascii?Q?/16ZgSroMy8HHWrvso3xRqMqt/0sQCIE7URYY+XjDXAanh8Eprv240qKVe9Q?= =?us-ascii?Q?zABGHlusZggs1QeMEwU18iiAj6nxsSWj92Y2IJ7Eki/7O39Yed0lODc4h2fY?= =?us-ascii?Q?SjMgOZhsZncuGWUrurKl8xaySIeWyNo6Azm2M22Mq2Jt252C5RYSoe2BshC0?= =?us-ascii?Q?GBMOl5hjPyoQ8cUCRFrDlVS0Psaug6YHNlpemonARu8zgYrCOTZkZVCfhKry?= =?us-ascii?Q?brB9eocZf8nbXMgwz2x0fL8WGLISz4jSg+Db?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(82310400026)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:40:14.4513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e8af2545-45c3-4072-4ecb-08ddf03d47d2 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002529E.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8645 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490383979116601 Content-Type: text/plain; charset="utf-8" The following functions are xsm-related and only invoked under arch-specific domctl-op, so they shall all be wrapped with CONFIG_MGMT_HYPERCALLS: - xsm_domctl - xsm_{bind,unbind}_pt_irq - xsm_ioport_permission - xsm_ioport_mapping Signed-off-by: Penny Zheng --- v1 -> v2: - new commit --- xen/include/xsm/xsm.h | 14 ++++++++++++-- xen/xsm/dummy.c | 6 +++--- xen/xsm/flask/hooks.c | 12 ++++++------ 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 542488bd44..0539e3bf10 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -60,8 +60,8 @@ struct xsm_ops { int (*domctl_scheduler_op)(struct domain *d, int op); int (*sysctl_scheduler_op)(int op); int (*set_target)(struct domain *d, struct domain *e); -#endif int (*domctl)(struct domain *d, unsigned int cmd, uint32_t ssidref); +#endif int (*sysctl)(int cmd); int (*readconsole)(uint32_t clear); =20 @@ -111,9 +111,9 @@ struct xsm_ops { int (*map_domain_irq)(struct domain *d, int irq, const void *data); int (*unmap_domain_pirq)(struct domain *d); int (*unmap_domain_irq)(struct domain *d, int irq, const void *data); +#ifdef CONFIG_MGMT_HYPERCALLS int (*bind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *bi= nd); int (*unbind_pt_irq)(struct domain *d, struct xen_domctl_bind_pt_irq *= bind); -#ifdef CONFIG_MGMT_HYPERCALLS int (*irq_permission)(struct domain *d, int pirq, uint8_t allow); int (*iomem_permission)(struct domain *d, uint64_t s, uint64_t e, uint8_t allow); @@ -190,10 +190,12 @@ struct xsm_ops { int (*update_va_mapping)(struct domain *d, struct domain *f, l1_pgentry_t pte); int (*priv_mapping)(struct domain *d, struct domain *t); +#ifdef CONFIG_MGMT_HYPERCALLS int (*ioport_permission)(struct domain *d, uint32_t s, uint32_t e, uint8_t allow); int (*ioport_mapping)(struct domain *d, uint32_t s, uint32_t e, uint8_t allow); +#endif int (*pmu_op)(struct domain *d, unsigned int op); #endif int (*dm_op)(struct domain *d); @@ -272,7 +274,11 @@ static inline int xsm_set_target( static inline int xsm_domctl(xsm_default_t def, struct domain *d, unsigned int cmd, uint32_t ssidref) { +#ifdef CONFIG_MGMT_HYPERCALLS return alternative_call(xsm_ops.domctl, d, cmd, ssidref); +#else + return -EOPNOTSUPP; +#endif } =20 static inline int xsm_sysctl(xsm_default_t def, int cmd) @@ -503,6 +509,7 @@ static inline int xsm_unmap_domain_irq( return alternative_call(xsm_ops.unmap_domain_irq, d, irq, data); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static inline int xsm_bind_pt_irq( xsm_default_t def, struct domain *d, struct xen_domctl_bind_pt_irq *bi= nd) { @@ -514,6 +521,7 @@ static inline int xsm_unbind_pt_irq( { return alternative_call(xsm_ops.unbind_pt_irq, d, bind); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static inline int xsm_irq_permission( xsm_default_t def, struct domain *d, int pirq, uint8_t allow) @@ -757,6 +765,7 @@ static inline int xsm_priv_mapping( return alternative_call(xsm_ops.priv_mapping, d, t); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static inline int xsm_ioport_permission( xsm_default_t def, struct domain *d, uint32_t s, uint32_t e, uint8_t a= llow) { @@ -768,6 +777,7 @@ static inline int xsm_ioport_mapping( { return alternative_call(xsm_ops.ioport_mapping, d, s, e, allow); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static inline int xsm_pmu_op( xsm_default_t def, struct domain *d, unsigned int op) diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c index 2c8e0725b6..48ed724f86 100644 --- a/xen/xsm/dummy.c +++ b/xen/xsm/dummy.c @@ -22,9 +22,7 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .domctl_scheduler_op =3D xsm_domctl_scheduler_op, .sysctl_scheduler_op =3D xsm_sysctl_scheduler_op, .set_target =3D xsm_set_target, -#endif .domctl =3D xsm_domctl, -#ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D xsm_sysctl, .readconsole =3D xsm_readconsole, #endif @@ -71,9 +69,9 @@ static const struct xsm_ops __initconst_cf_clobber dummy_= ops =3D { .map_domain_irq =3D xsm_map_domain_irq, .unmap_domain_pirq =3D xsm_unmap_domain_pirq, .unmap_domain_irq =3D xsm_unmap_domain_irq, +#ifdef CONFIG_MGMT_HYPERCALLS .bind_pt_irq =3D xsm_bind_pt_irq, .unbind_pt_irq =3D xsm_unbind_pt_irq, -#ifdef CONFIG_MGMT_HYPERCALLS .irq_permission =3D xsm_irq_permission, .iomem_permission =3D xsm_iomem_permission, #endif @@ -143,8 +141,10 @@ static const struct xsm_ops __initconst_cf_clobber dum= my_ops =3D { .mmuext_op =3D xsm_mmuext_op, .update_va_mapping =3D xsm_update_va_mapping, .priv_mapping =3D xsm_priv_mapping, +#ifdef CONFIG_MGMT_HYPERCALLS .ioport_permission =3D xsm_ioport_permission, .ioport_mapping =3D xsm_ioport_mapping, +#endif .pmu_op =3D xsm_pmu_op, #endif .dm_op =3D xsm_dm_op, diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c index 66d8bfda3a..76bf1b5240 100644 --- a/xen/xsm/flask/hooks.c +++ b/xen/xsm/flask/hooks.c @@ -665,7 +665,6 @@ static int cf_check flask_set_target(struct domain *d, = struct domain *t) &dsec->target_sid); return rc; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_domctl(struct domain *d, unsigned int cmd, uint32_t ssidref) @@ -858,7 +857,6 @@ static int cf_check flask_domctl(struct domain *d, unsi= gned int cmd, } } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_sysctl(int cmd) { switch ( cmd ) @@ -1078,6 +1076,7 @@ static int cf_check flask_unmap_domain_irq( return rc; } =20 +#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_bind_pt_irq( struct domain *d, struct xen_domctl_bind_pt_irq *bind) { @@ -1111,7 +1110,6 @@ static int cf_check flask_unbind_pt_irq( return current_has_perm(d, SECCLASS_RESOURCE, RESOURCE__REMOVE); } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static int cf_check flask_irq_permission( struct domain *d, int pirq, uint8_t access) { @@ -1634,6 +1632,7 @@ static int cf_check flask_shadow_control(struct domai= n *d, uint32_t op) return current_has_perm(d, SECCLASS_SHADOW, perm); } =20 +#ifdef CONFIG_MGMT_HYPERCALLS struct ioport_has_perm_data { uint32_t ssid; uint32_t dsid; @@ -1689,6 +1688,7 @@ static int cf_check flask_ioport_mapping( { return flask_ioport_permission(d, start, end, access); } +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 static int cf_check flask_mem_sharing_op( struct domain *d, struct domain *cd, int op) @@ -1894,9 +1894,7 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .domctl_scheduler_op =3D flask_domctl_scheduler_op, .sysctl_scheduler_op =3D flask_sysctl_scheduler_op, .set_target =3D flask_set_target, -#endif .domctl =3D flask_domctl, -#ifdef CONFIG_MGMT_HYPERCALLS .sysctl =3D flask_sysctl, .readconsole =3D flask_readconsole, #endif @@ -1943,9 +1941,9 @@ static const struct xsm_ops __initconst_cf_clobber fl= ask_ops =3D { .map_domain_irq =3D flask_map_domain_irq, .unmap_domain_pirq =3D flask_unmap_domain_pirq, .unmap_domain_irq =3D flask_unmap_domain_irq, +#ifdef CONFIG_MGMT_HYPERCALLS .bind_pt_irq =3D flask_bind_pt_irq, .unbind_pt_irq =3D flask_unbind_pt_irq, -#ifdef CONFIG_MGMT_HYPERCALLS .irq_permission =3D flask_irq_permission, .iomem_permission =3D flask_iomem_permission, #endif @@ -2016,8 +2014,10 @@ static const struct xsm_ops __initconst_cf_clobber f= lask_ops =3D { .mmuext_op =3D flask_mmuext_op, .update_va_mapping =3D flask_update_va_mapping, .priv_mapping =3D flask_priv_mapping, +#ifdef CONFIG_MGMT_HYPERCALLS .ioport_permission =3D flask_ioport_permission, .ioport_mapping =3D flask_ioport_mapping, +#endif .pmu_op =3D flask_pmu_op, #endif .dm_op =3D flask_dm_op, --=20 2.34.1 From nobody Sun Sep 14 06:32:59 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass(p=quarantine dis=none) header.from=amd.com ARC-Seal: i=2; a=rsa-sha256; t=1757490399; cv=pass; d=zohomail.com; s=zohoarc; b=UBDZkRjLbTNqDFjRM2JnKcdxcfzQoRtJKVjfp5Lq3NZIc1/Hlcxhj2PFjW85sYTUA01MHefoggaT7EZuQF3Xa6NMnOim+XZCW0Vd7PJuKLs43UAruE+8MqDbpBKny3+WZlyr0Nvd84XjrQLDt+RJWyY8/sf17Wx/1Wdi/6zCNd4= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1757490399; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SXHAK3uL+WqLVQS8Xa7MII98ao1zO0m4LzYxceHy8E4=; b=FLCjs5yeMCjoF93dll1BDA4c/2Jo+FP5NplUcrvpZE4o/sYVP5x0EgVjctiK7CmIrWDuecMiXWW00bmNf6G/bqRidHed6MGfBcZiSOUuUEEeYKkf7BLWP+4eqpytNSpouZlNffV1V7klrlmIUeUIWpPV1TVNb/ahUalQvKtEr6E= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; arc=pass (i=1 dmarc=pass fromdomain=amd.com); dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1757490399778276.45158242333866; Wed, 10 Sep 2025 00:46:39 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.1117707.1463830 (Exim 4.92) (envelope-from ) id 1uwFX5-00070g-Mr; Wed, 10 Sep 2025 07:46:23 +0000 Received: by outflank-mailman (output) from mailman id 1117707.1463830; Wed, 10 Sep 2025 07:46:23 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFX5-0006zU-A6; Wed, 10 Sep 2025 07:46:23 +0000 Received: by outflank-mailman (input) for mailman id 1117707; Wed, 10 Sep 2025 07:46:21 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uwFRL-0005yt-Gn for xen-devel@lists.xenproject.org; Wed, 10 Sep 2025 07:40:27 +0000 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20601.outbound.protection.outlook.com [2a01:111:f403:2414::601]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 682d0fc8-8e19-11f0-9d13-b5c5bf9af7f9; Wed, 10 Sep 2025 09:40:22 +0200 (CEST) Received: from SJ0P220CA0009.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::25) by PH7PR12MB6739.namprd12.prod.outlook.com (2603:10b6:510:1aa::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9094.22; Wed, 10 Sep 2025 07:40:17 +0000 Received: from SN1PEPF000252A4.namprd05.prod.outlook.com (2603:10b6:a03:41b:cafe::50) by SJ0P220CA0009.outlook.office365.com (2603:10b6:a03:41b::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9115.15 via Frontend Transport; Wed, 10 Sep 2025 07:40:17 +0000 Received: from satlexmb07.amd.com (165.204.84.17) by SN1PEPF000252A4.mail.protection.outlook.com (10.167.242.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9115.13 via Frontend Transport; Wed, 10 Sep 2025 07:40:16 +0000 Received: from penny-System-Product-Name.amd.com (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Wed, 10 Sep 2025 00:40:06 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 682d0fc8-8e19-11f0-9d13-b5c5bf9af7f9 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CN5x0eLqcfcJtcgcSKCJM+A/mDez7z6VkJD62ExDpUYYfDQhNHWDvyQ4StqlFRnl+QaVU1idBr+PGMthl5uD3Txep6t22fOBThQcVptdBROuTsH796347V4qCxtWvRBPo6gw77m+43/Su36W3mdIBINSRCzjMw17hDZh3eCBMSCQ85E25+BUEKulP5of88TxWH1Ui4HQzqwMee4fA2jS5Ba2a49YVS0BWXuwcEsrdptW9RtC+30fX7NHB/HDDAEpwhumEjckEGqyQ9u4cUpxYP7f/C9wK/3uvO7DSMlARCwwS+d2taunvOYxoCq9wj6HjnqAC2UmzIW+tO7Xtkn7aA== 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=SXHAK3uL+WqLVQS8Xa7MII98ao1zO0m4LzYxceHy8E4=; b=gI6FecQg6rj9IlimLMGIKe93kBRhdYydvitEUAgqPjSmlwNkJGOzlJrvF8uBFxGffQQfghM0clvjVHO3Q4henJwv6GfPX3UtR08IJ6awNFwO9avw1uUkKzXUi6ktgliRbBNJ7IuwlIalloD+HequprTdHWR4EOpuJHfxQmJ0PokW8uR7ZXtU5/sMV/WO0cHQ94/VyghCLlEHGRvlTrvglIQRF+YPPdMGEZSg/NLNCYWf6HSI5SmaN5xbENZN+7c5udt42Vn6cwetX/PI2bsakunYn2t7kczj7iDi0ztujUmQykwbwrIiaUvJ9EhyEHdjzwXRU4P8d0rYZCGVvt2niQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.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=SXHAK3uL+WqLVQS8Xa7MII98ao1zO0m4LzYxceHy8E4=; b=ETAjYkMXebEVLMtDf1O3oWUASrosYTkwGifcp1GQqQNWGmNJvhCCjFB6+lFkgCBqhcIlK9c1+DYLqG8Natn65P0C7OovAXUq3neJ+x5V7o9Op6UO7ylMSXCvkKkrO/S6OWf/6eWL9u+zxrnOvKv2JS9jRJETt61StWisO7mZF8k= 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 (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; 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=satlexmb07.amd.com; pr=C From: Penny Zheng To: CC: , Penny Zheng , Andrew Cooper , Anthony PERARD , Michal Orzel , Jan Beulich , "Julien Grall" , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= , Stefano Stabellini Subject: [PATCH v2 26/26] xen/domctl: wrap common/domctl.c with CONFIG_MGMT_HYPERCALLS Date: Wed, 10 Sep 2025 15:38:27 +0800 Message-ID: <20250910073827.3622177-27-Penny.Zheng@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250910073827.3622177-1-Penny.Zheng@amd.com> References: <20250910073827.3622177-1-Penny.Zheng@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF000252A4:EE_|PH7PR12MB6739:EE_ X-MS-Office365-Filtering-Correlation-Id: c7f821b7-7250-4afc-60cb-08ddf03d4954 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?aDvpUA0jZDkY7g5o1Tp0+n6GRyTTZ9l6pY889AwuPDpvIa0PgWXabPltKnIh?= =?us-ascii?Q?j/b7JEGZw8BEUhFROzTA9ewBfURM0d7B5x8v9kCt9U7vnhzB3vASMbTx+AlV?= =?us-ascii?Q?FH6ZC7v7PM0LLZB/K7KKYg2IuqYPla3EEEXvHFaC7afxzkc5/syP0AoyvUcg?= =?us-ascii?Q?XTncD0AYxN5KVy0Xv+XVGw0BwUXuKHFrAVLO276q/wvkMvOmezaAu2fUunJO?= =?us-ascii?Q?DFYCIMQ10BmyHd35+ppGiXUhNLDVqbDDHneKn05igiB8nymda5S5NO4gOzMa?= =?us-ascii?Q?t3IZpg9PvJP3mq9DxcpJbwlVjoLNoyd8NTHYKLhAvRba+uQta6x3WL6Ha2RV?= =?us-ascii?Q?lkJiVnZ/vWePigQ3jTU8b+vBOr44TCgkHKw8ovEA3vP6+b3W4VlvvdIbzxXe?= =?us-ascii?Q?u/DXfVBCuLNirrermheyYQC9wlNpQzwx5L41LKPWLHFKAabZUbZ9LKONtb4r?= =?us-ascii?Q?7wWVAvj0Nph/zpexJ7/7cooLJCmQ5J+YdinutcfFe5xh30BLvRuM41mVYXUX?= =?us-ascii?Q?uZISNroU4klqfEGcjFqa8ScGeR3YO3EL/npjzv58s/1C7aFqqvlxSVajA/Lr?= =?us-ascii?Q?2e/CqMqfWZouWhNe3qhgKD03zzgaFoXJA9rS7PmA4Cj9x1JIPUb8PY/RP4bg?= =?us-ascii?Q?ETeNWtVvFKSZZYFB7tJT0P8L1UQXrGUnefeH7vLREEsh3vKDRlmhcXhQItpb?= =?us-ascii?Q?oE4PNy+r4surKBl1l7lq5SUEMVQjW+dObPiRNQFEVOH/jVb/uBZFnSwxYbVi?= =?us-ascii?Q?pQFoGOgSS3mwl8IdG+CvXu/A51nhnEgVEoLVuKYGMBqIWWMSzAyaEedrLdDt?= =?us-ascii?Q?vyPxJN8sot6wDUdXBIgwFe8P5sqQOVQHezJVQEoOnvAbyhrVRdXclwmK7lvk?= =?us-ascii?Q?+q+VnE7l48P8pdnyv47P1xGMfDvKenQoFitb4Zj+1+WCFOYQDDk/Q7L0wnFQ?= =?us-ascii?Q?wYZ/lMQMneXUBwBhXMFH9gF5YAI9DBAenZM9175dYdSkqz0TcWirRalJkWIu?= =?us-ascii?Q?CgQa5ytZJU2PNbWeq61/8peygLdQ2c3LB2NwRIdB8Qn5ZkkPsT0nUyNxm8L2?= =?us-ascii?Q?4tHGLgqjroBY9vniWLuo8HY16RG4O7+4oNgmsvaNKG68ELh06AIVbG2QfrH3?= =?us-ascii?Q?QnWIJqgENEf1aCRJhb/q/fLC9UXdVEeoIGJoruQZQ7voL9Dl3jv9w2xj4rY9?= =?us-ascii?Q?f58RGrZml1g5zPSIXsK5YBgnus/fN2d2EJt7y/1+t4GYgEuXouXdzOQGOYTa?= =?us-ascii?Q?vBzEjlMhw/WOTuMKTiW1z9vjPud9XTe4xmUHn7N7n7ywF6g1bZU7JD99s3nU?= =?us-ascii?Q?g7EzqE0niaBQ+smNVu3+5JpCmvCBUgRQuCvEMyxm2LWXFDpDTkYpMJuPuX90?= =?us-ascii?Q?Z5GgqXXrpp4ckauXnsVsQeLAYw6xIUdFJwyw0klDxQ8bPJuq2sC78pPPUmah?= =?us-ascii?Q?hn0eP9h5lPOoEx5XRX7V6zshN3jHSTbxUVpGMv/ToiuAK+iEjqs6uZL1ibCK?= =?us-ascii?Q?qAZOJkrJvIP/DQcnW7lAaulqHbklDD6M2Lvp?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(376014)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2025 07:40:16.9751 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7f821b7-7250-4afc-60cb-08ddf03d4954 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=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF000252A4.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6739 X-ZohoMail-DKIM: pass (identity @amd.com) X-ZM-MESSAGEID: 1757490401768116600 Content-Type: text/plain; charset="utf-8" Wrap domctl hypercall def and domctl.o with CONFIG_MGMT_HYPERCALLS, and remove all #ifdef CONFIG_MGMT_HYPERCALLS wrappings in common/domctl.c With MGMT_HYPERCALLS=3Dn, we need to provide stub for domctl_lock_{acquire,release}(), as it may be invoked by hvm_set_param(). Signed-off-by: Penny Zheng --- v1 -> v2: - remove stub in common/domctl.c - combine the original commit of "xen/domctl: provide stub for domctl_lock_{acquire,release}" - adapt to changes of "unify DOMCTL to MGMT_HYPERCALLS" --- xen/common/Kconfig | 2 +- xen/common/Makefile | 2 +- xen/common/domctl.c | 24 ------------------------ xen/include/hypercall-defs.c | 4 +++- xen/include/xen/domain.h | 9 +++++++++ 5 files changed, 14 insertions(+), 27 deletions(-) diff --git a/xen/common/Kconfig b/xen/common/Kconfig index 1aedd00b12..da207a7183 100644 --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -654,7 +654,7 @@ config MGMT_HYPERCALLS help This option shall only be disabled on some dom0less systems, or PV shim on x86, to reduce Xen footprint via managing unnessary - hypercalls, like sysctl, etc. + hypercalls, like sysctl, domctl, etc. =20 config PM_OP bool "Enable Performance Management Operation" diff --git a/xen/common/Makefile b/xen/common/Makefile index fdf826f218..45c0bda000 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -11,7 +11,7 @@ obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) +=3D devic= e.o obj-$(CONFIG_DEVICE_TREE_PARSE) +=3D device-tree/ obj-$(CONFIG_IOREQ_SERVER) +=3D dm.o obj-y +=3D domain.o -obj-y +=3D domctl.o +obj-$(CONFIG_MGMT_HYPERCALLS) +=3D domctl.o obj-y +=3D domid.o obj-y +=3D event_2l.o obj-y +=3D event_channel.o diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 5657b95089..71e712c1f3 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -44,14 +44,12 @@ static int nodemask_to_xenctl_bitmap(struct xenctl_bitm= ap *xenctl_nodemap, MAX_NUMNODES); } =20 -#ifdef CONFIG_MGMT_HYPERCALLS static int xenctl_bitmap_to_nodemask(nodemask_t *nodemask, const struct xenctl_bitmap *xenctl_no= demap) { return xenctl_bitmap_to_bitmap(nodemask_bits(nodemask), xenctl_nodemap, MAX_NUMNODES); } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 void getdomaininfo(struct domain *d, struct xen_domctl_getdomaininfo *info) { @@ -114,9 +112,7 @@ void getdomaininfo(struct domain *d, struct xen_domctl_= getdomaininfo *info) =20 memcpy(info->handle, d->handle, sizeof(xen_domain_handle_t)); =20 -#ifdef CONFIG_MGMT_HYPERCALLS arch_get_domain_info(d, info); -#endif } =20 bool domctl_lock_acquire(void) @@ -394,26 +390,22 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) break; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_pausedomain: ret =3D -EINVAL; if ( d !=3D current->domain ) ret =3D domain_pause_by_systemcontroller(d); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_unpausedomain: ret =3D domain_unpause_by_systemcontroller(d); break; =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_resumedomain: if ( d =3D=3D current->domain ) /* no domain_pause() */ ret =3D -EINVAL; else domain_resume(d); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_createdomain: { @@ -473,7 +465,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) break; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_soft_reset: case XEN_DOMCTL_soft_reset_cont: if ( d =3D=3D current->domain ) /* no domain_pause() */ @@ -510,14 +501,12 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u= _domctl) ret =3D domain_set_node_affinity(d, &new_affinity); break; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getnodeaffinity: ret =3D nodemask_to_xenctl_bitmap(&op->u.nodeaffinity.nodemap, &d->node_affinity); break; =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_setvcpuaffinity: case XEN_DOMCTL_getvcpuaffinity: ret =3D vcpu_affinity_domctl(d, op->cmd, &op->u.vcpuaffinity); @@ -527,7 +516,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D sched_adjust(d, &op->u.scheduler_op); copyback =3D 1; break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getdomaininfo: ret =3D xsm_getdomaininfo(XSM_XS_PRIV, d); @@ -540,7 +528,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) copyback =3D 1; break; =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_getvcpucontext: { vcpu_guest_context_u c =3D { .nat =3D NULL }; @@ -589,7 +576,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) xfree(c.nat); break; } -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_getvcpuinfo: { @@ -750,11 +736,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; } =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_settimeoffset: domain_set_time_offset(d, op->u.settimeoffset.time_offset_seconds); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_set_target: { @@ -810,11 +794,9 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; #endif =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_set_virq_handler: ret =3D set_global_virq_handler(d, op->u.set_virq_handler.virq); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_setvnumainfo: { @@ -842,7 +824,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) copyback =3D 1; break; =20 -#ifdef CONFIG_MGMT_HYPERCALLS case XEN_DOMCTL_assign_device: case XEN_DOMCTL_test_assign_device: case XEN_DOMCTL_deassign_device: @@ -863,7 +844,6 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_d= omctl) ret =3D hypercall_create_continuation( __HYPERVISOR_domctl, "h", u_domctl); break; -#endif /* CONFIG_MGMT_HYPERCALLS */ =20 case XEN_DOMCTL_set_llc_colors: if ( op->u.set_llc_colors.pad ) @@ -884,11 +864,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_= domctl) break; =20 default: -#ifdef CONFIG_MGMT_HYPERCALLS ret =3D arch_do_domctl(op, d, u_domctl); -#else - ret =3D -EOPNOTSUPP; -#endif /* CONFIG_MGMT_HYPERCALLS */ break; } =20 diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c index 02d7b93e80..cbd547f724 100644 --- a/xen/include/hypercall-defs.c +++ b/xen/include/hypercall-defs.c @@ -200,7 +200,9 @@ sysctl(xen_sysctl_t *u_sysctl) #if defined(CONFIG_X86) && defined(CONFIG_PAGING) && defined(CONFIG_MGMT_H= YPERCALLS) paging_domctl_cont(xen_domctl_t *u_domctl) #endif +#ifdef CONFIG_MGMT_HYPERCALLS domctl(xen_domctl_t *u_domctl) +#endif #ifndef CONFIG_PV_SHIM_EXCLUSIVE platform_op(xen_platform_op_t *u_xenpf_op) #endif @@ -279,8 +281,8 @@ hvm_op do do do= do do #endif #ifdef CONFIG_MGMT_HYPERCALLS sysctl do do do do do -#endif domctl do do do do do +#endif #ifdef CONFIG_KEXEC kexec_op compat do - - - #endif diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h index 11d2505420..19dd85150a 100644 --- a/xen/include/xen/domain.h +++ b/xen/include/xen/domain.h @@ -151,8 +151,17 @@ void arch_dump_domain_info(struct domain *d); =20 int arch_vcpu_reset(struct vcpu *v); =20 +#ifdef CONFIG_MGMT_HYPERCALLS bool domctl_lock_acquire(void); void domctl_lock_release(void); +#else +static inline bool domctl_lock_acquire(void) +{ + return false; +} + +static inline void domctl_lock_release(void) {} +#endif /* CONFIG_MGMT_HYPERCALLS */ =20 /* * Continue the current hypercall via func(data) on specified cpu. --=20 2.34.1