All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Propose an minimal xen-tools
@ 2025-05-14  7:12 Sookyung Ahn
  2025-05-14  7:12 ` [RFC PATCH 1/2] changes for minimal-xen-tools Sookyung Ahn
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Sookyung Ahn @ 2025-05-14  7:12 UTC (permalink / raw)
  To: xen-devel
  Cc: matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim, Sookyung Ahn

I am writing to propose an enhancement to the `xen-tools` for users who require only a minimal subset of its functionality, particularly in safety-critical domains like aerospace.

I believe that the addition of a new build-time option, `ENABLE_MINIMAL_XEN_TOOLS`, will significantly benefit users by allowing them to build only the essential components needed for their specific applications. 
This approach not only streamlines the toolset but also reduces the potential for unnecessary complexity in safety-critical environments.
This proposal is based on `dom0less` environment.

The proposed implementation includes:
- Introducing the `ENABLE_MINIMAL_XEN_TOOLS` configuration flag.
- Modifying the build process to selectively include only the necessary components based on the configuration.

This implementation can be effectively applied to the following use cases. 
- Minimal APIs for `dom0less` operation. This involves taking existing Xen functions and shrinking them to minimal needed parts. For example, we can use static device tree instead of XenStore. 
- By retaining `libxencall` and minimum part of `libxencrtl`, the Hypercall interface can be utilized, enabling support for the Xen ARINC653 Multiple Module Schedules service. 
- Addition of ARINC653 Part1&2 APIs and services (hosted on the domain OS.)

I would appreciate any feedback or suggestions you may have regarding this enhancement. 
Additionally, I would like to emphasize the importance of community input in refining this proposal to ensure it meets the needs of all users.

Sookyung Ahn (2):
  changes for minimal-xen-tools
  add document minimal_xen_tools.pandoc

 config/Tools.mk.in                    |   1 +
 docs/designs/minimal_xen_tools.pandoc | 147 ++++++++++++++++++++++++++
 tools/Makefile                        |  19 ++++
 tools/Rules.mk                        |   9 +-
 tools/configure.ac                    |  47 +++-----
 tools/flask/Makefile                  |   4 +
 tools/hotplug/Linux/Makefile          |   6 ++
 tools/hotplug/Linux/systemd/Makefile  |   6 ++
 tools/libs/Makefile                   |   9 ++
 tools/libs/ctrl/Makefile.common       |  92 +++++++++-------
 tools/libs/ctrl/xc_private.c          |   6 ++
 tools/libs/ctrl/xc_private.h          |   7 +-
 tools/libs/uselibs.mk                 |  76 +++++++------
 13 files changed, 325 insertions(+), 104 deletions(-)
 create mode 100644 docs/designs/minimal_xen_tools.pandoc

-- 
2.34.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC PATCH 1/2] changes for minimal-xen-tools
  2025-05-14  7:12 [RFC PATCH 0/2] Propose an minimal xen-tools Sookyung Ahn
@ 2025-05-14  7:12 ` Sookyung Ahn
  2025-05-14  7:12 ` [RFC PATCH 2/2] add document minimal_xen_tools.pandoc Sookyung Ahn
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Sookyung Ahn @ 2025-05-14  7:12 UTC (permalink / raw)
  To: xen-devel
  Cc: matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim, Sookyung Ahn

---
 config/Tools.mk.in                   |  1 +
 tools/Makefile                       | 19 ++++++
 tools/Rules.mk                       |  9 ++-
 tools/configure.ac                   | 47 +++++---------
 tools/flask/Makefile                 |  4 ++
 tools/hotplug/Linux/Makefile         |  6 ++
 tools/hotplug/Linux/systemd/Makefile |  6 ++
 tools/libs/Makefile                  |  9 +++
 tools/libs/ctrl/Makefile.common      | 92 ++++++++++++++++------------
 tools/libs/ctrl/xc_private.c         |  6 ++
 tools/libs/ctrl/xc_private.h         |  7 ++-
 tools/libs/uselibs.mk                | 76 +++++++++++++----------
 12 files changed, 178 insertions(+), 104 deletions(-)

diff --git a/config/Tools.mk.in b/config/Tools.mk.in
index 37c071961e..3880d7ada2 100644
--- a/config/Tools.mk.in
+++ b/config/Tools.mk.in
@@ -55,6 +55,7 @@ CONFIG_SYSTEMD      := @systemd@
 XEN_SYSTEMD_DIR     := @SYSTEMD_DIR@
 XEN_SYSTEMD_MODULES_LOAD := @SYSTEMD_MODULES_LOAD@
 CONFIG_9PFS         := @ninepfs@
+CONFIG_MINIMAL_TOOLS  := @minimal_xen_tools@
 
 LINUX_BACKEND_MODULES := @LINUX_BACKEND_MODULES@
 
diff --git a/tools/Makefile b/tools/Makefile
index 7d17211782..b4af073305 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -41,6 +41,24 @@ SUBDIRS-y += python
 SUBDIRS-$(CONFIG_PYGRUB) += pygrub
 SUBDIRS-$(OCAML_TOOLS) += ocaml
 
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+SUBDIRS-y :=
+SUBDIRS-y += libs
+SUBDIRS-y += flask
+SUBDIRS-y += hotplug
+SUBDIRS-$(CONFIG_X86) += firmware
+SUBDIRS-$(CONFIG_LIBFSIMAGE) += libfsimage
+
+# do not recurse in to a dir we are about to delete
+ifneq "$(MAKECMDGOALS)" "distclean"
+SUBDIRS-$(CONFIG_QEMU_TRAD) += qemu-xen-traditional-dir
+SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir
+endif
+#SUBDIRS-y += python
+SUBDIRS-$(CONFIG_PYGRUB) += pygrub
+SUBDIRS-$(OCAML_TOOLS) += ocaml
+endif
+
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := libs
 endif
@@ -55,6 +73,7 @@ endif
 
 .PHONY: build all
 build all: subdirs-all
+	echo "$(SUBDIRS-y)"
 
 .PHONY: install
 install:
diff --git a/tools/Rules.mk b/tools/Rules.mk
index cb3fd82c1f..fd4146fc7e 100644
--- a/tools/Rules.mk
+++ b/tools/Rules.mk
@@ -22,8 +22,11 @@ include $(XEN_ROOT)/tools/libs/uselibs.mk
 
 CFLAGS_xeninclude = -I$(XEN_INCLUDE)
 
-XENSTORE_XENSTORED ?= y
-
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+	XENSTORE_XENSTORED ?= n
+else
+	XENSTORE_XENSTORED ?= y
+endif
 # A debug build of tools?
 debug ?= n
 debug_symbols ?= $(debug)
@@ -139,7 +142,9 @@ ifeq ($(CONFIG_Linux),y)
 xenlibs-ldlibs-store := -ldl
 endif
 
+ifeq ($(CONFIG_MINIMAL_TOOLS),n)
 CFLAGS_libxenlight += $(CFLAGS_libxenctrl)
+endif
 
 # Don't add -Werror if we are used by qemu-trad build system.
 ifndef BUILDING_QEMU_TRAD
diff --git a/tools/configure.ac b/tools/configure.ac
index 0dd6d747ab..a063bd4759 100644
--- a/tools/configure.ac
+++ b/tools/configure.ac
@@ -3,8 +3,8 @@
 
 AC_PREREQ([2.67])
 AC_INIT([Xen Hypervisor Tools], m4_esyscmd([../version.sh ../xen/Makefile]),
-    [xen-devel@lists.xen.org], [xen], [https://www.xen.org/])
-AC_CONFIG_SRCDIR([libs/light/libxl.c])
+	[xen-devel@lists.xen.org], [xen], [https://www.xen.org/])
+AC_CONFIG_SRCDIR([libs/call/core.c])
 AC_CONFIG_FILES([
 ../config/Tools.mk
 hotplug/common/hotplugpath.sh
@@ -32,7 +32,7 @@ AC_CONFIG_AUX_DIR([../])
 # Check if CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is set and print a warning
 
 AS_IF([test -n "$CC$CFLAGS$LDFLAGS$LIBS$CPPFLAGS$CPP"], [
-    AC_MSG_WARN(
+	AC_MSG_WARN(
 [Setting CC, CFLAGS, LDFLAGS, LIBS, CPPFLAGS or CPP is not \
 recommended, use PREPEND_INCLUDES, PREPEND_LIB, \
 APPEND_INCLUDES and APPEND_LIB instead when possible.])
@@ -90,36 +90,21 @@ AX_ARG_DEFAULT_DISABLE([ovmf], [Enable OVMF])
 AX_ARG_DEFAULT_ENABLE([seabios], [Disable SeaBIOS])
 AX_ARG_DEFAULT_ENABLE([golang], [Disable Go tools])
 AX_ARG_DEFAULT_ENABLE([pygrub], [Disable pygrub])
+AX_ARG_DEFAULT_DISABLE([minimal_xen_tools], [Enable Minimal Xen Tools])
+
+AS_IF([test "x$enable_minimal_xen_tools" = "xyes"],
+	[AC_DEFINE([ENABLE_MINIMAL_XEN_TOOLS], [1], [Enable Light Xen Tools])])
 
 AC_ARG_WITH([linux-backend-modules],
-    AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"],
-    [List of Linux backend module or modalias names to be autoloaded on startup.]),
-    [LINUX_BACKEND_MODULES="$withval"],
-    [case "$host_os" in
-*linux*)
-LINUX_BACKEND_MODULES="
-xen-evtchn
-xen-gntdev
-xen-gntalloc
-xen-blkback
-xen-netback
-xen-pciback
-evtchn
-gntdev
-netbk
-blkbk
-xen-scsibk
-usbbk
-pciback
-xen-acpi-processor
-"
-;;
-*)
-LINUX_BACKEND_MODULES=
-;;
-esac])
-LINUX_BACKEND_MODULES="`eval echo $LINUX_BACKEND_MODULES`"
-AC_SUBST(LINUX_BACKEND_MODULES)
+	AS_HELP_STRING([--with-linux-backend-modules="mod1 mod2"], 
+		[List of Linux backend module or modalias names to be autoloaded on startup.]),
+		[LINUX_BACKEND_MODULES="$withval"],
+		AS_IF([test "x$enable_minimal_xen_tools" = "xyes"], [LINUX_BACKEND_MODULES=],
+			[test "x$host_os"="xlinux"],
+				[LINUX_BACKEND_MODULES="xen-evtchn xen-gntdev xen-gntalloc xen-blkback xen-netback xen-pciback evtchn gntdev netbk blkbk xen-scsibk usbbk pciback xen-acpi-processor"],
+				[LINUX_BACKEND_MODULES=])
+)
+AC_SUBST([LINUX_BACKEND_MODULES])
 
 AC_ARG_ENABLE([qemu-traditional],
     AS_HELP_STRING([--enable-qemu-traditional],
diff --git a/tools/flask/Makefile b/tools/flask/Makefile
index 335ee2a090..07dc4ec587 100644
--- a/tools/flask/Makefile
+++ b/tools/flask/Makefile
@@ -1,7 +1,11 @@
 XEN_ROOT = $(CURDIR)/../..
 include $(XEN_ROOT)/tools/Rules.mk
 
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+SUBDIRS-y :=
+else
 SUBDIRS-y := utils
+endif
 SUBDIRS-$(FLASK_POLICY) += policy
 
 .PHONY: all clean install distclean uninstall
diff --git a/tools/hotplug/Linux/Makefile b/tools/hotplug/Linux/Makefile
index 9a7b3a3515..9b6d7bbed1 100644
--- a/tools/hotplug/Linux/Makefile
+++ b/tools/hotplug/Linux/Makefile
@@ -18,7 +18,9 @@ XEN_SCRIPTS += block-drbd-probe
 XEN_SCRIPTS += block-dummy
 XEN_SCRIPTS += $(XEN_SCRIPTS-y)
 XEN_SCRIPTS += colo-proxy-setup
+ifeq ($(CONFIG_MINIMAL_TOOLS),n)
 XEN_SCRIPTS += launch-xenstore
+endif
 
 SUBDIRS-$(CONFIG_SYSTEMD) += systemd
 
@@ -47,11 +49,15 @@ install-initd:
 	$(INSTALL_PROG) init.d/xendomains $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) init.d/xencommons $(DESTDIR)$(INITD_DIR)
 	$(INSTALL_PROG) init.d/xendriverdomain $(DESTDIR)$(INITD_DIR)
+ifeq ($(CONFIG_MINIMAL_TOOLS),n)
 	$(INSTALL_PROG) init.d/xen-watchdog $(DESTDIR)$(INITD_DIR)
+endif
 
 .PHONY: uninstall-initd
 uninstall-initd:
+ifeq ($(CONFIG_MINIMAL_TOOLS),n)
 	rm -f $(DESTDIR)$(INITD_DIR)/xen-watchdog
+endif
 	rm -f $(DESTDIR)$(INITD_DIR)/xendriverdomain
 	rm -f $(DESTDIR)$(INITD_DIR)/xencommons
 	rm -f $(DESTDIR)$(INITD_DIR)/xendomains
diff --git a/tools/hotplug/Linux/systemd/Makefile b/tools/hotplug/Linux/systemd/Makefile
index e29889156d..4a35fcaa0e 100644
--- a/tools/hotplug/Linux/systemd/Makefile
+++ b/tools/hotplug/Linux/systemd/Makefile
@@ -5,6 +5,7 @@ XEN_SYSTEMD_MODULES := xen.conf
 
 XEN_SYSTEMD_MOUNT := proc-xen.mount
 
+ifeq ($(CONFIG_MINIMAL_TOOLS),n)
 XEN_SYSTEMD_SERVICE := xenstored.service
 XEN_SYSTEMD_SERVICE += xenconsoled.service
 XEN_SYSTEMD_SERVICE += xen-qemu-dom0-disk-backend.service
@@ -12,6 +13,11 @@ XEN_SYSTEMD_SERVICE += xendomains.service
 XEN_SYSTEMD_SERVICE += xen-watchdog.service
 XEN_SYSTEMD_SERVICE += xen-init-dom0.service
 XEN_SYSTEMD_SERVICE += xendriverdomain.service
+else
+XEN_SYSTEMD_SERVICE := xen-init-dom0.service
+XEN_SYSTEMD_SERVICE += xendomains.service
+#XEN_SYSTEMD_SERVICE += xendriverdomain.service
+endif
 
 ALL_XEN_SYSTEMD :=	$(XEN_SYSTEMD_MODULES)  \
 			$(XEN_SYSTEMD_MOUNT)	\
diff --git a/tools/libs/Makefile b/tools/libs/Makefile
index 1afcd12e2b..21dd501b4c 100644
--- a/tools/libs/Makefile
+++ b/tools/libs/Makefile
@@ -18,6 +18,15 @@ SUBDIRS-$(CONFIG_Linux) += vchan
 SUBDIRS-y += light
 SUBDIRS-y += util
 
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+SUBDIRS-y :=
+SUBDIRS-y += toolcore
+SUBDIRS-y += toollog
+SUBDIRS-y += call
+SUBDIRS-y += foreignmemory
+SUBDIRS-y += ctrl
+endif
+
 ifeq ($(CONFIG_RUMP),y)
 SUBDIRS-y := toolcore
 endif
diff --git a/tools/libs/ctrl/Makefile.common b/tools/libs/ctrl/Makefile.common
index 247afbe5f9..cee4f6d2f7 100644
--- a/tools/libs/ctrl/Makefile.common
+++ b/tools/libs/ctrl/Makefile.common
@@ -1,41 +1,57 @@
-OBJS-y       += xc_altp2m.o
-OBJS-y       += xc_cpupool.o
-OBJS-y       += xc_domain.o
-OBJS-y       += xc_evtchn.o
-OBJS-y       += xc_gnttab.o
-OBJS-y       += xc_misc.o
-OBJS-y       += xc_flask.o
-OBJS-y       += xc_physdev.o
-OBJS-y       += xc_private.o
-OBJS-y       += xc_csched.o
-OBJS-y       += xc_csched2.o
-OBJS-y       += xc_arinc653.o
-OBJS-y       += xc_rt.o
-OBJS-y       += xc_tbuf.o
-OBJS-y       += xc_pm.o
-OBJS-y       += xc_cpu_hotplug.o
-OBJS-y       += xc_vm_event.o
-OBJS-y       += xc_vmtrace.o
-OBJS-y       += xc_monitor.o
-OBJS-y       += xc_mem_paging.o
-OBJS-y       += xc_mem_access.o
-OBJS-y       += xc_memshr.o
-OBJS-y       += xc_hcall_buf.o
-OBJS-y       += xc_foreign_memory.o
-OBJS-y       += xc_kexec.o
-OBJS-y       += xc_resource.o
-OBJS-$(CONFIG_ARM)  += xc_dt_overlay.o
-OBJS-$(CONFIG_X86) += xc_psr.o
-OBJS-$(CONFIG_X86) += xc_pagetab.o
-OBJS-$(CONFIG_Linux) += xc_linux.o
-OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
-OBJS-$(CONFIG_SunOS) += xc_solaris.o
-OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
-OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
-OBJS-$(CONFIG_MiniOS) += xc_minios.o
-OBJS-y       += xc_evtchn_compat.o
-OBJS-y       += xc_gnttab_compat.o
-OBJS-y       += xc_devicemodel_compat.o
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+    OBJS-y       += xc_domain.o
+    OBJS-y       += xc_misc.o
+    OBJS-y       += xc_private.o
+    OBJS-y       += xc_csched2.o
+    OBJS-y       += xc_arinc653.o
+    OBJS-y       += xc_hcall_buf.o
+    OBJS-y       += xc_foreign_memory.o
+    OBJS-$(CONFIG_Linux) += xc_linux.o
+    OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
+    OBJS-$(CONFIG_SunOS) += xc_solaris.o
+    OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
+    OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
+    OBJS-$(CONFIG_MiniOS) += xc_minios.o
+else
+    OBJS-y       += xc_altp2m.o
+    OBJS-y       += xc_cpupool.o
+    OBJS-y       += xc_domain.o
+    OBJS-y       += xc_evtchn.o
+    OBJS-y       += xc_gnttab.o
+    OBJS-y       += xc_misc.o
+    OBJS-y       += xc_flask.o
+    OBJS-y       += xc_physdev.o
+    OBJS-y       += xc_private.o
+    OBJS-y       += xc_csched.o
+    OBJS-y       += xc_csched2.o
+    OBJS-y       += xc_arinc653.o
+    OBJS-y       += xc_rt.o
+    OBJS-y       += xc_tbuf.o
+    OBJS-y       += xc_pm.o
+    OBJS-y       += xc_cpu_hotplug.o
+    OBJS-y       += xc_vm_event.o
+    OBJS-y       += xc_vmtrace.o
+    OBJS-y       += xc_monitor.o
+    OBJS-y       += xc_mem_paging.o
+    OBJS-y       += xc_mem_access.o
+    OBJS-y       += xc_memshr.o
+    OBJS-y       += xc_hcall_buf.o
+    OBJS-y       += xc_foreign_memory.o
+    OBJS-y       += xc_kexec.o
+    OBJS-y       += xc_resource.o
+    OBJS-$(CONFIG_ARM)  += xc_dt_overlay.o
+    OBJS-$(CONFIG_X86) += xc_psr.o
+    OBJS-$(CONFIG_X86) += xc_pagetab.o
+    OBJS-$(CONFIG_Linux) += xc_linux.o
+    OBJS-$(CONFIG_FreeBSD) += xc_freebsd.o
+    OBJS-$(CONFIG_SunOS) += xc_solaris.o
+    OBJS-$(CONFIG_NetBSD) += xc_netbsd.o
+    OBJS-$(CONFIG_NetBSDRump) += xc_netbsd.o
+    OBJS-$(CONFIG_MiniOS) += xc_minios.o
+    OBJS-y       += xc_evtchn_compat.o
+    OBJS-y       += xc_gnttab_compat.o
+    OBJS-y       += xc_devicemodel_compat.o
+endif
 
 CFLAGS   += -D__XEN_TOOLS__
 CFLAGS	+= $(PTHREAD_CFLAGS)
diff --git a/tools/libs/ctrl/xc_private.c b/tools/libs/ctrl/xc_private.c
index abd0b0d849..4cd893a4fd 100644
--- a/tools/libs/ctrl/xc_private.c
+++ b/tools/libs/ctrl/xc_private.c
@@ -65,9 +65,11 @@ struct xc_interface_core *xc_interface_open(xentoollog_logger *logger,
     if ( xch->fmem == NULL )
         goto err;
 
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
     xch->dmod = xendevicemodel_open(xch->error_handler, 0);
     if ( xch->dmod == NULL )
         goto err;
+#endif
 
     return xch;
 
@@ -92,8 +94,10 @@ int xc_interface_close(xc_interface *xch)
     rc = xenforeignmemory_close(xch->fmem);
     if (rc) PERROR("Could not close foreign memory interface");
 
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
     rc = xendevicemodel_close(xch->dmod);
     if (rc) PERROR("Could not close device model interface");
+#endif
 
     xtl_logger_destroy(xch->dombuild_logger_tofree);
     xtl_logger_destroy(xch->error_handler_tofree);
@@ -107,6 +111,7 @@ xencall_handle *xc_interface_xcall_handle(xc_interface *xch)
     return xch->xcall;
 }
 
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
 struct xenforeignmemory_handle *xc_interface_fmem_handle(xc_interface *xch)
 {
     return xch->fmem;
@@ -116,6 +121,7 @@ struct xendevicemodel_handle *xc_interface_dmod_handle(xc_interface *xch)
 {
     return xch->dmod;
 }
+#endif
 
 static pthread_key_t errbuf_pkey;
 static pthread_once_t errbuf_pkey_once = PTHREAD_ONCE_INIT;
diff --git a/tools/libs/ctrl/xc_private.h b/tools/libs/ctrl/xc_private.h
index d8b7da2805..18dffdf6fd 100644
--- a/tools/libs/ctrl/xc_private.h
+++ b/tools/libs/ctrl/xc_private.h
@@ -36,7 +36,9 @@
 
 #include <xencall.h>
 #include <xenforeignmemory.h>
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
 #include <xendevicemodel.h>
+#endif
 
 #include <xen/sys/privcmd.h>
 
@@ -91,9 +93,10 @@ struct xc_interface_core {
 
     /* Foreign mappings */
     xenforeignmemory_handle *fmem;
-
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
     /* Device model */
     xendevicemodel_handle *dmod;
+#endif
 };
 
 void *osdep_alloc_hypercall_buffer(xc_interface *xch, int npages);
@@ -400,6 +403,7 @@ int xc_ffs64(uint64_t x);
 #define DOMPRINTF(fmt, args...) xc_dom_printf(dom->xch, fmt, ## args)
 #define DOMPRINTF_CALLED(xch) xc_dom_printf((xch), "%s: called", __FUNCTION__)
 
+#if (ENABLE_MINIMAL_XEN_TOOLS != 1)
 /**
  * vm_event operations. Internal use only.
  */
@@ -411,6 +415,7 @@ int xc_vm_event_control(xc_interface *xch, uint32_t domain_id, unsigned int op,
  */
 void *xc_vm_event_enable(xc_interface *xch, uint32_t domain_id, int param,
                          uint32_t *port);
+#endif
 
 int do_dm_op(xc_interface *xch, uint32_t domid, unsigned int nr_bufs, ...);
 
diff --git a/tools/libs/uselibs.mk b/tools/libs/uselibs.mk
index efd7a475ba..c0ce4ef210 100644
--- a/tools/libs/uselibs.mk
+++ b/tools/libs/uselibs.mk
@@ -1,33 +1,45 @@
 # Libraries below tools/libs/ and their dependencies
-
-LIBS_LIBS += toolcore
-USELIBS_toolcore :=
-LIBS_LIBS += toollog
-USELIBS_toollog :=
-LIBS_LIBS += evtchn
-USELIBS_evtchn := toollog toolcore
-LIBS_LIBS += gnttab
-USELIBS_gnttab := toollog toolcore
-LIBS_LIBS += call
-USELIBS_call := toollog toolcore
-LIBS_LIBS += foreignmemory
-USELIBS_foreignmemory := toollog toolcore
-LIBS_LIBS += devicemodel
-USELIBS_devicemodel := toollog toolcore call
-LIBS_LIBS += hypfs
-USELIBS_hypfs := toollog toolcore call
-LIBS_LIBS += ctrl
-USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel
-LIBS_LIBS += guest
-USELIBS_guest := evtchn ctrl
-LIBS_LIBS += store
-USELIBS_store := toolcore
-LIBS_LIBS += vchan
-USELIBS_vchan := toollog store gnttab evtchn
-LIBS_LIBS += stat
-USELIBS_stat := ctrl store
-LIBS_LIBS += light
-USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest
-LIBS_LIBS += util
-USELIBS_util := light
-FILENAME_util := xlutil
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+    LIBS_LIBS += toolcore
+    USELIBS_toolcore := 
+    LIBS_LIBS += toollog
+    USELIBS_toollog :=
+    LIBS_LIBS += call
+    USELIBS_call := toollog toolcore
+    LIBS_LIBS += foreignmemory
+    USELIBS_foreignmemory := toollog toolcore
+    LIBS_LIBS += ctrl
+    USELIBS_ctrl := toollog call foreignmemory
+else
+    LIBS_LIBS += toolcore
+    USELIBS_toolcore :=
+    LIBS_LIBS += toollog
+    USELIBS_toollog :=
+    LIBS_LIBS += evtchn
+    USELIBS_evtchn := toollog toolcore
+    LIBS_LIBS += gnttab
+    USELIBS_gnttab := toollog toolcore
+    LIBS_LIBS += call
+    USELIBS_call := toollog toolcore
+    LIBS_LIBS += foreignmemory
+    USELIBS_foreignmemory := toollog toolcore
+    LIBS_LIBS += devicemodel
+    USELIBS_devicemodel := toollog toolcore call
+    LIBS_LIBS += hypfs
+    USELIBS_hypfs := toollog toolcore call
+    LIBS_LIBS += ctrl
+    USELIBS_ctrl := toollog call evtchn gnttab foreignmemory devicemodel
+    LIBS_LIBS += guest
+    USELIBS_guest := evtchn ctrl
+    LIBS_LIBS += store
+    USELIBS_store := toolcore
+    LIBS_LIBS += vchan
+    USELIBS_vchan := toollog store gnttab evtchn
+    LIBS_LIBS += stat
+    USELIBS_stat := ctrl store
+    LIBS_LIBS += light
+    USELIBS_light := toollog evtchn toolcore ctrl store hypfs guest
+    LIBS_LIBS += util
+    USELIBS_util := light
+    FILENAME_util := xlutil
+endif
\ No newline at end of file
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [RFC PATCH 2/2] add document minimal_xen_tools.pandoc
  2025-05-14  7:12 [RFC PATCH 0/2] Propose an minimal xen-tools Sookyung Ahn
  2025-05-14  7:12 ` [RFC PATCH 1/2] changes for minimal-xen-tools Sookyung Ahn
