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

Re: [PATCH 16/24] XSM: suppress hypercall when XSM=n


  • To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 5 Aug 2026 18:42:36 -0400
  • Arc-authentication-results: i=1; mx.zohomail.com; dkim=pass header.i=apertussolutions.com; spf=pass smtp.mailfrom=dpsmith@xxxxxxxxxxxxxxxxxxxx; dmarc=pass header.from=<dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1785969756; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=lruKykF7Bez3AHxlAg46tPNe7nOSsS4PSeVZZpQY56U=; b=SUs/P0uuFq+gnC2gKkL2KfEZF9eLXnAQiHvjmv7tVVL4t3B016Sc6QzrT3Q3es5Y3AUeqqU++Mt221etNFzIgf1LXOe0V5wuizGE8/1UeXgx8i4GIVU2+XVECsKEXr3PM4q2weadv0A0uZ6WZ4PnD+3b+Pc8QhtBRz6rzWlWJXM=
  • Arc-seal: i=1; a=rsa-sha256; t=1785969756; cv=none; d=zohomail.com; s=zohoarc; b=OtjRAeOB3W63X7nJO+6k23SAistada/5vTpF/PZIMtgwD0YaABmYuUFYNVKXvyjtj+v4i0gHXlWU7sa7o3/fssc1cGFO0grBBW1JO4csYdGIEwYQgRGmWhxHHVktQ4mbOE8TEvT008gqkc20LumRDKHW2/n4BXRJ1bOKABumwU8=
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=zoho header.d=apertussolutions.com header.i="dpsmith@xxxxxxxxxxxxxxxxxxxx" header.h="Message-ID:Date:MIME-Version:Subject:To:Cc:From:In-Reply-To:Content-Type:Content-Transfer-Encoding"
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Wed, 05 Aug 2026 22:42:50 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 7/28/26 9:20 AM, Jan Beulich wrote:
This can be easily done in hypercall-defs.c, thus avoiding the need to
dive into xsm/ when building Xen, just to add code which does what is done
for an absent hypercall handler anyway (returning -ENOSYS).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/Makefile
+++ b/xen/Makefile
@@ -458,7 +458,7 @@ CFLAGS += -I$(objtree)/arch/$(SRCARCH)/i
  ALL_OBJS-y                := common/built_in.o
  ALL_OBJS-y                += drivers/built_in.o
  ALL_OBJS-y                += lib/built_in.o
-ALL_OBJS-y                += xsm/built_in.o
+ALL_OBJS-$(CONFIG_XSM)    += xsm/built_in.o
  ALL_OBJS-y                += arch/$(SRCARCH)/built_in.o
  ALL_OBJS-$(CONFIG_CRYPTO) += crypto/built_in.o
--- a/xen/include/hypercall-defs.c
+++ b/xen/include/hypercall-defs.c
@@ -119,7 +119,9 @@ prefix: do PREFIX_compat
  xen_version(int cmd, void *arg)
  vcpu_op(int cmd, unsigned int vcpuid, void *arg)
  sched_op(int cmd, void *arg)
+#ifdef CONFIG_XSM
  xsm_op(void *op)
+#endif
  callback_op(int cmd, const void *arg)
  #ifdef CONFIG_ARGO
  argo_op(unsigned int cmd, void *arg1, void *arg2, unsigned long arg3, 
unsigned long arg4)
@@ -264,7 +266,9 @@ set_segment_base                   do:2
  #ifdef CONFIG_PV
  mmuext_op                          compat:2 do:2     compat   do       -
  #endif
+#ifdef CONFIG_XSM
  xsm_op                             compat   do       compat   do       do
+#endif
  nmi_op                             compat   do       -        -        -
  sched_op                           compat   do       compat   do       do
  callback_op                        compat   do       -        -        -
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -437,6 +437,8 @@ static XSM_INLINE int xsm_hypfs_op(XSM_D
  }
  #endif
+#ifdef CONFIG_XSM
+
  static XSM_INLINE long xsm_do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
  {
      return -ENOSYS;
@@ -449,6 +451,8 @@ static XSM_INLINE int xsm_do_compat_op(X
  }
  #endif
+#endif /* CONFIG_XSM */
+
  static XSM_INLINE char *xsm_show_irq_sid(int irq)
  {
      return NULL;
--- a/xen/xsm/Makefile
+++ b/xen/xsm/Makefile
@@ -1,6 +1,6 @@
  obj-y += xsm_core.o
-obj-$(CONFIG_XSM) += xsm_policy.o
-obj-$(CONFIG_XSM) += dummy.o
+obj-y += xsm_policy.o
+obj-y += dummy.o
  obj-$(CONFIG_XSM_SILO) += silo.o
obj-$(CONFIG_XSM_FLASK) += flask/
--- a/xen/xsm/xsm_core.c
+++ b/xen/xsm/xsm_core.c
@@ -18,8 +18,6 @@
  #include <xen/hypercall.h>
  #include <xsm/xsm.h>
-#ifdef CONFIG_XSM
-
  #ifdef CONFIG_MULTIBOOT
  #include <asm/bootinfo.h>
  #include <asm/setup.h>
@@ -216,8 +214,6 @@ bool __init has_xsm_magic(paddr_t start)
  }
  #endif
-#endif
-
  long do_xsm_op(XEN_GUEST_HANDLE_PARAM(void) op)
  {
      return xsm_do_xsm_op(op);


Acked-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxx>



 


Rackspace

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