Skip to content

Commit

Permalink
Upgraded Xen-tools from 4.15 to 4.19.0
Browse files Browse the repository at this point in the history
    Able to add ninja through apk in xen-tools/Docker and xen/Docker (1)

    Changed the seabios and Xen version to 1.16.3 and 4.19.0 respectively (2)

    Added 12-remove-vanillaqemu4.19-cpupinning.patch which removes new qemu_thread_set_affinity implementation (QEMU 8.0.4), also retained
    Nikolay CPU Pinning PatchNo.15 (3)

    Warning treated as error flag is available by default so removed 12-disable-Werror-to-build-under-gcc-11.2.patch (4)

    NetdevTapOptions doesn't have has_br member so changed 10-bridge-helper-support.patch (5)

    Bydefault vhost-vsock and vhost-scsi is enabled so removing the corresponding enable flags from xen-tools/Dockerfile (6)

    Removed 11-char-socket-revert.patch as it's unnecessary (7)

    Removed [realtime] option from kvm.go and replaced it with [overcommit], hypervisor.go unit test need to be changed to reflect [overcommit] (8)

    Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch looked super messy, so cleaned it (9)

    Removed old directory patches-4.15.0 (10)

    Removed redundant patches under pkg/xen (11)

    Replaced [realtime] with [overcommit] in kvm_test.go for the unit test case to pass (12)

Signed-off-by: Roja Eswaran <roja@zededa.com>
  • Loading branch information
roja-zededa committed Sep 3, 2024
1 parent ad83884 commit cd04e97
Show file tree
Hide file tree
Showing 28 changed files with 460 additions and 636 deletions.
4 changes: 2 additions & 2 deletions pkg/pillar/hypervisor/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ const qemuConfTemplate = `# This file is automatically generated by domainmgr
driver = "intel-iommu"
caching-mode = "on"
{{ end }}
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down
36 changes: 18 additions & 18 deletions pkg/pillar/hypervisor/kvm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -416,8 +416,8 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -664,8 +664,8 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) {
append = "init=/bin/sh"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -1133,8 +1133,8 @@ func domConfigArm64() string {
append = "init=/bin/sh"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -1420,8 +1420,8 @@ func domConfigAmd64FML() string {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -1718,8 +1718,8 @@ func domConfigAmd64Legacy() string {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -2007,8 +2007,8 @@ func domConfigAmd64() string {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -2292,8 +2292,8 @@ func domConfigContainerVNC() string {
driver = "intel-iommu"
caching-mode = "on"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[chardev "charmonitor"]
backend = "socket"
Expand Down Expand Up @@ -2598,8 +2598,8 @@ func TestCreateDom(t *testing.T) {
property = "disable_s4"
value = "1"
[realtime]
mlock = "off"
[overcommit]
mem-lock = "off"
[rtc]
base = "localtime"
Expand Down
19 changes: 12 additions & 7 deletions pkg/xen-tools/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ ENV BUILD_PKGS \
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 \
python3 build-base ninja

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 alpine-baselayout libgcc 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 Down Expand Up @@ -57,11 +59,11 @@ 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.19.0
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-user --enable-linux-io-uring --enable-zstd"
--enable-vhost-net --enable-vhost-kernel \
--enable-vhost-user --enable-linux-io-uring --enable-zstd"

WORKDIR /

Expand All @@ -80,7 +82,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.3
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 All @@ -89,10 +91,13 @@ RUN mkdir -p /out

# FEATURES="--enable-stubdom --enable-vtpm-stubdom --enable-vtpmmgr-stubdom"
COPY gmp.patch /xen/stubdom

WORKDIR /xen

# disable golang as it does not play well together with musl (stderr is defined as FILE* const and fails to compile)
RUN ./configure --prefix=/usr --disable-xen --disable-golang --disable-qemu-traditional --disable-docs --enable-9pfs \
--with-system-ovmf=/usr/lib/xen/boot/ovmf.bin --disable-stubdom
--with-system-ovmf=/usr/lib/xen/boot/ovmf.bin --disable-stubdom \
--enable-vhost-vsock --enable-vhost-scsi
RUN make -j "$(getconf _NPROCESSORS_ONLN)" && make dist
RUN dist/install.sh /out

Expand Down
24 changes: 0 additions & 24 deletions pkg/xen-tools/patches-4.15.0/11-char-socket-revert.patch

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ index dac1b8ddb8..a368fe6ba0 100644
if (rc) return rc;

diff --git a/tools/xl/xl_utils.c b/tools/xl/xl_utils.c
index 4503ac7ea0..1f646c6400 100644
index b0d23b2..949d281 100644
--- a/tools/xl/xl_utils.c
+++ b/tools/xl/xl_utils.c
@@ -27,6 +27,8 @@
Expand All @@ -164,31 +164,30 @@ index 4503ac7ea0..1f646c6400 100644

+#include "../libs/light/xentoollog_external.h"
+
void dolog(const char *file, int line, const char *func, char *fmt, ...)
{
va_list ap;
@@ -264,14 +266,17 @@ int do_daemonize(char *name, const char *pidfile)
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
@@ -268,14 +270,16 @@ int do_daemonize(const char *name, const char *pidfile)

postfork();

- ret = libxl_create_logfile(ctx, name, &fullname);
- if (ret) {
- LOG("failed to open logfile %s: %s",fullname,strerror(errno));
- exit(-1);
- }
+ logfile = xtl_logger_create_external(name);
+ logfile = xtl_logger_create_external((char *)name);
+ if (logfile < 0) {
+ ret = libxl_create_logfile(ctx, name, &fullname);
+ if (ret) {
+ LOG("failed to open logfile %s: %s",fullname,strerror(errno));
+ exit(-1);
+ }

- CHK_SYSCALL(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
+ ret = libxl_create_logfile(ctx, name, &fullname);
+ if (ret) {
+ LOG("failed to open logfile %s: %s",fullname,strerror(errno));
+ exit(-1);
+ }
+ CHK_SYSCALL(logfile = open(fullname, O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC, 0644));
+ free(fullname);
}
-
- CHK_SYSCALL(logfile = open(fullname, O_WRONLY | O_CREAT | O_APPEND | O_CLOEXEC, 0644));
- free(fullname);
+ CHK_SYSCALL(logfile = open(fullname, O_WRONLY|O_CREAT|O_APPEND, 0644));
+ free(fullname);
+ }
assert(logfile >= 3);

CHK_SYSCALL(nullfd = open("/dev/null", O_RDONLY));
CHK_SYSCALL(nullfd = open("/dev/null", O_RDONLY));
Loading

0 comments on commit cd04e97

Please sign in to comment.