@ 2025-05-14  7:12 ` Sookyung Ahn
  2025-05-14  7:28   ` Jan Beulich
  2025-05-14  7:24 ` [RFC PATCH 0/2] Propose an minimal xen-tools Jan Beulich
  2025-05-21 14:26 ` Anthony PERARD
  3 siblings, 1 reply; 7+ messages in thread
From: Sookyung Ahn @ 2025-05-14  7:12 UTC (permalink / raw)
  To: xen-devel
  Cc: matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim, Sookyung Ahn

---
 docs/designs/minimal_xen_tools.pandoc | 147 ++++++++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 docs/designs/minimal_xen_tools.pandoc

diff --git a/docs/designs/minimal_xen_tools.pandoc b/docs/designs/minimal_xen_tools.pandoc
new file mode 100644
index 0000000000..32e0e8d002
--- /dev/null
+++ b/docs/designs/minimal_xen_tools.pandoc
@@ -0,0 +1,147 @@
+- [Minimal Xen-tools](#minimal-xen-tools)
+  - [`xen-tools` : full vs minimal](#xen-tools--full-vs-minimal)
+  - [Components of minimal `xen-tools`](#components-of-minimal-xen-tools)
+  - [How to enable minimal `xen-tools`](#how-to-enable-minimal-xen-tools)
+  - [How to include a component which is excluded](#how-to-include-a-component-which-is-excluded)
+    - [Library](#library)
+    - [Tool](#tool)
+
+# Minimal Xen-tools
+
+Purpose : To enhance `xen-tools` for users who require only a minimal subset of its functionality, particularly in safety-critical domains such as aerospace. 
+
+## `xen-tools` : full vs minimal
+
+- total size of **full** `xen-tools` and **minimal** `xen-tools`
+
+|      | full         | minimal        |
+|------| ------------ | ------------ |
+|ipks  | 8.1M (8216K) | **1.3M** (1276K) |
+|image | 26M (25944K) | **4.6M** (4664)K |
+
+## Components of minimal `xen-tools`
+
+| `xen-tools-`        | included | Rationale                                                    | remark  |
+|---------------------| -------- | ------------------------------------------------------------ | ------- |
+| libxencall          | yes      | library to provide hypercall interface                       |         |
+| libxenctrl          | yes      | library to provide interface for the ARINC 653 scheduler     | partially included |
+| libxendevicemodel   | no       | library to support device model. Not needed                  |         |
+| libxenevtchn        | no       | library to support event channel. Not needed with static event channel | |
+| libxenforeignmemory | yes      | library to support  memory management for hypercall buffer                       |         |
+| libxengnttab        | no       | library to support grant table. We are plainning to use static shared memory instaed of grant table to avoid dynamic memory allocation. | |
+| libxenguest         | no       | library to support control and manage the domUs. Not required with dom0less | |
+| libxenhypfs         | no       | library to provide interface for hypervisor fs. We don't access hypervisor fs. | |
+| libxenlight         | no       | library to support `xl`. We don't use `xl` at all            | |
+| libxenstat          | no       | library to monitor statistic data of domUs with `xentop`. We don't use it | |
+| libxenstore         | no       | library to access `XenStore`. We don't use `XenStore`. | |
+| libxenutil          | no       | library to provide common utilities. | |
+| libxenvchan         | no       | library to provide interface for vchan(vitual channel). We don't use vchan | |
+| libxentoolcore      | yes      | managing libraries' handlers                                 |         |
+| libxentoollog       | yes      | library to provide logging interface                         | can be removed |
+| 9pfsd               | no       | network file system protocol.                                | had dependency on `XenStore` |
+| consold             | no       | `ctrl-a` ×3 replaces it                                        |         |
+| dev                 | yes      | header files                                                 |         |
+| flask               | yes      | Xen security policy framework (XSM/FLASK)                    | disabled |
+| flask-tools         | yes      | tools to manage FLASK policy                                 | disabled |
+| fuzz                | no       | FUZZ test tool                                               |         |
+| fsimage             | yes      | file system image generator for domUs; depends on `pygrub`   |         |
+| hvmloader           | no       | legacy BIOS loader for HVM guests                            |         |
+| libacpi             | no       | Advanced Configuration and Power Interface                   | disabled |
+| pygrub              | yes      | bootloader parser for domU kernels                           | enabled |
+| reums               | yes      | tool for failover of domUs via periodic backup; requires `libnl3` | need to check dependency with `libxenlight` (xl) |
+| scripts-block       | yes      | scripts for block device                                     |         |
+| scripts-common      | yes      | scripts for common utilities                                 |         |
+| scripts-network     | yes      | scripts for domU network setup                               |         |
+| shim                | yes      | EFI loader to launch Xen as a bootloader                     | disabled  |
+| xenpaging           | no       | domain paging tools not used                                 |           |
+| xenpmd              | no       | xen power management daemon                                  | had dependency on `XenStore` |
+| xenstored           | no       | Xen Store Daemon providing simple tree-like database         | had dependency on `XenStore`, and event channel |
+| xenwatchdogd        | no       | watchdog daemon. Not needed                                  |           |
+| volatiles           | yes      | runtime files (e.g. sockets, pid) for Xen tools              |           |
+| xencommons          | yes      | startup script for Xen toolstack                             |           |
+| xendomains          | yes      | init scirpt to autostart and shutdown domUs at boot/shutdown |           |
+| xentrace            | no       | trace Xen internal events. kind of debugging and monitoring tool. Not needed |  |
+| xenmon              | no       | live trace monitor                                           | requires `xentrace` |
+
+## How to enable minimal `xen-tools`
+
+- Ensure the following lines are present in `local.conf`:
+
+``` conf
+# Enable minimal-xen-tools mode
+ENABLE_MINIMAL_XEN_TOOLS = "true"
+# Append minimal-xen-tools feature to xen-tools build configuration
+PACKAGECONFIG:append:pn-xen-tools = " minimal-xen-tools"
+```
+
+- `minimal-xen-tools` will be enabled if `ENABLE_MINIMAL_XEN_TOOLS` is set to `true`
+
+## How to include a component which is excluded
+
+### Library
+
+- Modify `xen/tools/libs/Makefile` and `xen/tools/libs/uselibs.mk` as follows to include the library's source code in the build
+
+@xen/tools/libs/Makefile
+
+```makefile
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+SUBDIRS-y :=
+SUBDIRS-y += toolcore
+SUBDIRS-y += toollog
+SUBDIRS-y += call
+SUBDIRS-y += foreignmemory
+SUBDIRS-y += ctrl
+SUBDIRS-y += xxx            # include 'xxx' to build 
+endif
+```
+
+@xen/tools/libs/uselibs.mk
+
+```makefile
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+    LIBS_LIBS += toolcore
+    USELIBS_toolcore := 
+    LIBS_LIBS += toollog
+    USELIBS_toollog :=
+    LIBS_LIBS += call
+    USELIBS_call := toollog toolcore
+    LIBS_LIBS += foreignmemory
+    USELIBS_foreignmemory := toollog toolcore
+    LIBS_LIBS += ctrl
+    USELIBS_ctrl := toollog call foreignmemory
+    LIBS_LIBS += xxx    # add 'xxx'
+    USELIBS_xxx := toollog toolcore aaa   # dependency of 'xxx'      
+else
+    LIBS_LIBS += toolcore
+
+```
+
+- Modify `xen/tools/libs/ctrl/Makefile.common` if you want to include part of `libxenctrl`
+
+### Tool
+
+- Modify `xen/tools/Makefile` as follows to include the source code in the build
+
+``` makefile
+ifeq ($(CONFIG_MINIMAL_TOOLS),y)
+SUBDIRS-y :=
+SUBDIRS-y += libs
+SUBDIRS-y += flask
+SUBDIRS-y += hotplug
+SUBDIRS-y += xxx          # include 'xxx' to build 
+SUBDIRS-$(CONFIG_X86) += firmware
+SUBDIRS-$(CONFIG_LIBFSIMAGE) += libfsimage
+
+# do not recurse in to a dir we are about to delete
+ifneq "$(MAKECMDGOALS)" "distclean"
+SUBDIRS-$(CONFIG_QEMU_TRAD) += qemu-xen-traditional-dir
+SUBDIRS-$(CONFIG_QEMU_XEN) += qemu-xen-dir
+endif
+#SUBDIRS-y += python
+SUBDIRS-$(CONFIG_PYGRUB) += pygrub
+SUBDIRS-$(OCAML_TOOLS) += ocaml
+endif
+```
+
+- The `xen/tools/configure.ac` file should also be modified appropriately as needed. In this case, you should ensure that updating `configure` file and executing it during the build.
-- 
2.34.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RFC PATCH 0/2] Propose an minimal xen-tools
  2025-05-14  7:12 [RFC PATCH 0/2] Propose an minimal xen-tools Sookyung Ahn
  2025-05-14  7:12 ` [RFC PATCH 1/2] changes for minimal-xen-tools Sookyung Ahn
  2025-05-14  7:12 ` [RFC PATCH 2/2] add document minimal_xen_tools.pandoc Sookyung Ahn
@ 2025-05-14  7:24 ` Jan Beulich
  2025-05-21 14:26 ` Anthony PERARD
  3 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2025-05-14  7:24 UTC (permalink / raw)
  To: Sookyung Ahn, xen-devel
  Cc: matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim

On 14.05.2025 09:12, Sookyung Ahn wrote:
> I am writing to propose an enhancement to the `xen-tools` for users who require only a minimal subset of its functionality, particularly in safety-critical domains like aerospace.
> 
> I believe that the addition of a new build-time option, `ENABLE_MINIMAL_XEN_TOOLS`, will significantly benefit users by allowing them to build only the essential components needed for their specific applications. 
> This approach not only streamlines the toolset but also reduces the potential for unnecessary complexity in safety-critical environments.
> This proposal is based on `dom0less` environment.
> 
> The proposed implementation includes:
> - Introducing the `ENABLE_MINIMAL_XEN_TOOLS` configuration flag.
> - Modifying the build process to selectively include only the necessary components based on the configuration.
> 
> This implementation can be effectively applied to the following use cases. 
> - Minimal APIs for `dom0less` operation. This involves taking existing Xen functions and shrinking them to minimal needed parts. For example, we can use static device tree instead of XenStore. 
> - By retaining `libxencall` and minimum part of `libxencrtl`, the Hypercall interface can be utilized, enabling support for the Xen ARINC653 Multiple Module Schedules service. 
> - Addition of ARINC653 Part1&2 APIs and services (hosted on the domain OS.)
> 
> I would appreciate any feedback or suggestions you may have regarding this enhancement. 
> Additionally, I would like to emphasize the importance of community input in refining this proposal to ensure it meets the needs of all users.
> 
> Sookyung Ahn (2):
>   changes for minimal-xen-tools
>   add document minimal_xen_tools.pandoc
> 
>  config/Tools.mk.in                    |   1 +
>  docs/designs/minimal_xen_tools.pandoc | 147 ++++++++++++++++++++++++++

Just one nit here: Like you have it in the subject, please prefer dashes over
underscores in the names of new files.

Jan

>  tools/Makefile                        |  19 ++++
>  tools/Rules.mk                        |   9 +-
>  tools/configure.ac                    |  47 +++-----
>  tools/flask/Makefile                  |   4 +
>  tools/hotplug/Linux/Makefile          |   6 ++
>  tools/hotplug/Linux/systemd/Makefile  |   6 ++
>  tools/libs/Makefile                   |   9 ++
>  tools/libs/ctrl/Makefile.common       |  92 +++++++++-------
>  tools/libs/ctrl/xc_private.c          |   6 ++
>  tools/libs/ctrl/xc_private.h          |   7 +-
>  tools/libs/uselibs.mk                 |  76 +++++++------
>  13 files changed, 325 insertions(+), 104 deletions(-)
>  create mode 100644 docs/designs/minimal_xen_tools.pandoc
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC PATCH 2/2] add document minimal_xen_tools.pandoc
  2025-05-14  7:12 ` [RFC PATCH 2/2] add document minimal_xen_tools.pandoc Sookyung Ahn
@ 2025-05-14  7:28   ` Jan Beulich
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2025-05-14  7:28 UTC (permalink / raw)
  To: Sookyung Ahn
  Cc: matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim, xen-devel

On 14.05.2025 09:12, Sookyung Ahn wrote:
> --- /dev/null
> +++ b/docs/designs/minimal_xen_tools.pandoc
> @@ -0,0 +1,147 @@
> +- [Minimal Xen-tools](#minimal-xen-tools)
> +  - [`xen-tools` : full vs minimal](#xen-tools--full-vs-minimal)
> +  - [Components of minimal `xen-tools`](#components-of-minimal-xen-tools)
> +  - [How to enable minimal `xen-tools`](#how-to-enable-minimal-xen-tools)
> +  - [How to include a component which is excluded](#how-to-include-a-component-which-is-excluded)
> +    - [Library](#library)
> +    - [Tool](#tool)
> +
> +# Minimal Xen-tools
> +
> +Purpose : To enhance `xen-tools` for users who require only a minimal subset of its functionality, particularly in safety-critical domains such as aerospace. 
> +
> +## `xen-tools` : full vs minimal
> +
> +- total size of **full** `xen-tools` and **minimal** `xen-tools`
> +
> +|      | full         | minimal        |
> +|------| ------------ | ------------ |
> +|ipks  | 8.1M (8216K) | **1.3M** (1276K) |
> +|image | 26M (25944K) | **4.6M** (4664)K |
> +
> +## Components of minimal `xen-tools`
> +
> +| `xen-tools-`        | included | Rationale                                                    | remark  |
> +|---------------------| -------- | ------------------------------------------------------------ | ------- |
> +| libxencall          | yes      | library to provide hypercall interface                       |         |
> +| libxenctrl          | yes      | library to provide interface for the ARINC 653 scheduler     | partially included |
> +| libxendevicemodel   | no       | library to support device model. Not needed                  |         |
> +| libxenevtchn        | no       | library to support event channel. Not needed with static event channel | |
> +| libxenforeignmemory | yes      | library to support  memory management for hypercall buffer                       |         |
> +| libxengnttab        | no       | library to support grant table. We are plainning to use static shared memory instaed of grant table to avoid dynamic memory allocation. | |
> +| libxenguest         | no       | library to support control and manage the domUs. Not required with dom0less | |
> +| libxenhypfs         | no       | library to provide interface for hypervisor fs. We don't access hypervisor fs. | |
> +| libxenlight         | no       | library to support `xl`. We don't use `xl` at all            | |
> +| libxenstat          | no       | library to monitor statistic data of domUs with `xentop`. We don't use it | |
> +| libxenstore         | no       | library to access `XenStore`. We don't use `XenStore`. | |
> +| libxenutil          | no       | library to provide common utilities. | |
> +| libxenvchan         | no       | library to provide interface for vchan(vitual channel). We don't use vchan | |
> +| libxentoolcore      | yes      | managing libraries' handlers                                 |         |
> +| libxentoollog       | yes      | library to provide logging interface                         | can be removed |
> +| 9pfsd               | no       | network file system protocol.                                | had dependency on `XenStore` |
> +| consold             | no       | `ctrl-a` ×3 replaces it                                        |         |
> +| dev                 | yes      | header files                                                 |         |
> +| flask               | yes      | Xen security policy framework (XSM/FLASK)                    | disabled |
> +| flask-tools         | yes      | tools to manage FLASK policy                                 | disabled |
> +| fuzz                | no       | FUZZ test tool                                               |         |
> +| fsimage             | yes      | file system image generator for domUs; depends on `pygrub`   |         |
> +| hvmloader           | no       | legacy BIOS loader for HVM guests                            |         |
> +| libacpi             | no       | Advanced Configuration and Power Interface                   | disabled |
> +| pygrub              | yes      | bootloader parser for domU kernels                           | enabled |
> +| reums               | yes      | tool for failover of domUs via periodic backup; requires `libnl3` | need to check dependency with `libxenlight` (xl) |
> +| scripts-block       | yes      | scripts for block device                                     |         |
> +| scripts-common      | yes      | scripts for common utilities                                 |         |
> +| scripts-network     | yes      | scripts for domU network setup                               |         |
> +| shim                | yes      | EFI loader to launch Xen as a bootloader                     | disabled  |
> +| xenpaging           | no       | domain paging tools not used                                 |           |
> +| xenpmd              | no       | xen power management daemon                                  | had dependency on `XenStore` |
> +| xenstored           | no       | Xen Store Daemon providing simple tree-like database         | had dependency on `XenStore`, and event channel |
> +| xenwatchdogd        | no       | watchdog daemon. Not needed                                  |           |
> +| volatiles           | yes      | runtime files (e.g. sockets, pid) for Xen tools              |           |
> +| xencommons          | yes      | startup script for Xen toolstack                             |           |
> +| xendomains          | yes      | init scirpt to autostart and shutdown domUs at boot/shutdown |           |
> +| xentrace            | no       | trace Xen internal events. kind of debugging and monitoring tool. Not needed |  |
> +| xenmon              | no       | live trace monitor                                           | requires `xentrace` |

While I trust you that this properly summarizes what patch 1 does, I wonder
whether this simple "full" vs "minimal" can really cover everyone's needs.
Furthermore, is it really a requirement to limit what's being _built_? I.e.
isn't what you care about what ends up on the target system(s)? In e.g. the
RPM world that would be controlled by the .spec file, not by changes to the
build infrastructure.

Jan


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC PATCH 0/2] Propose an minimal xen-tools
  2025-05-14  7:12 [RFC PATCH 0/2] Propose an minimal xen-tools Sookyung Ahn
                   ` (2 preceding siblings ...)
  2025-05-14  7:24 ` [RFC PATCH 0/2] Propose an minimal xen-tools Jan Beulich
@ 2025-05-21 14:26 ` Anthony PERARD
  2025-07-08 18:45   ` [EXTERNAL] " Weber (US), Matthew L
  3 siblings, 1 reply; 7+ messages in thread
From: Anthony PERARD @ 2025-05-21 14:26 UTC (permalink / raw)
  To: Sookyung Ahn
  Cc: xen-devel, matthew.l.weber3, joshua.c.whitehead, Anderson.Choi,
	brian.j.wood2, haesun.kim

Hi,

Thanks for the proposal.

On Wed, May 14, 2025 at 07:12:48AM +0000, Sookyung Ahn wrote:
> I am writing to propose an enhancement to the `xen-tools` for users who require only a minimal subset of its functionality, particularly in safety-critical domains like aerospace.

FYI, there's a project call `xen-tools`, at
https://github.com/xen-tools/xen-tools/, and having it spell like
reminds me of that external project, and not the tools in this repo.

> I believe that the addition of a new build-time option, `ENABLE_MINIMAL_XEN_TOOLS`, will significantly benefit users by allowing them to build only the essential components needed for their specific applications. 
> This approach not only streamlines the toolset but also reduces the potential for unnecessary complexity in safety-critical environments.
> This proposal is based on `dom0less` environment.
> 
> The proposed implementation includes:
> - Introducing the `ENABLE_MINIMAL_XEN_TOOLS` configuration flag.
> - Modifying the build process to selectively include only the necessary components based on the configuration.
> 
> This implementation can be effectively applied to the following use cases. 
> - Minimal APIs for `dom0less` operation. This involves taking existing Xen functions and shrinking them to minimal needed parts. For example, we can use static device tree instead of XenStore. 
> - By retaining `libxencall` and minimum part of `libxencrtl`, the Hypercall interface can be utilized, enabling support for the Xen ARINC653 Multiple Module Schedules service. 
> - Addition of ARINC653 Part1&2 APIs and services (hosted on the domain OS.)
> 
> I would appreciate any feedback or suggestions you may have regarding this enhancement. 
> Additionally, I would like to emphasize the importance of community input in refining this proposal to ensure it meets the needs of all users.

I don't quite like this approach. What is "minimal"? Whatever
definition we can come up with isn't going to fit other's expectation
of a minimal set of tools. Also, the minimum set of tools needed might
be 0, if you only need the hypervisor.

Also, the implementation is quite invasive, with `CONFIG_MINIMAL_TOOLS`
spread through the build system. It also duplicates configurations, with
like "SUBDIRS-y += libs" been written twice in tools/Makefile.

I feel like a better approach would be to have something like:
    ./configure --no-default --enable-flask --enable-hotplug ...

As for the makefiles, instead of having to invent a config option for
every single `SUBDIRS-y` we could have a generic
SUBDIRS-$(subdir-default) where subdir_default is 'y' unless we want to
select a handful of subdirectory.

It might not be necessary to have a config option for everything, you
could deal with some of the stray binary with the tool use to make
package, like RPM where you select which files to packages (as already
suggested), and for other tool just `rm` the few files not needed.

Then, there's `libxenctrl`. For this one, it doesn't feel like a good
idea to make it selectively smaller. Maybe there's a way to extract the
functionality you need into a new lib? We kind of tried in the past to
extract piece of it into lib with a stable interface, like
libdevicemodel, libcall. So it might be a better approach to remove the
need of libxenctrl in your environment.

I hope that help.

Cheers,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [EXTERNAL] Re: [RFC PATCH 0/2] Propose an minimal xen-tools
  2025-05-21 14:26 ` Anthony PERARD
@ 2025-07-08 18:45   ` Weber (US), Matthew L
  0 siblings, 0 replies; 7+ messages in thread
From: Weber (US), Matthew L @ 2025-07-08 18:45 UTC (permalink / raw)
  To: Anthony PERARD, ayan.kumar.halder@amd.com
  Cc: xen-devel@lists.xenproject.org, Whitehead (US), Joshua C,
	Choi, Anderson, Wood (US), Brian J, Kim, Haesun, Jan Beulich,
	Ahn, Sookyung

Anthony & Ayan,

> -----Original Message-----
> From: Xen-devel <xen-devel-bounces@lists.xenproject.org> On Behalf Of Anthony PERARD
> Sent: Wednesday, May 21, 2025 9:27 AM
> To: Ahn, Sookyung <sookyung.ahn@boeing.com>
> Cc: xen-devel@lists.xenproject.org; Weber (US), Matthew L <matthew.l.weber3@boeing.com>; Whitehead (US), Joshua C <joshua.c.whitehead@boeing.com>; Choi, Anderson <Anderson.Choi@boeing.com>; Wood (US), Brian J > <brian.j.wood2@boeing.com>; Kim, Haesun <haesun.kim@boeing.com>
> Subject: [EXTERNAL] Re: [RFC PATCH 0/2] Propose an minimal xen-tools
>

<snip>
 
> > The proposed implementation includes:
> > - Introducing the `ENABLE_MINIMAL_XEN_TOOLS` configuration flag.
> > - Modifying the build process to selectively include only the necessary components based on the configuration.
> > 

@ayan.kumar.halder@amd.com  what is automotive planning to do for XL tool stack in a FuSa configuration?


> > This implementation can be effectively applied to the following use cases. 
> > - Minimal APIs for `dom0less` operation. This involves taking existing Xen functions and shrinking them to minimal needed parts. For example, we can use static device tree instead of XenStore. 
> > - By retaining `libxencall` and minimum part of `libxencrtl`, the Hypercall interface can be utilized, enabling support for the Xen ARINC653 Multiple Module Schedules service. 
> > - Addition of ARINC653 Part1&2 APIs and services (hosted on the domain 
> > OS.)
>
> I don't quite like this approach. What is "minimal"? Whatever definition we can come up with isn't going to fit other's expectation of a minimal set of tools. Also, the minimum set of tools needed might be 0, if you only need the hypervisor.
>
> Also, the implementation is quite invasive, with `CONFIG_MINIMAL_TOOLS` spread through the build system. It also duplicates configurations, with like "SUBDIRS-y += libs" been written twice in tools/Makefile.
>

This is good feedback.  The other route we had looked at is establishing a new library that's specifically focused on ARINC653.  The Xen existing ARINC653 scheduling support has some out of tree tools we're looking to integrate in and we're working to finish implementing the standard.  So maybe the basis for this new library is more around ARINC653 and not minimizing the existing XL tool stack.  (We'd have the XL tools disabled in a dom0less safety certification configuration.)

> I feel like a better approach would be to have something like:
>     ./configure --no-default --enable-flask --enable-hotplug ...
>
> As for the makefiles, instead of having to invent a config option for every single `SUBDIRS-y` we could have a generic
> SUBDIRS-$(subdir-default) where subdir_default is 'y' unless we want to select a handful of subdirectory. 
>
> It might not be necessary to have a config option for everything, you could deal with some of the stray binary with the tool use to make package, like RPM where you select which files to packages (as already suggested), and for other tool just `rm` the few files not needed.
>
> Then, there's `libxenctrl`. For this one, it doesn't feel like a good idea to make it selectively smaller. Maybe there's a way to extract the functionality you need into a new lib? We kind of tried in the past to extract piece of it into lib with a stable interface, like libdevicemodel, libcall. So it might be a better approach to remove the need of libxenctrl in your environment.

I see, sounds like the possible way forward is for us to make a libxenarinc static library that pulls in only what's needed.  Then look at the ./configure approach to enabling that library and seeing if we can selectively build solely that new library.

Best Regards,
-
Matthew L. Weber
Associate Technical Fellow / LXF ELISA Aerospace WG Chair


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-07-08 18:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-14  7:12 [RFC PATCH 0/2] Propose an minimal xen-tools Sookyung Ahn
2025-05-14  7:12 ` [RFC PATCH 1/2] changes for minimal-xen-tools Sookyung Ahn
2025-05-14  7:12 ` [RFC PATCH 2/2] add document minimal_xen_tools.pandoc Sookyung Ahn
2025-05-14  7:28   ` Jan Beulich
2025-05-14  7:24 ` [RFC PATCH 0/2] Propose an minimal xen-tools Jan Beulich
2025-05-21 14:26 ` Anthony PERARD
2025-07-08 18:45   ` [EXTERNAL] " Weber (US), Matthew L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.