[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 08/11] xen/xsm: Wrap around xsm_resource_(un)plug_core


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jiqian Chen <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 25 Jul 2025 14:15:27 +0800
  • 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)
  • 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=F98DbrCPzxPK79XAUFK/eQkwXwDe7WqaiOZQ7Ae3QKA=; b=Qi2S8+YH6BdcA3FIOgW5Yuj6TU4EW6CnABCIcACybvMu90UGdfRQCQD75AuFnDBIm8FybnCFHPru1prpfZE9H9Fa3Cvt+1WUouiINyvC4KzyGEWYG8NyKyw1bsolTwq9H/TX8vG/7LFBCUKCr/gprdiKbbSnSxV3Dmn+3FCPJ1az/6ZgvzvxS515MZVoVMYHGEAe6ysIq9O59vIxkURNgESETS4l2lbJRmZUgdkZIw4tkSkJHL0zTQ9p06r5CmdGo/bLzHHAShNM/Zwkr/AfMPtJKG3/xs4YCj7AF3EpPfbFWfqFIbTR0n2qr/JLWx2mMqQwVu2fZnFSIKEERiALSQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uVLjwwftEnazKV01iaK+b3u3eOM1NbB0omHhnaS+dxgb9zZEnDUWooIeSp8l1zH9zY98ZtP/RScsy5i4rrucRdW1EC3nzK6G+tiv0eYH5e6bUzj0dojgJe6dcTCgbqOGPtL/EfxXkl3qXNxca8pgy9O8DUT5mwZi9z2O3JDN2ZIfl52QCvqvk96qdrWsMG1YcAYimCcr6BHc1xlMhSeoMECN0k2a038q0iz9tNNZ7Ib1iKV8utI9VTpBvWh57omKD2242FHnSyK2nfBV6KTsuyCefAR5w58h330GQxgwllKwsAI6B7wNeGVyKjtmhQOkg9VlkyScqetrruKm43iK2w==
  • Cc: Huang Rui <ray.huang@xxxxxxx>, Jiqian Chen <Jiqian.Chen@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 06:16:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Since xsm_resource_plug_core and xsm_resource_unplug_core are only
used for arch/x86/platform_hypercall.c and arch/sysctl.c, so wrap
around them with CONFIG_SYSCTL and CONFIG_PLATFORM_OP.

Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
---
cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
---
 xen/include/xsm/xsm.h | 8 ++++++++
 xen/xsm/dummy.c       | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h
index bc0a0776c895..546a1aa57e37 100644
--- a/xen/include/xsm/xsm.h
+++ b/xen/include/xsm/xsm.h
@@ -577,12 +577,20 @@ static inline int xsm_resource_unplug_pci(
 
 static inline int xsm_resource_plug_core(xsm_default_t def)
 {
+#if defined(CONFIG_SYSCTL) || defined(CONFIG_PLATFORM_OP)
     return alternative_call(xsm_ops.resource_plug_core);
+#else
+    return -EOPNOTSUPP;
+#endif
 }
 
 static inline int xsm_resource_unplug_core(xsm_default_t def)
 {
+#if defined(CONFIG_SYSCTL) || defined(CONFIG_PLATFORM_OP)
     return alternative_call(xsm_ops.resource_unplug_core);
+#else
+    return -EOPNOTSUPP;
+#endif
 }
 
 static inline int xsm_resource_setup_pci(
diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c
index d9f4d3ee12b1..ab6eb2149376 100644
--- a/xen/xsm/dummy.c
+++ b/xen/xsm/dummy.c
@@ -90,8 +90,10 @@ static const struct xsm_ops __initconst_cf_clobber dummy_ops 
= {
     .deassign_dtdevice             = xsm_deassign_dtdevice,
 #endif
 
+#if defined(CONFIG_SYSCTL) || defined(CONFIG_PLATFORM_OP)
     .resource_plug_core            = xsm_resource_plug_core,
     .resource_unplug_core          = xsm_resource_unplug_core,
+#endif
     .resource_plug_pci             = xsm_resource_plug_pci,
     .resource_unplug_pci           = xsm_resource_unplug_pci,
     .resource_setup_pci            = xsm_resource_setup_pci,
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.