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

[PATCH 11/11] xen/platform_op: Wrap around platform_op hypercall


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jiqian Chen <Jiqian.Chen@xxxxxxx>
  • Date: Fri, 25 Jul 2025 14:15:30 +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=eNTTQW7KbLsmij49sd7KJEzywhJ6hR4QqGOe3FB6ihI=; b=KJLSloQctqDNQRZFdKJbet9+ro9+MAkOlgIXR+KzHy5huwMnpotfelv7ydVjnIGfKaHyZoS27FVhMonqHrtinalOsZ+mfm6t+6dRh3FIEODzPC5nkHpbtAqwpUN09AMfBhGUhXqQ24sJv88163wWA6tVJrRuhAYbnbsbHXfT1uZsvzN9L6/NSBPINFRalpTt+7VI7JDptyl6bo0Om2mqlUxIAECLNt1MvCVH47N/QujvQI+2cgGn+GZdP8hSYzi/y9J6GDAYoep4L/MZVd66eIyvuqRWoDrHwrXedJ8CQQcbXd/OpUYTCbFdhzocDvlmiBqhr5E4B6GVs/srSk6zKA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HTaBr2iEGvBvnO7LHeBNkUSb7X8MAUcHiWgxPhb+as+HfxN2YOUCqs9M+pKdw2DvGShwlRa8IdCMWpsyFna46p9N5dHesFPWOxPcnL5dqWjtlhWUiA3gEXb/M6tljJOmJTXoDCsI1K0se9c5/BodIkeiebri31rNV0rCxPISFfAu3uC+OK7LogIrjWdCI1vaYSaipQEKAAJt5Ne7g1FtWBNiHlnLDJysFJ+WuJsO16is74Wl+qZpmXqWnYQHKDXuZdgbwpmPt0wlNa9t5to2cMoDrgxQ+FEwbe50RBMQx1FkpQYv1AgkryZWG2zeUpHJq6Le+OGf75EMmotq9JPGpA==
  • Cc: Huang Rui <ray.huang@xxxxxxx>, Jiqian Chen <Jiqian.Chen@xxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, "Bertrand Marquis" <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 25 Jul 2025 06:20:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Wrap platform_op hypercall definition and platform_hypercall.o of arm and
x86 with CONFIG_PLATFORM_OP, and since PV_SHIM_EXCLUSIVE needs sorting in
the future, move them out of PV_SHIM_EXCLUSIVE condition at the same time.

And need to make PLATFORM_OP with help info. It shall at least provide
"# CONFIG_PLATFORM_OP is not set" in preset configs for PV shim on x86.
With that, all dependent option get covered and could be deleted.

Signed-off-by: Jiqian Chen <Jiqian.Chen@xxxxxxx>
---
cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
cc: Julien Grall <julien@xxxxxxx>
cc: Bertrand Marquis <bertrand.marquis@xxxxxxx>
cc: Michal Orzel <michal.orzel@xxxxxxx>
cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
cc: Jan Beulich <jbeulich@xxxxxxxx>
cc: "Roger Pau Monné" <roger.pau@xxxxxxxxxx>
---
 xen/arch/arm/Makefile                 | 2 +-
 xen/arch/x86/Makefile                 | 2 ++
 xen/arch/x86/configs/pvshim_defconfig | 1 +
 xen/common/Kconfig                    | 3 +++
 xen/include/hypercall-defs.c          | 6 ++++--
 5 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/xen/arch/arm/Makefile b/xen/arch/arm/Makefile
index f833cdf2078b..4f9290fe6345 100644
--- a/xen/arch/arm/Makefile
+++ b/xen/arch/arm/Makefile
@@ -42,7 +42,7 @@ obj-$(CONFIG_VM_EVENT) += mem_access.o
 obj-y += mm.o
 obj-$(CONFIG_VM_EVENT) += monitor.o
 obj-y += p2m.o
-obj-y += platform.o
+obj-$(CONFIG_PLATFORM_OP) += platform.o
 obj-y += platform_hypercall.o
 obj-y += physdev.o
 obj-y += processor.o
diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile
index 5aab30a0c4a4..e180ab1a0409 100644
--- a/xen/arch/x86/Makefile
+++ b/xen/arch/x86/Makefile
@@ -80,6 +80,8 @@ obj-y += xstate.o
 
 ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
 obj-y += domctl.o
+endif
+ifeq ($(CONFIG_PLATFORM_OP),y)
 obj-y += platform_hypercall.o
 obj-$(CONFIG_COMPAT) += x86_64/platform_hypercall.o
 endif
diff --git a/xen/arch/x86/configs/pvshim_defconfig 
b/xen/arch/x86/configs/pvshim_defconfig
index c58c29adb0bf..e9ede13250d8 100644
--- a/xen/arch/x86/configs/pvshim_defconfig
+++ b/xen/arch/x86/configs/pvshim_defconfig
@@ -25,3 +25,4 @@ CONFIG_EXPERT=y
 # CONFIG_DEBUG is not set
 # CONFIG_GDBSX is not set
 # CONFIG_SYSCTL is not set
+# CONFIG_PLATFORM_OP is not set
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 1a8f5ec93364..13b544cbb1d5 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -630,6 +630,9 @@ config SYSCTL
 config PLATFORM_OP
        bool "Enable Platform Operation hypercall"
        default y
+       help
+         This option shall only be disabled on some dom0less systems, or
+         PV shim on x86, to reduce Xen footprint.
 
 endmenu
 
diff --git a/xen/include/hypercall-defs.c b/xen/include/hypercall-defs.c
index c1081d87a252..96ad6efacd5a 100644
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -150,7 +150,7 @@ update_va_mapping(unsigned int va, uint32_t lo, uint32_t 
hi, unsigned int flags)
 physdev_op_compat(physdev_op_compat_t *uop)
 update_va_mapping_otherdomain(unsigned int va, uint32_t lo, uint32_t hi, 
unsigned int flags, domid_t domid)
 #endif
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#ifdef CONFIG_PLATFORM_OP
 platform_op(compat_platform_op_t *u_xenpf_op)
 #endif
 #ifdef CONFIG_KEXEC
@@ -200,6 +200,8 @@ sysctl(xen_sysctl_t *u_sysctl)
 #ifndef CONFIG_PV_SHIM_EXCLUSIVE
 domctl(xen_domctl_t *u_domctl)
 paging_domctl_cont(xen_domctl_t *u_domctl)
+#endif
+#ifdef CONFIG_PLATFORM_OP
 platform_op(xen_platform_op_t *u_xenpf_op)
 #endif
 #ifdef CONFIG_HVM
@@ -236,7 +238,7 @@ stack_switch                       do:2     do:2     -      
  -        -
 set_callbacks                      compat   do       -        -        -
 fpu_taskswitch                     do       do       -        -        -
 sched_op_compat                    do       do       -        -        dep
-#ifndef CONFIG_PV_SHIM_EXCLUSIVE
+#ifdef CONFIG_PLATFORM_OP
 platform_op                        compat   do       compat   do       do
 #endif
 set_debugreg                       do       do       -        -        -
-- 
2.34.1




 


Rackspace

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