diff --git a/emulators/xen-kernel/Makefile b/emulators/xen-kernel/Makefile index 4740b91ac09c..ef67d3cb7b6f 100644 --- a/emulators/xen-kernel/Makefile +++ b/emulators/xen-kernel/Makefile @@ -1,58 +1,58 @@ PORTNAME= xen PKGNAMESUFFIX= -kernel -DISTVERSION= 4.19.0.20241112 +DISTVERSION= 4.19.1.20250217 CATEGORIES= emulators USE_GITLAB= yes GL_ACCOUNT= xen-project -GL_TAGNAME= 251a9496485a86f302980a3f8d3c656831b5a62f +GL_TAGNAME= 93302bb88855c5f308f1e67ac2cd84271aa2d73a MAINTAINER= royger@FreeBSD.org COMMENT= Hypervisor using a microkernel design WWW= https://www.xenproject.org/ LICENSE= GPLv2 ONLY_FOR_ARCHS= amd64 USES= cpe gmake python:build bison # Ports build environment has ARCH=amd64 set which disables Xen automatic arch # detection, but amd64 is not a valid arch for Xen. Hardcode x86_64 on the # command line in order to overwrite the one from the environment. MAKE_ARGS= clang=y PYTHON=${PYTHON_CMD} ARCH=x86_64 NO_MTREE= yes STRIP= # PLIST_FILES= /boot/xen \ /boot/xen-debug \ lib/debug/boot/xen.debug \ lib/debug/boot/xen-debug.debug .include .if ${OPSYS} != FreeBSD IGNORE= only supported on FreeBSD .endif # The ports native 'build' target cannot be used because it sets # CFLAGS, and that breaks the Xen build system. # # Build both a production and a debug hypervisor. do-build: ${ECHO} "CONFIG_DEBUG=y" > ${WRKSRC}/xen/.config ${MAKE_CMD} -C ${WRKSRC}/xen olddefconfig ${MAKE_ARGS} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} build-xen ${MAKE_ARGS} cp ${WRKSRC}/xen/xen ${WRKSRC}/xen/xen-debug cp ${WRKSRC}/xen/xen-syms ${WRKSRC}/xen/xen-debug-syms ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} distclean-xen ${MAKE_ARGS} ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} build-xen ${MAKE_ARGS} do-install: ${MKDIR} ${STAGEDIR}/boot ${MKDIR} ${STAGEDIR}${PREFIX}/lib/debug/boot/ ${INSTALL_PROGRAM} ${WRKSRC}/xen/xen ${STAGEDIR}/boot ${INSTALL_DATA} ${WRKSRC}/xen/xen-syms ${STAGEDIR}${PREFIX}/lib/debug/boot/xen.debug ${INSTALL_PROGRAM} ${WRKSRC}/xen/xen-debug ${STAGEDIR}/boot ${INSTALL_DATA} ${WRKSRC}/xen/xen-debug-syms ${STAGEDIR}${PREFIX}/lib/debug/boot/xen-debug.debug .include diff --git a/emulators/xen-kernel/distinfo b/emulators/xen-kernel/distinfo index 11217aed8731..a19d269e7bc7 100644 --- a/emulators/xen-kernel/distinfo +++ b/emulators/xen-kernel/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1731419133 -SHA256 (xen-project-xen-251a9496485a86f302980a3f8d3c656831b5a62f_GL0.tar.gz) = fc0f502af1741e0d5bf9b3ab8576c4874271c63a3ad79892b78cd244fab52f21 -SIZE (xen-project-xen-251a9496485a86f302980a3f8d3c656831b5a62f_GL0.tar.gz) = 6932160 +TIMESTAMP = 1739878271 +SHA256 (xen-project-xen-93302bb88855c5f308f1e67ac2cd84271aa2d73a_GL0.tar.gz) = fb74e9c8b78a22d427507ee9ae52bdc9d78ee7c46dd58ae3d6d12670b6c6c2a8 +SIZE (xen-project-xen-93302bb88855c5f308f1e67ac2cd84271aa2d73a_GL0.tar.gz) = 6938735 diff --git a/sysutils/xen-tools/Makefile b/sysutils/xen-tools/Makefile index 5c4a15aafb60..75084bdc0e9a 100644 --- a/sysutils/xen-tools/Makefile +++ b/sysutils/xen-tools/Makefile @@ -1,108 +1,108 @@ PORTNAME= xen PKGNAMESUFFIX= -tools -DISTVERSION= 4.19.0.20241112 +DISTVERSION= 4.19.1.20250217 CATEGORIES= sysutils emulators USE_GITLAB= yes GL_ACCOUNT= xen-project -GL_TAGNAME= 251a9496485a86f302980a3f8d3c656831b5a62f +GL_TAGNAME= 93302bb88855c5f308f1e67ac2cd84271aa2d73a GL_TUPLE= qemu-project:qemu:v8.0.4:qemu \ qemu-project:dtc:b6910bec:dtc \ qemu-project:meson:3a9b285a:meson \ qemu-project:keycodemapdb:f5772a62:keycodemapdb \ qemu-project:berkeley-testfloat-3:40619cbb:testfloat \ qemu-project:berkeley-softfloat-3:b64af41c:softfloat MAINTAINER= royger@FreeBSD.org COMMENT= Xen Hypervisor management tools WWW= https://www.xenproject.org/ LICENSE= GPLv2 LGPL3 LICENSE_COMB= multi LIB_DEPENDS= libyajl.so:devel/yajl \ liblzo2.so:archivers/lzo2 \ libpixman-1.so:x11/pixman \ libargp.so:devel/argp-standalone BUILD_DEPENDS= seabios>0:misc/seabios \ ${LOCALBASE}/share/edk2-xen/XEN_X64_EFI.fd:sysutils/edk2@xen_x64 \ bash>0:shells/bash RUN_DEPENDS= seabios>0:misc/seabios \ ${LOCALBASE}/share/edk2-xen/XEN_X64_EFI.fd:sysutils/edk2@xen_x64 OPTIONS_DEFINE= DOCS SPICE OPTIONS_DEFAULT= DOCS OPTIONS_SUB= yes SPICE_DESC= Enable SPICE protocol for QEMU SPICE_CONFIGURE_WITH= extra-qemuu-configure-args="--enable-spice" SPICE_BUILD_DEPENDS= spice-protocol>=0.12.10:devel/spice-protocol SPICE_LIB_DEPENDS= libspice-server.so:devel/libspice-server ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= not yet ported to anything other than amd64 USES= cpe gettext gmake gnome libtool localbase:ldflags perl5 \ pkgconfig python shebangfix iconv bison ninja:build USE_GNOME= glib20 libxml2 USE_LDCONFIG= yes USE_PYTHON= py3kplist HAS_CONFIGURE= yes # Set ARCH=x86_64 in order to overwrite the environment ARCH=amd64 MAKE_ARGS= clang=y ARCH=x86_64 BINARY_ALIAS= python3=${PYTHON_CMD} CONFIGURE_ARGS+= --with-system-seabios=${LOCALBASE}/share/seabios/bios.bin \ --with-system-ovmf=${LOCALBASE}/share/edk2-xen/XEN_X64_EFI.fd \ --mandir=${PREFIX}/share/man \ --disable-golang SHEBANG_FILES= tools/misc/xencov_split \ tools/python/scripts/convert-legacy-stream \ tools/python/scripts/verify-stream-v2 \ tools/xenmon/xenmon.py ALL_TARGET= tools DOCS_ALL_TARGET= docs INSTALL_TARGET= install-tools DOCS_INSTALL_TARGET= install-docs .include .if ${OPSYS} != FreeBSD IGNORE= only supported on FreeBSD .endif post-extract: ${MV} ${WRKSRC_qemu} ${WRKSRC}/tools/qemu-xen ${RM} -rf ${WRKSRC}/tools/qemu-xen/dtc ${MV} ${WRKSRC_dtc} ${WRKSRC}/tools/qemu-xen/dtc ${RM} -rf ${WRKSRC}/tools/qemu-xen/meson ${MV} ${WRKSRC_meson} ${WRKSRC}/tools/qemu-xen/meson ${RM} -rf ${WRKSRC}/tools/qemu-xen/ui/keycodemapdb ${MV} ${WRKSRC_keycodemapdb} ${WRKSRC}/tools/qemu-xen/ui/keycodemapdb ${RM} -rf ${WRKSRC}/tools/qemu-xen/tests/fp/berkeley-testfloat-3 ${MV} ${WRKSRC_testfloat} ${WRKSRC}/tools/qemu-xen/tests/fp/berkeley-testfloat-3 ${RM} -rf ${WRKSRC}/tools/qemu-xen/tests/fp/berkeley-softfloat-3 ${MV} ${WRKSRC_softfloat} ${WRKSRC}/tools/qemu-xen/tests/fp/berkeley-softfloat-3 post-patch: @for p in `ls ${FILESDIR}/*qemuu*.patch 2>/dev/null`; do \ ${ECHO_CMD} "====> Applying $${p##*/}" ; \ ${PATCH} -s -p1 -i $${p} -d ${WRKSRC}/tools/qemu-xen ; \ done # The ports native 'build' target cannot be used because it sets CFLAGS, and # that breaks the Xen kernel build system that's used by the tools in order to # build the pv-shim. do-build: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${ALL_TARGET} do-install: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${INSTALL_TARGET} post-install: ${MKDIR} ${STAGEDIR}/var/run/xen .include diff --git a/sysutils/xen-tools/distinfo b/sysutils/xen-tools/distinfo index 480318d2449f..f8d2cd648c8b 100644 --- a/sysutils/xen-tools/distinfo +++ b/sysutils/xen-tools/distinfo @@ -1,15 +1,15 @@ -TIMESTAMP = 1731419084 -SHA256 (xen-project-xen-251a9496485a86f302980a3f8d3c656831b5a62f_GL0.tar.gz) = fc0f502af1741e0d5bf9b3ab8576c4874271c63a3ad79892b78cd244fab52f21 -SIZE (xen-project-xen-251a9496485a86f302980a3f8d3c656831b5a62f_GL0.tar.gz) = 6932160 +TIMESTAMP = 1739878294 +SHA256 (xen-project-xen-93302bb88855c5f308f1e67ac2cd84271aa2d73a_GL0.tar.gz) = fb74e9c8b78a22d427507ee9ae52bdc9d78ee7c46dd58ae3d6d12670b6c6c2a8 +SIZE (xen-project-xen-93302bb88855c5f308f1e67ac2cd84271aa2d73a_GL0.tar.gz) = 6938735 SHA256 (qemu-v8.0.4.tar.bz2) = 958eae6b32046bb512b5b968f66e896258fa8c4ec5c7fdf2d780fd206c677774 SIZE (qemu-v8.0.4.tar.bz2) = 31468222 SHA256 (dtc-b6910bec.tar.bz2) = f180420b105bdd35cfee9977d6ee2ee5d6601aa2a84693c048a985a604bd2c1c SIZE (dtc-b6910bec.tar.bz2) = 163044 SHA256 (meson-3a9b285a.tar.bz2) = 2ab212e390b5d5458cee0c0217160f9e390aa95cf366e7327876a1019aaf006b SIZE (meson-3a9b285a.tar.bz2) = 4054688 SHA256 (keycodemapdb-f5772a62.tar.bz2) = d349b02f0c95b5fb4bf8aa25d64395b04e8d5d98025c3e6e6ac8fe6f54005681 SIZE (keycodemapdb-f5772a62.tar.bz2) = 27905 SHA256 (berkeley-testfloat-3-40619cbb.tar.bz2) = 371e2a9c62ef020891bd03eef1a4caed3f34e9736732e6a11deb3acde6f9b07c SIZE (berkeley-testfloat-3-40619cbb.tar.bz2) = 90086 SHA256 (berkeley-softfloat-3-b64af41c.tar.bz2) = d56b54c557485f6126838391088e3a3d3d41c80d68099b0d90bcc09f533f2e9e SIZE (berkeley-softfloat-3-b64af41c.tar.bz2) = 83736 diff --git a/sysutils/xen-tools/files/qemuu-0001-hw-xen-Add-xs_node_read-helper-function.patch b/sysutils/xen-tools/files/qemuu-0001-hw-xen-Add-xs_node_read-helper-function.patch new file mode 100644 index 000000000000..81367e1bf544 --- /dev/null +++ b/sysutils/xen-tools/files/qemuu-0001-hw-xen-Add-xs_node_read-helper-function.patch @@ -0,0 +1,91 @@ +From db2e99cab015e03711542f8d97b6cd9654aa1b0a Mon Sep 17 00:00:00 2001 +From: David Woodhouse +Date: Fri, 10 Jan 2025 10:35:30 +0100 +Subject: [PATCH 1/2] hw/xen: Add xs_node_read() helper function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +This returns the full contents of the node, having created the node path +from the printf-style format string provided in its arguments. + +This will save various callers from having to do so for themselves (and +from using xs_node_scanf() with the non-portable %ms format string. + +Signed-off-by: David Woodhouse +[remove double newline and constify trace parameters] +Signed-off-by: Roger Pau Monné +Reviewed-by: Anthony PERARD +--- + hw/xen/trace-events | 1 + + hw/xen/xen-bus-helper.c | 22 ++++++++++++++++++++++ + include/hw/xen/xen-bus-helper.h | 9 +++++++++ + 3 files changed, 32 insertions(+) + +diff --git a/hw/xen/trace-events b/hw/xen/trace-events +index 55c9e1df680b..53df1b9ba968 100644 +--- a/hw/xen/trace-events ++++ b/hw/xen/trace-events +@@ -39,5 +39,6 @@ xs_node_create(const char *node) "%s" + xs_node_destroy(const char *node) "%s" + xs_node_vprintf(char *path, char *value) "%s %s" + xs_node_vscanf(char *path, char *value) "%s %s" ++xs_node_read(const char *path, const char *value) "%s %s" + xs_node_watch(char *path) "%s" + xs_node_unwatch(char *path) "%s" +diff --git a/hw/xen/xen-bus-helper.c b/hw/xen/xen-bus-helper.c +index b2b2cc9c5d5e..22fd2f6c1ac5 100644 +--- a/hw/xen/xen-bus-helper.c ++++ b/hw/xen/xen-bus-helper.c +@@ -142,6 +142,28 @@ int xs_node_scanf(struct qemu_xs_handle *h, xs_transaction_t tid, + return rc; + } + ++char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid, ++ unsigned int *len, Error **errp, ++ const char *path_fmt, ...) ++{ ++ char *path, *value; ++ va_list ap; ++ ++ va_start(ap, path_fmt); ++ path = g_strdup_vprintf(path_fmt, ap); ++ va_end(ap); ++ ++ value = qemu_xen_xs_read(h, tid, path, len); ++ trace_xs_node_read(path, value); ++ if (!value) { ++ error_setg_errno(errp, errno, "failed to read from '%s'", path); ++ } ++ ++ g_free(path); ++ ++ return value; ++} ++ + struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node, + const char *key, xs_watch_fn fn, + void *opaque, Error **errp) +diff --git a/include/hw/xen/xen-bus-helper.h b/include/hw/xen/xen-bus-helper.h +index d8dcc2f0107d..e9911115b326 100644 +--- a/include/hw/xen/xen-bus-helper.h ++++ b/include/hw/xen/xen-bus-helper.h +@@ -38,6 +38,15 @@ int xs_node_scanf(struct qemu_xs_handle *h, xs_transaction_t tid, + const char *fmt, ...) + G_GNUC_SCANF(6, 7); + ++/* ++ * Unlike other functions here, the printf-formatted path_fmt is for ++ * the XenStore path, not the contents of the node. ++ */ ++char *xs_node_read(struct qemu_xs_handle *h, xs_transaction_t tid, ++ unsigned int *len, Error **errp, ++ const char *path_fmt, ...) ++ G_GNUC_PRINTF(5, 6); ++ + /* Watch node/key unless node is empty, in which case watch key */ + struct qemu_xs_watch *xs_node_watch(struct qemu_xs_handle *h, const char *node, + const char *key, xs_watch_fn fn, +-- +2.46.0 + diff --git a/sysutils/xen-tools/files/qemuu-0002-xen-do-not-use-ms-scanf-specifier.patch b/sysutils/xen-tools/files/qemuu-0002-xen-do-not-use-ms-scanf-specifier.patch new file mode 100644 index 000000000000..2be76c0443ad --- /dev/null +++ b/sysutils/xen-tools/files/qemuu-0002-xen-do-not-use-ms-scanf-specifier.patch @@ -0,0 +1,88 @@ +From 677a577b625045c6d02210ac91ff452f54812513 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Fri, 10 Jan 2025 10:35:31 +0100 +Subject: [PATCH 2/2] xen: do not use '%ms' scanf specifier +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The 'm' parameter used to request auto-allocation of the destination variable +is not supported on FreeBSD, and as such leads to failures to parse. + +What's more, the current usage of '%ms' with xs_node_scanf() is pointless, as +it just leads to a double allocation of the same string. Instead use +xs_node_read() to read the whole xenstore node. + +Fixes: a783f8ad4ec9 ('xen: add a mechanism to automatically create XenDevice-s...') +Fixes: 9b7737469080 ('hw/xen: update Xen console to XenDevice model') +Signed-off-by: Roger Pau Monné +Signed-off-by: David Woodhouse +Reviewed-by: Anthony PERARD +--- + hw/block/xen-block.c | 4 ++-- + hw/xen/xen-bus.c | 14 ++++++++++++-- + include/hw/xen/xen-bus.h | 1 + + 3 files changed, 15 insertions(+), 4 deletions(-) + +diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c +index 6ccb8a4a3219..dc389578f454 100644 +--- a/hw/block/xen-block.c ++++ b/hw/block/xen-block.c +@@ -115,8 +115,8 @@ static void xen_block_connect(XenDevice *xendev, Error **errp) + return; + } + +- if (xen_device_frontend_scanf(xendev, "protocol", "%ms", +- &str) != 1) { ++ str = xen_device_frontend_read(xendev, "protocol"); ++ if (!str) { + protocol = BLKIF_PROTOCOL_NATIVE; + } else { + if (strcmp(str, XEN_IO_PROTO_ABI_X86_32) == 0) { +diff --git a/hw/xen/xen-bus.c b/hw/xen/xen-bus.c +index c59850b1dee7..8ff083167f47 100644 +--- a/hw/xen/xen-bus.c ++++ b/hw/xen/xen-bus.c +@@ -154,8 +154,8 @@ again: + !strcmp(key[i], "hotplug-status")) + continue; + +- if (xs_node_scanf(xenbus->xsh, tid, path, key[i], NULL, "%ms", +- &val) == 1) { ++ val = xs_node_read(xenbus->xsh, tid, NULL, NULL, "%s/%s", path, key[i]); ++ if (val) { + qdict_put_str(opts, key[i], val); + free(val); + } +@@ -644,6 +644,16 @@ int xen_device_frontend_scanf(XenDevice *xendev, const char *key, + return rc; + } + ++char *xen_device_frontend_read(XenDevice *xendev, const char *key) ++{ ++ XenBus *xenbus = XEN_BUS(qdev_get_parent_bus(DEVICE(xendev))); ++ ++ g_assert(xenbus->xsh); ++ ++ return xs_node_read(xenbus->xsh, XBT_NULL, NULL, NULL, "%s/%s", ++ xendev->frontend_path, key); ++} ++ + static void xen_device_frontend_set_state(XenDevice *xendev, + enum xenbus_state state, + bool publish) +diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h +index f43589816495..6bb199704440 100644 +--- a/include/hw/xen/xen-bus.h ++++ b/include/hw/xen/xen-bus.h +@@ -89,6 +89,7 @@ void xen_device_frontend_printf(XenDevice *xendev, const char *key, + int xen_device_frontend_scanf(XenDevice *xendev, const char *key, + const char *fmt, ...) + G_GNUC_SCANF(3, 4); ++char *xen_device_frontend_read(XenDevice *xendev, const char *key); + + void xen_device_set_max_grant_refs(XenDevice *xendev, unsigned int nr_refs, + Error **errp); +-- +2.46.0 +