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

[PATCH v5 23/24] xen/domctl: wrap common/domctl.c with CONFIG_MGMT_HYPERCALLS


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Penny Zheng <Penny.Zheng@xxxxxxx>
  • Date: Fri, 12 Dec 2025 12:02:08 +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=odExyTV3fsgU5LF6NYJiZ8Pw/V9R8W68o6yrCIsvmNc=; b=waBsqy8Ct1czB8sbu2zV1pV/bxd3D7qYm0BRiVQFqmnbdJWDSMilQXUBdcplaSrhCdU3l9ts8JflBY3G0PeZ7g0cYM34DhctBXFaNG+wqV7/wmAzjFnoPqniodTJqQPtjDbIsoFJ68V2qcFrfe32zgDfwwxhr7/xBpEsCur1YEsPtB0aqunW6kgD2PWQFQr1GS1cvtDpWyrpsJPhZ9AaAh/1Uc5PlLB68tbcKW1xvzfG2+NbV8G4+4VkMezZ+uT53xalNQSqBBvbs6BWYCeNcR82lsNlx+xFNKDfo2EQyfavRNWGGbgZiPa8YWk0/lTOGavnt0WPdFf91rLzfPVN1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AcMTWT6ISmCZi5Ug52edbR8PVxaoQG+2zw9cYTzyHjR8veFPvJy5MpRRVM0iPhdwPfeECrvf0R6eKrYWsvZOEPMtfc7eryWH1gvcJvz5gQKX+KVEn+bsMBuopalbSsRG25QPB/a9WC3G5JD1v35n8n9Xucf/yH9tFTZJePXquHf12RGhCEGqTX6aY3RnjKMXEIO4HJnC801JismKvTwv/ardH1t14o2cZ7On/1AKBIOoEfNx9XQhdaU/cfYgYHM+IcOaW3BUBj8j7GcTcsVF1LFEsBo3TOKbPo26qg6sZAW0XsZ/ORmkzM5unUptJiogzHAsinqEDHncH95Fvz/GtQ==
  • Cc: <ray.huang@xxxxxxx>, <grygorii_strashko@xxxxxxxx>, Penny Zheng <Penny.Zheng@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, "Anthony PERARD" <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 12 Dec 2025 04:21:38 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Wrap domctl hypercall def and domctl.o with CONFIG_MGMT_HYPERCALLS.
Make CONFIG_MGMT_HYPERCALLS optional and expand help message

Signed-off-by: Penny Zheng <Penny.Zheng@xxxxxxx>
---
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"
---
v2 -> v3:
- add pitfall warnning in Kconfig help
---
v3 -> v4:
- refine help message
---
- change to "say Y" to keep consistent
- add back default y
---
 xen/common/Kconfig           | 16 ++++++++++++----
 xen/common/Makefile          |  2 +-
 xen/include/hypercall-defs.c |  6 ++++--
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 64023703ae..d59e108652 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -653,12 +653,20 @@ menu "Supported hypercall interfaces"
        visible if EXPERT
 
 config MGMT_HYPERCALLS
-       def_bool y
+       bool "Enable privileged hypercalls for system management"
        depends on !PV_SHIM_EXCLUSIVE
+       default y
        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.
+         Management hypercalls provide the means for dom0 to manage the
+         overall Xen system and other domains, including sysctl, domctl, etc.
+         In a dom0less or pv-shim build, they can be omitted to cut down
+         on the Xen binary's size. However, this comes at the loss of
+         significant runtime functionality.
+         So be cautious to disable it, as admins will face missing a few basic
+         hypercalls like listdomains, getdomaininfo, etc, hence leading to
+         have an impact on device-passthrough and DM.
+
+         Unless you know what you are doing, say Y.
 
 endmenu
 
diff --git a/xen/common/Makefile b/xen/common/Makefile
index 4353ea59a4..9f59f141a8 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -71,7 +71,7 @@ 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-y += domctl.o
+obj-$(CONFIG_MGMT_HYPERCALLS) += domctl.o
 endif
 
 obj-$(CONFIG_COVERAGE) += coverage/
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index a08e80ed59..c9ee5de99e 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -199,9 +199,11 @@ 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
-#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
 #ifdef CONFIG_HVM
@@ -282,10 +284,10 @@ 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
-#endif
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
 domctl                             do       do       do       do       do
 #endif
+#endif
 #ifdef CONFIG_KEXEC
 kexec_op                           compat   do       -        -        -
 #endif
-- 
2.34.1




 


Rackspace

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