Propose an minimal xen-tools
cover Propose an minimal xen-tools
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
Signature · 1 line
2.34.1
RFC PATCH 1/2 changes for minimal-xen-tools
--- 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(-)
config/Tools.mk.in +1 -0
@@ -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@
tools/Makefile +19 -0
@@ -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:
tools/Rules.mk +7 -2
@@ -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
tools/configure.ac +16 -31
67 lines not on this page · raw message
tools/flask/Makefile +4 -0
@@ -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
tools/hotplug/Linux/Makefile +6 -0
@@ -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
tools/hotplug/Linux/systemd/Makefile +6 -0
@@ -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) \
tools/libs/Makefile +9 -0
@@ -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
tools/libs/ctrl/Makefile.common +54 -38
95 lines not on this page · raw message
tools/libs/ctrl/xc_private.c +6 -0
@@ -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 ;
tools/libs/ctrl/xc_private.h +6 -1
@@ -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, ...);
tools/libs/uselibs.mk +44 -32
78 lines not on this page · raw message
Signature · 1 line
2.34.1
RFC PATCH 2/2 add document minimal_xen_tools.pandoc
In reply to Sookyung Ahn--- docs/designs/minimal_xen_tools.pandoc | 147 ++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 docs/designs/minimal_xen_tools.pandoc
docs/designs/minimal_xen_tools.pandoc new file +147 -0
@@ -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.
Signature · 1 line
2.34.1
Quoted 18 lines · Sookyung Ahn
I am writing to propose an enhancement to the
xen-toolsfor 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 ondom0lessenvironment.The proposed implementation includes:
- Introducing theENABLE_MINIMAL_XEN_TOOLSconfiguration 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 fordom0lessoperation. 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 retaininglibxencalland minimum part oflibxencrtl, 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.
Quoted 6 lines
Sookyung Ahn (2):
changes for minimal-xen-tools
add document minimal_xen_tools.pandocconfig/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
Quoted 14 lines
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
Re: [RFC PATCH 2/2] add document minimal_xen_tools.pandoc
In reply to Sookyung AhnQuoted 57 lines · Sookyung Ahn
docs/designs/minimal_xen_tools.pandoc new file +54
-0@@ -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 | |
docs/designs/minimal_xen_tools.pandoc line 64
Quoted 10 lines
docs/designs/minimal_xen_tools.pandoc new file +10
-0+| 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
Hi,
Thanks for the proposal.
Quoted 1 line · Sookyung Ahn
I am writing to propose an enhancement to the
xen-toolsfor 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.
Quoted 8 lines
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 ondom0lessenvironment.The proposed implementation includes:
- Introducing theENABLE_MINIMAL_XEN_TOOLSconfiguration flag.
- Modifying the build process to selectively include only the necessary components based on the configuration.
Quoted 7 lines
This implementation can be effectively applied to the following use cases.
- Minimal APIs fordom0lessoperation. 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 retaininglibxencalland minimum part oflibxencrtl, 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,
Signature · 1 line
Anthony PERARD
Anthony & Ayan,
Quoted 7 lines
-----Original Message-----
From: Xen-devel <[email protected]> On Behalf Of Anthony PERARD
Sent: Wednesday, May 21, 2025 9:27 AM
To: Ahn, Sookyung <[email protected]>
Cc: [email protected]; Weber (US), Matthew L <[email protected]>; Whitehead (US), Joshua C <[email protected]>; Choi, Anderson <[email protected]>; Wood (US), Brian J > <[email protected]>; Kim, Haesun <[email protected]>
Subject: [EXTERNAL] Re: [RFC PATCH 0/2] Propose an minimal xen-tools
<snip>
Quoted 4 lines
Quoted 4 lines
The proposed implementation includes:
- Introducing theENABLE_MINIMAL_XEN_TOOLSconfiguration flag.
- Modifying the build process to selectively include only the necessary components based on the configuration.
@[email protected] what is automotive planning to do for XL tool stack in a FuSa configuration?
Quoted 10 lines
Quoted 5 lines
This implementation can be effectively applied to the following use cases.
- Minimal APIs fordom0lessoperation. 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 retaininglibxencalland minimum part oflibxencrtl, 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_TOOLSspread through the build system. It also duplicates configurations, with like "SUBDIRS-y += libs" been written twice intools/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.)
Quoted 9 lines
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-ywe could have a generic SUBDIRS-$(subdir-default) wheresubdir_defaultis '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
rmthe 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