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

[PATCH v5 24/24] xen: decouple PV_SHIM_EXCLUSIVE and MGMT_HYPERCALLS


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Fri, 12 Dec 2025 12:02:09 +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=VeiH6+Z+OiU86ZAPkaW9D/QiTAcCg9U2zSCm9FXdi9c=; b=qjaA8sHQQEWvZyy86FUol40iRgxZem9iIWkDs+hByDnTGAHgkd6dv9Eqa4aeDoR7Z7UHgGHyNH9579zAtZqqnddiK2gsK0rhq/i6496wMLbhBKxxcEK1fbf4g5v7slKCyE1wRm2R+AY/4FwHsnftwZHKYh/nAOtf14SyfVDmSB3296QTCMHBmbV4qlrJS29Ktg2TGeGN0TjebDDY22QXOop2IRtL9eZC1ogFuAxYgxFGIXBkI3Rpd1prPJ7d/cPbUjj/rkwGmXMiEDUKXINioXRJJC8wlTTCbolqv4ZsSQiFQlWtdVfTpyvlpp43pSr9qFayVvNKg9lKMgQM9frd5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cVVKg9/Kw+eVhdLtv02KYsLTdREQg1Ub5VkLEvgEFLpzxTCwhh1a1Z8nZVBwMKEO89kM2WlEyC7+oMvMU0GzBtQnxuk0xpAo0yQ3M58YJ0G/zQEmJjLJQ/VvI+XEkp7WvNsRvZin+5U02boWFX4KMK9ZvUkiNYV5itTFjGo1+rY8LzVLzjsL7tkU8Z36kon8Km075JVafMWARgTMtVJJcP/+h66PRjfOh8YaQkGlDwWyIRWEY1CMsA3H8/UkjrNjoxZvVeMT+fzbLmABiLRywQrAlRxaYpE2K9h5BymEGLd5RA+Kw90jR46gBOFGSf471EHARmkUq/qsxSXMoGnvxA==
  • Cc: <ray.huang@xxxxxxx>, <grygorii_strashko@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Michal Orzel" <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 12 Dec 2025 04:21:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

We try to decouple PV_SHIM_EXCLUSIVE and MGMT_HYPERCALLS, including getting
rid of "depends on !PV_SHIM_EXCLUSIVE" (and related Makefile constructs)
regarding features guarded under MGMT_HYPERCALLS.
There is little possibility that random config may pick MGMT_HYPERCALLS=y
and PV_SHIM_EXCLUSIVE=y, so we need to add !defined(CONFIG_PV_SHIM_EXCLUSIVE)
constriction on paging_domctl() under XEN_DOMCTL_shadow_op-case to avoid
undefined error.

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
v3 -> v4:
- new commit
---
v4 -> v5:
- Remove unrelated changes on CONFIG_HVM
- add !defined(CONFIG_PV_SHIM_EXCLUSIVE) constriction on paging_domctl() under
XEN_DOMCTL_shadow_op-case
- refine title and commit message
---
 xen/arch/x86/Makefile        | 2 +-
 xen/arch/x86/domctl.c        | 2 +-
 xen/common/Kconfig           | 1 -
 xen/common/Makefile          | 4 +---
 xen/include/hypercall-defs.c | 4 ----
 xen/include/xen/domain.h     | 4 ----
 6 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index d389787bb3..03650049ce 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -31,6 +31,7 @@ obj-bin-y += dmi_scan.init.o
 obj-y += domain.o
 obj-bin-y += dom0_build.init.o
 obj-y += domain_page.o
+obj-$(CONFIG_MGMT_HYPERCALLS) += domctl.o
 obj-y += e820.o
 obj-y += emul-i8254.o
 obj-y += extable.o
@@ -80,7 +81,6 @@ obj-$(CONFIG_VM_EVENT) += vm_event.o
 obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
-obj-$(CONFIG_MGMT_HYPERCALLS) += domctl.o
 obj-y += platform_hypercall.o
 obj-$(CONFIG_COMPAT) += x86_64/platform_hypercall.o
 endif
diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c
index 6153e3c07e..235fd3b60f 100644
--- a/xen/arch/x86/domctl.c
+++ b/xen/arch/x86/domctl.c
@@ -216,7 +216,7 @@ long arch_do_domctl(
     {
 
     case XEN_DOMCTL_shadow_op:
-#ifdef CONFIG_PAGING
+#if defined(CONFIG_PAGING) && !defined(CONFIG_PV_SHIM_EXCLUSIVE)
         ret = paging_domctl(d, &domctl->u.shadow_op, u_domctl, 0);
         if ( ret == -ERESTART )
             return hypercall_create_continuation(
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index d59e108652..f57a5f00a3 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -654,7 +654,6 @@ menu "Supported hypercall interfaces"
 
 config MGMT_HYPERCALLS
        bool "Enable privileged hypercalls for system management"
-       depends on !PV_SHIM_EXCLUSIVE
        default y
        help
          Management hypercalls provide the means for dom0 to manage the
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 9f59f141a8..a0b0705f72 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -11,6 +11,7 @@ obj-$(filter-out $(CONFIG_X86),$(CONFIG_ACPI)) += device.o
 obj-$(CONFIG_DEVICE_TREE_PARSE) += device-tree/
 obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
+obj-$(CONFIG_MGMT_HYPERCALLS) += domctl.o
 obj-y += domid.o
 obj-y += event_2l.o
 obj-y += event_channel.o
@@ -70,9 +71,6 @@ obj-bin-$(CONFIG_X86) += $(foreach n,decompress bunzip2 unxz 
unlzma lzo unlzo un
 
 obj-$(CONFIG_COMPAT) += $(addprefix compat/,domain.o memory.o multicall.o 
xlat.o)
 
-ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
-obj-$(CONFIG_MGMT_HYPERCALLS) += domctl.o
-endif
 
 obj-$(CONFIG_COVERAGE) += coverage/
 obj-y += sched/
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index c9ee5de99e..e7209f8b63 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -199,10 +199,8 @@ sysctl(xen_sysctl_t *u_sysctl)
 #if defined(CONFIG_X86) && defined(CONFIG_PAGING) && 
!defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont(xen_domctl_t *u_domctl)
 #endif
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
 domctl(xen_domctl_t *u_domctl)
 #endif
-#endif
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
 platform_op(xen_platform_op_t *u_xenpf_op)
 #endif
@@ -284,10 +282,8 @@ sysctl                             do       do       do    
   do       do
 #if defined(CONFIG_X86) && defined(CONFIG_PAGING) && 
!defined(CONFIG_PV_SHIM_EXCLUSIVE)
 paging_domctl_cont                 do       do       do       do       -
 #endif
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
 domctl                             do       do       do       do       do
 #endif
-#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;
 };
 
-#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
 
 extern bool vmtrace_available;
 
-- 
2.34.1




 


Rackspace

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