From nobody Fri Dec 19 02:51:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=boeing.com ARC-Seal: i=1; a=rsa-sha256; t=1747206823; cv=none; d=zohomail.com; s=zohoarc; b=FZ5tFzpZ9UO7yEjV27do2OdQRvJyFxD7RcALFPLx3wrJlByWQIJqd/hl9On7UcVWZ66rrhExn2I3433GDMHriOhAZ0+/hO1p+m1D7jZT9++JlM5s7ugqyJxDA5HxtJOvAdpJUyaWdQeuyJW6OTlnQ5FE2D8r5RK/tnZv5uMKB2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747206823; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=1Yr2jbEn9COVInZYVVMSkIcvU1ytJWJjBPVPWMZKdFM=; b=dLv7RPJybIda5QwKd9O/Vu/pnAU9q4u41y5yaHFCkwBNU8boxsNCzhg79yPivAWtJBpIyyV6JoUeFtZwNca1GkK0Xv8B1qID/Rf2rA2lao1pWHJW/cuZwDqFKvXIWvfv0kM9nAOhJeEazDz9mfwHMhZrfL0l604tI8L/G1P3rSU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174720682389485.13795733007362; Wed, 14 May 2025 00:13:43 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.983858.1370031 (Exim 4.92) (envelope-from ) id 1uF6Ir-0004Jo-2V; Wed, 14 May 2025 07:13:21 +0000 Received: by outflank-mailman (output) from mailman id 983858.1370031; Wed, 14 May 2025 07:13:21 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uF6Iq-0004Jh-Vb; Wed, 14 May 2025 07:13:20 +0000 Received: by outflank-mailman (input) for mailman id 983858; Wed, 14 May 2025 07:13:19 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uF6Ip-0004JZ-F8 for xen-devel@lists.xenproject.org; Wed, 14 May 2025 07:13:19 +0000 Received: from clt-mbsout-02.mbs.boeing.net (clt-mbsout-02.mbs.boeing.net [130.76.144.163]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id e6bffcd6-3092-11f0-9ffb-bf95429c2676; Wed, 14 May 2025 09:13:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by clt-mbsout-02.mbs.boeing.net (8.15.2/8.15.2/DOWNSTREAM_MBSOUT) with SMTP id 54E7DDEt014098; Wed, 14 May 2025 03:13:13 -0400 Received: from phx-av-01.mbs.boeing.net (phx-av-01.mbs.boeing.net [137.136.102.153]) by clt-mbsout-02.mbs.boeing.net (8.15.2/8.15.2/8.15.2/UPSTREAM_MBSOUT) with ESMTPS id 54E7D3kn014026 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 14 May 2025 03:13:03 -0400 Received: from localhost (localhost [127.0.0.1]) by phx-av-01.mbs.boeing.net (8.15.2/8.15.2/DOWNSTREAM_RELAY) with SMTP id 54E7D2da008202; Wed, 14 May 2025 00:13:03 -0700 Received: from localhost.localdomain ([144.112.81.43]) by phx-av-01.mbs.boeing.net (8.15.2/8.15.2/UPSTREAM_RELAY) with ESMTP id 54E7CtL2007958; Wed, 14 May 2025 00:13:00 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e6bffcd6-3092-11f0-9ffb-bf95429c2676 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boeing.com; s=boeing-s1912; t=1747206793; bh=1Yr2jbEn9COVInZYVVMSkIcvU1ytJWJjBPVPWMZKdFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ufMBdsT3MxCWE2Oj+ape6o3c/XdxqLrH1MU9VpMa5vp+/kG7tzPExKowlIGA8mw6G 0m38LEyRwbFgPKNvIvVb0SLXSTERW7FHbjZn68fIVSaymr+PG0lLeriw9hJAJSDhhi 1HsyVHnjjNUZxHBjQNYKjMHea+KCZz9boVmTsQ8AKBIcmN3ZQgECEDJMJHmV6g1RrR 3EN6GxjsCy3MGVD7w2RqyQOhse8Uqi+wksdYTg5PI/gtANIl+HN3KOPQNPDIERkx8c MWu7fiWSZFFBWg7+Elpkg5em6fPS8gncn66T7xRQtZmiwLgVl4VKudBZum+N78V7WD Sb24zWbsYRoNA== From: Sookyung Ahn To: xen-devel@lists.xenproject.org Cc: matthew.l.weber3@boeing.com, joshua.c.whitehead@boeing.com, Anderson.Choi@boeing.com, brian.j.wood2@boeing.com, haesun.kim@boeing.com, Sookyung Ahn Subject: [RFC PATCH 1/2] changes for minimal-xen-tools Date: Wed, 14 May 2025 07:12:49 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-ZohoMail-DKIM: pass (identity @boeing.com) X-ZM-MESSAGEID: 1747206825893019000 Content-Type: text/plain; charset="utf-8" --- 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 :=3D @systemd@ XEN_SYSTEMD_DIR :=3D @SYSTEMD_DIR@ XEN_SYSTEMD_MODULES_LOAD :=3D @SYSTEMD_MODULES_LOAD@ CONFIG_9PFS :=3D @ninepfs@ +CONFIG_MINIMAL_TOOLS :=3D @minimal_xen_tools@ =20 LINUX_BACKEND_MODULES :=3D @LINUX_BACKEND_MODULES@ =20 diff --git a/tools/Makefile b/tools/Makefile index 7d17211782..b4af073305 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -41,6 +41,24 @@ SUBDIRS-y +=3D python SUBDIRS-$(CONFIG_PYGRUB) +=3D pygrub SUBDIRS-$(OCAML_TOOLS) +=3D ocaml =20 +ifeq ($(CONFIG_MINIMAL_TOOLS),y) +SUBDIRS-y :=3D +SUBDIRS-y +=3D libs +SUBDIRS-y +=3D flask +SUBDIRS-y +=3D hotplug +SUBDIRS-$(CONFIG_X86) +=3D firmware +SUBDIRS-$(CONFIG_LIBFSIMAGE) +=3D libfsimage + +# do not recurse in to a dir we are about to delete +ifneq "$(MAKECMDGOALS)" "distclean" +SUBDIRS-$(CONFIG_QEMU_TRAD) +=3D qemu-xen-traditional-dir +SUBDIRS-$(CONFIG_QEMU_XEN) +=3D qemu-xen-dir +endif +#SUBDIRS-y +=3D python +SUBDIRS-$(CONFIG_PYGRUB) +=3D pygrub +SUBDIRS-$(OCAML_TOOLS) +=3D ocaml +endif + ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D libs endif @@ -55,6 +73,7 @@ endif =20 .PHONY: build all build all: subdirs-all + echo "$(SUBDIRS-y)" =20 .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 =20 CFLAGS_xeninclude =3D -I$(XEN_INCLUDE) =20 -XENSTORE_XENSTORED ?=3D y - +ifeq ($(CONFIG_MINIMAL_TOOLS),y) + XENSTORE_XENSTORED ?=3D n +else + XENSTORE_XENSTORED ?=3D y +endif # A debug build of tools? debug ?=3D n debug_symbols ?=3D $(debug) @@ -139,7 +142,9 @@ ifeq ($(CONFIG_Linux),y) xenlibs-ldlibs-store :=3D -ldl endif =20 +ifeq ($(CONFIG_MINIMAL_TOOLS),n) CFLAGS_libxenlight +=3D $(CFLAGS_libxenctrl) +endif =20 # 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 @@ =20 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 warni= ng =20 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" =3D "xyes"], + [AC_DEFINE([ENABLE_MINIMAL_XEN_TOOLS], [1], [Enable Light Xen Tools])]) =20 AC_ARG_WITH([linux-backend-modules], - AS_HELP_STRING([--with-linux-backend-modules=3D"mod1 mod2"], - [List of Linux backend module or modalias names to be autoloaded on st= artup.]), - [LINUX_BACKEND_MODULES=3D"$withval"], - [case "$host_os" in -*linux*) -LINUX_BACKEND_MODULES=3D" -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=3D -;; -esac]) -LINUX_BACKEND_MODULES=3D"`eval echo $LINUX_BACKEND_MODULES`" -AC_SUBST(LINUX_BACKEND_MODULES) + AS_HELP_STRING([--with-linux-backend-modules=3D"mod1 mod2"],=20 + [List of Linux backend module or modalias names to be autoloaded on star= tup.]), + [LINUX_BACKEND_MODULES=3D"$withval"], + AS_IF([test "x$enable_minimal_xen_tools" =3D "xyes"], [LINUX_BACKEND_MOD= ULES=3D], + [test "x$host_os"=3D"xlinux"], + [LINUX_BACKEND_MODULES=3D"xen-evtchn xen-gntdev xen-gntalloc xen-blkba= ck xen-netback xen-pciback evtchn gntdev netbk blkbk xen-scsibk usbbk pciba= ck xen-acpi-processor"], + [LINUX_BACKEND_MODULES=3D]) +) +AC_SUBST([LINUX_BACKEND_MODULES]) =20 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 =3D $(CURDIR)/../.. include $(XEN_ROOT)/tools/Rules.mk =20 +ifeq ($(CONFIG_MINIMAL_TOOLS),y) +SUBDIRS-y :=3D +else SUBDIRS-y :=3D utils +endif SUBDIRS-$(FLASK_POLICY) +=3D policy =20 .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 +=3D block-drbd-probe XEN_SCRIPTS +=3D block-dummy XEN_SCRIPTS +=3D $(XEN_SCRIPTS-y) XEN_SCRIPTS +=3D colo-proxy-setup +ifeq ($(CONFIG_MINIMAL_TOOLS),n) XEN_SCRIPTS +=3D launch-xenstore +endif =20 SUBDIRS-$(CONFIG_SYSTEMD) +=3D systemd =20 @@ -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 =20 .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/sys= temd/Makefile index e29889156d..4a35fcaa0e 100644 --- a/tools/hotplug/Linux/systemd/Makefile +++ b/tools/hotplug/Linux/systemd/Makefile @@ -5,6 +5,7 @@ XEN_SYSTEMD_MODULES :=3D xen.conf =20 XEN_SYSTEMD_MOUNT :=3D proc-xen.mount =20 +ifeq ($(CONFIG_MINIMAL_TOOLS),n) XEN_SYSTEMD_SERVICE :=3D xenstored.service XEN_SYSTEMD_SERVICE +=3D xenconsoled.service XEN_SYSTEMD_SERVICE +=3D xen-qemu-dom0-disk-backend.service @@ -12,6 +13,11 @@ XEN_SYSTEMD_SERVICE +=3D xendomains.service XEN_SYSTEMD_SERVICE +=3D xen-watchdog.service XEN_SYSTEMD_SERVICE +=3D xen-init-dom0.service XEN_SYSTEMD_SERVICE +=3D xendriverdomain.service +else +XEN_SYSTEMD_SERVICE :=3D xen-init-dom0.service +XEN_SYSTEMD_SERVICE +=3D xendomains.service +#XEN_SYSTEMD_SERVICE +=3D xendriverdomain.service +endif =20 ALL_XEN_SYSTEMD :=3D $(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) +=3D vchan SUBDIRS-y +=3D light SUBDIRS-y +=3D util =20 +ifeq ($(CONFIG_MINIMAL_TOOLS),y) +SUBDIRS-y :=3D +SUBDIRS-y +=3D toolcore +SUBDIRS-y +=3D toollog +SUBDIRS-y +=3D call +SUBDIRS-y +=3D foreignmemory +SUBDIRS-y +=3D ctrl +endif + ifeq ($(CONFIG_RUMP),y) SUBDIRS-y :=3D toolcore endif diff --git a/tools/libs/ctrl/Makefile.common b/tools/libs/ctrl/Makefile.com= mon index 247afbe5f9..cee4f6d2f7 100644 --- a/tools/libs/ctrl/Makefile.common +++ b/tools/libs/ctrl/Makefile.common @@ -1,41 +1,57 @@ -OBJS-y +=3D xc_altp2m.o -OBJS-y +=3D xc_cpupool.o -OBJS-y +=3D xc_domain.o -OBJS-y +=3D xc_evtchn.o -OBJS-y +=3D xc_gnttab.o -OBJS-y +=3D xc_misc.o -OBJS-y +=3D xc_flask.o -OBJS-y +=3D xc_physdev.o -OBJS-y +=3D xc_private.o -OBJS-y +=3D xc_csched.o -OBJS-y +=3D xc_csched2.o -OBJS-y +=3D xc_arinc653.o -OBJS-y +=3D xc_rt.o -OBJS-y +=3D xc_tbuf.o -OBJS-y +=3D xc_pm.o -OBJS-y +=3D xc_cpu_hotplug.o -OBJS-y +=3D xc_vm_event.o -OBJS-y +=3D xc_vmtrace.o -OBJS-y +=3D xc_monitor.o -OBJS-y +=3D xc_mem_paging.o -OBJS-y +=3D xc_mem_access.o -OBJS-y +=3D xc_memshr.o -OBJS-y +=3D xc_hcall_buf.o -OBJS-y +=3D xc_foreign_memory.o -OBJS-y +=3D xc_kexec.o -OBJS-y +=3D xc_resource.o -OBJS-$(CONFIG_ARM) +=3D xc_dt_overlay.o -OBJS-$(CONFIG_X86) +=3D xc_psr.o -OBJS-$(CONFIG_X86) +=3D xc_pagetab.o -OBJS-$(CONFIG_Linux) +=3D xc_linux.o -OBJS-$(CONFIG_FreeBSD) +=3D xc_freebsd.o -OBJS-$(CONFIG_SunOS) +=3D xc_solaris.o -OBJS-$(CONFIG_NetBSD) +=3D xc_netbsd.o -OBJS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.o -OBJS-$(CONFIG_MiniOS) +=3D xc_minios.o -OBJS-y +=3D xc_evtchn_compat.o -OBJS-y +=3D xc_gnttab_compat.o -OBJS-y +=3D xc_devicemodel_compat.o +ifeq ($(CONFIG_MINIMAL_TOOLS),y) + OBJS-y +=3D xc_domain.o + OBJS-y +=3D xc_misc.o + OBJS-y +=3D xc_private.o + OBJS-y +=3D xc_csched2.o + OBJS-y +=3D xc_arinc653.o + OBJS-y +=3D xc_hcall_buf.o + OBJS-y +=3D xc_foreign_memory.o + OBJS-$(CONFIG_Linux) +=3D xc_linux.o + OBJS-$(CONFIG_FreeBSD) +=3D xc_freebsd.o + OBJS-$(CONFIG_SunOS) +=3D xc_solaris.o + OBJS-$(CONFIG_NetBSD) +=3D xc_netbsd.o + OBJS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.o + OBJS-$(CONFIG_MiniOS) +=3D xc_minios.o +else + OBJS-y +=3D xc_altp2m.o + OBJS-y +=3D xc_cpupool.o + OBJS-y +=3D xc_domain.o + OBJS-y +=3D xc_evtchn.o + OBJS-y +=3D xc_gnttab.o + OBJS-y +=3D xc_misc.o + OBJS-y +=3D xc_flask.o + OBJS-y +=3D xc_physdev.o + OBJS-y +=3D xc_private.o + OBJS-y +=3D xc_csched.o + OBJS-y +=3D xc_csched2.o + OBJS-y +=3D xc_arinc653.o + OBJS-y +=3D xc_rt.o + OBJS-y +=3D xc_tbuf.o + OBJS-y +=3D xc_pm.o + OBJS-y +=3D xc_cpu_hotplug.o + OBJS-y +=3D xc_vm_event.o + OBJS-y +=3D xc_vmtrace.o + OBJS-y +=3D xc_monitor.o + OBJS-y +=3D xc_mem_paging.o + OBJS-y +=3D xc_mem_access.o + OBJS-y +=3D xc_memshr.o + OBJS-y +=3D xc_hcall_buf.o + OBJS-y +=3D xc_foreign_memory.o + OBJS-y +=3D xc_kexec.o + OBJS-y +=3D xc_resource.o + OBJS-$(CONFIG_ARM) +=3D xc_dt_overlay.o + OBJS-$(CONFIG_X86) +=3D xc_psr.o + OBJS-$(CONFIG_X86) +=3D xc_pagetab.o + OBJS-$(CONFIG_Linux) +=3D xc_linux.o + OBJS-$(CONFIG_FreeBSD) +=3D xc_freebsd.o + OBJS-$(CONFIG_SunOS) +=3D xc_solaris.o + OBJS-$(CONFIG_NetBSD) +=3D xc_netbsd.o + OBJS-$(CONFIG_NetBSDRump) +=3D xc_netbsd.o + OBJS-$(CONFIG_MiniOS) +=3D xc_minios.o + OBJS-y +=3D xc_evtchn_compat.o + OBJS-y +=3D xc_gnttab_compat.o + OBJS-y +=3D xc_devicemodel_compat.o +endif =20 CFLAGS +=3D -D__XEN_TOOLS__ CFLAGS +=3D $(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_l= ogger *logger, if ( xch->fmem =3D=3D NULL ) goto err; =20 +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 1) xch->dmod =3D xendevicemodel_open(xch->error_handler, 0); if ( xch->dmod =3D=3D NULL ) goto err; +#endif =20 return xch; =20 @@ -92,8 +94,10 @@ int xc_interface_close(xc_interface *xch) rc =3D xenforeignmemory_close(xch->fmem); if (rc) PERROR("Could not close foreign memory interface"); =20 +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 1) rc =3D xendevicemodel_close(xch->dmod); if (rc) PERROR("Could not close device model interface"); +#endif =20 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; } =20 +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 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 =20 static pthread_key_t errbuf_pkey; static pthread_once_t errbuf_pkey_once =3D 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 @@ =20 #include #include +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 1) #include +#endif =20 #include =20 @@ -91,9 +93,10 @@ struct xc_interface_core { =20 /* Foreign mappings */ xenforeignmemory_handle *fmem; - +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 1) /* Device model */ xendevicemodel_handle *dmod; +#endif }; =20 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", __FUNCTIO= N__) =20 +#if (ENABLE_MINIMAL_XEN_TOOLS !=3D 1) /** * vm_event operations. Internal use only. */ @@ -411,6 +415,7 @@ int xc_vm_event_control(xc_interface *xch, uint32_t dom= ain_id, unsigned int op, */ void *xc_vm_event_enable(xc_interface *xch, uint32_t domain_id, int param, uint32_t *port); +#endif =20 int do_dm_op(xc_interface *xch, uint32_t domid, unsigned int nr_bufs, ...); =20 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 +=3D toolcore -USELIBS_toolcore :=3D -LIBS_LIBS +=3D toollog -USELIBS_toollog :=3D -LIBS_LIBS +=3D evtchn -USELIBS_evtchn :=3D toollog toolcore -LIBS_LIBS +=3D gnttab -USELIBS_gnttab :=3D toollog toolcore -LIBS_LIBS +=3D call -USELIBS_call :=3D toollog toolcore -LIBS_LIBS +=3D foreignmemory -USELIBS_foreignmemory :=3D toollog toolcore -LIBS_LIBS +=3D devicemodel -USELIBS_devicemodel :=3D toollog toolcore call -LIBS_LIBS +=3D hypfs -USELIBS_hypfs :=3D toollog toolcore call -LIBS_LIBS +=3D ctrl -USELIBS_ctrl :=3D toollog call evtchn gnttab foreignmemory devicemodel -LIBS_LIBS +=3D guest -USELIBS_guest :=3D evtchn ctrl -LIBS_LIBS +=3D store -USELIBS_store :=3D toolcore -LIBS_LIBS +=3D vchan -USELIBS_vchan :=3D toollog store gnttab evtchn -LIBS_LIBS +=3D stat -USELIBS_stat :=3D ctrl store -LIBS_LIBS +=3D light -USELIBS_light :=3D toollog evtchn toolcore ctrl store hypfs guest -LIBS_LIBS +=3D util -USELIBS_util :=3D light -FILENAME_util :=3D xlutil +ifeq ($(CONFIG_MINIMAL_TOOLS),y) + LIBS_LIBS +=3D toolcore + USELIBS_toolcore :=3D=20 + LIBS_LIBS +=3D toollog + USELIBS_toollog :=3D + LIBS_LIBS +=3D call + USELIBS_call :=3D toollog toolcore + LIBS_LIBS +=3D foreignmemory + USELIBS_foreignmemory :=3D toollog toolcore + LIBS_LIBS +=3D ctrl + USELIBS_ctrl :=3D toollog call foreignmemory +else + LIBS_LIBS +=3D toolcore + USELIBS_toolcore :=3D + LIBS_LIBS +=3D toollog + USELIBS_toollog :=3D + LIBS_LIBS +=3D evtchn + USELIBS_evtchn :=3D toollog toolcore + LIBS_LIBS +=3D gnttab + USELIBS_gnttab :=3D toollog toolcore + LIBS_LIBS +=3D call + USELIBS_call :=3D toollog toolcore + LIBS_LIBS +=3D foreignmemory + USELIBS_foreignmemory :=3D toollog toolcore + LIBS_LIBS +=3D devicemodel + USELIBS_devicemodel :=3D toollog toolcore call + LIBS_LIBS +=3D hypfs + USELIBS_hypfs :=3D toollog toolcore call + LIBS_LIBS +=3D ctrl + USELIBS_ctrl :=3D toollog call evtchn gnttab foreignmemory devicemodel + LIBS_LIBS +=3D guest + USELIBS_guest :=3D evtchn ctrl + LIBS_LIBS +=3D store + USELIBS_store :=3D toolcore + LIBS_LIBS +=3D vchan + USELIBS_vchan :=3D toollog store gnttab evtchn + LIBS_LIBS +=3D stat + USELIBS_stat :=3D ctrl store + LIBS_LIBS +=3D light + USELIBS_light :=3D toollog evtchn toolcore ctrl store hypfs guest + LIBS_LIBS +=3D util + USELIBS_util :=3D light + FILENAME_util :=3D xlutil +endif \ No newline at end of file --=20 2.34.1 From nobody Fri Dec 19 02:51:20 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=reject dis=none) header.from=boeing.com ARC-Seal: i=1; a=rsa-sha256; t=1747206825; cv=none; d=zohomail.com; s=zohoarc; b=YtseBY2CjL8W1kZqV1k34LSRCr7wH0ANNCflJr+9iNukJy060R+xnWnTpNgYVAKvSPxiYiupWlr8lwOvkby7XwgpzyZ5mChZ4y90tpb9SHZyT32B5aCa22mnxKL/Gurw+VbDLXK1qsOqVrn96Cka778B3UWrpvfTXO2bhVjj8bY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1747206825; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SqhQ9oLNBoOgUzMMxOjrt8HiB1Bp3rr566Xpah5pmvc=; b=ItxsK7jceDdujvHdN9nDoewoy7b+q6TpJY4OqGiBFT5aVvQyWOI6TkbrSl9WLBofvpHEkvCG4CM7l05++cG/ej+XE6XTCBgY/lIkwUD+IVDhoE7DPSpAMVdpt4axabT415mrysXFs450U51cBceECOIoVveeYGnA2MPoAlHhS/w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 174720682504298.89862029597339; Wed, 14 May 2025 00:13:45 -0700 (PDT) Received: from list by lists.xenproject.org with outflank-mailman.983860.1370051 (Exim 4.92) (envelope-from ) id 1uF6Iu-0004m7-Fe; Wed, 14 May 2025 07:13:24 +0000 Received: by outflank-mailman (output) from mailman id 983860.1370051; Wed, 14 May 2025 07:13:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uF6Iu-0004m0-CM; Wed, 14 May 2025 07:13:24 +0000 Received: by outflank-mailman (input) for mailman id 983860; Wed, 14 May 2025 07:13:23 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1uF6It-0004Xa-8z for xen-devel@lists.xenproject.org; Wed, 14 May 2025 07:13:23 +0000 Received: from ewa-mbsout-01.mbs.boeing.net (ewa-mbsout-01.mbs.boeing.net [130.76.20.194]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id e9142e51-3092-11f0-9eb6-5ba50f476ded; Wed, 14 May 2025 09:13:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by ewa-mbsout-01.mbs.boeing.net (8.15.2/8.15.2/DOWNSTREAM_MBSOUT) with SMTP id 54E7DH0Y014578; Wed, 14 May 2025 00:13:17 -0700 Received: from phx-av-01.mbs.boeing.net (phx-av-01.mbs.boeing.net [137.136.102.153]) by ewa-mbsout-01.mbs.boeing.net (8.15.2/8.15.2/8.15.2/UPSTREAM_MBSOUT) with ESMTPS id 54E7DDtd014540 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 14 May 2025 00:13:14 -0700 Received: from localhost (localhost [127.0.0.1]) by phx-av-01.mbs.boeing.net (8.15.2/8.15.2/DOWNSTREAM_RELAY) with SMTP id 54E7DDpV008750; Wed, 14 May 2025 00:13:13 -0700 Received: from localhost.localdomain ([144.112.81.43]) by phx-av-01.mbs.boeing.net (8.15.2/8.15.2/UPSTREAM_RELAY) with ESMTP id 54E7CtL3007958; Wed, 14 May 2025 00:13:02 -0700 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: e9142e51-3092-11f0-9eb6-5ba50f476ded DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boeing.com; s=boeing-s1912; t=1747206797; bh=SqhQ9oLNBoOgUzMMxOjrt8HiB1Bp3rr566Xpah5pmvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WtyXEAkx21/9WQleAn0FTSHD1Z45whBPDqdu+nbLxqqZS1/7OoQA+AOqdnwHmwq0V 5AdBFg7Zc1EA535yxkEACTlVu/3zYltHK3VwZ7vRaYEznVnpZt4AsRG8glqZoIJwYn XmzWfjGTu4+YX/+Iqg7tebvIP38Tj0WI3uxjhREop0IJZ89GAFq4fg0K3XQTNAScSF IwVmDjkeh5nuhqYtLjdvt1+fSJH/BwT8yxeHXWItdu4HcaYnZYKNhfCL/9KahoL0V1 HFcI3zEjcSGOcFOZf+NYkGe1960W2l1aUP7KNKbxqubNFjHO2BO9zj7uhRSVA9CNrZ sZnDMtCfFecuw== From: Sookyung Ahn To: xen-devel@lists.xenproject.org Cc: matthew.l.weber3@boeing.com, joshua.c.whitehead@boeing.com, Anderson.Choi@boeing.com, brian.j.wood2@boeing.com, haesun.kim@boeing.com, Sookyung Ahn Subject: [RFC PATCH 2/2] add document minimal_xen_tools.pandoc Date: Wed, 14 May 2025 07:12:50 +0000 Message-Id: <0267d6a430a11b9387d56514f963b6a5c6033450.1747205627.git.sookyung.ahn@boeing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-ZohoMail-DKIM: pass (identity @boeing.com) X-ZM-MESSAGEID: 1747206825851019000 --- 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_x= en_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-compo= nent-which-is-excluded) + - [Library](#library) + - [Tool](#tool) + +# Minimal Xen-tools + +Purpose : To enhance `xen-tools` for users who require only a minimal subs= et of its functionality, particularly in safety-critical domains such as ae= rospace.=20 + +## `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 AR= INC 653 scheduler | partially included | +| libxendevicemodel | no | library to support device model. Not ne= eded | | +| libxenevtchn | no | library to support event channel. Not n= eeded with static event channel | | +| libxenforeignmemory | yes | library to support memory management f= or hypercall buffer | | +| libxengnttab | no | library to support grant table. We are = plainning to use static shared memory instaed of grant table to avoid dynam= ic memory allocation. | | +| libxenguest | no | library to support control and manage t= he domUs. Not required with dom0less | | +| libxenhypfs | no | library to provide interface for hyperv= isor 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 do= mUs 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` =C3=973 replaces it = | | +| dev | yes | header files = | | +| flask | yes | Xen security policy framework (XSM/FLAS= K) | 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 Interf= ace | 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` (x= l) | +| 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 bootloade= r | 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 X= en tools | | +| xencommons | yes | startup script for Xen toolstack = | | +| xendomains | yes | init scirpt to autostart and shutdown d= omUs at boot/shutdown | | +| xentrace | no | trace Xen internal events. kind of debu= gging 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 =3D "true" +# Append minimal-xen-tools feature to xen-tools build configuration +PACKAGECONFIG:append:pn-xen-tools =3D " 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 foll= ows to include the library's source code in the build + +@xen/tools/libs/Makefile + +```makefile +ifeq ($(CONFIG_MINIMAL_TOOLS),y) +SUBDIRS-y :=3D +SUBDIRS-y +=3D toolcore +SUBDIRS-y +=3D toollog +SUBDIRS-y +=3D call +SUBDIRS-y +=3D foreignmemory +SUBDIRS-y +=3D ctrl +SUBDIRS-y +=3D xxx # include 'xxx' to build=20 +endif +``` + +@xen/tools/libs/uselibs.mk + +```makefile +ifeq ($(CONFIG_MINIMAL_TOOLS),y) + LIBS_LIBS +=3D toolcore + USELIBS_toolcore :=3D=20 + LIBS_LIBS +=3D toollog + USELIBS_toollog :=3D + LIBS_LIBS +=3D call + USELIBS_call :=3D toollog toolcore + LIBS_LIBS +=3D foreignmemory + USELIBS_foreignmemory :=3D toollog toolcore + LIBS_LIBS +=3D ctrl + USELIBS_ctrl :=3D toollog call foreignmemory + LIBS_LIBS +=3D xxx # add 'xxx' + USELIBS_xxx :=3D toollog toolcore aaa # dependency of 'xxx' =20 +else + LIBS_LIBS +=3D 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 :=3D +SUBDIRS-y +=3D libs +SUBDIRS-y +=3D flask +SUBDIRS-y +=3D hotplug +SUBDIRS-y +=3D xxx # include 'xxx' to build=20 +SUBDIRS-$(CONFIG_X86) +=3D firmware +SUBDIRS-$(CONFIG_LIBFSIMAGE) +=3D libfsimage + +# do not recurse in to a dir we are about to delete +ifneq "$(MAKECMDGOALS)" "distclean" +SUBDIRS-$(CONFIG_QEMU_TRAD) +=3D qemu-xen-traditional-dir +SUBDIRS-$(CONFIG_QEMU_XEN) +=3D qemu-xen-dir +endif +#SUBDIRS-y +=3D python +SUBDIRS-$(CONFIG_PYGRUB) +=3D pygrub +SUBDIRS-$(OCAML_TOOLS) +=3D 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 a= nd executing it during the build. --=20 2.34.1