From fa0e360a8e1cf1b0a4d0b0716ec1d9af9b40eedf Mon Sep 17 00:00:00 2001 From: Roja Eswaran Date: Tue, 10 Sep 2024 12:16:06 -0700 Subject: [PATCH] Fix: Upgrading xentools to 4.19.0 Upgraded xen/Dockerfile and xen-tools/Dockerfile to point new version (1) Removed unused patches No. 11,12,15,16,0001,0003 (2) Upgraded xen/Dockerfile to include the patches under xen/arch (3) Adding new patch No. 12 to retain default qemu_thread_set_affinity for cpu-pinning (4) Replacing [realtime] with [overcommit] for kvm.go and kvm_test.go (5) Included utilities required for xen (6) Signed-off-by: Roja Eswaran --- pkg/pillar/hypervisor/kvm.go | 4 +- pkg/pillar/hypervisor/kvm_test.go | 36 ++-- pkg/xen-tools/Dockerfile | 23 +- .../11-char-socket-revert.patch | 24 --- ...sable-Werror-to-build-under-gcc-11.2.patch | 26 --- ...d_of_pointer_when_using_build_header.patch | 132 ------------ .../00-musl-support.patch | 0 .../01-enable-gmp-patching.patch | 0 .../04-disable-vif-allow-all-iptables.patch | 0 .../08-memlogd-logger.patch | 35 ++-- .../09-enable-kvm.patch | 0 .../10-bridge-helper-support.patch | 36 ++-- ...12-remove-vanillaqemu4.19-cpupinning.patch | 197 ++++++++++++++++++ ...qemu-Add-cpu-pin-and-cpumask-options.patch | 23 +- .../14-qemu-Init-CPU-mask-per-VCPU.patch | 85 +++++--- ...inity-of-QEMU-threads-according-to-t.patch | 0 .../x86_64/05-xen-spoofing.patch | 53 ++--- .../x86_64/07-patch-seabios.patch | 6 +- ...Disable_stolen_memory_for_igd_VFIO__.patch | 0 .../x86_64/patch.seabios | 0 ...sable-Werror-to-build-under-gcc-11.2.patch | 26 --- pkg/xen/Dockerfile | 5 +- .../aarch64/0002-arm-efi-mem-detection.patch | 28 +-- ...003-arch-arm-small-hack-for-rpi4-usb.patch | 32 --- pkg/xen/arch/aarch64/0005-smbios.patch | 46 ++-- .../0001-gettime-considered-harmful.patch | 20 +- pkg/xen/arch/x86_64/0002-xen-spoofing.patch | 98 +++++---- 27 files changed, 465 insertions(+), 470 deletions(-) delete mode 100644 pkg/xen-tools/patches-4.15.0/11-char-socket-revert.patch delete mode 100644 pkg/xen-tools/patches-4.15.0/12-disable-Werror-to-build-under-gcc-11.2.patch delete mode 100644 pkg/xen-tools/patches-4.15.0/16-imammedo_x86_acpi_use_offset_instead_of_pointer_when_using_build_header.patch rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/00-musl-support.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/01-enable-gmp-patching.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/04-disable-vif-allow-all-iptables.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/08-memlogd-logger.patch (87%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/09-enable-kvm.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/10-bridge-helper-support.patch (61%) create mode 100644 pkg/xen-tools/patches-4.19.0/12-remove-vanillaqemu4.19-cpupinning.patch rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/13-qemu-Add-cpu-pin-and-cpumask-options.patch (89%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/14-qemu-Init-CPU-mask-per-VCPU.patch (76%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/15-qemu-Set-the-affinity-of-QEMU-threads-according-to-t.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/x86_64/05-xen-spoofing.patch (89%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/x86_64/07-patch-seabios.patch (68%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/x86_64/08-Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch (100%) rename pkg/xen-tools/{patches-4.15.0 => patches-4.19.0}/x86_64/patch.seabios (100%) delete mode 100644 pkg/xen/0001-disable-Werror-to-build-under-gcc-11.2.patch delete mode 100644 pkg/xen/arch/aarch64/0003-arch-arm-small-hack-for-rpi4-usb.patch diff --git a/pkg/pillar/hypervisor/kvm.go b/pkg/pillar/hypervisor/kvm.go index 6b5332ca6d..093acc3f0b 100644 --- a/pkg/pillar/hypervisor/kvm.go +++ b/pkg/pillar/hypervisor/kvm.go @@ -123,8 +123,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" diff --git a/pkg/pillar/hypervisor/kvm_test.go b/pkg/pillar/hypervisor/kvm_test.go index ee873c9a67..cfd289a95c 100644 --- a/pkg/pillar/hypervisor/kvm_test.go +++ b/pkg/pillar/hypervisor/kvm_test.go @@ -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" @@ -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" @@ -664,8 +664,8 @@ func TestCreateDomConfigOnlyCom1(t *testing.T) { append = "init=/bin/sh" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -1133,8 +1133,8 @@ func domConfigArm64() string { append = "init=/bin/sh" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -1420,8 +1420,8 @@ func domConfigAmd64FML() string { driver = "intel-iommu" caching-mode = "on" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -1718,8 +1718,8 @@ func domConfigAmd64Legacy() string { driver = "intel-iommu" caching-mode = "on" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -2007,8 +2007,8 @@ func domConfigAmd64() string { driver = "intel-iommu" caching-mode = "on" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -2292,8 +2292,8 @@ func domConfigContainerVNC() string { driver = "intel-iommu" caching-mode = "on" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [chardev "charmonitor"] backend = "socket" @@ -2598,8 +2598,8 @@ func TestCreateDom(t *testing.T) { property = "disable_s4" value = "1" -[realtime] - mlock = "off" +[overcommit] + mem-lock = "off" [rtc] base = "localtime" diff --git a/pkg/xen-tools/Dockerfile b/pkg/xen-tools/Dockerfile index e9f0284509..058e55bf8d 100644 --- a/pkg/xen-tools/Dockerfile +++ b/pkg/xen-tools/Dockerfile @@ -5,7 +5,7 @@ FROM lfedge/eve-uefi:d821658883d6748d8bbf0d6640c62288e3ce8c6f as uefi-build -FROM lfedge/eve-alpine:82df60e43ab9f8c935584b8c7b4d0a4b0271d608 as runx-build +FROM lfedge/eve-alpine:1f7685f95a475c6bbe682f0b976f12180b6c8726 as runx-build ENV BUILD_PKGS mkinitfs gcc musl-dev e2fsprogs chrony agetty RUN eve-alpine-deploy.sh @@ -20,16 +20,18 @@ RUN gcc -s -o /chroot2 /tmp/chroot2.c -Wall -Werror RUN gcc -s -o /hacf /tmp/hacf.c -Wall -Werror RUN mkinitfs -n -F base -i /init-initrd -o /runx-initrd -FROM lfedge/eve-alpine:82df60e43ab9f8c935584b8c7b4d0a4b0271d608 as build +FROM lfedge/eve-alpine:1f7685f95a475c6bbe682f0b976f12180b6c8726 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 \ + 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 bash musl-utils libaio libbz2 glib pixman yajl keyutils libusb xz-libs libuuid zstd-libs util-linux-misc ENV PKGS_arm64 libfdt RUN eve-alpine-deploy.sh @@ -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 / @@ -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 @@ -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 diff --git a/pkg/xen-tools/patches-4.15.0/11-char-socket-revert.patch b/pkg/xen-tools/patches-4.15.0/11-char-socket-revert.patch deleted file mode 100644 index 91d6aece9b..0000000000 --- a/pkg/xen-tools/patches-4.15.0/11-char-socket-revert.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/tools/qemu-xen/chardev/char-socket.c b/tools/qemu-xen/chardev/char-socket.c -index ef62dbf..7ad180e 100644 ---- a/tools/qemu-xen/chardev/char-socket.c -+++ b/tools/qemu-xen/chardev/char-socket.c -@@ -177,16 +177,15 @@ static int tcp_chr_write(Chardev *chr, const uint8_t *buf, int len) - - if (ret < 0 && errno != EAGAIN) { - if (tcp_chr_read_poll(chr) <= 0) { -- /* Perform disconnect and return error. */ - tcp_chr_disconnect_locked(chr); -+ return len; - } /* else let the read handler finish it properly */ - } - - return ret; - } else { -- /* Indicate an error. */ -- errno = EIO; -- return -1; -+ /* XXX: indicate an error ? */ -+ return len; - } - } - diff --git a/pkg/xen-tools/patches-4.15.0/12-disable-Werror-to-build-under-gcc-11.2.patch b/pkg/xen-tools/patches-4.15.0/12-disable-Werror-to-build-under-gcc-11.2.patch deleted file mode 100644 index 3e1178308c..0000000000 --- a/pkg/xen-tools/patches-4.15.0/12-disable-Werror-to-build-under-gcc-11.2.patch +++ /dev/null @@ -1,26 +0,0 @@ -From d3b8b8369c5d48d88ea9ec024cf2988833e1ccaa Mon Sep 17 00:00:00 2001 -From: Petr Fedchenkov -Date: Tue, 16 Aug 2022 15:53:35 +0300 -Subject: [PATCH] disable Werror to build under gcc 11.2 - -Signed-off-by: Petr Fedchenkov ---- - tools/libs/libs.mk | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk -index 2d973ccb95..fe85eeef22 100644 ---- a/tools/libs/libs.mk -+++ b/tools/libs/libs.mk -@@ -11,7 +11,7 @@ MINOR ?= 0 - - SHLIB_LDFLAGS += -Wl,--version-script=libxen$(LIBNAME).map - --CFLAGS += -Werror -Wmissing-prototypes -+CFLAGS += -Wmissing-prototypes - CFLAGS += -I./include $(CFLAGS_xeninclude) - CFLAGS += $(foreach lib, $(USELIBS_$(LIBNAME)), $(CFLAGS_libxen$(lib))) - --- -2.34.1 - diff --git a/pkg/xen-tools/patches-4.15.0/16-imammedo_x86_acpi_use_offset_instead_of_pointer_when_using_build_header.patch b/pkg/xen-tools/patches-4.15.0/16-imammedo_x86_acpi_use_offset_instead_of_pointer_when_using_build_header.patch deleted file mode 100644 index 1ef4201de1..0000000000 --- a/pkg/xen-tools/patches-4.15.0/16-imammedo_x86_acpi_use_offset_instead_of_pointer_when_using_build_header.patch +++ /dev/null @@ -1,132 +0,0 @@ -From git@z Thu Jan 1 00:00:00 1970 -Subject: [PATCH] x86: acpi: use offset instead of pointer when using - build_header() -From: Igor Mammedov -Date: Tue, 13 Apr 2021 07:14:00 -0400 -Message-Id: <20210413111400.3778820-1-imammedo@redhat.com> -MIME-Version: 1.0 -Content-Type: text/plain; charset="utf-8" -Content-Transfer-Encoding: 7bit - -Do the same as in commit - (4d027afeb3a97 Virt: ACPI: fix qemu assert due to re-assigned table data address) -for remaining tables that happen to use saved at -the beginning pointer to build header to avoid assert -when table_data is relocated due to implicit re-size. - -Reported-in: https://bugs.launchpad.net/bugs/1923497 -Signed-off-by: Igor Mammedov -Buglink: https://bugs.launchpad.net/qemu/+bug/1921138 -Acked-by: Michael S. Tsirkin -Fixes: 243bdb79fb0b2ed hw/arm/virt-acpi-build: Generate RSDT table -Fixes: cb51ac2ffe3649e hw/arm/virt: generate 64-bit addressable ACPI objects -Fixes: 4338416064303aa acpi: Move build_tpm2() in the generic part -Fixes: 72c194f7e75cb64 i386: ACPI table generation code from seabios -Fixes: 711b20b479aa96e Add ACPI tables for TPM ---- -PS: - I have build_header() refactoring patch that requires offset - instead of pointer, to make it harder to misuse but it's - a bit intrusive for last minute fixes. So here goes simplified - variant, and I'll post refactoring patch for 6.1. later. ---- -diff --git a/tools/qemu-xen/hw/acpi/aml-build.c b/tools/qemu-xen/hw/acpi/aml-build.c -index f6fbc9b..7215573 100644 ---- a/tools/qemu-xen/hw/acpi/aml-build.c -+++ b/tools/qemu-xen/hw/acpi/aml-build.c -@@ -1669,6 +1669,7 @@ build_rsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, - int i; - unsigned rsdt_entries_offset; - AcpiRsdtDescriptorRev1 *rsdt; -+ int rsdt_start = table_data->len; - const unsigned table_data_len = (sizeof(uint32_t) * table_offsets->len); - const unsigned rsdt_entry_size = sizeof(rsdt->table_offset_entry[0]); - const size_t rsdt_len = sizeof(*rsdt) + table_data_len; -@@ -1685,7 +1686,8 @@ build_rsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, - ACPI_BUILD_TABLE_FILE, ref_tbl_offset); - } - build_header(linker, table_data, -- (void *)rsdt, "RSDT", rsdt_len, 1, oem_id, oem_table_id); -+ (void *)(table_data->data + rsdt_start), -+ "RSDT", rsdt_len, 1, oem_id, oem_table_id); - } - - /* Build xsdt table */ -@@ -1696,6 +1698,7 @@ build_xsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, - int i; - unsigned xsdt_entries_offset; - AcpiXsdtDescriptorRev2 *xsdt; -+ int xsdt_start = table_data->len; - const unsigned table_data_len = (sizeof(uint64_t) * table_offsets->len); - const unsigned xsdt_entry_size = sizeof(xsdt->table_offset_entry[0]); - const size_t xsdt_len = sizeof(*xsdt) + table_data_len; -@@ -1712,7 +1715,8 @@ build_xsdt(GArray *table_data, BIOSLinker *linker, GArray *table_offsets, - ACPI_BUILD_TABLE_FILE, ref_tbl_offset); - } - build_header(linker, table_data, -- (void *)xsdt, "XSDT", xsdt_len, 1, oem_id, oem_table_id); -+ (void *)(table_data->data + xsdt_start), -+ "XSDT", xsdt_len, 1, oem_id, oem_table_id); - } - - void build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, -@@ -1890,10 +1894,9 @@ void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) - uint64_t control_area_start_address; - TPMIf *tpmif = tpm_find(); - uint32_t start_method; -- void *tpm2_ptr; - - tpm2_start = table_data->len; -- tpm2_ptr = acpi_data_push(table_data, sizeof(AcpiTableHeader)); -+ acpi_data_push(table_data, sizeof(AcpiTableHeader)); - - /* Platform Class */ - build_append_int_noprefix(table_data, TPM2_ACPI_CLASS_CLIENT, 2); -@@ -1932,7 +1935,8 @@ void build_tpm2(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) - log_addr_offset, 8, - ACPI_BUILD_TPMLOG_FILE, 0); - build_header(linker, table_data, -- tpm2_ptr, "TPM2", table_data->len - tpm2_start, 4, NULL, NULL); -+ (void *)(table_data->data + tpm2_start), -+ "TPM2", table_data->len - tpm2_start, 4, NULL, NULL); - } - - /* ACPI 5.0: 6.4.3.8.2 Serial Bus Connection Descriptors */ -diff --git a/tools/qemu-xen/hw/i386/acpi-build.c b/tools/qemu-xen/hw/i386/acpi-build.c -index b7bcbbb..7ff5435 100644 ---- a/tools/qemu-xen/hw/i386/acpi-build.c -+++ b/tools/qemu-xen/hw/i386/acpi-build.c -@@ -1881,6 +1881,7 @@ static void - build_hpet(GArray *table_data, BIOSLinker *linker) - { - Acpi20Hpet *hpet; -+ int hpet_start = table_data->len; - - hpet = acpi_data_push(table_data, sizeof(*hpet)); - /* Note timer_block_id value must be kept in sync with value advertised by -@@ -1889,12 +1890,14 @@ build_hpet(GArray *table_data, BIOSLinker *linker) - hpet->timer_block_id = cpu_to_le32(0x8086a201); - hpet->addr.address = cpu_to_le64(HPET_BASE); - build_header(linker, table_data, -- (void *)hpet, "HPET", sizeof(*hpet), 1, NULL, NULL); -+ (void *)(table_data->data + hpet_start), -+ "HPET", sizeof(*hpet), 1, NULL, NULL); - } - - static void - build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) - { -+ int tcpa_start = table_data->len; - Acpi20Tcpa *tcpa = acpi_data_push(table_data, sizeof *tcpa); - unsigned log_addr_size = sizeof(tcpa->log_area_start_address); - unsigned log_addr_offset = -@@ -1913,7 +1916,8 @@ build_tpm_tcpa(GArray *table_data, BIOSLinker *linker, GArray *tcpalog) - ACPI_BUILD_TPMLOG_FILE, 0); - - build_header(linker, table_data, -- (void *)tcpa, "TCPA", sizeof(*tcpa), 2, NULL, NULL); -+ (void *)(table_data->data + tcpa_start), -+ "TCPA", sizeof(*tcpa), 2, NULL, NULL); - } - - #define HOLE_640K_START (640 * KiB) diff --git a/pkg/xen-tools/patches-4.15.0/00-musl-support.patch b/pkg/xen-tools/patches-4.19.0/00-musl-support.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/00-musl-support.patch rename to pkg/xen-tools/patches-4.19.0/00-musl-support.patch diff --git a/pkg/xen-tools/patches-4.15.0/01-enable-gmp-patching.patch b/pkg/xen-tools/patches-4.19.0/01-enable-gmp-patching.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/01-enable-gmp-patching.patch rename to pkg/xen-tools/patches-4.19.0/01-enable-gmp-patching.patch diff --git a/pkg/xen-tools/patches-4.15.0/04-disable-vif-allow-all-iptables.patch b/pkg/xen-tools/patches-4.19.0/04-disable-vif-allow-all-iptables.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/04-disable-vif-allow-all-iptables.patch rename to pkg/xen-tools/patches-4.19.0/04-disable-vif-allow-all-iptables.patch diff --git a/pkg/xen-tools/patches-4.15.0/08-memlogd-logger.patch b/pkg/xen-tools/patches-4.19.0/08-memlogd-logger.patch similarity index 87% rename from pkg/xen-tools/patches-4.15.0/08-memlogd-logger.patch rename to pkg/xen-tools/patches-4.19.0/08-memlogd-logger.patch index e9b747a161..8ac956aaaf 100644 --- a/pkg/xen-tools/patches-4.15.0/08-memlogd-logger.patch +++ b/pkg/xen-tools/patches-4.19.0/08-memlogd-logger.patch @@ -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 @@ @@ -164,10 +164,10 @@ 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(); @@ -175,20 +175,19 @@ index 4503ac7ea0..1f646c6400 100644 - 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)); \ No newline at end of file diff --git a/pkg/xen-tools/patches-4.15.0/09-enable-kvm.patch b/pkg/xen-tools/patches-4.19.0/09-enable-kvm.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/09-enable-kvm.patch rename to pkg/xen-tools/patches-4.19.0/09-enable-kvm.patch diff --git a/pkg/xen-tools/patches-4.15.0/10-bridge-helper-support.patch b/pkg/xen-tools/patches-4.19.0/10-bridge-helper-support.patch similarity index 61% rename from pkg/xen-tools/patches-4.15.0/10-bridge-helper-support.patch rename to pkg/xen-tools/patches-4.19.0/10-bridge-helper-support.patch index a81de45748..302ed2d917 100644 --- a/pkg/xen-tools/patches-4.15.0/10-bridge-helper-support.patch +++ b/pkg/xen-tools/patches-4.19.0/10-bridge-helper-support.patch @@ -1,6 +1,8 @@ +diff --git a/tools/qemu-xen/net/tap.c b/tools/qemu-xen/net/tap.c +index 1bf085d..1887c4a 100644 --- a/tools/qemu-xen/net/tap.c +++ b/tools/qemu-xen/net/tap.c -@@ -62,7 +62,7 @@ +@@ -63,7 +63,7 @@ typedef struct TAPState { Notifier exit; } TAPState; @@ -9,7 +11,7 @@ int fd, Error **errp); static void tap_send(void *opaque); -@@ -300,7 +300,7 @@ +@@ -323,7 +323,7 @@ static void tap_exit_notify(Notifier *notifier, void *data) Error *err = NULL; if (s->down_script[0]) { @@ -18,7 +20,7 @@ if (err) { error_report_err(err); } -@@ -397,7 +397,7 @@ +@@ -431,7 +431,7 @@ static TAPState *net_tap_fd_init(NetClientState *peer, return s; } @@ -27,7 +29,7 @@ int fd, Error **errp) { int pid, status; -@@ -422,6 +422,7 @@ +@@ -456,6 +456,7 @@ static void launch_script(const char *setup_script, const char *ifname, parg = args; *parg++ = (char *)setup_script; *parg++ = (char *)ifname; @@ -35,16 +37,18 @@ *parg = NULL; execv(setup_script, args); _exit(1); -@@ -607,7 +608,7 @@ +@@ -648,8 +649,8 @@ int net_init_bridge(const Netdev *netdev, const char *name, + } static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr, - const char *setup_script, char *ifname, +- const char *setup_script, char *ifname, - size_t ifname_sz, int mq_required, Error **errp) ++ const char *setup_script, char *ifname, + size_t ifname_sz, const char *bridge, int mq_required, Error **errp) { Error *err = NULL; int fd, vnet_hdr_required; -@@ -629,7 +630,7 @@ +@@ -671,7 +672,7 @@ static int net_tap_init(const NetdevTapOptions *tap, int *vnet_hdr, if (setup_script && setup_script[0] != '\0' && strcmp(setup_script, "no") != 0) { @@ -53,14 +57,20 @@ if (err) { error_propagate(errp, err); close(fd); -@@ -918,7 +919,9 @@ - +@@ -1003,8 +1004,14 @@ free_fail: + } + for (i = 0; i < queues; i++) { - fd = net_tap_init(tap, &vnet_hdr, i >= 1 ? "no" : script, +- fd = net_tap_init(tap, &vnet_hdr, i >= 1 ? "no" : script, - ifname, sizeof ifname, queues > 1, errp); -+ ifname, sizeof ifname, -+ tap->has_br ? tap->br : "bn1", -+ queues > 1, errp); ++ ++ if(tap->br == NULL) ++ fd = net_tap_init(tap, &vnet_hdr, i >= 1 ? "no" : script, ++ ifname, sizeof ifname, "bn1" , queues > 1, errp); ++ else ++ fd = net_tap_init(tap, &vnet_hdr, i >= 1 ? "no" : script, ++ ifname, sizeof ifname, tap->br , queues > 1, errp); ++ if (fd == -1) { return -1; } diff --git a/pkg/xen-tools/patches-4.19.0/12-remove-vanillaqemu4.19-cpupinning.patch b/pkg/xen-tools/patches-4.19.0/12-remove-vanillaqemu4.19-cpupinning.patch new file mode 100644 index 0000000000..695751ad26 --- /dev/null +++ b/pkg/xen-tools/patches-4.19.0/12-remove-vanillaqemu4.19-cpupinning.patch @@ -0,0 +1,197 @@ +diff --git a/tools/qemu-xen/include/qemu/thread.h b/tools/qemu-xen/include/qemu/thread.h +index dd3822d..a5b9ca8 100644 +--- a/tools/qemu-xen/include/qemu/thread.h ++++ b/tools/qemu-xen/include/qemu/thread.h +@@ -189,10 +189,6 @@ void qemu_event_destroy(QemuEvent *ev); + void qemu_thread_create(QemuThread *thread, const char *name, + void *(*start_routine)(void *), + void *arg, int mode); +-int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, +- unsigned long nbits); +-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, +- unsigned long *nbits); + void *qemu_thread_join(QemuThread *thread); + void qemu_thread_get_self(QemuThread *thread); + bool qemu_thread_is_self(QemuThread *thread); +diff --git a/tools/qemu-xen/util/qemu-thread-posix.c b/tools/qemu-xen/util/qemu-thread-posix.c +index b2e26e2..0a563ba 100644 +--- a/tools/qemu-xen/util/qemu-thread-posix.c ++++ b/tools/qemu-xen/util/qemu-thread-posix.c +@@ -589,75 +589,6 @@ void qemu_thread_create(QemuThread *thread, const char *name, + pthread_attr_destroy(&attr); + } + +-int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, +- unsigned long nbits) +-{ +-#if defined(CONFIG_PTHREAD_AFFINITY_NP) +- const size_t setsize = CPU_ALLOC_SIZE(nbits); +- unsigned long value; +- cpu_set_t *cpuset; +- int err; +- +- cpuset = CPU_ALLOC(nbits); +- g_assert(cpuset); +- +- CPU_ZERO_S(setsize, cpuset); +- value = find_first_bit(host_cpus, nbits); +- while (value < nbits) { +- CPU_SET_S(value, setsize, cpuset); +- value = find_next_bit(host_cpus, nbits, value + 1); +- } +- +- err = pthread_setaffinity_np(thread->thread, setsize, cpuset); +- CPU_FREE(cpuset); +- return err; +-#else +- return -ENOSYS; +-#endif +-} +- +-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, +- unsigned long *nbits) +-{ +-#if defined(CONFIG_PTHREAD_AFFINITY_NP) +- unsigned long tmpbits; +- cpu_set_t *cpuset; +- size_t setsize; +- int i, err; +- +- tmpbits = CPU_SETSIZE; +- while (true) { +- setsize = CPU_ALLOC_SIZE(tmpbits); +- cpuset = CPU_ALLOC(tmpbits); +- g_assert(cpuset); +- +- err = pthread_getaffinity_np(thread->thread, setsize, cpuset); +- if (err) { +- CPU_FREE(cpuset); +- if (err != -EINVAL) { +- return err; +- } +- tmpbits *= 2; +- } else { +- break; +- } +- } +- +- /* Convert the result into a proper bitmap. */ +- *nbits = tmpbits; +- *host_cpus = bitmap_new(tmpbits); +- for (i = 0; i < tmpbits; i++) { +- if (CPU_ISSET(i, cpuset)) { +- set_bit(i, *host_cpus); +- } +- } +- CPU_FREE(cpuset); +- return 0; +-#else +- return -ENOSYS; +-#endif +-} +- + void qemu_thread_get_self(QemuThread *thread) + { + thread->thread = pthread_self(); +diff --git a/tools/qemu-xen/util/qemu-thread-win32.c b/tools/qemu-xen/util/qemu-thread-win32.c +index a7fe3cc..2c02a1b 100644 +--- a/tools/qemu-xen/util/qemu-thread-win32.c ++++ b/tools/qemu-xen/util/qemu-thread-win32.c +@@ -507,18 +507,6 @@ void qemu_thread_create(QemuThread *thread, const char *name, + thread->data = data; + } + +-int qemu_thread_set_affinity(QemuThread *thread, unsigned long *host_cpus, +- unsigned long nbits) +-{ +- return -ENOSYS; +-} +- +-int qemu_thread_get_affinity(QemuThread *thread, unsigned long **host_cpus, +- unsigned long *nbits) +-{ +- return -ENOSYS; +-} +- + void qemu_thread_get_self(QemuThread *thread) + { + thread->data = qemu_thread_data; +diff --git a/tools/qemu-xen/util/thread-context.c b/tools/qemu-xen/util/thread-context.c +index 2bc7883..ba443f5 100644 +--- a/tools/qemu-xen/util/thread-context.c ++++ b/tools/qemu-xen/util/thread-context.c +@@ -113,21 +113,7 @@ static void thread_context_set_cpu_affinity(Object *obj, Visitor *v, + set_bit(l->value, bitmap); + } + +- if (tc->thread_id != -1) { +- /* +- * Note: we won't be adjusting the affinity of any thread that is still +- * around, but only the affinity of the context thread. +- */ +- ret = qemu_thread_set_affinity(&tc->thread, bitmap, nbits); +- if (ret) { +- error_setg(errp, "Setting CPU affinity failed: %s", strerror(ret)); +- } +- } else { +- tc->init_cpu_bitmap = bitmap; +- bitmap = NULL; +- tc->init_cpu_nbits = nbits; +- } +-out: ++ out: + g_free(bitmap); + qapi_free_uint16List(host_cpus); + } +@@ -147,12 +133,6 @@ static void thread_context_get_cpu_affinity(Object *obj, Visitor *v, + return; + } + +- ret = qemu_thread_get_affinity(&tc->thread, &bitmap, &nbits); +- if (ret) { +- error_setg(errp, "Getting CPU affinity failed: %s", strerror(ret)); +- return; +- } +- + value = find_first_bit(bitmap, nbits); + while (value < nbits) { + QAPI_LIST_APPEND(tail, value); +@@ -213,21 +193,7 @@ static void thread_context_set_node_affinity(Object *obj, Visitor *v, + goto out; + } + +- if (tc->thread_id != -1) { +- /* +- * Note: we won't be adjusting the affinity of any thread that is still +- * around for now, but only the affinity of the context thread. +- */ +- ret = qemu_thread_set_affinity(&tc->thread, bitmap, nbits); +- if (ret) { +- error_setg(errp, "Setting CPU affinity failed: %s", strerror(ret)); +- } +- } else { +- tc->init_cpu_bitmap = bitmap; +- bitmap = NULL; +- tc->init_cpu_nbits = nbits; +- } +-out: ++ out: + g_free(bitmap); + qapi_free_uint16List(host_nodes); + #else +@@ -262,15 +228,6 @@ static void thread_context_instance_complete(UserCreatable *uc, Error **errp) + qemu_sem_wait(&tc->sem); + } + +- if (tc->init_cpu_bitmap) { +- ret = qemu_thread_set_affinity(&tc->thread, tc->init_cpu_bitmap, +- tc->init_cpu_nbits); +- if (ret) { +- error_setg(errp, "Setting CPU affinity failed: %s", strerror(ret)); +- } +- g_free(tc->init_cpu_bitmap); +- tc->init_cpu_bitmap = NULL; +- } + } + + static void thread_context_class_init(ObjectClass *oc, void *data) diff --git a/pkg/xen-tools/patches-4.15.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch b/pkg/xen-tools/patches-4.19.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch similarity index 89% rename from pkg/xen-tools/patches-4.15.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch rename to pkg/xen-tools/patches-4.19.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch index 5fd8fd81e1..0c77f63167 100644 --- a/pkg/xen-tools/patches-4.15.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch +++ b/pkg/xen-tools/patches-4.19.0/13-qemu-Add-cpu-pin-and-cpumask-options.patch @@ -123,26 +123,27 @@ index 708583b..a33ee1e 100644 "-k language use keyboard layout (for example 'fr' for French)\n", QEMU_ARCH_ALL) diff --git a/tools/qemu-xen/softmmu/vl.c b/tools/qemu-xen/softmmu/vl.c -index 4eb9d1f..c7c8abc 100644 +index ea20b23..59ff7c7 100644 --- a/tools/qemu-xen/softmmu/vl.c +++ b/tools/qemu-xen/softmmu/vl.c -@@ -2868,6 +2868,7 @@ void qemu_init(int argc, char **argv, char **envp) - BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); - QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list); - int mem_prealloc = 0; /* force preallocation of physical target memory */ -+ bool cpu_pin = false; - - os_set_line_buffering(); - -@@ -3638,6 +3639,9 @@ void qemu_init(int argc, char **argv, char **envp) +@@ -173,6 +173,7 @@ static QemuPluginList plugin_list = QTAILQ_HEAD_INITIALIZER(plugin_list); + static BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue); + static bool nographic = false; + static int mem_prealloc; /* force preallocation of physical target memory */ ++static bool cpu_pin = false; + static const char *vga_model = NULL; + static DisplayOptions dpy; + static int num_serial_hds; +@@ -3360,6 +3361,10 @@ void qemu_init(int argc, char **argv) case QEMU_OPTION_nodefaults: has_defaults = 0; break; + case QEMU_OPTION_cpu_pin: + cpu_pin = true; + break; ++ case QEMU_OPTION_xen_domid: - if (!(xen_available())) { + if (!(accel_find("xen")) && !(accel_find("kvm"))) { error_report("Option not supported for this target"); base-commit: 9c55fdd5e54c5ea4bf238cee787f13a03eac1c86 diff --git a/pkg/xen-tools/patches-4.15.0/14-qemu-Init-CPU-mask-per-VCPU.patch b/pkg/xen-tools/patches-4.19.0/14-qemu-Init-CPU-mask-per-VCPU.patch similarity index 76% rename from pkg/xen-tools/patches-4.15.0/14-qemu-Init-CPU-mask-per-VCPU.patch rename to pkg/xen-tools/patches-4.19.0/14-qemu-Init-CPU-mask-per-VCPU.patch index 53a00e2cfb..f6a52c9fdb 100644 --- a/pkg/xen-tools/patches-4.15.0/14-qemu-Init-CPU-mask-per-VCPU.patch +++ b/pkg/xen-tools/patches-4.19.0/14-qemu-Init-CPU-mask-per-VCPU.patch @@ -24,26 +24,29 @@ index b06f13e..a4b4f11 100644 AccelState *accelerator; CPUArchIdList *possible_cpus; diff --git a/tools/qemu-xen/include/hw/core/cpu.h b/tools/qemu-xen/include/hw/core/cpu.h -index 8f14573..628b31a 100644 +index 397fd3a..1bf357b 100644 --- a/tools/qemu-xen/include/hw/core/cpu.h +++ b/tools/qemu-xen/include/hw/core/cpu.h -@@ -374,6 +374,8 @@ struct CPUState { +@@ -344,6 +344,9 @@ struct CPUState { bool created; bool stop; bool stopped; + bool pinned; + uint64_t cpumask; - bool unplug; - bool crash_occurred; - bool exit_request; ++ + + /* Should CPU start in powered-off state? */ + bool start_powered_off; + diff --git a/tools/qemu-xen/softmmu/cpus.c b/tools/qemu-xen/softmmu/cpus.c -index a802e89..da56052 100644 +index 9cbc817..2867325 100644 --- a/tools/qemu-xen/softmmu/cpus.c +++ b/tools/qemu-xen/softmmu/cpus.c -@@ -2011,6 +2011,23 @@ static void qemu_dummy_start_vcpu(CPUState *cpu) - QEMU_THREAD_JOINABLE); - } +@@ -72,6 +72,25 @@ static QemuMutex qemu_global_mutex; + */ + static const AccelOpsClass *cpus_accel; ++ +static inline void cpumask_clear_bit(uint64_t *mask, uint8_t bit) +{ + *mask &= ~(1ul << bit); @@ -52,7 +55,7 @@ index a802e89..da56052 100644 +static inline long cpumask_get_min_bit(uint64_t mask) +{ + return __builtin_ffsll(mask) - 1; -+} ++ } + +static long pick_pcpu(uint64_t *cpumask) +{ @@ -61,13 +64,14 @@ index a802e89..da56052 100644 + return ret; +} + - void qemu_init_vcpu(CPUState *cpu) ++ + bool cpu_is_stopped(CPUState *cpu) { - MachineState *ms = MACHINE(qdev_get_machine()); -@@ -2019,6 +2036,20 @@ void qemu_init_vcpu(CPUState *cpu) - cpu->nr_threads = ms->smp.threads; + return cpu->stopped || !runstate_is_running(); +@@ -635,6 +654,21 @@ void qemu_init_vcpu(CPUState *cpu) cpu->stopped = true; cpu->random_seed = qemu_guest_random_seed_thread_part1(); + + cpu->pinned = ms->cpu_pin; + static uint64_t vm_cpumask; + uint64_t vcpu_cpumask; @@ -82,15 +86,18 @@ index a802e89..da56052 100644 + } + + cpu->cpumask = vcpu_cpumask; - ++ if (!cpu->as) { /* If the target cpu hasn't set up any address spaces itself, + * give it the default one. + + diff --git a/tools/qemu-xen/softmmu/vl.c b/tools/qemu-xen/softmmu/vl.c -index c7c8abc..f514f59 100644 +index ea20b23..98287f4 100644 --- a/tools/qemu-xen/softmmu/vl.c +++ b/tools/qemu-xen/softmmu/vl.c -@@ -2829,6 +2829,68 @@ static void create_default_memdev(MachineState *ms, const char *path) - &error_fatal); +@@ -2631,6 +2631,68 @@ void qmp_x_exit_preconfig(Error **errp) + } } +static inline void cpumask_set_bit(uint64_t *mask, uint8_t bit) @@ -107,15 +114,15 @@ index c7c8abc..f514f59 100644 + const char *cur = cpumask_str; + bool range = false; + -+ assert(cpumask_str != NULL); ++ assert(cpumask_str != NULL); + + if (strcmp(cpumask_str, "") == 0) + return 0; + + if (cpumask_str[0] == '-') { -+ warn_report("The CPU mask cannot start with -\n"); ++ warn_report("The CPU mask cannot start with -\n"); + return 0; -+ } ++ } + + uint8_t last_set; + while (*cur) { @@ -124,7 +131,7 @@ index c7c8abc..f514f59 100644 + if (*cur == '-') { + cur++; + range = true; -+ continue; ++ continue; + } + if (*cur == ',') { + cur++; @@ -138,7 +145,7 @@ index c7c8abc..f514f59 100644 + } + if (end != cur) { + if (num == 0 || num > sizeof(cpumask) * BITS_PER_BYTE) -+ return 0; ++ return 0; + if (range) { + range = false; + for (int i = last_set + 1; i < num; i++) @@ -155,14 +162,24 @@ index c7c8abc..f514f59 100644 + return cpumask; +} + - void qemu_init(int argc, char **argv, char **envp) + void qemu_init(int argc, char **argv) { - int i; -@@ -4306,6 +4368,19 @@ void qemu_init(int argc, char **argv, char **envp) - - current_machine->boot_order = boot_order; - -+ current_machine->cpumask = 0; + QemuOpts *opts; +@@ -3357,6 +3419,7 @@ void qemu_init(int argc, char **argv) + case QEMU_OPTION_only_migratable: + only_migratable = 1; + break; ++ + case QEMU_OPTION_nodefaults: + has_defaults = 0; + break; +@@ -3596,6 +3659,21 @@ void qemu_init(int argc, char **argv) + if (cpu_option) { + current_machine->cpu_type = parse_cpu_option(cpu_option); + } ++ ++ ++ current_machine->cpumask = 0; + if (current_machine->cpumask_str) { + current_machine->cpumask = cpumask_parse(current_machine->cpumask_str); + if (!current_machine->cpumask) { @@ -175,9 +192,11 @@ index c7c8abc..f514f59 100644 + } + } + - /* parse features once if machine provides default cpu_type */ - current_machine->cpu_type = machine_class->default_cpu_type; - if (cpu_option) { + /* NB: for machine none cpu_type could STILL be NULL here! */ + + qemu_resolve_machine_memdev(); + + -- 2.35.1 diff --git a/pkg/xen-tools/patches-4.15.0/15-qemu-Set-the-affinity-of-QEMU-threads-according-to-t.patch b/pkg/xen-tools/patches-4.19.0/15-qemu-Set-the-affinity-of-QEMU-threads-according-to-t.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/15-qemu-Set-the-affinity-of-QEMU-threads-according-to-t.patch rename to pkg/xen-tools/patches-4.19.0/15-qemu-Set-the-affinity-of-QEMU-threads-according-to-t.patch diff --git a/pkg/xen-tools/patches-4.15.0/x86_64/05-xen-spoofing.patch b/pkg/xen-tools/patches-4.19.0/x86_64/05-xen-spoofing.patch similarity index 89% rename from pkg/xen-tools/patches-4.15.0/x86_64/05-xen-spoofing.patch rename to pkg/xen-tools/patches-4.19.0/x86_64/05-xen-spoofing.patch index b224442f16..a19e97e113 100644 --- a/pkg/xen-tools/patches-4.15.0/x86_64/05-xen-spoofing.patch +++ b/pkg/xen-tools/patches-4.19.0/x86_64/05-xen-spoofing.patch @@ -1,20 +1,20 @@ diff --git a/tools/firmware/hvmloader/hvmloader.c b/tools/firmware/hvmloader/hvmloader.c -index 598a226..0c3963a 100644 +index f8af88f..8dbb0cf 100644 --- a/tools/firmware/hvmloader/hvmloader.c +++ b/tools/firmware/hvmloader/hvmloader.c -@@ -135,9 +135,11 @@ static void init_hypercalls(void) +@@ -136,10 +136,10 @@ static void init_hypercalls(void) if ( !strcmp("XenVMMXenVMM", signature) ) break; -+ if ( !strcmp("ZenZenZenZen", signature) ) -+ break; ++ if ( !strcmp("ZenZenZenZen", signature) ) ++ break; } - BUG_ON(strcmp("XenVMMXenVMM", signature) || ((eax - base) < 2)); -+ //BUG_ON( (strcmp("XenVMMXenVMM", signature) && strcmp("ZenZenZenZen", signature) ) || ((eax - base) < 2)); - +- /* Fill in hypercall transfer pages. */ cpuid(base + 2, &eax, &ebx, &ecx, &edx); + for ( i = 0; i < eax; i++ ) diff --git a/tools/libs/light/libxl_create.c b/tools/libs/light/libxl_create.c index 32d45dc..283b41b 100644 --- a/tools/libs/light/libxl_create.c @@ -153,19 +153,7 @@ index 97499a0..b500095 100644 break; case 1: -diff --git a/xen/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h -index bcc5621..a506710 100644 ---- a/xen/include/asm-x86/hvm/domain.h -+++ b/xen/include/asm-x86/hvm/domain.h -@@ -159,6 +159,8 @@ struct hvm_domain { - bool_t mem_sharing_enabled; - bool_t qemu_mapcache_invalidate; - bool_t is_s3_suspended; -+ bool_t spoof_xen; -+ bool_t spoof_viridian; - - /* - * TSC value that VCPUs use to calculate their tsc_offset value. + diff --git a/xen/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h index ce46305..7e63c55 100644 --- a/xen/include/public/arch-x86/cpuid.h @@ -182,21 +170,21 @@ index ce46305..7e63c55 100644 * Leaf 2 (0x40000x01) * EAX[31:16]: Xen major version. diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h -index 36832e4..2be4178 100644 +index 99c40b4..5bec661 100644 --- a/xen/include/public/hvm/params.h +++ b/xen/include/public/hvm/params.h -@@ -302,7 +302,10 @@ +@@ -290,7 +290,9 @@ #define HVM_PARAM_MCA_CAP 38 #define XEN_HVM_MCA_CAP_LMCE (xen_mk_ullong(1) << 0) #define XEN_HVM_MCA_CAP_MASK XEN_HVM_MCA_CAP_LMCE -+#define HVM_PARAM_SPOOF_XEN 39 ++#define HVM_PARAM_SPOOF_XEN 39 -#define HVM_NR_PARAMS 39 -+#define HVM_PARAM_SPOOF_VIRIDIAN 40 -+ -+#define HVM_NR_PARAMS 41 ++#define HVM_PARAM_SPOOF_VIRIDIAN 40 ++#define HVM_NR_PARAMS 41 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */ + diff --git a/tools/xl/xl_parse.c b/tools/xl/xl_parse.c index 36832e4..2be4178 100644 --- a/tools/xl/xl_parse.c @@ -212,3 +200,18 @@ index 36832e4..2be4178 100644 switch (xlu_cfg_get_list(config, "viridian", &viridian, &num_viridian, 1)) { + +diff --git a/xen/arch/x86/include/asm/hvm/domain.h b/xen/arch/x86/include/asm/hvm/domain.h +index dd9d837..9f2e863 100644 +--- a/xen/arch/x86/include/asm/hvm/domain.h ++++ b/xen/arch/x86/include/asm/hvm/domain.h +@@ -106,6 +106,9 @@ struct hvm_domain { + + bool is_s3_suspended; + ++ bool spoof_xen; ++ bool spoof_virdian; ++ + /* Compatibility setting for a bug in x2APIC LDR */ + bool bug_x2apic_ldr_vcpu_id; + diff --git a/pkg/xen-tools/patches-4.15.0/x86_64/07-patch-seabios.patch b/pkg/xen-tools/patches-4.19.0/x86_64/07-patch-seabios.patch similarity index 68% rename from pkg/xen-tools/patches-4.15.0/x86_64/07-patch-seabios.patch rename to pkg/xen-tools/patches-4.19.0/x86_64/07-patch-seabios.patch index 6afc51d567..562a262ab6 100644 --- a/pkg/xen-tools/patches-4.15.0/x86_64/07-patch-seabios.patch +++ b/pkg/xen-tools/patches-4.19.0/x86_64/07-patch-seabios.patch @@ -1,10 +1,12 @@ +diff --git a/tools/firmware/Makefile b/tools/firmware/Makefile +index 345037b..b70255e 100644 --- a/tools/firmware/Makefile +++ b/tools/firmware/Makefile -@@ -26,6 +26,7 @@ +@@ -26,6 +26,7 @@ ovmf-dir: seabios-dir: GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_REVISION) seabios-dir cp seabios-config seabios-dir/.config; + cd seabios-dir && patch -p1 < /patches/x86_64/patch.seabios $(MAKE) -C seabios-dir olddefconfig CC=$(SEABIOSCC) LD=$(SEABIOSLD) rm -f seabios-dir/.version - echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version + echo '$(SEABIOS_UPSTREAM_REVISION)' > seabios-dir/.version \ No newline at end of file diff --git a/pkg/xen-tools/patches-4.15.0/x86_64/08-Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch b/pkg/xen-tools/patches-4.19.0/x86_64/08-Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch similarity index 100% rename from pkg/xen-tools/patches-4.15.0/x86_64/08-Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch rename to pkg/xen-tools/patches-4.19.0/x86_64/08-Revert__Revert__vfio_pci-quirks_c__Disable_stolen_memory_for_igd_VFIO__.patch diff --git a/pkg/xen-tools/patches-4.15.0/x86_64/patch.seabios b/pkg/xen-tools/patches-4.19.0/x86_64/patch.seabios similarity index 100% rename from pkg/xen-tools/patches-4.15.0/x86_64/patch.seabios rename to pkg/xen-tools/patches-4.19.0/x86_64/patch.seabios diff --git a/pkg/xen/0001-disable-Werror-to-build-under-gcc-11.2.patch b/pkg/xen/0001-disable-Werror-to-build-under-gcc-11.2.patch deleted file mode 100644 index ca88cd4134..0000000000 --- a/pkg/xen/0001-disable-Werror-to-build-under-gcc-11.2.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0957b86d55dd37f4acc7135ea423ee7b614ac23d Mon Sep 17 00:00:00 2001 -From: Petr Fedchenkov -Date: Tue, 16 Aug 2022 16:18:29 +0300 -Subject: [PATCH] disable Werror to build under gcc 11.2 - -Signed-off-by: Petr Fedchenkov ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index d4a7014f59..b487847b1f 100644 ---- a/Makefile -+++ b/Makefile -@@ -207,7 +207,7 @@ CFLAGS += -fomit-frame-pointer - endif - - CFLAGS += -nostdinc -fno-builtin -fno-common --CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith -+CFLAGS += -Wredundant-decls -Wno-pointer-arith - $(call cc-option-add,CFLAGS,CC,-Wvla) - CFLAGS += -pipe -D__XEN__ -include $(BASEDIR)/include/xen/config.h - CFLAGS-$(CONFIG_DEBUG_INFO) += -g --- -2.34.1 - diff --git a/pkg/xen/Dockerfile b/pkg/xen/Dockerfile index a61eb9a90e..280eaa8d0d 100644 --- a/pkg/xen/Dockerfile +++ b/pkg/xen/Dockerfile @@ -1,4 +1,4 @@ -FROM lfedge/eve-alpine:82df60e43ab9f8c935584b8c7b4d0a4b0271d608 as kernel-build +FROM lfedge/eve-alpine:1f7685f95a475c6bbe682f0b976f12180b6c8726 as kernel-build ENV BUILD_PKGS argp-standalone automake bash bc binutils-dev bison build-base \ diffutils flex git gmp-dev gnupg installkernel kmod \ @@ -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.19.0 ENV XEN_SOURCE=https://downloads.xenproject.org/release/xen/${XEN_VERSION}/xen-${XEN_VERSION}.tar.gz # Download and verify xen @@ -19,6 +19,7 @@ RUN [ -f "$(basename ${XEN_SOURCE})" ] || tar --absolute-names -xz < /xen.tar.gz WORKDIR /xen/xen COPY *.patch arch /tmp/ +#RUN cat /tmp/"$(uname -m)"/*.patch | patch -p1 RUN cp /tmp/"$(uname -m)"/*.patch /tmp/ RUN for p in /tmp/*.patch ; do patch -p1 < "$p" || exit 1 ; done RUN chmod +x scripts/* || : diff --git a/pkg/xen/arch/aarch64/0002-arm-efi-mem-detection.patch b/pkg/xen/arch/aarch64/0002-arm-efi-mem-detection.patch index 4cae389118..9d7d8ed3ba 100644 --- a/pkg/xen/arch/aarch64/0002-arm-efi-mem-detection.patch +++ b/pkg/xen/arch/aarch64/0002-arm-efi-mem-detection.patch @@ -1,26 +1,28 @@ ---- a/include/efi/efidef.h 2019-12-17 14:23:09.000000000 +0000 -+++ b/include/efi/efidef.h 2019-12-31 22:55:08.181551593 +0000 -@@ -147,6 +147,7 @@ +--- a/include/efi/efidef.h 2024-07-29 10:20:45 ++++ b/include/efi/efidef.h 2024-09-09 11:38:04 +@@ -147,6 +147,7 @@ typedef enum { EfiMemoryMappedIO, EfiMemoryMappedIOPortSpace, EfiPalCode, + EfiPersistentMemory, EfiMaxMemoryType } EFI_MEMORY_TYPE; - ---- a/arch/arm/efi/efi-boot.h 2019-12-17 14:23:09.000000000 +0000 -+++ b/arch/arm/efi/efi-boot.h 2019-12-31 22:55:08.181551593 +0000 -@@ -153,9 +153,10 @@ + +--- a/arch/arm/efi/efi-boot.h 2024-07-29 10:20:45 ++++ b/arch/arm/efi/efi-boot.h 2024-09-09 11:40:36 +@@ -194,10 +194,11 @@ static EFI_STATUS __init efi_process_memory_map_bootin (desc_ptr->Type == EfiConventionalMemory || desc_ptr->Type == EfiLoaderCode || desc_ptr->Type == EfiLoaderData || - (!map_bs && - (desc_ptr->Type == EfiBootServicesCode || - desc_ptr->Type == EfiBootServicesData))) ) -+ desc_ptr->Type == EfiACPIReclaimMemory || -+ desc_ptr->Type == EfiPersistentMemory || -+ desc_ptr->Type == EfiBootServicesCode || -+ desc_ptr->Type == EfiBootServicesData) ) - { - if ( !meminfo_add_bank(&bootinfo.mem, desc_ptr) ) +- { ++ desc_ptr->Type == EfiACPIReclaimMemory || ++ desc_ptr->Type == EfiPersistentMemory || ++ desc_ptr->Type == EfiBootServicesCode || ++ desc_ptr->Type == EfiBootServicesData) ) ++ { + if ( !meminfo_add_bank(bootinfo_get_mem(), desc_ptr) ) { + PrintStr(L"Warning: All " __stringify(NR_MEM_BANKS) diff --git a/pkg/xen/arch/aarch64/0003-arch-arm-small-hack-for-rpi4-usb.patch b/pkg/xen/arch/aarch64/0003-arch-arm-small-hack-for-rpi4-usb.patch deleted file mode 100644 index c642646a9a..0000000000 --- a/pkg/xen/arch/aarch64/0003-arch-arm-small-hack-for-rpi4-usb.patch +++ /dev/null @@ -1,32 +0,0 @@ -From fafd866db71dc014a06ae180ff44946a002762cd Mon Sep 17 00:00:00 2001 -From: Aleksandrov Dmitriy -Date: Thu, 17 Jun 2021 05:40:22 +0300 -Subject: [PATCH] arch: arm: small hack for rpi4 usb - device tree node generation. - -Fix device tree generation failed. - -(XEN) Unable to retrieve address 0 for /scb/pcie@7d500000/pci@1,0/usb@1,0 -(XEN) Device tree generation failed (-22). - -Signed-off-by: Aleksandrov Dmitriy ---- - arch/arm/domain_build.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/arm/domain_build.c b/arch/arm/domain_build.c -index 282416e..daa37d7 100644 ---- a/arch/arm/domain_build.c -+++ b/arch/arm/domain_build.c -@@ -1410,7 +1410,7 @@ static int __init handle_device(struct domain *d, struct dt_device_node *dev, - { - printk(XENLOG_ERR "Unable to retrieve address %u for %s\n", - i, dt_node_full_name(dev)); -- return res; -+ continue; - } - - res = map_range_to_domain(dev, addr, size, &mr_data); --- -2.25.1 - diff --git a/pkg/xen/arch/aarch64/0005-smbios.patch b/pkg/xen/arch/aarch64/0005-smbios.patch index 2683c9a0cf..2b4ebf74b6 100644 --- a/pkg/xen/arch/aarch64/0005-smbios.patch +++ b/pkg/xen/arch/aarch64/0005-smbios.patch @@ -1,60 +1,58 @@ -commit cf280c10471878c1861e5ee156fa54a80e0f85a4 -Author: Stefano Stabellini -Date: Thu Dec 17 18:29:39 2020 -0800 - - Pass SMBIOS address to Dom0 - diff --git a/arch/arm/domain_build.c b/arch/arm/domain_build.c -index e824ba34b0..835f14c42a 100644 +index 669970c..d15aade 100644 --- a/arch/arm/domain_build.c +++ b/arch/arm/domain_build.c -@@ -80,6 +80,12 @@ unsigned int __init dom0_max_vcpus(void) +@@ -113,6 +113,14 @@ unsigned int __init dom0_max_vcpus(void) return opt_dom0_max_vcpus; } ++ +static unsigned long __initdata smbios_addr; +void __init dmi_efi_get_table(const void *smbios, const void *smbios3) +{ -+ smbios_addr = (unsigned long)smbios; ++ smbios_addr = (unsigned long)smbios; +} ++ + struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0) { return vcpu_create(dom0, 0); -@@ -751,6 +757,13 @@ static int __init make_hypervisor_node(struct domain *d, +@@ -1199,6 +1207,14 @@ int __init make_hypervisor_node(struct domain *d, if ( res ) return res; -+ if ( smbios_addr != 0 ) -+ { -+ res = fdt_property_u64(fdt, "xen,smbios", smbios_addr); -+ if ( res ) -+ return res; -+ } ++ if ( smbios_addr != 0 ) ++ { ++ res = fdt_property_u64(fdt, "xen,smbios", smbios_addr); ++ if ( res ) ++ return res; ++ } ++ + /* Cannot use fdt_property_string due to embedded nulls */ res = fdt_property(fdt, "compatible", compat, sizeof(compat)); if ( res ) -@@ -2575,6 +2588,13 @@ +@@ -2183,6 +2199,14 @@ static int __init construct_dom0(struct domain *d) if ( rc < 0 ) return rc; + if ( smbios_addr != 0 ) + { -+ map_regions_p2mt(d, -+ gaddr_to_gfn(smbios_addr), 1, -+ maddr_to_mfn(smbios_addr), p2m_mmio_direct_c); ++ map_regions_p2mt(d, ++ gaddr_to_gfn(smbios_addr), 1, ++ maddr_to_mfn(smbios_addr), p2m_mmio_direct_c); + } ++ + return construct_domain(d, &kinfo); } - + diff --git a/common/efi/boot.c b/common/efi/boot.c -index 63e289ab85..0cf2202d58 100644 +index efbec00..bfc07bb 100644 --- a/common/efi/boot.c +++ b/common/efi/boot.c -@@ -855,12 +855,10 @@ static void __init efi_tables(void) - efi.smbios3 = (long)efi_ct[i].VendorTable; +@@ -999,12 +999,10 @@ static void __init efi_tables(void) + esrt = (UINTN)efi_ct[i].VendorTable; } -#ifndef CONFIG_ARM /* TODO - disabled until implemented on ARM */ diff --git a/pkg/xen/arch/x86_64/0001-gettime-considered-harmful.patch b/pkg/xen/arch/x86_64/0001-gettime-considered-harmful.patch index 56a658da5e..415c514b8e 100644 --- a/pkg/xen/arch/x86_64/0001-gettime-considered-harmful.patch +++ b/pkg/xen/arch/x86_64/0001-gettime-considered-harmful.patch @@ -1,19 +1,9 @@ -From: Roman Shaposhnik -Date: Mon, 24 Aug 2020 12:04:57 +0530 -Subject: [PATCH] UEFI GetTime() is considered harmful - -As per thread here: https://lists.archive.carbon60.com/xen/devel/408709 -it is best to avoid calling GetTime() - -Please follow Xen upstream discussion here: - https://lists.xenproject.org/archives/html/xen-devel/2020-08/msg01018.html - -diff --git a/arch/x86/time.c b/xen/arch/x86/time.c -index 4723f5d..311e8a5 100644 +diff --git a/arch/x86/time.c b/arch/x86/time.c +index a97d784..c25fdf7 100644 --- a/arch/x86/time.c +++ b/arch/x86/time.c -@@ -1040,19 +1040,12 @@ - +@@ -1247,19 +1247,12 @@ static void __get_cmos_time(struct rtc_time *rtc) + static unsigned long get_cmos_time(void) { - unsigned long res, flags; @@ -22,7 +12,7 @@ index 4723f5d..311e8a5 100644 unsigned int seconds = 60; static bool __read_mostly cmos_rtc_probe; boolean_param("cmos-rtc-probe", cmos_rtc_probe); - + - if ( efi_enabled(EFI_RS) ) - { - res = efi_get_time(); diff --git a/pkg/xen/arch/x86_64/0002-xen-spoofing.patch b/pkg/xen/arch/x86_64/0002-xen-spoofing.patch index 14ca808600..89e0801e63 100644 --- a/pkg/xen/arch/x86_64/0002-xen-spoofing.patch +++ b/pkg/xen/arch/x86_64/0002-xen-spoofing.patch @@ -1,8 +1,8 @@ -diff --git a/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c -index 4723f5d..311e8a5 100644 +diff --git a/arch/x86/hvm/hvm.c b/arch/x86/hvm/hvm.c +index f49e29f..54da255 100644 --- a/arch/x86/hvm/hvm.c +++ b/arch/x86/hvm/hvm.c -@@ -4256,6 +4256,12 @@ +@@ -4332,6 +4332,12 @@ static int hvm_set_param(struct domain *d, uint32_t index, uint64_t value) case HVM_PARAM_IOREQ_SERVER_PFN: d->arch.hvm.ioreq_gfn.base = value; break; @@ -15,89 +15,97 @@ index 4723f5d..311e8a5 100644 case HVM_PARAM_NR_IOREQ_SERVER_PAGES: { unsigned int i; -diff --git a/arch/x86/hvm/viridian/viridian.c b/xen/arch/x86/hvm/viridian/viridian.c -index 44c8e6c..b45bdbf 100644 + +diff --git a/arch/x86/hvm/viridian/viridian.c b/arch/x86/hvm/viridian/viridian.c +index 21480d9..6a54abf 100644 --- a/arch/x86/hvm/viridian/viridian.c +++ b/arch/x86/hvm/viridian/viridian.c -@@ -121,9 +121,9 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf, +@@ -124,10 +124,10 @@ void cpuid_viridian_leaves(const struct vcpu *v, uint32_t leaf, { case 0: res->a = 0x40000006; /* Maximum leaf */ - memcpy(&res->b, "Micr", 4); - memcpy(&res->c, "osof", 4); - memcpy(&res->d, "t Hv", 4); -+ memcpy(&res->b, "Wetw", 4); -+ memcpy(&res->c, "era ", 4); -+ memcpy(&res->d, "Labs", 4); - break; +- break; ++ memcpy(&res->b, "Wetw", 4); ++ memcpy(&res->c, "era ", 4); ++ memcpy(&res->d, "Labs", 4); ++ break; case 1: -diff --git a/arch/x86/traps.c b/xen/arch/x86/traps.c -index 97499a0..b500095 100644 + memcpy(&res->a, "Hv#1", 4); + +diff --git a/arch/x86/traps.c b/arch/x86/traps.c +index 708136f..33a02e9 100644 --- a/arch/x86/traps.c +++ b/arch/x86/traps.c -@@ -892,9 +892,17 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, +@@ -1075,10 +1075,18 @@ void cpuid_hypervisor_leaves(const struct vcpu *v, uint32_t leaf, { case 0: res->a = base + limit; /* Largest leaf */ - res->b = XEN_CPUID_SIGNATURE_EBX; - res->c = XEN_CPUID_SIGNATURE_ECX; - res->d = XEN_CPUID_SIGNATURE_EDX; +- break; + if (!d->arch.hvm.spoof_xen ) { -+ res->b = XEN_CPUID_SIGNATURE_EBX; -+ res->c = XEN_CPUID_SIGNATURE_ECX; -+ res->d = XEN_CPUID_SIGNATURE_EDX; -+ } else ++ res->b = XEN_CPUID_SIGNATURE_EBX; ++ res->c = XEN_CPUID_SIGNATURE_ECX; ++ res->d = XEN_CPUID_SIGNATURE_EDX; ++ } ++ else + { -+ res->b = ZEN_CPUID_SIGNATURE_EBX; -+ res->c = ZEN_CPUID_SIGNATURE_ECX; -+ res->d = ZEN_CPUID_SIGNATURE_EDX; ++ res->b = ZEN_CPUID_SIGNATURE_EBX; ++ res->c = ZEN_CPUID_SIGNATURE_ECX; ++ res->d = ZEN_CPUID_SIGNATURE_EDX; + } -+ - break; ++ break; case 1: -diff --git a/include/asm-x86/hvm/domain.h b/xen/include/asm-x86/hvm/domain.h -index bcc5621..a506710 100644 ---- a/include/asm-x86/hvm/domain.h -+++ b/include/asm-x86/hvm/domain.h -@@ -166,6 +166,8 @@ + res->a = (xen_major_version() << 16) | xen_minor_version(); + +diff --git a/arch/x86/include/asm/hvm/domain.h b/arch/x86/include/asm/hvm/domain.h +index dd9d837..357cfb7 100644 +--- a/arch/x86/include/asm/hvm/domain.h ++++ b/arch/x86/include/asm/hvm/domain.h +@@ -105,6 +105,8 @@ struct hvm_domain { + bool is_in_uc_mode; - bool_t qemu_mapcache_invalidate; - bool_t is_s3_suspended; -+ bool_t spoof_xen; -+ bool_t spoof_viridian; + bool is_s3_suspended; ++ bool spoof_xen; ++ bool spoof_viridian; - /* - * TSC value that VCPUs use to calculate their tsc_offset value. -diff --git a/include/public/arch-x86/cpuid.h b/xen/include/public/arch-x86/cpuid.h -index ce46305..7e63c55 100644 + /* Compatibility setting for a bug in x2APIC LDR */ + bool bug_x2apic_ldr_vcpu_id; + + +diff --git a/include/public/arch-x86/cpuid.h b/include/public/arch-x86/cpuid.h +index 3bb0dd2..a77edf2 100644 --- a/include/public/arch-x86/cpuid.h +++ b/include/public/arch-x86/cpuid.h -@@ -53,6 +53,10 @@ +@@ -35,6 +35,9 @@ + #define XEN_CPUID_SIGNATURE_EBX 0x566e6558 /* "XenV" */ #define XEN_CPUID_SIGNATURE_ECX 0x65584d4d /* "MMXe" */ #define XEN_CPUID_SIGNATURE_EDX 0x4d4d566e /* "nVMM" */ - +#define ZEN_CPUID_SIGNATURE_EBX 0x5A6e655A /* "ZenZ" */ +#define ZEN_CPUID_SIGNATURE_ECX 0x655A6e65 /* "enZe" */ +#define ZEN_CPUID_SIGNATURE_EDX 0x6e655A6e /* "nZen" */ -+ + /* * Leaf 2 (0x40000x01) - * EAX[31:16]: Xen major version. -diff --git a/include/public/hvm/params.h b/xen/include/public/hvm/params.h -index 36832e4..2be4178 100644 + +diff --git a/include/public/hvm/params.h b/include/public/hvm/params.h +index 99c40b4..f1c77e2 100644 --- a/include/public/hvm/params.h +++ b/include/public/hvm/params.h -@@ -302,7 +302,10 @@ +@@ -290,7 +290,8 @@ #define HVM_PARAM_MCA_CAP 38 #define XEN_HVM_MCA_CAP_LMCE (xen_mk_ullong(1) << 0) #define XEN_HVM_MCA_CAP_MASK XEN_HVM_MCA_CAP_LMCE -+#define HVM_PARAM_SPOOF_XEN 39 - +- -#define HVM_NR_PARAMS 39 ++#define HVM_PARAM_SPOOF_XEN 39 +#define HVM_PARAM_SPOOF_VIRIDIAN 40 -+ +#define HVM_NR_PARAMS 41 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */