Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump up XEN version to 4.18.0 #3534

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 1 addition & 8 deletions pkg/pillar/hypervisor/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,7 @@ const qemuConfTemplate = `# This file is automatically generated by domainmgr
[machine]
type = "{{.Machine}}"
dump-guest-core = "off"
{{- if .DomainStatus.CPUs }}
Copy link
Collaborator

@rene rene Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these being removed? I think it will affect the unit tests, so you need to update them as well (same for the realtime config).... the removal reason should also be explained in the commit message...

Edit: I see... you didn't port @OhmSpectator patches yet...

cpumask = "{{.DomainStatus.CPUs}}"
{{- end -}}
{{- if .DomainConfig.CPUsPinned }}
cpu-pin = "on"
{{- end -}}

{{- if eq .Machine "virt" }}
accel = "kvm:tcg"
gic-version = "host"
Expand Down Expand Up @@ -108,8 +103,6 @@ const qemuConfTemplate = `# This file is automatically generated by domainmgr
driver = "intel-iommu"
caching-mode = "on"
{{ end }}
[realtime]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to QEMU's documentation:

The -realtime mlock=on|off argument has been replaced by the -overcommit mem-lock=on|off argument.

Even if mem-lock=off is the default it can make sense to let this option explicit in the config... or at least explain the removal in your commit message

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Essentially, this option enables or disables mlock() call (https://www.man7.org/linux/man-pages/man2/mlock.2.html). This is probably workload-specific.

mlock = "off"

[chardev "charmonitor"]
backend = "socket"
Expand Down
16 changes: 8 additions & 8 deletions pkg/xen-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

FROM lfedge/eve-uefi:d821658883d6748d8bbf0d6640c62288e3ce8c6f as uefi-build

FROM lfedge/eve-alpine:0f4e313d0d84ac313ea35e966def9ef96f61aafb as runx-build
FROM lfedge/eve-alpine:58438ac39bd7aee086dfd969790fd1a5c44da8bd as runx-build
ENV BUILD_PKGS mkinitfs gcc musl-dev e2fsprogs chrony
RUN eve-alpine-deploy.sh

Expand All @@ -16,16 +16,16 @@ RUN gcc -s -o /chroot2 /tmp/chroot2.c
RUN gcc -s -o /hacf /tmp/hacf.c
RUN mkinitfs -n -F base -i /init-initrd -o /runx-initrd

FROM lfedge/eve-alpine:d32cf7889da970a42fdf5c1c5454a311356cb8f8 as build
FROM lfedge/eve-alpine:58438ac39bd7aee086dfd969790fd1a5c44da8bd as build
ENV BUILD_PKGS \
gcc make libc-dev dev86 xz-dev perl bash python3-dev \
gettext iasl util-linux-dev ncurses-dev glib-dev \
pixman-dev libaio-dev yajl-dev argp-standalone \
linux-headers git patch texinfo tar libcap-ng-dev \
attr-dev flex bison cmake libusb-dev zstd-dev
attr-dev flex bison cmake libusb-dev zstd-dev cmake python3 g++ samurai
ENV BUILD_PKGS_arm64 dtc-dev

ENV PKGS alpine-baselayout musl-utils bash libaio libbz2 glib pixman yajl keyutils libusb xz-libs libuuid sudo zstd-libs
ENV PKGS libgcc alpine-baselayout musl-utils bash libaio libbz2 glib pixman yajl keyutils libusb xz-libs libuuid sudo zstd-libs
ENV PKGS_arm64 libfdt

RUN eve-alpine-deploy.sh
Expand All @@ -36,7 +36,7 @@ WORKDIR /
COPY alpine.patch /
RUN patch -p1 < alpine.patch

ENV LIBURING_VERSION 0.7
ENV LIBURING_VERSION 2.4
ENV LIBURING_SOURCE=https://git.kernel.dk/cgit/liburing/snapshot/liburing-${LIBURING_VERSION}.tar.bz2

# Download and verify liburing
Expand All @@ -53,10 +53,10 @@ RUN rm -rf /out/usr/man
RUN strip /out/usr/lib/* || :

# When changing this version, also update SEABIOS_UPSTREAM_REVISION to whatever is in `Config.mk` in the xen source
ENV XEN_VERSION 4.15.0
ENV XEN_VERSION 4.18.0-rc4
ENV XEN_SOURCE=https://downloads.xenproject.org/release/xen/${XEN_VERSION}/xen-${XEN_VERSION}.tar.gz
ENV EXTRA_QEMUU_CONFIGURE_ARGS="--enable-libusb --enable-linux-aio \
--enable-vhost-net --enable-vhost-vsock --enable-vhost-scsi --enable-vhost-kernel \
--enable-vhost-net --enable-vhost-kernel \
--enable-vhost-user --enable-linux-io-uring --enable-zstd"

WORKDIR /
Expand All @@ -76,7 +76,7 @@ RUN cat /patches/*.patch /patches/"$(uname -m)"/*.patch | patch -p1
# Note that Xen's `configure` command uses this env variable SEABIOS_UPSTREAM_URL to find the seabios source.
ENV SEABIOS_UPSTREAM_URL /seabios.git
# this revision should be kept in sync with the XEN_VERSION by reading `Config.mk` in the xen source
ENV SEABIOS_UPSTREAM_REVISION rel-1.14.0
ENV SEABIOS_UPSTREAM_REVISION rel-1.16.2
ADD --keep-git-dir git://xenbits.xen.org/seabios.git#${SEABIOS_UPSTREAM_REVISION} ${SEABIOS_UPSTREAM_URL}
# we need this because it will complain about ambiguous refs
RUN git config --global core.warnambiguousrefs false
Expand Down
13 changes: 13 additions & 0 deletions pkg/xen-tools/patches-4.18.0-rc4/01-enable-gmp-patching.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/stubdom/Makefile b/stubdom/Makefile
index 8cf7131c6a..c6a8051c85 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -178,7 +178,7 @@ gmp-$(XEN_TARGET_ARCH): gmp-$(GMP_VERSION).tar.bz2 $(NEWLIB_STAMPFILE)
tar xjf $<
rm $@ -rf || :
mv gmp-$(GMP_VERSION) $@
- #patch -d $@ -p0 < gmp.patch
+ patch -d $@ -p0 < gmp.patch
cd $@; CPPFLAGS="-isystem $(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/include $(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" CC=$(CC) $(GMPEXT) ./configure --disable-shared --enable-static --disable-fft --without-readline --prefix=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf --libdir=$(CROSS_PREFIX)/$(GNU_TARGET_ARCH)-xen-elf/lib --build=`gcc -dumpmachine` --host=$(GNU_TARGET_ARCH)-xen-elf
sed -i 's/#define HAVE_OBSTACK_VPRINTF 1/\/\/#define HAVE_OBSTACK_VPRINTF 1/' $@/config.h
touch $@
19 changes: 19 additions & 0 deletions pkg/xen-tools/patches-4.18.0-rc4/09-enable-kvm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
--- a/tools/Makefile.orig
+++ b/tools/Makefile
@@ -232,7 +232,7 @@
virtfs='' ; \
fi ; \
PKG_CONFIG_PATH=$(XEN_ROOT)/tools/pkg-config$${PKG_CONFIG_PATH:+:$${PKG_CONFIG_PATH}} \
- $$source/configure --enable-xen --target-list=i386-softmmu \
+ $$source/configure --enable-xen --target-list=i386-softmmu,$$(uname -m)-softmmu \
$(QEMU_XEN_ENABLE_DEBUG) \
$$enable_trace_backend \
--prefix=$(prefix) \
@@ -251,7 +251,6 @@
--mandir=$(LIBEXEC)/share/man \
--libexecdir=$(LIBEXEC)/libexec \
--firmwarepath=$(LIBEXEC)/share/qemu-firmware \
- --disable-kvm \
--disable-docs \
--disable-guest-agent \
--python=$(PYTHON) \
4 changes: 2 additions & 2 deletions pkg/xen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ENV BUILD_PKGS_arm64 u-boot-tools
RUN eve-alpine-deploy.sh

ENV XEN_UBOOT_ADDR 0x81000000
ENV XEN_VERSION 4.15.0
ENV XEN_VERSION 4.18.0-rc4
ENV XEN_SOURCE=https://downloads.xenproject.org/release/xen/${XEN_VERSION}/xen-${XEN_VERSION}.tar.gz

# Download and verify xen
Expand All @@ -20,7 +20,7 @@ RUN [ -f "$(basename ${XEN_SOURCE})" ] || tar --absolute-names -xz < /xen.tar.gz
WORKDIR /xen/xen
COPY *.patch arch /tmp/
RUN cp /tmp/"$(uname -m)"/*.patch /tmp/
RUN for p in /tmp/*.patch ; do patch -p1 < "$p" || exit 1 ; done
#RUN for p in /tmp/*.patch ; do patch -p1 < "$p" || exit 1 ; done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we instead delete the content of the patch directories? Or will we need some of them?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need them, but it's just a temporary workaround to avoid applying the not-yet-ported patches.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(it should be converted to a draft PR)

RUN chmod +x scripts/* || :

RUN make defconfig && \
Expand Down