diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6df5e29 --- /dev/null +++ b/.gitignore @@ -0,0 +1,28 @@ +/qemu-3.1.0.tar.xz +/qemu-4.0.0.tar.xz +/qemu-4.1.0-rc4.tar.xz +/qemu-4.1.0.tar.xz +/qemu-4.2.0-rc1.tar.xz +/qemu-4.2.0-rc4.tar.xz +/qemu-4.2.0.tar.xz +/qemu-5.0.0-rc0.tar.xz +/qemu-5.0.0-rc1.tar.xz +/qemu-5.0.0-rc2.tar.xz +/qemu-5.0.0-rc3.tar.xz +/qemu-5.0.0-rc4.tar.xz +/qemu-5.0.0.tar.xz +/qemu-5.1.0.tar.xz +/qemu-5.2.0-rc1.tar.xz +/qemu-5.2.0-rc3.tar.xz +/qemu-5.2.0.tar.xz +/qemu-6.0.0.tar.xz +/qemu-kvm*.src.rpm +/patches.* +/*.orig +/qemu-6.1.0.tar.xz +/qemu-6.2.0.tar.xz +/qemu-7.0.0.tar.xz +/capstone.tar.gz +/qemu-7.1.0.tar.xz +/qemu-7.2.0.tar.xz +/qemu-8.0.0.tar.xz diff --git a/0004-Initial-redhat-build.patch b/0004-Initial-redhat-build.patch new file mode 100644 index 0000000..612633e --- /dev/null +++ b/0004-Initial-redhat-build.patch @@ -0,0 +1,300 @@ +From 84039bfc860878f3c3421de4a1836ac5d6300ed7 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 26 May 2021 10:56:02 +0200 +Subject: Initial redhat build + +This patch introduces redhat build structure in redhat subdirectory. In addition, +several issues are fixed in QEMU tree: + +- Change of app name for sasl_server_init in VNC code from qemu to qemu-kvm + - As we use qemu-kvm as name in all places, this is updated to be consistent +- Man page renamed from qemu to qemu-kvm + - man page is installed using make install so we have to fix it in qemu tree + +We disable make check due to issues with some of the tests. + +This rebase is based on qemu-kvm-7.2.0-14.el9 + +Signed-off-by: Miroslav Rezanina +-- +Rebase changes (6.1.0): +- Move build to .distro +- Move changes for support file to related commit +- Added dependency for python3-sphinx-rtd_theme +- Removed --disable-sheepdog configure option +- Added new hw-display modules +- SASL initialization moved to ui/vnc-auth-sasl.c +- Add accel-qtest- and accel-tcg-x86_64 libraries +- Added hw-usb-host module +- Disable new configure options (bpf, nvmm, slirp-smbd) +- Use -pie for ksmctl build (annocheck complain fix) + +Rebase changes (6.2.0): +- removed --disable-jemalloc and --disable-tcmalloc configure options +- added audio-oss.so +- added fdt requirement for x86_64 +- tests/acceptance renamed to tests/avocado +- added multiboot_dma.bin +- Add -Wno-string-plus-int to extra flags +- Updated configure options + +Rebase changes (7.0.0): +- Do not use -mlittle CFLAG on ppc64le +- Used upstream handling issue with ui/clipboard.c +- Use -mlittle-endian on ppc64le instead of deleteing it in configure +- Drop --disable-libxml2 option for configure (upstream) +- Remove vof roms +- Disable AVX2 support +- Use internal meson +- Disable new configure options (dbus-display and qga-vss) +- Change permissions on installing tests/Makefile.include +- Remove ssh block driver + +Rebase changes (7.1.0 rc0): +- --disable-vnc-png renamed to --disable-png (upstream) +- removed --disable-vhost-vsock and --disable-vhost-scsi +- capstone submodule removed +- Temporary include capstone build + +Rebase changes (7.2.0 rc0): +- Switch --enable-slirp=system to --enable-slirp + +Rebaes changes (7.2.0 rc2): +- Added new configure options (blkio and sndio, both disabled) + +Rebase changes (7.2.0): +- Fix SRPM name generation to work on Fedora 37 +- Switch back to system meson + +Rebase changes (8.0.0-rc1): +- use enable-dtrace-backands instead of enable-dtrace-backend +- Removed qemu virtiofsd bits + +Rebase changes (8.0.0-rc2): +- test/check-block.sh removed (upstream) + +Rebase changes (8.0.0-rc3): +- Add new --disable-* options for configure + +Merged patches (6.0.0): + - 605758c902 Limit build on Power to qemu-img and qemu-ga only + +Merged patches (6.1.0): +- f04f91751f Use cached tarballs +- 6581165c65 Remove message with running VM count +- 03c3cac9fc spec-file: build qemu-kvm without SPICE and QXL +- e0ae6c1f6c spec-file: Obsolete qemu-kvm-ui-spice +- 9d2e9f9ecf spec: Do not build qemu-kvm-block-gluster +- cf470b4234 spec: Do not link pcnet and ne2k_pci roms +- e981284a6b redhat: Install the s390-netboot.img that we've built +- 24ef557f33 spec: Remove usage of Group: tag +- c40d69b4f4 spec: Drop %defattr usage +- f8e98798ce spec: Clean up BuildRequires +- 47246b43ee spec: Remove iasl BuildRequires +- 170dc1cbe0 spec: Remove redundant 0 in conditionals +- 8718f6fa11 spec: Add more have_XXX conditionals +- a001269ce9 spec: Remove binutils versioned Requires +- 34545ee641 spec: Remove diffutils BuildRequires +- c2c82beac9 spec: Remove redundant Requires: +- 9314c231f4 spec: Add XXX_version macros +- c43db0bf0f spec: Add have_block_rbd +- 3ecb0c0319 qga: drop StandardError=syslog +- 018049dc80 Remove iscsi support +- a2edf18777 redhat: Replace the kvm-setup.service with a /etc/modules-load.d config file +- 387b5fbcfe redhat: Move qemu-kvm-docs dependency to qemu-kvm +- 4ead693178 redhat: introducting qemu-kvm-hw-usbredir +- 4dc6fc3035 redhat: use the standard vhost-user JSON path +- 84757178b4 Fix local build +- 8c394227dd spec: Restrict block drivers in tools +- b6aa7c1fae Move tools to separate package +- eafd82e509 Split qemu-pr-helper to separate package +- 2c0182e2aa spec: RPM_BUILD_ROOT -> %{buildroot} +- 91bd55ca13 spec: More use of %{name} instead of 'qemu-kvm' +- 50ba299c61 spec: Use qemu-pr-helper.service from qemu.git (partial) +- ee08d4e0a3 spec: Use %{_sourcedir} for referencing sources +- 039e7f7d02 spec: Add tools_only +- 884ba71617 spec: %build: Add run_configure helper +- 8ebd864d65 spec: %build: Disable more bits with %{disable_everything} (partial) +- f23fdb53f5 spec: %build: Add macros for some 'configure' parameters +- fe951a8bd8 spec: %files: Move qemu-guest-agent and qemu-img earlier +- 353b632e37 spec: %install: Remove redundant bits +- 9d2015b752 spec: %install: Add %{modprobe_kvm_conf} macro +- 6d05134e8c spec: %install: Remove qemu-guest-agent /etc/qemu-kvm usage +- 985b226467 spec: %install: clean up qemu-ga section +- dfaf9c600d spec: %install: Use a single %{tools_only} section +- f6978ddb46 spec: Make tools_only not cross spec sections +- 071c211098 spec: %install: Limit time spent in %{qemu_kvm_build} +- 1b65c674be spec: misc syntactic merges with Fedora +- 4da16294cf spec: Use Fedora's pattern for specifying rc version +- d7ee259a79 spec: %files: don't use fine grained -docs file list +- 64cad0c60f spec: %files: Add licenses to qemu-common too +- c3de4f080a spec: %install: Drop python3 shebang fixup +- 46fc216115 Update local build to work with spec file improvements +- bab9531548 spec: Remove buildldflags +- c8360ab6a9 spec: Use %make_build macro +- f6966c66e9 spec: Drop make install sharedir and datadir usage +- 86982421bc spec: use %make_install macro +- 191c405d22 spec: parallelize `make check` +- 251a1fb958 spec: Drop explicit --build-id +- 44c7dda6c3 spec: use %{build_ldflags} +- 0009a34354 Move virtiofsd to separate package +- 34d1b200b3 Utilize --firmware configure option +- 2800e1dd03 spec: Switch toolchain to Clang/LLVM (except process-patches.sh) +- e8a70f500f spec: Use safe-stack for x86_64 +- e29445d50d spec: Reenable write support for VMDK etc. in tools +- a4fe2a3e16 redhat: Disable LTO on non-x86 architectures + +Merged patches (6.2.0): +- 333452440b remove sgabios dependency +- 7d3633f184 enable pulseaudio +- bd898709b0 spec: disable use of gcrypt for crypto backends in favour of gnutls +- e4f0c6dee6 spec: Remove block-curl and block-ssh dependency +- 4dc13bfe63 spec: Build the VDI block driver +- d2f2ff3c74 spec: Explicitly include compress filter +- a7d047f9c2 Move ksmtuned files to separate package + +Merged patches (7.0.0): +- 098d4d08d0 spec: Rename qemu-kvm-hw-usbredir to qemu-kvm-device-usb-redirect +- c2bd0d6834 spec: Split qemu-kvm-ui-opengl +- 2c9cda805d spec: Introduce packages for virtio-gpu-* modules (changed as rhel device tree not set) +- d0414a3e0b spec: Introduce device-display-virtio-vga* packages +- 3534ec46d4 spec: Move usb-host module to separate package +- ddc14d4737 spec: Move qtest accel module to tests package +- 6f2c4befa6 spec: Extend qemu-kvm-core description +- 6f11866e4e (rhel/rhel-9.0.0) Update to qemu-kvm-6.2.0-6.el9 +- da0a28758f ui/clipboard: fix use-after-free regression +- 895d4d52eb spec: Remove qemu-virtiofsd +- c8c8c8bd84 spec: Fix obsolete for spice subpackages +- d46d2710b2 spec: Obsolete old usb redir subpackage +- 6f52a50b68 spec: Obsolete ssh driver + +Merged patches (7.2.0 rc4): +- 8c6834feb6 Remove opengl display device subpackages (C9S MR 124) +- 0ecc97f29e spec: Add requires for packages with additional virtio-gpu variants (C9S MR 124) + +Merged patches (8.0.0-rc1): +- 7754f6ba78 Minor packaging fixes +- 401af56187 spec: Disable VDUSE + +Signed-off-by: Miroslav Rezanina +--- + .distro/Makefile | 100 + + .distro/Makefile.common | 41 + + .distro/README.tests | 39 + + .distro/modules-load.conf | 4 + + .distro/qemu-guest-agent.service | 1 - + .distro/qemu-kvm.spec.template | 4528 +++++++++++++++++++++++ + .distro/rpminspect.yaml | 6 +- + .distro/scripts/extract_build_cmd.py | 12 + + .distro/scripts/process-patches.sh | 4 + + .gitignore | 1 + + README.systemtap | 43 + + scripts/qemu-guest-agent/fsfreeze-hook | 2 +- + scripts/systemtap/conf.d/qemu_kvm.conf | 4 + + scripts/systemtap/script.d/qemu_kvm.stp | 1 + + ui/vnc-auth-sasl.c | 2 +- + 15 files changed, 4784 insertions(+), 4 deletions(-) + create mode 100644 .distro/Makefile + create mode 100644 .distro/Makefile.common + create mode 100644 .distro/README.tests + create mode 100644 .distro/modules-load.conf + create mode 100644 .distro/qemu-kvm.spec.template + create mode 100644 README.systemtap + create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf + create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp + +diff --git a/README.systemtap b/README.systemtap +new file mode 100644 +index 0000000000..ad913fc990 +--- /dev/null ++++ b/README.systemtap +@@ -0,0 +1,43 @@ ++QEMU tracing using systemtap-initscript ++--------------------------------------- ++ ++You can capture QEMU trace data all the time using systemtap-initscript. This ++uses SystemTap's flight recorder mode to trace all running guests to a ++fixed-size buffer on the host. Old trace entries are overwritten by new ++entries when the buffer size wraps. ++ ++1. Install the systemtap-initscript package: ++ # yum install systemtap-initscript ++ ++2. Install the systemtap scripts and the conf file: ++ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/ ++ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/ ++ ++The set of trace events to enable is given in qemu_kvm.stp. This SystemTap ++script can be customized to add or remove trace events provided in ++/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp. ++ ++SystemTap customizations can be made to qemu_kvm.conf to control the flight ++recorder buffer size and whether to store traces in memory only or disk too. ++See stap(1) for option documentation. ++ ++3. Start the systemtap service. ++ # service systemtap start qemu_kvm ++ ++4. Make the service start at boot time. ++ # chkconfig systemtap on ++ ++5. Confirm that the service works. ++ # service systemtap status qemu_kvm ++ qemu_kvm is running... ++ ++When you want to inspect the trace buffer, perform the following steps: ++ ++1. Dump the trace buffer. ++ # staprun -A qemu_kvm >/tmp/trace.log ++ ++2. Start the systemtap service because the preceding step stops the service. ++ # service systemtap start qemu_kvm ++ ++3. Translate the trace record to readable format. ++ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log +diff --git a/scripts/qemu-guest-agent/fsfreeze-hook b/scripts/qemu-guest-agent/fsfreeze-hook +index 13aafd4845..e9b84ec028 100755 +--- a/scripts/qemu-guest-agent/fsfreeze-hook ++++ b/scripts/qemu-guest-agent/fsfreeze-hook +@@ -8,7 +8,7 @@ + # request, it is issued with "thaw" argument after filesystem is thawed. + + LOGFILE=/var/log/qga-fsfreeze-hook.log +-FSFREEZE_D=$(dirname -- "$0")/fsfreeze-hook.d ++FSFREEZE_D=$(dirname -- "$(realpath $0)")/fsfreeze-hook.d + + # Check whether file $1 is a backup or rpm-generated file and should be ignored + is_ignored_file() { +diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf +new file mode 100644 +index 0000000000..372d8160a4 +--- /dev/null ++++ b/scripts/systemtap/conf.d/qemu_kvm.conf +@@ -0,0 +1,4 @@ ++# Force load uprobes (see BZ#1118352) ++stap -e 'probe process("/usr/libexec/qemu-kvm").function("main") { printf("") }' -c true ++ ++qemu_kvm_OPT="-s4" # per-CPU buffer size, in megabytes +diff --git a/scripts/systemtap/script.d/qemu_kvm.stp b/scripts/systemtap/script.d/qemu_kvm.stp +new file mode 100644 +index 0000000000..c04abf9449 +--- /dev/null ++++ b/scripts/systemtap/script.d/qemu_kvm.stp +@@ -0,0 +1 @@ ++probe qemu.kvm.simpletrace.handle_qmp_command,qemu.kvm.simpletrace.monitor_protocol_*,qemu.kvm.simpletrace.migrate_set_state {} +diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth-sasl.c +index 47fdae5b21..2a950caa2a 100644 +--- a/ui/vnc-auth-sasl.c ++++ b/ui/vnc-auth-sasl.c +@@ -42,7 +42,7 @@ + + bool vnc_sasl_server_init(Error **errp) + { +- int saslErr = sasl_server_init(NULL, "qemu"); ++ int saslErr = sasl_server_init(NULL, "qemu-kvm"); + + if (saslErr != SASL_OK) { + error_setg(errp, "Failed to initialize SASL auth: %s", +-- +2.39.1 + diff --git a/0005-Enable-disable-devices-for-RHEL.patch b/0005-Enable-disable-devices-for-RHEL.patch new file mode 100644 index 0000000..14dd3f9 --- /dev/null +++ b/0005-Enable-disable-devices-for-RHEL.patch @@ -0,0 +1,678 @@ +From 63829772dbc2075fc014a9d52e3968735d228018 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 7 Dec 2022 03:05:48 -0500 +Subject: Enable/disable devices for RHEL + +This commit adds all changes related to changes in supported devices. + +Signed-off-by: Miroslav Rezanina +-- +Rebase notes (6.1.0): +- Added CONFIG_TPM (except s390x) +- default-configs moved to configs +- Use --with-device- configure option to use rhel configs + +Rebase notes (6.2.0): +- Add CONFIG_ISA_FDC +- Do not remove -no-hpet documentation + +Rebase notes (7.0.0): +- Added CONFIG_ARM_GIC_TCG option for aarch64 +- Fixes necessary for layout change fixes +- Renamed CONFIG_ARM_GIC_TCG to CONFIG_ARM_GICV3_TCG +- Removed upstream devices + +Rebase notes (7.1.0 rc0): +- Added CONFIG_VHOST_VSOCK and CONFIG_VHOST_USER_VSOCK configs +- Added CONFIG_CXL and CONFIG_CXL_MEM_DEVICE for aarch64 and x86_64 + +Rebase notes (7.1.0 rc3): +- Added CONFIG_VHOST_USER_FS option (all archs) + +Rebase notes (7.2.0 rc20): +- Removed disabling a15mpcore.c as no longer needed + +Rebase notes (8.0.0-rc1): +- Rename CONFIG_ACPI_X86_ICH to CONFIG_ACPI_ICH9 +- Inlude qemu/error-report.h in hw/display/cirrus_vga.c +- Change virtiofsd dependency version + +Merged patches (6.1.0): +- c51bf45304 Remove SPICE and QXL from x86_64-rh-devices.mak +- 02fc745601 aarch64-rh-devices: add CONFIG_PVPANIC_PCI +- f2fe835153 aarch64-rh-devices: add CONFIG_PXB +- b5431733ad disable CONFIG_USB_STORAGE_BOT +- 478ba0cdf6 Disable TPM passthrough +- 2504d68a7c aarch64: Add USB storage devices +- 51c2a3253c disable ac97 audio + +Merged patches (6.2.0): +- 9f2f9fa2ba disable sga device + +Merged patches (7.0.0): +- fd7c45a5a8 redhat: Enable virtio-mem as tech-preview on x86-64 +- c9e68ea451 Enable SGX -- RH Only + +Merged patches (7.1.0 rc0): +- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/acpi/ich9.c chunk) +- 8f663466c6 configs/devices/aarch64-softmmu: Enable CONFIG_VIRTIO_MEM +- 1bf372717a Enable virtio-iommu-pci on aarch64 +- ae3f269458 Enable virtio-iommu-pci on x86_64 +--- + .distro/qemu-kvm.spec.template | 18 +-- + .../aarch64-softmmu/aarch64-rh-devices.mak | 41 +++++++ + .../ppc64-softmmu/ppc64-rh-devices.mak | 37 ++++++ + configs/devices/rh-virtio.mak | 10 ++ + .../s390x-softmmu/s390x-rh-devices.mak | 18 +++ + .../x86_64-softmmu/x86_64-rh-devices.mak | 109 ++++++++++++++++++ + hw/arm/meson.build | 2 +- + hw/block/fdc.c | 10 ++ + hw/cpu/meson.build | 3 +- + hw/display/cirrus_vga.c | 7 +- + hw/ide/piix.c | 5 +- + hw/input/pckbd.c | 2 + + hw/net/e1000.c | 2 + + hw/ppc/spapr_cpu_core.c | 2 + + hw/usb/meson.build | 2 +- + target/arm/cpu_tcg.c | 10 ++ + target/ppc/cpu-models.c | 9 ++ + target/s390x/cpu_models_sysemu.c | 3 + + target/s390x/kvm/kvm.c | 8 ++ + 19 files changed, 285 insertions(+), 13 deletions(-) + create mode 100644 configs/devices/aarch64-softmmu/aarch64-rh-devices.mak + create mode 100644 configs/devices/ppc64-softmmu/ppc64-rh-devices.mak + create mode 100644 configs/devices/rh-virtio.mak + create mode 100644 configs/devices/s390x-softmmu/s390x-rh-devices.mak + create mode 100644 configs/devices/x86_64-softmmu/x86_64-rh-devices.mak + +diff --git a/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak +new file mode 100644 +index 0000000000..720ec0cb57 +--- /dev/null ++++ b/configs/devices/aarch64-softmmu/aarch64-rh-devices.mak +@@ -0,0 +1,41 @@ ++include ../rh-virtio.mak ++ ++CONFIG_ARM_GIC_KVM=y ++CONFIG_ARM_GICV3_TCG=y ++CONFIG_ARM_GIC=y ++CONFIG_ARM_SMMUV3=y ++CONFIG_ARM_V7M=y ++CONFIG_ARM_VIRT=y ++CONFIG_CXL=y ++CONFIG_CXL_MEM_DEVICE=y ++CONFIG_EDID=y ++CONFIG_PCIE_PORT=y ++CONFIG_PCI_DEVICES=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_PFLASH_CFI01=y ++CONFIG_SCSI=y ++CONFIG_SEMIHOSTING=y ++CONFIG_USB=y ++CONFIG_USB_XHCI=y ++CONFIG_USB_XHCI_PCI=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y ++CONFIG_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VIRTIO_MMIO=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO_MEM=y ++CONFIG_VIRTIO_IOMMU=y ++CONFIG_XIO3130=y ++CONFIG_NVDIMM=y ++CONFIG_ACPI_APEI=y ++CONFIG_TPM=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_TIS_SYSBUS=y ++CONFIG_PTIMER=y ++CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y ++CONFIG_PVPANIC_PCI=y ++CONFIG_PXB=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y +diff --git a/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak +new file mode 100644 +index 0000000000..dbb7d30829 +--- /dev/null ++++ b/configs/devices/ppc64-softmmu/ppc64-rh-devices.mak +@@ -0,0 +1,37 @@ ++include ../rh-virtio.mak ++ ++CONFIG_DIMM=y ++CONFIG_MEM_DEVICE=y ++CONFIG_NVDIMM=y ++CONFIG_PCI=y ++CONFIG_PCI_DEVICES=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_PCI_EXPRESS=y ++CONFIG_PSERIES=y ++CONFIG_SCSI=y ++CONFIG_SPAPR_VSCSI=y ++CONFIG_TEST_DEVICES=y ++CONFIG_USB=y ++CONFIG_USB_OHCI=y ++CONFIG_USB_OHCI_PCI=y ++CONFIG_USB_SMARTCARD=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y ++CONFIG_USB_XHCI=y ++CONFIG_USB_XHCI_NEC=y ++CONFIG_USB_XHCI_PCI=y ++CONFIG_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VGA=y ++CONFIG_VGA_PCI=y ++CONFIG_VHOST_USER=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO_VGA=y ++CONFIG_WDT_IB6300ESB=y ++CONFIG_XICS=y ++CONFIG_XIVE=y ++CONFIG_TPM=y ++CONFIG_TPM_SPAPR=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y +diff --git a/configs/devices/rh-virtio.mak b/configs/devices/rh-virtio.mak +new file mode 100644 +index 0000000000..94ede1b5f6 +--- /dev/null ++++ b/configs/devices/rh-virtio.mak +@@ -0,0 +1,10 @@ ++CONFIG_VIRTIO=y ++CONFIG_VIRTIO_BALLOON=y ++CONFIG_VIRTIO_BLK=y ++CONFIG_VIRTIO_GPU=y ++CONFIG_VIRTIO_INPUT=y ++CONFIG_VIRTIO_INPUT_HOST=y ++CONFIG_VIRTIO_NET=y ++CONFIG_VIRTIO_RNG=y ++CONFIG_VIRTIO_SCSI=y ++CONFIG_VIRTIO_SERIAL=y +diff --git a/configs/devices/s390x-softmmu/s390x-rh-devices.mak b/configs/devices/s390x-softmmu/s390x-rh-devices.mak +new file mode 100644 +index 0000000000..69a799adbd +--- /dev/null ++++ b/configs/devices/s390x-softmmu/s390x-rh-devices.mak +@@ -0,0 +1,18 @@ ++include ../rh-virtio.mak ++ ++CONFIG_PCI=y ++CONFIG_S390_CCW_VIRTIO=y ++CONFIG_S390_FLIC=y ++CONFIG_S390_FLIC_KVM=y ++CONFIG_SCLPCONSOLE=y ++CONFIG_SCSI=y ++CONFIG_VFIO=y ++CONFIG_VFIO_AP=y ++CONFIG_VFIO_CCW=y ++CONFIG_VFIO_PCI=y ++CONFIG_VHOST_USER=y ++CONFIG_VIRTIO_CCW=y ++CONFIG_WDT_DIAG288=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y +diff --git a/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak +new file mode 100644 +index 0000000000..668b2d0e18 +--- /dev/null ++++ b/configs/devices/x86_64-softmmu/x86_64-rh-devices.mak +@@ -0,0 +1,109 @@ ++include ../rh-virtio.mak ++ ++CONFIG_ACPI=y ++CONFIG_ACPI_PCI=y ++CONFIG_ACPI_CPU_HOTPLUG=y ++CONFIG_ACPI_MEMORY_HOTPLUG=y ++CONFIG_ACPI_NVDIMM=y ++CONFIG_ACPI_SMBUS=y ++CONFIG_ACPI_VMGENID=y ++CONFIG_ACPI_X86=y ++CONFIG_ACPI_ICH9=y ++CONFIG_AHCI=y ++CONFIG_APIC=y ++CONFIG_APM=y ++CONFIG_BOCHS_DISPLAY=y ++CONFIG_CXL=y ++CONFIG_CXL_MEM_DEVICE=y ++CONFIG_DIMM=y ++CONFIG_E1000E_PCI_EXPRESS=y ++CONFIG_E1000_PCI=y ++CONFIG_EDU=y ++CONFIG_FDC=y ++CONFIG_FDC_SYSBUS=y ++CONFIG_FDC_ISA=y ++CONFIG_FW_CFG_DMA=y ++CONFIG_HDA=y ++CONFIG_HYPERV=y ++CONFIG_HYPERV_TESTDEV=y ++CONFIG_I2C=y ++CONFIG_I440FX=y ++CONFIG_I8254=y ++CONFIG_I8257=y ++CONFIG_I8259=y ++CONFIG_I82801B11=y ++CONFIG_IDE_CORE=y ++CONFIG_IDE_PCI=y ++CONFIG_IDE_PIIX=y ++CONFIG_IDE_QDEV=y ++CONFIG_IOAPIC=y ++CONFIG_IOH3420=y ++CONFIG_ISA_BUS=y ++CONFIG_ISA_DEBUG=y ++CONFIG_ISA_TESTDEV=y ++CONFIG_LPC_ICH9=y ++CONFIG_MC146818RTC=y ++CONFIG_MEM_DEVICE=y ++CONFIG_NVDIMM=y ++CONFIG_OPENGL=y ++CONFIG_PAM=y ++CONFIG_PC=y ++CONFIG_PCI=y ++CONFIG_PCIE_PORT=y ++CONFIG_PCI_DEVICES=y ++CONFIG_PCI_EXPRESS=y ++CONFIG_PCI_EXPRESS_Q35=y ++CONFIG_PCI_I440FX=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_PCKBD=y ++CONFIG_PCSPK=y ++CONFIG_PC_ACPI=y ++CONFIG_PC_PCI=y ++CONFIG_PFLASH_CFI01=y ++CONFIG_PVPANIC_ISA=y ++CONFIG_PXB=y ++CONFIG_Q35=y ++CONFIG_RTL8139_PCI=y ++CONFIG_SCSI=y ++CONFIG_SERIAL=y ++CONFIG_SERIAL_ISA=y ++CONFIG_SERIAL_PCI=y ++CONFIG_SEV=y ++CONFIG_SMBIOS=y ++CONFIG_SMBUS_EEPROM=y ++CONFIG_TEST_DEVICES=y ++CONFIG_USB=y ++CONFIG_USB_EHCI=y ++CONFIG_USB_EHCI_PCI=y ++CONFIG_USB_SMARTCARD=y ++CONFIG_USB_STORAGE_CORE=y ++CONFIG_USB_STORAGE_CLASSIC=y ++CONFIG_USB_UHCI=y ++CONFIG_USB_XHCI=y ++CONFIG_USB_XHCI_NEC=y ++CONFIG_USB_XHCI_PCI=y ++CONFIG_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VGA=y ++CONFIG_VGA_CIRRUS=y ++CONFIG_VGA_PCI=y ++CONFIG_VHOST_USER=y ++CONFIG_VHOST_USER_BLK=y ++CONFIG_VIRTIO_MEM=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO_VGA=y ++CONFIG_VIRTIO_IOMMU=y ++CONFIG_VMMOUSE=y ++CONFIG_VMPORT=y ++CONFIG_VTD=y ++CONFIG_WDT_IB6300ESB=y ++CONFIG_WDT_IB700=y ++CONFIG_XIO3130=y ++CONFIG_TPM=y ++CONFIG_TPM_CRB=y ++CONFIG_TPM_TIS_ISA=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_SGX=y ++CONFIG_VHOST_VSOCK=y ++CONFIG_VHOST_USER_VSOCK=y ++CONFIG_VHOST_USER_FS=y +diff --git a/hw/arm/meson.build b/hw/arm/meson.build +index b545ba0e4f..a41a16cba7 100644 +--- a/hw/arm/meson.build ++++ b/hw/arm/meson.build +@@ -29,7 +29,7 @@ arm_ss.add(when: 'CONFIG_VEXPRESS', if_true: files('vexpress.c')) + arm_ss.add(when: 'CONFIG_ZYNQ', if_true: files('xilinx_zynq.c')) + arm_ss.add(when: 'CONFIG_SABRELITE', if_true: files('sabrelite.c')) + +-arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c')) ++#arm_ss.add(when: 'CONFIG_ARM_V7M', if_true: files('armv7m.c')) + arm_ss.add(when: 'CONFIG_EXYNOS4', if_true: files('exynos4210.c')) + arm_ss.add(when: 'CONFIG_PXA2XX', if_true: files('pxa2xx.c', 'pxa2xx_gpio.c', 'pxa2xx_pic.c')) + arm_ss.add(when: 'CONFIG_DIGIC', if_true: files('digic.c')) +diff --git a/hw/block/fdc.c b/hw/block/fdc.c +index d7cc4d3ec1..12d0a60905 100644 +--- a/hw/block/fdc.c ++++ b/hw/block/fdc.c +@@ -49,6 +49,8 @@ + #include "qom/object.h" + #include "fdc-internal.h" + ++#include "hw/boards.h" ++ + /********************************************************/ + /* debug Floppy devices */ + +@@ -2346,6 +2348,14 @@ void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, Error **errp) + FDrive *drive; + static int command_tables_inited = 0; + ++ /* Restricted for Red Hat Enterprise Linux: */ ++ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); ++ if (!strstr(mc->name, "-rhel7.")) { ++ error_setg(errp, "Device %s is not supported with machine type %s", ++ object_get_typename(OBJECT(dev)), mc->name); ++ return; ++ } ++ + if (fdctrl->fallback == FLOPPY_DRIVE_TYPE_AUTO) { + error_setg(errp, "Cannot choose a fallback FDrive type of 'auto'"); + return; +diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build +index e37490074f..4431e3731c 100644 +--- a/hw/cpu/meson.build ++++ b/hw/cpu/meson.build +@@ -1,4 +1,5 @@ +-softmmu_ss.add(files('core.c', 'cluster.c')) ++#softmmu_ss.add(files('core.c', 'cluster.c')) ++softmmu_ss.add(files('core.c')) + + softmmu_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) + softmmu_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c')) +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index b80f98b6c4..cbde6a8f15 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -36,6 +36,7 @@ + #include "qemu/module.h" + #include "qemu/units.h" + #include "qemu/log.h" ++#include "qemu/error-report.h" + #include "sysemu/reset.h" + #include "qapi/error.h" + #include "trace.h" +@@ -47,6 +48,7 @@ + #include "qom/object.h" + #include "ui/console.h" + ++ + /* + * TODO: + * - destination write mask support not complete (bits 5..7) +@@ -2946,7 +2948,10 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp) + PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev); + int16_t device_id = pc->device_id; + +- /* ++ warn_report("'cirrus-vga' is deprecated, " ++ "please use a different VGA card instead"); ++ ++ /* + * Follow real hardware, cirrus card emulated has 4 MB video memory. + * Also accept 8 MB/16 MB for backward compatibility. + */ +diff --git a/hw/ide/piix.c b/hw/ide/piix.c +index 41d60921e3..a4af45b4e8 100644 +--- a/hw/ide/piix.c ++++ b/hw/ide/piix.c +@@ -193,7 +193,8 @@ static void piix3_ide_class_init(ObjectClass *klass, void *data) + k->device_id = PCI_DEVICE_ID_INTEL_82371SB_1; + k->class_id = PCI_CLASS_STORAGE_IDE; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); +- dc->hotpluggable = false; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo piix3_ide_info = { +@@ -216,6 +217,8 @@ static void piix4_ide_class_init(ObjectClass *klass, void *data) + k->class_id = PCI_CLASS_STORAGE_IDE; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + dc->hotpluggable = false; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo piix4_ide_info = { +diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c +index b92b63bedc..3b6235dde6 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -957,6 +957,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_kbd_isa; + adevc->build_dev_aml = i8042_build_aml; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->user_creatable = false; + } + + static const TypeInfo i8042_info = { +diff --git a/hw/net/e1000.c b/hw/net/e1000.c +index 23d660619f..b75c9aa799 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1805,6 +1805,7 @@ static const E1000Info e1000_devices[] = { + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, + }, ++#if 0 /* Disabled for Red Hat Enterprise Linux 7 */ + { + .name = "e1000-82544gc", + .device_id = E1000_DEV_ID_82544GC_COPPER, +@@ -1817,6 +1818,7 @@ static const E1000Info e1000_devices[] = { + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, + }, ++#endif + }; + + static void e1000_register_types(void) +diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c +index 8a4861f45a..fcb5dfe792 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -379,10 +379,12 @@ static const TypeInfo spapr_cpu_core_type_infos[] = { + .instance_size = sizeof(SpaprCpuCore), + .class_size = sizeof(SpaprCpuCoreClass), + }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + DEFINE_SPAPR_CPU_CORE_TYPE("970_v2.2"), + DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.0"), + DEFINE_SPAPR_CPU_CORE_TYPE("970mp_v1.1"), + DEFINE_SPAPR_CPU_CORE_TYPE("power5+_v2.1"), ++#endif + DEFINE_SPAPR_CPU_CORE_TYPE("power7_v2.3"), + DEFINE_SPAPR_CPU_CORE_TYPE("power7+_v2.1"), + DEFINE_SPAPR_CPU_CORE_TYPE("power8_v2.0"), +diff --git a/hw/usb/meson.build b/hw/usb/meson.build +index 599dc24f0d..905a994c3a 100644 +--- a/hw/usb/meson.build ++++ b/hw/usb/meson.build +@@ -52,7 +52,7 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade + if cacard.found() + usbsmartcard_ss = ss.source_set() + usbsmartcard_ss.add(when: 'CONFIG_USB_SMARTCARD', +- if_true: [cacard, files('ccid-card-emulated.c', 'ccid-card-passthru.c')]) ++ if_true: [cacard, files('ccid-card-passthru.c')]) + hw_usb_modules += {'smartcard': usbsmartcard_ss} + endif + +diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c +index df0c45e523..c154a4dcf2 100644 +--- a/target/arm/cpu_tcg.c ++++ b/target/arm/cpu_tcg.c +@@ -155,6 +155,7 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) + /* CPU models. These are not needed for the AArch64 linux-user build. */ + #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) + static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) + { +@@ -508,6 +509,7 @@ static void cortex_a9_initfn(Object *obj) + cpu->isar.reset_pmcr_el0 = 0x41093000; + define_arm_cp_regs(cpu, cortexa9_cp_reginfo); + } ++#endif /* disabled for RHEL */ + + #ifndef CONFIG_USER_ONLY + static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri) +@@ -532,6 +534,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = { + .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 }, + }; + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void cortex_a7_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -580,6 +583,7 @@ static void cortex_a7_initfn(Object *obj) + cpu->isar.reset_pmcr_el0 = 0x41072000; + define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */ + } ++#endif /* disabled for RHEL */ + + static void cortex_a15_initfn(Object *obj) + { +@@ -628,6 +632,7 @@ static void cortex_a15_initfn(Object *obj) + define_arm_cp_regs(cpu, cortexa15_cp_reginfo); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void cortex_m0_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -1110,6 +1115,7 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) + + cc->gdb_core_xml_file = "arm-m-profile.xml"; + } ++#endif /* disabled for RHEL */ + + #ifndef TARGET_AARCH64 + /* +@@ -1177,6 +1183,7 @@ static void arm_max_initfn(Object *obj) + #endif /* !TARGET_AARCH64 */ + + static const ARMCPUInfo arm_tcg_cpus[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "arm926", .initfn = arm926_initfn }, + { .name = "arm946", .initfn = arm946_initfn }, + { .name = "arm1026", .initfn = arm1026_initfn }, +@@ -1192,7 +1199,9 @@ static const ARMCPUInfo arm_tcg_cpus[] = { + { .name = "cortex-a7", .initfn = cortex_a7_initfn }, + { .name = "cortex-a8", .initfn = cortex_a8_initfn }, + { .name = "cortex-a9", .initfn = cortex_a9_initfn }, ++#endif /* disabled for RHEL */ + { .name = "cortex-a15", .initfn = cortex_a15_initfn }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "cortex-m0", .initfn = cortex_m0_initfn, + .class_init = arm_v7m_class_init }, + { .name = "cortex-m3", .initfn = cortex_m3_initfn, +@@ -1224,6 +1233,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = { + { .name = "pxa270-b1", .initfn = pxa270b1_initfn }, + { .name = "pxa270-c0", .initfn = pxa270c0_initfn }, + { .name = "pxa270-c5", .initfn = pxa270c5_initfn }, ++#endif /* disabled for RHEL */ + #ifndef TARGET_AARCH64 + { .name = "max", .initfn = arm_max_initfn }, + #endif +diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c +index 912b037c63..cd3ff700ac 100644 +--- a/target/ppc/cpu-models.c ++++ b/target/ppc/cpu-models.c +@@ -66,6 +66,7 @@ + #define POWERPC_DEF(_name, _pvr, _type, _desc) \ + POWERPC_DEF_SVR(_name, _desc, _pvr, POWERPC_SVR_NONE, _type) + ++#if 0 /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */ + /* Embedded PowerPC */ + /* PowerPC 405 family */ + /* PowerPC 405 cores */ +@@ -698,8 +699,10 @@ + "PowerPC 7447A v1.2 (G4)") + POWERPC_DEF("7457a_v1.2", CPU_POWERPC_74x7A_v12, 7455, + "PowerPC 7457A v1.2 (G4)") ++#endif + /* 64 bits PowerPC */ + #if defined(TARGET_PPC64) ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970, + "PowerPC 970 v2.2") + POWERPC_DEF("970fx_v1.0", CPU_POWERPC_970FX_v10, 970, +@@ -718,6 +721,7 @@ + "PowerPC 970MP v1.1") + POWERPC_DEF("power5+_v2.1", CPU_POWERPC_POWER5P_v21, POWER5P, + "POWER5+ v2.1") ++#endif + POWERPC_DEF("power7_v2.3", CPU_POWERPC_POWER7_v23, POWER7, + "POWER7 v2.3") + POWERPC_DEF("power7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER7, +@@ -896,12 +900,15 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "7447a", "7447a_v1.2" }, + { "7457a", "7457a_v1.2" }, + { "apollo7pm", "7457a_v1.0" }, ++#endif + #if defined(TARGET_PPC64) ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "970", "970_v2.2" }, + { "970fx", "970fx_v3.1" }, + { "970mp", "970mp_v1.1" }, + { "power5+", "power5+_v2.1" }, + { "power5gs", "power5+_v2.1" }, ++#endif + { "power7", "power7_v2.3" }, + { "power7+", "power7+_v2.1" }, + { "power8e", "power8e_v2.1" }, +@@ -911,12 +918,14 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "power10", "power10_v2.0" }, + #endif + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* Generic PowerPCs */ + #if defined(TARGET_PPC64) + { "ppc64", "970fx_v3.1" }, + #endif + { "ppc32", "604" }, + { "ppc", "604" }, ++#endif + + { NULL, NULL } + }; +diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c +index 63981bf36b..87a4480c05 100644 +--- a/target/s390x/cpu_models_sysemu.c ++++ b/target/s390x/cpu_models_sysemu.c +@@ -35,6 +35,9 @@ static void check_unavailable_features(const S390CPUModel *max_model, + (max_model->def->gen == model->def->gen && + max_model->def->ec_ga < model->def->ec_ga)) { + list_add_feat("type", unavailable); ++ } else if (model->def->gen < 11 && kvm_enabled()) { ++ /* Older CPU models are not supported on Red Hat Enterprise Linux */ ++ list_add_feat("type", unavailable); + } + + /* detect missing features if any to properly report them */ +diff --git a/target/s390x/kvm/kvm.c b/target/s390x/kvm/kvm.c +index 3ac7ec9acf..97da1a6424 100644 +--- a/target/s390x/kvm/kvm.c ++++ b/target/s390x/kvm/kvm.c +@@ -2529,6 +2529,14 @@ void kvm_s390_apply_cpu_model(const S390CPUModel *model, Error **errp) + error_setg(errp, "KVM doesn't support CPU models"); + return; + } ++ ++ /* Older CPU models are not supported on Red Hat Enterprise Linux */ ++ if (model->def->gen < 11) { ++ error_setg(errp, "KVM: Unsupported CPU type specified: %s", ++ MACHINE(qdev_get_machine())->cpu_type); ++ return; ++ } ++ + prop.cpuid = s390_cpuid_from_cpu_model(model); + prop.ibc = s390_ibc_from_cpu_model(model); + /* configure cpu features indicated via STFL(e) */ +-- +2.39.1 + diff --git a/0006-Machine-type-related-general-changes.patch b/0006-Machine-type-related-general-changes.patch new file mode 100644 index 0000000..5dd591f --- /dev/null +++ b/0006-Machine-type-related-general-changes.patch @@ -0,0 +1,677 @@ +From c13f8e21b32aa06b08847e88080f2fdea5084a9b Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 11 Jan 2019 09:54:45 +0100 +Subject: Machine type related general changes + +This patch is first part of original "Add RHEL machine types" patch we +split to allow easier review. It contains changes not related to any +architecture. + +Signed-off-by: Miroslav Rezanina +-- +Rebase notes (6.2.0): +- Do not duplicate minimal_version_id for piix4_pm +- Remove empty line chunks in serial.c +- Remove migration.h include in serial.c +- Update hw_compat_rhel_8_5 (from MR 66) + +Rebase notes (7.0.0): +- Remove downstream changes leftovers in hw/rtc/mc146818rtc.c +- Remove unnecessary change in hw/usb/hcd-uhci.c + +Rebase notes (7.1.0 rc0): +- Moved adding rhel_old_machine_deprecation variable from s390x to general machine types commit +- Moved adding hw_compat_rhel_8_6 struct from x86_64 to general machine types commit + +Merged patches (6.1.0): +- f2fb42a3c6 redhat: add missing entries in hw_compat_rhel_8_4 +- 1949ec258e hw/arm/virt: Disable PL011 clock migration through hw_compat_rhel_8_3 +- a3995e2eff Remove RHEL 7.0.0 machine type (only generic changes) +- ad3190a79b Remove RHEL 7.1.0 machine type (only generic changes) +- 84bbe15d4e Remove RHEL 7.2.0 machine type (only generic changes) +- 0215eb3356 Remove RHEL 7.3.0 machine types (only generic changes) +- af69d1ca6e Remove RHEL 7.4.0 machine types (only generic changes) +- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only generic changes) + +Merged patches (6.2.0): +- d687ac13d2 redhat: Define hw_compat_rhel_8_5 + +Merged patches (7.0.0): +- ef5afcc86d Fix virtio-net-pci* "vectors" compat +- 168f0d56e3 compat: Update hw_compat_rhel_8_5 with 6.2.0 RC2 changes + +Merged patches (7.1.0 rc0): +- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/acpi/piix4.c chunk) +- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/core/machine.c and include/hw/boards.h chunk) + +Merged patches (7.2.0 rc0): +- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts) + +Merged patches (8.0.0-rc1): +- 21ed34787b Addd 7.2 compat bits for RHEL 9.1 machine type +- e5c8d5d603 virtio-rng-pci: fix migration compat for vectors +- 5a5fa77059 virtio-rng-pci: fix transitional migration compat for vectors +--- + hw/acpi/piix4.c | 2 +- + hw/arm/virt.c | 2 +- + hw/core/machine.c | 229 +++++++++++++++++++++++++++++++++++ + hw/display/vga-isa.c | 2 +- + hw/i386/pc_piix.c | 2 + + hw/i386/pc_q35.c | 2 + + hw/net/rtl8139.c | 4 +- + hw/smbios/smbios.c | 46 ++++++- + hw/timer/i8254_common.c | 2 +- + hw/usb/hcd-xhci-pci.c | 59 ++++++--- + hw/usb/hcd-xhci-pci.h | 1 + + include/hw/boards.h | 31 +++++ + include/hw/firmware/smbios.h | 5 +- + include/hw/i386/pc.h | 3 + + 14 files changed, 367 insertions(+), 23 deletions(-) + +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index 63d2113b86..a24b9aac92 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -247,7 +247,7 @@ static bool vmstate_test_migrate_acpi_index(void *opaque, int version_id) + static const VMStateDescription vmstate_acpi = { + .name = "piix4_pm", + .version_id = 3, +- .minimum_version_id = 3, ++ .minimum_version_id = 2, + .post_load = vmstate_acpi_post_load, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState), +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index ac626b3bef..4a6e89c7bc 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -1629,7 +1629,7 @@ static void virt_build_smbios(VirtMachineState *vms) + + smbios_set_defaults("QEMU", product, + vmc->smbios_old_sys_ver ? "1.0" : mc->name, false, +- true, SMBIOS_ENTRY_POINT_TYPE_64); ++ true, NULL, NULL, SMBIOS_ENTRY_POINT_TYPE_64); + + /* build the array of physical mem area from base_memmap */ + mem_array.address = vms->memmap[VIRT_MEM].base; +diff --git a/hw/core/machine.c b/hw/core/machine.c +index cd13b8b0a3..5aa567fad3 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -46,6 +46,235 @@ GlobalProperty hw_compat_7_2[] = { + }; + const size_t hw_compat_7_2_len = G_N_ELEMENTS(hw_compat_7_2); + ++/* ++ * RHEL only: machine types for previous major releases are deprecated ++ */ ++const char *rhel_old_machine_deprecation = ++ "machine types for previous major releases are deprecated"; ++ ++/* ++ * Mostly the same as hw_compat_7_0 ++ */ ++GlobalProperty hw_compat_rhel_9_1[] = { ++ /* hw_compat_rhel_9_1 from hw_compat_7_0 */ ++ { "arm-gicv3-common", "force-8-bit-prio", "on" }, ++ /* hw_compat_rhel_9_1 from hw_compat_7_0 */ ++ { "nvme-ns", "eui64-default", "on"}, ++ /* hw_compat_rhel_9_1 from hw_compat_7_1 */ ++ { "virtio-device", "queue_reset", "false" }, ++ /* hw_compat_rhel_9_1 bz 2155749 */ ++ { "virtio-rng-pci", "vectors", "0" }, ++ /* hw_compat_rhel_9_1 bz 2162569 */ ++ { "virtio-rng-pci-transitional", "vectors", "0" }, ++ { "virtio-rng-pci-non-transitional", "vectors", "0" }, ++}; ++const size_t hw_compat_rhel_9_1_len = G_N_ELEMENTS(hw_compat_rhel_9_1); ++ ++/* ++ * Mostly the same as hw_compat_6_2 ++ */ ++GlobalProperty hw_compat_rhel_9_0[] = { ++ /* hw_compat_rhel_9_0 from hw_compat_6_2 */ ++ { "PIIX4_PM", "x-not-migrate-acpi-index", "on"}, ++}; ++const size_t hw_compat_rhel_9_0_len = G_N_ELEMENTS(hw_compat_rhel_9_0); ++ ++GlobalProperty hw_compat_rhel_8_6[] = { ++ /* hw_compat_rhel_8_6 bz 2065589 */ ++ /* ++ * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so ++ * we need do disable it downstream on the latest hw_compat_rhel_8. ++ */ ++ { "vhost-vsock-device", "seqpacket", "off" }, ++}; ++const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6); ++ ++/* ++ * Mostly the same as hw_compat_6_0 and hw_compat_6_1 ++ */ ++GlobalProperty hw_compat_rhel_8_5[] = { ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "gpex-pcihost", "allow-unmapped-accesses", "false" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "i8042", "extended-state", "false"}, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "nvme-ns", "eui64-default", "off"}, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "e1000", "init-vet", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "e1000e", "init-vet", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_0 */ ++ { "vhost-vsock-device", "seqpacket", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_1 */ ++ { "vhost-user-vsock-device", "seqpacket", "off" }, ++ /* hw_compat_rhel_8_5 from hw_compat_6_1 */ ++ { "nvme-ns", "shared", "off" }, ++}; ++const size_t hw_compat_rhel_8_5_len = G_N_ELEMENTS(hw_compat_rhel_8_5); ++ ++/* ++ * Mostly the same as hw_compat_5_2 ++ */ ++GlobalProperty hw_compat_rhel_8_4[] = { ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "ICH9-LPC", "smm-compat", "on"}, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "PIIX4_PM", "smm-compat", "on"}, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ { "virtio-blk-device", "report-discard-granularity", "off" }, ++ /* hw_compat_rhel_8_4 from hw_compat_5_2 */ ++ /* ++ * Upstream incorrectly had "virtio-net-pci" instead of "virtio-net-pci-base", ++ * (https://bugzilla.redhat.com/show_bug.cgi?id=1999141) ++ */ ++ { "virtio-net-pci-base", "vectors", "3"}, ++}; ++const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4); ++ ++/* ++ * Mostly the same as hw_compat_5_1 ++ */ ++GlobalProperty hw_compat_rhel_8_3[] = { ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-scsi", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-user-blk", "num-queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "vhost-user-scsi", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-blk-device", "num-queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-scsi-device", "num_queues", "1"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "nvme", "use-intel-id", "on"}, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "pvpanic", "events", "1"}, /* PVPANIC_PANICKED */ ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "pl011", "migrate-clk", "off" }, ++ /* hw_compat_rhel_8_3 bz 1912846 */ ++ { "pci-xhci", "x-rh-late-msi-cap", "off" }, ++ /* hw_compat_rhel_8_3 from hw_compat_5_1 */ ++ { "virtio-pci", "x-ats-page-aligned", "off"}, ++}; ++const size_t hw_compat_rhel_8_3_len = G_N_ELEMENTS(hw_compat_rhel_8_3); ++ ++/* ++ * The same as hw_compat_4_2 + hw_compat_5_0 ++ */ ++GlobalProperty hw_compat_rhel_8_2[] = { ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "queue-size", "128"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-scsi-device", "virtqueue_size", "128"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "x-enable-wce-if-config-wce", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-blk-device", "seg-max-adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-scsi-device", "seg_max_adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "vhost-blk-device", "seg_max_adjust", "off"}, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "usb-host", "suppress-remote-wake", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "usb-redir", "suppress-remote-wake", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "qxl", "revision", "4" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "qxl-vga", "revision", "4" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "fw_cfg", "acpi-mr-restore", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_4_2 */ ++ { "virtio-device", "use-disabled-flag", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "pci-host-bridge", "x-config-reg-migration-enabled", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "virtio-balloon-device", "page-poison", "false" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-read-set-eax", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-signal-unsupported-cmd", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-report-vmx-type", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "vmport", "x-cmds-v2", "off" }, ++ /* hw_compat_rhel_8_2 from hw_compat_5_0 */ ++ { "virtio-device", "x-disable-legacy-check", "true" }, ++}; ++const size_t hw_compat_rhel_8_2_len = G_N_ELEMENTS(hw_compat_rhel_8_2); ++ ++/* ++ * The same as hw_compat_4_1 ++ */ ++GlobalProperty hw_compat_rhel_8_1[] = { ++ /* hw_compat_rhel_8_1 from hw_compat_4_1 */ ++ { "virtio-pci", "x-pcie-flr-init", "off" }, ++}; ++const size_t hw_compat_rhel_8_1_len = G_N_ELEMENTS(hw_compat_rhel_8_1); ++ ++/* The same as hw_compat_3_1 ++ * format of array has been changed by: ++ * 6c36bddf5340 ("machine: Use shorter format for GlobalProperty arrays") ++ */ ++GlobalProperty hw_compat_rhel_8_0[] = { ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "pcie-root-port", "x-speed", "2_5" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "pcie-root-port", "x-width", "1" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "memory-backend-file", "x-use-canonical-path-for-ramblock-id", "true" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "memory-backend-memfd", "x-use-canonical-path-for-ramblock-id", "true" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "tpm-crb", "ppi", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "tpm-tis", "ppi", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-kbd", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-mouse", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "usb-tablet", "serial", "42" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "virtio-blk-device", "discard", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 */ ++ { "virtio-blk-device", "write-zeroes", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "VGA", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "secondary-vga", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "bochs-display", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-vga", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-gpu-device", "edid", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_4_0 */ ++ { "virtio-device", "use-started", "false" }, ++ /* hw_compat_rhel_8_0 from hw_compat_3_1 - that was added in 4.1 */ ++ { "pcie-root-port-base", "disable-acs", "true" }, ++}; ++const size_t hw_compat_rhel_8_0_len = G_N_ELEMENTS(hw_compat_rhel_8_0); ++ ++/* The same as hw_compat_3_0 + hw_compat_2_12 ++ * except that ++ * there's nothing in 3_0 ++ * migration.decompress-error-check=off was in 7.5 from bz 1584139 ++ */ ++GlobalProperty hw_compat_rhel_7_6[] = { ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "hda-audio", "use-timer", "false" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "cirrus-vga", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "VGA", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "vmware-svga", "global-vmstate", "true" }, ++ /* hw_compat_rhel_7_6 from hw_compat_2_12 */ ++ { "qxl-vga", "global-vmstate", "true" }, ++}; ++const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6); ++ + GlobalProperty hw_compat_7_1[] = { + { "virtio-device", "queue_reset", "false" }, + { "virtio-rng-pci", "vectors", "0" }, +diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c +index 2a5437d803..0db2c2b2a1 100644 +--- a/hw/display/vga-isa.c ++++ b/hw/display/vga-isa.c +@@ -89,7 +89,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp) + } + + static Property vga_isa_properties[] = { +- DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 8), ++ DEFINE_PROP_UINT32("vgamem_mb", ISAVGAState, state.vram_size_mb, 16), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 30eedd62a3..14a794081e 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -201,6 +201,8 @@ static void pc_init1(MachineState *machine, + smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", + mc->name, pcmc->smbios_legacy_mode, + pcmc->smbios_uuid_encoded, ++ pcmc->smbios_stream_product, ++ pcmc->smbios_stream_version, + pcms->smbios_entry_point_type); + } + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 797ba347fd..dc0ba5f9e7 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -202,6 +202,8 @@ static void pc_q35_init(MachineState *machine) + smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", + mc->name, pcmc->smbios_legacy_mode, + pcmc->smbios_uuid_encoded, ++ pcmc->smbios_stream_product, ++ pcmc->smbios_stream_version, + pcms->smbios_entry_point_type); + } + +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 5a5aaf868d..3d473d5869 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3178,7 +3178,7 @@ static int rtl8139_pre_save(void *opaque) + + static const VMStateDescription vmstate_rtl8139 = { + .name = "rtl8139", +- .version_id = 5, ++ .version_id = 4, + .minimum_version_id = 3, + .post_load = rtl8139_post_load, + .pre_save = rtl8139_pre_save, +@@ -3259,7 +3259,9 @@ static const VMStateDescription vmstate_rtl8139 = { + VMSTATE_UINT32(tally_counters.TxMCol, RTL8139State), + VMSTATE_UINT64(tally_counters.RxOkPhy, RTL8139State), + VMSTATE_UINT64(tally_counters.RxOkBrd, RTL8139State), ++#if 0 /* Disabled for Red Hat Enterprise Linux bz 1420195 */ + VMSTATE_UINT32_V(tally_counters.RxOkMul, RTL8139State, 5), ++#endif + VMSTATE_UINT16(tally_counters.TxAbt, RTL8139State), + VMSTATE_UINT16(tally_counters.TxUndrn, RTL8139State), + +diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c +index d2007e70fb..319eae9e9d 100644 +--- a/hw/smbios/smbios.c ++++ b/hw/smbios/smbios.c +@@ -58,6 +58,9 @@ static bool smbios_legacy = true; + static bool smbios_uuid_encoded = true; + /* end: legacy structures & constants for <= 2.0 machines */ + ++/* Set to true for modern Windows 10 HardwareID-6 compat */ ++static bool smbios_type2_required; ++ + + uint8_t *smbios_tables; + size_t smbios_tables_len; +@@ -670,7 +673,7 @@ static void smbios_build_type_1_table(void) + + static void smbios_build_type_2_table(void) + { +- SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, false); /* optional */ ++ SMBIOS_BUILD_TABLE_PRE(2, T2_BASE, smbios_type2_required); + + SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer); + SMBIOS_TABLE_SET_STR(2, product_str, type2.product); +@@ -980,7 +983,10 @@ void smbios_set_cpuid(uint32_t version, uint32_t features) + + void smbios_set_defaults(const char *manufacturer, const char *product, + const char *version, bool legacy_mode, +- bool uuid_encoded, SmbiosEntryPointType ep_type) ++ bool uuid_encoded, ++ const char *stream_product, ++ const char *stream_version, ++ SmbiosEntryPointType ep_type) + { + smbios_have_defaults = true; + smbios_legacy = legacy_mode; +@@ -1001,11 +1007,45 @@ void smbios_set_defaults(const char *manufacturer, const char *product, + g_free(smbios_entries); + } + ++ /* ++ * If @stream_product & @stream_version are non-NULL, then ++ * we're following rules for new Windows driver support. ++ * The data we have to report is defined in this doc: ++ * ++ * https://docs.microsoft.com/en-us/windows-hardware/drivers/install/specifying-hardware-ids-for-a-computer ++ * ++ * The Windows drivers are written to expect use of the ++ * scheme documented as "HardwareID-6" against Windows 10, ++ * which uses SMBIOS System (Type 1) and Base Board (Type 2) ++ * tables and will match on ++ * ++ * System Manufacturer = Red Hat (@manufacturer) ++ * System SKU Number = 8.2.0 (@stream_version) ++ * Baseboard Manufacturer = Red Hat (@manufacturer) ++ * Baseboard Product = RHEL-AV (@stream_product) ++ * ++ * NB, SKU must be changed with each RHEL-AV release ++ * ++ * Other fields can be freely used by applications using ++ * QEMU. For example apps can use the "System product" ++ * and "System version" to identify themselves. ++ * ++ * We get 'System Manufacturer' and 'Baseboard Manufacturer' ++ */ + SMBIOS_SET_DEFAULT(type1.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type1.product, product); + SMBIOS_SET_DEFAULT(type1.version, version); ++ SMBIOS_SET_DEFAULT(type1.family, "Red Hat Enterprise Linux"); ++ if (stream_version != NULL) { ++ SMBIOS_SET_DEFAULT(type1.sku, stream_version); ++ } + SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer); +- SMBIOS_SET_DEFAULT(type2.product, product); ++ if (stream_product != NULL) { ++ SMBIOS_SET_DEFAULT(type2.product, stream_product); ++ smbios_type2_required = true; ++ } else { ++ SMBIOS_SET_DEFAULT(type2.product, product); ++ } + SMBIOS_SET_DEFAULT(type2.version, version); + SMBIOS_SET_DEFAULT(type3.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type3.version, version); +diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c +index 050875b497..32935da46c 100644 +--- a/hw/timer/i8254_common.c ++++ b/hw/timer/i8254_common.c +@@ -231,7 +231,7 @@ static const VMStateDescription vmstate_pit_common = { + .pre_save = pit_dispatch_pre_save, + .post_load = pit_dispatch_post_load, + .fields = (VMStateField[]) { +- VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3), ++ VMSTATE_UINT32(channels[0].irq_disabled, PITCommonState), /* qemu-kvm's v2 had 'flags' here */ + VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2, + vmstate_pit_channel, PITChannelState), + VMSTATE_INT64(channels[0].next_transition_time, +diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c +index 643d4643e4..529bad9366 100644 +--- a/hw/usb/hcd-xhci-pci.c ++++ b/hw/usb/hcd-xhci-pci.c +@@ -104,6 +104,33 @@ static int xhci_pci_vmstate_post_load(void *opaque, int version_id) + return 0; + } + ++/* RH bz 1912846 */ ++static bool usb_xhci_pci_add_msi(struct PCIDevice *dev, Error **errp) ++{ ++ int ret; ++ Error *err = NULL; ++ XHCIPciState *s = XHCI_PCI(dev); ++ ++ ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err); ++ /* ++ * Any error other than -ENOTSUP(board's MSI support is broken) ++ * is a programming error ++ */ ++ assert(!ret || ret == -ENOTSUP); ++ if (ret && s->msi == ON_OFF_AUTO_ON) { ++ /* Can't satisfy user's explicit msi=on request, fail */ ++ error_append_hint(&err, "You have to use msi=auto (default) or " ++ "msi=off with this machine type.\n"); ++ error_propagate(errp, err); ++ return true; ++ } ++ assert(!err || s->msi == ON_OFF_AUTO_AUTO); ++ /* With msi=auto, we fall back to MSI off silently */ ++ error_free(err); ++ ++ return false; ++} ++ + static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + { + int ret; +@@ -125,23 +152,12 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + s->xhci.nec_quirks = true; + } + +- if (s->msi != ON_OFF_AUTO_OFF) { +- ret = msi_init(dev, 0x70, s->xhci.numintrs, true, false, &err); +- /* +- * Any error other than -ENOTSUP(board's MSI support is broken) +- * is a programming error +- */ +- assert(!ret || ret == -ENOTSUP); +- if (ret && s->msi == ON_OFF_AUTO_ON) { +- /* Can't satisfy user's explicit msi=on request, fail */ +- error_append_hint(&err, "You have to use msi=auto (default) or " +- "msi=off with this machine type.\n"); ++ if (s->msi != ON_OFF_AUTO_OFF && s->rh_late_msi_cap) { ++ /* This gives the behaviour from 5.2.0 onwards, lspci shows 90,a0,70 */ ++ if (usb_xhci_pci_add_msi(dev, &err)) { + error_propagate(errp, err); + return; + } +- assert(!err || s->msi == ON_OFF_AUTO_AUTO); +- /* With msi=auto, we fall back to MSI off silently */ +- error_free(err); + } + pci_register_bar(dev, 0, + PCI_BASE_ADDRESS_SPACE_MEMORY | +@@ -154,6 +170,14 @@ static void usb_xhci_pci_realize(struct PCIDevice *dev, Error **errp) + assert(ret > 0); + } + ++ /* RH bz 1912846 */ ++ if (s->msi != ON_OFF_AUTO_OFF && !s->rh_late_msi_cap) { ++ /* This gives the older RH machine behaviour, lspci shows 90,70,a0 */ ++ if (usb_xhci_pci_add_msi(dev, &err)) { ++ error_propagate(errp, err); ++ return; ++ } ++ } + if (s->msix != ON_OFF_AUTO_OFF) { + /* TODO check for errors, and should fail when msix=on */ + msix_init(dev, s->xhci.numintrs, +@@ -198,11 +222,18 @@ static void xhci_instance_init(Object *obj) + qdev_alias_all_properties(DEVICE(&s->xhci), obj); + } + ++static Property xhci_pci_properties[] = { ++ /* RH bz 1912846 */ ++ DEFINE_PROP_BOOL("x-rh-late-msi-cap", XHCIPciState, rh_late_msi_cap, true), ++ DEFINE_PROP_END_OF_LIST() ++}; ++ + static void xhci_class_init(ObjectClass *klass, void *data) + { + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); + ++ device_class_set_props(dc, xhci_pci_properties); + dc->reset = xhci_pci_reset; + dc->vmsd = &vmstate_xhci_pci; + set_bit(DEVICE_CATEGORY_USB, dc->categories); +diff --git a/hw/usb/hcd-xhci-pci.h b/hw/usb/hcd-xhci-pci.h +index 08f70ce97c..1be7527c1b 100644 +--- a/hw/usb/hcd-xhci-pci.h ++++ b/hw/usb/hcd-xhci-pci.h +@@ -40,6 +40,7 @@ typedef struct XHCIPciState { + XHCIState xhci; + OnOffAuto msi; + OnOffAuto msix; ++ bool rh_late_msi_cap; /* bz 1912846 */ + } XHCIPciState; + + #endif +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 6fbbfd56c8..c5a965d27f 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -459,4 +459,35 @@ extern const size_t hw_compat_2_2_len; + extern GlobalProperty hw_compat_2_1[]; + extern const size_t hw_compat_2_1_len; + ++extern GlobalProperty hw_compat_rhel_9_1[]; ++extern const size_t hw_compat_rhel_9_1_len; ++ ++extern GlobalProperty hw_compat_rhel_9_0[]; ++extern const size_t hw_compat_rhel_9_0_len; ++ ++extern GlobalProperty hw_compat_rhel_8_6[]; ++extern const size_t hw_compat_rhel_8_6_len; ++ ++extern GlobalProperty hw_compat_rhel_8_5[]; ++extern const size_t hw_compat_rhel_8_5_len; ++ ++extern GlobalProperty hw_compat_rhel_8_4[]; ++extern const size_t hw_compat_rhel_8_4_len; ++ ++extern GlobalProperty hw_compat_rhel_8_3[]; ++extern const size_t hw_compat_rhel_8_3_len; ++ ++extern GlobalProperty hw_compat_rhel_8_2[]; ++extern const size_t hw_compat_rhel_8_2_len; ++ ++extern GlobalProperty hw_compat_rhel_8_1[]; ++extern const size_t hw_compat_rhel_8_1_len; ++ ++extern GlobalProperty hw_compat_rhel_8_0[]; ++extern const size_t hw_compat_rhel_8_0_len; ++ ++extern GlobalProperty hw_compat_rhel_7_6[]; ++extern const size_t hw_compat_rhel_7_6_len; ++ ++extern const char *rhel_old_machine_deprecation; + #endif +diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h +index 7f3259a630..d24b3ccd32 100644 +--- a/include/hw/firmware/smbios.h ++++ b/include/hw/firmware/smbios.h +@@ -294,7 +294,10 @@ void smbios_entry_add(QemuOpts *opts, Error **errp); + void smbios_set_cpuid(uint32_t version, uint32_t features); + void smbios_set_defaults(const char *manufacturer, const char *product, + const char *version, bool legacy_mode, +- bool uuid_encoded, SmbiosEntryPointType ep_type); ++ bool uuid_encoded, ++ const char *stream_product, ++ const char *stream_version, ++ SmbiosEntryPointType ep_type); + uint8_t *smbios_get_table_legacy(MachineState *ms, size_t *length); + void smbios_get_tables(MachineState *ms, + const struct smbios_phys_mem_area *mem_array, +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 8206d5405a..908a275736 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -111,6 +111,9 @@ struct PCMachineClass { + bool smbios_defaults; + bool smbios_legacy_mode; + bool smbios_uuid_encoded; ++ /* New fields needed for Windows HardwareID-6 matching */ ++ const char *smbios_stream_product; ++ const char *smbios_stream_version; + + /* RAM / address space compat: */ + bool gigabyte_align; +-- +2.39.1 + diff --git a/0007-Add-aarch64-machine-types.patch b/0007-Add-aarch64-machine-types.patch new file mode 100644 index 0000000..f47bbd0 --- /dev/null +++ b/0007-Add-aarch64-machine-types.patch @@ -0,0 +1,712 @@ +From ec6468b65a3af0e2b84575c9f965f61916d0d8ea Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 19 Oct 2018 12:53:31 +0200 +Subject: Add aarch64 machine types + +Adding changes to add RHEL machine types for aarch64 architecture. + +Signed-off-by: Miroslav Rezanina +--- +Rebase notes (6.1.0): +- Use CONFIG_TPM check when using TPM structures +- Add support for default_bus_bypass_iommu +- ea4c0b32d9 arm/virt: Register highmem and gic-version as class properties +- 895e1fa86a hw/arm/virt: Add 8.5 and 9.0 machine types and remove older ones + +Rebase notes (7.0.0): +- Added dtb-kaslr-seed option +- Set no_tcg_lpa2 to true + +Rebase notes (7.1.0 rc0): +- replace dtb_kaslr_seed by dtb_randomness + +Rebase notes (7.1.0 rc3): +- Updated dtb_randomness comment + +Rebase notes (7.2.0 rc0): +- Disabled cortex-a35 + +Rebase notes (8.0.0-rc1): +- Moved changed code from target/arm/helper.c to target/arm/arm-qmp-cmds.c + +Merged patches (6.2.0): +- 9a3d4fde0e hw/arm/virt: Remove 9.0 machine type +- f7d04d6695 hw: arm: virt: Add hw_compat_rhel_8_5 to 8.5 machine type + +Merged patches (7.0.0): +- 3b82be3dd3 redhat: virt-rhel8.5.0: Update machine type compatibility for QEMU 6.2.0 update +- c354a86c9b hw/arm/virt: Register "iommu" as a class property +- c1a2630dc9 hw/arm/virt: Register "its" as a class property +- 9d8c61dc93 hw/arm/virt: Rename default_bus_bypass_iommu +- a1d1b6eeb6 hw/arm/virt: Expose the 'RAS' option +- 47f8fe1b82 hw/arm/virt: Add 9.0 machine type and remove 8.5 one +- ed2346788f hw/arm/virt: Check no_tcg_its and minor style changes + +Merged patches (7.0.0): +- f79b31bdef hw/arm/virt: Remove the dtb-kaslr-seed machine option +- b6fca85f4a hw/arm/virt: Fix missing initialization in instance/class_init() + +Merged patches (7.1.0 rc0): +- ac97dd4f9f RHEL-only: AArch64: Drop unsupported CPU types +- e9c0a70664 target/arm: deprecate named CPU models + +Merged patches (7.2.0 rc0): +- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts) + +Merged patches (8.0.0-rc1): +- c1a21266d8 redhat: aarch64: add rhel9.2.0 virt machine type +- d97cd7c513 redhat: fix virt-rhel9.2.0 compat props +--- + hw/arm/virt.c | 251 ++++++++++++++++++++++++++++++++- + include/hw/arm/virt.h | 8 ++ + target/arm/arm-qmp-cmds.c | 2 + + target/arm/cpu-qom.h | 1 + + target/arm/cpu.c | 5 + + target/arm/cpu.h | 2 + + target/arm/cpu64.c | 16 ++- + target/arm/cpu_tcg.c | 12 +- + tests/qtest/arm-cpu-features.c | 6 + + 9 files changed, 289 insertions(+), 14 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 4a6e89c7bc..1ae1654be5 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -81,6 +81,7 @@ + #include "hw/char/pl011.h" + #include "qemu/guest-random.h" + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ + static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ + void *data) \ +@@ -107,7 +108,48 @@ + DEFINE_VIRT_MACHINE_LATEST(major, minor, true) + #define DEFINE_VIRT_MACHINE(major, minor) \ + DEFINE_VIRT_MACHINE_LATEST(major, minor, false) +- ++#endif /* disabled for RHEL */ ++ ++#define DEFINE_RHEL_MACHINE_LATEST(m, n, s, latest) \ ++ static void rhel##m##n##s##_virt_class_init(ObjectClass *oc, \ ++ void *data) \ ++ { \ ++ MachineClass *mc = MACHINE_CLASS(oc); \ ++ rhel##m##n##s##_virt_options(mc); \ ++ mc->desc = "RHEL " # m "." # n "." # s " ARM Virtual Machine"; \ ++ if (latest) { \ ++ mc->alias = "virt"; \ ++ mc->is_default = 1; \ ++ } \ ++ } \ ++ static const TypeInfo rhel##m##n##s##_machvirt_info = { \ ++ .name = MACHINE_TYPE_NAME("virt-rhel" # m "." # n "." # s), \ ++ .parent = TYPE_RHEL_MACHINE, \ ++ .class_init = rhel##m##n##s##_virt_class_init, \ ++ }; \ ++ static void rhel##m##n##s##_machvirt_init(void) \ ++ { \ ++ type_register_static(&rhel##m##n##s##_machvirt_info); \ ++ } \ ++ type_init(rhel##m##n##s##_machvirt_init); ++ ++#define DEFINE_RHEL_MACHINE_AS_LATEST(major, minor, subminor) \ ++ DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, true) ++#define DEFINE_RHEL_MACHINE(major, minor, subminor) \ ++ DEFINE_RHEL_MACHINE_LATEST(major, minor, subminor, false) ++ ++/* This variable is for changes to properties that are RHEL specific, ++ * different to the current upstream and to be applied to the latest ++ * machine type. ++ */ ++GlobalProperty arm_rhel_compat[] = { ++ { ++ .driver = "virtio-net-pci", ++ .property = "romfile", ++ .value = "", ++ }, ++}; ++const size_t arm_rhel_compat_len = G_N_ELEMENTS(arm_rhel_compat); + + /* Number of external interrupt lines to configure the GIC with */ + #define NUM_IRQS 256 +@@ -204,16 +246,20 @@ static const int a15irqmap[] = { + }; + + static const char *valid_cpus[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + ARM_CPU_TYPE_NAME("cortex-a7"), + ARM_CPU_TYPE_NAME("cortex-a15"), + ARM_CPU_TYPE_NAME("cortex-a35"), + ARM_CPU_TYPE_NAME("cortex-a53"), + ARM_CPU_TYPE_NAME("cortex-a55"), ++#endif /* disabled for RHEL */ + ARM_CPU_TYPE_NAME("cortex-a57"), ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + ARM_CPU_TYPE_NAME("cortex-a72"), + ARM_CPU_TYPE_NAME("cortex-a76"), + ARM_CPU_TYPE_NAME("a64fx"), + ARM_CPU_TYPE_NAME("neoverse-n1"), ++#endif /* disabled for RHEL */ + ARM_CPU_TYPE_NAME("host"), + ARM_CPU_TYPE_NAME("max"), + }; +@@ -2339,6 +2385,7 @@ static void machvirt_init(MachineState *machine) + qemu_add_machine_init_done_notifier(&vms->machine_done); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_secure(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2366,6 +2413,7 @@ static void virt_set_virt(Object *obj, bool value, Error **errp) + + vms->virt = value; + } ++#endif /* disabled for RHEL */ + + static bool virt_get_highmem(Object *obj, Error **errp) + { +@@ -2380,7 +2428,7 @@ static void virt_set_highmem(Object *obj, bool value, Error **errp) + + vms->highmem = value; + } +- ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_compact_highmem(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2436,7 +2484,7 @@ static void virt_set_highmem_mmio(Object *obj, bool value, Error **errp) + + vms->highmem_mmio = value; + } +- ++#endif /* disabled for RHEL */ + + static bool virt_get_its(Object *obj, Error **errp) + { +@@ -2452,6 +2500,7 @@ static void virt_set_its(Object *obj, bool value, Error **errp) + vms->its = value; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_dtb_randomness(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2465,6 +2514,7 @@ static void virt_set_dtb_randomness(Object *obj, bool value, Error **errp) + + vms->dtb_randomness = value; + } ++#endif /* disabled for RHEL */ + + static char *virt_get_oem_id(Object *obj, Error **errp) + { +@@ -2548,6 +2598,7 @@ static void virt_set_ras(Object *obj, bool value, Error **errp) + vms->ras = value; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_mte(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2561,6 +2612,7 @@ static void virt_set_mte(Object *obj, bool value, Error **errp) + + vms->mte = value; + } ++#endif /* disabled for RHEL */ + + static char *virt_get_gic_version(Object *obj, Error **errp) + { +@@ -2988,6 +3040,7 @@ static int virt_kvm_type(MachineState *ms, const char *type_str) + return fixed_ipa ? 0 : requested_pa_size; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void virt_machine_class_init(ObjectClass *oc, void *data) + { + MachineClass *mc = MACHINE_CLASS(oc); +@@ -3441,3 +3494,195 @@ static void virt_machine_2_6_options(MachineClass *mc) + vmc->no_pmu = true; + } + DEFINE_VIRT_MACHINE(2, 6) ++#endif /* disabled for RHEL */ ++ ++static void rhel_machine_class_init(ObjectClass *oc, void *data) ++{ ++ MachineClass *mc = MACHINE_CLASS(oc); ++ HotplugHandlerClass *hc = HOTPLUG_HANDLER_CLASS(oc); ++ ++ mc->family = "virt-rhel-Z"; ++ mc->init = machvirt_init; ++ /* Maximum supported VCPU count for all virt-rhel* machines */ ++ mc->max_cpus = 384; ++#ifdef CONFIG_TPM ++ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); ++#endif ++ mc->block_default_type = IF_VIRTIO; ++ mc->no_cdrom = 1; ++ mc->pci_allow_0_address = true; ++ /* We know we will never create a pre-ARMv7 CPU which needs 1K pages */ ++ mc->minimum_page_bits = 12; ++ mc->possible_cpu_arch_ids = virt_possible_cpu_arch_ids; ++ mc->cpu_index_to_instance_props = virt_cpu_index_to_props; ++ mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a57"); ++ mc->get_default_cpu_node_id = virt_get_default_cpu_node_id; ++ mc->kvm_type = virt_kvm_type; ++ assert(!mc->get_hotplug_handler); ++ mc->get_hotplug_handler = virt_machine_get_hotplug_handler; ++ hc->pre_plug = virt_machine_device_pre_plug_cb; ++ hc->plug = virt_machine_device_plug_cb; ++ hc->unplug_request = virt_machine_device_unplug_request_cb; ++ hc->unplug = virt_machine_device_unplug_cb; ++ mc->nvdimm_supported = true; ++ mc->smp_props.clusters_supported = true; ++ mc->auto_enable_numa_with_memhp = true; ++ mc->auto_enable_numa_with_memdev = true; ++ mc->default_ram_id = "mach-virt.ram"; ++ ++ object_class_property_add(oc, "acpi", "OnOffAuto", ++ virt_get_acpi, virt_set_acpi, ++ NULL, NULL); ++ object_class_property_set_description(oc, "acpi", ++ "Enable ACPI"); ++ ++ object_class_property_add_bool(oc, "highmem", virt_get_highmem, ++ virt_set_highmem); ++ object_class_property_set_description(oc, "highmem", ++ "Set on/off to enable/disable using " ++ "physical address space above 32 bits"); ++ ++ object_class_property_add_str(oc, "gic-version", virt_get_gic_version, ++ virt_set_gic_version); ++ object_class_property_set_description(oc, "gic-version", ++ "Set GIC version. " ++ "Valid values are 2, 3, host and max"); ++ ++ object_class_property_add_str(oc, "iommu", virt_get_iommu, virt_set_iommu); ++ object_class_property_set_description(oc, "iommu", ++ "Set the IOMMU type. " ++ "Valid values are none and smmuv3"); ++ ++ object_class_property_add_bool(oc, "default-bus-bypass-iommu", ++ virt_get_default_bus_bypass_iommu, ++ virt_set_default_bus_bypass_iommu); ++ object_class_property_set_description(oc, "default-bus-bypass-iommu", ++ "Set on/off to enable/disable " ++ "bypass_iommu for default root bus"); ++ ++ object_class_property_add_bool(oc, "ras", virt_get_ras, ++ virt_set_ras); ++ object_class_property_set_description(oc, "ras", ++ "Set on/off to enable/disable reporting host memory errors " ++ "to a KVM guest using ACPI and guest external abort exceptions"); ++ ++ object_class_property_add_bool(oc, "its", virt_get_its, ++ virt_set_its); ++ object_class_property_set_description(oc, "its", ++ "Set on/off to enable/disable " ++ "ITS instantiation"); ++ ++ object_class_property_add_str(oc, "x-oem-id", ++ virt_get_oem_id, ++ virt_set_oem_id); ++ object_class_property_set_description(oc, "x-oem-id", ++ "Override the default value of field OEMID " ++ "in ACPI table header." ++ "The string may be up to 6 bytes in size"); ++ ++ ++ object_class_property_add_str(oc, "x-oem-table-id", ++ virt_get_oem_table_id, ++ virt_set_oem_table_id); ++ object_class_property_set_description(oc, "x-oem-table-id", ++ "Override the default value of field OEM Table ID " ++ "in ACPI table header." ++ "The string may be up to 8 bytes in size"); ++} ++ ++static void rhel_virt_instance_init(Object *obj) ++{ ++ VirtMachineState *vms = VIRT_MACHINE(obj); ++ VirtMachineClass *vmc = VIRT_MACHINE_GET_CLASS(vms); ++ ++ /* EL3 is disabled by default and non-configurable for RHEL */ ++ vms->secure = false; ++ ++ /* EL2 is disabled by default and non-configurable for RHEL */ ++ vms->virt = false; ++ ++ /* High memory is enabled by default */ ++ vms->highmem = true; ++ vms->highmem_compact = !vmc->no_highmem_compact; ++ vms->gic_version = VIRT_GIC_VERSION_NOSEL; ++ ++ vms->highmem_ecam = !vmc->no_highmem_ecam; ++ vms->highmem_mmio = true; ++ vms->highmem_redists = true; ++ ++ if (vmc->no_its) { ++ vms->its = false; ++ } else { ++ /* Default allows ITS instantiation */ ++ vms->its = true; ++ ++ if (vmc->no_tcg_its) { ++ vms->tcg_its = false; ++ } else { ++ vms->tcg_its = true; ++ } ++ } ++ ++ /* Default disallows iommu instantiation */ ++ vms->iommu = VIRT_IOMMU_NONE; ++ ++ /* The default root bus is attached to iommu by default */ ++ vms->default_bus_bypass_iommu = false; ++ ++ /* Default disallows RAS instantiation and is non-configurable for RHEL */ ++ vms->ras = false; ++ ++ /* MTE is disabled by default and non-configurable for RHEL */ ++ vms->mte = false; ++ ++ /* Supply kaslr-seed and rng-seed by default, non-configurable for RHEL */ ++ vms->dtb_randomness = true; ++ ++ vms->irqmap = a15irqmap; ++ ++ virt_flash_create(vms); ++ ++ vms->oem_id = g_strndup(ACPI_BUILD_APPNAME6, 6); ++ vms->oem_table_id = g_strndup(ACPI_BUILD_APPNAME8, 8); ++} ++ ++static const TypeInfo rhel_machine_info = { ++ .name = TYPE_RHEL_MACHINE, ++ .parent = TYPE_MACHINE, ++ .abstract = true, ++ .instance_size = sizeof(VirtMachineState), ++ .class_size = sizeof(VirtMachineClass), ++ .class_init = rhel_machine_class_init, ++ .instance_init = rhel_virt_instance_init, ++ .interfaces = (InterfaceInfo[]) { ++ { TYPE_HOTPLUG_HANDLER }, ++ { } ++ }, ++}; ++ ++static void rhel_machine_init(void) ++{ ++ type_register_static(&rhel_machine_info); ++} ++type_init(rhel_machine_init); ++ ++static void rhel920_virt_options(MachineClass *mc) ++{ ++ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len); ++} ++DEFINE_RHEL_MACHINE_AS_LATEST(9, 2, 0) ++ ++static void rhel900_virt_options(MachineClass *mc) ++{ ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ ++ rhel920_virt_options(mc); ++ ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len); ++ ++ /* Disable FEAT_LPA2 since old kernels (<= v5.12) don't boot with that feature */ ++ vmc->no_tcg_lpa2 = true; ++ /* Compact layout for high memory regions was introduced with 9.2.0 */ ++ vmc->no_highmem_compact = true; ++} ++DEFINE_RHEL_MACHINE(9, 0, 0) +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index e1ddbea96b..81c2363a40 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -187,9 +187,17 @@ struct VirtMachineState { + + #define VIRT_ECAM_ID(high) (high ? VIRT_HIGH_PCIE_ECAM : VIRT_PCIE_ECAM) + ++#if 0 /* disabled for Red Hat Enterprise Linux */ + #define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") + OBJECT_DECLARE_TYPE(VirtMachineState, VirtMachineClass, VIRT_MACHINE) + ++#else ++#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel") ++typedef struct VirtMachineClass VirtMachineClass; ++typedef struct VirtMachineState VirtMachineState; ++DECLARE_OBJ_CHECKERS(VirtMachineState, VirtMachineClass, VIRT_MACHINE, TYPE_RHEL_MACHINE) ++#endif ++ + void virt_acpi_setup(VirtMachineState *vms); + bool virt_is_acpi_enabled(VirtMachineState *vms); + +diff --git a/target/arm/arm-qmp-cmds.c b/target/arm/arm-qmp-cmds.c +index c8fa524002..3aa089abf3 100644 +--- a/target/arm/arm-qmp-cmds.c ++++ b/target/arm/arm-qmp-cmds.c +@@ -231,6 +231,7 @@ CpuModelExpansionInfo *qmp_query_cpu_model_expansion(CpuModelExpansionType type, + static void arm_cpu_add_definition(gpointer data, gpointer user_data) + { + ObjectClass *oc = data; ++ CPUClass *cc = CPU_CLASS(oc); + CpuDefinitionInfoList **cpu_list = user_data; + CpuDefinitionInfo *info; + const char *typename; +@@ -240,6 +241,7 @@ static void arm_cpu_add_definition(gpointer data, gpointer user_data) + info->name = g_strndup(typename, + strlen(typename) - strlen("-" TYPE_ARM_CPU)); + info->q_typename = g_strdup(typename); ++ info->deprecated = !!cc->deprecation_note; + + QAPI_LIST_PREPEND(*cpu_list, info); + } +diff --git a/target/arm/cpu-qom.h b/target/arm/cpu-qom.h +index 514c22ced9..f789173451 100644 +--- a/target/arm/cpu-qom.h ++++ b/target/arm/cpu-qom.h +@@ -35,6 +35,7 @@ typedef struct ARMCPUInfo { + const char *name; + void (*initfn)(Object *obj); + void (*class_init)(ObjectClass *oc, void *data); ++ const char *deprecation_note; + } ARMCPUInfo; + + void arm_cpu_register(const ARMCPUInfo *info); +diff --git a/target/arm/cpu.c b/target/arm/cpu.c +index 5182ed0c91..6740a8b940 100644 +--- a/target/arm/cpu.c ++++ b/target/arm/cpu.c +@@ -2290,8 +2290,13 @@ static void arm_cpu_instance_init(Object *obj) + static void cpu_register_class_init(ObjectClass *oc, void *data) + { + ARMCPUClass *acc = ARM_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + acc->info = data; ++ ++ if (acc->info->deprecation_note) { ++ cc->deprecation_note = acc->info->deprecation_note; ++ } + } + + void arm_cpu_register(const ARMCPUInfo *info) +diff --git a/target/arm/cpu.h b/target/arm/cpu.h +index c097cae988..829d4a2328 100644 +--- a/target/arm/cpu.h ++++ b/target/arm/cpu.h +@@ -34,6 +34,8 @@ + #define KVM_HAVE_MCE_INJECTION 1 + #endif + ++#define RHEL_CPU_DEPRECATION "use 'host' / 'max'" ++ + #define EXCP_UDEF 1 /* undefined instruction */ + #define EXCP_SWI 2 /* software interrupt */ + #define EXCP_PREFETCH_ABORT 3 +diff --git a/target/arm/cpu64.c b/target/arm/cpu64.c +index 0fb07cc7b6..47459627fb 100644 +--- a/target/arm/cpu64.c ++++ b/target/arm/cpu64.c +@@ -31,6 +31,7 @@ + #include "hw/qdev-properties.h" + #include "internals.h" + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void aarch64_a35_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -110,6 +111,7 @@ static void aarch64_a35_initfn(Object *obj) + /* These values are the same with A53/A57/A72. */ + define_cortex_a72_a57_a53_cp_reginfo(cpu); + } ++#endif /* disabled for RHEL */ + + void arm_cpu_sve_finalize(ARMCPU *cpu, Error **errp) + { +@@ -730,6 +732,7 @@ static void aarch64_a57_initfn(Object *obj) + define_cortex_a72_a57_a53_cp_reginfo(cpu); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void aarch64_a53_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -1164,6 +1167,7 @@ static void aarch64_neoverse_n1_initfn(Object *obj) + + define_neoverse_n1_cp_reginfo(cpu); + } ++#endif /* disabled for RHEL */ + + static void aarch64_host_initfn(Object *obj) + { +@@ -1373,14 +1377,19 @@ static void aarch64_max_initfn(Object *obj) + } + + static const ARMCPUInfo aarch64_cpus[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "cortex-a35", .initfn = aarch64_a35_initfn }, +- { .name = "cortex-a57", .initfn = aarch64_a57_initfn }, ++#endif /* disabled for RHEL */ ++ { .name = "cortex-a57", .initfn = aarch64_a57_initfn, ++ .deprecation_note = RHEL_CPU_DEPRECATION }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "cortex-a53", .initfn = aarch64_a53_initfn }, + { .name = "cortex-a55", .initfn = aarch64_a55_initfn }, + { .name = "cortex-a72", .initfn = aarch64_a72_initfn }, + { .name = "cortex-a76", .initfn = aarch64_a76_initfn }, + { .name = "a64fx", .initfn = aarch64_a64fx_initfn }, + { .name = "neoverse-n1", .initfn = aarch64_neoverse_n1_initfn }, ++#endif /* disabled for RHEL */ + { .name = "max", .initfn = aarch64_max_initfn }, + #if defined(CONFIG_KVM) || defined(CONFIG_HVF) + { .name = "host", .initfn = aarch64_host_initfn }, +@@ -1452,8 +1461,13 @@ static void aarch64_cpu_instance_init(Object *obj) + static void cpu_register_class_init(ObjectClass *oc, void *data) + { + ARMCPUClass *acc = ARM_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + acc->info = data; ++ ++ if (acc->info->deprecation_note) { ++ cc->deprecation_note = acc->info->deprecation_note; ++ } + } + + void aarch64_cpu_register(const ARMCPUInfo *info) +diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c +index c154a4dcf2..f29425b656 100644 +--- a/target/arm/cpu_tcg.c ++++ b/target/arm/cpu_tcg.c +@@ -152,10 +152,10 @@ void define_cortex_a72_a57_a53_cp_reginfo(ARMCPU *cpu) + } + #endif /* !CONFIG_USER_ONLY */ + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* CPU models. These are not needed for the AArch64 linux-user build. */ + #if !defined(CONFIG_USER_ONLY) || !defined(TARGET_AARCH64) + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + #if !defined(CONFIG_USER_ONLY) && defined(CONFIG_TCG) + static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) + { +@@ -509,7 +509,6 @@ static void cortex_a9_initfn(Object *obj) + cpu->isar.reset_pmcr_el0 = 0x41093000; + define_arm_cp_regs(cpu, cortexa9_cp_reginfo); + } +-#endif /* disabled for RHEL */ + + #ifndef CONFIG_USER_ONLY + static uint64_t a15_l2ctlr_read(CPUARMState *env, const ARMCPRegInfo *ri) +@@ -534,7 +533,6 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = { + .access = PL1_RW, .type = ARM_CP_CONST, .resetvalue = 0 }, + }; + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void cortex_a7_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -583,7 +581,6 @@ static void cortex_a7_initfn(Object *obj) + cpu->isar.reset_pmcr_el0 = 0x41072000; + define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */ + } +-#endif /* disabled for RHEL */ + + static void cortex_a15_initfn(Object *obj) + { +@@ -632,7 +629,6 @@ static void cortex_a15_initfn(Object *obj) + define_arm_cp_regs(cpu, cortexa15_cp_reginfo); + } + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void cortex_m0_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -1115,7 +1111,6 @@ static void arm_v7m_class_init(ObjectClass *oc, void *data) + + cc->gdb_core_xml_file = "arm-m-profile.xml"; + } +-#endif /* disabled for RHEL */ + + #ifndef TARGET_AARCH64 + /* +@@ -1183,7 +1178,6 @@ static void arm_max_initfn(Object *obj) + #endif /* !TARGET_AARCH64 */ + + static const ARMCPUInfo arm_tcg_cpus[] = { +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "arm926", .initfn = arm926_initfn }, + { .name = "arm946", .initfn = arm946_initfn }, + { .name = "arm1026", .initfn = arm1026_initfn }, +@@ -1199,9 +1193,7 @@ static const ARMCPUInfo arm_tcg_cpus[] = { + { .name = "cortex-a7", .initfn = cortex_a7_initfn }, + { .name = "cortex-a8", .initfn = cortex_a8_initfn }, + { .name = "cortex-a9", .initfn = cortex_a9_initfn }, +-#endif /* disabled for RHEL */ + { .name = "cortex-a15", .initfn = cortex_a15_initfn }, +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + { .name = "cortex-m0", .initfn = cortex_m0_initfn, + .class_init = arm_v7m_class_init }, + { .name = "cortex-m3", .initfn = cortex_m3_initfn, +@@ -1233,7 +1225,6 @@ static const ARMCPUInfo arm_tcg_cpus[] = { + { .name = "pxa270-b1", .initfn = pxa270b1_initfn }, + { .name = "pxa270-c0", .initfn = pxa270c0_initfn }, + { .name = "pxa270-c5", .initfn = pxa270c5_initfn }, +-#endif /* disabled for RHEL */ + #ifndef TARGET_AARCH64 + { .name = "max", .initfn = arm_max_initfn }, + #endif +@@ -1261,3 +1252,4 @@ static void arm_tcg_cpu_register_types(void) + type_init(arm_tcg_cpu_register_types) + + #endif /* !CONFIG_USER_ONLY || !TARGET_AARCH64 */ ++#endif /* disabled for RHEL */ +diff --git a/tests/qtest/arm-cpu-features.c b/tests/qtest/arm-cpu-features.c +index 1cb08138ad..834497dfec 100644 +--- a/tests/qtest/arm-cpu-features.c ++++ b/tests/qtest/arm-cpu-features.c +@@ -441,8 +441,10 @@ static void test_query_cpu_model_expansion(const void *data) + assert_error(qts, "host", "The CPU type 'host' requires KVM", NULL); + + /* Test expected feature presence/absence for some cpu types */ ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + assert_has_feature_enabled(qts, "cortex-a15", "pmu"); + assert_has_not_feature(qts, "cortex-a15", "aarch64"); ++#endif /* disabled for RHEL */ + + /* Enabling and disabling pmu should always work. */ + assert_has_feature_enabled(qts, "max", "pmu"); +@@ -459,6 +461,7 @@ static void test_query_cpu_model_expansion(const void *data) + assert_has_feature_enabled(qts, "cortex-a57", "pmu"); + assert_has_feature_enabled(qts, "cortex-a57", "aarch64"); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + assert_has_feature_enabled(qts, "a64fx", "pmu"); + assert_has_feature_enabled(qts, "a64fx", "aarch64"); + /* +@@ -471,6 +474,7 @@ static void test_query_cpu_model_expansion(const void *data) + "{ 'sve384': true }"); + assert_error(qts, "a64fx", "cannot enable sve640", + "{ 'sve640': true }"); ++#endif /* disabled for RHEL */ + + sve_tests_default(qts, "max"); + pauth_tests_default(qts, "max"); +@@ -506,9 +510,11 @@ static void test_query_cpu_model_expansion_kvm(const void *data) + QDict *resp; + char *error; + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + assert_error(qts, "cortex-a15", + "We cannot guarantee the CPU type 'cortex-a15' works " + "with KVM on this host", NULL); ++#endif /* disabled for RHEL */ + + assert_has_feature_enabled(qts, "host", "aarch64"); + +-- +2.39.1 + diff --git a/0008-Add-ppc64-machine-types.patch b/0008-Add-ppc64-machine-types.patch new file mode 100644 index 0000000..ab78cae --- /dev/null +++ b/0008-Add-ppc64-machine-types.patch @@ -0,0 +1,544 @@ +From 401d0ebf1ee959fd944df6b5b4ae9c51c36d1244 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 19 Oct 2018 13:27:13 +0200 +Subject: Add ppc64 machine types + +Adding changes to add RHEL machine types for ppc64 architecture. + +Signed-off-by: Miroslav Rezanina + +Rebase notes (6.2.0): +- Fixed rebase conflict relicts +- Update machine type compat for 6.2 (from MR 66) + +Merged patches (6.1.0): +- c438c25ac3 redhat: Define pseries-rhel8.5.0 machine type +- a3995e2eff Remove RHEL 7.0.0 machine type (only ppc64 changes) +- ad3190a79b Remove RHEL 7.1.0 machine type (only ppc64 changes) +- 84bbe15d4e Remove RHEL 7.2.0 machine type (only ppc64 changes) +- 0215eb3356 Remove RHEL 7.3.0 machine types (only ppc64 changes) +- af69d1ca6e Remove RHEL 7.4.0 machine types (only ppc64 changes) +- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only ppc64 changes) + +Merged patches (7.1.0 rc0): +- baa6790171 target/ppc/cpu-models: Fix ppc_cpu_aliases list for RHEL +--- + hw/ppc/spapr.c | 243 ++++++++++++++++++++++++++++++++++++++++ + hw/ppc/spapr_cpu_core.c | 13 +++ + include/hw/ppc/spapr.h | 4 + + target/ppc/compat.c | 13 ++- + target/ppc/cpu-models.c | 1 + + target/ppc/cpu.h | 1 + + target/ppc/kvm.c | 27 +++++ + target/ppc/kvm_ppc.h | 13 +++ + 8 files changed, 314 insertions(+), 1 deletion(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 4921198b9d..e24b3e22e3 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1634,6 +1634,9 @@ static void spapr_machine_reset(MachineState *machine, ShutdownCause reason) + + pef_kvm_reset(machine->cgs, &error_fatal); + spapr_caps_apply(spapr); ++ if (spapr->svm_allowed) { ++ kvmppc_svm_allow(&error_fatal); ++ } + + first_ppc_cpu = POWERPC_CPU(first_cpu); + if (kvm_enabled() && kvmppc_has_cap_mmu_radix() && +@@ -3348,6 +3351,20 @@ static void spapr_set_host_serial(Object *obj, const char *value, Error **errp) + spapr->host_serial = g_strdup(value); + } + ++static bool spapr_get_svm_allowed(Object *obj, Error **errp) ++{ ++ SpaprMachineState *spapr = SPAPR_MACHINE(obj); ++ ++ return spapr->svm_allowed; ++} ++ ++static void spapr_set_svm_allowed(Object *obj, bool value, Error **errp) ++{ ++ SpaprMachineState *spapr = SPAPR_MACHINE(obj); ++ ++ spapr->svm_allowed = value; ++} ++ + static void spapr_instance_init(Object *obj) + { + SpaprMachineState *spapr = SPAPR_MACHINE(obj); +@@ -3426,6 +3443,12 @@ static void spapr_instance_init(Object *obj) + spapr_get_host_serial, spapr_set_host_serial); + object_property_set_description(obj, "host-serial", + "Host serial number to advertise in guest device tree"); ++ object_property_add_bool(obj, "x-svm-allowed", ++ spapr_get_svm_allowed, ++ spapr_set_svm_allowed); ++ object_property_set_description(obj, "x-svm-allowed", ++ "Allow the guest to become a Secure Guest" ++ " (experimental only)"); + } + + static void spapr_machine_finalizefn(Object *obj) +@@ -4683,6 +4706,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) + vmc->client_architecture_support = spapr_vof_client_architecture_support; + vmc->quiesce = spapr_vof_quiesce; + vmc->setprop = spapr_vof_setprop; ++ smc->has_power9_support = true; + } + + static const TypeInfo spapr_machine_info = { +@@ -4734,6 +4758,7 @@ static void spapr_machine_latest_class_options(MachineClass *mc) + } \ + type_init(spapr_machine_register_##suffix) + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* + * pseries-8.0 + */ +@@ -4894,6 +4919,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc) + } + + DEFINE_SPAPR_MACHINE(4_1, "4.1", false); ++#endif + + /* + * pseries-4.0 +@@ -4913,6 +4939,8 @@ static bool phb_placement_4_0(SpaprMachineState *spapr, uint32_t index, + *nv2atsd = 0; + return true; + } ++ ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void spapr_machine_4_0_class_options(MachineClass *mc) + { + SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +@@ -5240,6 +5268,221 @@ static void spapr_machine_2_1_class_options(MachineClass *mc) + compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len); + } + DEFINE_SPAPR_MACHINE(2_1, "2.1", false); ++#endif ++ ++static void spapr_machine_rhel_default_class_options(MachineClass *mc) ++{ ++ /* ++ * Defaults for the latest behaviour inherited from the base class ++ * can be overriden here for all pseries-rhel* machines. ++ */ ++ ++ /* Maximum supported VCPU count */ ++ mc->max_cpus = 384; ++} ++ ++/* ++ * pseries-rhel8.5.0 ++ * like pseries-6.0 ++ */ ++ ++static void spapr_machine_rhel850_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ /* The default machine type must apply the RHEL specific defaults */ ++ spapr_machine_rhel_default_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_5, ++ hw_compat_rhel_8_5_len); ++ smc->pre_6_2_numa_affinity = true; ++ mc->smp_props.prefer_sockets = true; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel850, "rhel8.5.0", true); ++ ++/* ++ * pseries-rhel8.4.0 ++ * like pseries-5.2 ++ */ ++ ++static void spapr_machine_rhel840_class_options(MachineClass *mc) ++{ ++ spapr_machine_rhel850_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_len); ++} ++ ++DEFINE_SPAPR_MACHINE(rhel840, "rhel8.4.0", false); ++ ++/* ++ * pseries-rhel8.3.0 ++ * like pseries-5.1 ++ */ ++ ++static void spapr_machine_rhel830_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel840_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_3, ++ hw_compat_rhel_8_3_len); ++ ++ /* from pseries-5.1 */ ++ smc->pre_5_2_numa_associativity = true; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel830, "rhel8.3.0", false); ++ ++/* ++ * pseries-rhel8.2.0 ++ * like pseries-4.2 + pseries-5.0 ++ * except SPAPR_CAP_CCF_ASSIST that has been backported to pseries-rhel8.1.0 ++ */ ++ ++static void spapr_machine_rhel820_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ /* from pseries-5.0 */ ++ static GlobalProperty compat[] = { ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-5.1-associativity", "on" }, ++ }; ++ ++ spapr_machine_rhel830_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_2, ++ hw_compat_rhel_8_2_len); ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ ++ /* from pseries-4.2 */ ++ smc->default_caps.caps[SPAPR_CAP_FWNMI] = SPAPR_CAP_OFF; ++ smc->rma_limit = 16 * GiB; ++ mc->nvdimm_supported = false; ++ ++ /* from pseries-5.0 */ ++ mc->numa_mem_supported = true; ++ smc->pre_5_1_assoc_refpoints = true; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel820, "rhel8.2.0", false); ++ ++/* ++ * pseries-rhel8.1.0 ++ * like pseries-4.1 ++ */ ++ ++static void spapr_machine_rhel810_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ static GlobalProperty compat[] = { ++ /* Only allow 4kiB and 64kiB IOMMU pagesizes */ ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pgsz", "0x11000" }, ++ }; ++ ++ spapr_machine_rhel820_class_options(mc); ++ ++ /* from pseries-4.1 */ ++ smc->linux_pci_probe = false; ++ smc->smp_threads_vsmt = false; ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_1, ++ hw_compat_rhel_8_1_len); ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ ++ /* from pseries-4.2 */ ++ smc->default_caps.caps[SPAPR_CAP_CCF_ASSIST] = SPAPR_CAP_OFF; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel810, "rhel8.1.0", false); ++ ++/* ++ * pseries-rhel8.0.0 ++ * like pseries-3.1 and pseries-4.0 ++ * except SPAPR_CAP_CFPC, SPAPR_CAP_SBBC and SPAPR_CAP_IBS ++ * that have been backported to pseries-rhel8.0.0 ++ */ ++ ++static void spapr_machine_rhel800_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel810_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_0, ++ hw_compat_rhel_8_0_len); ++ ++ /* pseries-4.0 */ ++ smc->phb_placement = phb_placement_4_0; ++ smc->irq = &spapr_irq_xics; ++ smc->pre_4_1_migration = true; ++ ++ /* pseries-3.1 */ ++ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power8_v2.0"); ++ smc->update_dt_enabled = false; ++ smc->dr_phb_enabled = false; ++ smc->broken_host_serial_model = true; ++ smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] = SPAPR_CAP_OFF; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel800, "rhel8.0.0", false); ++ ++/* ++ * pseries-rhel7.6.0 ++ * like spapr_compat_2_12 and spapr_compat_3_0 ++ * spapr_compat_0 is empty ++ */ ++GlobalProperty spapr_compat_rhel7_6[] = { ++ { TYPE_POWERPC_CPU, "pre-3.0-migration", "on" }, ++ { TYPE_SPAPR_CPU_CORE, "pre-3.0-migration", "on" }, ++}; ++const size_t spapr_compat_rhel7_6_len = G_N_ELEMENTS(spapr_compat_rhel7_6); ++ ++ ++static void spapr_machine_rhel760_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel800_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++ compat_props_add(mc->compat_props, spapr_compat_rhel7_6, spapr_compat_rhel7_6_len); ++ ++ /* from spapr_machine_3_0_class_options() */ ++ smc->legacy_irq_allocation = true; ++ smc->nr_xirqs = 0x400; ++ smc->irq = &spapr_irq_xics_legacy; ++ ++ /* from spapr_machine_2_12_class_options() */ ++ /* We depend on kvm_enabled() to choose a default value for the ++ * hpt-max-page-size capability. Of course we can't do it here ++ * because this is too early and the HW accelerator isn't initialzed ++ * yet. Postpone this to machine init (see default_caps_with_cpu()). ++ */ ++ smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] = 0; ++ ++ /* SPAPR_CAP_WORKAROUND enabled in pseries-rhel800 by ++ * f21757edc554 ++ * "Enable mitigations by default for pseries-4.0 machine type") ++ */ ++ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_BROKEN; ++ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_BROKEN; ++ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_BROKEN; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel760, "rhel7.6.0", false); ++ ++/* ++ * pseries-rhel7.6.0-sxxm ++ * ++ * pseries-rhel7.6.0 with speculative execution exploit mitigations enabled by default ++ */ ++ ++static void spapr_machine_rhel760sxxm_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel760_class_options(mc); ++ smc->default_caps.caps[SPAPR_CAP_CFPC] = SPAPR_CAP_WORKAROUND; ++ smc->default_caps.caps[SPAPR_CAP_SBBC] = SPAPR_CAP_WORKAROUND; ++ smc->default_caps.caps[SPAPR_CAP_IBS] = SPAPR_CAP_FIXED_CCD; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel760sxxm, "rhel7.6.0-sxxm", false); + + static void spapr_machine_register_types(void) + { +diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c +index fcb5dfe792..ab8fb5bf62 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -25,6 +25,7 @@ + #include "sysemu/reset.h" + #include "sysemu/hw_accel.h" + #include "qemu/error-report.h" ++#include "cpu-models.h" + + static void spapr_reset_vcpu(PowerPCCPU *cpu) + { +@@ -259,6 +260,7 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, + { + CPUPPCState *env = &cpu->env; + CPUState *cs = CPU(cpu); ++ SpaprMachineClass *smc = SPAPR_MACHINE_GET_CLASS(spapr); + + if (!qdev_realize(DEVICE(cpu), NULL, errp)) { + return false; +@@ -270,6 +272,17 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, + /* Set time-base frequency to 512 MHz. vhyp must be set first. */ + cpu_ppc_tb_init(env, SPAPR_TIMEBASE_FREQ); + ++ if (!smc->has_power9_support && ++ (((spapr->max_compat_pvr && ++ ppc_compat_cmp(spapr->max_compat_pvr, ++ CPU_POWERPC_LOGICAL_3_00) >= 0)) || ++ (!spapr->max_compat_pvr && ++ ppc_check_compat(cpu, CPU_POWERPC_LOGICAL_3_00, 0, 0)))) { ++ error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, ++ "POWER9 CPU is not supported by this machine class"); ++ return false; ++ } ++ + if (spapr_irq_cpu_intc_create(spapr, cpu, errp) < 0) { + qdev_unrealize(DEVICE(cpu)); + return false; +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index 5c8aabd444..04489d5808 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -155,6 +155,7 @@ struct SpaprMachineClass { + bool pre_5_2_numa_associativity; + bool pre_6_2_numa_affinity; + ++ bool has_power9_support; + bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index, + uint64_t *buid, hwaddr *pio, + hwaddr *mmio32, hwaddr *mmio64, +@@ -257,6 +258,9 @@ struct SpaprMachineState { + /* Set by -boot */ + char *boot_device; + ++ /* Secure Guest support via x-svm-allowed */ ++ bool svm_allowed; ++ + /*< public >*/ + char *kvm_type; + char *host_model; +diff --git a/target/ppc/compat.c b/target/ppc/compat.c +index 7949a24f5a..f207a9ba01 100644 +--- a/target/ppc/compat.c ++++ b/target/ppc/compat.c +@@ -114,8 +114,19 @@ static const CompatInfo *compat_by_pvr(uint32_t pvr) + return NULL; + } + ++long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2) ++{ ++ const CompatInfo *compat1 = compat_by_pvr(pvr1); ++ const CompatInfo *compat2 = compat_by_pvr(pvr2); ++ ++ g_assert(compat1); ++ g_assert(compat2); ++ ++ return compat1 - compat2; ++} ++ + static bool pcc_compat(PowerPCCPUClass *pcc, uint32_t compat_pvr, +- uint32_t min_compat_pvr, uint32_t max_compat_pvr) ++ uint32_t min_compat_pvr, uint32_t max_compat_pvr) + { + const CompatInfo *compat = compat_by_pvr(compat_pvr); + const CompatInfo *min = compat_by_pvr(min_compat_pvr); +diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c +index cd3ff700ac..1cb49c8087 100644 +--- a/target/ppc/cpu-models.c ++++ b/target/ppc/cpu-models.c +@@ -746,6 +746,7 @@ + /* PowerPC CPU aliases */ + + PowerPCCPUAlias ppc_cpu_aliases[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "405", "405d4" }, + { "405cr", "405crc" }, + { "405gp", "405gpd" }, +diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h +index 557d736dab..6646ec1c27 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -1482,6 +1482,7 @@ static inline int cpu_mmu_index(CPUPPCState *env, bool ifetch) + + /* Compatibility modes */ + #if defined(TARGET_PPC64) ++long ppc_compat_cmp(uint32_t pvr1, uint32_t pvr2); + bool ppc_check_compat(PowerPCCPU *cpu, uint32_t compat_pvr, + uint32_t min_compat_pvr, uint32_t max_compat_pvr); + bool ppc_type_check_compat(const char *cputype, uint32_t compat_pvr, +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 78f6fc50cd..68d06c3f8f 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -88,6 +88,7 @@ static int cap_ppc_nested_kvm_hv; + static int cap_large_decr; + static int cap_fwnmi; + static int cap_rpt_invalidate; ++static int cap_ppc_secure_guest; + + static uint32_t debug_inst_opcode; + +@@ -135,6 +136,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) + cap_resize_hpt = kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT); + kvmppc_get_cpu_characteristics(s); + cap_ppc_nested_kvm_hv = kvm_vm_check_extension(s, KVM_CAP_PPC_NESTED_HV); ++ cap_ppc_secure_guest = kvm_vm_check_extension(s, KVM_CAP_PPC_SECURE_GUEST); + cap_large_decr = kvmppc_get_dec_bits(); + cap_fwnmi = kvm_vm_check_extension(s, KVM_CAP_PPC_FWNMI); + /* +@@ -2569,6 +2571,16 @@ int kvmppc_has_cap_rpt_invalidate(void) + return cap_rpt_invalidate; + } + ++bool kvmppc_has_cap_secure_guest(void) ++{ ++ return !!cap_ppc_secure_guest; ++} ++ ++int kvmppc_enable_cap_secure_guest(void) ++{ ++ return kvm_vm_enable_cap(kvm_state, KVM_CAP_PPC_SECURE_GUEST, 0, 1); ++} ++ + PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) + { + uint32_t host_pvr = mfpvr(); +@@ -2969,3 +2981,18 @@ bool kvm_arch_cpu_check_are_resettable(void) + void kvm_arch_accel_class_init(ObjectClass *oc) + { + } ++ ++void kvmppc_svm_allow(Error **errp) ++{ ++ if (!kvm_enabled()) { ++ error_setg(errp, "No PEF support in tcg, try x-svm-allowed=off"); ++ return; ++ } ++ ++ if (!kvmppc_has_cap_secure_guest()) { ++ error_setg(errp, "KVM implementation does not support secure guests, " ++ "try x-svm-allowed=off"); ++ } else if (kvmppc_enable_cap_secure_guest() < 0) { ++ error_setg(errp, "Error enabling x-svm-allowed, try x-svm-allowed=off"); ++ } ++} +diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h +index 5fd9753953..b5ebfe2be0 100644 +--- a/target/ppc/kvm_ppc.h ++++ b/target/ppc/kvm_ppc.h +@@ -43,6 +43,7 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu); + target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, + bool radix, bool gtse, + uint64_t proc_tbl); ++void kvmppc_svm_allow(Error **errp); + #ifndef CONFIG_USER_ONLY + bool kvmppc_spapr_use_multitce(void); + int kvmppc_spapr_enable_inkernel_multitce(void); +@@ -77,6 +78,8 @@ int kvmppc_get_cap_large_decr(void); + int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable); + int kvmppc_has_cap_rpt_invalidate(void); + int kvmppc_enable_hwrng(void); ++bool kvmppc_has_cap_secure_guest(void); ++int kvmppc_enable_cap_secure_guest(void); + int kvmppc_put_books_sregs(PowerPCCPU *cpu); + PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void); + void kvmppc_check_papr_resize_hpt(Error **errp); +@@ -396,6 +399,16 @@ static inline int kvmppc_has_cap_rpt_invalidate(void) + return false; + } + ++static inline bool kvmppc_has_cap_secure_guest(void) ++{ ++ return false; ++} ++ ++static inline int kvmppc_enable_cap_secure_guest(void) ++{ ++ return -1; ++} ++ + static inline int kvmppc_enable_hwrng(void) + { + return -1; +-- +2.39.1 + diff --git a/0009-Add-s390x-machine-types.patch b/0009-Add-s390x-machine-types.patch new file mode 100644 index 0000000..07dfb57 --- /dev/null +++ b/0009-Add-s390x-machine-types.patch @@ -0,0 +1,286 @@ +From 3c7647197729fcd76e219070c6f359bb3667d04d Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 19 Oct 2018 13:47:32 +0200 +Subject: Add s390x machine types + +Adding changes to add RHEL machine types for s390x architecture. + +Signed-off-by: Miroslav Rezanina +-- + +Rebase changes (7.1.0 rc0): +- Moved adding rhel_old_machine_deprecation variable to general machine types commit + +Merged patches (6.1.0): +- 64a9a5c971 hw/s390x: Remove the RHEL7-only machine type +- 395516d62b redhat: s390x: add rhel-8.5.0 compat machine + +Merged patches (6.2.0): +- 3bf66f4520 redhat: Add s390x machine type compatibility update for 6.1 rebase + +Merged patches (7.0.0): +- e6ff4de4f7 redhat: Add s390x machine type compatibility handling for the rebase to v6.2 +- 4b0efa7e21 redhat: Add rhel8.6.0 and rhel9.0.0 machine types for s390x +- dcc64971bf RHEL: mark old machine types as deprecated (partialy) + +Merged patches (7.1.0 rc0): +- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (only hw/s390x/s390-virtio-ccw.c chunk) +- c8ad21ca31 redhat: Update s390x machine type compatibility for rebase to QEMU 7.0.0 +- 5bcf8d874c target/s390x: deprecate CPUs older than z14 + +Merged patches (7.2.0 rc0): +- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts) + +Merged patches (8.0.0-rc1): +- 27c188c6a4 redhat: Update s390x machine type compatibility for QEMU 7.2.0 update +- a932b8d429 redhat: Add new rhel-9.2.0 s390x machine type +- ac88104bad s390x/s390-virtio-ccw: Activate zPCI features on s390-ccw-virtio-rhel8.6.0 +--- + hw/s390x/s390-virtio-ccw.c | 143 +++++++++++++++++++++++++++++++ + target/s390x/cpu_models.c | 11 +++ + target/s390x/cpu_models.h | 2 + + target/s390x/cpu_models_sysemu.c | 2 + + 4 files changed, 158 insertions(+) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 503f212a31..dcd3b966b0 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -826,6 +826,7 @@ bool css_migration_enabled(void) + } \ + type_init(ccw_machine_register_##suffix) + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void ccw_machine_8_0_instance_options(MachineState *machine) + { + } +@@ -1201,6 +1202,148 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) + compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + } + DEFINE_CCW_MACHINE(2_4, "2.4", false); ++#endif ++ ++ ++static void ccw_machine_rhel920_instance_options(MachineState *machine) ++{ ++} ++ ++static void ccw_machine_rhel920_class_options(MachineClass *mc) ++{ ++} ++DEFINE_CCW_MACHINE(rhel920, "rhel9.2.0", true); ++ ++static void ccw_machine_rhel900_instance_options(MachineState *machine) ++{ ++ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V6_2 }; ++ ++ ccw_machine_rhel920_instance_options(machine); ++ ++ s390_set_qemu_cpu_model(0x3906, 14, 2, qemu_cpu_feat); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAIE); ++} ++ ++static void ccw_machine_rhel900_class_options(MachineClass *mc) ++{ ++ S390CcwMachineClass *s390mc = S390_CCW_MACHINE_CLASS(mc); ++ static GlobalProperty compat[] = { ++ { TYPE_S390_PCI_DEVICE, "interpret", "off", }, ++ { TYPE_S390_PCI_DEVICE, "forwarding-assist", "off", }, ++ }; ++ ++ ccw_machine_rhel920_class_options(mc); ++ ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_1, hw_compat_rhel_9_1_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_0, hw_compat_rhel_9_0_len); ++ s390mc->max_threads = S390_MAX_CPUS; ++} ++DEFINE_CCW_MACHINE(rhel900, "rhel9.0.0", false); ++ ++static void ccw_machine_rhel860_instance_options(MachineState *machine) ++{ ++ /* Note: The -rhel8.6.0 and -rhel9.0.0 machines are technically identical */ ++ ccw_machine_rhel900_instance_options(machine); ++} ++ ++static void ccw_machine_rhel860_class_options(MachineClass *mc) ++{ ++ static GlobalProperty compat[] = { ++ { TYPE_S390_PCI_DEVICE, "interpret", "on", }, ++ { TYPE_S390_PCI_DEVICE, "forwarding-assist", "on", }, ++ }; ++ ++ ccw_machine_rhel900_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_6, hw_compat_rhel_8_6_len); ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ ++ /* All RHEL machines for prior major releases are deprecated */ ++ mc->deprecation_reason = rhel_old_machine_deprecation; ++} ++DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", false); ++ ++static void ccw_machine_rhel850_instance_options(MachineState *machine) ++{ ++ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V6_0 }; ++ ++ ccw_machine_rhel860_instance_options(machine); ++ ++ s390_set_qemu_cpu_model(0x2964, 13, 2, qemu_cpu_feat); ++ ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_NNPA); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_BEAR_ENH); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_RDP); ++ s390_cpudef_featoff_greater(16, 1, S390_FEAT_PAI); ++} ++ ++static void ccw_machine_rhel850_class_options(MachineClass *mc) ++{ ++ static GlobalProperty compat[] = { ++ { TYPE_S390_PCI_DEVICE, "interpret", "off", }, ++ { TYPE_S390_PCI_DEVICE, "forwarding-assist", "off", }, ++ }; ++ ++ ccw_machine_rhel860_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_5, hw_compat_rhel_8_5_len); ++ compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); ++ mc->smp_props.prefer_sockets = true; ++} ++DEFINE_CCW_MACHINE(rhel850, "rhel8.5.0", false); ++ ++static void ccw_machine_rhel840_instance_options(MachineState *machine) ++{ ++ ccw_machine_rhel850_instance_options(machine); ++} ++ ++static void ccw_machine_rhel840_class_options(MachineClass *mc) ++{ ++ ccw_machine_rhel850_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_4, hw_compat_rhel_8_4_len); ++} ++DEFINE_CCW_MACHINE(rhel840, "rhel8.4.0", false); ++ ++static void ccw_machine_rhel820_instance_options(MachineState *machine) ++{ ++ ccw_machine_rhel840_instance_options(machine); ++} ++ ++static void ccw_machine_rhel820_class_options(MachineClass *mc) ++{ ++ ccw_machine_rhel840_class_options(mc); ++ mc->fixup_ram_size = s390_fixup_ram_size; ++ /* we did not publish a rhel8.3.0 machine */ ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_3, hw_compat_rhel_8_3_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_2, hw_compat_rhel_8_2_len); ++} ++DEFINE_CCW_MACHINE(rhel820, "rhel8.2.0", false); ++ ++static void ccw_machine_rhel760_instance_options(MachineState *machine) ++{ ++ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V3_1 }; ++ ++ ccw_machine_rhel820_instance_options(machine); ++ ++ s390_set_qemu_cpu_model(0x2827, 12, 2, qemu_cpu_feat); ++ ++ /* The multiple-epoch facility was not available with rhel7.6.0 on z14GA1 */ ++ s390_cpudef_featoff(14, 1, S390_FEAT_MULTIPLE_EPOCH); ++ s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QSIE); ++ s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_QTOUE); ++ s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOE); ++ s390_cpudef_featoff(14, 1, S390_FEAT_PTFF_STOUE); ++} ++ ++static void ccw_machine_rhel760_class_options(MachineClass *mc) ++{ ++ ccw_machine_rhel820_class_options(mc); ++ /* We never published the s390x version of RHEL-AV 8.0 and 8.1, so add this here */ ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++} ++DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false); + + static void ccw_machine_register_types(void) + { +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 457b5cb10c..ff6b9463cb 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -46,6 +46,9 @@ + * of a following release have been a superset of the previous release. With + * generation 15 one base feature and one optional feature have been deprecated. + */ ++ ++#define RHEL_CPU_DEPRECATION "use at least 'z14', or 'host' / 'qemu' / 'max'" ++ + static S390CPUDef s390_cpu_defs[] = { + CPUDEF_INIT(0x2064, 7, 1, 38, 0x00000000U, "z900", "IBM zSeries 900 GA1"), + CPUDEF_INIT(0x2064, 7, 2, 38, 0x00000000U, "z900.2", "IBM zSeries 900 GA2"), +@@ -857,22 +860,30 @@ static void s390_host_cpu_model_class_init(ObjectClass *oc, void *data) + static void s390_base_cpu_model_class_init(ObjectClass *oc, void *data) + { + S390CPUClass *xcc = S390_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + /* all base models are migration safe */ + xcc->cpu_def = (const S390CPUDef *) data; + xcc->is_migration_safe = true; + xcc->is_static = true; + xcc->desc = xcc->cpu_def->desc; ++ if (xcc->cpu_def->gen < 14) { ++ cc->deprecation_note = RHEL_CPU_DEPRECATION; ++ } + } + + static void s390_cpu_model_class_init(ObjectClass *oc, void *data) + { + S390CPUClass *xcc = S390_CPU_CLASS(oc); ++ CPUClass *cc = CPU_CLASS(oc); + + /* model that can change between QEMU versions */ + xcc->cpu_def = (const S390CPUDef *) data; + xcc->is_migration_safe = true; + xcc->desc = xcc->cpu_def->desc; ++ if (xcc->cpu_def->gen < 14) { ++ cc->deprecation_note = RHEL_CPU_DEPRECATION; ++ } + } + + static void s390_qemu_cpu_model_class_init(ObjectClass *oc, void *data) +diff --git a/target/s390x/cpu_models.h b/target/s390x/cpu_models.h +index fb1adc8b21..d76745afa9 100644 +--- a/target/s390x/cpu_models.h ++++ b/target/s390x/cpu_models.h +@@ -38,6 +38,8 @@ struct S390CPUDef { + S390FeatBitmap full_feat; + /* used to init full_feat from generated data */ + S390FeatInit full_init; ++ /* if deprecated, provides a suggestion */ ++ const char *deprecation_note; + }; + + /* CPU model based on a CPU definition */ +diff --git a/target/s390x/cpu_models_sysemu.c b/target/s390x/cpu_models_sysemu.c +index 87a4480c05..28c1b0486c 100644 +--- a/target/s390x/cpu_models_sysemu.c ++++ b/target/s390x/cpu_models_sysemu.c +@@ -60,6 +60,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) + CpuDefinitionInfo *info; + char *name = g_strdup(object_class_get_name(klass)); + S390CPUClass *scc = S390_CPU_CLASS(klass); ++ CPUClass *cc = CPU_CLASS(klass); + + /* strip off the -s390x-cpu */ + g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; +@@ -69,6 +70,7 @@ static void create_cpu_model_list(ObjectClass *klass, void *opaque) + info->migration_safe = scc->is_migration_safe; + info->q_static = scc->is_static; + info->q_typename = g_strdup(object_class_get_name(klass)); ++ info->deprecated = !!cc->deprecation_note; + /* check for unavailable features */ + if (cpu_list_data->model) { + Object *obj; +-- +2.39.1 + diff --git a/0010-Add-x86_64-machine-types.patch b/0010-Add-x86_64-machine-types.patch new file mode 100644 index 0000000..9685338 --- /dev/null +++ b/0010-Add-x86_64-machine-types.patch @@ -0,0 +1,885 @@ +From 510291040cb280e1f68b793a84ec0f7d1c88aafa Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 19 Oct 2018 13:10:31 +0200 +Subject: Add x86_64 machine types + +Adding changes to add RHEL machine types for x86_64 architecture. + +Signed-off-by: Miroslav Rezanina + +Rebase notes (6.1.0): +- Update qemu64 cpu spec + +Rebase notes (7.0.0): +- Reset alias for all machine-types except latest one + +Rebase notes (8.0.0-rc1): +- remove legacy_no_rng_seed usage (removed upstream) + +Merged patches (6.1.0): +- 59c284ad3b x86: Add x86 rhel8.5 machine types +- a8868b42fe redhat: x86: Enable 'kvm-asyncpf-int' by default +- a3995e2eff Remove RHEL 7.0.0 machine type (only x86_64 changes) +- ad3190a79b Remove RHEL 7.1.0 machine type (only x86_64 changes) +- 84bbe15d4e Remove RHEL 7.2.0 machine type (only x86_64 changes) +- 0215eb3356 Remove RHEL 7.3.0 machine types (only x86_64 changes) +- af69d1ca6e Remove RHEL 7.4.0 machine types (only x86_64 changes) +- 8f7a74ab78 Remove RHEL 7.5.0 machine types (only x86_64 changes) + +Merged patches (7.0.0): +- eae7d8dd3c x86/rhel machine types: Add pc_rhel_8_5_compat +- 6762f56469 x86/rhel machine types: Wire compat into q35 and i440fx +- 5762101438 rhel machine types/x86: set prefer_sockets +- 9ba9ddc632 x86: Add q35 RHEL 8.6.0 machine type +- 6110d865e5 x86: Add q35 RHEL 9.0.0 machine type +- dcc64971bf RHEL: mark old machine types as deprecated (partialy) +- 6b396f182b RHEL: disable "seqpacket" for "vhost-vsock-device" in rhel8.6.0 + +Merged patches (7.1.0 rc0): +- 38b89dc245 pc: Move s3/s4 suspend disabling to compat (only hw/i386/pc.c chunk) +- 1d6439527a WRB: Introduce RHEL 9.0.0 hw compat structure (x86_64 specific changes) +- 35b5c8554f target/i386: deprecate CPUs older than x86_64-v2 ABI + +Merged patches (7.2.0 rc0): +- 0be2889fa2 Introduce upstream 7.0 compat changes (only applicable parts) + +Merged patches (8.0.0-rc1): +- f33ca8aed4 x86: rhel 9.2.0 machine type +--- + hw/i386/pc.c | 147 +++++++++++++++++++++- + hw/i386/pc_piix.c | 86 ++++++++++++- + hw/i386/pc_q35.c | 252 ++++++++++++++++++++++++++++++++++++- + include/hw/boards.h | 2 + + include/hw/i386/pc.h | 27 ++++ + target/i386/cpu.c | 21 ++++ + target/i386/kvm/kvm-cpu.c | 1 + + target/i386/kvm/kvm.c | 4 + + tests/qtest/pvpanic-test.c | 5 +- + 9 files changed, 538 insertions(+), 7 deletions(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 1489abf010..8abb1f872e 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -407,6 +407,149 @@ GlobalProperty pc_compat_1_4[] = { + }; + const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4); + ++/* This macro is for changes to properties that are RHEL specific, ++ * different to the current upstream and to be applied to the latest ++ * machine type. ++ */ ++GlobalProperty pc_rhel_compat[] = { ++ /* we don't support s3/s4 suspend */ ++ { "PIIX4_PM", "disable_s3", "1" }, ++ { "PIIX4_PM", "disable_s4", "1" }, ++ { "ICH9-LPC", "disable_s3", "1" }, ++ { "ICH9-LPC", "disable_s4", "1" }, ++ ++ { TYPE_X86_CPU, "host-phys-bits", "on" }, ++ { TYPE_X86_CPU, "host-phys-bits-limit", "48" }, ++ { TYPE_X86_CPU, "vmx-entry-load-perf-global-ctrl", "off" }, ++ { TYPE_X86_CPU, "vmx-exit-load-perf-global-ctrl", "off" }, ++ /* bz 1508330 */ ++ { "vfio-pci", "x-no-geforce-quirks", "on" }, ++ /* bz 1941397 */ ++ { TYPE_X86_CPU, "kvm-asyncpf-int", "on" }, ++}; ++const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat); ++ ++GlobalProperty pc_rhel_9_0_compat[] = { ++ /* pc_rhel_9_0_compat from pc_compat_6_2 */ ++ { "virtio-mem", "unplugged-inaccessible", "off" }, ++}; ++const size_t pc_rhel_9_0_compat_len = G_N_ELEMENTS(pc_rhel_9_0_compat); ++ ++GlobalProperty pc_rhel_8_5_compat[] = { ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "family", "6" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "model", "6" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "qemu64" "-" TYPE_X86_CPU, "stepping", "3" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { TYPE_X86_CPU, "x-vendor-cpuid-only", "off" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_0 */ ++ { "ICH9-LPC", ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, "off" }, ++ ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-build", "0x1bbc" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-major", "0x0006" }, ++ /* pc_rhel_8_5_compat from pc_compat_6_1 */ ++ { TYPE_X86_CPU, "hv-version-id-minor", "0x0001" }, ++}; ++const size_t pc_rhel_8_5_compat_len = G_N_ELEMENTS(pc_rhel_8_5_compat); ++ ++GlobalProperty pc_rhel_8_4_compat[] = { ++ /* pc_rhel_8_4_compat from pc_compat_5_2 */ ++ { "ICH9-LPC", "x-smi-cpu-hotunplug", "off" }, ++ { TYPE_X86_CPU, "kvm-asyncpf-int", "off" }, ++}; ++const size_t pc_rhel_8_4_compat_len = G_N_ELEMENTS(pc_rhel_8_4_compat); ++ ++GlobalProperty pc_rhel_8_3_compat[] = { ++ /* pc_rhel_8_3_compat from pc_compat_5_1 */ ++ { "ICH9-LPC", "x-smi-cpu-hotplug", "off" }, ++}; ++const size_t pc_rhel_8_3_compat_len = G_N_ELEMENTS(pc_rhel_8_3_compat); ++ ++GlobalProperty pc_rhel_8_2_compat[] = { ++ /* pc_rhel_8_2_compat from pc_compat_4_2 */ ++ { "mch", "smbase-smram", "off" }, ++}; ++const size_t pc_rhel_8_2_compat_len = G_N_ELEMENTS(pc_rhel_8_2_compat); ++ ++/* pc_rhel_8_1_compat is empty since pc_4_1_compat is */ ++GlobalProperty pc_rhel_8_1_compat[] = { }; ++const size_t pc_rhel_8_1_compat_len = G_N_ELEMENTS(pc_rhel_8_1_compat); ++ ++GlobalProperty pc_rhel_8_0_compat[] = { ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "intel-iommu", "dma-drain", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G3" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G4" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "rdtscp", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Opteron_G5" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC-IBPB" "-" TYPE_X86_CPU, "npt", "off" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "EPYC-IBPB" "-" TYPE_X86_CPU, "nrip-save", "off" }, ++ /** The mpx=on entries from pc_compat_3_1 are in pc_rhel_7_6_compat **/ ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { "Cascadelake-Server" "-" TYPE_X86_CPU, "stepping", "5" }, ++ /* pc_rhel_8_0_compat from pc_compat_3_1 */ ++ { TYPE_X86_CPU, "x-intel-pt-auto-level", "off" }, ++}; ++const size_t pc_rhel_8_0_compat_len = G_N_ELEMENTS(pc_rhel_8_0_compat); ++ ++/* Similar to PC_COMPAT_3_0 + PC_COMPAT_2_12, but: ++ * all of the 2_12 stuff was already in 7.6 from bz 1481253 ++ * x-migrate-smi-count comes from PC_COMPAT_2_11 but ++ * is really tied to kernel version so keep it off on 7.x ++ * machine types irrespective of host. ++ */ ++GlobalProperty pc_rhel_7_6_compat[] = { ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { TYPE_X86_CPU, "x-hv-synic-kvm-only", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { "Skylake-Server" "-" TYPE_X86_CPU, "pku", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_3_0 */ ++ { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "pku", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { TYPE_X86_CPU, "x-migrate-smi-count", "off" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Client-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Skylake-Server-IBRS" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Cascadelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Icelake-Client" "-" TYPE_X86_CPU, "mpx", "on" }, ++ /* pc_rhel_7_6_compat from pc_compat_2_11 */ ++ { "Icelake-Server" "-" TYPE_X86_CPU, "mpx", "on" }, ++}; ++const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat); ++ ++/* ++ * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine ++ * types as the PC_COMPAT_* do for upstream types. ++ * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. ++ */ ++ + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) + { + GSIState *s; +@@ -1944,6 +2087,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + pcmc->pvh_enabled = true; + pcmc->kvmclock_create_always = true; + assert(!mc->get_hotplug_handler); ++ mc->async_pf_vmexit_disable = false; + mc->get_hotplug_handler = pc_get_hotplug_handler; + mc->hotplug_allowed = pc_hotplug_allowed; + mc->cpu_index_to_instance_props = x86_cpu_index_to_props; +@@ -1954,7 +2098,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + mc->has_hotpluggable_cpus = true; + mc->default_boot_order = "cad"; + mc->block_default_type = IF_IDE; +- mc->max_cpus = 255; ++ /* 240: max CPU count for RHEL */ ++ mc->max_cpus = 240; + mc->reset = pc_machine_reset; + mc->wakeup = pc_machine_wakeup; + hc->pre_plug = pc_machine_device_pre_plug_cb; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 14a794081e..3e330fd36f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -54,6 +54,7 @@ + #include "qapi/error.h" + #include "qemu/error-report.h" + #include "sysemu/xen.h" ++#include "migration/migration.h" + #ifdef CONFIG_XEN + #include + #include "hw/xen/xen_pt.h" +@@ -198,8 +199,8 @@ static void pc_init1(MachineState *machine, + if (pcmc->smbios_defaults) { + MachineClass *mc = MACHINE_GET_CLASS(machine); + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", "Standard PC (i440FX + PIIX, 1996)", +- mc->name, pcmc->smbios_legacy_mode, ++ smbios_set_defaults("Red Hat", "KVM", ++ mc->desc, pcmc->smbios_legacy_mode, + pcmc->smbios_uuid_encoded, + pcmc->smbios_stream_product, + pcmc->smbios_stream_version, +@@ -351,6 +352,7 @@ static void pc_init1(MachineState *machine, + * hw_compat_*, pc_compat_*, or * pc_*_machine_options(). + */ + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_compat_2_3_fn(MachineState *machine) + { + X86MachineState *x86ms = X86_MACHINE(machine); +@@ -899,3 +901,83 @@ static void xenfv_3_1_machine_options(MachineClass *m) + DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, + xenfv_3_1_machine_options); + #endif ++#endif /* Disabled for Red Hat Enterprise Linux */ ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++/* Options for the latest rhel7 machine type */ ++static void pc_machine_rhel7_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ m->family = "pc_piix_Y"; ++ m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; ++ pcmc->default_nic_model = "e1000"; ++ pcmc->pci_root_uid = 0; ++ m->default_display = "std"; ++ m->no_parallel = 1; ++ m->numa_mem_supported = true; ++ m->auto_enable_numa_with_memdev = false; ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); ++ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); ++ m->alias = "pc"; ++ m->is_default = 1; ++ m->smp_props.prefer_sockets = true; ++} ++ ++static void pc_init_rhel760(MachineState *machine) ++{ ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel760_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_machine_rhel7_options(m); ++ m->desc = "RHEL 7.6.0 PC (i440FX + PIIX, 1996)"; ++ m->async_pf_vmexit_disable = true; ++ m->smbus_no_migration_support = true; ++ ++ /* All RHEL machines for prior major releases are deprecated */ ++ m->deprecation_reason = rhel_old_machine_deprecation; ++ ++ pcmc->pvh_enabled = false; ++ pcmc->default_cpu_version = CPU_VERSION_LEGACY; ++ pcmc->kvmclock_create_always = false; ++ /* From pc_i440fx_5_1_machine_options() */ ++ pcmc->pci_root_uid = 1; ++ pcmc->enforce_amd_1tb_hole = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_9_1, ++ hw_compat_rhel_9_1_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_0, ++ hw_compat_rhel_9_0_len); ++ compat_props_add(m->compat_props, pc_rhel_9_0_compat, ++ pc_rhel_9_0_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_6, ++ hw_compat_rhel_8_6_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_5, ++ hw_compat_rhel_8_5_len); ++ compat_props_add(m->compat_props, pc_rhel_8_5_compat, ++ pc_rhel_8_5_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_len); ++ compat_props_add(m->compat_props, pc_rhel_8_4_compat, ++ pc_rhel_8_4_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_3, ++ hw_compat_rhel_8_3_len); ++ compat_props_add(m->compat_props, pc_rhel_8_3_compat, ++ pc_rhel_8_3_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_2, ++ hw_compat_rhel_8_2_len); ++ compat_props_add(m->compat_props, pc_rhel_8_2_compat, ++ pc_rhel_8_2_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); ++ compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); ++ compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++ compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760, ++ pc_machine_rhel760_options); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index dc0ba5f9e7..98601bb76f 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -199,8 +199,8 @@ static void pc_q35_init(MachineState *machine) + + if (pcmc->smbios_defaults) { + /* These values are guest ABI, do not change */ +- smbios_set_defaults("QEMU", "Standard PC (Q35 + ICH9, 2009)", +- mc->name, pcmc->smbios_legacy_mode, ++ smbios_set_defaults("Red Hat", "KVM", ++ mc->desc, pcmc->smbios_legacy_mode, + pcmc->smbios_uuid_encoded, + pcmc->smbios_stream_product, + pcmc->smbios_stream_version, +@@ -354,6 +354,7 @@ static void pc_q35_init(MachineState *machine) + DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) + + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void pc_q35_machine_options(MachineClass *m) + { + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +@@ -663,3 +664,250 @@ static void pc_q35_2_4_machine_options(MachineClass *m) + + DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, + pc_q35_2_4_machine_options); ++#endif /* Disabled for Red Hat Enterprise Linux */ ++ ++/* Red Hat Enterprise Linux machine types */ ++ ++/* Options for the latest rhel q35 machine type */ ++static void pc_q35_machine_rhel_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pcmc->default_nic_model = "e1000e"; ++ pcmc->pci_root_uid = 0; ++ m->family = "pc_q35_Z"; ++ m->units_per_default_bus = 1; ++ m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; ++ m->default_display = "std"; ++ m->no_floppy = 1; ++ m->no_parallel = 1; ++ pcmc->default_cpu_version = 1; ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_AMD_IOMMU_DEVICE); ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_INTEL_IOMMU_DEVICE); ++ machine_class_allow_dynamic_sysbus_dev(m, TYPE_RAMFB_DEVICE); ++ m->alias = "q35"; ++ m->max_cpus = 710; ++ compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); ++} ++ ++static void pc_q35_init_rhel920(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel920_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel_options(m); ++ m->desc = "RHEL-9.2.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.2.0"; ++} ++ ++DEFINE_PC_MACHINE(q35_rhel920, "pc-q35-rhel9.2.0", pc_q35_init_rhel920, ++ pc_q35_machine_rhel920_options); ++ ++static void pc_q35_init_rhel900(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel900_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel920_options(m); ++ m->desc = "RHEL-9.0.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL"; ++ pcmc->smbios_stream_version = "9.0.0"; ++ pcmc->enforce_amd_1tb_hole = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_9_1, ++ hw_compat_rhel_9_1_len); ++ compat_props_add(m->compat_props, hw_compat_rhel_9_0, ++ hw_compat_rhel_9_0_len); ++ compat_props_add(m->compat_props, pc_rhel_9_0_compat, ++ pc_rhel_9_0_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel900, "pc-q35-rhel9.0.0", pc_q35_init_rhel900, ++ pc_q35_machine_rhel900_options); ++ ++static void pc_q35_init_rhel860(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel860_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel900_options(m); ++ m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ ++ /* All RHEL machines for prior major releases are deprecated */ ++ m->deprecation_reason = rhel_old_machine_deprecation; ++ ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.6.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_6, ++ hw_compat_rhel_8_6_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel860, "pc-q35-rhel8.6.0", pc_q35_init_rhel860, ++ pc_q35_machine_rhel860_options); ++ ++ ++static void pc_q35_init_rhel850(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel850_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel860_options(m); ++ m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.5.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_5, ++ hw_compat_rhel_8_5_len); ++ compat_props_add(m->compat_props, pc_rhel_8_5_compat, ++ pc_rhel_8_5_compat_len); ++ m->smp_props.prefer_sockets = true; ++} ++ ++DEFINE_PC_MACHINE(q35_rhel850, "pc-q35-rhel8.5.0", pc_q35_init_rhel850, ++ pc_q35_machine_rhel850_options); ++ ++ ++static void pc_q35_init_rhel840(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel840_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel850_options(m); ++ m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.4.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_len); ++ compat_props_add(m->compat_props, pc_rhel_8_4_compat, ++ pc_rhel_8_4_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel840, "pc-q35-rhel8.4.0", pc_q35_init_rhel840, ++ pc_q35_machine_rhel840_options); ++ ++ ++static void pc_q35_init_rhel830(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel830_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel840_options(m); ++ m->desc = "RHEL-8.3.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.3.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_3, ++ hw_compat_rhel_8_3_len); ++ compat_props_add(m->compat_props, pc_rhel_8_3_compat, ++ pc_rhel_8_3_compat_len); ++ /* From pc_q35_5_1_machine_options() */ ++ pcmc->kvmclock_create_always = false; ++ /* From pc_q35_5_1_machine_options() */ ++ pcmc->pci_root_uid = 1; ++} ++ ++DEFINE_PC_MACHINE(q35_rhel830, "pc-q35-rhel8.3.0", pc_q35_init_rhel830, ++ pc_q35_machine_rhel830_options); ++ ++static void pc_q35_init_rhel820(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel820_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel830_options(m); ++ m->desc = "RHEL-8.2.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ m->numa_mem_supported = true; ++ m->auto_enable_numa_with_memdev = false; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.2.0"; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_2, ++ hw_compat_rhel_8_2_len); ++ compat_props_add(m->compat_props, pc_rhel_8_2_compat, ++ pc_rhel_8_2_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel820, "pc-q35-rhel8.2.0", pc_q35_init_rhel820, ++ pc_q35_machine_rhel820_options); ++ ++static void pc_q35_init_rhel810(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel810_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel820_options(m); ++ m->desc = "RHEL-8.1.0 PC (Q35 + ICH9, 2009)"; ++ m->alias = NULL; ++ pcmc->smbios_stream_product = NULL; ++ pcmc->smbios_stream_version = NULL; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_1, hw_compat_rhel_8_1_len); ++ compat_props_add(m->compat_props, pc_rhel_8_1_compat, pc_rhel_8_1_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel810, "pc-q35-rhel8.1.0", pc_q35_init_rhel810, ++ pc_q35_machine_rhel810_options); ++ ++static void pc_q35_init_rhel800(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel800_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel810_options(m); ++ m->desc = "RHEL-8.0.0 PC (Q35 + ICH9, 2009)"; ++ m->smbus_no_migration_support = true; ++ m->alias = NULL; ++ pcmc->pvh_enabled = false; ++ pcmc->default_cpu_version = CPU_VERSION_LEGACY; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_0, hw_compat_rhel_8_0_len); ++ compat_props_add(m->compat_props, pc_rhel_8_0_compat, pc_rhel_8_0_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel800, "pc-q35-rhel8.0.0", pc_q35_init_rhel800, ++ pc_q35_machine_rhel800_options); ++ ++static void pc_q35_init_rhel760(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel760_options(MachineClass *m) ++{ ++ pc_q35_machine_rhel800_options(m); ++ m->alias = NULL; ++ m->desc = "RHEL-7.6.0 PC (Q35 + ICH9, 2009)"; ++ m->async_pf_vmexit_disable = true; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_6, hw_compat_rhel_7_6_len); ++ compat_props_add(m->compat_props, pc_rhel_7_6_compat, pc_rhel_7_6_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760, ++ pc_q35_machine_rhel760_options); +diff --git a/include/hw/boards.h b/include/hw/boards.h +index c5a965d27f..5e7446ee40 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -268,6 +268,8 @@ struct MachineClass { + strList *allowed_dynamic_sysbus_devices; + bool auto_enable_numa_with_memhp; + bool auto_enable_numa_with_memdev; ++ /* RHEL only */ ++ bool async_pf_vmexit_disable; + bool ignore_boot_device_suffixes; + bool smbus_no_migration_support; + bool nvdimm_supported; +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 908a275736..4376f64a47 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -293,6 +293,33 @@ extern const size_t pc_compat_1_4_len; + + int pc_machine_kvm_type(MachineState *machine, const char *vm_type); + ++extern GlobalProperty pc_rhel_compat[]; ++extern const size_t pc_rhel_compat_len; ++ ++extern GlobalProperty pc_rhel_9_0_compat[]; ++extern const size_t pc_rhel_9_0_compat_len; ++ ++extern GlobalProperty pc_rhel_8_5_compat[]; ++extern const size_t pc_rhel_8_5_compat_len; ++ ++extern GlobalProperty pc_rhel_8_4_compat[]; ++extern const size_t pc_rhel_8_4_compat_len; ++ ++extern GlobalProperty pc_rhel_8_3_compat[]; ++extern const size_t pc_rhel_8_3_compat_len; ++ ++extern GlobalProperty pc_rhel_8_2_compat[]; ++extern const size_t pc_rhel_8_2_compat_len; ++ ++extern GlobalProperty pc_rhel_8_1_compat[]; ++extern const size_t pc_rhel_8_1_compat_len; ++ ++extern GlobalProperty pc_rhel_8_0_compat[]; ++extern const size_t pc_rhel_8_0_compat_len; ++ ++extern GlobalProperty pc_rhel_7_6_compat[]; ++extern const size_t pc_rhel_7_6_compat_len; ++ + #define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn) \ + static void pc_machine_##suffix##_class_init(ObjectClass *oc, void *data) \ + { \ +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index 6576287e5b..0ef2bf1b93 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -1834,9 +1834,13 @@ static const CPUCaches epyc_milan_cache_info = { + * PT in VMX operation + */ + ++#define RHEL_CPU_DEPRECATION \ ++ "use at least 'Nehalem' / 'Opteron_G4', or 'host' / 'max'" ++ + static const X86CPUDefinition builtin_x86_defs[] = { + { + .name = "qemu64", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -1857,6 +1861,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "phenom", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 16, +@@ -1889,6 +1894,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "core2duo", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 10, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -1931,6 +1937,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "kvm64", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 0xd, + .vendor = CPUID_VENDOR_INTEL, + .family = 15, +@@ -1972,6 +1979,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "qemu32", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 4, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -1986,6 +1994,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "kvm32", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_INTEL, + .family = 15, +@@ -2016,6 +2025,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "coreduo", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 10, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2049,6 +2059,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "486", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 1, + .vendor = CPUID_VENDOR_INTEL, + .family = 4, +@@ -2061,6 +2072,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "pentium", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 1, + .vendor = CPUID_VENDOR_INTEL, + .family = 5, +@@ -2073,6 +2085,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "pentium2", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 2, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2085,6 +2098,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "pentium3", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 3, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2097,6 +2111,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "athlon", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 2, + .vendor = CPUID_VENDOR_AMD, + .family = 6, +@@ -2112,6 +2127,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "n270", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 10, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2137,6 +2153,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Conroe", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 10, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -2177,6 +2194,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Penryn", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 10, + .vendor = CPUID_VENDOR_INTEL, + .family = 6, +@@ -3893,6 +3911,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G1", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -3913,6 +3932,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G2", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 15, +@@ -3935,6 +3955,7 @@ static const X86CPUDefinition builtin_x86_defs[] = { + }, + { + .name = "Opteron_G3", ++ .deprecation_note = RHEL_CPU_DEPRECATION, + .level = 5, + .vendor = CPUID_VENDOR_AMD, + .family = 16, +diff --git a/target/i386/kvm/kvm-cpu.c b/target/i386/kvm/kvm-cpu.c +index 7237378a7d..7b8a3d5af0 100644 +--- a/target/i386/kvm/kvm-cpu.c ++++ b/target/i386/kvm/kvm-cpu.c +@@ -137,6 +137,7 @@ static PropValue kvm_default_props[] = { + { "acpi", "off" }, + { "monitor", "off" }, + { "svm", "off" }, ++ { "kvm-pv-unhalt", "on" }, + { NULL, NULL }, + }; + +diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c +index de531842f6..8d82304609 100644 +--- a/target/i386/kvm/kvm.c ++++ b/target/i386/kvm/kvm.c +@@ -3822,6 +3822,7 @@ static int kvm_get_msrs(X86CPU *cpu) + struct kvm_msr_entry *msrs = cpu->kvm_msr_buf->entries; + int ret, i; + uint64_t mtrr_top_bits; ++ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); + + kvm_msr_buf_reset(cpu); + +@@ -4177,6 +4178,9 @@ static int kvm_get_msrs(X86CPU *cpu) + break; + case MSR_KVM_ASYNC_PF_EN: + env->async_pf_en_msr = msrs[i].data; ++ if (mc->async_pf_vmexit_disable) { ++ env->async_pf_en_msr &= ~(1ULL << 2); ++ } + break; + case MSR_KVM_ASYNC_PF_INT: + env->async_pf_int_msr = msrs[i].data; +diff --git a/tests/qtest/pvpanic-test.c b/tests/qtest/pvpanic-test.c +index 78f1cf8186..ac954c9b06 100644 +--- a/tests/qtest/pvpanic-test.c ++++ b/tests/qtest/pvpanic-test.c +@@ -17,7 +17,7 @@ static void test_panic_nopause(void) + QDict *response, *data; + QTestState *qts; + +- qts = qtest_init("-device pvpanic -action panic=none"); ++ qts = qtest_init("-M q35 -device pvpanic -action panic=none"); + + val = qtest_inb(qts, 0x505); + g_assert_cmpuint(val, ==, 3); +@@ -40,7 +40,8 @@ static void test_panic(void) + QDict *response, *data; + QTestState *qts; + +- qts = qtest_init("-device pvpanic -action panic=pause"); ++ /* RHEL: Use q35 */ ++ qts = qtest_init("-M q35 -device pvpanic -action panic=pause"); + + val = qtest_inb(qts, 0x505); + g_assert_cmpuint(val, ==, 3); +-- +2.39.1 + diff --git a/0011-Enable-make-check.patch b/0011-Enable-make-check.patch new file mode 100644 index 0000000..cc91302 --- /dev/null +++ b/0011-Enable-make-check.patch @@ -0,0 +1,301 @@ +From 738db8353055eb6fd902513949c6659af8b401d0 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 2 Sep 2020 09:39:41 +0200 +Subject: Enable make check + +Fixing tests after device disabling and machine types changes and enabling +make check run during build. + +Signed-off-by: Miroslav Rezanina +--- +Rebase changes (6.1.0): +- removed unnecessary test changes + +Rebase changes (6.2.0): +- new way of disabling bios-table-test + +Rebase changes (7.0.0): +- Disable testing virtio-iommu-pci +- Rename default_bus_bypass_iommu property to default-bus-bypass-iommu +- Disable qtest-bios-table for aarch64 +- Removed redhat chunks for boot-serial-test.c, cdrom-test.c and cpu-plug-test.c qtests +- Do not disable boot-order-test, prom-env-test and boot-serial-test qtests +- Use rhel machine type for new intel hda qtest +- Remove unnecessary changes in iotest 051 +- Remove changes in bios-tables-test.c and prom-env-test.c qtests + +Rebase changes (7.1.0 rc0): +- Disable bcm2835-dma-test (added upstream) + +Rebase changes (8.0.0-rc1): +- Removed chunks for disabling bios-table-test (protected upstream) + +Rebase change (8.0.0-rc2): +- Disable new qemu-iotests execution +- Revert change in tco qtest (blocking test run) + +Merged patches (6.1.0): +- 2f129df7d3 redhat: Enable the 'test-block-iothread' test again + +Merged patches (7.1.0 rc0): +- 64d736640e RHEL-only: tests/avocado: Switch aarch64 tests from a53 to a57 +--- + .distro/qemu-kvm.spec.template | 4 ++-- + tests/avocado/replay_kernel.py | 2 +- + tests/avocado/reverse_debugging.py | 2 +- + tests/avocado/tcg_plugins.py | 6 ++--- + tests/qemu-iotests/meson.build | 34 ++++++++++++++--------------- + tests/qtest/fuzz-e1000e-test.c | 2 +- + tests/qtest/fuzz-virtio-scsi-test.c | 2 +- + tests/qtest/intel-hda-test.c | 2 +- + tests/qtest/libqos/meson.build | 2 +- + tests/qtest/lpc-ich9-test.c | 2 +- + tests/qtest/meson.build | 2 -- + tests/qtest/tco-test.c | 2 +- + tests/qtest/usb-hcd-xhci-test.c | 4 ++++ + tests/qtest/virtio-net-failover.c | 1 + + 14 files changed, 35 insertions(+), 32 deletions(-) + +diff --git a/tests/avocado/replay_kernel.py b/tests/avocado/replay_kernel.py +index f13456e1ec..2fee270a42 100644 +--- a/tests/avocado/replay_kernel.py ++++ b/tests/avocado/replay_kernel.py +@@ -147,7 +147,7 @@ def test_aarch64_virt(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' + '/linux/releases/29/Everything/aarch64/os/images/pxeboot' +diff --git a/tests/avocado/reverse_debugging.py b/tests/avocado/reverse_debugging.py +index 680c314cfc..71eccb8fb6 100644 +--- a/tests/avocado/reverse_debugging.py ++++ b/tests/avocado/reverse_debugging.py +@@ -206,7 +206,7 @@ def test_aarch64_virt(self): + """ + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_url = ('https://archives.fedoraproject.org/pub/archive/fedora' + '/linux/releases/29/Everything/aarch64/os/images/pxeboot' +diff --git a/tests/avocado/tcg_plugins.py b/tests/avocado/tcg_plugins.py +index 642d2e49e3..93b3afd823 100644 +--- a/tests/avocado/tcg_plugins.py ++++ b/tests/avocado/tcg_plugins.py +@@ -68,7 +68,7 @@ def test_aarch64_virt_insn(self): + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + +@@ -94,7 +94,7 @@ def test_aarch64_virt_insn_icount(self): + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + +@@ -120,7 +120,7 @@ def test_aarch64_virt_mem_icount(self): + :avocado: tags=accel:tcg + :avocado: tags=arch:aarch64 + :avocado: tags=machine:virt +- :avocado: tags=cpu:cortex-a53 ++ :avocado: tags=cpu:cortex-a57 + """ + kernel_path = self._grab_aarch64_kernel() + kernel_command_line = (self.KERNEL_COMMON_COMMAND_LINE + +diff --git a/tests/qemu-iotests/meson.build b/tests/qemu-iotests/meson.build +index 9735071a29..32002335f4 100644 +--- a/tests/qemu-iotests/meson.build ++++ b/tests/qemu-iotests/meson.build +@@ -51,21 +51,21 @@ foreach format, speed: qemu_iotests_formats + check: true, + ) + +- foreach item: rc.stdout().strip().split() +- args = [qemu_iotests_check_cmd, +- '-tap', '-' + format, item, +- '--source-dir', meson.current_source_dir(), +- '--build-dir', meson.current_build_dir()] +- # Some individual tests take as long as 45 seconds +- # Bump the timeout to 3 minutes for some headroom +- # on slow machines to minimize spurious failures +- test('io-' + format + '-' + item, +- python, +- args: args, +- depends: qemu_iotests_binaries, +- env: qemu_iotests_env, +- protocol: 'tap', +- timeout: 180, +- suite: suites) +- endforeach ++# foreach item: rc.stdout().strip().split() ++# args = [qemu_iotests_check_cmd, ++# '-tap', '-' + format, item, ++# '--source-dir', meson.current_source_dir(), ++# '--build-dir', meson.current_build_dir()] ++# # Some individual tests take as long as 45 seconds ++# # Bump the timeout to 3 minutes for some headroom ++# # on slow machines to minimize spurious failures ++# test('io-' + format + '-' + item, ++# python, ++# args: args, ++# depends: qemu_iotests_binaries, ++# env: qemu_iotests_env, ++# protocol: 'tap', ++# timeout: 180, ++# suite: suites) ++# endforeach + endforeach +diff --git a/tests/qtest/fuzz-e1000e-test.c b/tests/qtest/fuzz-e1000e-test.c +index 5052883fb6..b5286f4b12 100644 +--- a/tests/qtest/fuzz-e1000e-test.c ++++ b/tests/qtest/fuzz-e1000e-test.c +@@ -17,7 +17,7 @@ static void test_lp1879531_eth_get_rss_ex_dst_addr(void) + { + QTestState *s; + +- s = qtest_init("-nographic -monitor none -serial none -M pc-q35-5.0"); ++ s = qtest_init("-nographic -monitor none -serial none -M pc-q35-rhel8.4.0"); + + qtest_outl(s, 0xcf8, 0x80001010); + qtest_outl(s, 0xcfc, 0xe1020000); +diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-scsi-test.c +index e37b48b2cc..88647da054 100644 +--- a/tests/qtest/fuzz-virtio-scsi-test.c ++++ b/tests/qtest/fuzz-virtio-scsi-test.c +@@ -19,7 +19,7 @@ static void test_mmio_oob_from_memory_region_cache(void) + { + QTestState *s; + +- s = qtest_init("-M pc-q35-5.2 -m 512M " ++ s = qtest_init("-M pc-q35-rhel8.4.0 -m 512M " + "-device virtio-scsi,num_queues=8,addr=03.0 "); + + qtest_outl(s, 0xcf8, 0x80001811); +diff --git a/tests/qtest/intel-hda-test.c b/tests/qtest/intel-hda-test.c +index d4a8db6fd6..1a796ec15a 100644 +--- a/tests/qtest/intel-hda-test.c ++++ b/tests/qtest/intel-hda-test.c +@@ -38,7 +38,7 @@ static void test_issue542_ich6(void) + { + QTestState *s; + +- s = qtest_init("-nographic -nodefaults -M pc-q35-6.2 " ++ s = qtest_init("-nographic -nodefaults -M pc-q35-rhel9.0.0 " + "-device intel-hda,id=" HDA_ID CODEC_DEVICES); + + qtest_outl(s, 0xcf8, 0x80000804); +diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build +index cc209a8de5..42a7c529c9 100644 +--- a/tests/qtest/libqos/meson.build ++++ b/tests/qtest/libqos/meson.build +@@ -44,7 +44,7 @@ libqos_srcs = files( + 'virtio-rng.c', + 'virtio-scsi.c', + 'virtio-serial.c', +- 'virtio-iommu.c', ++# 'virtio-iommu.c', + 'virtio-gpio.c', + 'generic-pcihost.c', + +diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c +index 8ac95b89f7..cd2102555c 100644 +--- a/tests/qtest/lpc-ich9-test.c ++++ b/tests/qtest/lpc-ich9-test.c +@@ -15,7 +15,7 @@ static void test_lp1878642_pci_bus_get_irq_level_assert(void) + { + QTestState *s; + +- s = qtest_init("-M pc-q35-5.0 " ++ s = qtest_init("-M pc-q35-rhel8.4.0 " + "-nographic -monitor none -serial none"); + + qtest_outl(s, 0xcf8, 0x8000f840); /* PMBASE */ +diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build +index 85ea4e8d99..893afc8eeb 100644 +--- a/tests/qtest/meson.build ++++ b/tests/qtest/meson.build +@@ -94,7 +94,6 @@ qtests_i386 = \ + 'drive_del-test', + 'tco-test', + 'cpu-plug-test', +- 'q35-test', + 'vmgenid-test', + 'migration-test', + 'test-x86-cpuid-compat', +@@ -223,7 +222,6 @@ qtests_s390x = \ + (config_host.has_key('CONFIG_POSIX') ? ['test-filter-redirector'] : []) + \ + ['boot-serial-test', + 'drive_del-test', +- 'device-plug-test', + 'virtio-ccw-test', + 'cpu-plug-test', + 'migration-test'] +diff --git a/tests/qtest/tco-test.c b/tests/qtest/tco-test.c +index 0547d41173..3756ce82d8 100644 +--- a/tests/qtest/tco-test.c ++++ b/tests/qtest/tco-test.c +@@ -60,7 +60,7 @@ static void test_init(TestData *d) + QTestState *qs; + + qs = qtest_initf("-machine q35 %s %s", +- d->noreboot ? "-global ICH9-LPC.noreboot=true" : "", ++ d->noreboot ? "" : "-global ICH9-LPC.noreboot=false", + !d->args ? "" : d->args); + qtest_irq_intercept_in(qs, "ioapic"); + +diff --git a/tests/qtest/usb-hcd-xhci-test.c b/tests/qtest/usb-hcd-xhci-test.c +index 10ef9d2a91..3855873050 100644 +--- a/tests/qtest/usb-hcd-xhci-test.c ++++ b/tests/qtest/usb-hcd-xhci-test.c +@@ -21,6 +21,7 @@ static void test_xhci_hotplug(void) + usb_test_hotplug(global_qtest, "xhci", "1", NULL); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void test_usb_uas_hotplug(void) + { + QTestState *qts = global_qtest; +@@ -36,6 +37,7 @@ static void test_usb_uas_hotplug(void) + qtest_qmp_device_del(qts, "scsihd"); + qtest_qmp_device_del(qts, "uas"); + } ++#endif + + static void test_usb_ccid_hotplug(void) + { +@@ -56,7 +58,9 @@ int main(int argc, char **argv) + + qtest_add_func("/xhci/pci/init", test_xhci_init); + qtest_add_func("/xhci/pci/hotplug", test_xhci_hotplug); ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug); ++#endif + qtest_add_func("/xhci/pci/hotplug/usb-ccid", test_usb_ccid_hotplug); + + qtest_start("-device nec-usb-xhci,id=xhci" +diff --git a/tests/qtest/virtio-net-failover.c b/tests/qtest/virtio-net-failover.c +index 4a809590bf..1bf3fa641c 100644 +--- a/tests/qtest/virtio-net-failover.c ++++ b/tests/qtest/virtio-net-failover.c +@@ -25,6 +25,7 @@ + #define PCI_SEL_BASE 0x0010 + + #define BASE_MACHINE "-M q35 -nodefaults " \ ++ "-global ICH9-LPC.acpi-pci-hotplug-with-bridge-support=on " \ + "-device pcie-root-port,id=root0,addr=0x1,bus=pcie.0,chassis=1 " \ + "-device pcie-root-port,id=root1,addr=0x2,bus=pcie.0,chassis=2 " + +-- +2.39.1 + diff --git a/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch b/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..430959b --- /dev/null +++ b/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,104 @@ +From 34cb4f7ddd762ec46ed1a6a4261aebde39360ca4 Mon Sep 17 00:00:00 2001 +From: Bandan Das +Date: Tue, 3 Dec 2013 20:05:13 +0100 +Subject: vfio: cap number of devices that can be assigned + +RH-Author: Bandan Das +Message-id: <1386101113-31560-3-git-send-email-bsd@redhat.com> +Patchwork-id: 55984 +O-Subject: [PATCH RHEL7 qemu-kvm v2 2/2] vfio: cap number of devices that can be assigned +Bugzilla: 678368 +RH-Acked-by: Alex Williamson +RH-Acked-by: Marcelo Tosatti +RH-Acked-by: Michael S. Tsirkin + +Go through all groups to get count of total number of devices +active to enforce limit + +Reasoning from Alex for the limit(32) - Assuming 3 slots per +device, with 125 slots (number of memory slots for RHEL 7), +we can support almost 40 devices and still have few slots left +for other uses. Stepping down a bit, the number 32 arbitrarily +matches the number of slots on a PCI bus and is also a nice power +of two. + +Count of slots increased to 509 later so we could increase limit +to 64 as some usecases require more than 32 devices. + +Signed-off-by: Bandan Das +--- + hw/vfio/pci.c | 29 ++++++++++++++++++++++++++++- + hw/vfio/pci.h | 1 + + 2 files changed, 29 insertions(+), 1 deletion(-) + +diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c +index ec9a854361..a779053be3 100644 +--- a/hw/vfio/pci.c ++++ b/hw/vfio/pci.c +@@ -48,6 +48,9 @@ + /* Protected by BQL */ + static KVMRouteChange vfio_route_change; + ++/* RHEL only: Set once for the first assigned dev */ ++static uint16_t device_limit; ++ + static void vfio_disable_interrupts(VFIOPCIDevice *vdev); + static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); + static void vfio_msi_disable_common(VFIOPCIDevice *vdev); +@@ -2854,9 +2857,30 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) + ssize_t len; + struct stat st; + int groupid; +- int i, ret; ++ int ret, i = 0; + bool is_mdev; + ++ if (device_limit && device_limit != vdev->assigned_device_limit) { ++ error_setg(errp, "Assigned device limit has been redefined. " ++ "Old:%d, New:%d", ++ device_limit, vdev->assigned_device_limit); ++ return; ++ } else { ++ device_limit = vdev->assigned_device_limit; ++ } ++ ++ QLIST_FOREACH(group, &vfio_group_list, next) { ++ QLIST_FOREACH(vbasedev_iter, &group->device_list, next) { ++ i++; ++ } ++ } ++ ++ if (i >= vdev->assigned_device_limit) { ++ error_setg(errp, "Maximum supported vfio devices (%d) " ++ "already attached", vdev->assigned_device_limit); ++ return; ++ } ++ + if (!vbasedev->sysfsdev) { + if (!(~vdev->host.domain || ~vdev->host.bus || + ~vdev->host.slot || ~vdev->host.function)) { +@@ -3294,6 +3318,9 @@ static Property vfio_pci_dev_properties[] = { + DEFINE_PROP_BOOL("x-no-kvm-msix", VFIOPCIDevice, no_kvm_msix, false), + DEFINE_PROP_BOOL("x-no-geforce-quirks", VFIOPCIDevice, + no_geforce_quirks, false), ++ /* RHEL only */ ++ DEFINE_PROP_UINT16("x-assigned-device-limit", VFIOPCIDevice, ++ assigned_device_limit, 64), + DEFINE_PROP_BOOL("x-no-kvm-ioeventfd", VFIOPCIDevice, no_kvm_ioeventfd, + false), + DEFINE_PROP_BOOL("x-no-vfio-ioeventfd", VFIOPCIDevice, no_vfio_ioeventfd, +diff --git a/hw/vfio/pci.h b/hw/vfio/pci.h +index 177abcc8fb..45235d38ba 100644 +--- a/hw/vfio/pci.h ++++ b/hw/vfio/pci.h +@@ -140,6 +140,7 @@ struct VFIOPCIDevice { + EventNotifier err_notifier; + EventNotifier req_notifier; + int (*resetfn)(struct VFIOPCIDevice *); ++ uint16_t assigned_device_limit; + uint32_t vendor_id; + uint32_t device_id; + uint32_t sub_vendor_id; +-- +2.39.1 + diff --git a/0013-Add-support-statement-to-help-output.patch b/0013-Add-support-statement-to-help-output.patch new file mode 100644 index 0000000..25db0b8 --- /dev/null +++ b/0013-Add-support-statement-to-help-output.patch @@ -0,0 +1,55 @@ +From 8964a3e8835992442902d35b011a708787366d82 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 4 Dec 2013 18:53:17 +0100 +Subject: Add support statement to -help output + +RH-Author: Eduardo Habkost +Message-id: <1386183197-27761-1-git-send-email-ehabkost@redhat.com> +Patchwork-id: 55994 +O-Subject: [qemu-kvm RHEL7 PATCH] Add support statement to -help output +Bugzilla: 972773 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: knoel@redhat.com +RH-Acked-by: Paolo Bonzini + +Add support statement to -help output, reporting direct qemu-kvm usage +as unsupported by Red Hat, and advising users to use libvirt instead. + +Signed-off-by: Eduardo Habkost +--- + softmmu/vl.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/softmmu/vl.c b/softmmu/vl.c +index ea20b23e4c..ad4173138d 100644 +--- a/softmmu/vl.c ++++ b/softmmu/vl.c +@@ -834,9 +834,17 @@ static void version(void) + QEMU_COPYRIGHT "\n"); + } + ++static void print_rh_warning(void) ++{ ++ printf("\nWARNING: Direct use of qemu-kvm from the command line is not supported by Red Hat.\n" ++ "WARNING: Use libvirt as the stable management interface.\n" ++ "WARNING: Some command line options listed here may not be available in future releases.\n\n"); ++} ++ + static void help(int exitcode) + { + version(); ++ print_rh_warning(); + printf("usage: %s [options] [disk_image]\n\n" + "'disk_image' is a raw hard disk image for IDE hard disk 0\n\n", + g_get_prgname()); +@@ -862,6 +870,7 @@ static void help(int exitcode) + "\n" + QEMU_HELP_BOTTOM "\n"); + ++ print_rh_warning(); + exit(exitcode); + } + +-- +2.39.1 + diff --git a/0014-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch b/0014-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch new file mode 100644 index 0000000..b97c844 --- /dev/null +++ b/0014-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch @@ -0,0 +1,61 @@ +From 0b72d348fa0714de641ee242e5cee97df006e8fd Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 8 Jul 2020 08:35:50 +0200 +Subject: Use qemu-kvm in documentation instead of qemu-system- + +Patchwork-id: 62380 +O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCHv4] Use qemu-kvm in documentation instead of qemu-system-i386 +Bugzilla: 1140620 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Markus Armbruster +RH-Acked-by: Stefan Hajnoczi + +From: Miroslav Rezanina + +We change the name and location of qemu-kvm binaries. Update documentation +to reflect this change. Only architectures available in RHEL are updated. + +Signed-off-by: Miroslav Rezanina +--- + docs/defs.rst.inc | 4 ++-- + qemu-options.hx | 10 +++++----- + 2 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/docs/defs.rst.inc b/docs/defs.rst.inc +index 52d6454b93..d74dbdeca9 100644 +--- a/docs/defs.rst.inc ++++ b/docs/defs.rst.inc +@@ -9,7 +9,7 @@ + but the manpages will end up misrendered with following normal text + incorrectly in boldface. + +-.. |qemu_system| replace:: qemu-system-x86_64 +-.. |qemu_system_x86| replace:: qemu-system-x86_64 ++.. |qemu_system| replace:: qemu-kvm ++.. |qemu_system_x86| replace:: qemu-kvm + .. |I2C| replace:: I\ :sup:`2`\ C + .. |I2S| replace:: I\ :sup:`2`\ S +diff --git a/qemu-options.hx b/qemu-options.hx +index 59bdf67a2c..52b49f1f6a 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -3296,11 +3296,11 @@ SRST + + :: + +- qemu -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ +- -numa node,memdev=mem \ +- -chardev socket,id=chr0,path=/path/to/socket \ +- -netdev type=vhost-user,id=net0,chardev=chr0 \ +- -device virtio-net-pci,netdev=net0 ++ qemu-kvm -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs,share=on \ ++ -numa node,memdev=mem \ ++ -chardev socket,id=chr0,path=/path/to/socket \ ++ -netdev type=vhost-user,id=net0,chardev=chr0 \ ++ -device virtio-net-pci,netdev=net0 + + ``-netdev vhost-vdpa[,vhostdev=/path/to/dev][,vhostfd=h]`` + Establish a vhost-vdpa netdev. +-- +2.39.1 + diff --git a/0015-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch b/0015-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch new file mode 100644 index 0000000..1e2f8e1 --- /dev/null +++ b/0015-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch @@ -0,0 +1,77 @@ +From bd6bcebfd783fa49e283d035d378fb5240423d84 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 20 Aug 2021 18:25:12 +0200 +Subject: qcow2: Deprecation warning when opening v2 images rw +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Kevin Wolf +RH-MergeRequest: 37: qcow2: Deprecation warning when opening v2 images rw +RH-Commit: [1/1] f450d0ae32d35063b28c72c4f2d2ebb9e6d8db3e (kmwolf/centos-qemu-kvm) +RH-Bugzilla: 1951814 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Hanna Reitz +RH-Acked-by: Thomas Huth +RH-Acked-by: Philippe Mathieu-Daudé + +qcow2 v3 has been around for a long time (since QEMU 1.1/RHEL 7), so +there is no real reason any more to use it. People still using it might +do so unintentionally. Warn about it and suggest upgrading during the +RHEL 9 timeframe so that the code can possibly be disabled in RHEL 10. + +The warning is restricted to read-write mode and the system emulator. +The primary motivation for not having it in qemu-img is that 'qemu-img +amend' for upgrades would warn otherwise. It also avoids having to make +too many changes to the test suite. + +bdrv_uses_whitelist() is used as a proxy for deciding whether we are +running in a tool or the system emulator. This is not entirely clean, +but it's what is available and the same function qcow2_do_open() already +uses it this way for another warning. + +Signed-off-by: Kevin Wolf + +patch_name: kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch +present_in_specfile: true +location_in_specfile: 116 +--- +Rebase notes (6.1.0): +- Replace bs->read_only with bdrv_is_read_only +--- + block/qcow2.c | 6 ++++++ + tests/qemu-iotests/common.filter | 1 + + 2 files changed, 7 insertions(+) + +diff --git a/block/qcow2.c b/block/qcow2.c +index 30fd53fa64..22084730f9 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -1337,6 +1337,12 @@ qcow2_do_open(BlockDriverState *bs, QDict *options, int flags, + ret = -ENOTSUP; + goto fail; + } ++ if (header.version < 3 && !bdrv_is_read_only(bs) && bdrv_uses_whitelist()) { ++ warn_report_once("qcow2 v2 images are deprecated and may not be " ++ "supported in future versions. Please consider " ++ "upgrading the image with 'qemu-img amend " ++ "-o compat=v3'."); ++ } + + s->qcow_version = header.version; + +diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter +index 6b32c7fbfa..6ddda2ee64 100644 +--- a/tests/qemu-iotests/common.filter ++++ b/tests/qemu-iotests/common.filter +@@ -83,6 +83,7 @@ _filter_qemu() + { + gsed -e "s#\\(^\\|(qemu) \\)$(basename $QEMU_PROG):#\1QEMU_PROG:#" \ + -e 's#^QEMU [0-9]\+\.[0-9]\+\.[0-9]\+ monitor#QEMU X.Y.Z monitor#' \ ++ -e "/qcow2 v2 images are deprecated/d" \ + -e $'s#\r##' # QEMU monitor uses \r\n line endings + } + +-- +2.39.1 + diff --git a/0016-qga-linux-add-usb-support-to-guest-get-fsinfo.patch b/0016-qga-linux-add-usb-support-to-guest-get-fsinfo.patch new file mode 100644 index 0000000..bb9455a --- /dev/null +++ b/0016-qga-linux-add-usb-support-to-guest-get-fsinfo.patch @@ -0,0 +1,53 @@ +From 78a42cf27aa519bb71214443ab570b40e156fa9c Mon Sep 17 00:00:00 2001 +From: Kfir Manor +Date: Sun, 22 Jan 2023 17:33:07 +0200 +Subject: qga/linux: add usb support to guest-get-fsinfo + +RH-Author: Kostiantyn Kostiuk +RH-MergeRequest: 140: qga/linux: add usb support to guest-get-fsinfo +RH-Bugzilla: 2149191 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: yvugenfi +RH-Commit: [1/1] bae929a2d0d0ad20e7308ede69c26499fc2119c7 (kostyanf14/redhat_centos-stream_src_qemu-kvm) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2149191 +Upstream patch: https://patchew.org/QEMU/20230122153307.1050593-1-kfir@daynix.com/ + +Signed-off-by: Kfir Manor +Reviewed-by: Konstantin Kostiuk +Signed-off-by: Konstantin Kostiuk + +Patch-name: kvm-qga-linux-add-usb-support-to-guest-get-fsinfo.patch +Patch-id: 72 +Patch-present-in-specfile: True +--- + qga/commands-posix.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/qga/commands-posix.c b/qga/commands-posix.c +index 079689d79a..97754930c1 100644 +--- a/qga/commands-posix.c ++++ b/qga/commands-posix.c +@@ -879,7 +879,9 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath, + g_str_equal(driver, "sym53c8xx") || + g_str_equal(driver, "virtio-pci") || + g_str_equal(driver, "ahci") || +- g_str_equal(driver, "nvme"))) { ++ g_str_equal(driver, "nvme") || ++ g_str_equal(driver, "xhci_hcd") || ++ g_str_equal(driver, "ehci-pci"))) { + break; + } + +@@ -976,6 +978,8 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath, + } + } else if (strcmp(driver, "nvme") == 0) { + disk->bus_type = GUEST_DISK_BUS_TYPE_NVME; ++ } else if (strcmp(driver, "ehci-pci") == 0 || strcmp(driver, "xhci_hcd") == 0) { ++ disk->bus_type = GUEST_DISK_BUS_TYPE_USB; + } else { + g_debug("unknown driver '%s' (sysfs path '%s')", driver, syspath); + goto cleanup; +-- +2.39.1 + diff --git a/0017-Add-RHEL-9.2.0-compat-structure.patch b/0017-Add-RHEL-9.2.0-compat-structure.patch new file mode 100644 index 0000000..ce0ba5c --- /dev/null +++ b/0017-Add-RHEL-9.2.0-compat-structure.patch @@ -0,0 +1,110 @@ +From bd5d81d2865c239ffea0fecf32476732149ad05c Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 15 Feb 2023 02:03:17 -0500 +Subject: Add RHEL 9.2.0 compat structure + +Adding compatibility bits necessary to keep 9.2.0 machine +types same after rebase to 8.0. + +Signed-off-by: Miroslav Rezanina + +Rebase notes (8.0.0 rc4): +- Added migration.x-preempt-pre-7-2 compat) +--- + hw/arm/virt.c | 1 + + hw/core/machine.c | 10 ++++++++++ + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 3 +++ + hw/s390x/s390-virtio-ccw.c | 1 + + include/hw/boards.h | 3 +++ + 6 files changed, 20 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 1ae1654be5..9be53e9355 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3669,6 +3669,7 @@ type_init(rhel_machine_init); + static void rhel920_virt_options(MachineClass *mc) + { + compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len); ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len); + } + DEFINE_RHEL_MACHINE_AS_LATEST(9, 2, 0) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 5aa567fad3..0e0120b7f2 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -52,6 +52,16 @@ const size_t hw_compat_7_2_len = G_N_ELEMENTS(hw_compat_7_2); + const char *rhel_old_machine_deprecation = + "machine types for previous major releases are deprecated"; + ++GlobalProperty hw_compat_rhel_9_2[] = { ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "e1000e", "migrate-timadj", "off" }, ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "virtio-mem", "x-early-migration", "false" }, ++ /* hw_compat_rhel_9_2 from hw_compat_7_2 */ ++ { "migration", "x-preempt-pre-7-2", "true" }, ++}; ++const size_t hw_compat_rhel_9_2_len = G_N_ELEMENTS(hw_compat_rhel_9_2); ++ + /* + * Mostly the same as hw_compat_7_0 + */ +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 3e330fd36f..90fb6e2e03 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -947,6 +947,8 @@ static void pc_machine_rhel760_options(MachineClass *m) + /* From pc_i440fx_5_1_machine_options() */ + pcmc->pci_root_uid = 1; + pcmc->enforce_amd_1tb_hole = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_9_2, ++ hw_compat_rhel_9_2_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_1, + hw_compat_rhel_9_1_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_0, +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 98601bb76f..8945b69175 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -701,6 +701,9 @@ static void pc_q35_machine_rhel920_options(MachineClass *m) + m->desc = "RHEL-9.2.0 PC (Q35 + ICH9, 2009)"; + pcmc->smbios_stream_product = "RHEL"; + pcmc->smbios_stream_version = "9.2.0"; ++ ++ compat_props_add(m->compat_props, hw_compat_rhel_9_2, ++ hw_compat_rhel_9_2_len); + } + + DEFINE_PC_MACHINE(q35_rhel920, "pc-q35-rhel9.2.0", pc_q35_init_rhel920, +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index dcd3b966b0..6a0b93c63d 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1211,6 +1211,7 @@ static void ccw_machine_rhel920_instance_options(MachineState *machine) + + static void ccw_machine_rhel920_class_options(MachineClass *mc) + { ++ compat_props_add(mc->compat_props, hw_compat_rhel_9_2, hw_compat_rhel_9_2_len); + } + DEFINE_CCW_MACHINE(rhel920, "rhel9.2.0", true); + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 5e7446ee40..5f08bd7550 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -461,6 +461,9 @@ extern const size_t hw_compat_2_2_len; + extern GlobalProperty hw_compat_2_1[]; + extern const size_t hw_compat_2_1_len; + ++extern GlobalProperty hw_compat_rhel_9_2[]; ++extern const size_t hw_compat_rhel_9_2_len; ++ + extern GlobalProperty hw_compat_rhel_9_1[]; + extern const size_t hw_compat_rhel_9_1_len; + +-- +2.39.1 + diff --git a/0018-redhat-hw-i386-pc-Update-x86-machine-type-compatibil.patch b/0018-redhat-hw-i386-pc-Update-x86-machine-type-compatibil.patch new file mode 100644 index 0000000..81993e9 --- /dev/null +++ b/0018-redhat-hw-i386-pc-Update-x86-machine-type-compatibil.patch @@ -0,0 +1,76 @@ +From c6eaf73adda2e87fe91c9a3836f45dd58a553e06 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Mon, 27 Mar 2023 15:14:03 +0200 +Subject: redhat: hw/i386/pc: Update x86 machine type compatibility for QEMU + 8.0.0 update + +Add pc_rhel_9_2_compat based on upstream pc_compat_7_2. + +Signed-off-by: Thomas Huth +--- + hw/i386/pc.c | 6 ++++++ + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + include/hw/i386/pc.h | 3 +++ + 4 files changed, 13 insertions(+) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 8abb1f872e..f216922cee 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -429,6 +429,12 @@ GlobalProperty pc_rhel_compat[] = { + }; + const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat); + ++GlobalProperty pc_rhel_9_2_compat[] = { ++ /* pc_rhel_9_2_compat from pc_compat_7_2 */ ++ { "ICH9-LPC", "noreboot", "true" }, ++}; ++const size_t pc_rhel_9_2_compat_len = G_N_ELEMENTS(pc_rhel_9_2_compat); ++ + GlobalProperty pc_rhel_9_0_compat[] = { + /* pc_rhel_9_0_compat from pc_compat_6_2 */ + { "virtio-mem", "unplugged-inaccessible", "off" }, +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 90fb6e2e03..fc704d783f 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -949,6 +949,8 @@ static void pc_machine_rhel760_options(MachineClass *m) + pcmc->enforce_amd_1tb_hole = false; + compat_props_add(m->compat_props, hw_compat_rhel_9_2, + hw_compat_rhel_9_2_len); ++ compat_props_add(m->compat_props, pc_rhel_9_2_compat, ++ pc_rhel_9_2_compat_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_1, + hw_compat_rhel_9_1_len); + compat_props_add(m->compat_props, hw_compat_rhel_9_0, +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 8945b69175..e97655616a 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -704,6 +704,8 @@ static void pc_q35_machine_rhel920_options(MachineClass *m) + + compat_props_add(m->compat_props, hw_compat_rhel_9_2, + hw_compat_rhel_9_2_len); ++ compat_props_add(m->compat_props, pc_rhel_9_2_compat, ++ pc_rhel_9_2_compat_len); + } + + DEFINE_PC_MACHINE(q35_rhel920, "pc-q35-rhel9.2.0", pc_q35_init_rhel920, +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 4376f64a47..d218ad1628 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -296,6 +296,9 @@ int pc_machine_kvm_type(MachineState *machine, const char *vm_type); + extern GlobalProperty pc_rhel_compat[]; + extern const size_t pc_rhel_compat_len; + ++extern GlobalProperty pc_rhel_9_2_compat[]; ++extern const size_t pc_rhel_9_2_compat_len; ++ + extern GlobalProperty pc_rhel_9_0_compat[]; + extern const size_t pc_rhel_9_0_compat_len; + +-- +2.39.1 + diff --git a/0019-Disable-unwanted-new-devices.patch b/0019-Disable-unwanted-new-devices.patch new file mode 100644 index 0000000..f656ca9 --- /dev/null +++ b/0019-Disable-unwanted-new-devices.patch @@ -0,0 +1,83 @@ +From 8173d2eabaf77312d36b00c618f6770948b80593 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Mon, 17 Apr 2023 01:24:18 -0400 +Subject: Disable unwanted new devices + +QEMU 8.0 adds two new device we do not want to support that can't +be disabled using configure switch. + +1) ide-cf - virtual CompactFlash card + +2) i2c-echo - testing echo device + +Use manual disabling of the device by changing code (1) and meson configs (2). + +Signed-off-by: Miroslav Rezanina +--- + hw/ide/qdev.c | 9 +++++++++ + hw/misc/meson.build | 3 ++- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/hw/ide/qdev.c b/hw/ide/qdev.c +index 1b3b4da01d..454bfa5783 100644 +--- a/hw/ide/qdev.c ++++ b/hw/ide/qdev.c +@@ -283,10 +283,13 @@ static void ide_cd_realize(IDEDevice *dev, Error **errp) + ide_dev_initfn(dev, IDE_CD, errp); + } + ++/* Disabled for Red Hat Enterprise Linux */ ++#if 0 + static void ide_cf_realize(IDEDevice *dev, Error **errp) + { + ide_dev_initfn(dev, IDE_CFATA, errp); + } ++#endif + + #define DEFINE_IDE_DEV_PROPERTIES() \ + DEFINE_BLOCK_PROPERTIES(IDEDrive, dev.conf), \ +@@ -346,6 +349,8 @@ static const TypeInfo ide_cd_info = { + .class_init = ide_cd_class_init, + }; + ++/* Disabled for Red Hat Enterprise Linux */ ++#if 0 + static Property ide_cf_properties[] = { + DEFINE_IDE_DEV_PROPERTIES(), + DEFINE_BLOCK_CHS_PROPERTIES(IDEDrive, dev.conf), +@@ -371,6 +376,7 @@ static const TypeInfo ide_cf_info = { + .instance_size = sizeof(IDEDrive), + .class_init = ide_cf_class_init, + }; ++#endif + + static void ide_device_class_init(ObjectClass *klass, void *data) + { +@@ -396,7 +402,10 @@ static void ide_register_types(void) + type_register_static(&ide_bus_info); + type_register_static(&ide_hd_info); + type_register_static(&ide_cd_info); ++/* Disabled for Red Hat Enterprise Linux */ ++#if 0 + type_register_static(&ide_cf_info); ++#endif + type_register_static(&ide_device_type_info); + } + +diff --git a/hw/misc/meson.build b/hw/misc/meson.build +index a40245ad44..9cc5a61ed7 100644 +--- a/hw/misc/meson.build ++++ b/hw/misc/meson.build +@@ -128,7 +128,8 @@ softmmu_ss.add(when: 'CONFIG_NRF51_SOC', if_true: files('nrf51_rng.c')) + + softmmu_ss.add(when: 'CONFIG_GRLIB', if_true: files('grlib_ahb_apb_pnp.c')) + +-softmmu_ss.add(when: 'CONFIG_I2C', if_true: files('i2c-echo.c')) ++# Disabled for Red Hat Enterprise Linux ++# softmmu_ss.add(when: 'CONFIG_I2C', if_true: files('i2c-echo.c')) + + specific_ss.add(when: 'CONFIG_AVR_POWER', if_true: files('avr_power.c')) + +-- +2.39.1 + diff --git a/95-kvm-memlock.conf b/95-kvm-memlock.conf new file mode 100644 index 0000000..fc59dbe --- /dev/null +++ b/95-kvm-memlock.conf @@ -0,0 +1,10 @@ +# The KVM HV implementation on Power can require a significant amount +# of unswappable memory (about half of which also needs to be host +# physically contiguous) to hold the guest's Hash Page Table (HPT) - +# roughly 1/64th of the guest's RAM size, minimum 16MiB. +# +# These limits allow unprivileged users to start smallish VMs, such as +# those used by libguestfs. +# +* hard memlock 65536 +* soft memlock 65536 diff --git a/99-qemu-guest-agent.rules b/99-qemu-guest-agent.rules new file mode 100644 index 0000000..8a290ab --- /dev/null +++ b/99-qemu-guest-agent.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \ + TAG+="systemd" ENV{SYSTEMD_WANTS}="qemu-guest-agent.service" diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..15f93e6 --- /dev/null +++ b/README.rst @@ -0,0 +1,19 @@ +=================== +qemu-kvm development +=================== + +qemu-kvm is maintained in a `source tree`_ rather than directly in dist-git. +This provides way to develope using regular source code structure and provides +way to generate SRPM and build using koji service. In addition, local build using +CentOS 9 Stream specific configuration. + +Developers deliver all changes to source-git using merge request. Only maintainers +will be pushing changes sent to source-git to dist-git. + +Each release in dist-git is tagged in the source repository so you can easily +check out the source tree for a build. The tags are in the format +name-version-release, but note release doesn't contain the dist tag since the +source can be built in different build roots (Fedora, CentOS, etc.) + +.. _source tree: https://gitlab.com/redhat/centos-stream/src/qemu-kvm + diff --git a/README.tests b/README.tests new file mode 100644 index 0000000..9932773 --- /dev/null +++ b/README.tests @@ -0,0 +1,39 @@ +qemu-kvm-tests README +===================== + +The qemu-kvm-tests rpm contains tests that can be used to verify the +functionality of the installed qemu-kvm package + +When installed, the files from this rpm will be arranged in the following +directory structure + +tests-src/ +├── README +├── scripts +│   ├── qemu.py +│   └── qmp +└── tests + ├── acceptance + ├── Makefile.include + └── qemu-iotests + +The tests/ directory within the tests-src/ directory is setup to remain a copy +of a subset of the tests/ directory from the QEMU source tree + +The avocado_qemu tests and qemu-iotests, along with files required for the +execution of the avocado_qemu tests (scripts/qemu.py and scripts/qmp/) will be +installed in a new location - /usr/lib64/qemu-kvm/tests-src/ + +avocado_qemu tests: +The avocado_qemu tests can be executed by running the following avocado command: +avocado run -p qemu_bin=/usr/libexec/qemu-kvm /usr/lib64/qemu-kvm/tests/acceptance/ +Avocado needs to be installed separately using either pip or from source as +Avocado is not being packaged for RHEL-8. + +qemu-iotests: +symlinks to corresponding binaries need to be created for QEMU_PROG, +QEMU_IO_PROG, QEMU_IMG_PROG, and QEMU_NBD_PROG before the iotests can be +executed. + +The primary purpose of this package is to make these tests available to be +executed as gating tests for the virt module in the RHEL-8 OSCI environment. diff --git a/bridge.conf b/bridge.conf new file mode 100644 index 0000000..a573665 --- /dev/null +++ b/bridge.conf @@ -0,0 +1 @@ +allow virbr0 diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..8d17eb8 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,9 @@ +# recipients: kvmqe-ci, yfu +--- !Policy +product_versions: + - rhel-9 +decision_context: osci_compose_gate +subject_type: brew-build +rules: + - !PassingTestCaseRule {test_case_name: kvm-ci.qemu-kvm.x86_64-intel.brew-build.gating.tier1.functional} + - !PassingTestCaseRule {test_case_name: kvm-ci.qemu-kvm.x86_64-amd.brew-build.gating.tier1.functional} diff --git a/kvm-acpi-pcihp-allow-repeating-hot-unplug-requests.patch b/kvm-acpi-pcihp-allow-repeating-hot-unplug-requests.patch new file mode 100644 index 0000000..b937d27 --- /dev/null +++ b/kvm-acpi-pcihp-allow-repeating-hot-unplug-requests.patch @@ -0,0 +1,84 @@ +From 61256a82ce78f40222455becb8850b5f5ebb5d72 Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Tue, 18 Apr 2023 11:04:49 +0200 +Subject: [PATCH 1/3] acpi: pcihp: allow repeating hot-unplug requests + +RH-Author: Igor Mammedov +RH-MergeRequest: 159: acpi: pcihp: allow repeating hot-unplug requests +RH-Bugzilla: 2087047 +RH-Acked-by: Ani Sinha +RH-Acked-by: Julia Suvorova +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: MST +RH-Commit: [1/1] 9c597232466b27d91f127ee6004322d6ba69755f (imammedo/qemu-kvm-c-9-s-imam) + +with Q35 using ACPI PCI hotplug by default, user's request to unplug +device is ignored when it's issued before guest OS has been booted. +And any additional attempt to request device hot-unplug afterwards +results in following error: + + "Device XYZ is already in the process of unplug" + +arguably it can be considered as a regression introduced by [2], +before which it was possible to issue unplug request multiple +times. + +Accept new uplug requests after timeout (1ms). This brings ACPI PCI +hotplug on par with native PCIe unplug behavior [1] and allows user +to repeat unplug requests at propper times. +Set expire timeout to arbitrary 1msec so user won't be able to +flood guest with SCI interrupts by calling device_del in tight loop. + +PS: +ACPI spec doesn't mandate what OSPM can do with GPEx.status +bits set before it's booted => it's impl. depended. +Status bits may be retained (I tested with one Windows version) +or cleared (Linux since 2.6 kernel times) during guest's ACPI +subsystem initialization. +Clearing status bits (though not wrong per se) hides the unplug +event from guest, and it's upto user to repeat device_del later +when guest is able to handle unplug requests. + +1) 18416c62e3 ("pcie: expire pending delete") +2) +Fixes: cce8944cc9ef ("qdev-monitor: Forbid repeated device_del") +Signed-off-by: Igor Mammedov +Acked-by: Gerd Hoffmann +CC: mst@redhat.com +CC: anisinha@redhat.com +CC: jusual@redhat.com +CC: kraxel@redhat.com +Message-Id: <20230418090449.2155757-1-imammedo@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Ani Sinha +(cherry picked from commit 0f689cf5ada4d5df5ab95c7f7aa9fc221afa855d) +Signed-off-by: Igor Mammedov +--- + hw/acpi/pcihp.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c +index dcfb779a7a..cdd6f775a1 100644 +--- a/hw/acpi/pcihp.c ++++ b/hw/acpi/pcihp.c +@@ -357,6 +357,16 @@ void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev, + * acpi_pcihp_eject_slot() when the operation is completed. + */ + pdev->qdev.pending_deleted_event = true; ++ /* if unplug was requested before OSPM is initialized, ++ * linux kernel will clear GPE0.sts[] bits during boot, which effectively ++ * hides unplug event. And than followup qmp_device_del() calls remain ++ * blocked by above flag permanently. ++ * Unblock qmp_device_del() by setting expire limit, so user can ++ * repeat unplug request later when OSPM has been booted. ++ */ ++ pdev->qdev.pending_deleted_expires_ms = ++ qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL); /* 1 msec */ ++ + s->acpi_pcihp_pci_status[bsel].down |= (1U << slot); + acpi_send_event(DEVICE(hotplug_dev), ACPI_PCI_HOTPLUG_STATUS); + } +-- +2.39.1 + diff --git a/kvm-apic-disable-reentrancy-detection-for-apic-msi.patch b/kvm-apic-disable-reentrancy-detection-for-apic-msi.patch new file mode 100644 index 0000000..69505f8 --- /dev/null +++ b/kvm-apic-disable-reentrancy-detection-for-apic-msi.patch @@ -0,0 +1,55 @@ +From 5beea8b889a38aa59259679d7f1ba050f09eb0f0 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 12/21] apic: disable reentrancy detection for apic-msi + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [8/13] 329f3b1c02fc42d85c821dd14c70e6b885cf849a (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 50795ee051a342c681a9b45671c552fbd6274db8 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:13 2023 -0400 + + apic: disable reentrancy detection for apic-msi + + As the code is designed for re-entrant calls to apic-msi, mark apic-msi + as reentrancy-safe. + + Signed-off-by: Alexander Bulekov + Reviewed-by: Darren Kenny + Message-Id: <20230427211013.2994127-9-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/intc/apic.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/hw/intc/apic.c b/hw/intc/apic.c +index 20b5a94073..ac3d47d231 100644 +--- a/hw/intc/apic.c ++++ b/hw/intc/apic.c +@@ -885,6 +885,13 @@ static void apic_realize(DeviceState *dev, Error **errp) + memory_region_init_io(&s->io_memory, OBJECT(s), &apic_io_ops, s, "apic-msi", + APIC_SPACE_SIZE); + ++ /* ++ * apic-msi's apic_mem_write can call into ioapic_eoi_broadcast, which can ++ * write back to apic-msi. As such mark the apic-msi region re-entrancy ++ * safe. ++ */ ++ s->io_memory.disable_reentrancy_guard = true; ++ + s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, apic_timer, s); + local_apics[s->id] = s; + +-- +2.39.3 + diff --git a/kvm-async-Add-an-optional-reentrancy-guard-to-the-BH-API.patch b/kvm-async-Add-an-optional-reentrancy-guard-to-the-BH-API.patch new file mode 100644 index 0000000..65ba3be --- /dev/null +++ b/kvm-async-Add-an-optional-reentrancy-guard-to-the-BH-API.patch @@ -0,0 +1,231 @@ +From f6db359f543723e2eb840653d35004af357ea5ac Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 06/21] async: Add an optional reentrancy guard to the BH API + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [2/13] 009a9a68c1c25b9ad0cd9bc0d73b3e07bee2a19d (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 9c86c97f12c060bf7484dd931f38634e166a81f0 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:07 2023 -0400 + + async: Add an optional reentrancy guard to the BH API + + Devices can pass their MemoryReentrancyGuard (from their DeviceState), + when creating new BHes. Then, the async API will toggle the guard + before/after calling the BH call-back. This prevents bh->mmio reentrancy + issues. + + Signed-off-by: Alexander Bulekov + Reviewed-by: Darren Kenny + Message-Id: <20230427211013.2994127-3-alxndr@bu.edu> + [thuth: Fix "line over 90 characters" checkpatch.pl error] + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + docs/devel/multiple-iothreads.txt | 7 +++++++ + include/block/aio.h | 18 ++++++++++++++++-- + include/qemu/main-loop.h | 7 +++++-- + tests/unit/ptimer-test-stubs.c | 3 ++- + util/async.c | 18 +++++++++++++++++- + util/main-loop.c | 6 ++++-- + util/trace-events | 1 + + 7 files changed, 52 insertions(+), 8 deletions(-) + +diff --git a/docs/devel/multiple-iothreads.txt b/docs/devel/multiple-iothreads.txt +index 343120f2ef..a3e949f6b3 100644 +--- a/docs/devel/multiple-iothreads.txt ++++ b/docs/devel/multiple-iothreads.txt +@@ -61,6 +61,7 @@ There are several old APIs that use the main loop AioContext: + * LEGACY qemu_aio_set_event_notifier() - monitor an event notifier + * LEGACY timer_new_ms() - create a timer + * LEGACY qemu_bh_new() - create a BH ++ * LEGACY qemu_bh_new_guarded() - create a BH with a device re-entrancy guard + * LEGACY qemu_aio_wait() - run an event loop iteration + + Since they implicitly work on the main loop they cannot be used in code that +@@ -72,8 +73,14 @@ Instead, use the AioContext functions directly (see include/block/aio.h): + * aio_set_event_notifier() - monitor an event notifier + * aio_timer_new() - create a timer + * aio_bh_new() - create a BH ++ * aio_bh_new_guarded() - create a BH with a device re-entrancy guard + * aio_poll() - run an event loop iteration + ++The qemu_bh_new_guarded/aio_bh_new_guarded APIs accept a "MemReentrancyGuard" ++argument, which is used to check for and prevent re-entrancy problems. For ++BHs associated with devices, the reentrancy-guard is contained in the ++corresponding DeviceState and named "mem_reentrancy_guard". ++ + The AioContext can be obtained from the IOThread using + iothread_get_aio_context() or for the main loop using qemu_get_aio_context(). + Code that takes an AioContext argument works both in IOThreads or the main +diff --git a/include/block/aio.h b/include/block/aio.h +index 543717f294..db6f23c619 100644 +--- a/include/block/aio.h ++++ b/include/block/aio.h +@@ -23,6 +23,8 @@ + #include "qemu/thread.h" + #include "qemu/timer.h" + #include "block/graph-lock.h" ++#include "hw/qdev-core.h" ++ + + typedef struct BlockAIOCB BlockAIOCB; + typedef void BlockCompletionFunc(void *opaque, int ret); +@@ -331,9 +333,11 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, + * is opaque and must be allocated prior to its use. + * + * @name: A human-readable identifier for debugging purposes. ++ * @reentrancy_guard: A guard set when entering a cb to prevent ++ * device-reentrancy issues + */ + QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, +- const char *name); ++ const char *name, MemReentrancyGuard *reentrancy_guard); + + /** + * aio_bh_new: Allocate a new bottom half structure +@@ -342,7 +346,17 @@ QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, + * string. + */ + #define aio_bh_new(ctx, cb, opaque) \ +- aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb))) ++ aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb)), NULL) ++ ++/** ++ * aio_bh_new_guarded: Allocate a new bottom half structure with a ++ * reentrancy_guard ++ * ++ * A convenience wrapper for aio_bh_new_full() that uses the cb as the name ++ * string. ++ */ ++#define aio_bh_new_guarded(ctx, cb, opaque, guard) \ ++ aio_bh_new_full((ctx), (cb), (opaque), (stringify(cb)), guard) + + /** + * aio_notify: Force processing of pending events. +diff --git a/include/qemu/main-loop.h b/include/qemu/main-loop.h +index b3e54e00bc..68e70e61aa 100644 +--- a/include/qemu/main-loop.h ++++ b/include/qemu/main-loop.h +@@ -387,9 +387,12 @@ void qemu_cond_timedwait_iothread(QemuCond *cond, int ms); + + /* internal interfaces */ + ++#define qemu_bh_new_guarded(cb, opaque, guard) \ ++ qemu_bh_new_full((cb), (opaque), (stringify(cb)), guard) + #define qemu_bh_new(cb, opaque) \ +- qemu_bh_new_full((cb), (opaque), (stringify(cb))) +-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name); ++ qemu_bh_new_full((cb), (opaque), (stringify(cb)), NULL) ++QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name, ++ MemReentrancyGuard *reentrancy_guard); + void qemu_bh_schedule_idle(QEMUBH *bh); + + enum { +diff --git a/tests/unit/ptimer-test-stubs.c b/tests/unit/ptimer-test-stubs.c +index f2bfcede93..8c9407c560 100644 +--- a/tests/unit/ptimer-test-stubs.c ++++ b/tests/unit/ptimer-test-stubs.c +@@ -107,7 +107,8 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask) + return deadline; + } + +-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name) ++QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name, ++ MemReentrancyGuard *reentrancy_guard) + { + QEMUBH *bh = g_new(QEMUBH, 1); + +diff --git a/util/async.c b/util/async.c +index 21016a1ac7..a9b528c370 100644 +--- a/util/async.c ++++ b/util/async.c +@@ -65,6 +65,7 @@ struct QEMUBH { + void *opaque; + QSLIST_ENTRY(QEMUBH) next; + unsigned flags; ++ MemReentrancyGuard *reentrancy_guard; + }; + + /* Called concurrently from any thread */ +@@ -137,7 +138,7 @@ void aio_bh_schedule_oneshot_full(AioContext *ctx, QEMUBHFunc *cb, + } + + QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, +- const char *name) ++ const char *name, MemReentrancyGuard *reentrancy_guard) + { + QEMUBH *bh; + bh = g_new(QEMUBH, 1); +@@ -146,13 +147,28 @@ QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque, + .cb = cb, + .opaque = opaque, + .name = name, ++ .reentrancy_guard = reentrancy_guard, + }; + return bh; + } + + void aio_bh_call(QEMUBH *bh) + { ++ bool last_engaged_in_io = false; ++ ++ if (bh->reentrancy_guard) { ++ last_engaged_in_io = bh->reentrancy_guard->engaged_in_io; ++ if (bh->reentrancy_guard->engaged_in_io) { ++ trace_reentrant_aio(bh->ctx, bh->name); ++ } ++ bh->reentrancy_guard->engaged_in_io = true; ++ } ++ + bh->cb(bh->opaque); ++ ++ if (bh->reentrancy_guard) { ++ bh->reentrancy_guard->engaged_in_io = last_engaged_in_io; ++ } + } + + /* Multiple occurrences of aio_bh_poll cannot be called concurrently. */ +diff --git a/util/main-loop.c b/util/main-loop.c +index e180c85145..7022f02ef8 100644 +--- a/util/main-loop.c ++++ b/util/main-loop.c +@@ -605,9 +605,11 @@ void main_loop_wait(int nonblocking) + + /* Functions to operate on the main QEMU AioContext. */ + +-QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name) ++QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name, ++ MemReentrancyGuard *reentrancy_guard) + { +- return aio_bh_new_full(qemu_aio_context, cb, opaque, name); ++ return aio_bh_new_full(qemu_aio_context, cb, opaque, name, ++ reentrancy_guard); + } + + /* +diff --git a/util/trace-events b/util/trace-events +index 16f78d8fe5..3f7e766683 100644 +--- a/util/trace-events ++++ b/util/trace-events +@@ -11,6 +11,7 @@ poll_remove(void *ctx, void *node, int fd) "ctx %p node %p fd %d" + # async.c + aio_co_schedule(void *ctx, void *co) "ctx %p co %p" + aio_co_schedule_bh_cb(void *ctx, void *co) "ctx %p co %p" ++reentrant_aio(void *ctx, const char *name) "ctx %p name %s" + + # thread-pool.c + thread_pool_submit(void *pool, void *req, void *opaque) "pool %p req %p opaque %p" +-- +2.39.3 + diff --git a/kvm-async-avoid-use-after-free-on-re-entrancy-guard.patch b/kvm-async-avoid-use-after-free-on-re-entrancy-guard.patch new file mode 100644 index 0000000..df71fa2 --- /dev/null +++ b/kvm-async-avoid-use-after-free-on-re-entrancy-guard.patch @@ -0,0 +1,70 @@ +From 137e84f68da06666ebf7f391766cc6209ce1c39c Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 13/21] async: avoid use-after-free on re-entrancy guard + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [9/13] d4b957108aaacf4a597122aaeeaa8e56985f1fca (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 7915bd06f25e1803778081161bf6fa10c42dc7cd +Author: Alexander Bulekov +Date: Mon May 1 10:19:56 2023 -0400 + + async: avoid use-after-free on re-entrancy guard + + A BH callback can free the BH, causing a use-after-free in aio_bh_call. + Fix that by keeping a local copy of the re-entrancy guard pointer. + + Buglink: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=58513 + Fixes: 9c86c97f12 ("async: Add an optional reentrancy guard to the BH API") + Signed-off-by: Alexander Bulekov + Message-Id: <20230501141956.3444868-1-alxndr@bu.edu> + Reviewed-by: Thomas Huth + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + util/async.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/util/async.c b/util/async.c +index a9b528c370..cd1a1815f9 100644 +--- a/util/async.c ++++ b/util/async.c +@@ -156,18 +156,20 @@ void aio_bh_call(QEMUBH *bh) + { + bool last_engaged_in_io = false; + +- if (bh->reentrancy_guard) { +- last_engaged_in_io = bh->reentrancy_guard->engaged_in_io; +- if (bh->reentrancy_guard->engaged_in_io) { ++ /* Make a copy of the guard-pointer as cb may free the bh */ ++ MemReentrancyGuard *reentrancy_guard = bh->reentrancy_guard; ++ if (reentrancy_guard) { ++ last_engaged_in_io = reentrancy_guard->engaged_in_io; ++ if (reentrancy_guard->engaged_in_io) { + trace_reentrant_aio(bh->ctx, bh->name); + } +- bh->reentrancy_guard->engaged_in_io = true; ++ reentrancy_guard->engaged_in_io = true; + } + + bh->cb(bh->opaque); + +- if (bh->reentrancy_guard) { +- bh->reentrancy_guard->engaged_in_io = last_engaged_in_io; ++ if (reentrancy_guard) { ++ reentrancy_guard->engaged_in_io = last_engaged_in_io; + } + } + +-- +2.39.3 + diff --git a/kvm-bcm2835_property-disable-reentrancy-detection-for-io.patch b/kvm-bcm2835_property-disable-reentrancy-detection-for-io.patch new file mode 100644 index 0000000..6d9abb8 --- /dev/null +++ b/kvm-bcm2835_property-disable-reentrancy-detection-for-io.patch @@ -0,0 +1,57 @@ +From 40866640d15e6a8c9f6af7e437edc1ec1e17ba34 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 10/21] bcm2835_property: disable reentrancy detection for + iomem + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [6/13] 128ebc85e228674af66553af82fba70eb87960e6 (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 985c4a4e547afb9573b6bd6843d20eb2c3d1d1cd +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:11 2023 -0400 + + bcm2835_property: disable reentrancy detection for iomem + + As the code is designed for re-entrant calls from bcm2835_property to + bcm2835_mbox and back into bcm2835_property, mark iomem as + reentrancy-safe. + + Signed-off-by: Alexander Bulekov + Reviewed-by: Thomas Huth + Message-Id: <20230427211013.2994127-7-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/misc/bcm2835_property.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c +index 890ae7bae5..de056ea2df 100644 +--- a/hw/misc/bcm2835_property.c ++++ b/hw/misc/bcm2835_property.c +@@ -382,6 +382,13 @@ static void bcm2835_property_init(Object *obj) + + memory_region_init_io(&s->iomem, OBJECT(s), &bcm2835_property_ops, s, + TYPE_BCM2835_PROPERTY, 0x10); ++ ++ /* ++ * bcm2835_property_ops call into bcm2835_mbox, which in-turn reads from ++ * iomem. As such, mark iomem as re-entracy safe. ++ */ ++ s->iomem.disable_reentrancy_guard = true; ++ + sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->iomem); + sysbus_init_irq(SYS_BUS_DEVICE(s), &s->mbox_irq); + } +-- +2.39.3 + diff --git a/kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch b/kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch new file mode 100644 index 0000000..fbab82d --- /dev/null +++ b/kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch @@ -0,0 +1,56 @@ +From dfa2811e88afaf996345552330e97f0513c1803c Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 4 May 2023 13:57:34 +0200 +Subject: [PATCH 53/56] block: Don't call no_coroutine_fns in + qmp_block_resize() + +RH-Author: Kevin Wolf +RH-MergeRequest: 164: block: Fix hangs in qmp_block_resize() +RH-Bugzilla: 2185688 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Hanna Czenczek +RH-Acked-by: Eric Blake +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [2/4] 7ac7e34821cfc8bd5f0daadd7a1c4a5596bc60a6 (kmwolf/centos-qemu-kvm) + +This QMP handler runs in a coroutine, so it must use the corresponding +no_co_wrappers instead. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2185688 +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +Reviewed-by: Stefan Hajnoczi +Message-Id: <20230504115750.54437-5-kwolf@redhat.com> +Signed-off-by: Kevin Wolf +(cherry picked from commit 0c7d204f50c382c6baac8c94bd57af4a022b3888) +Signed-off-by: Kevin Wolf +--- + blockdev.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index d7b5c18f0a..eb509cf964 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -2430,7 +2430,7 @@ void coroutine_fn qmp_block_resize(const char *device, const char *node_name, + return; + } + +- blk = blk_new_with_bs(bs, BLK_PERM_RESIZE, BLK_PERM_ALL, errp); ++ blk = blk_co_new_with_bs(bs, BLK_PERM_RESIZE, BLK_PERM_ALL, errp); + if (!blk) { + return; + } +@@ -2445,7 +2445,7 @@ void coroutine_fn qmp_block_resize(const char *device, const char *node_name, + + bdrv_co_lock(bs); + bdrv_drained_end(bs); +- blk_unref(blk); ++ blk_co_unref(blk); + bdrv_co_unlock(bs); + } + +-- +2.39.1 + diff --git a/kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch b/kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch new file mode 100644 index 0000000..0f0347b --- /dev/null +++ b/kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch @@ -0,0 +1,386 @@ +From 7baea25be90e184175dd5a919ee5878cbd4970c2 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 4 May 2023 13:57:33 +0200 +Subject: [PATCH 52/56] block: bdrv/blk_co_unref() for calls in coroutine + context + +RH-Author: Kevin Wolf +RH-MergeRequest: 164: block: Fix hangs in qmp_block_resize() +RH-Bugzilla: 2185688 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Hanna Czenczek +RH-Acked-by: Eric Blake +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [1/4] 8ebf8486b082c30ca1b39a6ede35e471eaaccfa3 (kmwolf/centos-qemu-kvm) + +These functions must not be called in coroutine context, because they +need write access to the graph. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +Reviewed-by: Stefan Hajnoczi +Message-Id: <20230504115750.54437-4-kwolf@redhat.com> +Signed-off-by: Kevin Wolf +(cherry picked from commit b2ab5f545fa1eaaf2955dd617bee19a8b3279786) +Signed-off-by: Kevin Wolf +--- + block.c | 2 +- + block/crypto.c | 6 +++--- + block/parallels.c | 6 +++--- + block/qcow.c | 6 +++--- + block/qcow2.c | 14 +++++++------- + block/qed.c | 6 +++--- + block/vdi.c | 6 +++--- + block/vhdx.c | 6 +++--- + block/vmdk.c | 18 +++++++++--------- + block/vpc.c | 6 +++--- + include/block/block-global-state.h | 3 ++- + include/sysemu/block-backend-global-state.h | 5 ++++- + 12 files changed, 44 insertions(+), 40 deletions(-) + +diff --git a/block.c b/block.c +index d79a52ca74..a48112f945 100644 +--- a/block.c ++++ b/block.c +@@ -680,7 +680,7 @@ int coroutine_fn bdrv_co_create_opts_simple(BlockDriver *drv, + + ret = 0; + out: +- blk_unref(blk); ++ blk_co_unref(blk); + return ret; + } + +diff --git a/block/crypto.c b/block/crypto.c +index ca67289187..8fd3ad0054 100644 +--- a/block/crypto.c ++++ b/block/crypto.c +@@ -355,7 +355,7 @@ block_crypto_co_create_generic(BlockDriverState *bs, int64_t size, + ret = 0; + cleanup: + qcrypto_block_free(crypto); +- blk_unref(blk); ++ blk_co_unref(blk); + return ret; + } + +@@ -661,7 +661,7 @@ block_crypto_co_create_luks(BlockdevCreateOptions *create_options, Error **errp) + + ret = 0; + fail: +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + return ret; + } + +@@ -730,7 +730,7 @@ fail: + bdrv_co_delete_file_noerr(bs); + } + +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_QCryptoBlockCreateOptions(create_opts); + qobject_unref(cryptoopts); + return ret; +diff --git a/block/parallels.c b/block/parallels.c +index 013684801a..b49c35929e 100644 +--- a/block/parallels.c ++++ b/block/parallels.c +@@ -613,8 +613,8 @@ static int coroutine_fn parallels_co_create(BlockdevCreateOptions* opts, + + ret = 0; + out: +- blk_unref(blk); +- bdrv_unref(bs); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs); + return ret; + + exit: +@@ -691,7 +691,7 @@ parallels_co_create_opts(BlockDriver *drv, const char *filename, + + done: + qobject_unref(qdict); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/block/qcow.c b/block/qcow.c +index 490e4f819e..a0c701f578 100644 +--- a/block/qcow.c ++++ b/block/qcow.c +@@ -915,8 +915,8 @@ static int coroutine_fn qcow_co_create(BlockdevCreateOptions *opts, + g_free(tmp); + ret = 0; + exit: +- blk_unref(qcow_blk); +- bdrv_unref(bs); ++ blk_co_unref(qcow_blk); ++ bdrv_co_unref(bs); + qcrypto_block_free(crypto); + return ret; + } +@@ -1015,7 +1015,7 @@ qcow_co_create_opts(BlockDriver *drv, const char *filename, + fail: + g_free(backing_fmt); + qobject_unref(qdict); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/block/qcow2.c b/block/qcow2.c +index 22084730f9..0b8beb8b47 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -3711,7 +3711,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp) + goto out; + } + +- blk_unref(blk); ++ blk_co_unref(blk); + blk = NULL; + + /* +@@ -3791,7 +3791,7 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp) + } + } + +- blk_unref(blk); ++ blk_co_unref(blk); + blk = NULL; + + /* Reopen the image without BDRV_O_NO_FLUSH to flush it before returning. +@@ -3816,9 +3816,9 @@ qcow2_co_create(BlockdevCreateOptions *create_options, Error **errp) + + ret = 0; + out: +- blk_unref(blk); +- bdrv_unref(bs); +- bdrv_unref(data_bs); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs); ++ bdrv_co_unref(data_bs); + return ret; + } + +@@ -3949,8 +3949,8 @@ finish: + } + + qobject_unref(qdict); +- bdrv_unref(bs); +- bdrv_unref(data_bs); ++ bdrv_co_unref(bs); ++ bdrv_co_unref(data_bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/block/qed.c b/block/qed.c +index 0705a7b4e2..aff2a2076e 100644 +--- a/block/qed.c ++++ b/block/qed.c +@@ -748,8 +748,8 @@ static int coroutine_fn bdrv_qed_co_create(BlockdevCreateOptions *opts, + ret = 0; /* success */ + out: + g_free(l1_table); +- blk_unref(blk); +- bdrv_unref(bs); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs); + return ret; + } + +@@ -819,7 +819,7 @@ bdrv_qed_co_create_opts(BlockDriver *drv, const char *filename, + + fail: + qobject_unref(qdict); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/block/vdi.c b/block/vdi.c +index f2434d6153..08331d2dd7 100644 +--- a/block/vdi.c ++++ b/block/vdi.c +@@ -886,8 +886,8 @@ static int coroutine_fn vdi_co_do_create(BlockdevCreateOptions *create_options, + + ret = 0; + exit: +- blk_unref(blk); +- bdrv_unref(bs_file); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs_file); + g_free(bmap); + return ret; + } +@@ -975,7 +975,7 @@ vdi_co_create_opts(BlockDriver *drv, const char *filename, + done: + qobject_unref(qdict); + qapi_free_BlockdevCreateOptions(create_options); +- bdrv_unref(bs_file); ++ bdrv_co_unref(bs_file); + return ret; + } + +diff --git a/block/vhdx.c b/block/vhdx.c +index 81420722a1..00777da91a 100644 +--- a/block/vhdx.c ++++ b/block/vhdx.c +@@ -2053,8 +2053,8 @@ static int coroutine_fn vhdx_co_create(BlockdevCreateOptions *opts, + + ret = 0; + delete_and_exit: +- blk_unref(blk); +- bdrv_unref(bs); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs); + g_free(creator); + return ret; + } +@@ -2144,7 +2144,7 @@ vhdx_co_create_opts(BlockDriver *drv, const char *filename, + + fail: + qobject_unref(qdict); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/block/vmdk.c b/block/vmdk.c +index f5f49018fe..01ca13c82b 100644 +--- a/block/vmdk.c ++++ b/block/vmdk.c +@@ -2306,7 +2306,7 @@ exit: + if (pbb) { + *pbb = blk; + } else { +- blk_unref(blk); ++ blk_co_unref(blk); + blk = NULL; + } + } +@@ -2516,12 +2516,12 @@ vmdk_co_do_create(int64_t size, + if (strcmp(blk_bs(backing)->drv->format_name, "vmdk")) { + error_setg(errp, "Invalid backing file format: %s. Must be vmdk", + blk_bs(backing)->drv->format_name); +- blk_unref(backing); ++ blk_co_unref(backing); + ret = -EINVAL; + goto exit; + } + ret = vmdk_read_cid(blk_bs(backing), 0, &parent_cid); +- blk_unref(backing); ++ blk_co_unref(backing); + if (ret) { + error_setg(errp, "Failed to read parent CID"); + goto exit; +@@ -2542,14 +2542,14 @@ vmdk_co_do_create(int64_t size, + blk_bs(extent_blk)->filename); + created_size += cur_size; + extent_idx++; +- blk_unref(extent_blk); ++ blk_co_unref(extent_blk); + } + + /* Check whether we got excess extents */ + extent_blk = extent_fn(-1, extent_idx, flat, split, compress, zeroed_grain, + opaque, NULL); + if (extent_blk) { +- blk_unref(extent_blk); ++ blk_co_unref(extent_blk); + error_setg(errp, "List of extents contains unused extents"); + ret = -EINVAL; + goto exit; +@@ -2590,7 +2590,7 @@ vmdk_co_do_create(int64_t size, + ret = 0; + exit: + if (blk) { +- blk_unref(blk); ++ blk_co_unref(blk); + } + g_free(desc); + g_free(parent_desc_line); +@@ -2641,7 +2641,7 @@ vmdk_co_create_opts_cb(int64_t size, int idx, bool flat, bool split, + errp)) { + goto exit; + } +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + exit: + g_free(ext_filename); + return blk; +@@ -2797,12 +2797,12 @@ static BlockBackend * coroutine_fn vmdk_co_create_cb(int64_t size, int idx, + return NULL; + } + blk_set_allow_write_beyond_eof(blk, true); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + + if (size != -1) { + ret = vmdk_init_extent(blk, size, flat, compress, zeroed_grain, errp); + if (ret) { +- blk_unref(blk); ++ blk_co_unref(blk); + blk = NULL; + } + } +diff --git a/block/vpc.c b/block/vpc.c +index b89b0ff8e2..07ddda5b99 100644 +--- a/block/vpc.c ++++ b/block/vpc.c +@@ -1082,8 +1082,8 @@ static int coroutine_fn vpc_co_create(BlockdevCreateOptions *opts, + } + + out: +- blk_unref(blk); +- bdrv_unref(bs); ++ blk_co_unref(blk); ++ bdrv_co_unref(bs); + return ret; + } + +@@ -1162,7 +1162,7 @@ vpc_co_create_opts(BlockDriver *drv, const char *filename, + + fail: + qobject_unref(qdict); +- bdrv_unref(bs); ++ bdrv_co_unref(bs); + qapi_free_BlockdevCreateOptions(create_options); + return ret; + } +diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h +index 399200a9a3..cd4ea554bf 100644 +--- a/include/block/block-global-state.h ++++ b/include/block/block-global-state.h +@@ -214,7 +214,8 @@ void bdrv_img_create(const char *filename, const char *fmt, + bool quiet, Error **errp); + + void bdrv_ref(BlockDriverState *bs); +-void bdrv_unref(BlockDriverState *bs); ++void no_coroutine_fn bdrv_unref(BlockDriverState *bs); ++void coroutine_fn no_co_wrapper bdrv_co_unref(BlockDriverState *bs); + void bdrv_unref_child(BlockDriverState *parent, BdrvChild *child); + BdrvChild *bdrv_attach_child(BlockDriverState *parent_bs, + BlockDriverState *child_bs, +diff --git a/include/sysemu/block-backend-global-state.h b/include/sysemu/block-backend-global-state.h +index 2b6d27db7c..fa83f9389c 100644 +--- a/include/sysemu/block-backend-global-state.h ++++ b/include/sysemu/block-backend-global-state.h +@@ -42,7 +42,10 @@ blk_co_new_open(const char *filename, const char *reference, QDict *options, + + int blk_get_refcnt(BlockBackend *blk); + void blk_ref(BlockBackend *blk); +-void blk_unref(BlockBackend *blk); ++ ++void no_coroutine_fn blk_unref(BlockBackend *blk); ++void coroutine_fn no_co_wrapper blk_co_unref(BlockBackend *blk); ++ + void blk_remove_all_bs(void); + BlockBackend *blk_by_name(const char *name); + BlockBackend *blk_next(BlockBackend *blk); +-- +2.39.1 + diff --git a/kvm-block-blkio-use-qemu_open-to-support-fd-passing-for-.patch b/kvm-block-blkio-use-qemu_open-to-support-fd-passing-for-.patch new file mode 100644 index 0000000..3b32299 --- /dev/null +++ b/kvm-block-blkio-use-qemu_open-to-support-fd-passing-for-.patch @@ -0,0 +1,108 @@ +From fd57241cf0f8c2906fa56118f8da1e65a5b1e4d8 Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Tue, 30 May 2023 09:19:40 +0200 +Subject: [PATCH 3/5] block/blkio: use qemu_open() to support fd passing for + virtio-blk + +RH-Author: Stefano Garzarella +RH-MergeRequest: 169: block/blkio: support fd passing for virtio-blk-vhost-vdpa driver +RH-Bugzilla: 2180076 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [1/2] 9ff1a1510500db101648341207a36318a0c41c5a (sgarzarella/qemu-kvm-c-9-s) + +Some virtio-blk drivers (e.g. virtio-blk-vhost-vdpa) supports the fd +passing. Let's expose this to the user, so the management layer +can pass the file descriptor of an already opened path. + +If the libblkio virtio-blk driver supports fd passing, let's always +use qemu_open() to open the `path`, so we can handle fd passing +from the management layer through the "/dev/fdset/N" special path. + +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Stefano Garzarella +Message-id: 20230530071941.8954-2-sgarzare@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit cad2ccc395c7113fb30bc9390774b67b34f06c68) +Signed-off-by: Stefano Garzarella +--- + block/blkio.c | 53 ++++++++++++++++++++++++++++++++++++++++++--------- + 1 file changed, 44 insertions(+), 9 deletions(-) + +diff --git a/block/blkio.c b/block/blkio.c +index 0cdc99a729..6a6f20f923 100644 +--- a/block/blkio.c ++++ b/block/blkio.c +@@ -672,25 +672,60 @@ static int blkio_virtio_blk_common_open(BlockDriverState *bs, + { + const char *path = qdict_get_try_str(options, "path"); + BDRVBlkioState *s = bs->opaque; +- int ret; ++ bool fd_supported = false; ++ int fd, ret; + + if (!path) { + error_setg(errp, "missing 'path' option"); + return -EINVAL; + } + +- ret = blkio_set_str(s->blkio, "path", path); +- qdict_del(options, "path"); +- if (ret < 0) { +- error_setg_errno(errp, -ret, "failed to set path: %s", +- blkio_get_error_msg()); +- return ret; +- } +- + if (!(flags & BDRV_O_NOCACHE)) { + error_setg(errp, "cache.direct=off is not supported"); + return -EINVAL; + } ++ ++ if (blkio_get_int(s->blkio, "fd", &fd) == 0) { ++ fd_supported = true; ++ } ++ ++ /* ++ * If the libblkio driver supports fd passing, let's always use qemu_open() ++ * to open the `path`, so we can handle fd passing from the management ++ * layer through the "/dev/fdset/N" special path. ++ */ ++ if (fd_supported) { ++ int open_flags; ++ ++ if (flags & BDRV_O_RDWR) { ++ open_flags = O_RDWR; ++ } else { ++ open_flags = O_RDONLY; ++ } ++ ++ fd = qemu_open(path, open_flags, errp); ++ if (fd < 0) { ++ return -EINVAL; ++ } ++ ++ ret = blkio_set_int(s->blkio, "fd", fd); ++ if (ret < 0) { ++ error_setg_errno(errp, -ret, "failed to set fd: %s", ++ blkio_get_error_msg()); ++ qemu_close(fd); ++ return ret; ++ } ++ } else { ++ ret = blkio_set_str(s->blkio, "path", path); ++ if (ret < 0) { ++ error_setg_errno(errp, -ret, "failed to set path: %s", ++ blkio_get_error_msg()); ++ return ret; ++ } ++ } ++ ++ qdict_del(options, "path"); ++ + return 0; + } + +-- +2.39.3 + diff --git a/kvm-block-compile-out-assert_bdrv_graph_readable-by-defa.patch b/kvm-block-compile-out-assert_bdrv_graph_readable-by-defa.patch new file mode 100644 index 0000000..b6eebf3 --- /dev/null +++ b/kvm-block-compile-out-assert_bdrv_graph_readable-by-defa.patch @@ -0,0 +1,121 @@ +From d9190117f3c701380701d6e9b2aa3c2446b9708f Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Mon, 1 May 2023 13:34:43 -0400 +Subject: [PATCH 01/21] block: compile out assert_bdrv_graph_readable() by + default + +RH-Author: Kevin Wolf +RH-MergeRequest: 166: block/graph-lock: Disable locking for now +RH-Bugzilla: 2186725 +RH-Acked-by: Eric Blake +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [1/4] d8cb4bb832c85e8216d97e57679a34c7bc6a8f71 (kmwolf/centos-qemu-kvm) + +reader_count() is a performance bottleneck because the global +aio_context_list_lock mutex causes thread contention. Put this debugging +assertion behind a new ./configure --enable-debug-graph-lock option and +disable it by default. + +The --enable-debug-graph-lock option is also enabled by the more general +--enable-debug option. + +Signed-off-by: Stefan Hajnoczi +Message-Id: <20230501173443.153062-1-stefanha@redhat.com> +Reviewed-by: Kevin Wolf +Signed-off-by: Kevin Wolf +(cherry picked from commit 58a2e3f5c37be02dac3086b81bdda9414b931edf) +Signed-off-by: Kevin Wolf +--- + block/graph-lock.c | 3 +++ + configure | 1 + + meson.build | 2 ++ + meson_options.txt | 2 ++ + scripts/meson-buildoptions.sh | 4 ++++ + 5 files changed, 12 insertions(+) + +diff --git a/block/graph-lock.c b/block/graph-lock.c +index 454c31e691..259a7a0bde 100644 +--- a/block/graph-lock.c ++++ b/block/graph-lock.c +@@ -265,7 +265,10 @@ void bdrv_graph_rdunlock_main_loop(void) + + void assert_bdrv_graph_readable(void) + { ++ /* reader_count() is slow due to aio_context_list_lock lock contention */ ++#ifdef CONFIG_DEBUG_GRAPH_LOCK + assert(qemu_in_main_thread() || reader_count()); ++#endif + } + + void assert_bdrv_graph_writable(void) +diff --git a/configure b/configure +index 800b5850f4..a62a3e6be9 100755 +--- a/configure ++++ b/configure +@@ -806,6 +806,7 @@ for opt do + --enable-debug) + # Enable debugging options that aren't excessively noisy + debug_tcg="yes" ++ meson_option_parse --enable-debug-graph-lock "" + meson_option_parse --enable-debug-mutex "" + meson_option_add -Doptimization=0 + fortify_source="no" +diff --git a/meson.build b/meson.build +index c44d05a13f..d964e741e7 100644 +--- a/meson.build ++++ b/meson.build +@@ -1956,6 +1956,7 @@ if get_option('debug_stack_usage') and have_coroutine_pool + have_coroutine_pool = false + endif + config_host_data.set10('CONFIG_COROUTINE_POOL', have_coroutine_pool) ++config_host_data.set('CONFIG_DEBUG_GRAPH_LOCK', get_option('debug_graph_lock')) + config_host_data.set('CONFIG_DEBUG_MUTEX', get_option('debug_mutex')) + config_host_data.set('CONFIG_DEBUG_STACK_USAGE', get_option('debug_stack_usage')) + config_host_data.set('CONFIG_GPROF', get_option('gprof')) +@@ -3833,6 +3834,7 @@ summary_info += {'PIE': get_option('b_pie')} + summary_info += {'static build': config_host.has_key('CONFIG_STATIC')} + summary_info += {'malloc trim support': has_malloc_trim} + summary_info += {'membarrier': have_membarrier} ++summary_info += {'debug graph lock': get_option('debug_graph_lock')} + summary_info += {'debug stack usage': get_option('debug_stack_usage')} + summary_info += {'mutex debugging': get_option('debug_mutex')} + summary_info += {'memory allocator': get_option('malloc')} +diff --git a/meson_options.txt b/meson_options.txt +index fc9447d267..bc857fe68b 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -311,6 +311,8 @@ option('rng_none', type: 'boolean', value: false, + description: 'dummy RNG, avoid using /dev/(u)random and getrandom()') + option('coroutine_pool', type: 'boolean', value: true, + description: 'coroutine freelist (better performance)') ++option('debug_graph_lock', type: 'boolean', value: false, ++ description: 'graph lock debugging support') + option('debug_mutex', type: 'boolean', value: false, + description: 'mutex debugging support') + option('debug_stack_usage', type: 'boolean', value: false, +diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh +index 009fab1515..30e1f25259 100644 +--- a/scripts/meson-buildoptions.sh ++++ b/scripts/meson-buildoptions.sh +@@ -21,6 +21,8 @@ meson_options_help() { + printf "%s\n" ' QEMU' + printf "%s\n" ' --enable-cfi Control-Flow Integrity (CFI)' + printf "%s\n" ' --enable-cfi-debug Verbose errors in case of CFI violation' ++ printf "%s\n" ' --enable-debug-graph-lock' ++ printf "%s\n" ' graph lock debugging support' + printf "%s\n" ' --enable-debug-mutex mutex debugging support' + printf "%s\n" ' --enable-debug-stack-usage' + printf "%s\n" ' measure coroutine stack usage' +@@ -249,6 +251,8 @@ _meson_option_parse() { + --datadir=*) quote_sh "-Ddatadir=$2" ;; + --enable-dbus-display) printf "%s" -Ddbus_display=enabled ;; + --disable-dbus-display) printf "%s" -Ddbus_display=disabled ;; ++ --enable-debug-graph-lock) printf "%s" -Ddebug_graph_lock=true ;; ++ --disable-debug-graph-lock) printf "%s" -Ddebug_graph_lock=false ;; + --enable-debug-mutex) printf "%s" -Ddebug_mutex=true ;; + --disable-debug-mutex) printf "%s" -Ddebug_mutex=false ;; + --enable-debug-stack-usage) printf "%s" -Ddebug_stack_usage=true ;; +-- +2.39.3 + diff --git a/kvm-checkpatch-add-qemu_bh_new-aio_bh_new-checks.patch b/kvm-checkpatch-add-qemu_bh_new-aio_bh_new-checks.patch new file mode 100644 index 0000000..4173648 --- /dev/null +++ b/kvm-checkpatch-add-qemu_bh_new-aio_bh_new-checks.patch @@ -0,0 +1,55 @@ +From 961bc392ee60743344236ddd247ab646a0eec914 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 07/21] checkpatch: add qemu_bh_new/aio_bh_new checks + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [3/13] e0473487f0e3186c42559a5c36a8650f27ab26ae (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit ef56ffbdd6b0605dc1e305611287b948c970e236 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:08 2023 -0400 + + checkpatch: add qemu_bh_new/aio_bh_new checks + + Advise authors to use the _guarded versions of the APIs, instead. + + Signed-off-by: Alexander Bulekov + Reviewed-by: Darren Kenny + Message-Id: <20230427211013.2994127-4-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + scripts/checkpatch.pl | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl +index d768171dcf..eeaec436eb 100755 +--- a/scripts/checkpatch.pl ++++ b/scripts/checkpatch.pl +@@ -2865,6 +2865,14 @@ sub process { + if ($line =~ /\bsignal\s*\(/ && !($line =~ /SIG_(?:IGN|DFL)/)) { + ERROR("use sigaction to establish signal handlers; signal is not portable\n" . $herecurr); + } ++# recommend qemu_bh_new_guarded instead of qemu_bh_new ++ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\bqemu_bh_new\s*\(/) { ++ ERROR("use qemu_bh_new_guarded() instead of qemu_bh_new() to avoid reentrancy problems\n" . $herecurr); ++ } ++# recommend aio_bh_new_guarded instead of aio_bh_new ++ if ($realfile =~ /.*\/hw\/.*/ && $line =~ /\baio_bh_new\s*\(/) { ++ ERROR("use aio_bh_new_guarded() instead of aio_bh_new() to avoid reentrancy problems\n" . $herecurr); ++ } + # check for module_init(), use category-specific init macros explicitly please + if ($line =~ /^module_init\s*\(/) { + ERROR("please use block_init(), type_init() etc. instead of module_init()\n" . $herecurr); +-- +2.39.3 + diff --git a/kvm-graph-lock-Disable-locking-for-now.patch b/kvm-graph-lock-Disable-locking-for-now.patch new file mode 100644 index 0000000..77086e5 --- /dev/null +++ b/kvm-graph-lock-Disable-locking-for-now.patch @@ -0,0 +1,153 @@ +From 516bf44de08a13d97c08e210137078e642ce8e88 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 17 May 2023 17:28:32 +0200 +Subject: [PATCH 02/21] graph-lock: Disable locking for now + +RH-Author: Kevin Wolf +RH-MergeRequest: 166: block/graph-lock: Disable locking for now +RH-Bugzilla: 2186725 +RH-Acked-by: Eric Blake +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [2/4] 39d42fb527aad0491a018743289de7b762108317 (kmwolf/centos-qemu-kvm) + +In QEMU 8.0, we've been seeing deadlocks in bdrv_graph_wrlock(). They +come from callers that hold an AioContext lock, which is not allowed +during polling. In theory, we could temporarily release the lock, but +callers are inconsistent about whether they hold a lock, and if they do, +some are also confused about which one they hold. While all of this is +fixable, it's not trivial, and the best course of action for 8.0.1 is +probably just disabling the graph locking code temporarily. + +We don't currently rely on graph locking yet. It is supposed to replace +the AioContext lock eventually to enable multiqueue support, but as long +as we still have the AioContext lock, it is sufficient without the graph +lock. Once the AioContext lock goes away, the deadlock doesn't exist any +more either and this commit can be reverted. (Of course, it can also be +reverted while the AioContext lock still exists if the callers have been +fixed.) + +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Message-Id: <20230517152834.277483-2-kwolf@redhat.com> +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit 80fc5d260002432628710f8b0c7cfc7d9b97bb9d) +Signed-off-by: Kevin Wolf +--- + block/graph-lock.c | 24 ++++++++++++++++++++++++ + 1 file changed, 24 insertions(+) + +diff --git a/block/graph-lock.c b/block/graph-lock.c +index 259a7a0bde..2490926c90 100644 +--- a/block/graph-lock.c ++++ b/block/graph-lock.c +@@ -30,8 +30,10 @@ BdrvGraphLock graph_lock; + /* Protects the list of aiocontext and orphaned_reader_count */ + static QemuMutex aio_context_list_lock; + ++#if 0 + /* Written and read with atomic operations. */ + static int has_writer; ++#endif + + /* + * A reader coroutine could move from an AioContext to another. +@@ -88,6 +90,7 @@ void unregister_aiocontext(AioContext *ctx) + g_free(ctx->bdrv_graph); + } + ++#if 0 + static uint32_t reader_count(void) + { + BdrvGraphRWlock *brdv_graph; +@@ -105,10 +108,17 @@ static uint32_t reader_count(void) + assert((int32_t)rd >= 0); + return rd; + } ++#endif + + void bdrv_graph_wrlock(void) + { + GLOBAL_STATE_CODE(); ++ /* ++ * TODO Some callers hold an AioContext lock when this is called, which ++ * causes deadlocks. Reenable once the AioContext locking is cleaned up (or ++ * AioContext locks are gone). ++ */ ++#if 0 + assert(!qatomic_read(&has_writer)); + + /* Make sure that constantly arriving new I/O doesn't cause starvation */ +@@ -139,11 +149,13 @@ void bdrv_graph_wrlock(void) + } while (reader_count() >= 1); + + bdrv_drain_all_end(); ++#endif + } + + void bdrv_graph_wrunlock(void) + { + GLOBAL_STATE_CODE(); ++#if 0 + QEMU_LOCK_GUARD(&aio_context_list_lock); + assert(qatomic_read(&has_writer)); + +@@ -155,10 +167,13 @@ void bdrv_graph_wrunlock(void) + + /* Wake up all coroutine that are waiting to read the graph */ + qemu_co_enter_all(&reader_queue, &aio_context_list_lock); ++#endif + } + + void coroutine_fn bdrv_graph_co_rdlock(void) + { ++ /* TODO Reenable when wrlock is reenabled */ ++#if 0 + BdrvGraphRWlock *bdrv_graph; + bdrv_graph = qemu_get_current_aio_context()->bdrv_graph; + +@@ -223,10 +238,12 @@ void coroutine_fn bdrv_graph_co_rdlock(void) + qemu_co_queue_wait(&reader_queue, &aio_context_list_lock); + } + } ++#endif + } + + void coroutine_fn bdrv_graph_co_rdunlock(void) + { ++#if 0 + BdrvGraphRWlock *bdrv_graph; + bdrv_graph = qemu_get_current_aio_context()->bdrv_graph; + +@@ -249,6 +266,7 @@ void coroutine_fn bdrv_graph_co_rdunlock(void) + if (qatomic_read(&has_writer)) { + aio_wait_kick(); + } ++#endif + } + + void bdrv_graph_rdlock_main_loop(void) +@@ -266,13 +284,19 @@ void bdrv_graph_rdunlock_main_loop(void) + void assert_bdrv_graph_readable(void) + { + /* reader_count() is slow due to aio_context_list_lock lock contention */ ++ /* TODO Reenable when wrlock is reenabled */ ++#if 0 + #ifdef CONFIG_DEBUG_GRAPH_LOCK + assert(qemu_in_main_thread() || reader_count()); + #endif ++#endif + } + + void assert_bdrv_graph_writable(void) + { + assert(qemu_in_main_thread()); ++ /* TODO Reenable when wrlock is reenabled */ ++#if 0 + assert(qatomic_read(&has_writer)); ++#endif + } +-- +2.39.3 + diff --git a/kvm-hw-acpi-Mark-acpi-blobs-as-resizable-on-RHEL-pc-mach.patch b/kvm-hw-acpi-Mark-acpi-blobs-as-resizable-on-RHEL-pc-mach.patch new file mode 100644 index 0000000..67e702c --- /dev/null +++ b/kvm-hw-acpi-Mark-acpi-blobs-as-resizable-on-RHEL-pc-mach.patch @@ -0,0 +1,40 @@ +From b4645e7682aa1bde6f89df0eff2a9de83720eecc Mon Sep 17 00:00:00 2001 +From: Ani Sinha +Date: Tue, 2 May 2023 15:51:53 +0530 +Subject: [PATCH 3/3] hw/acpi: Mark acpi blobs as resizable on RHEL pc machines + version 7.6 and above + +RH-Author: Ani Sinha +RH-MergeRequest: 160: hw/acpi: limit warning on acpi table size to pc machines older than version 2.3 +RH-Bugzilla: 1934134 +RH-Acked-by: Igor Mammedov +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: MST +RH-Commit: [2/2] 95d443af6e75c569d89d04d028012c3c56c0c3a4 (anisinha/centos-qemu-kvm) + +Please look at QEMU upstream commit +1af507756bae7 ("hw/acpi: limit warning on acpi table size to pc machines older than version 2.3") +This patch adapts the above change so that it applies to RHEL pc machines of +version 7.6 and newer. These are the machine types that are currently supported +in RHEL. Q35 machines are not affected. + +Signed-off-by: Ani Sinha +--- + hw/i386/pc_piix.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 4d5880e249..6c7be628e1 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -914,6 +914,7 @@ static void pc_machine_rhel7_options(MachineClass *m) + m->default_machine_opts = "firmware=bios-256k.bin,hpet=off"; + pcmc->default_nic_model = "e1000"; + pcmc->pci_root_uid = 0; ++ pcmc->resizable_acpi_blob = true; + m->default_display = "std"; + m->no_parallel = 1; + m->numa_mem_supported = true; +-- +2.39.1 + diff --git a/kvm-hw-acpi-limit-warning-on-acpi-table-size-to-pc-machi.patch b/kvm-hw-acpi-limit-warning-on-acpi-table-size-to-pc-machi.patch new file mode 100644 index 0000000..e06113a --- /dev/null +++ b/kvm-hw-acpi-limit-warning-on-acpi-table-size-to-pc-machi.patch @@ -0,0 +1,101 @@ +From 3f70da88788c398877b8ded0b27689530385302b Mon Sep 17 00:00:00 2001 +From: Ani Sinha +Date: Wed, 29 Mar 2023 10:27:26 +0530 +Subject: [PATCH 2/3] hw/acpi: limit warning on acpi table size to pc machines + older than version 2.3 + +RH-Author: Ani Sinha +RH-MergeRequest: 160: hw/acpi: limit warning on acpi table size to pc machines older than version 2.3 +RH-Bugzilla: 1934134 +RH-Acked-by: Igor Mammedov +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: MST +RH-Commit: [1/2] 96c3b6d51e16734eb4e8de52635e0ca036964090 (anisinha/centos-qemu-kvm) + +i440fx machine versions 2.3 and newer supports dynamic ram +resizing. See commit a1666142db6233 ("acpi-build: make ROMs RAM blocks resizeable") . +Currently supported all q35 machine types (versions 2.4 and newer) supports +resizable RAM/ROM blocks.Therefore the warning generated when the ACPI table +size exceeds a pre-defined value does not apply to those machine versions. +Add a check limiting the warning message to only those machines that does not +support expandable ram blocks (that is, i440fx machines with version 2.2 +and older). + +Signed-off-by: Ani Sinha +Message-Id: <20230329045726.14028-1-anisinha@redhat.com> +Reviewed-by: Igor Mammedov +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 1af507756bae775028c27d30e602e2b9c72cd074) +--- + hw/i386/acpi-build.c | 6 ++++-- + hw/i386/pc.c | 1 + + hw/i386/pc_piix.c | 1 + + include/hw/i386/pc.h | 3 +++ + 4 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index ec857a117e..9bc4d8a981 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -2695,7 +2695,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) + int legacy_table_size = + ROUND_UP(tables_blob->len - aml_len + legacy_aml_len, + ACPI_BUILD_ALIGN_SIZE); +- if (tables_blob->len > legacy_table_size) { ++ if ((tables_blob->len > legacy_table_size) && ++ !pcmc->resizable_acpi_blob) { + /* Should happen only with PCI bridges and -M pc-i440fx-2.0. */ + warn_report("ACPI table size %u exceeds %d bytes," + " migration may not work", +@@ -2706,7 +2707,8 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) + g_array_set_size(tables_blob, legacy_table_size); + } else { + /* Make sure we have a buffer in case we need to resize the tables. */ +- if (tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) { ++ if ((tables_blob->len > ACPI_BUILD_TABLE_SIZE / 2) && ++ !pcmc->resizable_acpi_blob) { + /* As of QEMU 2.1, this fires with 160 VCPUs and 255 memory slots. */ + warn_report("ACPI table size %u exceeds %d bytes," + " migration may not work", +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index f216922cee..7db5a2348f 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -2092,6 +2092,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + pcmc->acpi_data_size = 0x20000 + 0x8000; + pcmc->pvh_enabled = true; + pcmc->kvmclock_create_always = true; ++ pcmc->resizable_acpi_blob = true; + assert(!mc->get_hotplug_handler); + mc->async_pf_vmexit_disable = false; + mc->get_hotplug_handler = pc_get_hotplug_handler; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index fc704d783f..4d5880e249 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -750,6 +750,7 @@ static void pc_i440fx_2_2_machine_options(MachineClass *m) + compat_props_add(m->compat_props, hw_compat_2_2, hw_compat_2_2_len); + compat_props_add(m->compat_props, pc_compat_2_2, pc_compat_2_2_len); + pcmc->rsdp_in_ram = false; ++ pcmc->resizable_acpi_blob = false; + } + + DEFINE_I440FX_MACHINE(v2_2, "pc-i440fx-2.2", pc_compat_2_2_fn, +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index d218ad1628..2f514d13d8 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -130,6 +130,9 @@ struct PCMachineClass { + + /* create kvmclock device even when KVM PV features are not exposed */ + bool kvmclock_create_always; ++ ++ /* resizable acpi blob compat */ ++ bool resizable_acpi_blob; + }; + + #define TYPE_PC_MACHINE "generic-pc-machine" +-- +2.39.1 + diff --git a/kvm-hw-arm-Validate-cluster-and-NUMA-node-boundary.patch b/kvm-hw-arm-Validate-cluster-and-NUMA-node-boundary.patch new file mode 100644 index 0000000..e96bb10 --- /dev/null +++ b/kvm-hw-arm-Validate-cluster-and-NUMA-node-boundary.patch @@ -0,0 +1,60 @@ +From 7b57aec372fc238cbaafe86557f9fb4b560895b1 Mon Sep 17 00:00:00 2001 +From: Gavin Shan +Date: Tue, 27 Jun 2023 20:20:09 +1000 +Subject: [PATCH 2/6] hw/arm: Validate cluster and NUMA node boundary + +RH-Author: Gavin Shan +RH-MergeRequest: 175: hw/arm: Validate CPU cluster and NUMA node boundary for RHEL machines +RH-Bugzilla: 2171363 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [2/3] fcac7ea85d9f73613989903c642fc1bf6c51946b + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2171363 + +There are two ARM machines where NUMA is aware: 'virt' and 'sbsa-ref'. +Both of them are required to follow cluster-NUMA-node boundary. To +enable the validation to warn about the irregular configuration where +multiple CPUs in one cluster have been associated with different NUMA +nodes. + +Signed-off-by: Gavin Shan +Acked-by: Igor Mammedov +Message-Id: <20230509002739.18388-3-gshan@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit fecff672351ace5e39adf7dbcf7a8ee748b201cb) +Signed-off-by: Gavin Shan +--- + hw/arm/sbsa-ref.c | 2 ++ + hw/arm/virt.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/hw/arm/sbsa-ref.c b/hw/arm/sbsa-ref.c +index 0b93558dde..efb380e7c8 100644 +--- a/hw/arm/sbsa-ref.c ++++ b/hw/arm/sbsa-ref.c +@@ -864,6 +864,8 @@ static void sbsa_ref_class_init(ObjectClass *oc, void *data) + mc->possible_cpu_arch_ids = sbsa_ref_possible_cpu_arch_ids; + mc->cpu_index_to_instance_props = sbsa_ref_cpu_index_to_props; + mc->get_default_cpu_node_id = sbsa_ref_get_default_cpu_node_id; ++ /* platform instead of architectural choice */ ++ mc->cpu_cluster_has_numa_boundary = true; + } + + static const TypeInfo sbsa_ref_info = { +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 9be53e9355..df6a0231bc 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3083,6 +3083,8 @@ static void virt_machine_class_init(ObjectClass *oc, void *data) + mc->smp_props.clusters_supported = true; + mc->auto_enable_numa_with_memhp = true; + mc->auto_enable_numa_with_memdev = true; ++ /* platform instead of architectural choice */ ++ mc->cpu_cluster_has_numa_boundary = true; + mc->default_ram_id = "mach-virt.ram"; + + object_class_property_add(oc, "acpi", "OnOffAuto", +-- +2.39.3 + diff --git a/kvm-hw-arm-virt-Validate-cluster-and-NUMA-node-boundary-.patch b/kvm-hw-arm-virt-Validate-cluster-and-NUMA-node-boundary-.patch new file mode 100644 index 0000000..42ec705 --- /dev/null +++ b/kvm-hw-arm-virt-Validate-cluster-and-NUMA-node-boundary-.patch @@ -0,0 +1,41 @@ +From 022529f6d0ee306da857825c72a98bf7ddf5de22 Mon Sep 17 00:00:00 2001 +From: Gavin Shan +Date: Tue, 27 Jun 2023 20:20:09 +1000 +Subject: [PATCH 3/6] hw/arm/virt: Validate cluster and NUMA node boundary for + RHEL machines + +RH-Author: Gavin Shan +RH-MergeRequest: 175: hw/arm: Validate CPU cluster and NUMA node boundary for RHEL machines +RH-Bugzilla: 2171363 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [3/3] a396c499259b566861ca007b01f8539bf6113711 + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2171363 +Upstream Status: RHEL only + +Set mc->cpu_cluster_has_numa_boundary to true so that the boundary of +CPU cluster and NUMA node will be validated for 'virt-rhel*' machines. +A warning message will be printed if the boundary is broken. + +Signed-off-by: Gavin Shan +--- + hw/arm/virt.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index df6a0231bc..faf68488d5 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3530,6 +3530,8 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + mc->smp_props.clusters_supported = true; + mc->auto_enable_numa_with_memhp = true; + mc->auto_enable_numa_with_memdev = true; ++ /* platform instead of architectural choice */ ++ mc->cpu_cluster_has_numa_boundary = true; + mc->default_ram_id = "mach-virt.ram"; + + object_class_property_add(oc, "acpi", "OnOffAuto", +-- +2.39.3 + diff --git a/kvm-hw-pci-Disable-PCI_ERR_UNCOR_MASK-register-for-machi.patch b/kvm-hw-pci-Disable-PCI_ERR_UNCOR_MASK-register-for-machi.patch new file mode 100644 index 0000000..164bea7 --- /dev/null +++ b/kvm-hw-pci-Disable-PCI_ERR_UNCOR_MASK-register-for-machi.patch @@ -0,0 +1,118 @@ +From 3ac01bb90da12538898f95b2fb4e7f6bc1557eb3 Mon Sep 17 00:00:00 2001 +From: Leonardo Bras +Date: Tue, 2 May 2023 21:27:02 -0300 +Subject: [PATCH 18/21] hw/pci: Disable PCI_ERR_UNCOR_MASK register for machine + type < 8.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Leonardo Brás +RH-MergeRequest: 170: hw/pci: Disable PCI_ERR_UNCOR_MASK register for machine type < 8.0 +RH-Bugzilla: 2189423 +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] ad62dd5a8567f386770577513c00a0bf36bd3df1 (LeoBras/centos-qemu-kvm) + +Since it's implementation on v8.0.0-rc0, having the PCI_ERR_UNCOR_MASK +set for machine types < 8.0 will cause migration to fail if the target +QEMU version is < 8.0.0 : + +qemu-system-x86_64: get_pci_config_device: Bad config data: i=0x10a read: 40 device: 0 cmask: ff wmask: 0 w1cmask:0 +qemu-system-x86_64: Failed to load PCIDevice:config +qemu-system-x86_64: Failed to load e1000e:parent_obj +qemu-system-x86_64: error while loading state for instance 0x0 of device '0000:00:02.0/e1000e' +qemu-system-x86_64: load of migration failed: Invalid argument + +The above test migrated a 7.2 machine type from QEMU master to QEMU 7.2.0, +with this cmdline: + +./qemu-system-x86_64 -M pc-q35-7.2 [-incoming XXX] + +In order to fix this, property x-pcie-err-unc-mask was introduced to +control when PCI_ERR_UNCOR_MASK is enabled. This property is enabled by +default, but is disabled if machine type <= 7.2. + +Fixes: 010746ae1d ("hw/pci/aer: Implement PCI_ERR_UNCOR_MASK register") +Suggested-by: Michael S. Tsirkin +Signed-off-by: Leonardo Bras +Message-Id: <20230503002701.854329-1-leobras@redhat.com> +Reviewed-by: Jonathan Cameron +Reviewed-by: Peter Xu +Reviewed-by: Juan Quintela +Fixes: https://gitlab.com/qemu-project/qemu/-/issues/1576 +Tested-by: Fiona Ebner +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 5ed3dabe57dd9f4c007404345e5f5bf0e347317f) +Signed-off-by: Leonardo Bras +--- + hw/core/machine.c | 1 + + hw/pci/pci.c | 2 ++ + hw/pci/pcie_aer.c | 11 +++++++---- + include/hw/pci/pci.h | 2 ++ + 4 files changed, 12 insertions(+), 4 deletions(-) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 0e0120b7f2..c28702b690 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -43,6 +43,7 @@ GlobalProperty hw_compat_7_2[] = { + { "e1000e", "migrate-timadj", "off" }, + { "virtio-mem", "x-early-migration", "false" }, + { "migration", "x-preempt-pre-7-2", "true" }, ++ { TYPE_PCI_DEVICE, "x-pcie-err-unc-mask", "off" }, + }; + const size_t hw_compat_7_2_len = G_N_ELEMENTS(hw_compat_7_2); + +diff --git a/hw/pci/pci.c b/hw/pci/pci.c +index def5000e7b..8ad4349e96 100644 +--- a/hw/pci/pci.c ++++ b/hw/pci/pci.c +@@ -79,6 +79,8 @@ static Property pci_props[] = { + DEFINE_PROP_STRING("failover_pair_id", PCIDevice, + failover_pair_id), + DEFINE_PROP_UINT32("acpi-index", PCIDevice, acpi_index, 0), ++ DEFINE_PROP_BIT("x-pcie-err-unc-mask", PCIDevice, cap_present, ++ QEMU_PCIE_ERR_UNC_MASK_BITNR, true), + DEFINE_PROP_END_OF_LIST() + }; + +diff --git a/hw/pci/pcie_aer.c b/hw/pci/pcie_aer.c +index 103667c368..374d593ead 100644 +--- a/hw/pci/pcie_aer.c ++++ b/hw/pci/pcie_aer.c +@@ -112,10 +112,13 @@ int pcie_aer_init(PCIDevice *dev, uint8_t cap_ver, uint16_t offset, + + pci_set_long(dev->w1cmask + offset + PCI_ERR_UNCOR_STATUS, + PCI_ERR_UNC_SUPPORTED); +- pci_set_long(dev->config + offset + PCI_ERR_UNCOR_MASK, +- PCI_ERR_UNC_MASK_DEFAULT); +- pci_set_long(dev->wmask + offset + PCI_ERR_UNCOR_MASK, +- PCI_ERR_UNC_SUPPORTED); ++ ++ if (dev->cap_present & QEMU_PCIE_ERR_UNC_MASK) { ++ pci_set_long(dev->config + offset + PCI_ERR_UNCOR_MASK, ++ PCI_ERR_UNC_MASK_DEFAULT); ++ pci_set_long(dev->wmask + offset + PCI_ERR_UNCOR_MASK, ++ PCI_ERR_UNC_SUPPORTED); ++ } + + pci_set_long(dev->config + offset + PCI_ERR_UNCOR_SEVER, + PCI_ERR_UNC_SEVERITY_DEFAULT); +diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h +index d5a40cd058..6dc6742fc4 100644 +--- a/include/hw/pci/pci.h ++++ b/include/hw/pci/pci.h +@@ -207,6 +207,8 @@ enum { + QEMU_PCIE_EXTCAP_INIT = (1 << QEMU_PCIE_EXTCAP_INIT_BITNR), + #define QEMU_PCIE_CXL_BITNR 10 + QEMU_PCIE_CAP_CXL = (1 << QEMU_PCIE_CXL_BITNR), ++#define QEMU_PCIE_ERR_UNC_MASK_BITNR 11 ++ QEMU_PCIE_ERR_UNC_MASK = (1 << QEMU_PCIE_ERR_UNC_MASK_BITNR), + }; + + typedef struct PCIINTxRoute { +-- +2.39.3 + diff --git a/kvm-hw-replace-most-qemu_bh_new-calls-with-qemu_bh_new_g.patch b/kvm-hw-replace-most-qemu_bh_new-calls-with-qemu_bh_new_g.patch new file mode 100644 index 0000000..08ee94f --- /dev/null +++ b/kvm-hw-replace-most-qemu_bh_new-calls-with-qemu_bh_new_g.patch @@ -0,0 +1,470 @@ +From d1b7a9b25c0df9016cd8e93d40837314b1a81d70 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 08/21] hw: replace most qemu_bh_new calls with + qemu_bh_new_guarded + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [4/13] bcbc67dd0023aee2b3a342665237daa83b183c7b (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit f63192b0544af5d3e4d5edfd85ab520fcf671377 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:09 2023 -0400 + + hw: replace most qemu_bh_new calls with qemu_bh_new_guarded + + This protects devices from bh->mmio reentrancy issues. + + Thanks: Thomas Huth for diagnosing OS X test failure. + Signed-off-by: Alexander Bulekov + Reviewed-by: Darren Kenny + Reviewed-by: Stefan Hajnoczi + Reviewed-by: Michael S. Tsirkin + Reviewed-by: Paul Durrant + Reviewed-by: Thomas Huth + Message-Id: <20230427211013.2994127-5-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/9pfs/xen-9p-backend.c | 5 ++++- + hw/block/dataplane/virtio-blk.c | 3 ++- + hw/block/dataplane/xen-block.c | 5 +++-- + hw/char/virtio-serial-bus.c | 3 ++- + hw/display/qxl.c | 9 ++++++--- + hw/display/virtio-gpu.c | 6 ++++-- + hw/ide/ahci.c | 3 ++- + hw/ide/ahci_internal.h | 1 + + hw/ide/core.c | 4 +++- + hw/misc/imx_rngc.c | 6 ++++-- + hw/misc/macio/mac_dbdma.c | 2 +- + hw/net/virtio-net.c | 3 ++- + hw/nvme/ctrl.c | 6 ++++-- + hw/scsi/mptsas.c | 3 ++- + hw/scsi/scsi-bus.c | 3 ++- + hw/scsi/vmw_pvscsi.c | 3 ++- + hw/usb/dev-uas.c | 3 ++- + hw/usb/hcd-dwc2.c | 3 ++- + hw/usb/hcd-ehci.c | 3 ++- + hw/usb/hcd-uhci.c | 2 +- + hw/usb/host-libusb.c | 6 ++++-- + hw/usb/redirect.c | 6 ++++-- + hw/usb/xen-usb.c | 3 ++- + hw/virtio/virtio-balloon.c | 5 +++-- + hw/virtio/virtio-crypto.c | 3 ++- + 25 files changed, 66 insertions(+), 33 deletions(-) + +diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c +index 74f3a05f88..0e266c552b 100644 +--- a/hw/9pfs/xen-9p-backend.c ++++ b/hw/9pfs/xen-9p-backend.c +@@ -61,6 +61,7 @@ typedef struct Xen9pfsDev { + + int num_rings; + Xen9pfsRing *rings; ++ MemReentrancyGuard mem_reentrancy_guard; + } Xen9pfsDev; + + static void xen_9pfs_disconnect(struct XenLegacyDevice *xendev); +@@ -443,7 +444,9 @@ static int xen_9pfs_connect(struct XenLegacyDevice *xendev) + xen_9pdev->rings[i].ring.out = xen_9pdev->rings[i].data + + XEN_FLEX_RING_SIZE(ring_order); + +- xen_9pdev->rings[i].bh = qemu_bh_new(xen_9pfs_bh, &xen_9pdev->rings[i]); ++ xen_9pdev->rings[i].bh = qemu_bh_new_guarded(xen_9pfs_bh, ++ &xen_9pdev->rings[i], ++ &xen_9pdev->mem_reentrancy_guard); + xen_9pdev->rings[i].out_cons = 0; + xen_9pdev->rings[i].out_size = 0; + xen_9pdev->rings[i].inprogress = false; +diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c +index b28d81737e..a6202997ee 100644 +--- a/hw/block/dataplane/virtio-blk.c ++++ b/hw/block/dataplane/virtio-blk.c +@@ -127,7 +127,8 @@ bool virtio_blk_data_plane_create(VirtIODevice *vdev, VirtIOBlkConf *conf, + } else { + s->ctx = qemu_get_aio_context(); + } +- s->bh = aio_bh_new(s->ctx, notify_guest_bh, s); ++ s->bh = aio_bh_new_guarded(s->ctx, notify_guest_bh, s, ++ &DEVICE(vdev)->mem_reentrancy_guard); + s->batch_notify_vqs = bitmap_new(conf->num_queues); + + *dataplane = s; +diff --git a/hw/block/dataplane/xen-block.c b/hw/block/dataplane/xen-block.c +index 734da42ea7..d8bc39d359 100644 +--- a/hw/block/dataplane/xen-block.c ++++ b/hw/block/dataplane/xen-block.c +@@ -633,8 +633,9 @@ XenBlockDataPlane *xen_block_dataplane_create(XenDevice *xendev, + } else { + dataplane->ctx = qemu_get_aio_context(); + } +- dataplane->bh = aio_bh_new(dataplane->ctx, xen_block_dataplane_bh, +- dataplane); ++ dataplane->bh = aio_bh_new_guarded(dataplane->ctx, xen_block_dataplane_bh, ++ dataplane, ++ &DEVICE(xendev)->mem_reentrancy_guard); + + return dataplane; + } +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index 7d4601cb5d..dd619f0731 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -985,7 +985,8 @@ static void virtser_port_device_realize(DeviceState *dev, Error **errp) + return; + } + +- port->bh = qemu_bh_new(flush_queued_data_bh, port); ++ port->bh = qemu_bh_new_guarded(flush_queued_data_bh, port, ++ &dev->mem_reentrancy_guard); + port->elem = NULL; + } + +diff --git a/hw/display/qxl.c b/hw/display/qxl.c +index 80ce1e9a93..f1c0eb7dfc 100644 +--- a/hw/display/qxl.c ++++ b/hw/display/qxl.c +@@ -2201,11 +2201,14 @@ static void qxl_realize_common(PCIQXLDevice *qxl, Error **errp) + + qemu_add_vm_change_state_handler(qxl_vm_change_state_handler, qxl); + +- qxl->update_irq = qemu_bh_new(qxl_update_irq_bh, qxl); ++ qxl->update_irq = qemu_bh_new_guarded(qxl_update_irq_bh, qxl, ++ &DEVICE(qxl)->mem_reentrancy_guard); + qxl_reset_state(qxl); + +- qxl->update_area_bh = qemu_bh_new(qxl_render_update_area_bh, qxl); +- qxl->ssd.cursor_bh = qemu_bh_new(qemu_spice_cursor_refresh_bh, &qxl->ssd); ++ qxl->update_area_bh = qemu_bh_new_guarded(qxl_render_update_area_bh, qxl, ++ &DEVICE(qxl)->mem_reentrancy_guard); ++ qxl->ssd.cursor_bh = qemu_bh_new_guarded(qemu_spice_cursor_refresh_bh, &qxl->ssd, ++ &DEVICE(qxl)->mem_reentrancy_guard); + } + + static void qxl_realize_primary(PCIDevice *dev, Error **errp) +diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c +index 5e15c79b94..66ac9b6cc5 100644 +--- a/hw/display/virtio-gpu.c ++++ b/hw/display/virtio-gpu.c +@@ -1339,8 +1339,10 @@ void virtio_gpu_device_realize(DeviceState *qdev, Error **errp) + + g->ctrl_vq = virtio_get_queue(vdev, 0); + g->cursor_vq = virtio_get_queue(vdev, 1); +- g->ctrl_bh = qemu_bh_new(virtio_gpu_ctrl_bh, g); +- g->cursor_bh = qemu_bh_new(virtio_gpu_cursor_bh, g); ++ g->ctrl_bh = qemu_bh_new_guarded(virtio_gpu_ctrl_bh, g, ++ &qdev->mem_reentrancy_guard); ++ g->cursor_bh = qemu_bh_new_guarded(virtio_gpu_cursor_bh, g, ++ &qdev->mem_reentrancy_guard); + QTAILQ_INIT(&g->reslist); + QTAILQ_INIT(&g->cmdq); + QTAILQ_INIT(&g->fenceq); +diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c +index 55902e1df7..4e76d6b191 100644 +--- a/hw/ide/ahci.c ++++ b/hw/ide/ahci.c +@@ -1509,7 +1509,8 @@ static void ahci_cmd_done(const IDEDMA *dma) + ahci_write_fis_d2h(ad); + + if (ad->port_regs.cmd_issue && !ad->check_bh) { +- ad->check_bh = qemu_bh_new(ahci_check_cmd_bh, ad); ++ ad->check_bh = qemu_bh_new_guarded(ahci_check_cmd_bh, ad, ++ &ad->mem_reentrancy_guard); + qemu_bh_schedule(ad->check_bh); + } + } +diff --git a/hw/ide/ahci_internal.h b/hw/ide/ahci_internal.h +index 303fcd7235..2480455372 100644 +--- a/hw/ide/ahci_internal.h ++++ b/hw/ide/ahci_internal.h +@@ -321,6 +321,7 @@ struct AHCIDevice { + bool init_d2h_sent; + AHCICmdHdr *cur_cmd; + NCQTransferState ncq_tfs[AHCI_MAX_CMDS]; ++ MemReentrancyGuard mem_reentrancy_guard; + }; + + struct AHCIPCIState { +diff --git a/hw/ide/core.c b/hw/ide/core.c +index 45d14a25e9..de48ff9f86 100644 +--- a/hw/ide/core.c ++++ b/hw/ide/core.c +@@ -513,6 +513,7 @@ BlockAIOCB *ide_issue_trim( + BlockCompletionFunc *cb, void *cb_opaque, void *opaque) + { + IDEState *s = opaque; ++ IDEDevice *dev = s->unit ? s->bus->slave : s->bus->master; + TrimAIOCB *iocb; + + /* Paired with a decrement in ide_trim_bh_cb() */ +@@ -520,7 +521,8 @@ BlockAIOCB *ide_issue_trim( + + iocb = blk_aio_get(&trim_aiocb_info, s->blk, cb, cb_opaque); + iocb->s = s; +- iocb->bh = qemu_bh_new(ide_trim_bh_cb, iocb); ++ iocb->bh = qemu_bh_new_guarded(ide_trim_bh_cb, iocb, ++ &DEVICE(dev)->mem_reentrancy_guard); + iocb->ret = 0; + iocb->qiov = qiov; + iocb->i = -1; +diff --git a/hw/misc/imx_rngc.c b/hw/misc/imx_rngc.c +index 632c03779c..082c6980ad 100644 +--- a/hw/misc/imx_rngc.c ++++ b/hw/misc/imx_rngc.c +@@ -228,8 +228,10 @@ static void imx_rngc_realize(DeviceState *dev, Error **errp) + sysbus_init_mmio(sbd, &s->iomem); + + sysbus_init_irq(sbd, &s->irq); +- s->self_test_bh = qemu_bh_new(imx_rngc_self_test, s); +- s->seed_bh = qemu_bh_new(imx_rngc_seed, s); ++ s->self_test_bh = qemu_bh_new_guarded(imx_rngc_self_test, s, ++ &dev->mem_reentrancy_guard); ++ s->seed_bh = qemu_bh_new_guarded(imx_rngc_seed, s, ++ &dev->mem_reentrancy_guard); + } + + static void imx_rngc_reset(DeviceState *dev) +diff --git a/hw/misc/macio/mac_dbdma.c b/hw/misc/macio/mac_dbdma.c +index 43bb1f56ba..80a789f32b 100644 +--- a/hw/misc/macio/mac_dbdma.c ++++ b/hw/misc/macio/mac_dbdma.c +@@ -914,7 +914,7 @@ static void mac_dbdma_realize(DeviceState *dev, Error **errp) + { + DBDMAState *s = MAC_DBDMA(dev); + +- s->bh = qemu_bh_new(DBDMA_run_bh, s); ++ s->bh = qemu_bh_new_guarded(DBDMA_run_bh, s, &dev->mem_reentrancy_guard); + } + + static void mac_dbdma_class_init(ObjectClass *oc, void *data) +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 53e1c32643..447f669921 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -2917,7 +2917,8 @@ static void virtio_net_add_queue(VirtIONet *n, int index) + n->vqs[index].tx_vq = + virtio_add_queue(vdev, n->net_conf.tx_queue_size, + virtio_net_handle_tx_bh); +- n->vqs[index].tx_bh = qemu_bh_new(virtio_net_tx_bh, &n->vqs[index]); ++ n->vqs[index].tx_bh = qemu_bh_new_guarded(virtio_net_tx_bh, &n->vqs[index], ++ &DEVICE(vdev)->mem_reentrancy_guard); + } + + n->vqs[index].tx_waiting = 0; +diff --git a/hw/nvme/ctrl.c b/hw/nvme/ctrl.c +index ac24eeb5ed..e5a468975e 100644 +--- a/hw/nvme/ctrl.c ++++ b/hw/nvme/ctrl.c +@@ -4607,7 +4607,8 @@ static void nvme_init_sq(NvmeSQueue *sq, NvmeCtrl *n, uint64_t dma_addr, + QTAILQ_INSERT_TAIL(&(sq->req_list), &sq->io_req[i], entry); + } + +- sq->bh = qemu_bh_new(nvme_process_sq, sq); ++ sq->bh = qemu_bh_new_guarded(nvme_process_sq, sq, ++ &DEVICE(sq->ctrl)->mem_reentrancy_guard); + + if (n->dbbuf_enabled) { + sq->db_addr = n->dbbuf_dbs + (sqid << 3); +@@ -5253,7 +5254,8 @@ static void nvme_init_cq(NvmeCQueue *cq, NvmeCtrl *n, uint64_t dma_addr, + } + } + n->cq[cqid] = cq; +- cq->bh = qemu_bh_new(nvme_post_cqes, cq); ++ cq->bh = qemu_bh_new_guarded(nvme_post_cqes, cq, ++ &DEVICE(cq->ctrl)->mem_reentrancy_guard); + } + + static uint16_t nvme_create_cq(NvmeCtrl *n, NvmeRequest *req) +diff --git a/hw/scsi/mptsas.c b/hw/scsi/mptsas.c +index c485da792c..3de288b454 100644 +--- a/hw/scsi/mptsas.c ++++ b/hw/scsi/mptsas.c +@@ -1322,7 +1322,8 @@ static void mptsas_scsi_realize(PCIDevice *dev, Error **errp) + } + s->max_devices = MPTSAS_NUM_PORTS; + +- s->request_bh = qemu_bh_new(mptsas_fetch_requests, s); ++ s->request_bh = qemu_bh_new_guarded(mptsas_fetch_requests, s, ++ &DEVICE(dev)->mem_reentrancy_guard); + + scsi_bus_init(&s->bus, sizeof(s->bus), &dev->qdev, &mptsas_scsi_info); + } +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index c97176110c..3c20b47ad0 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -193,7 +193,8 @@ static void scsi_dma_restart_cb(void *opaque, bool running, RunState state) + AioContext *ctx = blk_get_aio_context(s->conf.blk); + /* The reference is dropped in scsi_dma_restart_bh.*/ + object_ref(OBJECT(s)); +- s->bh = aio_bh_new(ctx, scsi_dma_restart_bh, s); ++ s->bh = aio_bh_new_guarded(ctx, scsi_dma_restart_bh, s, ++ &DEVICE(s)->mem_reentrancy_guard); + qemu_bh_schedule(s->bh); + } + } +diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c +index fa76696855..4de34536e9 100644 +--- a/hw/scsi/vmw_pvscsi.c ++++ b/hw/scsi/vmw_pvscsi.c +@@ -1184,7 +1184,8 @@ pvscsi_realizefn(PCIDevice *pci_dev, Error **errp) + pcie_endpoint_cap_init(pci_dev, PVSCSI_EXP_EP_OFFSET); + } + +- s->completion_worker = qemu_bh_new(pvscsi_process_completion_queue, s); ++ s->completion_worker = qemu_bh_new_guarded(pvscsi_process_completion_queue, s, ++ &DEVICE(pci_dev)->mem_reentrancy_guard); + + scsi_bus_init(&s->bus, sizeof(s->bus), DEVICE(pci_dev), &pvscsi_scsi_info); + /* override default SCSI bus hotplug-handler, with pvscsi's one */ +diff --git a/hw/usb/dev-uas.c b/hw/usb/dev-uas.c +index 88f99c05d5..f013ded91e 100644 +--- a/hw/usb/dev-uas.c ++++ b/hw/usb/dev-uas.c +@@ -937,7 +937,8 @@ static void usb_uas_realize(USBDevice *dev, Error **errp) + + QTAILQ_INIT(&uas->results); + QTAILQ_INIT(&uas->requests); +- uas->status_bh = qemu_bh_new(usb_uas_send_status_bh, uas); ++ uas->status_bh = qemu_bh_new_guarded(usb_uas_send_status_bh, uas, ++ &d->mem_reentrancy_guard); + + dev->flags |= (1 << USB_DEV_FLAG_IS_SCSI_STORAGE); + scsi_bus_init(&uas->bus, sizeof(uas->bus), DEVICE(dev), &usb_uas_scsi_info); +diff --git a/hw/usb/hcd-dwc2.c b/hw/usb/hcd-dwc2.c +index 8755e9cbb0..a0c4e782b2 100644 +--- a/hw/usb/hcd-dwc2.c ++++ b/hw/usb/hcd-dwc2.c +@@ -1364,7 +1364,8 @@ static void dwc2_realize(DeviceState *dev, Error **errp) + s->fi = USB_FRMINTVL - 1; + s->eof_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, dwc2_frame_boundary, s); + s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, dwc2_work_timer, s); +- s->async_bh = qemu_bh_new(dwc2_work_bh, s); ++ s->async_bh = qemu_bh_new_guarded(dwc2_work_bh, s, ++ &dev->mem_reentrancy_guard); + + sysbus_init_irq(sbd, &s->irq); + } +diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c +index d4da8dcb8d..c930c60921 100644 +--- a/hw/usb/hcd-ehci.c ++++ b/hw/usb/hcd-ehci.c +@@ -2533,7 +2533,8 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) + } + + s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_work_timer, s); +- s->async_bh = qemu_bh_new(ehci_work_bh, s); ++ s->async_bh = qemu_bh_new_guarded(ehci_work_bh, s, ++ &dev->mem_reentrancy_guard); + s->device = dev; + + s->vmstate = qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s); +diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c +index 8ac1175ad2..77baaa7a6b 100644 +--- a/hw/usb/hcd-uhci.c ++++ b/hw/usb/hcd-uhci.c +@@ -1190,7 +1190,7 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp) + USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL); + } + } +- s->bh = qemu_bh_new(uhci_bh, s); ++ s->bh = qemu_bh_new_guarded(uhci_bh, s, &DEVICE(dev)->mem_reentrancy_guard); + s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, uhci_frame_timer, s); + s->num_ports_vmstate = NB_PORTS; + QTAILQ_INIT(&s->queues); +diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c +index 176868d345..f500db85ab 100644 +--- a/hw/usb/host-libusb.c ++++ b/hw/usb/host-libusb.c +@@ -1141,7 +1141,8 @@ static void usb_host_nodev_bh(void *opaque) + static void usb_host_nodev(USBHostDevice *s) + { + if (!s->bh_nodev) { +- s->bh_nodev = qemu_bh_new(usb_host_nodev_bh, s); ++ s->bh_nodev = qemu_bh_new_guarded(usb_host_nodev_bh, s, ++ &DEVICE(s)->mem_reentrancy_guard); + } + qemu_bh_schedule(s->bh_nodev); + } +@@ -1739,7 +1740,8 @@ static int usb_host_post_load(void *opaque, int version_id) + USBHostDevice *dev = opaque; + + if (!dev->bh_postld) { +- dev->bh_postld = qemu_bh_new(usb_host_post_load_bh, dev); ++ dev->bh_postld = qemu_bh_new_guarded(usb_host_post_load_bh, dev, ++ &DEVICE(dev)->mem_reentrancy_guard); + } + qemu_bh_schedule(dev->bh_postld); + dev->bh_postld_pending = true; +diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c +index fd7df599bc..39fbaaab16 100644 +--- a/hw/usb/redirect.c ++++ b/hw/usb/redirect.c +@@ -1441,8 +1441,10 @@ static void usbredir_realize(USBDevice *udev, Error **errp) + } + } + +- dev->chardev_close_bh = qemu_bh_new(usbredir_chardev_close_bh, dev); +- dev->device_reject_bh = qemu_bh_new(usbredir_device_reject_bh, dev); ++ dev->chardev_close_bh = qemu_bh_new_guarded(usbredir_chardev_close_bh, dev, ++ &DEVICE(dev)->mem_reentrancy_guard); ++ dev->device_reject_bh = qemu_bh_new_guarded(usbredir_device_reject_bh, dev, ++ &DEVICE(dev)->mem_reentrancy_guard); + dev->attach_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, usbredir_do_attach, dev); + + packet_id_queue_init(&dev->cancelled, dev, "cancelled"); +diff --git a/hw/usb/xen-usb.c b/hw/usb/xen-usb.c +index 66cb3f7c24..38ee660a30 100644 +--- a/hw/usb/xen-usb.c ++++ b/hw/usb/xen-usb.c +@@ -1032,7 +1032,8 @@ static void usbback_alloc(struct XenLegacyDevice *xendev) + + QTAILQ_INIT(&usbif->req_free_q); + QSIMPLEQ_INIT(&usbif->hotplug_q); +- usbif->bh = qemu_bh_new(usbback_bh, usbif); ++ usbif->bh = qemu_bh_new_guarded(usbback_bh, usbif, ++ &DEVICE(xendev)->mem_reentrancy_guard); + } + + static int usbback_free(struct XenLegacyDevice *xendev) +diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c +index 43092aa634..5186e831dd 100644 +--- a/hw/virtio/virtio-balloon.c ++++ b/hw/virtio/virtio-balloon.c +@@ -909,8 +909,9 @@ static void virtio_balloon_device_realize(DeviceState *dev, Error **errp) + precopy_add_notifier(&s->free_page_hint_notify); + + object_ref(OBJECT(s->iothread)); +- s->free_page_bh = aio_bh_new(iothread_get_aio_context(s->iothread), +- virtio_ballloon_get_free_page_hints, s); ++ s->free_page_bh = aio_bh_new_guarded(iothread_get_aio_context(s->iothread), ++ virtio_ballloon_get_free_page_hints, s, ++ &dev->mem_reentrancy_guard); + } + + if (virtio_has_feature(s->host_features, VIRTIO_BALLOON_F_REPORTING)) { +diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c +index 802e1b9659..2fe804510f 100644 +--- a/hw/virtio/virtio-crypto.c ++++ b/hw/virtio/virtio-crypto.c +@@ -1074,7 +1074,8 @@ static void virtio_crypto_device_realize(DeviceState *dev, Error **errp) + vcrypto->vqs[i].dataq = + virtio_add_queue(vdev, 1024, virtio_crypto_handle_dataq_bh); + vcrypto->vqs[i].dataq_bh = +- qemu_bh_new(virtio_crypto_dataq_bh, &vcrypto->vqs[i]); ++ qemu_bh_new_guarded(virtio_crypto_dataq_bh, &vcrypto->vqs[i], ++ &dev->mem_reentrancy_guard); + vcrypto->vqs[i].vcrypto = vcrypto; + } + +-- +2.39.3 + diff --git a/kvm-hw-scsi-lsi53c895a-Fix-reentrancy-issues-in-the-LSI-.patch b/kvm-hw-scsi-lsi53c895a-Fix-reentrancy-issues-in-the-LSI-.patch new file mode 100644 index 0000000..efa966e --- /dev/null +++ b/kvm-hw-scsi-lsi53c895a-Fix-reentrancy-issues-in-the-LSI-.patch @@ -0,0 +1,141 @@ +From 8075a9e05699ef0c4e078017eefc20db3186328f Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Mon, 29 May 2023 14:21:08 -0400 +Subject: [PATCH 17/21] hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI + controller (CVE-2023-0330) + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [13/13] 0b6fa742075ef2db3a354ee672dccca3747051cc (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit b987718bbb1d0eabf95499b976212dd5f0120d75 +Author: Thomas Huth +Date: Mon May 22 11:10:11 2023 +0200 + + hw/scsi/lsi53c895a: Fix reentrancy issues in the LSI controller (CVE-2023-0330) + + We cannot use the generic reentrancy guard in the LSI code, so + we have to manually prevent endless reentrancy here. The problematic + lsi_execute_script() function has already a way to detect whether + too many instructions have been executed - we just have to slightly + change the logic here that it also takes into account if the function + has been called too often in a reentrant way. + + The code in fuzz-lsi53c895a-test.c has been taken from an earlier + patch by Mauro Matteo Cascella. + + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1563 + Message-Id: <20230522091011.1082574-1-thuth@redhat.com> + Reviewed-by: Stefan Hajnoczi + Reviewed-by: Alexander Bulekov + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/scsi/lsi53c895a.c | 23 +++++++++++++++------ + tests/qtest/fuzz-lsi53c895a-test.c | 33 ++++++++++++++++++++++++++++++ + 2 files changed, 50 insertions(+), 6 deletions(-) + +diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c +index 048436352b..f7d45b0b20 100644 +--- a/hw/scsi/lsi53c895a.c ++++ b/hw/scsi/lsi53c895a.c +@@ -1134,15 +1134,24 @@ static void lsi_execute_script(LSIState *s) + uint32_t addr, addr_high; + int opcode; + int insn_processed = 0; ++ static int reentrancy_level; ++ ++ reentrancy_level++; + + s->istat1 |= LSI_ISTAT1_SRUN; + again: +- if (++insn_processed > LSI_MAX_INSN) { +- /* Some windows drivers make the device spin waiting for a memory +- location to change. If we have been executed a lot of code then +- assume this is the case and force an unexpected device disconnect. +- This is apparently sufficient to beat the drivers into submission. +- */ ++ /* ++ * Some windows drivers make the device spin waiting for a memory location ++ * to change. If we have executed more than LSI_MAX_INSN instructions then ++ * assume this is the case and force an unexpected device disconnect. This ++ * is apparently sufficient to beat the drivers into submission. ++ * ++ * Another issue (CVE-2023-0330) can occur if the script is programmed to ++ * trigger itself again and again. Avoid this problem by stopping after ++ * being called multiple times in a reentrant way (8 is an arbitrary value ++ * which should be enough for all valid use cases). ++ */ ++ if (++insn_processed > LSI_MAX_INSN || reentrancy_level > 8) { + if (!(s->sien0 & LSI_SIST0_UDC)) { + qemu_log_mask(LOG_GUEST_ERROR, + "lsi_scsi: inf. loop with UDC masked"); +@@ -1596,6 +1605,8 @@ again: + } + } + trace_lsi_execute_script_stop(); ++ ++ reentrancy_level--; + } + + static uint8_t lsi_reg_readb(LSIState *s, int offset) +diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c +index 2012bd54b7..1b55928b9f 100644 +--- a/tests/qtest/fuzz-lsi53c895a-test.c ++++ b/tests/qtest/fuzz-lsi53c895a-test.c +@@ -8,6 +8,36 @@ + #include "qemu/osdep.h" + #include "libqtest.h" + ++/* ++ * This used to trigger a DMA reentrancy issue ++ * leading to memory corruption bugs like stack ++ * overflow or use-after-free ++ * https://gitlab.com/qemu-project/qemu/-/issues/1563 ++ */ ++static void test_lsi_dma_reentrancy(void) ++{ ++ QTestState *s; ++ ++ s = qtest_init("-M q35 -m 512M -nodefaults " ++ "-blockdev driver=null-co,node-name=null0 " ++ "-device lsi53c810 -device scsi-cd,drive=null0"); ++ ++ qtest_outl(s, 0xcf8, 0x80000804); /* PCI Command Register */ ++ qtest_outw(s, 0xcfc, 0x7); /* Enables accesses */ ++ qtest_outl(s, 0xcf8, 0x80000814); /* Memory Bar 1 */ ++ qtest_outl(s, 0xcfc, 0xff100000); /* Set MMIO Address*/ ++ qtest_outl(s, 0xcf8, 0x80000818); /* Memory Bar 2 */ ++ qtest_outl(s, 0xcfc, 0xff000000); /* Set RAM Address*/ ++ qtest_writel(s, 0xff000000, 0xc0000024); ++ qtest_writel(s, 0xff000114, 0x00000080); ++ qtest_writel(s, 0xff00012c, 0xff000000); ++ qtest_writel(s, 0xff000004, 0xff000114); ++ qtest_writel(s, 0xff000008, 0xff100014); ++ qtest_writel(s, 0xff10002f, 0x000000ff); ++ ++ qtest_quit(s); ++} ++ + /* + * This used to trigger a UAF in lsi_do_msgout() + * https://gitlab.com/qemu-project/qemu/-/issues/972 +@@ -124,5 +154,8 @@ int main(int argc, char **argv) + qtest_add_func("fuzz/lsi53c895a/lsi_do_msgout_cancel_req", + test_lsi_do_msgout_cancel_req); + ++ qtest_add_func("fuzz/lsi53c895a/lsi_dma_reentrancy", ++ test_lsi_dma_reentrancy); ++ + return g_test_run(); + } +-- +2.39.3 + diff --git a/kvm-iotests-Test-commit-with-iothreads-and-ongoing-I-O.patch b/kvm-iotests-Test-commit-with-iothreads-and-ongoing-I-O.patch new file mode 100644 index 0000000..1fc5697 --- /dev/null +++ b/kvm-iotests-Test-commit-with-iothreads-and-ongoing-I-O.patch @@ -0,0 +1,144 @@ +From 399bfc04fb8352af6d2f4c984e68c334d2043368 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 17 May 2023 17:28:34 +0200 +Subject: [PATCH 04/21] iotests: Test commit with iothreads and ongoing I/O + +RH-Author: Kevin Wolf +RH-MergeRequest: 166: block/graph-lock: Disable locking for now +RH-Bugzilla: 2186725 +RH-Acked-by: Eric Blake +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [4/4] 1e42fde5951ae12bddc4eea2320f066f7079878f (kmwolf/centos-qemu-kvm) + +This tests exercises graph locking, draining, and graph modifications +with AioContext switches a lot. Amongst others, it serves as a +regression test for bdrv_graph_wrlock() deadlocking because it is called +with a locked AioContext and for AioContext handling in the NBD server. + +Signed-off-by: Kevin Wolf +Message-Id: <20230517152834.277483-4-kwolf@redhat.com> +Tested-by: Eric Blake +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit 95fdd8db61848d31fde1d9b32da7f3f76babfa25) +Signed-off-by: Kevin Wolf +--- + tests/qemu-iotests/iotests.py | 4 ++ + .../qemu-iotests/tests/graph-changes-while-io | 56 +++++++++++++++++-- + .../tests/graph-changes-while-io.out | 4 +- + 3 files changed, 58 insertions(+), 6 deletions(-) + +diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py +index 3e82c634cf..7073579a7d 100644 +--- a/tests/qemu-iotests/iotests.py ++++ b/tests/qemu-iotests/iotests.py +@@ -462,6 +462,10 @@ def qmp(self, cmd: str, args: Optional[Dict[str, object]] = None) \ + assert self._qmp is not None + return self._qmp.cmd(cmd, args) + ++ def get_qmp(self) -> QEMUMonitorProtocol: ++ assert self._qmp is not None ++ return self._qmp ++ + def stop(self, kill_signal=15): + self._p.send_signal(kill_signal) + self._p.wait() +diff --git a/tests/qemu-iotests/tests/graph-changes-while-io b/tests/qemu-iotests/tests/graph-changes-while-io +index 7664f33689..750e7d4d38 100755 +--- a/tests/qemu-iotests/tests/graph-changes-while-io ++++ b/tests/qemu-iotests/tests/graph-changes-while-io +@@ -22,19 +22,19 @@ + import os + from threading import Thread + import iotests +-from iotests import imgfmt, qemu_img, qemu_img_create, QMPTestCase, \ +- QemuStorageDaemon ++from iotests import imgfmt, qemu_img, qemu_img_create, qemu_io, \ ++ QMPTestCase, QemuStorageDaemon + + + top = os.path.join(iotests.test_dir, 'top.img') + nbd_sock = os.path.join(iotests.sock_dir, 'nbd.sock') + + +-def do_qemu_img_bench() -> None: ++def do_qemu_img_bench(count: int = 2000000) -> None: + """ + Do some I/O requests on `nbd_sock`. + """ +- qemu_img('bench', '-f', 'raw', '-c', '2000000', ++ qemu_img('bench', '-f', 'raw', '-c', str(count), + f'nbd+unix:///node0?socket={nbd_sock}') + + +@@ -84,6 +84,54 @@ class TestGraphChangesWhileIO(QMPTestCase): + + bench_thr.join() + ++ def test_commit_while_io(self) -> None: ++ # Run qemu-img bench in the background ++ bench_thr = Thread(target=do_qemu_img_bench, args=(200000, )) ++ bench_thr.start() ++ ++ qemu_io('-c', 'write 0 64k', top) ++ qemu_io('-c', 'write 128k 64k', top) ++ ++ result = self.qsd.qmp('blockdev-add', { ++ 'driver': imgfmt, ++ 'node-name': 'overlay', ++ 'backing': None, ++ 'file': { ++ 'driver': 'file', ++ 'filename': top ++ } ++ }) ++ self.assert_qmp(result, 'return', {}) ++ ++ result = self.qsd.qmp('blockdev-snapshot', { ++ 'node': 'node0', ++ 'overlay': 'overlay', ++ }) ++ self.assert_qmp(result, 'return', {}) ++ ++ # While qemu-img bench is running, repeatedly commit overlay to node0 ++ while bench_thr.is_alive(): ++ result = self.qsd.qmp('block-commit', { ++ 'job-id': 'job0', ++ 'device': 'overlay', ++ }) ++ self.assert_qmp(result, 'return', {}) ++ ++ result = self.qsd.qmp('block-job-cancel', { ++ 'device': 'job0', ++ }) ++ self.assert_qmp(result, 'return', {}) ++ ++ cancelled = False ++ while not cancelled: ++ for event in self.qsd.get_qmp().get_events(wait=10.0): ++ if event['event'] != 'JOB_STATUS_CHANGE': ++ continue ++ if event['data']['status'] == 'null': ++ cancelled = True ++ ++ bench_thr.join() ++ + if __name__ == '__main__': + # Format must support raw backing files + iotests.main(supported_fmts=['qcow', 'qcow2', 'qed'], +diff --git a/tests/qemu-iotests/tests/graph-changes-while-io.out b/tests/qemu-iotests/tests/graph-changes-while-io.out +index ae1213e6f8..fbc63e62f8 100644 +--- a/tests/qemu-iotests/tests/graph-changes-while-io.out ++++ b/tests/qemu-iotests/tests/graph-changes-while-io.out +@@ -1,5 +1,5 @@ +-. ++.. + ---------------------------------------------------------------------- +-Ran 1 tests ++Ran 2 tests + + OK +-- +2.39.3 + diff --git a/kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch b/kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch new file mode 100644 index 0000000..4e91505 --- /dev/null +++ b/kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch @@ -0,0 +1,132 @@ +From 2c9e6892369ff99decd4030642b8dcf3875e9ebf Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Tue, 9 May 2023 15:41:33 +0200 +Subject: [PATCH 55/56] iotests: Test resizing image attached to an iothread + +RH-Author: Kevin Wolf +RH-MergeRequest: 164: block: Fix hangs in qmp_block_resize() +RH-Bugzilla: 2185688 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Hanna Czenczek +RH-Acked-by: Eric Blake +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [4/4] 8d31752d1e6e8c6a422d68d9cb2251fbc34b7aef (kmwolf/centos-qemu-kvm) + +This tests that trying to resize an image with QMP block_resize doesn't +hang or otherwise fail when the image is attached to a device running in +an iothread. + +This is a regression test for the recent fix that changed +qmp_block_resize, which is a coroutine based QMP handler, to avoid +calling no_coroutine_fns directly. + +Signed-off-by: Kevin Wolf +Message-Id: <20230509134133.373408-1-kwolf@redhat.com> +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit e113362e4cdfdcfe1d497e569527f70a0021333a) +Signed-off-by: Kevin Wolf +--- + tests/qemu-iotests/tests/iothreads-resize | 71 +++++++++++++++++++ + tests/qemu-iotests/tests/iothreads-resize.out | 11 +++ + 2 files changed, 82 insertions(+) + create mode 100755 tests/qemu-iotests/tests/iothreads-resize + create mode 100644 tests/qemu-iotests/tests/iothreads-resize.out + +diff --git a/tests/qemu-iotests/tests/iothreads-resize b/tests/qemu-iotests/tests/iothreads-resize +new file mode 100755 +index 0000000000..36e4598c62 +--- /dev/null ++++ b/tests/qemu-iotests/tests/iothreads-resize +@@ -0,0 +1,71 @@ ++#!/usr/bin/env bash ++# group: rw auto quick ++# ++# Test resizing an image that is attached to a separate iothread ++# ++# Copyright (C) 2023 Red Hat, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++# creator ++owner=kwolf@redhat.com ++ ++seq=`basename $0` ++echo "QA output created by $seq" ++ ++status=1 # failure is the default! ++ ++_cleanup() ++{ ++ _cleanup_test_img ++} ++trap "_cleanup; exit \$status" 0 1 2 3 15 ++ ++# get standard environment, filters and checks ++cd .. ++. ./common.rc ++. ./common.filter ++ ++# Resizing images is only supported by a few block drivers ++_supported_fmt raw qcow2 qed ++_supported_proto file ++_require_devices virtio-scsi-pci ++ ++size=64M ++_make_test_img $size ++ ++qmp() { ++cat < +Date: Thu, 11 May 2023 13:03:22 +0200 +Subject: [PATCH 54/56] iotests: Use alternative CPU type that is not + deprecated in RHEL + +RH-Author: Kevin Wolf +RH-MergeRequest: 164: block: Fix hangs in qmp_block_resize() +RH-Bugzilla: 2185688 +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Hanna Czenczek +RH-Acked-by: Eric Blake +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [3/4] 038d4718c0ee7a17ff5e6f4af8fc04d07e452f8d (kmwolf/centos-qemu-kvm) + +This is a downstream-only patch that is necessary because the default +CPU in RHEL is marked as deprecated. This makes test cases fail due to +the warning in the output: + +qemu-system-x86_64: warning: CPU model qemu64-x86_64-cpu is deprecated -- use at least 'Nehalem' / 'Opteron_G4', or 'host' / 'max' + +Fixes: 318178778db60b6475d1484509bee136317156d3 +Signed-off-by: Kevin Wolf +--- + tests/qemu-iotests/testenv.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tests/qemu-iotests/testenv.py b/tests/qemu-iotests/testenv.py +index 9a37ad9152..963514aab3 100644 +--- a/tests/qemu-iotests/testenv.py ++++ b/tests/qemu-iotests/testenv.py +@@ -244,6 +244,9 @@ def __init__(self, source_dir: str, build_dir: str, + if self.qemu_prog.endswith(f'qemu-system-{suffix}'): + self.qemu_options += f' -machine {machine}' + ++ if self.qemu_prog.endswith('qemu-system-x86_64'): ++ self.qemu_options += ' -cpu Nehalem' ++ + # QEMU_DEFAULT_MACHINE + self.qemu_default_machine = get_default_machine(self.qemu_prog) + +-- +2.39.1 + diff --git a/kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch b/kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch new file mode 100644 index 0000000..d6a6d73 --- /dev/null +++ b/kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch @@ -0,0 +1,160 @@ +From a5857fb12fcad46e27c415fe82ce13c0cb5d09c7 Mon Sep 17 00:00:00 2001 +From: Marcelo Tosatti +Date: Thu, 29 Jun 2023 14:48:32 -0300 +Subject: [PATCH 5/6] kvm: reuse per-vcpu stats fd to avoid vcpu interruption +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Marcelo Tosatti +RH-MergeRequest: 177: kvm: reuse per-vcpu stats fd to avoid vcpu interruption +RH-Bugzilla: 2218644 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Leonardo Brás +RH-Commit: [1/1] 4ec72385a9047888121485f49bacb1aff84f7018 (mtosatti/qemu-kvm) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2218644 +Commit: 3b6f485275ae95a81eec589d2773b86ca9ddec4d + +A regression has been detected in latency testing of KVM guests. +More specifically, it was observed that the cyclictest +numbers inside of an isolated vcpu (running on isolated pcpu) are: + +Where a maximum of 50us is acceptable. + +The implementation of KVM_GET_STATS_FD uses run_on_cpu to query +per vcpu statistics, which interrupts the vcpu (and is unnecessary). + +To fix this, open the per vcpu stats fd on vcpu initialization, +and read from that fd from QEMU's main thread. + +Signed-off-by: Marcelo Tosatti +Signed-off-by: Paolo Bonzini +--- + accel/kvm/kvm-all.c | 30 +++++++++++++++--------------- + include/hw/core/cpu.h | 1 + + 2 files changed, 16 insertions(+), 15 deletions(-) + +diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c +index cf3a88d90e..fa7ca46c66 100644 +--- a/accel/kvm/kvm-all.c ++++ b/accel/kvm/kvm-all.c +@@ -450,6 +450,8 @@ int kvm_init_vcpu(CPUState *cpu, Error **errp) + "kvm_init_vcpu: kvm_arch_init_vcpu failed (%lu)", + kvm_arch_vcpu_id(cpu)); + } ++ cpu->kvm_vcpu_stats_fd = kvm_vcpu_ioctl(cpu, KVM_GET_STATS_FD, NULL); ++ + err: + return ret; + } +@@ -3959,7 +3961,7 @@ static StatsDescriptors *find_stats_descriptors(StatsTarget target, int stats_fd + + /* Read stats header */ + kvm_stats_header = &descriptors->kvm_stats_header; +- ret = read(stats_fd, kvm_stats_header, sizeof(*kvm_stats_header)); ++ ret = pread(stats_fd, kvm_stats_header, sizeof(*kvm_stats_header), 0); + if (ret != sizeof(*kvm_stats_header)) { + error_setg(errp, "KVM stats: failed to read stats header: " + "expected %zu actual %zu", +@@ -3990,7 +3992,8 @@ static StatsDescriptors *find_stats_descriptors(StatsTarget target, int stats_fd + } + + static void query_stats(StatsResultList **result, StatsTarget target, +- strList *names, int stats_fd, Error **errp) ++ strList *names, int stats_fd, CPUState *cpu, ++ Error **errp) + { + struct kvm_stats_desc *kvm_stats_desc; + struct kvm_stats_header *kvm_stats_header; +@@ -4048,7 +4051,7 @@ static void query_stats(StatsResultList **result, StatsTarget target, + break; + case STATS_TARGET_VCPU: + add_stats_entry(result, STATS_PROVIDER_KVM, +- current_cpu->parent_obj.canonical_path, ++ cpu->parent_obj.canonical_path, + stats_list); + break; + default: +@@ -4085,10 +4088,9 @@ static void query_stats_schema(StatsSchemaList **result, StatsTarget target, + add_stats_schema(result, STATS_PROVIDER_KVM, target, stats_list); + } + +-static void query_stats_vcpu(CPUState *cpu, run_on_cpu_data data) ++static void query_stats_vcpu(CPUState *cpu, StatsArgs *kvm_stats_args) + { +- StatsArgs *kvm_stats_args = (StatsArgs *) data.host_ptr; +- int stats_fd = kvm_vcpu_ioctl(cpu, KVM_GET_STATS_FD, NULL); ++ int stats_fd = cpu->kvm_vcpu_stats_fd; + Error *local_err = NULL; + + if (stats_fd == -1) { +@@ -4097,14 +4099,13 @@ static void query_stats_vcpu(CPUState *cpu, run_on_cpu_data data) + return; + } + query_stats(kvm_stats_args->result.stats, STATS_TARGET_VCPU, +- kvm_stats_args->names, stats_fd, kvm_stats_args->errp); +- close(stats_fd); ++ kvm_stats_args->names, stats_fd, cpu, ++ kvm_stats_args->errp); + } + +-static void query_stats_schema_vcpu(CPUState *cpu, run_on_cpu_data data) ++static void query_stats_schema_vcpu(CPUState *cpu, StatsArgs *kvm_stats_args) + { +- StatsArgs *kvm_stats_args = (StatsArgs *) data.host_ptr; +- int stats_fd = kvm_vcpu_ioctl(cpu, KVM_GET_STATS_FD, NULL); ++ int stats_fd = cpu->kvm_vcpu_stats_fd; + Error *local_err = NULL; + + if (stats_fd == -1) { +@@ -4114,7 +4115,6 @@ static void query_stats_schema_vcpu(CPUState *cpu, run_on_cpu_data data) + } + query_stats_schema(kvm_stats_args->result.schema, STATS_TARGET_VCPU, stats_fd, + kvm_stats_args->errp); +- close(stats_fd); + } + + static void query_stats_cb(StatsResultList **result, StatsTarget target, +@@ -4132,7 +4132,7 @@ static void query_stats_cb(StatsResultList **result, StatsTarget target, + error_setg_errno(errp, errno, "KVM stats: ioctl failed"); + return; + } +- query_stats(result, target, names, stats_fd, errp); ++ query_stats(result, target, names, stats_fd, NULL, errp); + close(stats_fd); + break; + } +@@ -4146,7 +4146,7 @@ static void query_stats_cb(StatsResultList **result, StatsTarget target, + if (!apply_str_list_filter(cpu->parent_obj.canonical_path, targets)) { + continue; + } +- run_on_cpu(cpu, query_stats_vcpu, RUN_ON_CPU_HOST_PTR(&stats_args)); ++ query_stats_vcpu(cpu, &stats_args); + } + break; + } +@@ -4172,6 +4172,6 @@ void query_stats_schemas_cb(StatsSchemaList **result, Error **errp) + if (first_cpu) { + stats_args.result.schema = result; + stats_args.errp = errp; +- run_on_cpu(first_cpu, query_stats_schema_vcpu, RUN_ON_CPU_HOST_PTR(&stats_args)); ++ query_stats_schema_vcpu(first_cpu, &stats_args); + } + } +diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h +index 397fd3ac68..ae96be07e7 100644 +--- a/include/hw/core/cpu.h ++++ b/include/hw/core/cpu.h +@@ -399,6 +399,7 @@ struct CPUState { + struct kvm_dirty_gfn *kvm_dirty_gfns; + uint32_t kvm_fetch_index; + uint64_t dirty_pages; ++ int kvm_vcpu_stats_fd; + + /* Use by accel-block: CPU is executing an ioctl() */ + QemuLockCnt in_ioctl_lock; +-- +2.39.3 + diff --git a/kvm-loongarch-mark-loongarch_ipi_iocsr-re-entrnacy-safe.patch b/kvm-loongarch-mark-loongarch_ipi_iocsr-re-entrnacy-safe.patch new file mode 100644 index 0000000..c1100a5 --- /dev/null +++ b/kvm-loongarch-mark-loongarch_ipi_iocsr-re-entrnacy-safe.patch @@ -0,0 +1,53 @@ +From 6de2f37d9a5db6578554929227377e4fd6d2feb3 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 14/21] loongarch: mark loongarch_ipi_iocsr re-entrnacy safe + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [10/13] 02435b9148b906960137de32eb5a3c4961e44a57 (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 6d0589e0e6c64b888864a2bf980537be20389264 +Author: Alexander Bulekov +Date: Sat May 6 07:21:45 2023 -0400 + + loongarch: mark loongarch_ipi_iocsr re-entrnacy safe + + loongarch_ipi_iocsr MRs rely on re-entrant IO through the ipi_send + function. As such, mark these MRs re-entrancy-safe. + + Fixes: a2e1753b80 ("memory: prevent dma-reentracy issues") + Signed-off-by: Alexander Bulekov + Reviewed-by: Song Gao + Message-Id: <20230506112145.3563708-1-alxndr@bu.edu> + Signed-off-by: Song Gao + +Signed-off-by: Jon Maloy +--- + hw/intc/loongarch_ipi.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/intc/loongarch_ipi.c b/hw/intc/loongarch_ipi.c +index aa4bf9eb74..40e98af2ce 100644 +--- a/hw/intc/loongarch_ipi.c ++++ b/hw/intc/loongarch_ipi.c +@@ -215,6 +215,10 @@ static void loongarch_ipi_init(Object *obj) + for (cpu = 0; cpu < MAX_IPI_CORE_NUM; cpu++) { + memory_region_init_io(&s->ipi_iocsr_mem[cpu], obj, &loongarch_ipi_ops, + &lams->ipi_core[cpu], "loongarch_ipi_iocsr", 0x48); ++ ++ /* loongarch_ipi_iocsr performs re-entrant IO through ipi_send */ ++ s->ipi_iocsr_mem[cpu].disable_reentrancy_guard = true; ++ + sysbus_init_mmio(sbd, &s->ipi_iocsr_mem[cpu]); + + memory_region_init_io(&s->ipi64_iocsr_mem[cpu], obj, &loongarch_ipi64_ops, +-- +2.39.3 + diff --git a/kvm-lsi53c895a-disable-reentrancy-detection-for-MMIO-reg.patch b/kvm-lsi53c895a-disable-reentrancy-detection-for-MMIO-reg.patch new file mode 100644 index 0000000..359d53f --- /dev/null +++ b/kvm-lsi53c895a-disable-reentrancy-detection-for-MMIO-reg.patch @@ -0,0 +1,70 @@ +From 0660a7a6994db0db9f6d0b84f6345aa06dc61761 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Mon, 29 May 2023 14:21:08 -0400 +Subject: [PATCH 16/21] lsi53c895a: disable reentrancy detection for MMIO + region, too + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [12/13] fb9da8b68cdf0dc0b0bd8fb8540849c944d0bf20 (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit d139fe9ad8a27bcc50b4ead77d2f97d191a0e95e +Author: Thomas Huth +Date: Tue May 16 11:05:56 2023 +0200 + + lsi53c895a: disable reentrancy detection for MMIO region, too + + While trying to use a SCSI disk on the LSI controller with an + older version of Fedora (25), I'm getting: + + qemu: warning: Blocked re-entrant IO on MemoryRegion: lsi-mmio at addr: 0x34 + + and the SCSI controller is not usable. Seems like we have to + disable the reentrancy checker for the MMIO region, too, to + get this working again. + + The problem could be reproduced it like this: + + ./qemu-system-x86_64 -accel kvm -m 2G -machine q35 \ + -device lsi53c810,id=lsi1 -device scsi-hd,drive=d0 \ + -drive if=none,id=d0,file=.../somedisk.qcow2 \ + -cdrom Fedora-Everything-netinst-i386-25-1.3.iso + + Where somedisk.qcow2 is an image that contains already some partitions + and file systems. + + In the boot menu of Fedora, go to + "Troubleshooting" -> "Rescue a Fedora system" -> "3) Skip to shell" + + Then check "dmesg | grep -i 53c" for failure messages, and try to mount + a partition from somedisk.qcow2. + + Message-Id: <20230516090556.553813-1-thuth@redhat.com> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/scsi/lsi53c895a.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c +index db27872963..048436352b 100644 +--- a/hw/scsi/lsi53c895a.c ++++ b/hw/scsi/lsi53c895a.c +@@ -2307,6 +2307,7 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp) + * re-entrancy guard. + */ + s->ram_io.disable_reentrancy_guard = true; ++ s->mmio_io.disable_reentrancy_guard = true; + + address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-io"); + qdev_init_gpio_out(d, &s->ext_irq, 1); +-- +2.39.3 + diff --git a/kvm-lsi53c895a-disable-reentrancy-detection-for-script-R.patch b/kvm-lsi53c895a-disable-reentrancy-detection-for-script-R.patch new file mode 100644 index 0000000..e671c92 --- /dev/null +++ b/kvm-lsi53c895a-disable-reentrancy-detection-for-script-R.patch @@ -0,0 +1,58 @@ +From 621808c6c4da3adcc073231493d487d6360386c9 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 09/21] lsi53c895a: disable reentrancy detection for script RAM + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [5/13] 765d65fc3fb735eb4b52a408ccff91b538ad32b6 (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit bfd6e7ae6a72b84e2eb9574f56e6ec037f05182c +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:10 2023 -0400 + + lsi53c895a: disable reentrancy detection for script RAM + + As the code is designed to use the memory APIs to access the script ram, + disable reentrancy checks for the pseudo-RAM ram_io MemoryRegion. + + In the future, ram_io may be converted from an IO to a proper RAM MemoryRegion. + + Reported-by: Fiona Ebner + Signed-off-by: Alexander Bulekov + Reviewed-by: Thomas Huth + Reviewed-by: Darren Kenny + Message-Id: <20230427211013.2994127-6-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/scsi/lsi53c895a.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c +index af93557a9a..db27872963 100644 +--- a/hw/scsi/lsi53c895a.c ++++ b/hw/scsi/lsi53c895a.c +@@ -2302,6 +2302,12 @@ static void lsi_scsi_realize(PCIDevice *dev, Error **errp) + memory_region_init_io(&s->io_io, OBJECT(s), &lsi_io_ops, s, + "lsi-io", 256); + ++ /* ++ * Since we use the address-space API to interact with ram_io, disable the ++ * re-entrancy guard. ++ */ ++ s->ram_io.disable_reentrancy_guard = true; ++ + address_space_init(&s->pci_io_as, pci_address_space_io(dev), "lsi-pci-io"); + qdev_init_gpio_out(d, &s->ext_irq, 1); + +-- +2.39.3 + diff --git a/kvm-memory-prevent-dma-reentracy-issues.patch b/kvm-memory-prevent-dma-reentracy-issues.patch new file mode 100644 index 0000000..d3697dc --- /dev/null +++ b/kvm-memory-prevent-dma-reentracy-issues.patch @@ -0,0 +1,150 @@ +From 0bc9295be331781491e993b6f1b0dca959194f13 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 05/21] memory: prevent dma-reentracy issues + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/13] d4a762d3b156200a65d09cde58cd6d77b229071e (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 +CVE: CVE-2023-0330 + +commit a2e1753b8054344f32cf94f31c6399a58794a380 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:06 2023 -0400 + + memory: prevent dma-reentracy issues + + Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. + This flag is set/checked prior to calling a device's MemoryRegion + handlers, and set when device code initiates DMA. The purpose of this + flag is to prevent two types of DMA-based reentrancy issues: + + 1.) mmio -> dma -> mmio case + 2.) bh -> dma write -> mmio case + + These issues have led to problems such as stack-exhaustion and + use-after-frees. + + Summary of the problem from Peter Maydell: + https://lore.kernel.org/qemu-devel/CAFEAcA_23vc7hE3iaM-JVA6W38LK4hJoWae5KcknhPRD5fPBZA@mail.gmail.com + + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/62 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/540 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/541 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/556 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/557 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/827 + Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1282 + Resolves: CVE-2023-0330 + + Signed-off-by: Alexander Bulekov + Reviewed-by: Thomas Huth + Message-Id: <20230427211013.2994127-2-alxndr@bu.edu> + [thuth: Replace warn_report() with warn_report_once()] + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + include/exec/memory.h | 5 +++++ + include/hw/qdev-core.h | 7 +++++++ + softmmu/memory.c | 16 ++++++++++++++++ + 3 files changed, 28 insertions(+) + +diff --git a/include/exec/memory.h b/include/exec/memory.h +index 15ade918ba..e45ce6061f 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -767,6 +767,8 @@ struct MemoryRegion { + bool is_iommu; + RAMBlock *ram_block; + Object *owner; ++ /* owner as TYPE_DEVICE. Used for re-entrancy checks in MR access hotpath */ ++ DeviceState *dev; + + const MemoryRegionOps *ops; + void *opaque; +@@ -791,6 +793,9 @@ struct MemoryRegion { + unsigned ioeventfd_nb; + MemoryRegionIoeventfd *ioeventfds; + RamDiscardManager *rdm; /* Only for RAM */ ++ ++ /* For devices designed to perform re-entrant IO into their own IO MRs */ ++ bool disable_reentrancy_guard; + }; + + struct IOMMUMemoryRegion { +diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h +index bd50ad5ee1..7623703943 100644 +--- a/include/hw/qdev-core.h ++++ b/include/hw/qdev-core.h +@@ -162,6 +162,10 @@ struct NamedClockList { + QLIST_ENTRY(NamedClockList) node; + }; + ++typedef struct { ++ bool engaged_in_io; ++} MemReentrancyGuard; ++ + /** + * DeviceState: + * @realized: Indicates whether the device has been fully constructed. +@@ -194,6 +198,9 @@ struct DeviceState { + int alias_required_for_version; + ResettableState reset; + GSList *unplug_blockers; ++ ++ /* Is the device currently in mmio/pio/dma? Used to prevent re-entrancy */ ++ MemReentrancyGuard mem_reentrancy_guard; + }; + + struct DeviceListener { +diff --git a/softmmu/memory.c b/softmmu/memory.c +index b1a6cae6f5..b7b3386e9d 100644 +--- a/softmmu/memory.c ++++ b/softmmu/memory.c +@@ -542,6 +542,18 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, + access_size_max = 4; + } + ++ /* Do not allow more than one simultaneous access to a device's IO Regions */ ++ if (mr->dev && !mr->disable_reentrancy_guard && ++ !mr->ram_device && !mr->ram && !mr->rom_device && !mr->readonly) { ++ if (mr->dev->mem_reentrancy_guard.engaged_in_io) { ++ warn_report_once("Blocked re-entrant IO on MemoryRegion: " ++ "%s at addr: 0x%" HWADDR_PRIX, ++ memory_region_name(mr), addr); ++ return MEMTX_ACCESS_ERROR; ++ } ++ mr->dev->mem_reentrancy_guard.engaged_in_io = true; ++ } ++ + /* FIXME: support unaligned access? */ + access_size = MAX(MIN(size, access_size_max), access_size_min); + access_mask = MAKE_64BIT_MASK(0, access_size * 8); +@@ -556,6 +568,9 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, + access_mask, attrs); + } + } ++ if (mr->dev) { ++ mr->dev->mem_reentrancy_guard.engaged_in_io = false; ++ } + return r; + } + +@@ -1170,6 +1185,7 @@ static void memory_region_do_init(MemoryRegion *mr, + } + mr->name = g_strdup(name); + mr->owner = owner; ++ mr->dev = (DeviceState *) object_dynamic_cast(mr->owner, TYPE_DEVICE); + mr->ram_block = NULL; + + if (name) { +-- +2.39.3 + diff --git a/kvm-memory-stricter-checks-prior-to-unsetting-engaged_in.patch b/kvm-memory-stricter-checks-prior-to-unsetting-engaged_in.patch new file mode 100644 index 0000000..f45abea --- /dev/null +++ b/kvm-memory-stricter-checks-prior-to-unsetting-engaged_in.patch @@ -0,0 +1,67 @@ +From 3f2042e33acb6db91594e12ebd63b9abd9e753cc Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Wed, 7 Jun 2023 11:45:09 -0400 +Subject: [PATCH 15/21] memory: stricter checks prior to unsetting + engaged_in_io + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [11/13] b8e1a4b49dd7fa3b7948d32f46dfe1d7f7a4c1cf (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 3884bf6468ac6bbb58c2b3feaa74e87f821b52f3 +Author: Alexander Bulekov +Date: Tue May 16 04:40:02 2023 -0400 + + memory: stricter checks prior to unsetting engaged_in_io + + engaged_in_io could be unset by an MR with re-entrancy checks disabled. + Ensure that only MRs that can set the engaged_in_io flag can unset it. + + Signed-off-by: Alexander Bulekov + Message-Id: <20230516084002.3813836-1-alxndr@bu.edu> + Reviewed-by: Darren Kenny + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + softmmu/memory.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/softmmu/memory.c b/softmmu/memory.c +index b7b3386e9d..26424f1d78 100644 +--- a/softmmu/memory.c ++++ b/softmmu/memory.c +@@ -534,6 +534,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, + unsigned access_size; + unsigned i; + MemTxResult r = MEMTX_OK; ++ bool reentrancy_guard_applied = false; + + if (!access_size_min) { + access_size_min = 1; +@@ -552,6 +553,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, + return MEMTX_ACCESS_ERROR; + } + mr->dev->mem_reentrancy_guard.engaged_in_io = true; ++ reentrancy_guard_applied = true; + } + + /* FIXME: support unaligned access? */ +@@ -568,7 +570,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr, + access_mask, attrs); + } + } +- if (mr->dev) { ++ if (mr->dev && reentrancy_guard_applied) { + mr->dev->mem_reentrancy_guard.engaged_in_io = false; + } + return r; +-- +2.39.3 + diff --git a/kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch b/kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch new file mode 100644 index 0000000..7c9748b --- /dev/null +++ b/kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch @@ -0,0 +1,308 @@ +From e2c2910edf90186ca0d7d13c9943caa284e95ea9 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 25 Apr 2023 21:15:14 -0400 +Subject: [PATCH 51/56] migration: Allow postcopy_ram_supported_by_host() to + report err +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [50/50] 08c44affc11c27ddf1aa7ce0dfacbaf5effb80cb (peterx/qemu-kvm) + +Instead of print it to STDERR, bring the error upwards so that it can be +reported via QMP responses. + +E.g.: + +{ "execute": "migrate-set-capabilities" , + "arguments": { "capabilities": + [ { "capability": "postcopy-ram", "state": true } ] } } + +{ "error": + { "class": "GenericError", + "desc": "Postcopy is not supported: Host backend files need to be TMPFS + or HUGETLBFS only" } } + +Signed-off-by: Peter Xu +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit 74c38cf7fd24c60e4f0a90585d17250478260877) +Signed-off-by: Peter Xu +--- + migration/options.c | 8 ++---- + migration/postcopy-ram.c | 60 +++++++++++++++++++++------------------- + migration/postcopy-ram.h | 3 +- + migration/savevm.c | 3 +- + 4 files changed, 39 insertions(+), 35 deletions(-) + +diff --git a/migration/options.c b/migration/options.c +index 4701c75a4d..e51d667e14 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -302,6 +302,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + { + MigrationIncomingState *mis = migration_incoming_get_current(); + ++ ERRP_GUARD(); + #ifndef CONFIG_LIVE_BLOCK_MIGRATION + if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { + error_setg(errp, "QEMU compiled without old-style (blk/-b, inc/-i) " +@@ -327,11 +328,8 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + */ + if (!old_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] && + runstate_check(RUN_STATE_INMIGRATE) && +- !postcopy_ram_supported_by_host(mis)) { +- /* postcopy_ram_supported_by_host will have emitted a more +- * detailed message +- */ +- error_setg(errp, "Postcopy is not supported"); ++ !postcopy_ram_supported_by_host(mis, errp)) { ++ error_prepend(errp, "Postcopy is not supported: "); + return false; + } + +diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c +index 0711500036..75aa276bb1 100644 +--- a/migration/postcopy-ram.c ++++ b/migration/postcopy-ram.c +@@ -283,11 +283,13 @@ static bool request_ufd_features(int ufd, uint64_t features) + return true; + } + +-static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) ++static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis, ++ Error **errp) + { + uint64_t asked_features = 0; + static uint64_t supported_features; + ++ ERRP_GUARD(); + /* + * it's not possible to + * request UFFD_API twice per one fd +@@ -295,7 +297,7 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) + */ + if (!supported_features) { + if (!receive_ufd_features(&supported_features)) { +- error_report("%s failed", __func__); ++ error_setg(errp, "Userfault feature detection failed"); + return false; + } + } +@@ -317,8 +319,7 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) + * userfault file descriptor + */ + if (!request_ufd_features(ufd, asked_features)) { +- error_report("%s failed: features %" PRIu64, __func__, +- asked_features); ++ error_setg(errp, "Failed features %" PRIu64, asked_features); + return false; + } + +@@ -329,7 +330,8 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) + have_hp = supported_features & UFFD_FEATURE_MISSING_HUGETLBFS; + #endif + if (!have_hp) { +- error_report("Userfault on this host does not support huge pages"); ++ error_setg(errp, ++ "Userfault on this host does not support huge pages"); + return false; + } + } +@@ -338,7 +340,7 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) + + /* Callback from postcopy_ram_supported_by_host block iterator. + */ +-static int test_ramblock_postcopiable(RAMBlock *rb) ++static int test_ramblock_postcopiable(RAMBlock *rb, Error **errp) + { + const char *block_name = qemu_ram_get_idstr(rb); + ram_addr_t length = qemu_ram_get_used_length(rb); +@@ -346,16 +348,18 @@ static int test_ramblock_postcopiable(RAMBlock *rb) + QemuFsType fs; + + if (length % pagesize) { +- error_report("Postcopy requires RAM blocks to be a page size multiple," +- " block %s is 0x" RAM_ADDR_FMT " bytes with a " +- "page size of 0x%zx", block_name, length, pagesize); ++ error_setg(errp, ++ "Postcopy requires RAM blocks to be a page size multiple," ++ " block %s is 0x" RAM_ADDR_FMT " bytes with a " ++ "page size of 0x%zx", block_name, length, pagesize); + return 1; + } + + if (rb->fd >= 0) { + fs = qemu_fd_getfs(rb->fd); + if (fs != QEMU_FS_TYPE_TMPFS && fs != QEMU_FS_TYPE_HUGETLBFS) { +- error_report("Host backend files need to be TMPFS or HUGETLBFS only"); ++ error_setg(errp, ++ "Host backend files need to be TMPFS or HUGETLBFS only"); + return 1; + } + } +@@ -368,7 +372,7 @@ static int test_ramblock_postcopiable(RAMBlock *rb) + * normally fine since if the postcopy succeeds it gets turned back on at the + * end. + */ +-bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) ++bool postcopy_ram_supported_by_host(MigrationIncomingState *mis, Error **errp) + { + long pagesize = qemu_real_host_page_size(); + int ufd = -1; +@@ -377,29 +381,27 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + struct uffdio_register reg_struct; + struct uffdio_range range_struct; + uint64_t feature_mask; +- Error *local_err = NULL; + RAMBlock *block; + ++ ERRP_GUARD(); + if (qemu_target_page_size() > pagesize) { +- error_report("Target page size bigger than host page size"); ++ error_setg(errp, "Target page size bigger than host page size"); + goto out; + } + + ufd = uffd_open(O_CLOEXEC); + if (ufd == -1) { +- error_report("%s: userfaultfd not available: %s", __func__, +- strerror(errno)); ++ error_setg(errp, "Userfaultfd not available: %s", strerror(errno)); + goto out; + } + + /* Give devices a chance to object */ +- if (postcopy_notify(POSTCOPY_NOTIFY_PROBE, &local_err)) { +- error_report_err(local_err); ++ if (postcopy_notify(POSTCOPY_NOTIFY_PROBE, errp)) { + goto out; + } + + /* Version and features check */ +- if (!ufd_check_and_apply(ufd, mis)) { ++ if (!ufd_check_and_apply(ufd, mis, errp)) { + goto out; + } + +@@ -417,7 +419,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + * affect in reality, or we can revisit. + */ + RAMBLOCK_FOREACH(block) { +- if (test_ramblock_postcopiable(block)) { ++ if (test_ramblock_postcopiable(block, errp)) { + goto out; + } + } +@@ -427,7 +429,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + * it was enabled. + */ + if (munlockall()) { +- error_report("%s: munlockall: %s", __func__, strerror(errno)); ++ error_setg(errp, "munlockall() failed: %s", strerror(errno)); + goto out; + } + +@@ -439,8 +441,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + testarea = mmap(NULL, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | + MAP_ANONYMOUS, -1, 0); + if (testarea == MAP_FAILED) { +- error_report("%s: Failed to map test area: %s", __func__, +- strerror(errno)); ++ error_setg(errp, "Failed to map test area: %s", strerror(errno)); + goto out; + } + g_assert(QEMU_PTR_IS_ALIGNED(testarea, pagesize)); +@@ -450,14 +451,14 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + reg_struct.mode = UFFDIO_REGISTER_MODE_MISSING; + + if (ioctl(ufd, UFFDIO_REGISTER, ®_struct)) { +- error_report("%s userfault register: %s", __func__, strerror(errno)); ++ error_setg(errp, "UFFDIO_REGISTER failed: %s", strerror(errno)); + goto out; + } + + range_struct.start = (uintptr_t)testarea; + range_struct.len = pagesize; + if (ioctl(ufd, UFFDIO_UNREGISTER, &range_struct)) { +- error_report("%s userfault unregister: %s", __func__, strerror(errno)); ++ error_setg(errp, "UFFDIO_UNREGISTER failed: %s", strerror(errno)); + goto out; + } + +@@ -465,8 +466,8 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + (__u64)1 << _UFFDIO_COPY | + (__u64)1 << _UFFDIO_ZEROPAGE; + if ((reg_struct.ioctls & feature_mask) != feature_mask) { +- error_report("Missing userfault map features: %" PRIx64, +- (uint64_t)(~reg_struct.ioctls & feature_mask)); ++ error_setg(errp, "Missing userfault map features: %" PRIx64, ++ (uint64_t)(~reg_struct.ioctls & feature_mask)); + goto out; + } + +@@ -1188,6 +1189,8 @@ static int postcopy_temp_pages_setup(MigrationIncomingState *mis) + + int postcopy_ram_incoming_setup(MigrationIncomingState *mis) + { ++ Error *local_err = NULL; ++ + /* Open the fd for the kernel to give us userfaults */ + mis->userfault_fd = uffd_open(O_CLOEXEC | O_NONBLOCK); + if (mis->userfault_fd == -1) { +@@ -1200,7 +1203,8 @@ int postcopy_ram_incoming_setup(MigrationIncomingState *mis) + * Although the host check already tested the API, we need to + * do the check again as an ABI handshake on the new fd. + */ +- if (!ufd_check_and_apply(mis->userfault_fd, mis)) { ++ if (!ufd_check_and_apply(mis->userfault_fd, mis, &local_err)) { ++ error_report_err(local_err); + return -1; + } + +@@ -1360,7 +1364,7 @@ void fill_destination_postcopy_migration_info(MigrationInfo *info) + { + } + +-bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) ++bool postcopy_ram_supported_by_host(MigrationIncomingState *mis, Error **errp) + { + error_report("%s: No OS support", __func__); + return false; +diff --git a/migration/postcopy-ram.h b/migration/postcopy-ram.h +index b4867a32d5..442ab89752 100644 +--- a/migration/postcopy-ram.h ++++ b/migration/postcopy-ram.h +@@ -14,7 +14,8 @@ + #define QEMU_POSTCOPY_RAM_H + + /* Return true if the host supports everything we need to do postcopy-ram */ +-bool postcopy_ram_supported_by_host(MigrationIncomingState *mis); ++bool postcopy_ram_supported_by_host(MigrationIncomingState *mis, ++ Error **errp); + + /* + * Make all of RAM sensitive to accesses to areas that haven't yet been written +diff --git a/migration/savevm.c b/migration/savevm.c +index 9671211339..211eff3a8b 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -1753,7 +1753,8 @@ static int loadvm_postcopy_handle_advise(MigrationIncomingState *mis, + return -EINVAL; + } + +- if (!postcopy_ram_supported_by_host(mis)) { ++ if (!postcopy_ram_supported_by_host(mis, &local_err)) { ++ error_report_err(local_err); + postcopy_state_set(POSTCOPY_INCOMING_NONE); + return -1; + } +-- +2.39.1 + diff --git a/kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch b/kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch new file mode 100644 index 0000000..d1620f0 --- /dev/null +++ b/kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch @@ -0,0 +1,111 @@ +From 3691bb5f956e3c60dbf6de183011b31dbc7a7801 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Tue, 2 May 2023 15:52:12 -0500 +Subject: [PATCH 01/56] migration: Attempt disk reactivation in more failure + scenarios + +RH-Author: Eric Blake +RH-MergeRequest: 161: Avoid migration assertion from failed NFS server. +RH-Bugzilla: 2058982 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Acked-by: Kevin Wolf +RH-Commit: [1/1] 5999b747b314641259d3b8809033b057805eed3f (ebblake/centos-qemu-kvm) + +Commit fe904ea824 added a fail_inactivate label, which tries to +reactivate disks on the source after a failure while s->state == +MIGRATION_STATUS_ACTIVE, but didn't actually use the label if +qemu_savevm_state_complete_precopy() failed. This failure to +reactivate is also present in commit 6039dd5b1c (also covering the new +s->state == MIGRATION_STATUS_DEVICE state) and 403d18ae (ensuring +s->block_inactive is set more reliably). + +Consolidate the two labels back into one - no matter HOW migration is +failed, if there is any chance we can reach vm_start() after having +attempted inactivation, it is essential that we have tried to restart +disks before then. This also makes the cleanup more like +migrate_fd_cancel(). + +Suggested-by: Kevin Wolf +Signed-off-by: Eric Blake +Message-Id: <20230502205212.134680-1-eblake@redhat.com> +Acked-by: Peter Xu +Reviewed-by: Juan Quintela +Reviewed-by: Kevin Wolf +Signed-off-by: Kevin Wolf +(cherry picked from commit 6dab4c93ecfae48e2e67b984d1032c1e988d3005) +[eblake: downstream migrate_colo() => migrate_colo_enabled()] +Signed-off-by: Eric Blake +--- + migration/migration.c | 24 ++++++++++++++---------- + 1 file changed, 14 insertions(+), 10 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 08007cef4e..99f86bd6c2 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3443,6 +3443,11 @@ static void migration_completion(MigrationState *s) + MIGRATION_STATUS_DEVICE); + } + if (ret >= 0) { ++ /* ++ * Inactivate disks except in COLO, and track that we ++ * have done so in order to remember to reactivate ++ * them if migration fails or is cancelled. ++ */ + s->block_inactive = !migrate_colo_enabled(); + qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false, +@@ -3487,13 +3492,13 @@ static void migration_completion(MigrationState *s) + rp_error = await_return_path_close_on_source(s); + trace_migration_return_path_end_after(rp_error); + if (rp_error) { +- goto fail_invalidate; ++ goto fail; + } + } + + if (qemu_file_get_error(s->to_dst_file)) { + trace_migration_completion_file_err(); +- goto fail_invalidate; ++ goto fail; + } + + if (migrate_colo_enabled() && s->state == MIGRATION_STATUS_ACTIVE) { +@@ -3507,26 +3512,25 @@ static void migration_completion(MigrationState *s) + + return; + +-fail_invalidate: +- /* If not doing postcopy, vm_start() will be called: let's regain +- * control on images. +- */ +- if (s->state == MIGRATION_STATUS_ACTIVE || +- s->state == MIGRATION_STATUS_DEVICE) { ++fail: ++ if (s->block_inactive && (s->state == MIGRATION_STATUS_ACTIVE || ++ s->state == MIGRATION_STATUS_DEVICE)) { ++ /* ++ * If not doing postcopy, vm_start() will be called: let's ++ * regain control on images. ++ */ + Error *local_err = NULL; + + qemu_mutex_lock_iothread(); + bdrv_activate_all(&local_err); + if (local_err) { + error_report_err(local_err); +- s->block_inactive = true; + } else { + s->block_inactive = false; + } + qemu_mutex_unlock_iothread(); + } + +-fail: + migrate_set_state(&s->state, current_active_state, + MIGRATION_STATUS_FAILED); + } +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_cap_set.patch b/kvm-migration-Create-migrate_cap_set.patch new file mode 100644 index 0000000..33268bb --- /dev/null +++ b/kvm-migration-Create-migrate_cap_set.patch @@ -0,0 +1,93 @@ +From d772464e9a51a085e10864b2dc7ffd49991fc23b Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 21:02:42 +0100 +Subject: [PATCH 22/56] migration: Create migrate_cap_set() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [21/50] 5b12f04013cf2d374a869134bb67c938c789e24d (peterx/qemu-kvm) + +And remove the convoluted use of qmp_migrate_set_capabilities() to +enable disable MIGRATION_CAPABILITY_BLOCK. + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 9eb1109cfba5415dd0b0cb82e80fc5e42fe861b7) +Signed-off-by: Peter Xu +--- + migration/migration.c | 34 ++++++++++++++++------------------ + 1 file changed, 16 insertions(+), 18 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index b745d829a4..18058fb597 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1912,25 +1912,24 @@ void migrate_set_state(int *state, int old_state, int new_state) + } + } + +-static MigrationCapabilityStatus *migrate_cap_add(MigrationCapability index, +- bool state) ++static bool migrate_cap_set(int cap, bool value, Error **errp) + { +- MigrationCapabilityStatus *cap; +- +- cap = g_new0(MigrationCapabilityStatus, 1); +- cap->capability = index; +- cap->state = state; ++ MigrationState *s = migrate_get_current(); ++ bool new_caps[MIGRATION_CAPABILITY__MAX]; + +- return cap; +-} ++ if (migration_is_running(s->state)) { ++ error_setg(errp, QERR_MIGRATION_ACTIVE); ++ return false; ++ } + +-void migrate_set_block_enabled(bool value, Error **errp) +-{ +- MigrationCapabilityStatusList *cap = NULL; ++ memcpy(new_caps, s->capabilities, sizeof(new_caps)); ++ new_caps[cap] = value; + +- QAPI_LIST_PREPEND(cap, migrate_cap_add(MIGRATION_CAPABILITY_BLOCK, value)); +- qmp_migrate_set_capabilities(cap, errp); +- qapi_free_MigrationCapabilityStatusList(cap); ++ if (!migrate_caps_check(s->capabilities, new_caps, errp)) { ++ return false; ++ } ++ s->capabilities[cap] = value; ++ return true; + } + + static void migrate_set_block_incremental(MigrationState *s, bool value) +@@ -1942,7 +1941,7 @@ static void block_cleanup_parameters(MigrationState *s) + { + if (s->must_remove_block_options) { + /* setting to false can never fail */ +- migrate_set_block_enabled(false, &error_abort); ++ migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, false, &error_abort); + migrate_set_block_incremental(s, false); + s->must_remove_block_options = false; + } +@@ -2429,8 +2428,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, + "current migration capabilities"); + return false; + } +- migrate_set_block_enabled(true, &local_err); +- if (local_err) { ++ if (!migrate_cap_set(MIGRATION_CAPABILITY_BLOCK, true, &local_err)) { + error_propagate(errp, local_err); + return false; + } +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_checkpoint_delay.patch b/kvm-migration-Create-migrate_checkpoint_delay.patch new file mode 100644 index 0000000..408d258 --- /dev/null +++ b/kvm-migration-Create-migrate_checkpoint_delay.patch @@ -0,0 +1,84 @@ +From a17bee3c8ab48daa471ec53bed0e2cb0bb41fc76 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 01:04:55 +0100 +Subject: [PATCH 41/56] migration: Create migrate_checkpoint_delay() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [40/50] b972d3f12e49dc27aa78eb723ca6d0fac4d174d8 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit f94a858fa3e72ba954a338c01ae9fecc15fcce5c) +Signed-off-by: Peter Xu +--- + migration/colo.c | 5 ++--- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + 3 files changed, 12 insertions(+), 3 deletions(-) + +diff --git a/migration/colo.c b/migration/colo.c +index 93b78c9270..07bfa21fea 100644 +--- a/migration/colo.c ++++ b/migration/colo.c +@@ -576,7 +576,7 @@ static void colo_process_checkpoint(MigrationState *s) + trace_colo_vm_state_change("stop", "run"); + + timer_mod(s->colo_delay_timer, qemu_clock_get_ms(QEMU_CLOCK_HOST) + +- s->parameters.x_checkpoint_delay); ++ migrate_checkpoint_delay()); + + while (s->state == MIGRATION_STATUS_COLO) { + if (failover_get_state() != FAILOVER_STATUS_NONE) { +@@ -651,8 +651,7 @@ void colo_checkpoint_notify(void *opaque) + + qemu_event_set(&s->colo_checkpoint_event); + s->colo_checkpoint_time = qemu_clock_get_ms(QEMU_CLOCK_HOST); +- next_notify_time = s->colo_checkpoint_time + +- s->parameters.x_checkpoint_delay; ++ next_notify_time = s->colo_checkpoint_time + migrate_checkpoint_delay(); + timer_mod(s->colo_delay_timer, next_notify_time); + } + +diff --git a/migration/options.c b/migration/options.c +index b9f3815f7e..0e102e5700 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -472,6 +472,15 @@ bool migrate_block_incremental(void) + return s->parameters.block_incremental; + } + ++uint32_t migrate_checkpoint_delay(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.x_checkpoint_delay; ++} ++ + int migrate_compress_level(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index aa54443353..adc2879bbb 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -46,6 +46,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp); + /* parameters */ + + bool migrate_block_incremental(void); ++uint32_t migrate_checkpoint_delay(void); + int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_cpu_throttle_increment-func.patch b/kvm-migration-Create-migrate_cpu_throttle_increment-func.patch new file mode 100644 index 0000000..65bad3c --- /dev/null +++ b/kvm-migration-Create-migrate_cpu_throttle_increment-func.patch @@ -0,0 +1,75 @@ +From 7ff430e011780dad00e5ebaad0318c5fa3aec102 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:20:49 +0100 +Subject: [PATCH 45/56] migration: Create migrate_cpu_throttle_increment() + function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [44/50] aec990a106a0347b265f5c056a516e0b91e8183c (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 9605c2ac282c565bb00b5f344217161bef29eff8) +Signed-off-by: Peter Xu +--- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 2 +- + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/migration/options.c b/migration/options.c +index f7fb6999f7..31435d2b45 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -509,6 +509,15 @@ int migrate_compress_wait_thread(void) + return s->parameters.compress_wait_thread; + } + ++uint8_t migrate_cpu_throttle_increment(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.cpu_throttle_increment; ++} ++ + uint8_t migrate_cpu_throttle_initial(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index fd8b91d767..49b29bdafd 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -50,6 +50,7 @@ uint32_t migrate_checkpoint_delay(void); + int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); ++uint8_t migrate_cpu_throttle_increment(void); + uint8_t migrate_cpu_throttle_initial(void); + int migrate_decompress_threads(void); + uint8_t migrate_max_cpu_throttle(void); +diff --git a/migration/ram.c b/migration/ram.c +index 5e855d5c22..5645745a42 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -713,7 +713,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirty_period, + { + MigrationState *s = migrate_get_current(); + uint64_t pct_initial = migrate_cpu_throttle_initial(); +- uint64_t pct_increment = s->parameters.cpu_throttle_increment; ++ uint64_t pct_increment = migrate_cpu_throttle_increment(); + bool pct_tailslow = s->parameters.cpu_throttle_tailslow; + int pct_max = migrate_max_cpu_throttle(); + +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch b/kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch new file mode 100644 index 0000000..aab2013 --- /dev/null +++ b/kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch @@ -0,0 +1,75 @@ +From fdc2f14bfb3ef8897310a7db63287a9bab1fb858 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 01:22:44 +0100 +Subject: [PATCH 44/56] migration: Create migrate_cpu_throttle_initial() to + option.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [43/50] e0e0db7218f28aefd4bd022edbaec236e2030cb1 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 2a8ec38082f8098f2693bb3632175453c0c84a51) +Signed-off-by: Peter Xu +--- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 2 +- + 3 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/migration/options.c b/migration/options.c +index 418aafac64..f7fb6999f7 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -509,6 +509,15 @@ int migrate_compress_wait_thread(void) + return s->parameters.compress_wait_thread; + } + ++uint8_t migrate_cpu_throttle_initial(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.cpu_throttle_initial; ++} ++ + int migrate_decompress_threads(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 72b1a320b7..fd8b91d767 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -50,6 +50,7 @@ uint32_t migrate_checkpoint_delay(void); + int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); ++uint8_t migrate_cpu_throttle_initial(void); + int migrate_decompress_threads(void); + uint8_t migrate_max_cpu_throttle(void); + int64_t migrate_max_postcopy_bandwidth(void); +diff --git a/migration/ram.c b/migration/ram.c +index 5c786513ef..5e855d5c22 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -712,7 +712,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirty_period, + uint64_t bytes_dirty_threshold) + { + MigrationState *s = migrate_get_current(); +- uint64_t pct_initial = s->parameters.cpu_throttle_initial; ++ uint64_t pct_initial = migrate_cpu_throttle_initial(); + uint64_t pct_increment = s->parameters.cpu_throttle_increment; + bool pct_tailslow = s->parameters.cpu_throttle_tailslow; + int pct_max = migrate_max_cpu_throttle(); +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch b/kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch new file mode 100644 index 0000000..e36f003 --- /dev/null +++ b/kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch @@ -0,0 +1,78 @@ +From b88c51c4b02639e28da73143b1da7bd3d6706ce5 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:29:51 +0100 +Subject: [PATCH 46/56] migration: Create migrate_cpu_throttle_tailslow() + function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [45/50] e93e96392405c60f75abbf288e4fddb191bbc996 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 873f674c559e3162a6e6e92994301d400c5cc873) +Signed-off-by: Peter Xu +--- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 3 +-- + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/migration/options.c b/migration/options.c +index 31435d2b45..615534c151 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -527,6 +527,15 @@ uint8_t migrate_cpu_throttle_initial(void) + return s->parameters.cpu_throttle_initial; + } + ++bool migrate_cpu_throttle_tailslow(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.cpu_throttle_tailslow; ++} ++ + int migrate_decompress_threads(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 49b29bdafd..99f6bbd7a1 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -52,6 +52,7 @@ int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); + uint8_t migrate_cpu_throttle_increment(void); + uint8_t migrate_cpu_throttle_initial(void); ++bool migrate_cpu_throttle_tailslow(void); + int migrate_decompress_threads(void); + uint8_t migrate_max_cpu_throttle(void); + int64_t migrate_max_postcopy_bandwidth(void); +diff --git a/migration/ram.c b/migration/ram.c +index 5645745a42..01356f60a4 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -711,10 +711,9 @@ static size_t save_page_header(PageSearchStatus *pss, QEMUFile *f, + static void mig_throttle_guest_down(uint64_t bytes_dirty_period, + uint64_t bytes_dirty_threshold) + { +- MigrationState *s = migrate_get_current(); + uint64_t pct_initial = migrate_cpu_throttle_initial(); + uint64_t pct_increment = migrate_cpu_throttle_increment(); +- bool pct_tailslow = s->parameters.cpu_throttle_tailslow; ++ bool pct_tailslow = migrate_cpu_throttle_tailslow(); + int pct_max = migrate_max_cpu_throttle(); + + uint64_t throttle_now = cpu_throttle_get_percentage(); +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_max_bandwidth-function.patch b/kvm-migration-Create-migrate_max_bandwidth-function.patch new file mode 100644 index 0000000..ba1d34c --- /dev/null +++ b/kvm-migration-Create-migrate_max_bandwidth-function.patch @@ -0,0 +1,232 @@ +From b6228b3122f5c1f220f92042277ab1bfbb5ba086 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 11:00:12 +0100 +Subject: [PATCH 48/56] migration: Create migrate_max_bandwidth() function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [47/50] 3874656f70cb9c2a30f4d63e146539480d422326 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 9c894df3a37d675652390f7dbbe2f65b7bad7efa) +Signed-off-by: Peter Xu +--- + migration/migration.c | 70 +------------------------------------- + migration/options.c | 79 +++++++++++++++++++++++++++++++++++++++++++ + migration/options.h | 1 + + 3 files changed, 81 insertions(+), 69 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 46a5ea4d42..c2e109329d 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -886,74 +886,6 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value) + migrate_send_rp_message(mis, MIG_RP_MSG_RESUME_ACK, sizeof(buf), &buf); + } + +-MigrationParameters *qmp_query_migrate_parameters(Error **errp) +-{ +- MigrationParameters *params; +- MigrationState *s = migrate_get_current(); +- +- /* TODO use QAPI_CLONE() instead of duplicating it inline */ +- params = g_malloc0(sizeof(*params)); +- params->has_compress_level = true; +- params->compress_level = s->parameters.compress_level; +- params->has_compress_threads = true; +- params->compress_threads = s->parameters.compress_threads; +- params->has_compress_wait_thread = true; +- params->compress_wait_thread = s->parameters.compress_wait_thread; +- params->has_decompress_threads = true; +- params->decompress_threads = s->parameters.decompress_threads; +- params->has_throttle_trigger_threshold = true; +- params->throttle_trigger_threshold = s->parameters.throttle_trigger_threshold; +- params->has_cpu_throttle_initial = true; +- params->cpu_throttle_initial = s->parameters.cpu_throttle_initial; +- params->has_cpu_throttle_increment = true; +- params->cpu_throttle_increment = s->parameters.cpu_throttle_increment; +- params->has_cpu_throttle_tailslow = true; +- params->cpu_throttle_tailslow = s->parameters.cpu_throttle_tailslow; +- params->tls_creds = g_strdup(s->parameters.tls_creds); +- params->tls_hostname = g_strdup(s->parameters.tls_hostname); +- params->tls_authz = g_strdup(s->parameters.tls_authz ? +- s->parameters.tls_authz : ""); +- params->has_max_bandwidth = true; +- params->max_bandwidth = s->parameters.max_bandwidth; +- params->has_downtime_limit = true; +- params->downtime_limit = s->parameters.downtime_limit; +- params->has_x_checkpoint_delay = true; +- params->x_checkpoint_delay = s->parameters.x_checkpoint_delay; +- params->has_block_incremental = true; +- params->block_incremental = s->parameters.block_incremental; +- params->has_multifd_channels = true; +- params->multifd_channels = s->parameters.multifd_channels; +- params->has_multifd_compression = true; +- params->multifd_compression = s->parameters.multifd_compression; +- params->has_multifd_zlib_level = true; +- params->multifd_zlib_level = s->parameters.multifd_zlib_level; +- params->has_multifd_zstd_level = true; +- params->multifd_zstd_level = s->parameters.multifd_zstd_level; +- params->has_xbzrle_cache_size = true; +- params->xbzrle_cache_size = s->parameters.xbzrle_cache_size; +- params->has_max_postcopy_bandwidth = true; +- params->max_postcopy_bandwidth = s->parameters.max_postcopy_bandwidth; +- params->has_max_cpu_throttle = true; +- params->max_cpu_throttle = s->parameters.max_cpu_throttle; +- params->has_announce_initial = true; +- params->announce_initial = s->parameters.announce_initial; +- params->has_announce_max = true; +- params->announce_max = s->parameters.announce_max; +- params->has_announce_rounds = true; +- params->announce_rounds = s->parameters.announce_rounds; +- params->has_announce_step = true; +- params->announce_step = s->parameters.announce_step; +- +- if (s->parameters.has_block_bitmap_mapping) { +- params->has_block_bitmap_mapping = true; +- params->block_bitmap_mapping = +- QAPI_CLONE(BitmapMigrationNodeAliasList, +- s->parameters.block_bitmap_mapping); +- } +- +- return params; +-} +- + /* + * Return true if we're already in the middle of a migration + * (i.e. any of the active or setup states) +@@ -3775,7 +3707,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) + XFER_LIMIT_RATIO; + } else { + /* This is a fresh new migration */ +- rate_limit = s->parameters.max_bandwidth / XFER_LIMIT_RATIO; ++ rate_limit = migrate_max_bandwidth() / XFER_LIMIT_RATIO; + + /* Notify before starting migration thread */ + notifier_list_notify(&migration_state_notifiers, s); +diff --git a/migration/options.c b/migration/options.c +index 8bd2d949ae..8e8753d9be 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -12,8 +12,10 @@ + */ + + #include "qemu/osdep.h" ++#include "qapi/clone-visitor.h" + #include "qapi/error.h" + #include "qapi/qapi-commands-migration.h" ++#include "qapi/qapi-visit-migration.h" + #include "qapi/qmp/qerror.h" + #include "sysemu/runstate.h" + #include "migration/misc.h" +@@ -562,6 +564,15 @@ uint8_t migrate_max_cpu_throttle(void) + return s->parameters.max_cpu_throttle; + } + ++uint64_t migrate_max_bandwidth(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.max_bandwidth; ++} ++ + int64_t migrate_max_postcopy_bandwidth(void) + { + MigrationState *s; +@@ -641,3 +652,71 @@ AnnounceParameters *migrate_announce_params(void) + + return ≈ + } ++ ++MigrationParameters *qmp_query_migrate_parameters(Error **errp) ++{ ++ MigrationParameters *params; ++ MigrationState *s = migrate_get_current(); ++ ++ /* TODO use QAPI_CLONE() instead of duplicating it inline */ ++ params = g_malloc0(sizeof(*params)); ++ params->has_compress_level = true; ++ params->compress_level = s->parameters.compress_level; ++ params->has_compress_threads = true; ++ params->compress_threads = s->parameters.compress_threads; ++ params->has_compress_wait_thread = true; ++ params->compress_wait_thread = s->parameters.compress_wait_thread; ++ params->has_decompress_threads = true; ++ params->decompress_threads = s->parameters.decompress_threads; ++ params->has_throttle_trigger_threshold = true; ++ params->throttle_trigger_threshold = s->parameters.throttle_trigger_threshold; ++ params->has_cpu_throttle_initial = true; ++ params->cpu_throttle_initial = s->parameters.cpu_throttle_initial; ++ params->has_cpu_throttle_increment = true; ++ params->cpu_throttle_increment = s->parameters.cpu_throttle_increment; ++ params->has_cpu_throttle_tailslow = true; ++ params->cpu_throttle_tailslow = s->parameters.cpu_throttle_tailslow; ++ params->tls_creds = g_strdup(s->parameters.tls_creds); ++ params->tls_hostname = g_strdup(s->parameters.tls_hostname); ++ params->tls_authz = g_strdup(s->parameters.tls_authz ? ++ s->parameters.tls_authz : ""); ++ params->has_max_bandwidth = true; ++ params->max_bandwidth = s->parameters.max_bandwidth; ++ params->has_downtime_limit = true; ++ params->downtime_limit = s->parameters.downtime_limit; ++ params->has_x_checkpoint_delay = true; ++ params->x_checkpoint_delay = s->parameters.x_checkpoint_delay; ++ params->has_block_incremental = true; ++ params->block_incremental = s->parameters.block_incremental; ++ params->has_multifd_channels = true; ++ params->multifd_channels = s->parameters.multifd_channels; ++ params->has_multifd_compression = true; ++ params->multifd_compression = s->parameters.multifd_compression; ++ params->has_multifd_zlib_level = true; ++ params->multifd_zlib_level = s->parameters.multifd_zlib_level; ++ params->has_multifd_zstd_level = true; ++ params->multifd_zstd_level = s->parameters.multifd_zstd_level; ++ params->has_xbzrle_cache_size = true; ++ params->xbzrle_cache_size = s->parameters.xbzrle_cache_size; ++ params->has_max_postcopy_bandwidth = true; ++ params->max_postcopy_bandwidth = s->parameters.max_postcopy_bandwidth; ++ params->has_max_cpu_throttle = true; ++ params->max_cpu_throttle = s->parameters.max_cpu_throttle; ++ params->has_announce_initial = true; ++ params->announce_initial = s->parameters.announce_initial; ++ params->has_announce_max = true; ++ params->announce_max = s->parameters.announce_max; ++ params->has_announce_rounds = true; ++ params->announce_rounds = s->parameters.announce_rounds; ++ params->has_announce_step = true; ++ params->announce_step = s->parameters.announce_step; ++ ++ if (s->parameters.has_block_bitmap_mapping) { ++ params->has_block_bitmap_mapping = true; ++ params->block_bitmap_mapping = ++ QAPI_CLONE(BitmapMigrationNodeAliasList, ++ s->parameters.block_bitmap_mapping); ++ } ++ ++ return params; ++} +diff --git a/migration/options.h b/migration/options.h +index 093bc907a1..1b78fa9f3d 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -64,6 +64,7 @@ uint8_t migrate_cpu_throttle_initial(void); + bool migrate_cpu_throttle_tailslow(void); + int migrate_decompress_threads(void); + uint8_t migrate_max_cpu_throttle(void); ++uint64_t migrate_max_bandwidth(void); + int64_t migrate_max_postcopy_bandwidth(void); + int migrate_multifd_channels(void); + MultiFDCompression migrate_multifd_compression(void); +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_max_cpu_throttle.patch b/kvm-migration-Create-migrate_max_cpu_throttle.patch new file mode 100644 index 0000000..6628b80 --- /dev/null +++ b/kvm-migration-Create-migrate_max_cpu_throttle.patch @@ -0,0 +1,88 @@ +From f0d4e34b00f66d2336b755a34a1ba226571641c4 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 01:13:01 +0100 +Subject: [PATCH 42/56] migration: Create migrate_max_cpu_throttle() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [41/50] fc7537c06d8e1f53d7bb552661f6ddb0133a978d (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 24155bd0520035d5148c0af5b925932c4d8064a8) +Signed-off-by: Peter Xu +--- + migration/migration.h | 2 -- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 2 +- + 4 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.h b/migration/migration.h +index 86051af132..3ae938b19c 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -451,8 +451,6 @@ bool migrate_postcopy(void); + + int migrate_use_tls(void); + +-int migrate_max_cpu_throttle(void); +- + uint64_t ram_get_total_transferred_pages(void); + + /* Sending on the return path - generic and then for each message type */ +diff --git a/migration/options.c b/migration/options.c +index 0e102e5700..2cb04fbbd1 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -517,6 +517,15 @@ int migrate_decompress_threads(void) + return s->parameters.decompress_threads; + } + ++uint8_t migrate_max_cpu_throttle(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.max_cpu_throttle; ++} ++ + int64_t migrate_max_postcopy_bandwidth(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index adc2879bbb..72b1a320b7 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -51,6 +51,7 @@ int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); + int migrate_decompress_threads(void); ++uint8_t migrate_max_cpu_throttle(void); + int64_t migrate_max_postcopy_bandwidth(void); + int migrate_multifd_channels(void); + MultiFDCompression migrate_multifd_compression(void); +diff --git a/migration/ram.c b/migration/ram.c +index e82cee97c3..5c786513ef 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -715,7 +715,7 @@ static void mig_throttle_guest_down(uint64_t bytes_dirty_period, + uint64_t pct_initial = s->parameters.cpu_throttle_initial; + uint64_t pct_increment = s->parameters.cpu_throttle_increment; + bool pct_tailslow = s->parameters.cpu_throttle_tailslow; +- int pct_max = s->parameters.max_cpu_throttle; ++ int pct_max = migrate_max_cpu_throttle(); + + uint64_t throttle_now = cpu_throttle_get_percentage(); + uint64_t cpu_now, cpu_ideal, throttle_inc; +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_rdma_pin_all-function.patch b/kvm-migration-Create-migrate_rdma_pin_all-function.patch new file mode 100644 index 0000000..c7799f1 --- /dev/null +++ b/kvm-migration-Create-migrate_rdma_pin_all-function.patch @@ -0,0 +1,95 @@ +From e4ef0f2cee6cdf2cf4bd225ac9e610f41d66dfcb Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:41:55 +0100 +Subject: [PATCH 32/56] migration: Create migrate_rdma_pin_all() function +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [31/50] 206d96d47d9ee73ddc89dd01186560bf62ea5295 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy + +--- + +Fixed missing space after comma (fabiano) + +(cherry picked from commit 17cba690cdd42108369fafe6b07bff09872fbea6) +Signed-off-by: Peter Xu +--- + migration/options.c | 7 +++++++ + migration/options.h | 1 + + migration/rdma.c | 6 +++--- + 3 files changed, 11 insertions(+), 3 deletions(-) + +diff --git a/migration/options.c b/migration/options.c +index 2003e413da..9c9b8e5863 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -138,6 +138,13 @@ bool migrate_postcopy_ram(void) + return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; + } + ++bool migrate_rdma_pin_all(void) ++{ ++ MigrationState *s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL]; ++} ++ + bool migrate_release_ram(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 316efd1063..25c002b37a 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -30,6 +30,7 @@ bool migrate_pause_before_switchover(void); + bool migrate_postcopy_blocktime(void); + bool migrate_postcopy_preempt(void); + bool migrate_postcopy_ram(void); ++bool migrate_rdma_pin_all(void); + bool migrate_release_ram(void); + bool migrate_return_path(void); + bool migrate_validate_uuid(void); +diff --git a/migration/rdma.c b/migration/rdma.c +index bf55e2f163..0af5e944f0 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -35,6 +35,7 @@ + #include + #include "trace.h" + #include "qom/object.h" ++#include "options.h" + #include + + /* +@@ -4178,8 +4179,7 @@ void rdma_start_outgoing_migration(void *opaque, + goto err; + } + +- ret = qemu_rdma_source_init(rdma, +- s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); ++ ret = qemu_rdma_source_init(rdma, migrate_rdma_pin_all(), errp); + + if (ret) { + goto err; +@@ -4201,7 +4201,7 @@ void rdma_start_outgoing_migration(void *opaque, + } + + ret = qemu_rdma_source_init(rdma_return_path, +- s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); ++ migrate_rdma_pin_all(), errp); + + if (ret) { + goto return_path_err; +-- +2.39.1 + diff --git a/kvm-migration-Create-migrate_throttle_trigger_threshold.patch b/kvm-migration-Create-migrate_throttle_trigger_threshold.patch new file mode 100644 index 0000000..5fc1072 --- /dev/null +++ b/kvm-migration-Create-migrate_throttle_trigger_threshold.patch @@ -0,0 +1,75 @@ +From 27862b9d31da6447b60f185cdad95764018c6bc6 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 00:59:13 +0100 +Subject: [PATCH 40/56] migration: Create migrate_throttle_trigger_threshold() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [39/50] b8af9080c49be3d38bd2784d61289be89c03db3e (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit 6499efdb16e5c1288b4c8390d3bf68b313329b8b) +Signed-off-by: Peter Xu +--- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 3 +-- + 3 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/migration/options.c b/migration/options.c +index 2b6d88b4b9..b9f3815f7e 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -554,6 +554,15 @@ int migrate_multifd_zstd_level(void) + return s->parameters.multifd_zstd_level; + } + ++uint8_t migrate_throttle_trigger_threshold(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.throttle_trigger_threshold; ++} ++ + uint64_t migrate_xbzrle_cache_size(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 96d5a8e6e4..aa54443353 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -55,6 +55,7 @@ int migrate_multifd_channels(void); + MultiFDCompression migrate_multifd_compression(void); + int migrate_multifd_zlib_level(void); + int migrate_multifd_zstd_level(void); ++uint8_t migrate_throttle_trigger_threshold(void); + uint64_t migrate_xbzrle_cache_size(void); + + #endif +diff --git a/migration/ram.c b/migration/ram.c +index 4576d0d849..e82cee97c3 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1178,8 +1178,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time) + + static void migration_trigger_throttle(RAMState *rs) + { +- MigrationState *s = migrate_get_current(); +- uint64_t threshold = s->parameters.throttle_trigger_threshold; ++ uint64_t threshold = migrate_throttle_trigger_threshold(); + uint64_t bytes_xfer_period = + stat64_get(&ram_counters.transferred) - rs->bytes_xfer_prev; + uint64_t bytes_dirty_period = rs->num_dirty_pages_period * TARGET_PAGE_SIZE; +-- +2.39.1 + diff --git a/kvm-migration-Create-options.c.patch b/kvm-migration-Create-options.c.patch new file mode 100644 index 0000000..ea60202 --- /dev/null +++ b/kvm-migration-Create-options.c.patch @@ -0,0 +1,524 @@ +From 282634a835f4711c8b501dd76c344058bc399fbd Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 21:18:45 +0100 +Subject: [PATCH 23/56] migration: Create options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [22/50] 10c9be528b9fcfae93f1a12fcd09db1a69e58f64 (peterx/qemu-kvm) + +We move there all capabilities helpers from migration.c. + +Signed-off-by: Juan Quintela +Reviewed-by: Dr. David Alan Gilbert + +--- + +Following David advise: +- looked through the history, capabilities are newer than 2012, so we + can remove that bit of the header. +- This part is posterior to Anthony. + Original Author is Orit. Once there, + I put myself. Peter Xu also did quite a bit of work here. + Anyone else wants/needs to be there? I didn't search too hard + because nobody asked before to be added. + +What do you think? + +(cherry picked from commit 1f0776f1c03312aad5d6a5f98871240bc3af01e5) +Signed-off-by: Peter Xu +--- + hw/virtio/virtio-balloon.c | 1 + + migration/block-dirty-bitmap.c | 1 + + migration/block.c | 1 + + migration/colo.c | 1 + + migration/meson.build | 1 + + migration/migration.c | 109 +---------------------------- + migration/migration.h | 12 ---- + migration/options.c | 124 +++++++++++++++++++++++++++++++++ + migration/options.h | 32 +++++++++ + migration/postcopy-ram.c | 1 + + migration/ram.c | 1 + + migration/savevm.c | 1 + + migration/socket.c | 1 + + 13 files changed, 166 insertions(+), 120 deletions(-) + create mode 100644 migration/options.c + create mode 100644 migration/options.h + +diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c +index 746f07c4d2..43092aa634 100644 +--- a/hw/virtio/virtio-balloon.c ++++ b/hw/virtio/virtio-balloon.c +@@ -32,6 +32,7 @@ + #include "qemu/error-report.h" + #include "migration/misc.h" + #include "migration/migration.h" ++#include "migration/options.h" + + #include "hw/virtio/virtio-bus.h" + #include "hw/virtio/virtio-access.h" +diff --git a/migration/block-dirty-bitmap.c b/migration/block-dirty-bitmap.c +index fe73aa94b1..a6ffae0002 100644 +--- a/migration/block-dirty-bitmap.c ++++ b/migration/block-dirty-bitmap.c +@@ -79,6 +79,7 @@ + #include "qapi/qapi-visit-migration.h" + #include "qapi/clone-visitor.h" + #include "trace.h" ++#include "options.h" + + #define CHUNK_SIZE (1 << 10) + +diff --git a/migration/block.c b/migration/block.c +index b2497bbd32..4b167fa5cf 100644 +--- a/migration/block.c ++++ b/migration/block.c +@@ -28,6 +28,7 @@ + #include "migration/vmstate.h" + #include "sysemu/block-backend.h" + #include "trace.h" ++#include "options.h" + + #define BLK_MIG_BLOCK_SIZE (1ULL << 20) + #define BDRV_SECTORS_PER_DIRTY_CHUNK (BLK_MIG_BLOCK_SIZE >> BDRV_SECTOR_BITS) +diff --git a/migration/colo.c b/migration/colo.c +index 0716e64689..93b78c9270 100644 +--- a/migration/colo.c ++++ b/migration/colo.c +@@ -36,6 +36,7 @@ + #include "sysemu/cpus.h" + #include "sysemu/runstate.h" + #include "net/filter.h" ++#include "options.h" + + static bool vmstate_loading; + static Notifier packets_compare_notifier; +diff --git a/migration/meson.build b/migration/meson.build +index 0d1bb9f96e..480ff6854a 100644 +--- a/migration/meson.build ++++ b/migration/meson.build +@@ -22,6 +22,7 @@ softmmu_ss.add(files( + 'migration.c', + 'multifd.c', + 'multifd-zlib.c', ++ 'options.c', + 'postcopy-ram.c', + 'savevm.c', + 'socket.c', +diff --git a/migration/migration.c b/migration/migration.c +index 18058fb597..66ea55be06 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -63,6 +63,7 @@ + #include "sysemu/cpus.h" + #include "yank_functions.h" + #include "sysemu/qtest.h" ++#include "options.h" + + #define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling */ + +@@ -357,15 +358,6 @@ static void migrate_generate_event(int new_state) + } + } + +-static bool migrate_late_block_activate(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; +-} +- + /* + * Send a message on the return channel back to the source + * of the migration. +@@ -2525,56 +2517,11 @@ void qmp_migrate_continue(MigrationStatus state, Error **errp) + qemu_sem_post(&s->pause_sem); + } + +-bool migrate_release_ram(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; +-} +- +-bool migrate_postcopy_ram(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; +-} +- + bool migrate_postcopy(void) + { + return migrate_postcopy_ram() || migrate_dirty_bitmaps(); + } + +-bool migrate_auto_converge(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE]; +-} +- +-bool migrate_zero_blocks(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; +-} +- +-bool migrate_postcopy_blocktime(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; +-} +- + bool migrate_use_compression(void) + { + MigrationState *s; +@@ -2620,33 +2567,6 @@ int migrate_decompress_threads(void) + return s->parameters.decompress_threads; + } + +-bool migrate_dirty_bitmaps(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; +-} +- +-bool migrate_ignore_shared(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED]; +-} +- +-bool migrate_validate_uuid(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; +-} +- + bool migrate_use_events(void) + { + MigrationState *s; +@@ -2665,15 +2585,6 @@ bool migrate_use_multifd(void) + return s->capabilities[MIGRATION_CAPABILITY_MULTIFD]; + } + +-bool migrate_pause_before_switchover(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER]; +-} +- + int migrate_multifd_channels(void) + { + MigrationState *s; +@@ -2785,24 +2696,6 @@ bool migrate_use_block_incremental(void) + return s->parameters.block_incremental; + } + +-bool migrate_background_snapshot(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; +-} +- +-bool migrate_postcopy_preempt(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]; +-} +- + /* migration thread support */ + /* + * Something bad happened to the RP stream, mark an error +diff --git a/migration/migration.h b/migration/migration.h +index 04e0860b4e..a25fed6ef0 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -449,16 +449,7 @@ MigrationState *migrate_get_current(void); + + bool migrate_postcopy(void); + +-bool migrate_release_ram(void); +-bool migrate_postcopy_ram(void); +-bool migrate_zero_blocks(void); +-bool migrate_dirty_bitmaps(void); +-bool migrate_ignore_shared(void); +-bool migrate_validate_uuid(void); +- +-bool migrate_auto_converge(void); + bool migrate_use_multifd(void); +-bool migrate_pause_before_switchover(void); + int migrate_multifd_channels(void); + MultiFDCompression migrate_multifd_compression(void); + int migrate_multifd_zlib_level(void); +@@ -487,9 +478,6 @@ int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); + int migrate_decompress_threads(void); + bool migrate_use_events(void); +-bool migrate_postcopy_blocktime(void); +-bool migrate_background_snapshot(void); +-bool migrate_postcopy_preempt(void); + + /* Sending on the return path - generic and then for each message type */ + void migrate_send_rp_shut(MigrationIncomingState *mis, +diff --git a/migration/options.c b/migration/options.c +new file mode 100644 +index 0000000000..88a9a45913 +--- /dev/null ++++ b/migration/options.c +@@ -0,0 +1,124 @@ ++/* ++ * QEMU migration capabilities ++ * ++ * Copyright (c) 2012-2023 Red Hat Inc ++ * ++ * Authors: ++ * Orit Wasserman ++ * Juan Quintela ++ * ++ * This work is licensed under the terms of the GNU GPL, version 2 or later. ++ * See the COPYING file in the top-level directory. ++ */ ++ ++#include "qemu/osdep.h" ++#include "migration.h" ++#include "options.h" ++ ++bool migrate_auto_converge(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE]; ++} ++ ++bool migrate_background_snapshot(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; ++} ++ ++bool migrate_dirty_bitmaps(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; ++} ++ ++bool migrate_ignore_shared(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED]; ++} ++ ++bool migrate_late_block_activate(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; ++} ++ ++bool migrate_pause_before_switchover(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER]; ++} ++ ++bool migrate_postcopy_blocktime(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; ++} ++ ++bool migrate_postcopy_preempt(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]; ++} ++ ++bool migrate_postcopy_ram(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; ++} ++ ++bool migrate_release_ram(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; ++} ++ ++bool migrate_validate_uuid(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; ++} ++ ++bool migrate_zero_blocks(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; ++} +diff --git a/migration/options.h b/migration/options.h +new file mode 100644 +index 0000000000..0dfa0af245 +--- /dev/null ++++ b/migration/options.h +@@ -0,0 +1,32 @@ ++/* ++ * QEMU migration capabilities ++ * ++ * Copyright (c) 2012-2023 Red Hat Inc ++ * ++ * Authors: ++ * Orit Wasserman ++ * Juan Quintela ++ * ++ * This work is licensed under the terms of the GNU GPL, version 2 or later. ++ * See the COPYING file in the top-level directory. ++ */ ++ ++#ifndef QEMU_MIGRATION_OPTIONS_H ++#define QEMU_MIGRATION_OPTIONS_H ++ ++/* capabilities */ ++ ++bool migrate_auto_converge(void); ++bool migrate_background_snapshot(void); ++bool migrate_dirty_bitmaps(void); ++bool migrate_ignore_shared(void); ++bool migrate_late_block_activate(void); ++bool migrate_pause_before_switchover(void); ++bool migrate_postcopy_blocktime(void); ++bool migrate_postcopy_preempt(void); ++bool migrate_postcopy_ram(void); ++bool migrate_release_ram(void); ++bool migrate_validate_uuid(void); ++bool migrate_zero_blocks(void); ++ ++#endif +diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c +index d7b48dd920..0711500036 100644 +--- a/migration/postcopy-ram.c ++++ b/migration/postcopy-ram.c +@@ -37,6 +37,7 @@ + #include "tls.h" + #include "qemu/userfaultfd.h" + #include "qemu/mmap-alloc.h" ++#include "options.h" + + /* Arbitrary limit on size of each discard command, + * keeps them around ~200 bytes +diff --git a/migration/ram.c b/migration/ram.c +index 229714045a..912ccd89fa 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -57,6 +57,7 @@ + #include "qemu/iov.h" + #include "multifd.h" + #include "sysemu/runstate.h" ++#include "options.h" + + #include "hw/boards.h" /* for machine_dump_guest_core() */ + +diff --git a/migration/savevm.c b/migration/savevm.c +index 589ef926ab..ebcf571e37 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -67,6 +67,7 @@ + #include "qemu/yank.h" + #include "yank_functions.h" + #include "sysemu/qtest.h" ++#include "options.h" + + const unsigned int postcopy_ram_discard_version; + +diff --git a/migration/socket.c b/migration/socket.c +index e6fdf3c5e1..ebf9ac41af 100644 +--- a/migration/socket.c ++++ b/migration/socket.c +@@ -27,6 +27,7 @@ + #include "io/net-listener.h" + #include "trace.h" + #include "postcopy-ram.h" ++#include "options.h" + + struct SocketOutgoingArgs { + SocketAddress *saddr; +-- +2.39.1 + diff --git a/kvm-migration-Handle-block-device-inactivation-failures-.patch b/kvm-migration-Handle-block-device-inactivation-failures-.patch new file mode 100644 index 0000000..26c8437 --- /dev/null +++ b/kvm-migration-Handle-block-device-inactivation-failures-.patch @@ -0,0 +1,116 @@ +From 2aac64623d8d2d06d248c1bcc71aa13572fc843c Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 14 Apr 2023 10:33:58 -0500 +Subject: [PATCH 1/2] migration: Handle block device inactivation failures + better + +RH-Author: Eric Blake +RH-MergeRequest: 161: Avoid migration assertion from failed NFS server. +RH-Bugzilla: 2058982 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [1/2] 5ae143c9234f6eee9fc5154944172bcd56975b36 (ebblake/centos-qemu-kvm) + +Consider what happens when performing a migration between two host +machines connected to an NFS server serving multiple block devices to +the guest, when the NFS server becomes unavailable. The migration +attempts to inactivate all block devices on the source (a necessary +step before the destination can take over); but if the NFS server is +non-responsive, the attempt to inactivate can itself fail. When that +happens, the destination fails to get the migrated guest (good, +because the source wasn't able to flush everything properly): + + (qemu) qemu-kvm: load of migration failed: Input/output error + +at which point, our only hope for the guest is for the source to take +back control. With the current code base, the host outputs a message, but then appears to resume: + + (qemu) qemu-kvm: qemu_savevm_state_complete_precopy_non_iterable: bdrv_inactivate_all() failed (-1) + + (src qemu)info status + VM status: running + +but a second migration attempt now asserts: + + (src qemu) qemu-kvm: ../block.c:6738: int bdrv_inactivate_recurse(BlockDriverState *): Assertion `!(bs->open_flags & BDRV_O_INACTIVE)' failed. + +Whether the guest is recoverable on the source after the first failure +is debatable, but what we do not want is to have qemu itself fail due +to an assertion. It looks like the problem is as follows: + +In migration.c:migration_completion(), the source sets 'inactivate' to +true (since COLO is not enabled), then tries +savevm.c:qemu_savevm_state_complete_precopy() with a request to +inactivate block devices. In turn, this calls +block.c:bdrv_inactivate_all(), which fails when flushing runs up +against the non-responsive NFS server. With savevm failing, we are +now left in a state where some, but not all, of the block devices have +been inactivated; but migration_completion() then jumps to 'fail' +rather than 'fail_invalidate' and skips an attempt to reclaim those +those disks by calling bdrv_activate_all(). Even if we do attempt to +reclaim disks, we aren't taking note of failure there, either. + +Thus, we have reached a state where the migration engine has forgotten +all state about whether a block device is inactive, because we did not +set s->block_inactive in enough places; so migration allows the source +to reach vm_start() and resume execution, violating the block layer +invariant that the guest CPUs should not be restarted while a device +is inactive. Note that the code in migration.c:migrate_fd_cancel() +will also try to reactivate all block devices if s->block_inactive was +set, but because we failed to set that flag after the first failure, +the source assumes it has reclaimed all devices, even though it still +has remaining inactivated devices and does not try again. Normally, +qmp_cont() will also try to reactivate all disks (or correctly fail if +the disks are not reclaimable because NFS is not yet back up), but the +auto-resumption of the source after a migration failure does not go +through qmp_cont(). And because we have left the block layer in an +inconsistent state with devices still inactivated, the later migration +attempt is hitting the assertion failure. + +Since it is important to not resume the source with inactive disks, +this patch marks s->block_inactive before attempting inactivation, +rather than after succeeding, in order to prevent any vm_start() until +it has successfully reactivated all devices. + +See also https://bugzilla.redhat.com/show_bug.cgi?id=2058982 + +Signed-off-by: Eric Blake +Reviewed-by: Juan Quintela +Acked-by: Lukas Straub +Tested-by: Lukas Straub +Signed-off-by: Juan Quintela +(cherry picked from commit 403d18ae384239876764bbfa111d6cc5dcb673d1) +--- + migration/migration.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index bda4789193..cb0d42c061 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3444,13 +3444,11 @@ static void migration_completion(MigrationState *s) + MIGRATION_STATUS_DEVICE); + } + if (ret >= 0) { ++ s->block_inactive = inactivate; + qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false, + inactivate); + } +- if (inactivate && ret >= 0) { +- s->block_inactive = true; +- } + } + qemu_mutex_unlock_iothread(); + +@@ -3522,6 +3520,7 @@ fail_invalidate: + bdrv_activate_all(&local_err); + if (local_err) { + error_report_err(local_err); ++ s->block_inactive = true; + } else { + s->block_inactive = false; + } +-- +2.39.1 + diff --git a/kvm-migration-Make-dirty_sync_count-atomic.patch b/kvm-migration-Make-dirty_sync_count-atomic.patch new file mode 100644 index 0000000..ad1de7b --- /dev/null +++ b/kvm-migration-Make-dirty_sync_count-atomic.patch @@ -0,0 +1,105 @@ +From 886b511e0a225b1c4428c646534d7bcc65bd9e2a Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 11 Apr 2023 18:02:34 +0200 +Subject: [PATCH 14/56] migration: Make dirty_sync_count atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [13/50] ef3ae8cdd960e944ba9e73a53d54c9a5a55bb1ce (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 536b5a4e56ec67c958f46e7d46cbd5ac34e5a239) +Signed-off-by: Peter Xu +--- + migration/migration.c | 3 ++- + migration/ram.c | 13 +++++++------ + migration/ram.h | 2 +- + 3 files changed, 10 insertions(+), 8 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 8f2847d298..8fca751050 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1148,7 +1148,8 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->normal = stat64_get(&ram_counters.normal); + info->ram->normal_bytes = info->ram->normal * page_size; + info->ram->mbps = s->mbps; +- info->ram->dirty_sync_count = ram_counters.dirty_sync_count; ++ info->ram->dirty_sync_count = ++ stat64_get(&ram_counters.dirty_sync_count); + info->ram->dirty_sync_missed_zero_copy = + stat64_get(&ram_counters.dirty_sync_missed_zero_copy); + info->ram->postcopy_requests = ram_counters.postcopy_requests; +diff --git a/migration/ram.c b/migration/ram.c +index b1722b6071..3c13136559 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -764,7 +764,7 @@ static void xbzrle_cache_zero_page(RAMState *rs, ram_addr_t current_addr) + /* We don't care if this fails to allocate a new cache page + * as long as it updated an old one */ + cache_insert(XBZRLE.cache, current_addr, XBZRLE.zero_target_page, +- ram_counters.dirty_sync_count); ++ stat64_get(&ram_counters.dirty_sync_count)); + } + + #define ENCODING_FLAG_XBZRLE 0x1 +@@ -790,13 +790,13 @@ static int save_xbzrle_page(RAMState *rs, PageSearchStatus *pss, + int encoded_len = 0, bytes_xbzrle; + uint8_t *prev_cached_page; + QEMUFile *file = pss->pss_channel; ++ uint64_t generation = stat64_get(&ram_counters.dirty_sync_count); + +- if (!cache_is_cached(XBZRLE.cache, current_addr, +- ram_counters.dirty_sync_count)) { ++ if (!cache_is_cached(XBZRLE.cache, current_addr, generation)) { + xbzrle_counters.cache_miss++; + if (!rs->last_stage) { + if (cache_insert(XBZRLE.cache, current_addr, *current_data, +- ram_counters.dirty_sync_count) == -1) { ++ generation) == -1) { + return -1; + } else { + /* update *current_data when the page has been +@@ -1209,7 +1209,7 @@ static void migration_bitmap_sync(RAMState *rs) + RAMBlock *block; + int64_t end_time; + +- ram_counters.dirty_sync_count++; ++ stat64_add(&ram_counters.dirty_sync_count, 1); + + if (!rs->time_last_bitmap_sync) { + rs->time_last_bitmap_sync = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); +@@ -1246,7 +1246,8 @@ static void migration_bitmap_sync(RAMState *rs) + rs->bytes_xfer_prev = stat64_get(&ram_counters.transferred); + } + if (migrate_use_events()) { +- qapi_event_send_migration_pass(ram_counters.dirty_sync_count); ++ uint64_t generation = stat64_get(&ram_counters.dirty_sync_count); ++ qapi_event_send_migration_pass(generation); + } + } + +diff --git a/migration/ram.h b/migration/ram.h +index bb52632424..8c0d07c43a 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -42,7 +42,7 @@ + */ + typedef struct { + int64_t dirty_pages_rate; +- int64_t dirty_sync_count; ++ Stat64 dirty_sync_count; + Stat64 dirty_sync_missed_zero_copy; + Stat64 downtime_bytes; + Stat64 duplicate; +-- +2.39.1 + diff --git a/kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch b/kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch new file mode 100644 index 0000000..b7b0f60 --- /dev/null +++ b/kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch @@ -0,0 +1,92 @@ +From e9ff20d7f7e6c2354f3696e8bca265e535eeb801 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 11 Apr 2023 17:33:56 +0200 +Subject: [PATCH 11/56] migration: Make dirty_sync_missed_zero_copy atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [10/50] 041230abb087db0e7ffae02b4f85772490b805a0 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 4291823694fd8507831d26e2558d9cd0030841f7) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + migration/multifd.c | 2 +- + migration/ram.c | 5 ----- + migration/ram.h | 4 +--- + 4 files changed, 3 insertions(+), 10 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index ca68808b5c..645fb4b3c5 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1150,7 +1150,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->mbps = s->mbps; + info->ram->dirty_sync_count = ram_counters.dirty_sync_count; + info->ram->dirty_sync_missed_zero_copy = +- ram_counters.dirty_sync_missed_zero_copy; ++ stat64_get(&ram_counters.dirty_sync_missed_zero_copy); + info->ram->postcopy_requests = ram_counters.postcopy_requests; + info->ram->page_size = page_size; + info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes); +diff --git a/migration/multifd.c b/migration/multifd.c +index 1c992abf53..903df2117b 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -576,7 +576,7 @@ static int multifd_zero_copy_flush(QIOChannel *c) + return -1; + } + if (ret == 1) { +- dirty_sync_missed_zero_copy(); ++ stat64_add(&ram_counters.dirty_sync_missed_zero_copy, 1); + } + + return ret; +diff --git a/migration/ram.c b/migration/ram.c +index 71320ed27a..93e0a48af4 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -472,11 +472,6 @@ void ram_transferred_add(uint64_t bytes) + stat64_add(&ram_counters.transferred, bytes); + } + +-void dirty_sync_missed_zero_copy(void) +-{ +- ram_counters.dirty_sync_missed_zero_copy++; +-} +- + struct MigrationOps { + int (*ram_save_target_page)(RAMState *rs, PageSearchStatus *pss); + }; +diff --git a/migration/ram.h b/migration/ram.h +index ed70391317..2170c55e67 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -43,7 +43,7 @@ + typedef struct { + int64_t dirty_pages_rate; + int64_t dirty_sync_count; +- uint64_t dirty_sync_missed_zero_copy; ++ Stat64 dirty_sync_missed_zero_copy; + uint64_t downtime_bytes; + Stat64 duplicate; + Stat64 multifd_bytes; +@@ -114,6 +114,4 @@ void ram_write_tracking_prepare(void); + int ram_write_tracking_start(void); + void ram_write_tracking_stop(void); + +-void dirty_sync_missed_zero_copy(void); +- + #endif +-- +2.39.1 + diff --git a/kvm-migration-Make-downtime_bytes-atomic.patch b/kvm-migration-Make-downtime_bytes-atomic.patch new file mode 100644 index 0000000..9b206bc --- /dev/null +++ b/kvm-migration-Make-downtime_bytes-atomic.patch @@ -0,0 +1,68 @@ +From 4c6af064277b5445b31db4a598e1c4402ba56452 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 11 Apr 2023 17:38:11 +0200 +Subject: [PATCH 13/56] migration: Make downtime_bytes atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [12/50] ebfc16aae8bc4a8c1fec431780a062950e6f50c4 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 296a4ac2aa63038b6b702f2ee8f0f93ae26727ae) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + migration/ram.c | 2 +- + migration/ram.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 3a68d93d69..8f2847d298 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1156,7 +1156,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes); + info->ram->pages_per_second = s->pages_per_second; + info->ram->precopy_bytes = stat64_get(&ram_counters.precopy_bytes); +- info->ram->downtime_bytes = ram_counters.downtime_bytes; ++ info->ram->downtime_bytes = stat64_get(&ram_counters.downtime_bytes); + info->ram->postcopy_bytes = stat64_get(&ram_counters.postcopy_bytes); + + if (migrate_use_xbzrle()) { +diff --git a/migration/ram.c b/migration/ram.c +index 0b4693215e..b1722b6071 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -467,7 +467,7 @@ void ram_transferred_add(uint64_t bytes) + } else if (migration_in_postcopy()) { + stat64_add(&ram_counters.postcopy_bytes, bytes); + } else { +- ram_counters.downtime_bytes += bytes; ++ stat64_add(&ram_counters.downtime_bytes, bytes); + } + stat64_add(&ram_counters.transferred, bytes); + } +diff --git a/migration/ram.h b/migration/ram.h +index a766b895fa..bb52632424 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -44,7 +44,7 @@ typedef struct { + int64_t dirty_pages_rate; + int64_t dirty_sync_count; + Stat64 dirty_sync_missed_zero_copy; +- uint64_t downtime_bytes; ++ Stat64 downtime_bytes; + Stat64 duplicate; + Stat64 multifd_bytes; + Stat64 normal; +-- +2.39.1 + diff --git a/kvm-migration-Make-multifd_bytes-atomic.patch b/kvm-migration-Make-multifd_bytes-atomic.patch new file mode 100644 index 0000000..b315fdc --- /dev/null +++ b/kvm-migration-Make-multifd_bytes-atomic.patch @@ -0,0 +1,99 @@ +From bfcc4bc8f60b541d545f1ea27b1ff156d8092d33 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 23 Nov 2022 20:36:56 +0100 +Subject: [PATCH 10/56] migration: Make multifd_bytes atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [9/50] c2bc6b173770a0ea81c3f9d850c583c651647070 (peterx/qemu-kvm) + +In the spirit of: + +commit 394d323bc3451e4d07f13341cb8817fac8dfbadd +Author: Peter Xu +Date: Tue Oct 11 17:55:51 2022 -0400 + + migration: Use atomic ops properly for page accountings + +Reviewed-by: David Edmondson +Reviewed-by: Peter Xu +Signed-off-by: Juan Quintela +(cherry picked from commit cf671116facf4e29d91fce9c9ffb535385ffac81) +Signed-off-by: Peter Xu +--- + migration/migration.c | 4 ++-- + migration/multifd.c | 4 ++-- + migration/ram.h | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index a91704d35c..ca68808b5c 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1153,7 +1153,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + ram_counters.dirty_sync_missed_zero_copy; + info->ram->postcopy_requests = ram_counters.postcopy_requests; + info->ram->page_size = page_size; +- info->ram->multifd_bytes = ram_counters.multifd_bytes; ++ info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes); + info->ram->pages_per_second = s->pages_per_second; + info->ram->precopy_bytes = ram_counters.precopy_bytes; + info->ram->downtime_bytes = ram_counters.downtime_bytes; +@@ -3780,7 +3780,7 @@ static MigThrError migration_detect_error(MigrationState *s) + static uint64_t migration_total_bytes(MigrationState *s) + { + return qemu_file_total_transferred(s->to_dst_file) + +- ram_counters.multifd_bytes; ++ stat64_get(&ram_counters.multifd_bytes); + } + + static void migration_calculate_complete(MigrationState *s) +diff --git a/migration/multifd.c b/migration/multifd.c +index 6ef3a27938..1c992abf53 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -432,9 +432,9 @@ static int multifd_send_pages(QEMUFile *f) + p->pages = pages; + transferred = ((uint64_t) pages->num) * p->page_size + p->packet_len; + qemu_file_acct_rate_limit(f, transferred); +- ram_counters.multifd_bytes += transferred; + qemu_mutex_unlock(&p->mutex); + stat64_add(&ram_counters.transferred, transferred); ++ stat64_add(&ram_counters.multifd_bytes, transferred); + qemu_sem_post(&p->sem); + + return 1; +@@ -627,9 +627,9 @@ int multifd_send_sync_main(QEMUFile *f) + p->flags |= MULTIFD_FLAG_SYNC; + p->pending_job++; + qemu_file_acct_rate_limit(f, p->packet_len); +- ram_counters.multifd_bytes += p->packet_len; + qemu_mutex_unlock(&p->mutex); + stat64_add(&ram_counters.transferred, p->packet_len); ++ stat64_add(&ram_counters.multifd_bytes, p->packet_len); + qemu_sem_post(&p->sem); + } + for (i = 0; i < migrate_multifd_channels(); i++) { +diff --git a/migration/ram.h b/migration/ram.h +index 7c026b5242..ed70391317 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -46,7 +46,7 @@ typedef struct { + uint64_t dirty_sync_missed_zero_copy; + uint64_t downtime_bytes; + Stat64 duplicate; +- uint64_t multifd_bytes; ++ Stat64 multifd_bytes; + Stat64 normal; + Stat64 postcopy_bytes; + int64_t postcopy_requests; +-- +2.39.1 + diff --git a/kvm-migration-Make-postcopy_requests-atomic.patch b/kvm-migration-Make-postcopy_requests-atomic.patch new file mode 100644 index 0000000..894419a --- /dev/null +++ b/kvm-migration-Make-postcopy_requests-atomic.patch @@ -0,0 +1,69 @@ +From e6ff4536a5e5f5bbfda370ecb525d0e066c3ab1c Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 11 Apr 2023 18:04:59 +0200 +Subject: [PATCH 15/56] migration: Make postcopy_requests atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [14/50] d15c6052b77e7ded7bf34c66caa11bf86b75f2e8 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 3c764f9b2bc3e5eb5ed93ab45c2de6d599fef00f) +Signed-off-by: Peter Xu +--- + migration/migration.c | 3 ++- + migration/ram.c | 2 +- + migration/ram.h | 2 +- + 3 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 8fca751050..39501a0ed8 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1152,7 +1152,8 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + stat64_get(&ram_counters.dirty_sync_count); + info->ram->dirty_sync_missed_zero_copy = + stat64_get(&ram_counters.dirty_sync_missed_zero_copy); +- info->ram->postcopy_requests = ram_counters.postcopy_requests; ++ info->ram->postcopy_requests = ++ stat64_get(&ram_counters.postcopy_requests); + info->ram->page_size = page_size; + info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes); + info->ram->pages_per_second = s->pages_per_second; +diff --git a/migration/ram.c b/migration/ram.c +index 3c13136559..fe69ecaef4 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -2169,7 +2169,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) + RAMBlock *ramblock; + RAMState *rs = ram_state; + +- ram_counters.postcopy_requests++; ++ stat64_add(&ram_counters.postcopy_requests, 1); + RCU_READ_LOCK_GUARD(); + + if (!rbname) { +diff --git a/migration/ram.h b/migration/ram.h +index 8c0d07c43a..afa68521d7 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -49,7 +49,7 @@ typedef struct { + Stat64 multifd_bytes; + Stat64 normal; + Stat64 postcopy_bytes; +- int64_t postcopy_requests; ++ Stat64 postcopy_requests; + Stat64 precopy_bytes; + int64_t remaining; + Stat64 transferred; +-- +2.39.1 + diff --git a/kvm-migration-Make-precopy_bytes-atomic.patch b/kvm-migration-Make-precopy_bytes-atomic.patch new file mode 100644 index 0000000..8e6c177 --- /dev/null +++ b/kvm-migration-Make-precopy_bytes-atomic.patch @@ -0,0 +1,68 @@ +From 7e4d4316855f7f6556364eb16828f925b61c80d4 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 11 Apr 2023 17:36:48 +0200 +Subject: [PATCH 12/56] migration: Make precopy_bytes atomic +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [11/50] 23bec49b4b8f4d23c2192b401416139e3ca13626 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit b013b5d1f32ef88457e66c7ce576f6475238f97f) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + migration/ram.c | 2 +- + migration/ram.h | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 645fb4b3c5..3a68d93d69 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1155,7 +1155,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->page_size = page_size; + info->ram->multifd_bytes = stat64_get(&ram_counters.multifd_bytes); + info->ram->pages_per_second = s->pages_per_second; +- info->ram->precopy_bytes = ram_counters.precopy_bytes; ++ info->ram->precopy_bytes = stat64_get(&ram_counters.precopy_bytes); + info->ram->downtime_bytes = ram_counters.downtime_bytes; + info->ram->postcopy_bytes = stat64_get(&ram_counters.postcopy_bytes); + +diff --git a/migration/ram.c b/migration/ram.c +index 93e0a48af4..0b4693215e 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -463,7 +463,7 @@ RAMStats ram_counters; + void ram_transferred_add(uint64_t bytes) + { + if (runstate_is_running()) { +- ram_counters.precopy_bytes += bytes; ++ stat64_add(&ram_counters.precopy_bytes, bytes); + } else if (migration_in_postcopy()) { + stat64_add(&ram_counters.postcopy_bytes, bytes); + } else { +diff --git a/migration/ram.h b/migration/ram.h +index 2170c55e67..a766b895fa 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -50,7 +50,7 @@ typedef struct { + Stat64 normal; + Stat64 postcopy_bytes; + int64_t postcopy_requests; +- uint64_t precopy_bytes; ++ Stat64 precopy_bytes; + int64_t remaining; + Stat64 transferred; + } RAMStats; +-- +2.39.1 + diff --git a/kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch b/kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch new file mode 100644 index 0000000..0679e89 --- /dev/null +++ b/kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch @@ -0,0 +1,270 @@ +From 5a87058eea6ee56f37fb454486c35baaf693d691 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 22 Feb 2023 15:56:45 +0100 +Subject: [PATCH 08/56] migration: Merge ram_counters and ram_atomic_counters +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [7/50] 90e395de66aa32b886cf151f7996a680190471f5 (peterx/qemu-kvm) + +Using MgrationStats as type for ram_counters mean that we didn't have +to re-declare each value in another struct. The need of atomic +counters have make us to create MigrationAtomicStats for this atomic +counters. + +Create RAMStats type which is a merge of MigrationStats and +MigrationAtomicStats removing unused members. + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu + +--- + +Fix typos found by David Edmondson + +(cherry picked from commit abce5fa16d126ed085ccf8a5b3fe61a1efa20994) +Signed-off-by: Peter Xu +--- + migration/migration.c | 8 ++++---- + migration/multifd.c | 4 ++-- + migration/ram.c | 39 ++++++++++++++++----------------------- + migration/ram.h | 28 +++++++++++++++------------- + 4 files changed, 37 insertions(+), 42 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 99f86bd6c2..a91704d35c 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1140,12 +1140,12 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + size_t page_size = qemu_target_page_size(); + + info->ram = g_malloc0(sizeof(*info->ram)); +- info->ram->transferred = stat64_get(&ram_atomic_counters.transferred); ++ info->ram->transferred = stat64_get(&ram_counters.transferred); + info->ram->total = ram_bytes_total(); +- info->ram->duplicate = stat64_get(&ram_atomic_counters.duplicate); ++ info->ram->duplicate = stat64_get(&ram_counters.duplicate); + /* legacy value. It is not used anymore */ + info->ram->skipped = 0; +- info->ram->normal = stat64_get(&ram_atomic_counters.normal); ++ info->ram->normal = stat64_get(&ram_counters.normal); + info->ram->normal_bytes = info->ram->normal * page_size; + info->ram->mbps = s->mbps; + info->ram->dirty_sync_count = ram_counters.dirty_sync_count; +@@ -1157,7 +1157,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->pages_per_second = s->pages_per_second; + info->ram->precopy_bytes = ram_counters.precopy_bytes; + info->ram->downtime_bytes = ram_counters.downtime_bytes; +- info->ram->postcopy_bytes = stat64_get(&ram_atomic_counters.postcopy_bytes); ++ info->ram->postcopy_bytes = stat64_get(&ram_counters.postcopy_bytes); + + if (migrate_use_xbzrle()) { + info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache)); +diff --git a/migration/multifd.c b/migration/multifd.c +index cbc0dfe39b..01fab01a92 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -433,7 +433,7 @@ static int multifd_send_pages(QEMUFile *f) + transferred = ((uint64_t) pages->num) * p->page_size + p->packet_len; + qemu_file_acct_rate_limit(f, transferred); + ram_counters.multifd_bytes += transferred; +- stat64_add(&ram_atomic_counters.transferred, transferred); ++ stat64_add(&ram_counters.transferred, transferred); + qemu_mutex_unlock(&p->mutex); + qemu_sem_post(&p->sem); + +@@ -628,7 +628,7 @@ int multifd_send_sync_main(QEMUFile *f) + p->pending_job++; + qemu_file_acct_rate_limit(f, p->packet_len); + ram_counters.multifd_bytes += p->packet_len; +- stat64_add(&ram_atomic_counters.transferred, p->packet_len); ++ stat64_add(&ram_counters.transferred, p->packet_len); + qemu_mutex_unlock(&p->mutex); + qemu_sem_post(&p->sem); + } +diff --git a/migration/ram.c b/migration/ram.c +index 0e68099bf9..71320ed27a 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -458,25 +458,18 @@ uint64_t ram_bytes_remaining(void) + 0; + } + +-/* +- * NOTE: not all stats in ram_counters are used in reality. See comments +- * for struct MigrationAtomicStats. The ultimate result of ram migration +- * counters will be a merged version with both ram_counters and the atomic +- * fields in ram_atomic_counters. +- */ +-MigrationStats ram_counters; +-MigrationAtomicStats ram_atomic_counters; ++RAMStats ram_counters; + + void ram_transferred_add(uint64_t bytes) + { + if (runstate_is_running()) { + ram_counters.precopy_bytes += bytes; + } else if (migration_in_postcopy()) { +- stat64_add(&ram_atomic_counters.postcopy_bytes, bytes); ++ stat64_add(&ram_counters.postcopy_bytes, bytes); + } else { + ram_counters.downtime_bytes += bytes; + } +- stat64_add(&ram_atomic_counters.transferred, bytes); ++ stat64_add(&ram_counters.transferred, bytes); + } + + void dirty_sync_missed_zero_copy(void) +@@ -756,7 +749,7 @@ void mig_throttle_counter_reset(void) + + rs->time_last_bitmap_sync = qemu_clock_get_ms(QEMU_CLOCK_REALTIME); + rs->num_dirty_pages_period = 0; +- rs->bytes_xfer_prev = stat64_get(&ram_atomic_counters.transferred); ++ rs->bytes_xfer_prev = stat64_get(&ram_counters.transferred); + } + + /** +@@ -1130,8 +1123,8 @@ uint64_t ram_pagesize_summary(void) + + uint64_t ram_get_total_transferred_pages(void) + { +- return stat64_get(&ram_atomic_counters.normal) + +- stat64_get(&ram_atomic_counters.duplicate) + ++ return stat64_get(&ram_counters.normal) + ++ stat64_get(&ram_counters.duplicate) + + compression_counters.pages + xbzrle_counters.pages; + } + +@@ -1192,7 +1185,7 @@ static void migration_trigger_throttle(RAMState *rs) + MigrationState *s = migrate_get_current(); + uint64_t threshold = s->parameters.throttle_trigger_threshold; + uint64_t bytes_xfer_period = +- stat64_get(&ram_atomic_counters.transferred) - rs->bytes_xfer_prev; ++ stat64_get(&ram_counters.transferred) - rs->bytes_xfer_prev; + uint64_t bytes_dirty_period = rs->num_dirty_pages_period * TARGET_PAGE_SIZE; + uint64_t bytes_dirty_threshold = bytes_xfer_period * threshold / 100; + +@@ -1255,7 +1248,7 @@ static void migration_bitmap_sync(RAMState *rs) + /* reset period counters */ + rs->time_last_bitmap_sync = end_time; + rs->num_dirty_pages_period = 0; +- rs->bytes_xfer_prev = stat64_get(&ram_atomic_counters.transferred); ++ rs->bytes_xfer_prev = stat64_get(&ram_counters.transferred); + } + if (migrate_use_events()) { + qapi_event_send_migration_pass(ram_counters.dirty_sync_count); +@@ -1331,7 +1324,7 @@ static int save_zero_page(PageSearchStatus *pss, QEMUFile *f, RAMBlock *block, + int len = save_zero_page_to_file(pss, f, block, offset); + + if (len) { +- stat64_add(&ram_atomic_counters.duplicate, 1); ++ stat64_add(&ram_counters.duplicate, 1); + ram_transferred_add(len); + return 1; + } +@@ -1368,9 +1361,9 @@ static bool control_save_page(PageSearchStatus *pss, RAMBlock *block, + } + + if (bytes_xmit > 0) { +- stat64_add(&ram_atomic_counters.normal, 1); ++ stat64_add(&ram_counters.normal, 1); + } else if (bytes_xmit == 0) { +- stat64_add(&ram_atomic_counters.duplicate, 1); ++ stat64_add(&ram_counters.duplicate, 1); + } + + return true; +@@ -1402,7 +1395,7 @@ static int save_normal_page(PageSearchStatus *pss, RAMBlock *block, + qemu_put_buffer(file, buf, TARGET_PAGE_SIZE); + } + ram_transferred_add(TARGET_PAGE_SIZE); +- stat64_add(&ram_atomic_counters.normal, 1); ++ stat64_add(&ram_counters.normal, 1); + return 1; + } + +@@ -1458,7 +1451,7 @@ static int ram_save_multifd_page(QEMUFile *file, RAMBlock *block, + if (multifd_queue_page(file, block, offset) < 0) { + return -1; + } +- stat64_add(&ram_atomic_counters.normal, 1); ++ stat64_add(&ram_counters.normal, 1); + + return 1; + } +@@ -1497,7 +1490,7 @@ update_compress_thread_counts(const CompressParam *param, int bytes_xmit) + ram_transferred_add(bytes_xmit); + + if (param->zero_page) { +- stat64_add(&ram_atomic_counters.duplicate, 1); ++ stat64_add(&ram_counters.duplicate, 1); + return; + } + +@@ -2632,9 +2625,9 @@ void acct_update_position(QEMUFile *f, size_t size, bool zero) + uint64_t pages = size / TARGET_PAGE_SIZE; + + if (zero) { +- stat64_add(&ram_atomic_counters.duplicate, pages); ++ stat64_add(&ram_counters.duplicate, pages); + } else { +- stat64_add(&ram_atomic_counters.normal, pages); ++ stat64_add(&ram_counters.normal, pages); + ram_transferred_add(size); + qemu_file_credit_transfer(f, size); + } +diff --git a/migration/ram.h b/migration/ram.h +index 81cbb0947c..7c026b5242 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -35,25 +35,27 @@ + #include "qemu/stats64.h" + + /* +- * These are the migration statistic counters that need to be updated using +- * atomic ops (can be accessed by more than one thread). Here since we +- * cannot modify MigrationStats directly to use Stat64 as it was defined in +- * the QAPI scheme, we define an internal structure to hold them, and we +- * propagate the real values when QMP queries happen. +- * +- * IOW, the corresponding fields within ram_counters on these specific +- * fields will be always zero and not being used at all; they're just +- * placeholders to make it QAPI-compatible. ++ * These are the ram migration statistic counters. It is loosely ++ * based on MigrationStats. We change to Stat64 any counter that ++ * needs to be updated using atomic ops (can be accessed by more than ++ * one thread). + */ + typedef struct { +- Stat64 transferred; ++ int64_t dirty_pages_rate; ++ int64_t dirty_sync_count; ++ uint64_t dirty_sync_missed_zero_copy; ++ uint64_t downtime_bytes; + Stat64 duplicate; ++ uint64_t multifd_bytes; + Stat64 normal; + Stat64 postcopy_bytes; +-} MigrationAtomicStats; ++ int64_t postcopy_requests; ++ uint64_t precopy_bytes; ++ int64_t remaining; ++ Stat64 transferred; ++} RAMStats; + +-extern MigrationAtomicStats ram_atomic_counters; +-extern MigrationStats ram_counters; ++extern RAMStats ram_counters; + extern XBZRLECacheStats xbzrle_counters; + extern CompressionStats compression_counters; + +-- +2.39.1 + diff --git a/kvm-migration-Minor-control-flow-simplification.patch b/kvm-migration-Minor-control-flow-simplification.patch new file mode 100644 index 0000000..a0dbdd9 --- /dev/null +++ b/kvm-migration-Minor-control-flow-simplification.patch @@ -0,0 +1,52 @@ +From c3bc974ea4b5186a76daa433209c1209d94dd0b7 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 20 Apr 2023 09:35:51 -0500 +Subject: [PATCH 2/2] migration: Minor control flow simplification + +RH-Author: Eric Blake +RH-MergeRequest: 161: Avoid migration assertion from failed NFS server. +RH-Bugzilla: 2058982 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [2/2] 5afd8c25d6f14bdb2a380ecc77bc6c2f2a26df87 (ebblake/centos-qemu-kvm) + +No need to declare a temporary variable. + +Suggested-by: Juan Quintela +Fixes: 1df36e8c6289 ("migration: Handle block device inactivation failures better") +Signed-off-by: Eric Blake +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit 5d39f44d7ac5c63f53d4d0900ceba9521bc27e49) +--- + migration/migration.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index cb0d42c061..08007cef4e 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3436,7 +3436,6 @@ static void migration_completion(MigrationState *s) + ret = global_state_store(); + + if (!ret) { +- bool inactivate = !migrate_colo_enabled(); + ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE); + trace_migration_completion_vm_stop(ret); + if (ret >= 0) { +@@ -3444,10 +3443,10 @@ static void migration_completion(MigrationState *s) + MIGRATION_STATUS_DEVICE); + } + if (ret >= 0) { +- s->block_inactive = inactivate; ++ s->block_inactive = !migrate_colo_enabled(); + qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false, +- inactivate); ++ s->block_inactive); + } + } + qemu_mutex_unlock_iothread(); +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_announce_params-to-option.c.patch b/kvm-migration-Move-migrate_announce_params-to-option.c.patch new file mode 100644 index 0000000..24dcb16 --- /dev/null +++ b/kvm-migration-Move-migrate_announce_params-to-option.c.patch @@ -0,0 +1,90 @@ +From 1f5232d611ecaaf61bcac151e7d90b8b452ac161 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 01:17:23 +0100 +Subject: [PATCH 43/56] migration: Move migrate_announce_params() to option.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [42/50] 541be7adc7f81c269058485aef5b14e787b2efe6 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas + +--- + +Fix extra whitespace (fabiano) + +(cherry picked from commit 2682c4eea72c621dfd0fb0151cbd758e81d1bdff) +Signed-off-by: Peter Xu +--- + migration/migration.c | 14 -------------- + migration/options.c | 17 +++++++++++++++++ + 2 files changed, 17 insertions(+), 14 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 724e841eb9..f27ce30be2 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -954,20 +954,6 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) + return params; + } + +-AnnounceParameters *migrate_announce_params(void) +-{ +- static AnnounceParameters ap; +- +- MigrationState *s = migrate_get_current(); +- +- ap.initial = s->parameters.announce_initial; +- ap.max = s->parameters.announce_max; +- ap.rounds = s->parameters.announce_rounds; +- ap.step = s->parameters.announce_step; +- +- return ≈ +-} +- + /* + * Return true if we're already in the middle of a migration + * (i.e. any of the active or setup states) +diff --git a/migration/options.c b/migration/options.c +index 2cb04fbbd1..418aafac64 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -16,6 +16,7 @@ + #include "qapi/qapi-commands-migration.h" + #include "qapi/qmp/qerror.h" + #include "sysemu/runstate.h" ++#include "migration/misc.h" + #include "migration.h" + #include "ram.h" + #include "options.h" +@@ -589,3 +590,19 @@ uint64_t migrate_xbzrle_cache_size(void) + + return s->parameters.xbzrle_cache_size; + } ++ ++/* parameters helpers */ ++ ++AnnounceParameters *migrate_announce_params(void) ++{ ++ static AnnounceParameters ap; ++ ++ MigrationState *s = migrate_get_current(); ++ ++ ap.initial = s->parameters.announce_initial; ++ ap.max = s->parameters.announce_max; ++ ap.rounds = s->parameters.announce_rounds; ++ ap.step = s->parameters.announce_step; ++ ++ return ≈ ++} +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_cap_set-to-options.c.patch b/kvm-migration-Move-migrate_cap_set-to-options.c.patch new file mode 100644 index 0000000..0e33c4c --- /dev/null +++ b/kvm-migration-Move-migrate_cap_set-to-options.c.patch @@ -0,0 +1,110 @@ +From 9c4f8d869f5bbdd07381f6baad2ed755b07d03f4 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 23:25:44 +0100 +Subject: [PATCH 36/56] migration: Move migrate_cap_set() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [35/50] d0cd6b8e9cf0534a56795d94c3da18622fa10ad7 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit f80196b772ddeeb07d3d80d5c8382cb5d1063fa2) +Signed-off-by: Peter Xu +--- + migration/migration.c | 20 -------------------- + migration/options.c | 21 +++++++++++++++++++++ + migration/options.h | 1 + + 3 files changed, 22 insertions(+), 20 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 369cd91796..880a51210e 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1666,26 +1666,6 @@ void migrate_set_state(int *state, int old_state, int new_state) + } + } + +-static bool migrate_cap_set(int cap, bool value, Error **errp) +-{ +- MigrationState *s = migrate_get_current(); +- bool new_caps[MIGRATION_CAPABILITY__MAX]; +- +- if (migration_is_running(s->state)) { +- error_setg(errp, QERR_MIGRATION_ACTIVE); +- return false; +- } +- +- memcpy(new_caps, s->capabilities, sizeof(new_caps)); +- new_caps[cap] = value; +- +- if (!migrate_caps_check(s->capabilities, new_caps, errp)) { +- return false; +- } +- s->capabilities[cap] = value; +- return true; +-} +- + static void migrate_set_block_incremental(MigrationState *s, bool value) + { + s->parameters.block_incremental = value; +diff --git a/migration/options.c b/migration/options.c +index 4cbe77e35a..f3b2d6e482 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -14,6 +14,7 @@ + #include "qemu/osdep.h" + #include "qapi/error.h" + #include "qapi/qapi-commands-migration.h" ++#include "qapi/qmp/qerror.h" + #include "sysemu/runstate.h" + #include "migration.h" + #include "ram.h" +@@ -392,6 +393,26 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + return true; + } + ++bool migrate_cap_set(int cap, bool value, Error **errp) ++{ ++ MigrationState *s = migrate_get_current(); ++ bool new_caps[MIGRATION_CAPABILITY__MAX]; ++ ++ if (migration_is_running(s->state)) { ++ error_setg(errp, QERR_MIGRATION_ACTIVE); ++ return false; ++ } ++ ++ memcpy(new_caps, s->capabilities, sizeof(new_caps)); ++ new_caps[cap] = value; ++ ++ if (!migrate_caps_check(s->capabilities, new_caps, errp)) { ++ return false; ++ } ++ s->capabilities[cap] = value; ++ return true; ++} ++ + MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) + { + MigrationCapabilityStatusList *head = NULL, **tail = &head; +diff --git a/migration/options.h b/migration/options.h +index e779f14161..5979e4ff90 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -41,5 +41,6 @@ bool migrate_zero_copy_send(void); + /* capabilities helpers */ + + bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp); ++bool migrate_cap_set(int cap, bool value, Error **errp); + + #endif +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_caps_check-to-options.c.patch b/kvm-migration-Move-migrate_caps_check-to-options.c.patch new file mode 100644 index 0000000..0d6fa08 --- /dev/null +++ b/kvm-migration-Move-migrate_caps_check-to-options.c.patch @@ -0,0 +1,458 @@ +From 3af7c7aaf7407ec14c19e54d52a2229ce4dbb7c5 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 23:05:53 +0100 +Subject: [PATCH 33/56] migration: Move migrate_caps_check() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [32/50] 12999471063d97fffb2b04c6dcb80083b902f963 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 77608706459bd197e25ac1ef54591b9f8a0b46f8) +Signed-off-by: Peter Xu +--- + migration/migration.c | 190 ----------------------------------------- + migration/options.c | 192 ++++++++++++++++++++++++++++++++++++++++++ + migration/options.h | 4 + + 3 files changed, 196 insertions(+), 190 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index f7facecd66..d9e30ca918 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -136,39 +136,6 @@ enum mig_rp_message_type { + MIG_RP_MSG_MAX + }; + +-/* Migration capabilities set */ +-struct MigrateCapsSet { +- int size; /* Capability set size */ +- MigrationCapability caps[]; /* Variadic array of capabilities */ +-}; +-typedef struct MigrateCapsSet MigrateCapsSet; +- +-/* Define and initialize MigrateCapsSet */ +-#define INITIALIZE_MIGRATE_CAPS_SET(_name, ...) \ +- MigrateCapsSet _name = { \ +- .size = sizeof((int []) { __VA_ARGS__ }) / sizeof(int), \ +- .caps = { __VA_ARGS__ } \ +- } +- +-/* Background-snapshot compatibility check list */ +-static const +-INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot, +- MIGRATION_CAPABILITY_POSTCOPY_RAM, +- MIGRATION_CAPABILITY_DIRTY_BITMAPS, +- MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME, +- MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE, +- MIGRATION_CAPABILITY_RETURN_PATH, +- MIGRATION_CAPABILITY_MULTIFD, +- MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER, +- MIGRATION_CAPABILITY_AUTO_CONVERGE, +- MIGRATION_CAPABILITY_RELEASE_RAM, +- MIGRATION_CAPABILITY_RDMA_PIN_ALL, +- MIGRATION_CAPABILITY_COMPRESS, +- MIGRATION_CAPABILITY_XBZRLE, +- MIGRATION_CAPABILITY_X_COLO, +- MIGRATION_CAPABILITY_VALIDATE_UUID, +- MIGRATION_CAPABILITY_ZERO_COPY_SEND); +- + /* When we add fault tolerance, we could have several + migrations at once. For now we don't need to add + dynamic creation of migration */ +@@ -1235,163 +1202,6 @@ static void fill_source_migration_info(MigrationInfo *info) + info->status = state; + } + +-typedef enum WriteTrackingSupport { +- WT_SUPPORT_UNKNOWN = 0, +- WT_SUPPORT_ABSENT, +- WT_SUPPORT_AVAILABLE, +- WT_SUPPORT_COMPATIBLE +-} WriteTrackingSupport; +- +-static +-WriteTrackingSupport migrate_query_write_tracking(void) +-{ +- /* Check if kernel supports required UFFD features */ +- if (!ram_write_tracking_available()) { +- return WT_SUPPORT_ABSENT; +- } +- /* +- * Check if current memory configuration is +- * compatible with required UFFD features. +- */ +- if (!ram_write_tracking_compatible()) { +- return WT_SUPPORT_AVAILABLE; +- } +- +- return WT_SUPPORT_COMPATIBLE; +-} +- +-/** +- * @migration_caps_check - check capability compatibility +- * +- * @old_caps: old capability list +- * @new_caps: new capability list +- * @errp: set *errp if the check failed, with reason +- * +- * Returns true if check passed, otherwise false. +- */ +-static bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) +-{ +- MigrationIncomingState *mis = migration_incoming_get_current(); +- +-#ifndef CONFIG_LIVE_BLOCK_MIGRATION +- if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { +- error_setg(errp, "QEMU compiled without old-style (blk/-b, inc/-i) " +- "block migration"); +- error_append_hint(errp, "Use drive_mirror+NBD instead.\n"); +- return false; +- } +-#endif +- +-#ifndef CONFIG_REPLICATION +- if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { +- error_setg(errp, "QEMU compiled without replication module" +- " can't enable COLO"); +- error_append_hint(errp, "Please enable replication before COLO.\n"); +- return false; +- } +-#endif +- +- if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { +- /* This check is reasonably expensive, so only when it's being +- * set the first time, also it's only the destination that needs +- * special support. +- */ +- if (!old_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] && +- runstate_check(RUN_STATE_INMIGRATE) && +- !postcopy_ram_supported_by_host(mis)) { +- /* postcopy_ram_supported_by_host will have emitted a more +- * detailed message +- */ +- error_setg(errp, "Postcopy is not supported"); +- return false; +- } +- +- if (new_caps[MIGRATION_CAPABILITY_X_IGNORE_SHARED]) { +- error_setg(errp, "Postcopy is not compatible with ignore-shared"); +- return false; +- } +- } +- +- if (new_caps[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]) { +- WriteTrackingSupport wt_support; +- int idx; +- /* +- * Check if 'background-snapshot' capability is supported by +- * host kernel and compatible with guest memory configuration. +- */ +- wt_support = migrate_query_write_tracking(); +- if (wt_support < WT_SUPPORT_AVAILABLE) { +- error_setg(errp, "Background-snapshot is not supported by host kernel"); +- return false; +- } +- if (wt_support < WT_SUPPORT_COMPATIBLE) { +- error_setg(errp, "Background-snapshot is not compatible " +- "with guest memory configuration"); +- return false; +- } +- +- /* +- * Check if there are any migration capabilities +- * incompatible with 'background-snapshot'. +- */ +- for (idx = 0; idx < check_caps_background_snapshot.size; idx++) { +- int incomp_cap = check_caps_background_snapshot.caps[idx]; +- if (new_caps[incomp_cap]) { +- error_setg(errp, +- "Background-snapshot is not compatible with %s", +- MigrationCapability_str(incomp_cap)); +- return false; +- } +- } +- } +- +-#ifdef CONFIG_LINUX +- if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND] && +- (!new_caps[MIGRATION_CAPABILITY_MULTIFD] || +- new_caps[MIGRATION_CAPABILITY_COMPRESS] || +- new_caps[MIGRATION_CAPABILITY_XBZRLE] || +- migrate_multifd_compression() || +- migrate_use_tls())) { +- error_setg(errp, +- "Zero copy only available for non-compressed non-TLS multifd migration"); +- return false; +- } +-#else +- if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND]) { +- error_setg(errp, +- "Zero copy currently only available on Linux"); +- return false; +- } +-#endif +- +- if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]) { +- if (!new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { +- error_setg(errp, "Postcopy preempt requires postcopy-ram"); +- return false; +- } +- +- /* +- * Preempt mode requires urgent pages to be sent in separate +- * channel, OTOH compression logic will disorder all pages into +- * different compression channels, which is not compatible with the +- * preempt assumptions on channel assignments. +- */ +- if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { +- error_setg(errp, "Postcopy preempt not compatible with compress"); +- return false; +- } +- } +- +- if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { +- if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { +- error_setg(errp, "Multifd is not compatible with compress"); +- return false; +- } +- } +- +- return true; +-} +- + static void fill_destination_migration_info(MigrationInfo *info) + { + MigrationIncomingState *mis = migration_incoming_get_current(); +diff --git a/migration/options.c b/migration/options.c +index 9c9b8e5863..367c930f46 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -12,7 +12,10 @@ + */ + + #include "qemu/osdep.h" ++#include "qapi/error.h" ++#include "sysemu/runstate.h" + #include "migration.h" ++#include "ram.h" + #include "options.h" + + bool migrate_auto_converge(void) +@@ -198,3 +201,192 @@ bool migrate_zero_copy_send(void) + + return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; + } ++typedef enum WriteTrackingSupport { ++ WT_SUPPORT_UNKNOWN = 0, ++ WT_SUPPORT_ABSENT, ++ WT_SUPPORT_AVAILABLE, ++ WT_SUPPORT_COMPATIBLE ++} WriteTrackingSupport; ++ ++static ++WriteTrackingSupport migrate_query_write_tracking(void) ++{ ++ /* Check if kernel supports required UFFD features */ ++ if (!ram_write_tracking_available()) { ++ return WT_SUPPORT_ABSENT; ++ } ++ /* ++ * Check if current memory configuration is ++ * compatible with required UFFD features. ++ */ ++ if (!ram_write_tracking_compatible()) { ++ return WT_SUPPORT_AVAILABLE; ++ } ++ ++ return WT_SUPPORT_COMPATIBLE; ++} ++ ++/* Migration capabilities set */ ++struct MigrateCapsSet { ++ int size; /* Capability set size */ ++ MigrationCapability caps[]; /* Variadic array of capabilities */ ++}; ++typedef struct MigrateCapsSet MigrateCapsSet; ++ ++/* Define and initialize MigrateCapsSet */ ++#define INITIALIZE_MIGRATE_CAPS_SET(_name, ...) \ ++ MigrateCapsSet _name = { \ ++ .size = sizeof((int []) { __VA_ARGS__ }) / sizeof(int), \ ++ .caps = { __VA_ARGS__ } \ ++ } ++ ++/* Background-snapshot compatibility check list */ ++static const ++INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot, ++ MIGRATION_CAPABILITY_POSTCOPY_RAM, ++ MIGRATION_CAPABILITY_DIRTY_BITMAPS, ++ MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME, ++ MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE, ++ MIGRATION_CAPABILITY_RETURN_PATH, ++ MIGRATION_CAPABILITY_MULTIFD, ++ MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER, ++ MIGRATION_CAPABILITY_AUTO_CONVERGE, ++ MIGRATION_CAPABILITY_RELEASE_RAM, ++ MIGRATION_CAPABILITY_RDMA_PIN_ALL, ++ MIGRATION_CAPABILITY_COMPRESS, ++ MIGRATION_CAPABILITY_XBZRLE, ++ MIGRATION_CAPABILITY_X_COLO, ++ MIGRATION_CAPABILITY_VALIDATE_UUID, ++ MIGRATION_CAPABILITY_ZERO_COPY_SEND); ++ ++/** ++ * @migration_caps_check - check capability compatibility ++ * ++ * @old_caps: old capability list ++ * @new_caps: new capability list ++ * @errp: set *errp if the check failed, with reason ++ * ++ * Returns true if check passed, otherwise false. ++ */ ++bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) ++{ ++ MigrationIncomingState *mis = migration_incoming_get_current(); ++ ++#ifndef CONFIG_LIVE_BLOCK_MIGRATION ++ if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { ++ error_setg(errp, "QEMU compiled without old-style (blk/-b, inc/-i) " ++ "block migration"); ++ error_append_hint(errp, "Use drive_mirror+NBD instead.\n"); ++ return false; ++ } ++#endif ++ ++#ifndef CONFIG_REPLICATION ++ if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { ++ error_setg(errp, "QEMU compiled without replication module" ++ " can't enable COLO"); ++ error_append_hint(errp, "Please enable replication before COLO.\n"); ++ return false; ++ } ++#endif ++ ++ if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { ++ /* This check is reasonably expensive, so only when it's being ++ * set the first time, also it's only the destination that needs ++ * special support. ++ */ ++ if (!old_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] && ++ runstate_check(RUN_STATE_INMIGRATE) && ++ !postcopy_ram_supported_by_host(mis)) { ++ /* postcopy_ram_supported_by_host will have emitted a more ++ * detailed message ++ */ ++ error_setg(errp, "Postcopy is not supported"); ++ return false; ++ } ++ ++ if (new_caps[MIGRATION_CAPABILITY_X_IGNORE_SHARED]) { ++ error_setg(errp, "Postcopy is not compatible with ignore-shared"); ++ return false; ++ } ++ } ++ ++ if (new_caps[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]) { ++ WriteTrackingSupport wt_support; ++ int idx; ++ /* ++ * Check if 'background-snapshot' capability is supported by ++ * host kernel and compatible with guest memory configuration. ++ */ ++ wt_support = migrate_query_write_tracking(); ++ if (wt_support < WT_SUPPORT_AVAILABLE) { ++ error_setg(errp, "Background-snapshot is not supported by host kernel"); ++ return false; ++ } ++ if (wt_support < WT_SUPPORT_COMPATIBLE) { ++ error_setg(errp, "Background-snapshot is not compatible " ++ "with guest memory configuration"); ++ return false; ++ } ++ ++ /* ++ * Check if there are any migration capabilities ++ * incompatible with 'background-snapshot'. ++ */ ++ for (idx = 0; idx < check_caps_background_snapshot.size; idx++) { ++ int incomp_cap = check_caps_background_snapshot.caps[idx]; ++ if (new_caps[incomp_cap]) { ++ error_setg(errp, ++ "Background-snapshot is not compatible with %s", ++ MigrationCapability_str(incomp_cap)); ++ return false; ++ } ++ } ++ } ++ ++#ifdef CONFIG_LINUX ++ if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND] && ++ (!new_caps[MIGRATION_CAPABILITY_MULTIFD] || ++ new_caps[MIGRATION_CAPABILITY_COMPRESS] || ++ new_caps[MIGRATION_CAPABILITY_XBZRLE] || ++ migrate_multifd_compression() || ++ migrate_use_tls())) { ++ error_setg(errp, ++ "Zero copy only available for non-compressed non-TLS multifd migration"); ++ return false; ++ } ++#else ++ if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND]) { ++ error_setg(errp, ++ "Zero copy currently only available on Linux"); ++ return false; ++ } ++#endif ++ ++ if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]) { ++ if (!new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { ++ error_setg(errp, "Postcopy preempt requires postcopy-ram"); ++ return false; ++ } ++ ++ /* ++ * Preempt mode requires urgent pages to be sent in separate ++ * channel, OTOH compression logic will disorder all pages into ++ * different compression channels, which is not compatible with the ++ * preempt assumptions on channel assignments. ++ */ ++ if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { ++ error_setg(errp, "Postcopy preempt not compatible with compress"); ++ return false; ++ } ++ } ++ ++ if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { ++ if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { ++ error_setg(errp, "Multifd is not compatible with compress"); ++ return false; ++ } ++ } ++ ++ return true; ++} +diff --git a/migration/options.h b/migration/options.h +index 25c002b37a..e779f14161 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -38,4 +38,8 @@ bool migrate_xbzrle(void); + bool migrate_zero_blocks(void); + bool migrate_zero_copy_send(void); + ++/* capabilities helpers */ ++ ++bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp); ++ + #endif +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_colo_enabled-to-options.c.patch b/kvm-migration-Move-migrate_colo_enabled-to-options.c.patch new file mode 100644 index 0000000..47c6f83 --- /dev/null +++ b/kvm-migration-Move-migrate_colo_enabled-to-options.c.patch @@ -0,0 +1,136 @@ +From 13da9060fa2dfc666cd6f4b9bc85b7cee0fef45e Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:00:16 +0100 +Subject: [PATCH 24/56] migration: Move migrate_colo_enabled() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [23/50] 4809b1091edee38bd222af41b6313133705785c7 (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_colo() to be +consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 5e8046445575dc5879e63c5d07af893d174813d0) +Signed-off-by: Peter Xu +--- + migration/migration.c | 16 +++++----------- + migration/migration.h | 1 - + migration/options.c | 6 ++++++ + migration/options.h | 1 + + 4 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 66ea55be06..59ee0ef82b 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2411,7 +2411,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, + } + + if (blk || blk_inc) { +- if (migrate_colo_enabled()) { ++ if (migrate_colo()) { + error_setg(errp, "No disk migration is required in COLO mode"); + return false; + } +@@ -3304,7 +3304,7 @@ static void migration_completion(MigrationState *s) + * have done so in order to remember to reactivate + * them if migration fails or is cancelled. + */ +- s->block_inactive = !migrate_colo_enabled(); ++ s->block_inactive = !migrate_colo(); + qemu_file_set_rate_limit(s->to_dst_file, INT64_MAX); + ret = qemu_savevm_state_complete_precopy(s->to_dst_file, false, + s->block_inactive); +@@ -3357,7 +3357,7 @@ static void migration_completion(MigrationState *s) + goto fail; + } + +- if (migrate_colo_enabled() && s->state == MIGRATION_STATUS_ACTIVE) { ++ if (migrate_colo() && s->state == MIGRATION_STATUS_ACTIVE) { + /* COLO does not support postcopy */ + migrate_set_state(&s->state, MIGRATION_STATUS_ACTIVE, + MIGRATION_STATUS_COLO); +@@ -3435,12 +3435,6 @@ fail: + MIGRATION_STATUS_FAILED); + } + +-bool migrate_colo_enabled(void) +-{ +- MigrationState *s = migrate_get_current(); +- return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; +-} +- + typedef enum MigThrError { + /* No error detected */ + MIG_THR_ERR_NONE = 0, +@@ -3771,7 +3765,7 @@ static void migration_iteration_finish(MigrationState *s) + runstate_set(RUN_STATE_POSTMIGRATE); + break; + case MIGRATION_STATUS_COLO: +- if (!migrate_colo_enabled()) { ++ if (!migrate_colo()) { + error_report("%s: critical error: calling COLO code without " + "COLO enabled", __func__); + } +@@ -3967,7 +3961,7 @@ static void *migration_thread(void *opaque) + qemu_savevm_send_postcopy_advise(s->to_dst_file); + } + +- if (migrate_colo_enabled()) { ++ if (migrate_colo()) { + /* Notify migration destination that we enable COLO */ + qemu_savevm_send_colo_enable(s->to_dst_file); + } +diff --git a/migration/migration.h b/migration/migration.h +index a25fed6ef0..42f0c68b6f 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -463,7 +463,6 @@ bool migrate_use_zero_copy_send(void); + int migrate_use_tls(void); + int migrate_use_xbzrle(void); + uint64_t migrate_xbzrle_cache_size(void); +-bool migrate_colo_enabled(void); + + bool migrate_use_block(void); + bool migrate_use_block_incremental(void); +diff --git a/migration/options.c b/migration/options.c +index 88a9a45913..bd33c5da0a 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -33,6 +33,12 @@ bool migrate_background_snapshot(void) + return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; + } + ++bool migrate_colo(void) ++{ ++ MigrationState *s = migrate_get_current(); ++ return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; ++} ++ + bool migrate_dirty_bitmaps(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 0dfa0af245..2a0ee61ff8 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -18,6 +18,7 @@ + + bool migrate_auto_converge(void); + bool migrate_background_snapshot(void); ++bool migrate_colo(void); + bool migrate_dirty_bitmaps(void); + bool migrate_ignore_shared(void); + bool migrate_late_block_activate(void); +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_postcopy-to-options.c.patch b/kvm-migration-Move-migrate_postcopy-to-options.c.patch new file mode 100644 index 0000000..892ec9e --- /dev/null +++ b/kvm-migration-Move-migrate_postcopy-to-options.c.patch @@ -0,0 +1,98 @@ +From 710fe195a3c13ffe96795a7a2b550c00319997ea Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:44:20 +0100 +Subject: [PATCH 47/56] migration: Move migrate_postcopy() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [46/50] a4f3455b3524a331f44b481bf7a79318aef5abaa (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit f774fde5d4e97cbfc64dab6622c2c53c5fe5c9fe) +Signed-off-by: Peter Xu +--- + migration/migration.c | 5 ----- + migration/migration.h | 2 -- + migration/options.c | 8 ++++++++ + migration/options.h | 9 +++++++++ + 4 files changed, 17 insertions(+), 7 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index f27ce30be2..46a5ea4d42 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2245,11 +2245,6 @@ void qmp_migrate_continue(MigrationStatus state, Error **errp) + qemu_sem_post(&s->pause_sem); + } + +-bool migrate_postcopy(void) +-{ +- return migrate_postcopy_ram() || migrate_dirty_bitmaps(); +-} +- + int migrate_use_tls(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index 3ae938b19c..dcf906868d 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -447,8 +447,6 @@ bool migration_is_blocked(Error **errp); + bool migration_in_postcopy(void); + MigrationState *migrate_get_current(void); + +-bool migrate_postcopy(void); +- + int migrate_use_tls(void); + + uint64_t ram_get_total_transferred_pages(void); +diff --git a/migration/options.c b/migration/options.c +index 615534c151..8bd2d949ae 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -204,6 +204,14 @@ bool migrate_zero_copy_send(void) + + return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; + } ++ ++/* pseudo capabilities */ ++ ++bool migrate_postcopy(void) ++{ ++ return migrate_postcopy_ram() || migrate_dirty_bitmaps(); ++} ++ + typedef enum WriteTrackingSupport { + WT_SUPPORT_UNKNOWN = 0, + WT_SUPPORT_ABSENT, +diff --git a/migration/options.h b/migration/options.h +index 99f6bbd7a1..093bc907a1 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -38,6 +38,15 @@ bool migrate_xbzrle(void); + bool migrate_zero_blocks(void); + bool migrate_zero_copy_send(void); + ++/* ++ * pseudo capabilities ++ * ++ * These are functions that are used in a similar way to capabilities ++ * check, but they are not a capability. ++ */ ++ ++bool migrate_postcopy(void); ++ + /* capabilities helpers */ + + bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp); +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_block-to-options.c.patch b/kvm-migration-Move-migrate_use_block-to-options.c.patch new file mode 100644 index 0000000..f7cb338 --- /dev/null +++ b/kvm-migration-Move-migrate_use_block-to-options.c.patch @@ -0,0 +1,134 @@ +From 276877a71778a5cef0dc5bc843e2679f0fdabb77 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:23:57 +0100 +Subject: [PATCH 30/56] migration: Move migrate_use_block() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [29/50] fcaeb0e07cf828f3cd0d115515b30d913525a0a2 (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_block() +to be consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 9d4b1e5f22a838285ebeb8f0eb7cc8df1161998f) +Signed-off-by: Peter Xu +--- + migration/block.c | 2 +- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/savevm.c | 2 +- + 6 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/migration/block.c b/migration/block.c +index 4b167fa5cf..f0977217cf 100644 +--- a/migration/block.c ++++ b/migration/block.c +@@ -1001,7 +1001,7 @@ static int block_load(QEMUFile *f, void *opaque, int version_id) + + static bool block_is_active(void *opaque) + { +- return migrate_use_block(); ++ return migrate_block(); + } + + static SaveVMHandlers savevm_block_handlers = { +diff --git a/migration/migration.c b/migration/migration.c +index a4ede4294e..96f82bd165 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2415,7 +2415,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, + error_setg(errp, "No disk migration is required in COLO mode"); + return false; + } +- if (migrate_use_block() || migrate_use_block_incremental()) { ++ if (migrate_block() || migrate_use_block_incremental()) { + error_setg(errp, "Command options are incompatible with " + "current migration capabilities"); + return false; +@@ -2622,15 +2622,6 @@ static int64_t migrate_max_postcopy_bandwidth(void) + return s->parameters.max_postcopy_bandwidth; + } + +-bool migrate_use_block(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; +-} +- + bool migrate_use_return_path(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index e2bb5b1e2f..d4b68b08a5 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -457,7 +457,6 @@ int migrate_multifd_zstd_level(void); + int migrate_use_tls(void); + uint64_t migrate_xbzrle_cache_size(void); + +-bool migrate_use_block(void); + bool migrate_use_block_incremental(void); + int migrate_max_cpu_throttle(void); + bool migrate_use_return_path(void); +diff --git a/migration/options.c b/migration/options.c +index 25264c500e..fe1eadeed6 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -33,6 +33,15 @@ bool migrate_background_snapshot(void) + return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; + } + ++bool migrate_block(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; ++} ++ + bool migrate_colo(void) + { + MigrationState *s = migrate_get_current(); +diff --git a/migration/options.h b/migration/options.h +index 8f76a88329..e985a5233e 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -18,6 +18,7 @@ + + bool migrate_auto_converge(void); + bool migrate_background_snapshot(void); ++bool migrate_block(void); + bool migrate_colo(void); + bool migrate_compress(void); + bool migrate_dirty_bitmaps(void); +diff --git a/migration/savevm.c b/migration/savevm.c +index ebcf571e37..9671211339 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -1612,7 +1612,7 @@ static int qemu_savevm_state(QEMUFile *f, Error **errp) + return -EINVAL; + } + +- if (migrate_use_block()) { ++ if (migrate_block()) { + error_setg(errp, "Block migration and snapshots are incompatible"); + return -EINVAL; + } +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_block_incremental-to-opti.patch b/kvm-migration-Move-migrate_use_block_incremental-to-opti.patch new file mode 100644 index 0000000..3f20289 --- /dev/null +++ b/kvm-migration-Move-migrate_use_block_incremental-to-opti.patch @@ -0,0 +1,121 @@ +From def66503f4ccb97cf8029f88efe8e955edc8d32f Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 00:49:47 +0100 +Subject: [PATCH 39/56] migration: Move migrate_use_block_incremental() to + option.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [38/50] 961fda6464df3384fbcee88c726b56a33c26e14e (peterx/qemu-kvm) + +To be consistent with every other parameter, rename to +migrate_block_incremental(). + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 6f8be7080a1f79bf3832cf798fba1697c409c597) +Signed-off-by: Peter Xu +--- + migration/block.c | 2 +- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + 5 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/migration/block.c b/migration/block.c +index f0977217cf..6d532ac7a2 100644 +--- a/migration/block.c ++++ b/migration/block.c +@@ -417,7 +417,7 @@ static int init_blk_migration(QEMUFile *f) + bmds->bulk_completed = 0; + bmds->total_sectors = sectors; + bmds->completed_sectors = 0; +- bmds->shared_base = migrate_use_block_incremental(); ++ bmds->shared_base = migrate_block_incremental(); + + assert(i < num_bs); + bmds_bs[i].bmds = bmds; +diff --git a/migration/migration.c b/migration/migration.c +index 78bca9a93f..724e841eb9 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2157,7 +2157,7 @@ static bool migrate_prepare(MigrationState *s, bool blk, bool blk_inc, + error_setg(errp, "No disk migration is required in COLO mode"); + return false; + } +- if (migrate_block() || migrate_use_block_incremental()) { ++ if (migrate_block() || migrate_block_incremental()) { + error_setg(errp, "Command options are incompatible with " + "current migration capabilities"); + return false; +@@ -2273,15 +2273,6 @@ int migrate_use_tls(void) + return s->parameters.tls_creds && *s->parameters.tls_creds; + } + +-bool migrate_use_block_incremental(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.block_incremental; +-} +- + /* migration thread support */ + /* + * Something bad happened to the RP stream, mark an error +diff --git a/migration/migration.h b/migration/migration.h +index 8451e5f2fe..86051af132 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -451,7 +451,6 @@ bool migrate_postcopy(void); + + int migrate_use_tls(void); + +-bool migrate_use_block_incremental(void); + int migrate_max_cpu_throttle(void); + + uint64_t ram_get_total_transferred_pages(void); +diff --git a/migration/options.c b/migration/options.c +index 8d15be858c..2b6d88b4b9 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -463,6 +463,15 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, + + /* parameters */ + ++bool migrate_block_incremental(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.block_incremental; ++} ++ + int migrate_compress_level(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index b24ee92283..96d5a8e6e4 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -45,6 +45,7 @@ bool migrate_cap_set(int cap, bool value, Error **errp); + + /* parameters */ + ++bool migrate_block_incremental(void); + int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_compression-to-options.c.patch b/kvm-migration-Move-migrate_use_compression-to-options.c.patch new file mode 100644 index 0000000..8b74183 --- /dev/null +++ b/kvm-migration-Move-migrate_use_compression-to-options.c.patch @@ -0,0 +1,183 @@ +From ae183bfc9d7b001d3c4929556b095a76203bc08d Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:03:48 +0100 +Subject: [PATCH 25/56] migration: Move migrate_use_compression() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [24/50] 126b865f51bd4a1ae3a46411fdcd59033bfc5376 (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_compress() +to be consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit a7a94d14358dd7b445e20c2f26218ff987747642) +Signed-off-by: Peter Xu +--- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 16 ++++++++-------- + 5 files changed, 19 insertions(+), 19 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 59ee0ef82b..c6e32555a8 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1133,7 +1133,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->xbzrle_cache->overflow = xbzrle_counters.overflow; + } + +- if (migrate_use_compression()) { ++ if (migrate_compress()) { + info->compression = g_malloc0(sizeof(*info->compression)); + info->compression->pages = compression_counters.pages; + info->compression->busy = compression_counters.busy; +@@ -2522,15 +2522,6 @@ bool migrate_postcopy(void) + return migrate_postcopy_ram() || migrate_dirty_bitmaps(); + } + +-bool migrate_use_compression(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_COMPRESS]; +-} +- + int migrate_compress_level(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index 42f0c68b6f..77aa91c840 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -471,7 +471,6 @@ bool migrate_use_return_path(void); + + uint64_t ram_get_total_transferred_pages(void); + +-bool migrate_use_compression(void); + int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); +diff --git a/migration/options.c b/migration/options.c +index bd33c5da0a..fa7a13d3dc 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -39,6 +39,15 @@ bool migrate_colo(void) + return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; + } + ++bool migrate_compress(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_COMPRESS]; ++} ++ + bool migrate_dirty_bitmaps(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index 2a0ee61ff8..da2193fd94 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -19,6 +19,7 @@ + bool migrate_auto_converge(void); + bool migrate_background_snapshot(void); + bool migrate_colo(void); ++bool migrate_compress(void); + bool migrate_dirty_bitmaps(void); + bool migrate_ignore_shared(void); + bool migrate_late_block_activate(void); +diff --git a/migration/ram.c b/migration/ram.c +index 912ccd89fa..d050d0c5fd 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -586,7 +586,7 @@ static void compress_threads_save_cleanup(void) + { + int i, thread_count; + +- if (!migrate_use_compression() || !comp_param) { ++ if (!migrate_compress() || !comp_param) { + return; + } + +@@ -625,7 +625,7 @@ static int compress_threads_save_setup(void) + { + int i, thread_count; + +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + return 0; + } + thread_count = migrate_compress_threads(); +@@ -1155,7 +1155,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time) + rs->xbzrle_bytes_prev = xbzrle_counters.bytes; + } + +- if (migrate_use_compression()) { ++ if (migrate_compress()) { + compression_counters.busy_rate = (double)(compression_counters.busy - + rs->compress_thread_busy_prev) / page_count; + rs->compress_thread_busy_prev = compression_counters.busy; +@@ -2270,7 +2270,7 @@ int ram_save_queue_pages(const char *rbname, ram_addr_t start, ram_addr_t len) + + static bool save_page_use_compression(RAMState *rs) + { +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + return false; + } + +@@ -3734,7 +3734,7 @@ static int wait_for_decompress_done(void) + { + int idx, thread_count; + +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + return 0; + } + +@@ -3753,7 +3753,7 @@ static void compress_threads_load_cleanup(void) + { + int i, thread_count; + +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + return; + } + thread_count = migrate_decompress_threads(); +@@ -3794,7 +3794,7 @@ static int compress_threads_load_setup(QEMUFile *f) + { + int i, thread_count; + +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + return 0; + } + +@@ -4260,7 +4260,7 @@ static int ram_load_precopy(QEMUFile *f) + int flags = 0, ret = 0, invalid_flags = 0, len = 0, i = 0; + /* ADVISE is earlier, it shows the source has the postcopy capability on */ + bool postcopy_advised = migration_incoming_postcopy_advised(); +- if (!migrate_use_compression()) { ++ if (!migrate_compress()) { + invalid_flags |= RAM_SAVE_FLAG_COMPRESS_PAGE; + } + +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_events-to-options.c.patch b/kvm-migration-Move-migrate_use_events-to-options.c.patch new file mode 100644 index 0000000..41e05c3 --- /dev/null +++ b/kvm-migration-Move-migrate_use_events-to-options.c.patch @@ -0,0 +1,120 @@ +From 940f1eb4347c72edb3e1abc02c8d7e7c95753dcf Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:08:09 +0100 +Subject: [PATCH 26/56] migration: Move migrate_use_events() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [25/50] b3acd949af2a0fae18061d360e4f51dc12d32c6c (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_events() +to be consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit b890902c9c025b87d02e718eec3090fd3525ab18) +Signed-off-by: Peter Xu +--- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 2 +- + 5 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index c6e32555a8..032cd5c050 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -353,7 +353,7 @@ void migration_incoming_state_destroy(void) + + static void migrate_generate_event(int new_state) + { +- if (migrate_use_events()) { ++ if (migrate_events()) { + qapi_event_send_migration(new_state); + } + } +@@ -2558,15 +2558,6 @@ int migrate_decompress_threads(void) + return s->parameters.decompress_threads; + } + +-bool migrate_use_events(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_EVENTS]; +-} +- + bool migrate_use_multifd(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index 77aa91c840..bd06520c19 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -475,7 +475,6 @@ int migrate_compress_level(void); + int migrate_compress_threads(void); + int migrate_compress_wait_thread(void); + int migrate_decompress_threads(void); +-bool migrate_use_events(void); + + /* Sending on the return path - generic and then for each message type */ + void migrate_send_rp_shut(MigrationIncomingState *mis, +diff --git a/migration/options.c b/migration/options.c +index fa7a13d3dc..d2219ee0e4 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -57,6 +57,15 @@ bool migrate_dirty_bitmaps(void) + return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; + } + ++bool migrate_events(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_EVENTS]; ++} ++ + bool migrate_ignore_shared(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index da2193fd94..b998024eba 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -21,6 +21,7 @@ bool migrate_background_snapshot(void); + bool migrate_colo(void); + bool migrate_compress(void); + bool migrate_dirty_bitmaps(void); ++bool migrate_events(void); + bool migrate_ignore_shared(void); + bool migrate_late_block_activate(void); + bool migrate_pause_before_switchover(void); +diff --git a/migration/ram.c b/migration/ram.c +index d050d0c5fd..ee454a3849 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1246,7 +1246,7 @@ static void migration_bitmap_sync(RAMState *rs) + rs->num_dirty_pages_period = 0; + rs->bytes_xfer_prev = stat64_get(&ram_counters.transferred); + } +- if (migrate_use_events()) { ++ if (migrate_events()) { + uint64_t generation = stat64_get(&ram_counters.dirty_sync_count); + qapi_event_send_migration_pass(generation); + } +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_multifd-to-options.c.patch b/kvm-migration-Move-migrate_use_multifd-to-options.c.patch new file mode 100644 index 0000000..97d6597 --- /dev/null +++ b/kvm-migration-Move-migrate_use_multifd-to-options.c.patch @@ -0,0 +1,247 @@ +From afd8fb766af2be5cff97753b026847b91b09a30e Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:10:29 +0100 +Subject: [PATCH 27/56] migration: Move migrate_use_multifd() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [26/50] f2d72eae9cc80b2402ef613e809b40aa296d2e4c (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_multifd() +to be consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 51b07548f7c31793adc178c7460c5f4369733c61) +Signed-off-by: Peter Xu +--- + migration/migration.c | 19 +++++-------------- + migration/migration.h | 1 - + migration/multifd.c | 16 ++++++++-------- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 2 +- + migration/socket.c | 2 +- + 7 files changed, 25 insertions(+), 25 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 032cd5c050..e1d7f25786 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -186,7 +186,7 @@ static void migrate_fd_cancel(MigrationState *s); + + static bool migration_needs_multiple_sockets(void) + { +- return migrate_use_multifd() || migrate_postcopy_preempt(); ++ return migrate_multifd() || migrate_postcopy_preempt(); + } + + static bool uri_supports_multi_channels(const char *uri) +@@ -732,7 +732,7 @@ void migration_fd_process_incoming(QEMUFile *f, Error **errp) + static bool migration_should_start_incoming(bool main_channel) + { + /* Multifd doesn't start unless all channels are established */ +- if (migrate_use_multifd()) { ++ if (migrate_multifd()) { + return migration_has_all_channels(); + } + +@@ -759,7 +759,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp) + uint32_t channel_magic = 0; + int ret = 0; + +- if (migrate_use_multifd() && !migrate_postcopy_ram() && ++ if (migrate_multifd() && !migrate_postcopy_ram() && + qio_channel_has_feature(ioc, QIO_CHANNEL_FEATURE_READ_MSG_PEEK)) { + /* + * With multiple channels, it is possible that we receive channels +@@ -798,7 +798,7 @@ void migration_ioc_process_incoming(QIOChannel *ioc, Error **errp) + } else { + /* Multiple connections */ + assert(migration_needs_multiple_sockets()); +- if (migrate_use_multifd()) { ++ if (migrate_multifd()) { + multifd_recv_new_channel(ioc, &local_err); + } else { + assert(migrate_postcopy_preempt()); +@@ -834,7 +834,7 @@ bool migration_has_all_channels(void) + return false; + } + +- if (migrate_use_multifd()) { ++ if (migrate_multifd()) { + return multifd_recv_all_channels_created(); + } + +@@ -2558,15 +2558,6 @@ int migrate_decompress_threads(void) + return s->parameters.decompress_threads; + } + +-bool migrate_use_multifd(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_MULTIFD]; +-} +- + int migrate_multifd_channels(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index bd06520c19..49c0e13f41 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -449,7 +449,6 @@ MigrationState *migrate_get_current(void); + + bool migrate_postcopy(void); + +-bool migrate_use_multifd(void); + int migrate_multifd_channels(void); + MultiFDCompression migrate_multifd_compression(void); + int migrate_multifd_zlib_level(void); +diff --git a/migration/multifd.c b/migration/multifd.c +index 903df2117b..6807328189 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -516,7 +516,7 @@ void multifd_save_cleanup(void) + { + int i; + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return; + } + multifd_send_terminate_threads(NULL); +@@ -587,7 +587,7 @@ int multifd_send_sync_main(QEMUFile *f) + int i; + bool flush_zero_copy; + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return 0; + } + if (multifd_send_state->pages->num) { +@@ -911,7 +911,7 @@ int multifd_save_setup(Error **errp) + uint32_t page_count = MULTIFD_PACKET_SIZE / qemu_target_page_size(); + uint8_t i; + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return 0; + } + +@@ -1016,7 +1016,7 @@ static void multifd_recv_terminate_threads(Error *err) + + void multifd_load_shutdown(void) + { +- if (migrate_use_multifd()) { ++ if (migrate_multifd()) { + multifd_recv_terminate_threads(NULL); + } + } +@@ -1025,7 +1025,7 @@ void multifd_load_cleanup(void) + { + int i; + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return; + } + multifd_recv_terminate_threads(NULL); +@@ -1072,7 +1072,7 @@ void multifd_recv_sync_main(void) + { + int i; + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return; + } + for (i = 0; i < migrate_multifd_channels(); i++) { +@@ -1170,7 +1170,7 @@ int multifd_load_setup(Error **errp) + * Return successfully if multiFD recv state is already initialised + * or multiFD is not enabled. + */ +- if (multifd_recv_state || !migrate_use_multifd()) { ++ if (multifd_recv_state || !migrate_multifd()) { + return 0; + } + +@@ -1216,7 +1216,7 @@ bool multifd_recv_all_channels_created(void) + { + int thread_count = migrate_multifd_channels(); + +- if (!migrate_use_multifd()) { ++ if (!migrate_multifd()) { + return true; + } + +diff --git a/migration/options.c b/migration/options.c +index d2219ee0e4..58673fc101 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -84,6 +84,15 @@ bool migrate_late_block_activate(void) + return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; + } + ++bool migrate_multifd(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_MULTIFD]; ++} ++ + bool migrate_pause_before_switchover(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index b998024eba..d07269ee38 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -24,6 +24,7 @@ bool migrate_dirty_bitmaps(void); + bool migrate_events(void); + bool migrate_ignore_shared(void); + bool migrate_late_block_activate(void); ++bool migrate_multifd(void); + bool migrate_pause_before_switchover(void); + bool migrate_postcopy_blocktime(void); + bool migrate_postcopy_preempt(void); +diff --git a/migration/ram.c b/migration/ram.c +index ee454a3849..859dd7b63f 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -2362,7 +2362,7 @@ static int ram_save_target_page_legacy(RAMState *rs, PageSearchStatus *pss) + * if host page size == guest page size the dest guest during run may + * still see partially copied pages which is data corruption. + */ +- if (migrate_use_multifd() && !migration_in_postcopy()) { ++ if (migrate_multifd() && !migration_in_postcopy()) { + return ram_save_multifd_page(pss->pss_channel, block, offset); + } + +diff --git a/migration/socket.c b/migration/socket.c +index ebf9ac41af..f4835a256a 100644 +--- a/migration/socket.c ++++ b/migration/socket.c +@@ -183,7 +183,7 @@ socket_start_incoming_migration_internal(SocketAddress *saddr, + + qio_net_listener_set_name(listener, "migration-socket-listener"); + +- if (migrate_use_multifd()) { ++ if (migrate_multifd()) { + num = migrate_multifd_channels(); + } else if (migrate_postcopy_preempt()) { + num = RAM_CHANNEL_MAX; +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_return-to-options.c.patch b/kvm-migration-Move-migrate_use_return-to-options.c.patch new file mode 100644 index 0000000..b250d40 --- /dev/null +++ b/kvm-migration-Move-migrate_use_return-to-options.c.patch @@ -0,0 +1,138 @@ +From 145b630767dbc7020ddf39b20075f4691f71321a Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:25:47 +0100 +Subject: [PATCH 31/56] migration: Move migrate_use_return() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [30/50] 5cc150188bcc61b69ea0844253597594ab18fc13 (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_return_path() +to be consistent with all other capabilities. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 38ad1110e368bf91453c0abbd657224d57b65d47) +Signed-off-by: Peter Xu +--- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/rdma.c | 6 +++--- + 5 files changed, 14 insertions(+), 14 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 96f82bd165..f7facecd66 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2622,15 +2622,6 @@ static int64_t migrate_max_postcopy_bandwidth(void) + return s->parameters.max_postcopy_bandwidth; + } + +-bool migrate_use_return_path(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; +-} +- + bool migrate_use_block_incremental(void) + { + MigrationState *s; +@@ -4175,7 +4166,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) + * precopy, only if user specified "return-path" capability would + * QEMU uses the return path. + */ +- if (migrate_postcopy_ram() || migrate_use_return_path()) { ++ if (migrate_postcopy_ram() || migrate_return_path()) { + if (open_return_path_on_source(s, !resume)) { + error_report("Unable to open return-path for postcopy"); + migrate_set_state(&s->state, s->state, MIGRATION_STATUS_FAILED); +diff --git a/migration/migration.h b/migration/migration.h +index d4b68b08a5..24184622a8 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -459,7 +459,6 @@ uint64_t migrate_xbzrle_cache_size(void); + + bool migrate_use_block_incremental(void); + int migrate_max_cpu_throttle(void); +-bool migrate_use_return_path(void); + + uint64_t ram_get_total_transferred_pages(void); + +diff --git a/migration/options.c b/migration/options.c +index fe1eadeed6..2003e413da 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -147,6 +147,15 @@ bool migrate_release_ram(void) + return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; + } + ++bool migrate_return_path(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; ++} ++ + bool migrate_validate_uuid(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index e985a5233e..316efd1063 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -31,6 +31,7 @@ bool migrate_postcopy_blocktime(void); + bool migrate_postcopy_preempt(void); + bool migrate_postcopy_ram(void); + bool migrate_release_ram(void); ++bool migrate_return_path(void); + bool migrate_validate_uuid(void); + bool migrate_xbzrle(void); + bool migrate_zero_blocks(void); +diff --git a/migration/rdma.c b/migration/rdma.c +index f35f021963..bf55e2f163 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -3373,7 +3373,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) + * initialize the RDMAContext for return path for postcopy after first + * connection request reached. + */ +- if ((migrate_postcopy() || migrate_use_return_path()) ++ if ((migrate_postcopy() || migrate_return_path()) + && !rdma->is_return_path) { + rdma_return_path = qemu_rdma_data_init(rdma->host_port, NULL); + if (rdma_return_path == NULL) { +@@ -3456,7 +3456,7 @@ static int qemu_rdma_accept(RDMAContext *rdma) + } + + /* Accept the second connection request for return path */ +- if ((migrate_postcopy() || migrate_use_return_path()) ++ if ((migrate_postcopy() || migrate_return_path()) + && !rdma->is_return_path) { + qemu_set_fd_handler(rdma->channel->fd, rdma_accept_incoming_migration, + NULL, +@@ -4193,7 +4193,7 @@ void rdma_start_outgoing_migration(void *opaque, + } + + /* RDMA postcopy need a separate queue pair for return path */ +- if (migrate_postcopy() || migrate_use_return_path()) { ++ if (migrate_postcopy() || migrate_return_path()) { + rdma_return_path = qemu_rdma_data_init(host_port, errp); + + if (rdma_return_path == NULL) { +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_tls-to-options.c.patch b/kvm-migration-Move-migrate_use_tls-to-options.c.patch new file mode 100644 index 0000000..84734af --- /dev/null +++ b/kvm-migration-Move-migrate_use_tls-to-options.c.patch @@ -0,0 +1,134 @@ +From 2e2df63892e191e91216b8253171162f69b93387 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:41:23 +0100 +Subject: [PATCH 49/56] migration: Move migrate_use_tls() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [48/50] 314431b0f5e92d2211e58a8161f32d7b67d69e38 (peterx/qemu-kvm) + +Once there, rename it to migrate_tls() and make it return bool for +consistency. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy + +--- + +Fix typos found by fabiano + +(cherry picked from commit 10d4703be5d884bbbb6ecafe0e8bb270ad6ea937) +Signed-off-by: Peter Xu +--- + migration/migration.c | 9 --------- + migration/migration.h | 2 -- + migration/options.c | 11 ++++++++++- + migration/options.h | 1 + + migration/tls.c | 3 ++- + 5 files changed, 13 insertions(+), 13 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index c2e109329d..22ef83c619 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2177,15 +2177,6 @@ void qmp_migrate_continue(MigrationStatus state, Error **errp) + qemu_sem_post(&s->pause_sem); + } + +-int migrate_use_tls(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.tls_creds && *s->parameters.tls_creds; +-} +- + /* migration thread support */ + /* + * Something bad happened to the RP stream, mark an error +diff --git a/migration/migration.h b/migration/migration.h +index dcf906868d..2b71df8617 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -447,8 +447,6 @@ bool migration_is_blocked(Error **errp); + bool migration_in_postcopy(void); + MigrationState *migrate_get_current(void); + +-int migrate_use_tls(void); +- + uint64_t ram_get_total_transferred_pages(void); + + /* Sending on the return path - generic and then for each message type */ +diff --git a/migration/options.c b/migration/options.c +index 8e8753d9be..d4c0714683 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -214,6 +214,15 @@ bool migrate_postcopy(void) + return migrate_postcopy_ram() || migrate_dirty_bitmaps(); + } + ++bool migrate_tls(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.tls_creds && *s->parameters.tls_creds; ++} ++ + typedef enum WriteTrackingSupport { + WT_SUPPORT_UNKNOWN = 0, + WT_SUPPORT_ABSENT, +@@ -363,7 +372,7 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + new_caps[MIGRATION_CAPABILITY_COMPRESS] || + new_caps[MIGRATION_CAPABILITY_XBZRLE] || + migrate_multifd_compression() || +- migrate_use_tls())) { ++ migrate_tls())) { + error_setg(errp, + "Zero copy only available for non-compressed non-TLS multifd migration"); + return false; +diff --git a/migration/options.h b/migration/options.h +index 1b78fa9f3d..13318a16c7 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -46,6 +46,7 @@ bool migrate_zero_copy_send(void); + */ + + bool migrate_postcopy(void); ++bool migrate_tls(void); + + /* capabilities helpers */ + +diff --git a/migration/tls.c b/migration/tls.c +index 4d2166a209..acd38e0b62 100644 +--- a/migration/tls.c ++++ b/migration/tls.c +@@ -22,6 +22,7 @@ + #include "channel.h" + #include "migration.h" + #include "tls.h" ++#include "options.h" + #include "crypto/tlscreds.h" + #include "qemu/error-report.h" + #include "qapi/error.h" +@@ -165,7 +166,7 @@ void migration_tls_channel_connect(MigrationState *s, + + bool migrate_channel_requires_tls_upgrade(QIOChannel *ioc) + { +- if (!migrate_use_tls()) { ++ if (!migrate_tls()) { + return false; + } + +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch b/kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch new file mode 100644 index 0000000..e3a8bab --- /dev/null +++ b/kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch @@ -0,0 +1,156 @@ +From 2184f7dae0df5fa52deba2dc884e09c6bdbc7b5f Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:20:13 +0100 +Subject: [PATCH 29/56] migration: Move migrate_use_xbzrle() to options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [28/50] fc8bee0f691a96e6bd0b41f2511abe507b81fea5 (peterx/qemu-kvm) + +Once that we are there, we rename the function to migrate_xbzrle() +to be consistent with all other capabilities. +We change the type to return bool also for consistency. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 87dca0c9bb63014ef73ad82f7aedea1cb5a822e7) +Signed-off-by: Peter Xu +--- + migration/migration.c | 11 +---------- + migration/migration.h | 1 - + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/ram.c | 10 +++++----- + 5 files changed, 16 insertions(+), 16 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 1d63718e88..a4ede4294e 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1122,7 +1122,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->downtime_bytes = stat64_get(&ram_counters.downtime_bytes); + info->ram->postcopy_bytes = stat64_get(&ram_counters.postcopy_bytes); + +- if (migrate_use_xbzrle()) { ++ if (migrate_xbzrle()) { + info->xbzrle_cache = g_malloc0(sizeof(*info->xbzrle_cache)); + info->xbzrle_cache->cache_size = migrate_xbzrle_cache_size(); + info->xbzrle_cache->bytes = xbzrle_counters.bytes; +@@ -2604,15 +2604,6 @@ int migrate_use_tls(void) + return s->parameters.tls_creds && *s->parameters.tls_creds; + } + +-int migrate_use_xbzrle(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_XBZRLE]; +-} +- + uint64_t migrate_xbzrle_cache_size(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index c939f82d53..e2bb5b1e2f 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -455,7 +455,6 @@ int migrate_multifd_zlib_level(void); + int migrate_multifd_zstd_level(void); + + int migrate_use_tls(void); +-int migrate_use_xbzrle(void); + uint64_t migrate_xbzrle_cache_size(void); + + bool migrate_use_block(void); +diff --git a/migration/options.c b/migration/options.c +index f357c99996..25264c500e 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -147,6 +147,15 @@ bool migrate_validate_uuid(void) + return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; + } + ++bool migrate_xbzrle(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_XBZRLE]; ++} ++ + bool migrate_zero_blocks(void) + { + MigrationState *s; +diff --git a/migration/options.h b/migration/options.h +index ad22f4d24a..8f76a88329 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -31,6 +31,7 @@ bool migrate_postcopy_preempt(void); + bool migrate_postcopy_ram(void); + bool migrate_release_ram(void); + bool migrate_validate_uuid(void); ++bool migrate_xbzrle(void); + bool migrate_zero_blocks(void); + bool migrate_zero_copy_send(void); + +diff --git a/migration/ram.c b/migration/ram.c +index 859dd7b63f..4576d0d849 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -156,14 +156,14 @@ static struct { + + static void XBZRLE_cache_lock(void) + { +- if (migrate_use_xbzrle()) { ++ if (migrate_xbzrle()) { + qemu_mutex_lock(&XBZRLE.lock); + } + } + + static void XBZRLE_cache_unlock(void) + { +- if (migrate_use_xbzrle()) { ++ if (migrate_xbzrle()) { + qemu_mutex_unlock(&XBZRLE.lock); + } + } +@@ -1137,7 +1137,7 @@ static void migration_update_rates(RAMState *rs, int64_t end_time) + return; + } + +- if (migrate_use_xbzrle()) { ++ if (migrate_xbzrle()) { + double encoded_size, unencoded_size; + + xbzrle_counters.cache_miss_rate = (double)(xbzrle_counters.cache_miss - +@@ -1626,7 +1626,7 @@ static int find_dirty_block(RAMState *rs, PageSearchStatus *pss) + /* Flag that we've looped */ + pss->complete_round = true; + /* After the first round, enable XBZRLE. */ +- if (migrate_use_xbzrle()) { ++ if (migrate_xbzrle()) { + rs->xbzrle_enabled = true; + } + } +@@ -2979,7 +2979,7 @@ static int xbzrle_init(void) + { + Error *local_err = NULL; + +- if (!migrate_use_xbzrle()) { ++ if (!migrate_xbzrle()) { + return 0; + } + +-- +2.39.1 + diff --git a/kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch b/kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch new file mode 100644 index 0000000..90031df --- /dev/null +++ b/kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch @@ -0,0 +1,167 @@ +From 6eb252887378d639ad2e90dd426a1812d4b72ca6 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 22:17:14 +0100 +Subject: [PATCH 28/56] migration: Move migrate_use_zero_copy_send() to + options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [27/50] 5a4c2b5e75c62e0f60f9c4121a2756bd140a60d9 (peterx/qemu-kvm) + +Once that we are there, we rename the function to +migrate_zero_copy_send() to be consistent with all other capabilities. + +We can remove the CONFIG_LINUX guard. We already check that we can't +setup this capability in migrate_caps_check(). + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit b4bc342c766640e0cb8a0b72f71e0ee5545fb790) +Signed-off-by: Peter Xu +--- + migration/migration.c | 13 +------------ + migration/migration.h | 5 ----- + migration/multifd.c | 8 ++++---- + migration/options.c | 9 +++++++++ + migration/options.h | 1 + + migration/socket.c | 2 +- + 6 files changed, 16 insertions(+), 22 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index e1d7f25786..1d63718e88 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1609,7 +1609,7 @@ static bool migrate_params_check(MigrationParameters *params, Error **errp) + } + + #ifdef CONFIG_LINUX +- if (migrate_use_zero_copy_send() && ++ if (migrate_zero_copy_send() && + ((params->has_multifd_compression && params->multifd_compression) || + (params->tls_creds && *params->tls_creds))) { + error_setg(errp, +@@ -2595,17 +2595,6 @@ int migrate_multifd_zstd_level(void) + return s->parameters.multifd_zstd_level; + } + +-#ifdef CONFIG_LINUX +-bool migrate_use_zero_copy_send(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; +-} +-#endif +- + int migrate_use_tls(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index 49c0e13f41..c939f82d53 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -454,11 +454,6 @@ MultiFDCompression migrate_multifd_compression(void); + int migrate_multifd_zlib_level(void); + int migrate_multifd_zstd_level(void); + +-#ifdef CONFIG_LINUX +-bool migrate_use_zero_copy_send(void); +-#else +-#define migrate_use_zero_copy_send() (false) +-#endif + int migrate_use_tls(void); + int migrate_use_xbzrle(void); + uint64_t migrate_xbzrle_cache_size(void); +diff --git a/migration/multifd.c b/migration/multifd.c +index 6807328189..cce3ad6988 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -25,7 +25,7 @@ + #include "trace.h" + #include "multifd.h" + #include "threadinfo.h" +- ++#include "options.h" + #include "qemu/yank.h" + #include "io/channel-socket.h" + #include "yank_functions.h" +@@ -608,7 +608,7 @@ int multifd_send_sync_main(QEMUFile *f) + * all the dirty bitmaps. + */ + +- flush_zero_copy = migrate_use_zero_copy_send(); ++ flush_zero_copy = migrate_zero_copy_send(); + + for (i = 0; i < migrate_multifd_channels(); i++) { + MultiFDSendParams *p = &multifd_send_state->params[i]; +@@ -653,7 +653,7 @@ static void *multifd_send_thread(void *opaque) + MigrationThread *thread = NULL; + Error *local_err = NULL; + int ret = 0; +- bool use_zero_copy_send = migrate_use_zero_copy_send(); ++ bool use_zero_copy_send = migrate_zero_copy_send(); + + thread = MigrationThreadAdd(p->name, qemu_get_thread_id()); + +@@ -945,7 +945,7 @@ int multifd_save_setup(Error **errp) + p->page_size = qemu_target_page_size(); + p->page_count = page_count; + +- if (migrate_use_zero_copy_send()) { ++ if (migrate_zero_copy_send()) { + p->write_flags = QIO_CHANNEL_WRITE_FLAG_ZERO_COPY; + } else { + p->write_flags = 0; +diff --git a/migration/options.c b/migration/options.c +index 58673fc101..f357c99996 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -155,3 +155,12 @@ bool migrate_zero_blocks(void) + + return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; + } ++ ++bool migrate_zero_copy_send(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; ++} +diff --git a/migration/options.h b/migration/options.h +index d07269ee38..ad22f4d24a 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -32,5 +32,6 @@ bool migrate_postcopy_ram(void); + bool migrate_release_ram(void); + bool migrate_validate_uuid(void); + bool migrate_zero_blocks(void); ++bool migrate_zero_copy_send(void); + + #endif +diff --git a/migration/socket.c b/migration/socket.c +index f4835a256a..1b6f5baefb 100644 +--- a/migration/socket.c ++++ b/migration/socket.c +@@ -98,7 +98,7 @@ static void socket_outgoing_migration(QIOTask *task, + + trace_migration_socket_outgoing_connected(data->hostname); + +- if (migrate_use_zero_copy_send() && ++ if (migrate_zero_copy_send() && + !qio_channel_has_feature(sioc, QIO_CHANNEL_FEATURE_WRITE_ZERO_COPY)) { + error_setg(&err, "Zero copy send feature not detected in host kernel"); + } +-- +2.39.1 + diff --git a/kvm-migration-Move-parameters-functions-to-option.c.patch b/kvm-migration-Move-parameters-functions-to-option.c.patch new file mode 100644 index 0000000..ad4510b --- /dev/null +++ b/kvm-migration-Move-parameters-functions-to-option.c.patch @@ -0,0 +1,317 @@ +From d5ea4c82c44a59ac70313eb1eac77999ca5fde36 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 00:39:03 +0100 +Subject: [PATCH 37/56] migration: Move parameters functions to option.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [36/50] 2540921028025504723e762c0a1d2f295ac5a6d1 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 1dfc4b9e19bcf1ad41a1be9ac82db35b9647c3c1) +Signed-off-by: Peter Xu +--- + migration/migration.c | 91 --------------------------------------- + migration/migration.h | 11 ----- + migration/multifd-zlib.c | 1 + + migration/multifd-zstd.c | 1 + + migration/options.c | 93 ++++++++++++++++++++++++++++++++++++++++ + migration/options.h | 13 ++++++ + 6 files changed, 108 insertions(+), 102 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 880a51210e..7f2e770deb 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2264,79 +2264,6 @@ bool migrate_postcopy(void) + return migrate_postcopy_ram() || migrate_dirty_bitmaps(); + } + +-int migrate_compress_level(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.compress_level; +-} +- +-int migrate_compress_threads(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.compress_threads; +-} +- +-int migrate_compress_wait_thread(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.compress_wait_thread; +-} +- +-int migrate_decompress_threads(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.decompress_threads; +-} +- +-int migrate_multifd_channels(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.multifd_channels; +-} +- +-MultiFDCompression migrate_multifd_compression(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- assert(s->parameters.multifd_compression < MULTIFD_COMPRESSION__MAX); +- return s->parameters.multifd_compression; +-} +- +-int migrate_multifd_zlib_level(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.multifd_zlib_level; +-} +- +-int migrate_multifd_zstd_level(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.multifd_zstd_level; +-} +- + int migrate_use_tls(void) + { + MigrationState *s; +@@ -2346,24 +2273,6 @@ int migrate_use_tls(void) + return s->parameters.tls_creds && *s->parameters.tls_creds; + } + +-uint64_t migrate_xbzrle_cache_size(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.xbzrle_cache_size; +-} +- +-static int64_t migrate_max_postcopy_bandwidth(void) +-{ +- MigrationState *s; +- +- s = migrate_get_current(); +- +- return s->parameters.max_postcopy_bandwidth; +-} +- + bool migrate_use_block_incremental(void) + { + MigrationState *s; +diff --git a/migration/migration.h b/migration/migration.h +index 24184622a8..8451e5f2fe 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -449,24 +449,13 @@ MigrationState *migrate_get_current(void); + + bool migrate_postcopy(void); + +-int migrate_multifd_channels(void); +-MultiFDCompression migrate_multifd_compression(void); +-int migrate_multifd_zlib_level(void); +-int migrate_multifd_zstd_level(void); +- + int migrate_use_tls(void); +-uint64_t migrate_xbzrle_cache_size(void); + + bool migrate_use_block_incremental(void); + int migrate_max_cpu_throttle(void); + + uint64_t ram_get_total_transferred_pages(void); + +-int migrate_compress_level(void); +-int migrate_compress_threads(void); +-int migrate_compress_wait_thread(void); +-int migrate_decompress_threads(void); +- + /* Sending on the return path - generic and then for each message type */ + void migrate_send_rp_shut(MigrationIncomingState *mis, + uint32_t value); +diff --git a/migration/multifd-zlib.c b/migration/multifd-zlib.c +index 37770248e1..81701250ad 100644 +--- a/migration/multifd-zlib.c ++++ b/migration/multifd-zlib.c +@@ -18,6 +18,7 @@ + #include "qapi/error.h" + #include "migration.h" + #include "trace.h" ++#include "options.h" + #include "multifd.h" + + struct zlib_data { +diff --git a/migration/multifd-zstd.c b/migration/multifd-zstd.c +index f4a8e1ed1f..d1d29e76cc 100644 +--- a/migration/multifd-zstd.c ++++ b/migration/multifd-zstd.c +@@ -18,6 +18,7 @@ + #include "qapi/error.h" + #include "migration.h" + #include "trace.h" ++#include "options.h" + #include "multifd.h" + + struct zstd_data { +diff --git a/migration/options.c b/migration/options.c +index f3b2d6e482..8d15be858c 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -460,3 +460,96 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, + s->capabilities[cap->value->capability] = cap->value->state; + } + } ++ ++/* parameters */ ++ ++int migrate_compress_level(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.compress_level; ++} ++ ++int migrate_compress_threads(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.compress_threads; ++} ++ ++int migrate_compress_wait_thread(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.compress_wait_thread; ++} ++ ++int migrate_decompress_threads(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.decompress_threads; ++} ++ ++int64_t migrate_max_postcopy_bandwidth(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.max_postcopy_bandwidth; ++} ++ ++int migrate_multifd_channels(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.multifd_channels; ++} ++ ++MultiFDCompression migrate_multifd_compression(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ assert(s->parameters.multifd_compression < MULTIFD_COMPRESSION__MAX); ++ return s->parameters.multifd_compression; ++} ++ ++int migrate_multifd_zlib_level(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.multifd_zlib_level; ++} ++ ++int migrate_multifd_zstd_level(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.multifd_zstd_level; ++} ++ ++uint64_t migrate_xbzrle_cache_size(void) ++{ ++ MigrationState *s; ++ ++ s = migrate_get_current(); ++ ++ return s->parameters.xbzrle_cache_size; ++} +diff --git a/migration/options.h b/migration/options.h +index 5979e4ff90..b24ee92283 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -43,4 +43,17 @@ bool migrate_zero_copy_send(void); + bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp); + bool migrate_cap_set(int cap, bool value, Error **errp); + ++/* parameters */ ++ ++int migrate_compress_level(void); ++int migrate_compress_threads(void); ++int migrate_compress_wait_thread(void); ++int migrate_decompress_threads(void); ++int64_t migrate_max_postcopy_bandwidth(void); ++int migrate_multifd_channels(void); ++MultiFDCompression migrate_multifd_compression(void); ++int migrate_multifd_zlib_level(void); ++int migrate_multifd_zstd_level(void); ++uint64_t migrate_xbzrle_cache_size(void); ++ + #endif +-- +2.39.1 + diff --git a/kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch b/kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch new file mode 100644 index 0000000..10f185b --- /dev/null +++ b/kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch @@ -0,0 +1,100 @@ +From d967ec22cdb20e0a846f050a2bc7bd4caa87940d Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 23:18:02 +0100 +Subject: [PATCH 35/56] migration: Move qmp_migrate_set_capabilities() to + options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [34/50] 16b62ca7e06c58d71389c449dc19c11939dd0882 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 45c1de13f09b1fd4ea26f54e6da12aae52f34cb8) +Signed-off-by: Peter Xu +--- + migration/migration.c | 26 -------------------------- + migration/options.c | 26 ++++++++++++++++++++++++++ + 2 files changed, 26 insertions(+), 26 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 3dc8ee4875..369cd91796 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1222,32 +1222,6 @@ MigrationInfo *qmp_query_migrate(Error **errp) + return info; + } + +-void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, +- Error **errp) +-{ +- MigrationState *s = migrate_get_current(); +- MigrationCapabilityStatusList *cap; +- bool new_caps[MIGRATION_CAPABILITY__MAX]; +- +- if (migration_is_running(s->state)) { +- error_setg(errp, QERR_MIGRATION_ACTIVE); +- return; +- } +- +- memcpy(new_caps, s->capabilities, sizeof(new_caps)); +- for (cap = params; cap; cap = cap->next) { +- new_caps[cap->value->capability] = cap->value->state; +- } +- +- if (!migrate_caps_check(s->capabilities, new_caps, errp)) { +- return; +- } +- +- for (cap = params; cap; cap = cap->next) { +- s->capabilities[cap->value->capability] = cap->value->state; +- } +-} +- + /* + * Check whether the parameters are valid. Error will be put into errp + * (if provided). Return true if valid, otherwise false. +diff --git a/migration/options.c b/migration/options.c +index ff621bdeb3..4cbe77e35a 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -413,3 +413,29 @@ MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) + + return head; + } ++ ++void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, ++ Error **errp) ++{ ++ MigrationState *s = migrate_get_current(); ++ MigrationCapabilityStatusList *cap; ++ bool new_caps[MIGRATION_CAPABILITY__MAX]; ++ ++ if (migration_is_running(s->state)) { ++ error_setg(errp, QERR_MIGRATION_ACTIVE); ++ return; ++ } ++ ++ memcpy(new_caps, s->capabilities, sizeof(new_caps)); ++ for (cap = params; cap; cap = cap->next) { ++ new_caps[cap->value->capability] = cap->value->state; ++ } ++ ++ if (!migrate_caps_check(s->capabilities, new_caps, errp)) { ++ return; ++ } ++ ++ for (cap = params; cap; cap = cap->next) { ++ s->capabilities[cap->value->capability] = cap->value->state; ++ } ++} +-- +2.39.1 + diff --git a/kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch b/kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch new file mode 100644 index 0000000..3685a33 --- /dev/null +++ b/kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch @@ -0,0 +1,943 @@ +From 944bf4759d1279c342ddd29c47d47c9670b64625 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:13:16 +0100 +Subject: [PATCH 50/56] migration: Move qmp_migrate_set_parameters() to + options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [49/50] b55f7afe868e117d4212f1518b9a37514cc99b33 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 09d6c9658474e8573c5ada58dca8b20fe47dd99e) +Signed-off-by: Peter Xu +--- + migration/migration.c | 420 ------------------------------------------ + migration/options.c | 418 +++++++++++++++++++++++++++++++++++++++++ + migration/options.h | 11 ++ + 3 files changed, 429 insertions(+), 420 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 22ef83c619..08f87f2b0e 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -67,19 +67,10 @@ + + #define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling */ + +-/* Amount of time to allocate to each "chunk" of bandwidth-throttled +- * data. */ +-#define BUFFER_DELAY 100 +-#define XFER_LIMIT_RATIO (1000 / BUFFER_DELAY) +- + /* Time in milliseconds we are allowed to stop the source, + * for sending the last part */ + #define DEFAULT_MIGRATE_SET_DOWNTIME 300 + +-/* Maximum migrate downtime set to 2000 seconds */ +-#define MAX_MIGRATE_DOWNTIME_SECONDS 2000 +-#define MAX_MIGRATE_DOWNTIME (MAX_MIGRATE_DOWNTIME_SECONDS * 1000) +- + /* Default compression thread count */ + #define DEFAULT_MIGRATE_COMPRESS_THREAD_COUNT 8 + /* Default decompression thread count, usually decompression is at +@@ -1140,417 +1131,6 @@ MigrationInfo *qmp_query_migrate(Error **errp) + return info; + } + +-/* +- * Check whether the parameters are valid. Error will be put into errp +- * (if provided). Return true if valid, otherwise false. +- */ +-static bool migrate_params_check(MigrationParameters *params, Error **errp) +-{ +- if (params->has_compress_level && +- (params->compress_level > 9)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", +- "a value between 0 and 9"); +- return false; +- } +- +- if (params->has_compress_threads && (params->compress_threads < 1)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "compress_threads", +- "a value between 1 and 255"); +- return false; +- } +- +- if (params->has_decompress_threads && (params->decompress_threads < 1)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "decompress_threads", +- "a value between 1 and 255"); +- return false; +- } +- +- if (params->has_throttle_trigger_threshold && +- (params->throttle_trigger_threshold < 1 || +- params->throttle_trigger_threshold > 100)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "throttle_trigger_threshold", +- "an integer in the range of 1 to 100"); +- return false; +- } +- +- if (params->has_cpu_throttle_initial && +- (params->cpu_throttle_initial < 1 || +- params->cpu_throttle_initial > 99)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "cpu_throttle_initial", +- "an integer in the range of 1 to 99"); +- return false; +- } +- +- if (params->has_cpu_throttle_increment && +- (params->cpu_throttle_increment < 1 || +- params->cpu_throttle_increment > 99)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "cpu_throttle_increment", +- "an integer in the range of 1 to 99"); +- return false; +- } +- +- if (params->has_max_bandwidth && (params->max_bandwidth > SIZE_MAX)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "max_bandwidth", +- "an integer in the range of 0 to "stringify(SIZE_MAX) +- " bytes/second"); +- return false; +- } +- +- if (params->has_downtime_limit && +- (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "downtime_limit", +- "an integer in the range of 0 to " +- stringify(MAX_MIGRATE_DOWNTIME)" ms"); +- return false; +- } +- +- /* x_checkpoint_delay is now always positive */ +- +- if (params->has_multifd_channels && (params->multifd_channels < 1)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "multifd_channels", +- "a value between 1 and 255"); +- return false; +- } +- +- if (params->has_multifd_zlib_level && +- (params->multifd_zlib_level > 9)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zlib_level", +- "a value between 0 and 9"); +- return false; +- } +- +- if (params->has_multifd_zstd_level && +- (params->multifd_zstd_level > 20)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zstd_level", +- "a value between 0 and 20"); +- return false; +- } +- +- if (params->has_xbzrle_cache_size && +- (params->xbzrle_cache_size < qemu_target_page_size() || +- !is_power_of_2(params->xbzrle_cache_size))) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "xbzrle_cache_size", +- "a power of two no less than the target page size"); +- return false; +- } +- +- if (params->has_max_cpu_throttle && +- (params->max_cpu_throttle < params->cpu_throttle_initial || +- params->max_cpu_throttle > 99)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "max_cpu_throttle", +- "an integer in the range of cpu_throttle_initial to 99"); +- return false; +- } +- +- if (params->has_announce_initial && +- params->announce_initial > 100000) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "announce_initial", +- "a value between 0 and 100000"); +- return false; +- } +- if (params->has_announce_max && +- params->announce_max > 100000) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "announce_max", +- "a value between 0 and 100000"); +- return false; +- } +- if (params->has_announce_rounds && +- params->announce_rounds > 1000) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "announce_rounds", +- "a value between 0 and 1000"); +- return false; +- } +- if (params->has_announce_step && +- (params->announce_step < 1 || +- params->announce_step > 10000)) { +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, +- "announce_step", +- "a value between 0 and 10000"); +- return false; +- } +- +- if (params->has_block_bitmap_mapping && +- !check_dirty_bitmap_mig_alias_map(params->block_bitmap_mapping, errp)) { +- error_prepend(errp, "Invalid mapping given for block-bitmap-mapping: "); +- return false; +- } +- +-#ifdef CONFIG_LINUX +- if (migrate_zero_copy_send() && +- ((params->has_multifd_compression && params->multifd_compression) || +- (params->tls_creds && *params->tls_creds))) { +- error_setg(errp, +- "Zero copy only available for non-compressed non-TLS multifd migration"); +- return false; +- } +-#endif +- +- return true; +-} +- +-static void migrate_params_test_apply(MigrateSetParameters *params, +- MigrationParameters *dest) +-{ +- *dest = migrate_get_current()->parameters; +- +- /* TODO use QAPI_CLONE() instead of duplicating it inline */ +- +- if (params->has_compress_level) { +- dest->compress_level = params->compress_level; +- } +- +- if (params->has_compress_threads) { +- dest->compress_threads = params->compress_threads; +- } +- +- if (params->has_compress_wait_thread) { +- dest->compress_wait_thread = params->compress_wait_thread; +- } +- +- if (params->has_decompress_threads) { +- dest->decompress_threads = params->decompress_threads; +- } +- +- if (params->has_throttle_trigger_threshold) { +- dest->throttle_trigger_threshold = params->throttle_trigger_threshold; +- } +- +- if (params->has_cpu_throttle_initial) { +- dest->cpu_throttle_initial = params->cpu_throttle_initial; +- } +- +- if (params->has_cpu_throttle_increment) { +- dest->cpu_throttle_increment = params->cpu_throttle_increment; +- } +- +- if (params->has_cpu_throttle_tailslow) { +- dest->cpu_throttle_tailslow = params->cpu_throttle_tailslow; +- } +- +- if (params->tls_creds) { +- assert(params->tls_creds->type == QTYPE_QSTRING); +- dest->tls_creds = params->tls_creds->u.s; +- } +- +- if (params->tls_hostname) { +- assert(params->tls_hostname->type == QTYPE_QSTRING); +- dest->tls_hostname = params->tls_hostname->u.s; +- } +- +- if (params->has_max_bandwidth) { +- dest->max_bandwidth = params->max_bandwidth; +- } +- +- if (params->has_downtime_limit) { +- dest->downtime_limit = params->downtime_limit; +- } +- +- if (params->has_x_checkpoint_delay) { +- dest->x_checkpoint_delay = params->x_checkpoint_delay; +- } +- +- if (params->has_block_incremental) { +- dest->block_incremental = params->block_incremental; +- } +- if (params->has_multifd_channels) { +- dest->multifd_channels = params->multifd_channels; +- } +- if (params->has_multifd_compression) { +- dest->multifd_compression = params->multifd_compression; +- } +- if (params->has_xbzrle_cache_size) { +- dest->xbzrle_cache_size = params->xbzrle_cache_size; +- } +- if (params->has_max_postcopy_bandwidth) { +- dest->max_postcopy_bandwidth = params->max_postcopy_bandwidth; +- } +- if (params->has_max_cpu_throttle) { +- dest->max_cpu_throttle = params->max_cpu_throttle; +- } +- if (params->has_announce_initial) { +- dest->announce_initial = params->announce_initial; +- } +- if (params->has_announce_max) { +- dest->announce_max = params->announce_max; +- } +- if (params->has_announce_rounds) { +- dest->announce_rounds = params->announce_rounds; +- } +- if (params->has_announce_step) { +- dest->announce_step = params->announce_step; +- } +- +- if (params->has_block_bitmap_mapping) { +- dest->has_block_bitmap_mapping = true; +- dest->block_bitmap_mapping = params->block_bitmap_mapping; +- } +-} +- +-static void migrate_params_apply(MigrateSetParameters *params, Error **errp) +-{ +- MigrationState *s = migrate_get_current(); +- +- /* TODO use QAPI_CLONE() instead of duplicating it inline */ +- +- if (params->has_compress_level) { +- s->parameters.compress_level = params->compress_level; +- } +- +- if (params->has_compress_threads) { +- s->parameters.compress_threads = params->compress_threads; +- } +- +- if (params->has_compress_wait_thread) { +- s->parameters.compress_wait_thread = params->compress_wait_thread; +- } +- +- if (params->has_decompress_threads) { +- s->parameters.decompress_threads = params->decompress_threads; +- } +- +- if (params->has_throttle_trigger_threshold) { +- s->parameters.throttle_trigger_threshold = params->throttle_trigger_threshold; +- } +- +- if (params->has_cpu_throttle_initial) { +- s->parameters.cpu_throttle_initial = params->cpu_throttle_initial; +- } +- +- if (params->has_cpu_throttle_increment) { +- s->parameters.cpu_throttle_increment = params->cpu_throttle_increment; +- } +- +- if (params->has_cpu_throttle_tailslow) { +- s->parameters.cpu_throttle_tailslow = params->cpu_throttle_tailslow; +- } +- +- if (params->tls_creds) { +- g_free(s->parameters.tls_creds); +- assert(params->tls_creds->type == QTYPE_QSTRING); +- s->parameters.tls_creds = g_strdup(params->tls_creds->u.s); +- } +- +- if (params->tls_hostname) { +- g_free(s->parameters.tls_hostname); +- assert(params->tls_hostname->type == QTYPE_QSTRING); +- s->parameters.tls_hostname = g_strdup(params->tls_hostname->u.s); +- } +- +- if (params->tls_authz) { +- g_free(s->parameters.tls_authz); +- assert(params->tls_authz->type == QTYPE_QSTRING); +- s->parameters.tls_authz = g_strdup(params->tls_authz->u.s); +- } +- +- if (params->has_max_bandwidth) { +- s->parameters.max_bandwidth = params->max_bandwidth; +- if (s->to_dst_file && !migration_in_postcopy()) { +- qemu_file_set_rate_limit(s->to_dst_file, +- s->parameters.max_bandwidth / XFER_LIMIT_RATIO); +- } +- } +- +- if (params->has_downtime_limit) { +- s->parameters.downtime_limit = params->downtime_limit; +- } +- +- if (params->has_x_checkpoint_delay) { +- s->parameters.x_checkpoint_delay = params->x_checkpoint_delay; +- if (migration_in_colo_state()) { +- colo_checkpoint_notify(s); +- } +- } +- +- if (params->has_block_incremental) { +- s->parameters.block_incremental = params->block_incremental; +- } +- if (params->has_multifd_channels) { +- s->parameters.multifd_channels = params->multifd_channels; +- } +- if (params->has_multifd_compression) { +- s->parameters.multifd_compression = params->multifd_compression; +- } +- if (params->has_xbzrle_cache_size) { +- s->parameters.xbzrle_cache_size = params->xbzrle_cache_size; +- xbzrle_cache_resize(params->xbzrle_cache_size, errp); +- } +- if (params->has_max_postcopy_bandwidth) { +- s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth; +- if (s->to_dst_file && migration_in_postcopy()) { +- qemu_file_set_rate_limit(s->to_dst_file, +- s->parameters.max_postcopy_bandwidth / XFER_LIMIT_RATIO); +- } +- } +- if (params->has_max_cpu_throttle) { +- s->parameters.max_cpu_throttle = params->max_cpu_throttle; +- } +- if (params->has_announce_initial) { +- s->parameters.announce_initial = params->announce_initial; +- } +- if (params->has_announce_max) { +- s->parameters.announce_max = params->announce_max; +- } +- if (params->has_announce_rounds) { +- s->parameters.announce_rounds = params->announce_rounds; +- } +- if (params->has_announce_step) { +- s->parameters.announce_step = params->announce_step; +- } +- +- if (params->has_block_bitmap_mapping) { +- qapi_free_BitmapMigrationNodeAliasList( +- s->parameters.block_bitmap_mapping); +- +- s->parameters.has_block_bitmap_mapping = true; +- s->parameters.block_bitmap_mapping = +- QAPI_CLONE(BitmapMigrationNodeAliasList, +- params->block_bitmap_mapping); +- } +-} +- +-void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp) +-{ +- MigrationParameters tmp; +- +- /* TODO Rewrite "" to null instead */ +- if (params->tls_creds +- && params->tls_creds->type == QTYPE_QNULL) { +- qobject_unref(params->tls_creds->u.n); +- params->tls_creds->type = QTYPE_QSTRING; +- params->tls_creds->u.s = strdup(""); +- } +- /* TODO Rewrite "" to null instead */ +- if (params->tls_hostname +- && params->tls_hostname->type == QTYPE_QNULL) { +- qobject_unref(params->tls_hostname->u.n); +- params->tls_hostname->type = QTYPE_QSTRING; +- params->tls_hostname->u.s = strdup(""); +- } +- +- migrate_params_test_apply(params, &tmp); +- +- if (!migrate_params_check(&tmp, errp)) { +- /* Invalid parameter */ +- return; +- } +- +- migrate_params_apply(params, errp); +-} +- +- + void qmp_migrate_start_postcopy(Error **errp) + { + MigrationState *s = migrate_get_current(); +diff --git a/migration/options.c b/migration/options.c +index d4c0714683..4701c75a4d 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -12,17 +12,25 @@ + */ + + #include "qemu/osdep.h" ++#include "exec/target_page.h" + #include "qapi/clone-visitor.h" + #include "qapi/error.h" + #include "qapi/qapi-commands-migration.h" + #include "qapi/qapi-visit-migration.h" + #include "qapi/qmp/qerror.h" ++#include "qapi/qmp/qnull.h" + #include "sysemu/runstate.h" ++#include "migration/colo.h" + #include "migration/misc.h" + #include "migration.h" ++#include "qemu-file.h" + #include "ram.h" + #include "options.h" + ++/* Maximum migrate downtime set to 2000 seconds */ ++#define MAX_MIGRATE_DOWNTIME_SECONDS 2000 ++#define MAX_MIGRATE_DOWNTIME (MAX_MIGRATE_DOWNTIME_SECONDS * 1000) ++ + bool migrate_auto_converge(void) + { + MigrationState *s; +@@ -729,3 +737,413 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) + + return params; + } ++ ++/* ++ * Check whether the parameters are valid. Error will be put into errp ++ * (if provided). Return true if valid, otherwise false. ++ */ ++bool migrate_params_check(MigrationParameters *params, Error **errp) ++{ ++ if (params->has_compress_level && ++ (params->compress_level > 9)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "compress_level", ++ "a value between 0 and 9"); ++ return false; ++ } ++ ++ if (params->has_compress_threads && (params->compress_threads < 1)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "compress_threads", ++ "a value between 1 and 255"); ++ return false; ++ } ++ ++ if (params->has_decompress_threads && (params->decompress_threads < 1)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "decompress_threads", ++ "a value between 1 and 255"); ++ return false; ++ } ++ ++ if (params->has_throttle_trigger_threshold && ++ (params->throttle_trigger_threshold < 1 || ++ params->throttle_trigger_threshold > 100)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "throttle_trigger_threshold", ++ "an integer in the range of 1 to 100"); ++ return false; ++ } ++ ++ if (params->has_cpu_throttle_initial && ++ (params->cpu_throttle_initial < 1 || ++ params->cpu_throttle_initial > 99)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "cpu_throttle_initial", ++ "an integer in the range of 1 to 99"); ++ return false; ++ } ++ ++ if (params->has_cpu_throttle_increment && ++ (params->cpu_throttle_increment < 1 || ++ params->cpu_throttle_increment > 99)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "cpu_throttle_increment", ++ "an integer in the range of 1 to 99"); ++ return false; ++ } ++ ++ if (params->has_max_bandwidth && (params->max_bandwidth > SIZE_MAX)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "max_bandwidth", ++ "an integer in the range of 0 to "stringify(SIZE_MAX) ++ " bytes/second"); ++ return false; ++ } ++ ++ if (params->has_downtime_limit && ++ (params->downtime_limit > MAX_MIGRATE_DOWNTIME)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "downtime_limit", ++ "an integer in the range of 0 to " ++ stringify(MAX_MIGRATE_DOWNTIME)" ms"); ++ return false; ++ } ++ ++ /* x_checkpoint_delay is now always positive */ ++ ++ if (params->has_multifd_channels && (params->multifd_channels < 1)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "multifd_channels", ++ "a value between 1 and 255"); ++ return false; ++ } ++ ++ if (params->has_multifd_zlib_level && ++ (params->multifd_zlib_level > 9)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zlib_level", ++ "a value between 0 and 9"); ++ return false; ++ } ++ ++ if (params->has_multifd_zstd_level && ++ (params->multifd_zstd_level > 20)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "multifd_zstd_level", ++ "a value between 0 and 20"); ++ return false; ++ } ++ ++ if (params->has_xbzrle_cache_size && ++ (params->xbzrle_cache_size < qemu_target_page_size() || ++ !is_power_of_2(params->xbzrle_cache_size))) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "xbzrle_cache_size", ++ "a power of two no less than the target page size"); ++ return false; ++ } ++ ++ if (params->has_max_cpu_throttle && ++ (params->max_cpu_throttle < params->cpu_throttle_initial || ++ params->max_cpu_throttle > 99)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "max_cpu_throttle", ++ "an integer in the range of cpu_throttle_initial to 99"); ++ return false; ++ } ++ ++ if (params->has_announce_initial && ++ params->announce_initial > 100000) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "announce_initial", ++ "a value between 0 and 100000"); ++ return false; ++ } ++ if (params->has_announce_max && ++ params->announce_max > 100000) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "announce_max", ++ "a value between 0 and 100000"); ++ return false; ++ } ++ if (params->has_announce_rounds && ++ params->announce_rounds > 1000) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "announce_rounds", ++ "a value between 0 and 1000"); ++ return false; ++ } ++ if (params->has_announce_step && ++ (params->announce_step < 1 || ++ params->announce_step > 10000)) { ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, ++ "announce_step", ++ "a value between 0 and 10000"); ++ return false; ++ } ++ ++ if (params->has_block_bitmap_mapping && ++ !check_dirty_bitmap_mig_alias_map(params->block_bitmap_mapping, errp)) { ++ error_prepend(errp, "Invalid mapping given for block-bitmap-mapping: "); ++ return false; ++ } ++ ++#ifdef CONFIG_LINUX ++ if (migrate_zero_copy_send() && ++ ((params->has_multifd_compression && params->multifd_compression) || ++ (params->tls_creds && *params->tls_creds))) { ++ error_setg(errp, ++ "Zero copy only available for non-compressed non-TLS multifd migration"); ++ return false; ++ } ++#endif ++ ++ return true; ++} ++ ++static void migrate_params_test_apply(MigrateSetParameters *params, ++ MigrationParameters *dest) ++{ ++ *dest = migrate_get_current()->parameters; ++ ++ /* TODO use QAPI_CLONE() instead of duplicating it inline */ ++ ++ if (params->has_compress_level) { ++ dest->compress_level = params->compress_level; ++ } ++ ++ if (params->has_compress_threads) { ++ dest->compress_threads = params->compress_threads; ++ } ++ ++ if (params->has_compress_wait_thread) { ++ dest->compress_wait_thread = params->compress_wait_thread; ++ } ++ ++ if (params->has_decompress_threads) { ++ dest->decompress_threads = params->decompress_threads; ++ } ++ ++ if (params->has_throttle_trigger_threshold) { ++ dest->throttle_trigger_threshold = params->throttle_trigger_threshold; ++ } ++ ++ if (params->has_cpu_throttle_initial) { ++ dest->cpu_throttle_initial = params->cpu_throttle_initial; ++ } ++ ++ if (params->has_cpu_throttle_increment) { ++ dest->cpu_throttle_increment = params->cpu_throttle_increment; ++ } ++ ++ if (params->has_cpu_throttle_tailslow) { ++ dest->cpu_throttle_tailslow = params->cpu_throttle_tailslow; ++ } ++ ++ if (params->tls_creds) { ++ assert(params->tls_creds->type == QTYPE_QSTRING); ++ dest->tls_creds = params->tls_creds->u.s; ++ } ++ ++ if (params->tls_hostname) { ++ assert(params->tls_hostname->type == QTYPE_QSTRING); ++ dest->tls_hostname = params->tls_hostname->u.s; ++ } ++ ++ if (params->has_max_bandwidth) { ++ dest->max_bandwidth = params->max_bandwidth; ++ } ++ ++ if (params->has_downtime_limit) { ++ dest->downtime_limit = params->downtime_limit; ++ } ++ ++ if (params->has_x_checkpoint_delay) { ++ dest->x_checkpoint_delay = params->x_checkpoint_delay; ++ } ++ ++ if (params->has_block_incremental) { ++ dest->block_incremental = params->block_incremental; ++ } ++ if (params->has_multifd_channels) { ++ dest->multifd_channels = params->multifd_channels; ++ } ++ if (params->has_multifd_compression) { ++ dest->multifd_compression = params->multifd_compression; ++ } ++ if (params->has_xbzrle_cache_size) { ++ dest->xbzrle_cache_size = params->xbzrle_cache_size; ++ } ++ if (params->has_max_postcopy_bandwidth) { ++ dest->max_postcopy_bandwidth = params->max_postcopy_bandwidth; ++ } ++ if (params->has_max_cpu_throttle) { ++ dest->max_cpu_throttle = params->max_cpu_throttle; ++ } ++ if (params->has_announce_initial) { ++ dest->announce_initial = params->announce_initial; ++ } ++ if (params->has_announce_max) { ++ dest->announce_max = params->announce_max; ++ } ++ if (params->has_announce_rounds) { ++ dest->announce_rounds = params->announce_rounds; ++ } ++ if (params->has_announce_step) { ++ dest->announce_step = params->announce_step; ++ } ++ ++ if (params->has_block_bitmap_mapping) { ++ dest->has_block_bitmap_mapping = true; ++ dest->block_bitmap_mapping = params->block_bitmap_mapping; ++ } ++} ++ ++static void migrate_params_apply(MigrateSetParameters *params, Error **errp) ++{ ++ MigrationState *s = migrate_get_current(); ++ ++ /* TODO use QAPI_CLONE() instead of duplicating it inline */ ++ ++ if (params->has_compress_level) { ++ s->parameters.compress_level = params->compress_level; ++ } ++ ++ if (params->has_compress_threads) { ++ s->parameters.compress_threads = params->compress_threads; ++ } ++ ++ if (params->has_compress_wait_thread) { ++ s->parameters.compress_wait_thread = params->compress_wait_thread; ++ } ++ ++ if (params->has_decompress_threads) { ++ s->parameters.decompress_threads = params->decompress_threads; ++ } ++ ++ if (params->has_throttle_trigger_threshold) { ++ s->parameters.throttle_trigger_threshold = params->throttle_trigger_threshold; ++ } ++ ++ if (params->has_cpu_throttle_initial) { ++ s->parameters.cpu_throttle_initial = params->cpu_throttle_initial; ++ } ++ ++ if (params->has_cpu_throttle_increment) { ++ s->parameters.cpu_throttle_increment = params->cpu_throttle_increment; ++ } ++ ++ if (params->has_cpu_throttle_tailslow) { ++ s->parameters.cpu_throttle_tailslow = params->cpu_throttle_tailslow; ++ } ++ ++ if (params->tls_creds) { ++ g_free(s->parameters.tls_creds); ++ assert(params->tls_creds->type == QTYPE_QSTRING); ++ s->parameters.tls_creds = g_strdup(params->tls_creds->u.s); ++ } ++ ++ if (params->tls_hostname) { ++ g_free(s->parameters.tls_hostname); ++ assert(params->tls_hostname->type == QTYPE_QSTRING); ++ s->parameters.tls_hostname = g_strdup(params->tls_hostname->u.s); ++ } ++ ++ if (params->tls_authz) { ++ g_free(s->parameters.tls_authz); ++ assert(params->tls_authz->type == QTYPE_QSTRING); ++ s->parameters.tls_authz = g_strdup(params->tls_authz->u.s); ++ } ++ ++ if (params->has_max_bandwidth) { ++ s->parameters.max_bandwidth = params->max_bandwidth; ++ if (s->to_dst_file && !migration_in_postcopy()) { ++ qemu_file_set_rate_limit(s->to_dst_file, ++ s->parameters.max_bandwidth / XFER_LIMIT_RATIO); ++ } ++ } ++ ++ if (params->has_downtime_limit) { ++ s->parameters.downtime_limit = params->downtime_limit; ++ } ++ ++ if (params->has_x_checkpoint_delay) { ++ s->parameters.x_checkpoint_delay = params->x_checkpoint_delay; ++ if (migration_in_colo_state()) { ++ colo_checkpoint_notify(s); ++ } ++ } ++ ++ if (params->has_block_incremental) { ++ s->parameters.block_incremental = params->block_incremental; ++ } ++ if (params->has_multifd_channels) { ++ s->parameters.multifd_channels = params->multifd_channels; ++ } ++ if (params->has_multifd_compression) { ++ s->parameters.multifd_compression = params->multifd_compression; ++ } ++ if (params->has_xbzrle_cache_size) { ++ s->parameters.xbzrle_cache_size = params->xbzrle_cache_size; ++ xbzrle_cache_resize(params->xbzrle_cache_size, errp); ++ } ++ if (params->has_max_postcopy_bandwidth) { ++ s->parameters.max_postcopy_bandwidth = params->max_postcopy_bandwidth; ++ if (s->to_dst_file && migration_in_postcopy()) { ++ qemu_file_set_rate_limit(s->to_dst_file, ++ s->parameters.max_postcopy_bandwidth / XFER_LIMIT_RATIO); ++ } ++ } ++ if (params->has_max_cpu_throttle) { ++ s->parameters.max_cpu_throttle = params->max_cpu_throttle; ++ } ++ if (params->has_announce_initial) { ++ s->parameters.announce_initial = params->announce_initial; ++ } ++ if (params->has_announce_max) { ++ s->parameters.announce_max = params->announce_max; ++ } ++ if (params->has_announce_rounds) { ++ s->parameters.announce_rounds = params->announce_rounds; ++ } ++ if (params->has_announce_step) { ++ s->parameters.announce_step = params->announce_step; ++ } ++ ++ if (params->has_block_bitmap_mapping) { ++ qapi_free_BitmapMigrationNodeAliasList( ++ s->parameters.block_bitmap_mapping); ++ ++ s->parameters.has_block_bitmap_mapping = true; ++ s->parameters.block_bitmap_mapping = ++ QAPI_CLONE(BitmapMigrationNodeAliasList, ++ params->block_bitmap_mapping); ++ } ++} ++ ++void qmp_migrate_set_parameters(MigrateSetParameters *params, Error **errp) ++{ ++ MigrationParameters tmp; ++ ++ /* TODO Rewrite "" to null instead */ ++ if (params->tls_creds ++ && params->tls_creds->type == QTYPE_QNULL) { ++ qobject_unref(params->tls_creds->u.n); ++ params->tls_creds->type = QTYPE_QSTRING; ++ params->tls_creds->u.s = strdup(""); ++ } ++ /* TODO Rewrite "" to null instead */ ++ if (params->tls_hostname ++ && params->tls_hostname->type == QTYPE_QNULL) { ++ qobject_unref(params->tls_hostname->u.n); ++ params->tls_hostname->type = QTYPE_QSTRING; ++ params->tls_hostname->u.s = strdup(""); ++ } ++ ++ migrate_params_test_apply(params, &tmp); ++ ++ if (!migrate_params_check(&tmp, errp)) { ++ /* Invalid parameter */ ++ return; ++ } ++ ++ migrate_params_apply(params, errp); ++} +diff --git a/migration/options.h b/migration/options.h +index 13318a16c7..89067e59a0 100644 +--- a/migration/options.h ++++ b/migration/options.h +@@ -14,6 +14,13 @@ + #ifndef QEMU_MIGRATION_OPTIONS_H + #define QEMU_MIGRATION_OPTIONS_H + ++/* constants */ ++ ++/* Amount of time to allocate to each "chunk" of bandwidth-throttled ++ * data. */ ++#define BUFFER_DELAY 100 ++#define XFER_LIMIT_RATIO (1000 / BUFFER_DELAY) ++ + /* capabilities */ + + bool migrate_auto_converge(void); +@@ -74,4 +81,8 @@ int migrate_multifd_zstd_level(void); + uint8_t migrate_throttle_trigger_threshold(void); + uint64_t migrate_xbzrle_cache_size(void); + ++/* parameters helpers */ ++ ++bool migrate_params_check(MigrationParameters *params, Error **errp); ++ + #endif +-- +2.39.1 + diff --git a/kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch b/kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch new file mode 100644 index 0000000..d2564de --- /dev/null +++ b/kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch @@ -0,0 +1,100 @@ +From 00cc3c3598828588619a7b3696819060bddaddb8 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 23:15:59 +0100 +Subject: [PATCH 34/56] migration: Move qmp_query_migrate_capabilities() to + options.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [33/50] dbfa8f1e7aa7e000b4622ce2da12d7d418710f19 (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 4d0c6b695bf5252402ebf967f83baebfd2f4b91e) +Signed-off-by: Peter Xu +--- + migration/migration.c | 22 ---------------------- + migration/options.c | 23 +++++++++++++++++++++++ + 2 files changed, 23 insertions(+), 22 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index d9e30ca918..3dc8ee4875 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -886,28 +886,6 @@ void migrate_send_rp_resume_ack(MigrationIncomingState *mis, uint32_t value) + migrate_send_rp_message(mis, MIG_RP_MSG_RESUME_ACK, sizeof(buf), &buf); + } + +-MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) +-{ +- MigrationCapabilityStatusList *head = NULL, **tail = &head; +- MigrationCapabilityStatus *caps; +- MigrationState *s = migrate_get_current(); +- int i; +- +- for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { +-#ifndef CONFIG_LIVE_BLOCK_MIGRATION +- if (i == MIGRATION_CAPABILITY_BLOCK) { +- continue; +- } +-#endif +- caps = g_malloc0(sizeof(*caps)); +- caps->capability = i; +- caps->state = s->capabilities[i]; +- QAPI_LIST_APPEND(tail, caps); +- } +- +- return head; +-} +- + MigrationParameters *qmp_query_migrate_parameters(Error **errp) + { + MigrationParameters *params; +diff --git a/migration/options.c b/migration/options.c +index 367c930f46..ff621bdeb3 100644 +--- a/migration/options.c ++++ b/migration/options.c +@@ -13,6 +13,7 @@ + + #include "qemu/osdep.h" + #include "qapi/error.h" ++#include "qapi/qapi-commands-migration.h" + #include "sysemu/runstate.h" + #include "migration.h" + #include "ram.h" +@@ -390,3 +391,25 @@ bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + + return true; + } ++ ++MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) ++{ ++ MigrationCapabilityStatusList *head = NULL, **tail = &head; ++ MigrationCapabilityStatus *caps; ++ MigrationState *s = migrate_get_current(); ++ int i; ++ ++ for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { ++#ifndef CONFIG_LIVE_BLOCK_MIGRATION ++ if (i == MIGRATION_CAPABILITY_BLOCK) { ++ continue; ++ } ++#endif ++ caps = g_malloc0(sizeof(*caps)); ++ caps->capability = i; ++ caps->state = s->capabilities[i]; ++ QAPI_LIST_APPEND(tail, caps); ++ } ++ ++ return head; ++} +-- +2.39.1 + diff --git a/kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch b/kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch new file mode 100644 index 0000000..7339ce0 --- /dev/null +++ b/kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch @@ -0,0 +1,226 @@ +From 4782b59a8b0b5762f87505ac7a83b37ddd2e0b3f Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 20:28:56 +0100 +Subject: [PATCH 19/56] migration: Pass migrate_caps_check() the old and new + caps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [18/50] df78d680d03f15d7cb7401ad89e68a4fc93fa835 (peterx/qemu-kvm) + +We used to pass the old capabilities array and the new +capabilities as a list. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit b02c7fc9ef447787414e6fa67eff75e7b7b30180) +Signed-off-by: Peter Xu +--- + migration/migration.c | 80 +++++++++++++++++-------------------------- + 1 file changed, 31 insertions(+), 49 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index d8e5fb6226..e8f596bcfa 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1299,30 +1299,20 @@ WriteTrackingSupport migrate_query_write_tracking(void) + } + + /** +- * @migration_caps_check - check capability validity ++ * @migration_caps_check - check capability compatibility + * +- * @cap_list: old capability list, array of bool +- * @params: new capabilities to be applied soon ++ * @old_caps: old capability list ++ * @new_caps: new capability list + * @errp: set *errp if the check failed, with reason + * + * Returns true if check passed, otherwise false. + */ +-static bool migrate_caps_check(bool *cap_list, +- MigrationCapabilityStatusList *params, +- Error **errp) ++static bool migrate_caps_check(bool *old_caps, bool *new_caps, Error **errp) + { +- MigrationCapabilityStatusList *cap; +- bool old_postcopy_cap; + MigrationIncomingState *mis = migration_incoming_get_current(); + +- old_postcopy_cap = cap_list[MIGRATION_CAPABILITY_POSTCOPY_RAM]; +- +- for (cap = params; cap; cap = cap->next) { +- cap_list[cap->value->capability] = cap->value->state; +- } +- + #ifndef CONFIG_LIVE_BLOCK_MIGRATION +- if (cap_list[MIGRATION_CAPABILITY_BLOCK]) { ++ if (new_caps[MIGRATION_CAPABILITY_BLOCK]) { + error_setg(errp, "QEMU compiled without old-style (blk/-b, inc/-i) " + "block migration"); + error_append_hint(errp, "Use drive_mirror+NBD instead.\n"); +@@ -1331,7 +1321,7 @@ static bool migrate_caps_check(bool *cap_list, + #endif + + #ifndef CONFIG_REPLICATION +- if (cap_list[MIGRATION_CAPABILITY_X_COLO]) { ++ if (new_caps[MIGRATION_CAPABILITY_X_COLO]) { + error_setg(errp, "QEMU compiled without replication module" + " can't enable COLO"); + error_append_hint(errp, "Please enable replication before COLO.\n"); +@@ -1339,12 +1329,13 @@ static bool migrate_caps_check(bool *cap_list, + } + #endif + +- if (cap_list[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { ++ if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { + /* This check is reasonably expensive, so only when it's being + * set the first time, also it's only the destination that needs + * special support. + */ +- if (!old_postcopy_cap && runstate_check(RUN_STATE_INMIGRATE) && ++ if (!old_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM] && ++ runstate_check(RUN_STATE_INMIGRATE) && + !postcopy_ram_supported_by_host(mis)) { + /* postcopy_ram_supported_by_host will have emitted a more + * detailed message +@@ -1353,13 +1344,13 @@ static bool migrate_caps_check(bool *cap_list, + return false; + } + +- if (cap_list[MIGRATION_CAPABILITY_X_IGNORE_SHARED]) { ++ if (new_caps[MIGRATION_CAPABILITY_X_IGNORE_SHARED]) { + error_setg(errp, "Postcopy is not compatible with ignore-shared"); + return false; + } + } + +- if (cap_list[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]) { ++ if (new_caps[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]) { + WriteTrackingSupport wt_support; + int idx; + /* +@@ -1383,7 +1374,7 @@ static bool migrate_caps_check(bool *cap_list, + */ + for (idx = 0; idx < check_caps_background_snapshot.size; idx++) { + int incomp_cap = check_caps_background_snapshot.caps[idx]; +- if (cap_list[incomp_cap]) { ++ if (new_caps[incomp_cap]) { + error_setg(errp, + "Background-snapshot is not compatible with %s", + MigrationCapability_str(incomp_cap)); +@@ -1393,10 +1384,10 @@ static bool migrate_caps_check(bool *cap_list, + } + + #ifdef CONFIG_LINUX +- if (cap_list[MIGRATION_CAPABILITY_ZERO_COPY_SEND] && +- (!cap_list[MIGRATION_CAPABILITY_MULTIFD] || +- cap_list[MIGRATION_CAPABILITY_COMPRESS] || +- cap_list[MIGRATION_CAPABILITY_XBZRLE] || ++ if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND] && ++ (!new_caps[MIGRATION_CAPABILITY_MULTIFD] || ++ new_caps[MIGRATION_CAPABILITY_COMPRESS] || ++ new_caps[MIGRATION_CAPABILITY_XBZRLE] || + migrate_multifd_compression() || + migrate_use_tls())) { + error_setg(errp, +@@ -1404,15 +1395,15 @@ static bool migrate_caps_check(bool *cap_list, + return false; + } + #else +- if (cap_list[MIGRATION_CAPABILITY_ZERO_COPY_SEND]) { ++ if (new_caps[MIGRATION_CAPABILITY_ZERO_COPY_SEND]) { + error_setg(errp, + "Zero copy currently only available on Linux"); + return false; + } + #endif + +- if (cap_list[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]) { +- if (!cap_list[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { ++ if (new_caps[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]) { ++ if (!new_caps[MIGRATION_CAPABILITY_POSTCOPY_RAM]) { + error_setg(errp, "Postcopy preempt requires postcopy-ram"); + return false; + } +@@ -1423,14 +1414,14 @@ static bool migrate_caps_check(bool *cap_list, + * different compression channels, which is not compatible with the + * preempt assumptions on channel assignments. + */ +- if (cap_list[MIGRATION_CAPABILITY_COMPRESS]) { ++ if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { + error_setg(errp, "Postcopy preempt not compatible with compress"); + return false; + } + } + +- if (cap_list[MIGRATION_CAPABILITY_MULTIFD]) { +- if (cap_list[MIGRATION_CAPABILITY_COMPRESS]) { ++ if (new_caps[MIGRATION_CAPABILITY_MULTIFD]) { ++ if (new_caps[MIGRATION_CAPABILITY_COMPRESS]) { + error_setg(errp, "Multifd is not compatible with compress"); + return false; + } +@@ -1486,15 +1477,19 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, + { + MigrationState *s = migrate_get_current(); + MigrationCapabilityStatusList *cap; +- bool cap_list[MIGRATION_CAPABILITY__MAX]; ++ bool new_caps[MIGRATION_CAPABILITY__MAX]; + + if (migration_is_running(s->state)) { + error_setg(errp, QERR_MIGRATION_ACTIVE); + return; + } + +- memcpy(cap_list, s->capabilities, sizeof(cap_list)); +- if (!migrate_caps_check(cap_list, params, errp)) { ++ memcpy(new_caps, s->capabilities, sizeof(new_caps)); ++ for (cap = params; cap; cap = cap->next) { ++ new_caps[cap->value->capability] = cap->value->state; ++ } ++ ++ if (!migrate_caps_check(s->capabilities, new_caps, errp)) { + return; + } + +@@ -4634,27 +4629,14 @@ static void migration_instance_init(Object *obj) + */ + static bool migration_object_check(MigrationState *ms, Error **errp) + { +- MigrationCapabilityStatusList *head = NULL; + /* Assuming all off */ +- bool cap_list[MIGRATION_CAPABILITY__MAX] = { 0 }, ret; +- int i; ++ bool old_caps[MIGRATION_CAPABILITY__MAX] = { 0 }; + + if (!migrate_params_check(&ms->parameters, errp)) { + return false; + } + +- for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { +- if (ms->capabilities[i]) { +- QAPI_LIST_PREPEND(head, migrate_cap_add(i, true)); +- } +- } +- +- ret = migrate_caps_check(cap_list, head, errp); +- +- /* It works with head == NULL */ +- qapi_free_MigrationCapabilityStatusList(head); +- +- return ret; ++ return migrate_caps_check(old_caps, ms->capabilities, errp); + } + + static const TypeInfo migration_type = { +-- +2.39.1 + diff --git a/kvm-migration-Rename-duplicate-to-zero_pages.patch b/kvm-migration-Rename-duplicate-to-zero_pages.patch new file mode 100644 index 0000000..22acab5 --- /dev/null +++ b/kvm-migration-Rename-duplicate-to-zero_pages.patch @@ -0,0 +1,109 @@ +From 3cecf66655a0dd599666bcac8add2dee85d5651f Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 19 Apr 2023 18:16:05 +0200 +Subject: [PATCH 16/56] migration: Rename duplicate to zero_pages +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [15/50] 89db3c8b167c0f411ba95ce2730540c0e8f1206b (peterx/qemu-kvm) + +Rest of counters that refer to pages has a _pages suffix. +And historically, this showed the number of pages composed of the same +character, here comes the name "duplicated". But since years ago, it +refers to the number of zero_pages. + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 1a386e8de5995fb5478ea99baa6d3e71abcf4b80) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + migration/ram.c | 10 +++++----- + migration/ram.h | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 39501a0ed8..c15e2a61ca 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1142,7 +1142,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram = g_malloc0(sizeof(*info->ram)); + info->ram->transferred = stat64_get(&ram_counters.transferred); + info->ram->total = ram_bytes_total(); +- info->ram->duplicate = stat64_get(&ram_counters.duplicate); ++ info->ram->duplicate = stat64_get(&ram_counters.zero_pages); + /* legacy value. It is not used anymore */ + info->ram->skipped = 0; + info->ram->normal = stat64_get(&ram_counters.normal); +diff --git a/migration/ram.c b/migration/ram.c +index fe69ecaef4..19d345a030 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1119,7 +1119,7 @@ uint64_t ram_pagesize_summary(void) + uint64_t ram_get_total_transferred_pages(void) + { + return stat64_get(&ram_counters.normal) + +- stat64_get(&ram_counters.duplicate) + ++ stat64_get(&ram_counters.zero_pages) + + compression_counters.pages + xbzrle_counters.pages; + } + +@@ -1320,7 +1320,7 @@ static int save_zero_page(PageSearchStatus *pss, QEMUFile *f, RAMBlock *block, + int len = save_zero_page_to_file(pss, f, block, offset); + + if (len) { +- stat64_add(&ram_counters.duplicate, 1); ++ stat64_add(&ram_counters.zero_pages, 1); + ram_transferred_add(len); + return 1; + } +@@ -1359,7 +1359,7 @@ static bool control_save_page(PageSearchStatus *pss, RAMBlock *block, + if (bytes_xmit > 0) { + stat64_add(&ram_counters.normal, 1); + } else if (bytes_xmit == 0) { +- stat64_add(&ram_counters.duplicate, 1); ++ stat64_add(&ram_counters.zero_pages, 1); + } + + return true; +@@ -1486,7 +1486,7 @@ update_compress_thread_counts(const CompressParam *param, int bytes_xmit) + ram_transferred_add(bytes_xmit); + + if (param->zero_page) { +- stat64_add(&ram_counters.duplicate, 1); ++ stat64_add(&ram_counters.zero_pages, 1); + return; + } + +@@ -2621,7 +2621,7 @@ void acct_update_position(QEMUFile *f, size_t size, bool zero) + uint64_t pages = size / TARGET_PAGE_SIZE; + + if (zero) { +- stat64_add(&ram_counters.duplicate, pages); ++ stat64_add(&ram_counters.zero_pages, pages); + } else { + stat64_add(&ram_counters.normal, pages); + ram_transferred_add(size); +diff --git a/migration/ram.h b/migration/ram.h +index afa68521d7..55258334fe 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -45,7 +45,7 @@ typedef struct { + Stat64 dirty_sync_count; + Stat64 dirty_sync_missed_zero_copy; + Stat64 downtime_bytes; +- Stat64 duplicate; ++ Stat64 zero_pages; + Stat64 multifd_bytes; + Stat64 normal; + Stat64 postcopy_bytes; +-- +2.39.1 + diff --git a/kvm-migration-Rename-normal-to-normal_pages.patch b/kvm-migration-Rename-normal-to-normal_pages.patch new file mode 100644 index 0000000..8ad6447 --- /dev/null +++ b/kvm-migration-Rename-normal-to-normal_pages.patch @@ -0,0 +1,109 @@ +From 7e27e7ea83856e1a7222ff46d91495f48fb6be4d Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 19 Apr 2023 18:19:45 +0200 +Subject: [PATCH 17/56] migration: Rename normal to normal_pages +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [16/50] 7df8b946918def9657bbe357861a6d72b5399ac6 (peterx/qemu-kvm) + +Rest of counters that refer to pages has a _pages suffix. +And historically, this showed the number of full pages transferred. +The name "normal" refered to the fact that they were sent without any +optimization (compression, xbzrle, zero_page, ...). + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +(cherry picked from commit 8c0cda8fa0de0a50148e2c60552afca9cffca643) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + migration/ram.c | 10 +++++----- + migration/ram.h | 2 +- + 3 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index c15e2a61ca..f1b3439e5f 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1145,7 +1145,7 @@ static void populate_ram_info(MigrationInfo *info, MigrationState *s) + info->ram->duplicate = stat64_get(&ram_counters.zero_pages); + /* legacy value. It is not used anymore */ + info->ram->skipped = 0; +- info->ram->normal = stat64_get(&ram_counters.normal); ++ info->ram->normal = stat64_get(&ram_counters.normal_pages); + info->ram->normal_bytes = info->ram->normal * page_size; + info->ram->mbps = s->mbps; + info->ram->dirty_sync_count = +diff --git a/migration/ram.c b/migration/ram.c +index 19d345a030..229714045a 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1118,7 +1118,7 @@ uint64_t ram_pagesize_summary(void) + + uint64_t ram_get_total_transferred_pages(void) + { +- return stat64_get(&ram_counters.normal) + ++ return stat64_get(&ram_counters.normal_pages) + + stat64_get(&ram_counters.zero_pages) + + compression_counters.pages + xbzrle_counters.pages; + } +@@ -1357,7 +1357,7 @@ static bool control_save_page(PageSearchStatus *pss, RAMBlock *block, + } + + if (bytes_xmit > 0) { +- stat64_add(&ram_counters.normal, 1); ++ stat64_add(&ram_counters.normal_pages, 1); + } else if (bytes_xmit == 0) { + stat64_add(&ram_counters.zero_pages, 1); + } +@@ -1391,7 +1391,7 @@ static int save_normal_page(PageSearchStatus *pss, RAMBlock *block, + qemu_put_buffer(file, buf, TARGET_PAGE_SIZE); + } + ram_transferred_add(TARGET_PAGE_SIZE); +- stat64_add(&ram_counters.normal, 1); ++ stat64_add(&ram_counters.normal_pages, 1); + return 1; + } + +@@ -1447,7 +1447,7 @@ static int ram_save_multifd_page(QEMUFile *file, RAMBlock *block, + if (multifd_queue_page(file, block, offset) < 0) { + return -1; + } +- stat64_add(&ram_counters.normal, 1); ++ stat64_add(&ram_counters.normal_pages, 1); + + return 1; + } +@@ -2623,7 +2623,7 @@ void acct_update_position(QEMUFile *f, size_t size, bool zero) + if (zero) { + stat64_add(&ram_counters.zero_pages, pages); + } else { +- stat64_add(&ram_counters.normal, pages); ++ stat64_add(&ram_counters.normal_pages, pages); + ram_transferred_add(size); + qemu_file_credit_transfer(f, size); + } +diff --git a/migration/ram.h b/migration/ram.h +index 55258334fe..a6e0d70226 100644 +--- a/migration/ram.h ++++ b/migration/ram.h +@@ -47,7 +47,7 @@ typedef struct { + Stat64 downtime_bytes; + Stat64 zero_pages; + Stat64 multifd_bytes; +- Stat64 normal; ++ Stat64 normal_pages; + Stat64 postcopy_bytes; + Stat64 postcopy_requests; + Stat64 precopy_bytes; +-- +2.39.1 + diff --git a/kvm-migration-Update-atomic-stats-out-of-the-mutex.patch b/kvm-migration-Update-atomic-stats-out-of-the-mutex.patch new file mode 100644 index 0000000..7e78d82 --- /dev/null +++ b/kvm-migration-Update-atomic-stats-out-of-the-mutex.patch @@ -0,0 +1,52 @@ +From c0d377e1bf442a09b82fddbb8588fcddf6439854 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 24 Nov 2022 17:26:19 +0100 +Subject: [PATCH 09/56] migration: Update atomic stats out of the mutex +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [8/50] 88e9dbc9a3e5aef60a7c98c871144904c7062b1f (peterx/qemu-kvm) + +Reviewed-by: David Edmondson +Reviewed-by: Peter Xu +Signed-off-by: Juan Quintela +(cherry picked from commit 30fb22cda45bea43a3c0e26049ebdd71a9503ffd) +Signed-off-by: Peter Xu +--- + migration/multifd.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/migration/multifd.c b/migration/multifd.c +index 01fab01a92..6ef3a27938 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -433,8 +433,8 @@ static int multifd_send_pages(QEMUFile *f) + transferred = ((uint64_t) pages->num) * p->page_size + p->packet_len; + qemu_file_acct_rate_limit(f, transferred); + ram_counters.multifd_bytes += transferred; +- stat64_add(&ram_counters.transferred, transferred); + qemu_mutex_unlock(&p->mutex); ++ stat64_add(&ram_counters.transferred, transferred); + qemu_sem_post(&p->sem); + + return 1; +@@ -628,8 +628,8 @@ int multifd_send_sync_main(QEMUFile *f) + p->pending_job++; + qemu_file_acct_rate_limit(f, p->packet_len); + ram_counters.multifd_bytes += p->packet_len; +- stat64_add(&ram_counters.transferred, p->packet_len); + qemu_mutex_unlock(&p->mutex); ++ stat64_add(&ram_counters.transferred, p->packet_len); + qemu_sem_post(&p->sem); + } + for (i = 0; i < migrate_multifd_channels(); i++) { +-- +2.39.1 + diff --git a/kvm-migration-Use-migrate_max_postcopy_bandwidth.patch b/kvm-migration-Use-migrate_max_postcopy_bandwidth.patch new file mode 100644 index 0000000..f179761 --- /dev/null +++ b/kvm-migration-Use-migrate_max_postcopy_bandwidth.patch @@ -0,0 +1,40 @@ +From 8d203baa6cbd1f371e308c2c9d59a5ca7d29dca8 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Thu, 2 Mar 2023 10:55:30 +0100 +Subject: [PATCH 38/56] migration: Use migrate_max_postcopy_bandwidth() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [37/50] d62948e9ee40a85ed9b460a583c3b0e43cd5d47f (peterx/qemu-kvm) + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 5390adec03a7d8bc6bcf5887f726b0ddaeb90681) +Signed-off-by: Peter Xu +--- + migration/migration.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 7f2e770deb..78bca9a93f 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3799,7 +3799,7 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) + + if (resume) { + /* This is a resumed migration */ +- rate_limit = s->parameters.max_postcopy_bandwidth / ++ rate_limit = migrate_max_postcopy_bandwidth() / + XFER_LIMIT_RATIO; + } else { + /* This is a fresh new migration */ +-- +2.39.1 + diff --git a/kvm-migration-mark-mixed-functions-that-can-suspend.patch b/kvm-migration-mark-mixed-functions-that-can-suspend.patch new file mode 100644 index 0000000..9451696 --- /dev/null +++ b/kvm-migration-mark-mixed-functions-that-can-suspend.patch @@ -0,0 +1,153 @@ +From cfdf5715a2334ad06b5966ec986d134bbd5ba08b Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Dec 2022 12:48:16 +0100 +Subject: [PATCH 05/56] migration: mark mixed functions that can suspend +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [4/50] 9f055b526edd06a3440999d5de91e5d624678c7d (peterx/qemu-kvm) + +There should be no paths from a coroutine_fn to aio_poll, however in +practice coroutine_mixed_fn will call aio_poll in the !qemu_in_coroutine() +path. By marking mixed functions, we can track accurately the call paths +that execute entirely in coroutine context, and find more missing +coroutine_fn markers. This results in more accurate checks that +coroutine code does not end up blocking. + +If the marking were extended transitively to all functions that call +these ones, static analysis could be done much more efficiently. +However, this is a start and makes it possible to use vrc's path-based +searches to find potential bugs where coroutine_fns call blocking functions. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 394b9407e4c515f96df6647d629ee28cbb86f07c) +Signed-off-by: Peter Xu +--- + include/migration/qemu-file-types.h | 4 ++-- + migration/qemu-file.c | 14 +++++++------- + migration/qemu-file.h | 6 +++--- + 3 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/include/migration/qemu-file-types.h b/include/migration/qemu-file-types.h +index 2867e3da84..1436f9ce92 100644 +--- a/include/migration/qemu-file-types.h ++++ b/include/migration/qemu-file-types.h +@@ -35,7 +35,7 @@ void qemu_put_byte(QEMUFile *f, int v); + void qemu_put_be16(QEMUFile *f, unsigned int v); + void qemu_put_be32(QEMUFile *f, unsigned int v); + void qemu_put_be64(QEMUFile *f, uint64_t v); +-size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); ++size_t coroutine_mixed_fn qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size); + + int qemu_get_byte(QEMUFile *f); + +@@ -161,7 +161,7 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv) + qemu_get_be64s(f, (uint64_t *)pv); + } + +-size_t qemu_get_counted_string(QEMUFile *f, char buf[256]); ++size_t coroutine_mixed_fn qemu_get_counted_string(QEMUFile *f, char buf[256]); + + void qemu_put_counted_string(QEMUFile *f, const char *name); + +diff --git a/migration/qemu-file.c b/migration/qemu-file.c +index 102ab3b439..ee04240a21 100644 +--- a/migration/qemu-file.c ++++ b/migration/qemu-file.c +@@ -392,7 +392,7 @@ size_t ram_control_save_page(QEMUFile *f, ram_addr_t block_offset, + * case if the underlying file descriptor gives a short read, and that can + * happen even on a blocking fd. + */ +-static ssize_t qemu_fill_buffer(QEMUFile *f) ++static ssize_t coroutine_mixed_fn qemu_fill_buffer(QEMUFile *f) + { + int len; + int pending; +@@ -585,7 +585,7 @@ void qemu_file_skip(QEMUFile *f, int size) + * return as many as it managed to read (assuming blocking fd's which + * all current QEMUFile are) + */ +-size_t qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t offset) ++size_t coroutine_mixed_fn qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t offset) + { + ssize_t pending; + size_t index; +@@ -633,7 +633,7 @@ size_t qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t offset) + * return as many as it managed to read (assuming blocking fd's which + * all current QEMUFile are) + */ +-size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size) ++size_t coroutine_mixed_fn qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size) + { + size_t pending = size; + size_t done = 0; +@@ -674,7 +674,7 @@ size_t qemu_get_buffer(QEMUFile *f, uint8_t *buf, size_t size) + * Note: Since **buf may get changed, the caller should take care to + * keep a pointer to the original buffer if it needs to deallocate it. + */ +-size_t qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size) ++size_t coroutine_mixed_fn qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size) + { + if (size < IO_BUF_SIZE) { + size_t res; +@@ -696,7 +696,7 @@ size_t qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size) + * Peeks a single byte from the buffer; this isn't guaranteed to work if + * offset leaves a gap after the previous read/peeked data. + */ +-int qemu_peek_byte(QEMUFile *f, int offset) ++int coroutine_mixed_fn qemu_peek_byte(QEMUFile *f, int offset) + { + int index = f->buf_index + offset; + +@@ -713,7 +713,7 @@ int qemu_peek_byte(QEMUFile *f, int offset) + return f->buf[index]; + } + +-int qemu_get_byte(QEMUFile *f) ++int coroutine_mixed_fn qemu_get_byte(QEMUFile *f) + { + int result; + +@@ -894,7 +894,7 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src) + * else 0 + * (Note a 0 length string will return 0 either way) + */ +-size_t qemu_get_counted_string(QEMUFile *f, char buf[256]) ++size_t coroutine_fn qemu_get_counted_string(QEMUFile *f, char buf[256]) + { + size_t len = qemu_get_byte(f); + size_t res = qemu_get_buffer(f, (uint8_t *)buf, len); +diff --git a/migration/qemu-file.h b/migration/qemu-file.h +index 9d0155a2a1..d16cd50448 100644 +--- a/migration/qemu-file.h ++++ b/migration/qemu-file.h +@@ -108,8 +108,8 @@ bool qemu_file_is_writable(QEMUFile *f); + + #include "migration/qemu-file-types.h" + +-size_t qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t offset); +-size_t qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size); ++size_t coroutine_mixed_fn qemu_peek_buffer(QEMUFile *f, uint8_t **buf, size_t size, size_t offset); ++size_t coroutine_mixed_fn qemu_get_buffer_in_place(QEMUFile *f, uint8_t **buf, size_t size); + ssize_t qemu_put_compression_data(QEMUFile *f, z_stream *stream, + const uint8_t *p, size_t size); + int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src); +@@ -119,7 +119,7 @@ int qemu_put_qemu_file(QEMUFile *f_des, QEMUFile *f_src); + * is; you aren't guaranteed to be able to peak to +n bytes unless you've + * previously peeked +n-1. + */ +-int qemu_peek_byte(QEMUFile *f, int offset); ++int coroutine_mixed_fn qemu_peek_byte(QEMUFile *f, int offset); + void qemu_file_skip(QEMUFile *f, int size); + /* + * qemu_file_credit_transfer: +-- +2.39.1 + diff --git a/kvm-migration-move-migration_global_dump-to-migration-hm.patch b/kvm-migration-move-migration_global_dump-to-migration-hm.patch new file mode 100644 index 0000000..4e73c80 --- /dev/null +++ b/kvm-migration-move-migration_global_dump-to-migration-hm.patch @@ -0,0 +1,121 @@ +From 96e6914cbfb18bb8287c57b9ac9a6b364d3e7a22 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 22 Feb 2023 17:18:05 +0100 +Subject: [PATCH 20/56] migration: move migration_global_dump() to + migration-hmp-cmds.c +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [19/50] c8d330a2833c706b9bd78f7154be882e3977ad06 (peterx/qemu-kvm) + +It is only used there, so we can make it static. +Once there, remove spice.h that it is not used. + +Signed-off-by: Juan Quintela +Reviewed-by: Peter Xu +Reviewed-by: Philippe Mathieu-Daudé + +--- + +fix David Edmonson ui/qemu-spice.h unintended removal + +(cherry picked from commit c938157713e723165a42cb6e8364adb6fcbd0e22) +Signed-off-by: Peter Xu +--- + include/migration/misc.h | 1 - + migration/migration-hmp-cmds.c | 22 +++++++++++++++++++++- + migration/migration.c | 19 ------------------- + 3 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/include/migration/misc.h b/include/migration/misc.h +index 8b49841016..5ebe13b4b9 100644 +--- a/include/migration/misc.h ++++ b/include/migration/misc.h +@@ -66,7 +66,6 @@ bool migration_has_finished(MigrationState *); + bool migration_has_failed(MigrationState *); + /* ...and after the device transmission */ + bool migration_in_postcopy_after_devices(MigrationState *); +-void migration_global_dump(Monitor *mon); + /* True if incoming migration entered POSTCOPY_INCOMING_DISCARD */ + bool migration_in_incoming_postcopy(void); + /* True if incoming migration entered POSTCOPY_INCOMING_ADVISE */ +diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c +index 72519ea99f..71da91967a 100644 +--- a/migration/migration-hmp-cmds.c ++++ b/migration/migration-hmp-cmds.c +@@ -15,7 +15,6 @@ + + #include "qemu/osdep.h" + #include "block/qapi.h" +-#include "migration/misc.h" + #include "migration/snapshot.h" + #include "monitor/hmp.h" + #include "monitor/monitor.h" +@@ -30,6 +29,27 @@ + #include "qemu/sockets.h" + #include "sysemu/runstate.h" + #include "ui/qemu-spice.h" ++#include "sysemu/sysemu.h" ++#include "migration.h" ++ ++static void migration_global_dump(Monitor *mon) ++{ ++ MigrationState *ms = migrate_get_current(); ++ ++ monitor_printf(mon, "globals:\n"); ++ monitor_printf(mon, "store-global-state: %s\n", ++ ms->store_global_state ? "on" : "off"); ++ monitor_printf(mon, "only-migratable: %s\n", ++ only_migratable ? "on" : "off"); ++ monitor_printf(mon, "send-configuration: %s\n", ++ ms->send_configuration ? "on" : "off"); ++ monitor_printf(mon, "send-section-footer: %s\n", ++ ms->send_section_footer ? "on" : "off"); ++ monitor_printf(mon, "decompress-error-check: %s\n", ++ ms->decompress_error_check ? "on" : "off"); ++ monitor_printf(mon, "clear-bitmap-shift: %u\n", ++ ms->clear_bitmap_shift); ++} + + void hmp_info_migrate(Monitor *mon, const QDict *qdict) + { +diff --git a/migration/migration.c b/migration/migration.c +index e8f596bcfa..aa96ffdc5b 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -4420,25 +4420,6 @@ void migrate_fd_connect(MigrationState *s, Error *error_in) + s->migration_thread_running = true; + } + +-void migration_global_dump(Monitor *mon) +-{ +- MigrationState *ms = migrate_get_current(); +- +- monitor_printf(mon, "globals:\n"); +- monitor_printf(mon, "store-global-state: %s\n", +- ms->store_global_state ? "on" : "off"); +- monitor_printf(mon, "only-migratable: %s\n", +- only_migratable ? "on" : "off"); +- monitor_printf(mon, "send-configuration: %s\n", +- ms->send_configuration ? "on" : "off"); +- monitor_printf(mon, "send-section-footer: %s\n", +- ms->send_section_footer ? "on" : "off"); +- monitor_printf(mon, "decompress-error-check: %s\n", +- ms->decompress_error_check ? "on" : "off"); +- monitor_printf(mon, "clear-bitmap-shift: %u\n", +- ms->clear_bitmap_shift); +-} +- + #define DEFINE_PROP_MIG_CAP(name, x) \ + DEFINE_PROP_BOOL(name, MigrationState, capabilities[x], false) + +-- +2.39.1 + diff --git a/kvm-migration-postcopy-Detect-file-system-on-dest-host.patch b/kvm-migration-postcopy-Detect-file-system-on-dest-host.patch new file mode 100644 index 0000000..7700466 --- /dev/null +++ b/kvm-migration-postcopy-Detect-file-system-on-dest-host.patch @@ -0,0 +1,117 @@ +From 4827d5be5357ab89e0c46f606ad828bf97d36471 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Wed, 19 Apr 2023 12:17:38 -0400 +Subject: [PATCH 04/56] migration/postcopy: Detect file system on dest host +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [3/50] 121aeeda8a019f79dba6c077c7018bd1c86f3d71 (peterx/qemu-kvm) + +Postcopy requires the memory support userfaultfd to work. Right now we +check it but it's a bit too late (when switching to postcopy migration). + +Do that early right at enabling of postcopy. + +Note that this is still only a best effort because ramblocks can be +dynamically created. We can add check in hostmem creations and fail if +postcopy enabled, but maybe that's too aggressive. + +Still, we have chance to fail the most obvious where we know there's an +existing unsupported ramblock. + +Signed-off-by: Peter Xu +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit ae30b9b2892b85e6c3d5c0b8d1949c4d77a2954a) +Signed-off-by: Peter Xu +--- + migration/postcopy-ram.c | 34 ++++++++++++++++++++++++++++++---- + 1 file changed, 30 insertions(+), 4 deletions(-) + +diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c +index 93f39f8e06..bbb8af61ae 100644 +--- a/migration/postcopy-ram.c ++++ b/migration/postcopy-ram.c +@@ -36,6 +36,7 @@ + #include "yank_functions.h" + #include "tls.h" + #include "qemu/userfaultfd.h" ++#include "qemu/mmap-alloc.h" + + /* Arbitrary limit on size of each discard command, + * keeps them around ~200 bytes +@@ -336,11 +337,12 @@ static bool ufd_check_and_apply(int ufd, MigrationIncomingState *mis) + + /* Callback from postcopy_ram_supported_by_host block iterator. + */ +-static int test_ramblock_postcopiable(RAMBlock *rb, void *opaque) ++static int test_ramblock_postcopiable(RAMBlock *rb) + { + const char *block_name = qemu_ram_get_idstr(rb); + ram_addr_t length = qemu_ram_get_used_length(rb); + size_t pagesize = qemu_ram_pagesize(rb); ++ QemuFsType fs; + + if (length % pagesize) { + error_report("Postcopy requires RAM blocks to be a page size multiple," +@@ -348,6 +350,15 @@ static int test_ramblock_postcopiable(RAMBlock *rb, void *opaque) + "page size of 0x%zx", block_name, length, pagesize); + return 1; + } ++ ++ if (rb->fd >= 0) { ++ fs = qemu_fd_getfs(rb->fd); ++ if (fs != QEMU_FS_TYPE_TMPFS && fs != QEMU_FS_TYPE_HUGETLBFS) { ++ error_report("Host backend files need to be TMPFS or HUGETLBFS only"); ++ return 1; ++ } ++ } ++ + return 0; + } + +@@ -366,6 +377,7 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + struct uffdio_range range_struct; + uint64_t feature_mask; + Error *local_err = NULL; ++ RAMBlock *block; + + if (qemu_target_page_size() > pagesize) { + error_report("Target page size bigger than host page size"); +@@ -390,9 +402,23 @@ bool postcopy_ram_supported_by_host(MigrationIncomingState *mis) + goto out; + } + +- /* We don't support postcopy with shared RAM yet */ +- if (foreach_not_ignored_block(test_ramblock_postcopiable, NULL)) { +- goto out; ++ /* ++ * We don't support postcopy with some type of ramblocks. ++ * ++ * NOTE: we explicitly ignored ramblock_is_ignored() instead we checked ++ * all possible ramblocks. This is because this function can be called ++ * when creating the migration object, during the phase RAM_MIGRATABLE ++ * is not even properly set for all the ramblocks. ++ * ++ * A side effect of this is we'll also check against RAM_SHARED ++ * ramblocks even if migrate_ignore_shared() is set (in which case ++ * we'll never migrate RAM_SHARED at all), but normally this shouldn't ++ * affect in reality, or we can revisit. ++ */ ++ RAMBLOCK_FOREACH(block) { ++ if (test_ramblock_postcopiable(block)) { ++ goto out; ++ } + } + + /* +-- +2.39.1 + diff --git a/kvm-migration-remove-extra-whitespace-character-for-code.patch b/kvm-migration-remove-extra-whitespace-character-for-code.patch new file mode 100644 index 0000000..88eb791 --- /dev/null +++ b/kvm-migration-remove-extra-whitespace-character-for-code.patch @@ -0,0 +1,44 @@ +From 93c9a1ae812720d3a29980a3c5fcfc1e916993de Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E6=9D=8E=E7=9A=86=E4=BF=8A?= +Date: Fri, 17 Mar 2023 09:57:13 +0000 +Subject: [PATCH 07/56] migration: remove extra whitespace character for code + style +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [6/50] bc1cd812f8dfc18e47e1644b5333c703eae23d2d (peterx/qemu-kvm) + +Fix code style. + +Signed-off-by: 李皆俊 +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit 8ebb6ecc3798e66a9ba98355983762bedfa1b72d) +Signed-off-by: Peter Xu +--- + migration/ram.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/migration/ram.c b/migration/ram.c +index 79d881f735..0e68099bf9 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -3293,7 +3293,7 @@ static int ram_save_setup(QEMUFile *f, void *opaque) + + migration_ops = g_malloc0(sizeof(MigrationOps)); + migration_ops->ram_save_target_page = ram_save_target_page_legacy; +- ret = multifd_send_sync_main(f); ++ ret = multifd_send_sync_main(f); + if (ret < 0) { + return ret; + } +-- +2.39.1 + diff --git a/kvm-migration-rename-enabled_capabilities-to-capabilitie.patch b/kvm-migration-rename-enabled_capabilities-to-capabilitie.patch new file mode 100644 index 0000000..52b19b3 --- /dev/null +++ b/kvm-migration-rename-enabled_capabilities-to-capabilitie.patch @@ -0,0 +1,329 @@ +From ee566ec12099992f9134bda1db92dd568427245a Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 18:26:59 +0100 +Subject: [PATCH 18/56] migration: rename enabled_capabilities to capabilities +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [17/50] 841a27addf273d8f559bc8ebd2c854200e8ca673 (peterx/qemu-kvm) + +It is clear from the context what that means, and such a long name +with the extra long names of the capabilities make very difficilut to +stay inside the 80 columns limit. + +Signed-off-by: Juan Quintela +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 0cec2056ff67557c18d7b8ab1b70ab47c9e31f2f) +Signed-off-by: Peter Xu +--- + migration/migration.c | 52 +++++++++++++++++++++---------------------- + migration/migration.h | 2 +- + migration/rdma.c | 4 ++-- + migration/savevm.c | 6 ++--- + 4 files changed, 31 insertions(+), 33 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index f1b3439e5f..d8e5fb6226 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -364,8 +364,7 @@ static bool migrate_late_block_activate(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[ +- MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; ++ return s->capabilities[MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE]; + } + + /* +@@ -944,7 +943,7 @@ MigrationCapabilityStatusList *qmp_query_migrate_capabilities(Error **errp) + #endif + caps = g_malloc0(sizeof(*caps)); + caps->capability = i; +- caps->state = s->enabled_capabilities[i]; ++ caps->state = s->capabilities[i]; + QAPI_LIST_APPEND(tail, caps); + } + +@@ -1494,13 +1493,13 @@ void qmp_migrate_set_capabilities(MigrationCapabilityStatusList *params, + return; + } + +- memcpy(cap_list, s->enabled_capabilities, sizeof(cap_list)); ++ memcpy(cap_list, s->capabilities, sizeof(cap_list)); + if (!migrate_caps_check(cap_list, params, errp)) { + return; + } + + for (cap = params; cap; cap = cap->next) { +- s->enabled_capabilities[cap->value->capability] = cap->value->state; ++ s->capabilities[cap->value->capability] = cap->value->state; + } + } + +@@ -2569,7 +2568,7 @@ bool migrate_release_ram(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; ++ return s->capabilities[MIGRATION_CAPABILITY_RELEASE_RAM]; + } + + bool migrate_postcopy_ram(void) +@@ -2578,7 +2577,7 @@ bool migrate_postcopy_ram(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_RAM]; + } + + bool migrate_postcopy(void) +@@ -2592,7 +2591,7 @@ bool migrate_auto_converge(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE]; ++ return s->capabilities[MIGRATION_CAPABILITY_AUTO_CONVERGE]; + } + + bool migrate_zero_blocks(void) +@@ -2601,7 +2600,7 @@ bool migrate_zero_blocks(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; ++ return s->capabilities[MIGRATION_CAPABILITY_ZERO_BLOCKS]; + } + + bool migrate_postcopy_blocktime(void) +@@ -2610,7 +2609,7 @@ bool migrate_postcopy_blocktime(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME]; + } + + bool migrate_use_compression(void) +@@ -2619,7 +2618,7 @@ bool migrate_use_compression(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_COMPRESS]; ++ return s->capabilities[MIGRATION_CAPABILITY_COMPRESS]; + } + + int migrate_compress_level(void) +@@ -2664,7 +2663,7 @@ bool migrate_dirty_bitmaps(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; ++ return s->capabilities[MIGRATION_CAPABILITY_DIRTY_BITMAPS]; + } + + bool migrate_ignore_shared(void) +@@ -2673,7 +2672,7 @@ bool migrate_ignore_shared(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED]; ++ return s->capabilities[MIGRATION_CAPABILITY_X_IGNORE_SHARED]; + } + + bool migrate_validate_uuid(void) +@@ -2682,7 +2681,7 @@ bool migrate_validate_uuid(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; ++ return s->capabilities[MIGRATION_CAPABILITY_VALIDATE_UUID]; + } + + bool migrate_use_events(void) +@@ -2691,7 +2690,7 @@ bool migrate_use_events(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_EVENTS]; ++ return s->capabilities[MIGRATION_CAPABILITY_EVENTS]; + } + + bool migrate_use_multifd(void) +@@ -2700,7 +2699,7 @@ bool migrate_use_multifd(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_MULTIFD]; ++ return s->capabilities[MIGRATION_CAPABILITY_MULTIFD]; + } + + bool migrate_pause_before_switchover(void) +@@ -2709,8 +2708,7 @@ bool migrate_pause_before_switchover(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[ +- MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER]; ++ return s->capabilities[MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER]; + } + + int migrate_multifd_channels(void) +@@ -2757,7 +2755,7 @@ bool migrate_use_zero_copy_send(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; ++ return s->capabilities[MIGRATION_CAPABILITY_ZERO_COPY_SEND]; + } + #endif + +@@ -2776,7 +2774,7 @@ int migrate_use_xbzrle(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_XBZRLE]; ++ return s->capabilities[MIGRATION_CAPABILITY_XBZRLE]; + } + + uint64_t migrate_xbzrle_cache_size(void) +@@ -2803,7 +2801,7 @@ bool migrate_use_block(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_BLOCK]; ++ return s->capabilities[MIGRATION_CAPABILITY_BLOCK]; + } + + bool migrate_use_return_path(void) +@@ -2812,7 +2810,7 @@ bool migrate_use_return_path(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; ++ return s->capabilities[MIGRATION_CAPABILITY_RETURN_PATH]; + } + + bool migrate_use_block_incremental(void) +@@ -2830,7 +2828,7 @@ bool migrate_background_snapshot(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; ++ return s->capabilities[MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT]; + } + + bool migrate_postcopy_preempt(void) +@@ -2839,7 +2837,7 @@ bool migrate_postcopy_preempt(void) + + s = migrate_get_current(); + +- return s->enabled_capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]; ++ return s->capabilities[MIGRATION_CAPABILITY_POSTCOPY_PREEMPT]; + } + + /* migration thread support */ +@@ -3584,7 +3582,7 @@ fail: + bool migrate_colo_enabled(void) + { + MigrationState *s = migrate_get_current(); +- return s->enabled_capabilities[MIGRATION_CAPABILITY_X_COLO]; ++ return s->capabilities[MIGRATION_CAPABILITY_X_COLO]; + } + + typedef enum MigThrError { +@@ -4447,7 +4445,7 @@ void migration_global_dump(Monitor *mon) + } + + #define DEFINE_PROP_MIG_CAP(name, x) \ +- DEFINE_PROP_BOOL(name, MigrationState, enabled_capabilities[x], false) ++ DEFINE_PROP_BOOL(name, MigrationState, capabilities[x], false) + + static Property migration_properties[] = { + DEFINE_PROP_BOOL("store-global-state", MigrationState, +@@ -4646,7 +4644,7 @@ static bool migration_object_check(MigrationState *ms, Error **errp) + } + + for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { +- if (ms->enabled_capabilities[i]) { ++ if (ms->capabilities[i]) { + QAPI_LIST_PREPEND(head, migrate_cap_add(i, true)); + } + } +diff --git a/migration/migration.h b/migration/migration.h +index 310ae8901b..04e0860b4e 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -310,7 +310,7 @@ struct MigrationState { + int64_t downtime_start; + int64_t downtime; + int64_t expected_downtime; +- bool enabled_capabilities[MIGRATION_CAPABILITY__MAX]; ++ bool capabilities[MIGRATION_CAPABILITY__MAX]; + int64_t setup_time; + /* + * Whether guest was running when we enter the completion stage. +diff --git a/migration/rdma.c b/migration/rdma.c +index df646be35e..f35f021963 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -4179,7 +4179,7 @@ void rdma_start_outgoing_migration(void *opaque, + } + + ret = qemu_rdma_source_init(rdma, +- s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); ++ s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); + + if (ret) { + goto err; +@@ -4201,7 +4201,7 @@ void rdma_start_outgoing_migration(void *opaque, + } + + ret = qemu_rdma_source_init(rdma_return_path, +- s->enabled_capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); ++ s->capabilities[MIGRATION_CAPABILITY_RDMA_PIN_ALL], errp); + + if (ret) { + goto return_path_err; +diff --git a/migration/savevm.c b/migration/savevm.c +index aa54a67fda..589ef926ab 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -253,7 +253,7 @@ static uint32_t get_validatable_capabilities_count(void) + uint32_t result = 0; + int i; + for (i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { +- if (should_validate_capability(i) && s->enabled_capabilities[i]) { ++ if (should_validate_capability(i) && s->capabilities[i]) { + result++; + } + } +@@ -275,7 +275,7 @@ static int configuration_pre_save(void *opaque) + state->capabilities = g_renew(MigrationCapability, state->capabilities, + state->caps_count); + for (i = j = 0; i < MIGRATION_CAPABILITY__MAX; i++) { +- if (should_validate_capability(i) && s->enabled_capabilities[i]) { ++ if (should_validate_capability(i) && s->capabilities[i]) { + state->capabilities[j++] = i; + } + } +@@ -325,7 +325,7 @@ static bool configuration_validate_capabilities(SaveState *state) + continue; + } + source_state = test_bit(i, source_caps_bm); +- target_state = s->enabled_capabilities[i]; ++ target_state = s->capabilities[i]; + if (source_state != target_state) { + error_report("Capability %s is %s, but received capability is %s", + MigrationCapability_str(i), +-- +2.39.1 + diff --git a/kvm-multifd-Fix-the-number-of-channels-ready.patch b/kvm-multifd-Fix-the-number-of-channels-ready.patch new file mode 100644 index 0000000..abf21e6 --- /dev/null +++ b/kvm-multifd-Fix-the-number-of-channels-ready.patch @@ -0,0 +1,58 @@ +From af6f2a543c7db6d67d33fd12615a50e57fc3fe66 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 26 Apr 2023 12:20:36 +0200 +Subject: [PATCH 19/21] multifd: Fix the number of channels ready +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Leonardo Brás +RH-MergeRequest: 171: multifd: Fix the number of channels ready +RH-Bugzilla: 2196289 +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] a5e271ba249d85b27a68d3cff10480ca3a112c5d (LeoBras/centos-qemu-kvm) + +We don't wait in the sem when we are doing a sync_main. Make it wait +there. To make things clearer, we mark the channel ready at the +begining of the thread loop. + +Signed-off-by: Juan Quintela +Reviewed-by: Fabiano Rosas +(cherry picked from commit d2026ee117147893f8d80f060cede6d872ecbd7f) +Signed-off-by: Leonardo Bras +--- + migration/multifd.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/migration/multifd.c b/migration/multifd.c +index cce3ad6988..6a59c03dd2 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -635,6 +635,7 @@ int multifd_send_sync_main(QEMUFile *f) + for (i = 0; i < migrate_multifd_channels(); i++) { + MultiFDSendParams *p = &multifd_send_state->params[i]; + ++ qemu_sem_wait(&multifd_send_state->channels_ready); + trace_multifd_send_sync_main_wait(p->id); + qemu_sem_wait(&p->sem_sync); + +@@ -668,6 +669,7 @@ static void *multifd_send_thread(void *opaque) + p->num_packets = 1; + + while (true) { ++ qemu_sem_post(&multifd_send_state->channels_ready); + qemu_sem_wait(&p->sem); + + if (qatomic_read(&multifd_send_state->exiting)) { +@@ -736,7 +738,6 @@ static void *multifd_send_thread(void *opaque) + if (flags & MULTIFD_FLAG_SYNC) { + qemu_sem_post(&p->sem_sync); + } +- qemu_sem_post(&multifd_send_state->channels_ready); + } else if (p->quit) { + qemu_mutex_unlock(&p->mutex); + break; +-- +2.39.3 + diff --git a/kvm-nbd-server-Fix-drained_poll-to-wake-coroutine-in-rig.patch b/kvm-nbd-server-Fix-drained_poll-to-wake-coroutine-in-rig.patch new file mode 100644 index 0000000..214b6dd --- /dev/null +++ b/kvm-nbd-server-Fix-drained_poll-to-wake-coroutine-in-rig.patch @@ -0,0 +1,159 @@ +From 639f65d2cd4c6627a1d22c4b418b41400fe40154 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 17 May 2023 17:28:33 +0200 +Subject: [PATCH 03/21] nbd/server: Fix drained_poll to wake coroutine in right + AioContext + +RH-Author: Kevin Wolf +RH-MergeRequest: 166: block/graph-lock: Disable locking for now +RH-Bugzilla: 2186725 +RH-Acked-by: Eric Blake +RH-Acked-by: Emanuele Giuseppe Esposito +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [3/4] 177092e61360c2feb04377890b32fdeb2d1cfefc (kmwolf/centos-qemu-kvm) + +nbd_drained_poll() generally runs in the main thread, not whatever +iothread the NBD server coroutine is meant to run in, so it can't +directly reenter the coroutines to wake them up. + +The code seems to have the right intention, it specifies the correct +AioContext when it calls qemu_aio_coroutine_enter(). However, this +functions doesn't schedule the coroutine to run in that AioContext, but +it assumes it is already called in the home thread of the AioContext. + +To fix this, add a new thread-safe qio_channel_wake_read() that can be +called in the main thread to wake up the coroutine in its AioContext, +and use this in nbd_drained_poll(). + +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Message-Id: <20230517152834.277483-3-kwolf@redhat.com> +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit 7c1f51bf38de8cea4ed5030467646c37b46edeb7) +Signed-off-by: Kevin Wolf +--- + include/io/channel.h | 10 ++++++++++ + io/channel.c | 33 +++++++++++++++++++++++++++------ + nbd/server.c | 3 +-- + 3 files changed, 38 insertions(+), 8 deletions(-) + +diff --git a/include/io/channel.h b/include/io/channel.h +index 153fbd2904..2b905423a9 100644 +--- a/include/io/channel.h ++++ b/include/io/channel.h +@@ -757,6 +757,16 @@ void qio_channel_detach_aio_context(QIOChannel *ioc); + void coroutine_fn qio_channel_yield(QIOChannel *ioc, + GIOCondition condition); + ++/** ++ * qio_channel_wake_read: ++ * @ioc: the channel object ++ * ++ * If qio_channel_yield() is currently waiting for the channel to become ++ * readable, interrupt it and reenter immediately. This function is safe to call ++ * from any thread. ++ */ ++void qio_channel_wake_read(QIOChannel *ioc); ++ + /** + * qio_channel_wait: + * @ioc: the channel object +diff --git a/io/channel.c b/io/channel.c +index a8c7f11649..3c9b7beb65 100644 +--- a/io/channel.c ++++ b/io/channel.c +@@ -19,6 +19,7 @@ + */ + + #include "qemu/osdep.h" ++#include "block/aio-wait.h" + #include "io/channel.h" + #include "qapi/error.h" + #include "qemu/main-loop.h" +@@ -514,7 +515,11 @@ int qio_channel_flush(QIOChannel *ioc, + static void qio_channel_restart_read(void *opaque) + { + QIOChannel *ioc = opaque; +- Coroutine *co = ioc->read_coroutine; ++ Coroutine *co = qatomic_xchg(&ioc->read_coroutine, NULL); ++ ++ if (!co) { ++ return; ++ } + + /* Assert that aio_co_wake() reenters the coroutine directly */ + assert(qemu_get_current_aio_context() == +@@ -525,7 +530,11 @@ static void qio_channel_restart_read(void *opaque) + static void qio_channel_restart_write(void *opaque) + { + QIOChannel *ioc = opaque; +- Coroutine *co = ioc->write_coroutine; ++ Coroutine *co = qatomic_xchg(&ioc->write_coroutine, NULL); ++ ++ if (!co) { ++ return; ++ } + + /* Assert that aio_co_wake() reenters the coroutine directly */ + assert(qemu_get_current_aio_context() == +@@ -568,7 +577,11 @@ void qio_channel_detach_aio_context(QIOChannel *ioc) + void coroutine_fn qio_channel_yield(QIOChannel *ioc, + GIOCondition condition) + { ++ AioContext *ioc_ctx = ioc->ctx ?: qemu_get_aio_context(); ++ + assert(qemu_in_coroutine()); ++ assert(in_aio_context_home_thread(ioc_ctx)); ++ + if (condition == G_IO_IN) { + assert(!ioc->read_coroutine); + ioc->read_coroutine = qemu_coroutine_self(); +@@ -580,18 +593,26 @@ void coroutine_fn qio_channel_yield(QIOChannel *ioc, + } + qio_channel_set_aio_fd_handlers(ioc); + qemu_coroutine_yield(); ++ assert(in_aio_context_home_thread(ioc_ctx)); + + /* Allow interrupting the operation by reentering the coroutine other than + * through the aio_fd_handlers. */ +- if (condition == G_IO_IN && ioc->read_coroutine) { +- ioc->read_coroutine = NULL; ++ if (condition == G_IO_IN) { ++ assert(ioc->read_coroutine == NULL); + qio_channel_set_aio_fd_handlers(ioc); +- } else if (condition == G_IO_OUT && ioc->write_coroutine) { +- ioc->write_coroutine = NULL; ++ } else if (condition == G_IO_OUT) { ++ assert(ioc->write_coroutine == NULL); + qio_channel_set_aio_fd_handlers(ioc); + } + } + ++void qio_channel_wake_read(QIOChannel *ioc) ++{ ++ Coroutine *co = qatomic_xchg(&ioc->read_coroutine, NULL); ++ if (co) { ++ aio_co_wake(co); ++ } ++} + + static gboolean qio_channel_wait_complete(QIOChannel *ioc, + GIOCondition condition, +diff --git a/nbd/server.c b/nbd/server.c +index 3d8d0d81df..ea47522e8f 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -1599,8 +1599,7 @@ static bool nbd_drained_poll(void *opaque) + * enter it here so we don't depend on the client to wake it up. + */ + if (client->recv_coroutine != NULL && client->read_yielding) { +- qemu_aio_coroutine_enter(exp->common.ctx, +- client->recv_coroutine); ++ qio_channel_wake_read(client->ioc); + } + + return true; +-- +2.39.3 + diff --git a/kvm-numa-Validate-cluster-and-NUMA-node-boundary-if-requ.patch b/kvm-numa-Validate-cluster-and-NUMA-node-boundary-if-requ.patch new file mode 100644 index 0000000..66d68f1 --- /dev/null +++ b/kvm-numa-Validate-cluster-and-NUMA-node-boundary-if-requ.patch @@ -0,0 +1,145 @@ +From 760a2f284f6d4cd3cd3b1685411bbca21c4ad233 Mon Sep 17 00:00:00 2001 +From: Gavin Shan +Date: Tue, 27 Jun 2023 20:20:09 +1000 +Subject: [PATCH 1/6] numa: Validate cluster and NUMA node boundary if required +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gavin Shan +RH-MergeRequest: 175: hw/arm: Validate CPU cluster and NUMA node boundary for RHEL machines +RH-Bugzilla: 2171363 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Eric Auger +RH-Commit: [1/3] 24580064b9a0076ec4d9a916839d85135ac48cd9 + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2171363 + +For some architectures like ARM64, multiple CPUs in one cluster can be +associated with different NUMA nodes, which is irregular configuration +because we shouldn't have this in baremetal environment. The irregular +configuration causes Linux guest to misbehave, as the following warning +messages indicate. + + -smp 6,maxcpus=6,sockets=2,clusters=1,cores=3,threads=1 \ + -numa node,nodeid=0,cpus=0-1,memdev=ram0 \ + -numa node,nodeid=1,cpus=2-3,memdev=ram1 \ + -numa node,nodeid=2,cpus=4-5,memdev=ram2 \ + + ------------[ cut here ]------------ + WARNING: CPU: 0 PID: 1 at kernel/sched/topology.c:2271 build_sched_domains+0x284/0x910 + Modules linked in: + CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.14.0-268.el9.aarch64 #1 + pstate: 00400005 (nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) + pc : build_sched_domains+0x284/0x910 + lr : build_sched_domains+0x184/0x910 + sp : ffff80000804bd50 + x29: ffff80000804bd50 x28: 0000000000000002 x27: 0000000000000000 + x26: ffff800009cf9a80 x25: 0000000000000000 x24: ffff800009cbf840 + x23: ffff000080325000 x22: ffff0000005df800 x21: ffff80000a4ce508 + x20: 0000000000000000 x19: ffff000080324440 x18: 0000000000000014 + x17: 00000000388925c0 x16: 000000005386a066 x15: 000000009c10cc2e + x14: 00000000000001c0 x13: 0000000000000001 x12: ffff00007fffb1a0 + x11: ffff00007fffb180 x10: ffff80000a4ce508 x9 : 0000000000000041 + x8 : ffff80000a4ce500 x7 : ffff80000a4cf920 x6 : 0000000000000001 + x5 : 0000000000000001 x4 : 0000000000000007 x3 : 0000000000000002 + x2 : 0000000000001000 x1 : ffff80000a4cf928 x0 : 0000000000000001 + Call trace: + build_sched_domains+0x284/0x910 + sched_init_domains+0xac/0xe0 + sched_init_smp+0x48/0xc8 + kernel_init_freeable+0x140/0x1ac + kernel_init+0x28/0x140 + ret_from_fork+0x10/0x20 + +Improve the situation to warn when multiple CPUs in one cluster have +been associated with different NUMA nodes. However, one NUMA node is +allowed to be associated with different clusters. + +Signed-off-by: Gavin Shan +Acked-by: Philippe Mathieu-Daudé +Acked-by: Igor Mammedov +Message-Id: <20230509002739.18388-2-gshan@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit a494fdb715832000ee9047a549a35aacfea8175e) +Signed-off-by: Gavin Shan +--- + hw/core/machine.c | 42 ++++++++++++++++++++++++++++++++++++++++++ + include/hw/boards.h | 1 + + 2 files changed, 43 insertions(+) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index c28702b690..5abdc8c39b 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -1496,6 +1496,45 @@ static void machine_numa_finish_cpu_init(MachineState *machine) + g_string_free(s, true); + } + ++static void validate_cpu_cluster_to_numa_boundary(MachineState *ms) ++{ ++ MachineClass *mc = MACHINE_GET_CLASS(ms); ++ NumaState *state = ms->numa_state; ++ const CPUArchIdList *possible_cpus = mc->possible_cpu_arch_ids(ms); ++ const CPUArchId *cpus = possible_cpus->cpus; ++ int i, j; ++ ++ if (state->num_nodes <= 1 || possible_cpus->len <= 1) { ++ return; ++ } ++ ++ /* ++ * The Linux scheduling domain can't be parsed when the multiple CPUs ++ * in one cluster have been associated with different NUMA nodes. However, ++ * it's fine to associate one NUMA node with CPUs in different clusters. ++ */ ++ for (i = 0; i < possible_cpus->len; i++) { ++ for (j = i + 1; j < possible_cpus->len; j++) { ++ if (cpus[i].props.has_socket_id && ++ cpus[i].props.has_cluster_id && ++ cpus[i].props.has_node_id && ++ cpus[j].props.has_socket_id && ++ cpus[j].props.has_cluster_id && ++ cpus[j].props.has_node_id && ++ cpus[i].props.socket_id == cpus[j].props.socket_id && ++ cpus[i].props.cluster_id == cpus[j].props.cluster_id && ++ cpus[i].props.node_id != cpus[j].props.node_id) { ++ warn_report("CPU-%d and CPU-%d in socket-%" PRId64 "-cluster-%" PRId64 ++ " have been associated with node-%" PRId64 " and node-%" PRId64 ++ " respectively. It can cause OSes like Linux to" ++ " misbehave", i, j, cpus[i].props.socket_id, ++ cpus[i].props.cluster_id, cpus[i].props.node_id, ++ cpus[j].props.node_id); ++ } ++ } ++ } ++} ++ + MemoryRegion *machine_consume_memdev(MachineState *machine, + HostMemoryBackend *backend) + { +@@ -1581,6 +1620,9 @@ void machine_run_board_init(MachineState *machine, const char *mem_path, Error * + numa_complete_configuration(machine); + if (machine->numa_state->num_nodes) { + machine_numa_finish_cpu_init(machine); ++ if (machine_class->cpu_cluster_has_numa_boundary) { ++ validate_cpu_cluster_to_numa_boundary(machine); ++ } + } + } + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 5f08bd7550..3628671228 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -275,6 +275,7 @@ struct MachineClass { + bool nvdimm_supported; + bool numa_mem_supported; + bool auto_enable_numa; ++ bool cpu_cluster_has_numa_boundary; + SMPCompatProps smp_props; + const char *default_ram_id; + +-- +2.39.3 + diff --git a/kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch b/kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch new file mode 100644 index 0000000..0421e33 --- /dev/null +++ b/kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch @@ -0,0 +1,42 @@ +From ab9b8620c62540f3267d005c198920671ef9abc3 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 3 Mar 2023 11:15:28 +0100 +Subject: [PATCH 06/56] postcopy-ram: do not use qatomic_mb_read +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [5/50] 534c0e13362dfc994fa90c79bfb5ed6ee8c27dfc (peterx/qemu-kvm) + +It does not even pair with a qatomic_mb_set(), so it is clearer to use +load-acquire in this case; they are synonyms. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 4592eaf38755a28300d113cd128f65b5b38495f2) +Signed-off-by: Peter Xu +--- + migration/postcopy-ram.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c +index bbb8af61ae..d7b48dd920 100644 +--- a/migration/postcopy-ram.c ++++ b/migration/postcopy-ram.c +@@ -1526,7 +1526,7 @@ static PostcopyState incoming_postcopy_state; + + PostcopyState postcopy_state_get(void) + { +- return qatomic_mb_read(&incoming_postcopy_state); ++ return qatomic_load_acquire(&incoming_postcopy_state); + } + + /* Set the state and return the old state */ +-- +2.39.1 + diff --git a/kvm-qapi-add-fdset-feature-for-BlockdevOptionsVirtioBlkV.patch b/kvm-qapi-add-fdset-feature-for-BlockdevOptionsVirtioBlkV.patch new file mode 100644 index 0000000..abaadf8 --- /dev/null +++ b/kvm-qapi-add-fdset-feature-for-BlockdevOptionsVirtioBlkV.patch @@ -0,0 +1,79 @@ +From 99f27e14856c528f442b628e8f4a7881e6e63179 Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Tue, 30 May 2023 09:19:41 +0200 +Subject: [PATCH 4/5] qapi: add '@fdset' feature for + BlockdevOptionsVirtioBlkVhostVdpa + +RH-Author: Stefano Garzarella +RH-MergeRequest: 169: block/blkio: support fd passing for virtio-blk-vhost-vdpa driver +RH-Bugzilla: 2180076 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Stefan Hajnoczi +RH-Commit: [2/2] abee2a542e41f9eaa17dd204b74778e232d1eb60 (sgarzarella/qemu-kvm-c-9-s) + +The virtio-blk-vhost-vdpa driver in libblkio 1.3.0 supports the fd +passing through the new 'fd' property. + +Since now we are using qemu_open() on '@path' if the virtio-blk driver +supports the fd passing, let's announce it. +In this way, the management layer can pass the file descriptor of an +already opened vhost-vdpa character device. This is useful especially +when the device can only be accessed with certain privileges. + +Add the '@fdset' feature only when the virtio-blk-vhost-vdpa driver +in libblkio supports it. + +Suggested-by: Markus Armbruster +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Stefano Garzarella +Message-id: 20230530071941.8954-3-sgarzare@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 98b126f5e3228a346c774e569e26689943b401dd) +- changed doc indentantion since QAPI parser failed downstream because + we don't have commit 08349786c84306863a3b659c8a9b28bb74c405c6 + downstream. It relaxed the indentation rules. +Signed-off-by: Stefano Garzarella +--- + meson.build | 4 ++++ + qapi/block-core.json | 6 ++++++ + 2 files changed, 10 insertions(+) + +diff --git a/meson.build b/meson.build +index d964e741e7..a18cc64531 100644 +--- a/meson.build ++++ b/meson.build +@@ -1843,6 +1843,10 @@ config_host_data.set('CONFIG_LZO', lzo.found()) + config_host_data.set('CONFIG_MPATH', mpathpersist.found()) + config_host_data.set('CONFIG_MPATH_NEW_API', mpathpersist_new_api) + config_host_data.set('CONFIG_BLKIO', blkio.found()) ++if blkio.found() ++ config_host_data.set('CONFIG_BLKIO_VHOST_VDPA_FD', ++ blkio.version().version_compare('>=1.3.0')) ++endif + config_host_data.set('CONFIG_CURL', curl.found()) + config_host_data.set('CONFIG_CURSES', curses.found()) + config_host_data.set('CONFIG_GBM', gbm.found()) +diff --git a/qapi/block-core.json b/qapi/block-core.json +index c05ad0c07e..81b48a8d3b 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -3841,10 +3841,16 @@ + # + # @path: path to the vhost-vdpa character device. + # ++# Features: ++# @fdset: Member @path supports the special "/dev/fdset/N" path ++# (since 8.1) ++# + # Since: 7.2 + ## + { 'struct': 'BlockdevOptionsVirtioBlkVhostVdpa', + 'data': { 'path': 'str' }, ++ 'features': [ { 'name' :'fdset', ++ 'if': 'CONFIG_BLKIO_VHOST_VDPA_FD' } ], + 'if': 'CONFIG_BLKIO' } + + ## +-- +2.39.3 + diff --git a/kvm-raven-disable-reentrancy-detection-for-iomem.patch b/kvm-raven-disable-reentrancy-detection-for-iomem.patch new file mode 100644 index 0000000..4a4a2cc --- /dev/null +++ b/kvm-raven-disable-reentrancy-detection-for-iomem.patch @@ -0,0 +1,54 @@ +From 936e21428a04524ccffeb36110d1aa61de9f44e5 Mon Sep 17 00:00:00 2001 +From: Jon Maloy +Date: Tue, 9 May 2023 10:29:03 -0400 +Subject: [PATCH 11/21] raven: disable reentrancy detection for iomem + +RH-Author: Jon Maloy +RH-MergeRequest: 165: memory: prevent dma-reentracy issues +RH-Jira: RHEL-516 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [7/13] 48278583aa1ab08b912f49cd8b3a79d1bb3abf5f (jmaloy/jmaloy-qemu-kvm-2) + +Jira: https://issues.redhat.com/browse/RHEL-516 +Upstream: Merged +CVE: CVE-2023-2680 + +commit 6dad5a6810d9c60ca320d01276f6133bbcfa1fc7 +Author: Alexander Bulekov +Date: Thu Apr 27 17:10:12 2023 -0400 + + raven: disable reentrancy detection for iomem + + As the code is designed for re-entrant calls from raven_io_ops to + pci-conf, mark raven_io_ops as reentrancy-safe. + + Signed-off-by: Alexander Bulekov + Message-Id: <20230427211013.2994127-8-alxndr@bu.edu> + Signed-off-by: Thomas Huth + +Signed-off-by: Jon Maloy +--- + hw/pci-host/raven.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/hw/pci-host/raven.c b/hw/pci-host/raven.c +index 072ffe3c5e..9a11ac4b2b 100644 +--- a/hw/pci-host/raven.c ++++ b/hw/pci-host/raven.c +@@ -294,6 +294,13 @@ static void raven_pcihost_initfn(Object *obj) + memory_region_init(&s->pci_memory, obj, "pci-memory", 0x3f000000); + address_space_init(&s->pci_io_as, &s->pci_io, "raven-io"); + ++ /* ++ * Raven's raven_io_ops use the address-space API to access pci-conf-idx ++ * (which is also owned by the raven device). As such, mark the ++ * pci_io_non_contiguous as re-entrancy safe. ++ */ ++ s->pci_io_non_contiguous.disable_reentrancy_guard = true; ++ + /* CPU address space */ + memory_region_add_subregion(address_space_mem, PCI_IO_BASE_ADDR, + &s->pci_io); +-- +2.39.3 + diff --git a/kvm-s390x-pv-Fix-spurious-warning-with-asynchronous-tear.patch b/kvm-s390x-pv-Fix-spurious-warning-with-asynchronous-tear.patch new file mode 100644 index 0000000..ecf1353 --- /dev/null +++ b/kvm-s390x-pv-Fix-spurious-warning-with-asynchronous-tear.patch @@ -0,0 +1,129 @@ +From 3cab2a638a10ece2b76d9f33a3c5dc6f64f1bbaa Mon Sep 17 00:00:00 2001 +From: Claudio Imbrenda +Date: Wed, 10 May 2023 12:55:31 +0200 +Subject: [PATCH 21/21] s390x/pv: Fix spurious warning with asynchronous + teardown +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 173: Improve memory reclaiming for z15 Secure Execution guests +RH-Bugzilla: 2168500 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Cédric Le Goater +RH-Commit: [2/2] cb690d3155ea22c6df00a4d75b72f501515e5556 (thuth/qemu-kvm-cs9) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168500 + +Kernel commit 292a7d6fca33 ("KVM: s390: pv: fix asynchronous teardown +for small VMs") causes the KVM_PV_ASYNC_CLEANUP_PREPARE ioctl to fail +if the VM is not larger than 2GiB. QEMU would attempt it and fail, +print an error message, and then proceed with a normal teardown. + +Avoid attempting to use asynchronous teardown altogether when the VM is +not larger than 2 GiB. This will avoid triggering the error message and +also avoid pointless overhead; normal teardown is fast enough for small +VMs. + +Reported-by: Marc Hartmayer +Fixes: c3a073c610 ("s390x/pv: Add support for asynchronous teardown for reboot") +Link: https://lore.kernel.org/all/20230421085036.52511-2-imbrenda@linux.ibm.com/ +Signed-off-by: Claudio Imbrenda +Message-Id: <20230510105531.30623-2-imbrenda@linux.ibm.com> +Reviewed-by: Thomas Huth +[thuth: Fix inline function parameter in pv.h] +Signed-off-by: Thomas Huth +(cherry picked from commit 88693ab2a53f2f3d25cb39a7b5034ab391bc5a81) +--- + hw/s390x/pv.c | 10 ++++++++-- + hw/s390x/s390-virtio-ccw.c | 2 +- + include/hw/s390x/pv.h | 6 +++--- + 3 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c +index 49ea38236c..b63f3784c6 100644 +--- a/hw/s390x/pv.c ++++ b/hw/s390x/pv.c +@@ -13,6 +13,7 @@ + + #include + ++#include "qemu/units.h" + #include "qapi/error.h" + #include "qemu/error-report.h" + #include "sysemu/kvm.h" +@@ -115,7 +116,7 @@ static void *s390_pv_do_unprot_async_fn(void *p) + return NULL; + } + +-bool s390_pv_vm_try_disable_async(void) ++bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms) + { + /* + * t is only needed to create the thread; once qemu_thread_create +@@ -123,7 +124,12 @@ bool s390_pv_vm_try_disable_async(void) + */ + QemuThread t; + +- if (!kvm_check_extension(kvm_state, KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) { ++ /* ++ * If the feature is not present or if the VM is not larger than 2 GiB, ++ * KVM_PV_ASYNC_CLEANUP_PREPARE fill fail; no point in attempting it. ++ */ ++ if ((MACHINE(ms)->maxram_size <= 2 * GiB) || ++ !kvm_check_extension(kvm_state, KVM_CAP_S390_PROTECTED_ASYNC_DISABLE)) { + return false; + } + if (s390_pv_cmd(KVM_PV_ASYNC_CLEANUP_PREPARE, NULL) != 0) { +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 6a0b93c63d..d95c595f88 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -330,7 +330,7 @@ static inline void s390_do_cpu_ipl(CPUState *cs, run_on_cpu_data arg) + + static void s390_machine_unprotect(S390CcwMachineState *ms) + { +- if (!s390_pv_vm_try_disable_async()) { ++ if (!s390_pv_vm_try_disable_async(ms)) { + s390_pv_vm_disable(); + } + ms->pv = false; +diff --git a/include/hw/s390x/pv.h b/include/hw/s390x/pv.h +index 966306a9db..7b935e2246 100644 +--- a/include/hw/s390x/pv.h ++++ b/include/hw/s390x/pv.h +@@ -14,10 +14,10 @@ + + #include "qapi/error.h" + #include "sysemu/kvm.h" ++#include "hw/s390x/s390-virtio-ccw.h" + + #ifdef CONFIG_KVM + #include "cpu.h" +-#include "hw/s390x/s390-virtio-ccw.h" + + static inline bool s390_is_pv(void) + { +@@ -41,7 +41,7 @@ static inline bool s390_is_pv(void) + int s390_pv_query_info(void); + int s390_pv_vm_enable(void); + void s390_pv_vm_disable(void); +-bool s390_pv_vm_try_disable_async(void); ++bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms); + int s390_pv_set_sec_parms(uint64_t origin, uint64_t length); + int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tweak); + void s390_pv_prep_reset(void); +@@ -61,7 +61,7 @@ static inline bool s390_is_pv(void) { return false; } + static inline int s390_pv_query_info(void) { return 0; } + static inline int s390_pv_vm_enable(void) { return 0; } + static inline void s390_pv_vm_disable(void) {} +-static inline bool s390_pv_vm_try_disable_async(void) { return false; } ++static inline bool s390_pv_vm_try_disable_async(S390CcwMachineState *ms) { return false; } + static inline int s390_pv_set_sec_parms(uint64_t origin, uint64_t length) { return 0; } + static inline int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t tweak) { return 0; } + static inline void s390_pv_prep_reset(void) {} +-- +2.39.3 + diff --git a/kvm-s390x.conf b/kvm-s390x.conf new file mode 100644 index 0000000..d82b818 --- /dev/null +++ b/kvm-s390x.conf @@ -0,0 +1,19 @@ +# User changes in this file are preserved across upgrades. +# +# Setting "modprobe kvm nested=1" only enables Nested Virtualization until +# the next reboot or module reload. Uncomment the option below to enable +# the feature permanently. +# +#options kvm nested=1 +# +# +# Setting "modprobe kvm hpage=1" only enables Huge Page Backing (1MB) +# support until the next reboot or module reload. Uncomment the option +# below to enable the feature permanently. +# +# Note: - Incompatible with "nested=1". Loading the module will fail. +# - Dirty page logging will be performed on a 1MB (not 4KB) basis, +# which can result in a lot of data having to be transferred during +# migration, and therefore taking very long to converge. +# +#options kvm hpage=1 diff --git a/kvm-spice-move-client_migrate_info-command-to-ui.patch b/kvm-spice-move-client_migrate_info-command-to-ui.patch new file mode 100644 index 0000000..f1de158 --- /dev/null +++ b/kvm-spice-move-client_migrate_info-command-to-ui.patch @@ -0,0 +1,248 @@ +From 00f6e941e75f378c84c773a15efde7dd085d9ce3 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Wed, 1 Mar 2023 19:40:14 +0100 +Subject: [PATCH 21/56] spice: move client_migrate_info command to ui/ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [20/50] a587bb001b51a1f9fdf2fcfb0978bb931ae443b6 (peterx/qemu-kvm) + +It has nothing to do with migration, except for the "migrate" in the +name of the command. Move it with the rest of the ui commands. + +Signed-off-by: Juan Quintela +Reviewed-by: Philippe Mathieu-Daudé +(cherry picked from commit f9e1ef7482f1ee289b04f4b45702a1701bc8929d) +Signed-off-by: Peter Xu +--- + migration/migration-hmp-cmds.c | 17 ----------------- + migration/migration.c | 30 ------------------------------ + qapi/migration.json | 28 ---------------------------- + qapi/ui.json | 28 ++++++++++++++++++++++++++++ + ui/ui-hmp-cmds.c | 17 +++++++++++++++++ + ui/ui-qmp-cmds.c | 29 +++++++++++++++++++++++++++++ + 6 files changed, 74 insertions(+), 75 deletions(-) + +diff --git a/migration/migration-hmp-cmds.c b/migration/migration-hmp-cmds.c +index 71da91967a..4e9f00e7dc 100644 +--- a/migration/migration-hmp-cmds.c ++++ b/migration/migration-hmp-cmds.c +@@ -636,23 +636,6 @@ void hmp_migrate_set_parameter(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, err); + } + +-void hmp_client_migrate_info(Monitor *mon, const QDict *qdict) +-{ +- Error *err = NULL; +- const char *protocol = qdict_get_str(qdict, "protocol"); +- const char *hostname = qdict_get_str(qdict, "hostname"); +- bool has_port = qdict_haskey(qdict, "port"); +- int port = qdict_get_try_int(qdict, "port", -1); +- bool has_tls_port = qdict_haskey(qdict, "tls-port"); +- int tls_port = qdict_get_try_int(qdict, "tls-port", -1); +- const char *cert_subject = qdict_get_try_str(qdict, "cert-subject"); +- +- qmp_client_migrate_info(protocol, hostname, +- has_port, port, has_tls_port, tls_port, +- cert_subject, &err); +- hmp_handle_error(mon, err); +-} +- + void hmp_migrate_start_postcopy(Monitor *mon, const QDict *qdict) + { + Error *err = NULL; +diff --git a/migration/migration.c b/migration/migration.c +index aa96ffdc5b..b745d829a4 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -63,7 +63,6 @@ + #include "sysemu/cpus.h" + #include "yank_functions.h" + #include "sysemu/qtest.h" +-#include "ui/qemu-spice.h" + + #define MAX_THROTTLE (128 << 20) /* Migration transfer speed throttling */ + +@@ -1018,35 +1017,6 @@ MigrationParameters *qmp_query_migrate_parameters(Error **errp) + return params; + } + +-void qmp_client_migrate_info(const char *protocol, const char *hostname, +- bool has_port, int64_t port, +- bool has_tls_port, int64_t tls_port, +- const char *cert_subject, +- Error **errp) +-{ +- if (strcmp(protocol, "spice") == 0) { +- if (!qemu_using_spice(errp)) { +- return; +- } +- +- if (!has_port && !has_tls_port) { +- error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port"); +- return; +- } +- +- if (qemu_spice.migrate_info(hostname, +- has_port ? port : -1, +- has_tls_port ? tls_port : -1, +- cert_subject)) { +- error_setg(errp, "Could not set up display for migration"); +- return; +- } +- return; +- } +- +- error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'"); +-} +- + AnnounceParameters *migrate_announce_params(void) + { + static AnnounceParameters ap; +diff --git a/qapi/migration.json b/qapi/migration.json +index c84fa10e86..2c35b7b9cf 100644 +--- a/qapi/migration.json ++++ b/qapi/migration.json +@@ -1203,34 +1203,6 @@ + { 'command': 'query-migrate-parameters', + 'returns': 'MigrationParameters' } + +-## +-# @client_migrate_info: +-# +-# Set migration information for remote display. This makes the server +-# ask the client to automatically reconnect using the new parameters +-# once migration finished successfully. Only implemented for SPICE. +-# +-# @protocol: must be "spice" +-# @hostname: migration target hostname +-# @port: spice tcp port for plaintext channels +-# @tls-port: spice tcp port for tls-secured channels +-# @cert-subject: server certificate subject +-# +-# Since: 0.14 +-# +-# Example: +-# +-# -> { "execute": "client_migrate_info", +-# "arguments": { "protocol": "spice", +-# "hostname": "virt42.lab.kraxel.org", +-# "port": 1234 } } +-# <- { "return": {} } +-# +-## +-{ 'command': 'client_migrate_info', +- 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int', +- '*tls-port': 'int', '*cert-subject': 'str' } } +- + ## + # @migrate-start-postcopy: + # +diff --git a/qapi/ui.json b/qapi/ui.json +index 98322342f7..7ddd27a932 100644 +--- a/qapi/ui.json ++++ b/qapi/ui.json +@@ -1554,3 +1554,31 @@ + { 'command': 'display-update', + 'data': 'DisplayUpdateOptions', + 'boxed' : true } ++ ++## ++# @client_migrate_info: ++# ++# Set migration information for remote display. This makes the server ++# ask the client to automatically reconnect using the new parameters ++# once migration finished successfully. Only implemented for SPICE. ++# ++# @protocol: must be "spice" ++# @hostname: migration target hostname ++# @port: spice tcp port for plaintext channels ++# @tls-port: spice tcp port for tls-secured channels ++# @cert-subject: server certificate subject ++# ++# Since: 0.14 ++# ++# Example: ++# ++# -> { "execute": "client_migrate_info", ++# "arguments": { "protocol": "spice", ++# "hostname": "virt42.lab.kraxel.org", ++# "port": 1234 } } ++# <- { "return": {} } ++# ++## ++{ 'command': 'client_migrate_info', ++ 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int', ++ '*tls-port': 'int', '*cert-subject': 'str' } } +diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c +index 5c456ecc02..c671389473 100644 +--- a/ui/ui-hmp-cmds.c ++++ b/ui/ui-hmp-cmds.c +@@ -458,3 +458,20 @@ hmp_screendump(Monitor *mon, const QDict *qdict) + end: + hmp_handle_error(mon, err); + } ++ ++void hmp_client_migrate_info(Monitor *mon, const QDict *qdict) ++{ ++ Error *err = NULL; ++ const char *protocol = qdict_get_str(qdict, "protocol"); ++ const char *hostname = qdict_get_str(qdict, "hostname"); ++ bool has_port = qdict_haskey(qdict, "port"); ++ int port = qdict_get_try_int(qdict, "port", -1); ++ bool has_tls_port = qdict_haskey(qdict, "tls-port"); ++ int tls_port = qdict_get_try_int(qdict, "tls-port", -1); ++ const char *cert_subject = qdict_get_try_str(qdict, "cert-subject"); ++ ++ qmp_client_migrate_info(protocol, hostname, ++ has_port, port, has_tls_port, tls_port, ++ cert_subject, &err); ++ hmp_handle_error(mon, err); ++} +diff --git a/ui/ui-qmp-cmds.c b/ui/ui-qmp-cmds.c +index dbc4afcd73..a37a7024f3 100644 +--- a/ui/ui-qmp-cmds.c ++++ b/ui/ui-qmp-cmds.c +@@ -175,3 +175,32 @@ void qmp_display_update(DisplayUpdateOptions *arg, Error **errp) + abort(); + } + } ++ ++void qmp_client_migrate_info(const char *protocol, const char *hostname, ++ bool has_port, int64_t port, ++ bool has_tls_port, int64_t tls_port, ++ const char *cert_subject, ++ Error **errp) ++{ ++ if (strcmp(protocol, "spice") == 0) { ++ if (!qemu_using_spice(errp)) { ++ return; ++ } ++ ++ if (!has_port && !has_tls_port) { ++ error_setg(errp, QERR_MISSING_PARAMETER, "port/tls-port"); ++ return; ++ } ++ ++ if (qemu_spice.migrate_info(hostname, ++ has_port ? port : -1, ++ has_tls_port ? tls_port : -1, ++ cert_subject)) { ++ error_setg(errp, "Could not set up display for migration"); ++ return; ++ } ++ return; ++ } ++ ++ error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "protocol", "'spice'"); ++} +-- +2.39.1 + diff --git a/kvm-target-i386-add-support-for-FB_CLEAR-feature.patch b/kvm-target-i386-add-support-for-FB_CLEAR-feature.patch new file mode 100644 index 0000000..2b1cbc9 --- /dev/null +++ b/kvm-target-i386-add-support-for-FB_CLEAR-feature.patch @@ -0,0 +1,71 @@ +From 0d056d6da9e4147d5965bf3507f6d6d6a413924d Mon Sep 17 00:00:00 2001 +From: Emanuele Giuseppe Esposito +Date: Wed, 24 May 2023 06:52:43 -0400 +Subject: [PATCH 2/5] target/i386: add support for FB_CLEAR feature + +RH-Author: Emanuele Giuseppe Esposito +RH-MergeRequest: 167: target/i386: add support for FB_CLEAR feature +RH-Bugzilla: 2216201 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [2/2] 5f191964ba25754107a06ef907f4ac614280aaa1 (eesposit/qemu-kvm) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2216201 + +commit 22e1094ca82d5518c1b69aff3e87c550776ae1eb +Author: Emanuele Giuseppe Esposito +Date: Wed Feb 1 08:57:59 2023 -0500 + + target/i386: add support for FB_CLEAR feature + + As reported by the Intel's doc: + "FB_CLEAR: The processor will overwrite fill buffer values as part of + MD_CLEAR operations with the VERW instruction. + On these processors, L1D_FLUSH does not overwrite fill buffer values." + + If this cpu feature is present in host, allow QEMU to choose whether to + show it to the guest too. + One disadvantage of not exposing it is that the guest will report + a non existing vulnerability in + /sys/devices/system/cpu/vulnerabilities/mmio_stale_data + because the mitigation is present only when the cpu has + (FLUSH_L1D and MD_CLEAR) or FB_CLEAR + features enabled. + + Signed-off-by: Emanuele Giuseppe Esposito + Message-Id: <20230201135759.555607-3-eesposit@redhat.com> + Signed-off-by: Paolo Bonzini + +Signed-off-by: Emanuele Giuseppe Esposito +--- + target/i386/cpu.c | 2 +- + target/i386/cpu.h | 1 + + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index caf6338cc0..839706b430 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -1012,7 +1012,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { + "ssb-no", "mds-no", "pschange-mc-no", "tsx-ctrl", + "taa-no", NULL, NULL, NULL, + NULL, NULL, NULL, NULL, +- NULL, NULL, NULL, NULL, ++ NULL, "fb-clear", NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index 74fa649b60..c28b9df217 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -989,6 +989,7 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, + #define MSR_ARCH_CAP_PSCHANGE_MC_NO (1U << 6) + #define MSR_ARCH_CAP_TSX_CTRL_MSR (1U << 7) + #define MSR_ARCH_CAP_TAA_NO (1U << 8) ++#define MSR_ARCH_CAP_FB_CLEAR (1U << 17) + + #define MSR_CORE_CAP_SPLIT_LOCK_DETECT (1U << 5) + +-- +2.39.3 + diff --git a/kvm-target-i386-add-support-for-FLUSH_L1D-feature.patch b/kvm-target-i386-add-support-for-FLUSH_L1D-feature.patch new file mode 100644 index 0000000..39f2542 --- /dev/null +++ b/kvm-target-i386-add-support-for-FLUSH_L1D-feature.patch @@ -0,0 +1,70 @@ +From 14eae569030805680570d93412100ad26242c7e6 Mon Sep 17 00:00:00 2001 +From: Emanuele Giuseppe Esposito +Date: Wed, 24 May 2023 06:52:34 -0400 +Subject: [PATCH 1/5] target/i386: add support for FLUSH_L1D feature + +RH-Author: Emanuele Giuseppe Esposito +RH-MergeRequest: 167: target/i386: add support for FB_CLEAR feature +RH-Bugzilla: 2216201 +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/2] e296c75c5cd7e1d16d3c70483d52aeba9f9eb2cd (eesposit/qemu-kvm) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2216201 + +commit 0e7e3bf1a552c178924867fa7c2f30ccc8a179e0 +Author: Emanuele Giuseppe Esposito +Date: Wed Feb 1 08:57:58 2023 -0500 + + target/i386: add support for FLUSH_L1D feature + + As reported by Intel's doc: + "L1D_FLUSH: Writeback and invalidate the L1 data cache" + + If this cpu feature is present in host, allow QEMU to choose whether to + show it to the guest too. + One disadvantage of not exposing it is that the guest will report + a non existing vulnerability in + /sys/devices/system/cpu/vulnerabilities/mmio_stale_data + because the mitigation is present only when the cpu has + (FLUSH_L1D and MD_CLEAR) or FB_CLEAR + features enabled. + + Signed-off-by: Emanuele Giuseppe Esposito + Message-Id: <20230201135759.555607-2-eesposit@redhat.com> + Signed-off-by: Paolo Bonzini + +Signed-off-by: Emanuele Giuseppe Esposito +--- + target/i386/cpu.c | 2 +- + target/i386/cpu.h | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index 0ef2bf1b93..caf6338cc0 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -860,7 +860,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = { + "tsx-ldtrk", NULL, NULL /* pconfig */, "arch-lbr", + NULL, NULL, "amx-bf16", "avx512-fp16", + "amx-tile", "amx-int8", "spec-ctrl", "stibp", +- NULL, "arch-capabilities", "core-capability", "ssbd", ++ "flush-l1d", "arch-capabilities", "core-capability", "ssbd", + }, + .cpuid = { + .eax = 7, +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index d243e290d3..74fa649b60 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -896,6 +896,8 @@ uint64_t x86_cpu_get_supported_feature_word(FeatureWord w, + #define CPUID_7_0_EDX_SPEC_CTRL (1U << 26) + /* Single Thread Indirect Branch Predictors */ + #define CPUID_7_0_EDX_STIBP (1U << 27) ++/* Flush L1D cache */ ++#define CPUID_7_0_EDX_FLUSH_L1D (1U << 28) + /* Arch Capabilities */ + #define CPUID_7_0_EDX_ARCH_CAPABILITIES (1U << 29) + /* Core Capability */ +-- +2.39.3 + diff --git a/kvm-util-async-teardown-wire-up-query-command-line-optio.patch b/kvm-util-async-teardown-wire-up-query-command-line-optio.patch new file mode 100644 index 0000000..8c468d8 --- /dev/null +++ b/kvm-util-async-teardown-wire-up-query-command-line-optio.patch @@ -0,0 +1,180 @@ +From c1502b0cd16378d6d5bd4259b90bf81a5fb5aad3 Mon Sep 17 00:00:00 2001 +From: Claudio Imbrenda +Date: Fri, 5 May 2023 14:00:51 +0200 +Subject: [PATCH 20/21] util/async-teardown: wire up query-command-line-options +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 173: Improve memory reclaiming for z15 Secure Execution guests +RH-Bugzilla: 2168500 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Cédric Le Goater +RH-Commit: [1/2] 76e5f25df2c02721f5a29f552ee3061be589abb2 (thuth/qemu-kvm-cs9) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2168500 + +Add new -run-with option with an async-teardown=on|off parameter. It is +visible in the output of query-command-line-options QMP command, so it +can be discovered and used by libvirt. + +The option -async-teardown is now redundant, deprecate it. + +Reported-by: Boris Fiuczynski +Fixes: c891c24b1a ("os-posix: asynchronous teardown for shutdown on Linux") +Signed-off-by: Claudio Imbrenda +Message-Id: <20230505120051.36605-2-imbrenda@linux.ibm.com> +[thuth: Add curly braces to fix error with GCC 8.5, fix bug in deprecated.rst] +Signed-off-by: Thomas Huth + +(cherry picked from commit 80bd81cadd127c1e2fc784612a52abe392670ba4) +Conflicts: + docs/about/deprecated.rst (missing context from other patches) +Signed-off-by: Thomas Huth +--- + docs/about/deprecated.rst | 5 +++++ + os-posix.c | 14 ++++++++++++++ + qemu-options.hx | 34 +++++++++++++++++++++++----------- + util/async-teardown.c | 21 +++++++++++++++++++++ + 4 files changed, 63 insertions(+), 11 deletions(-) + +diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst +index 1ca9dc33d6..52893fcf38 100644 +--- a/docs/about/deprecated.rst ++++ b/docs/about/deprecated.rst +@@ -111,6 +111,11 @@ Use ``-machine acpi=off`` instead. + The HAXM project has been retired (see https://github.com/intel/haxm#status). + Use "whpx" (on Windows) or "hvf" (on macOS) instead. + ++``-async-teardown`` (since 8.1) ++''''''''''''''''''''''''''''''' ++ ++Use ``-run-with async-teardown=on`` instead. ++ + + QEMU Machine Protocol (QMP) commands + ------------------------------------ +diff --git a/os-posix.c b/os-posix.c +index 5adc69f560..90ea71725f 100644 +--- a/os-posix.c ++++ b/os-posix.c +@@ -36,6 +36,8 @@ + #include "qemu/log.h" + #include "sysemu/runstate.h" + #include "qemu/cutils.h" ++#include "qemu/config-file.h" ++#include "qemu/option.h" + + #ifdef CONFIG_LINUX + #include +@@ -152,9 +154,21 @@ int os_parse_cmd_args(int index, const char *optarg) + daemonize = 1; + break; + #if defined(CONFIG_LINUX) ++ /* deprecated */ + case QEMU_OPTION_asyncteardown: + init_async_teardown(); + break; ++ case QEMU_OPTION_run_with: { ++ QemuOpts *opts = qemu_opts_parse_noisily(qemu_find_opts("run-with"), ++ optarg, false); ++ if (!opts) { ++ exit(1); ++ } ++ if (qemu_opt_get_bool(opts, "async-teardown", false)) { ++ init_async_teardown(); ++ } ++ break; ++ } + #endif + default: + return -1; +diff --git a/qemu-options.hx b/qemu-options.hx +index 52b49f1f6a..b18f933703 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -4766,20 +4766,32 @@ DEF("qtest-log", HAS_ARG, QEMU_OPTION_qtest_log, "", QEMU_ARCH_ALL) + DEF("async-teardown", 0, QEMU_OPTION_asyncteardown, + "-async-teardown enable asynchronous teardown\n", + QEMU_ARCH_ALL) +-#endif + SRST + ``-async-teardown`` +- Enable asynchronous teardown. A new process called "cleanup/" +- will be created at startup sharing the address space with the main qemu +- process, using clone. It will wait for the main qemu process to +- terminate completely, and then exit. +- This allows qemu to terminate very quickly even if the guest was +- huge, leaving the teardown of the address space to the cleanup +- process. Since the cleanup process shares the same cgroups as the +- main qemu process, accounting is performed correctly. This only +- works if the cleanup process is not forcefully killed with SIGKILL +- before the main qemu process has terminated completely. ++ This option is deprecated and should no longer be used. The new option ++ ``-run-with async-teardown=on`` is a replacement. + ERST ++DEF("run-with", HAS_ARG, QEMU_OPTION_run_with, ++ "-run-with async-teardown[=on|off]\n" ++ " misc QEMU process lifecycle options\n" ++ " async-teardown=on enables asynchronous teardown\n", ++ QEMU_ARCH_ALL) ++SRST ++``-run-with`` ++ Set QEMU process lifecycle options. ++ ++ ``async-teardown=on`` enables asynchronous teardown. A new process called ++ "cleanup/" will be created at startup sharing the address ++ space with the main QEMU process, using clone. It will wait for the ++ main QEMU process to terminate completely, and then exit. This allows ++ QEMU to terminate very quickly even if the guest was huge, leaving the ++ teardown of the address space to the cleanup process. Since the cleanup ++ process shares the same cgroups as the main QEMU process, accounting is ++ performed correctly. This only works if the cleanup process is not ++ forcefully killed with SIGKILL before the main QEMU process has ++ terminated completely. ++ERST ++#endif + + DEF("msg", HAS_ARG, QEMU_OPTION_msg, + "-msg [timestamp[=on|off]][,guest-name=[on|off]]\n" +diff --git a/util/async-teardown.c b/util/async-teardown.c +index 62cdeb0f20..3ab19c8740 100644 +--- a/util/async-teardown.c ++++ b/util/async-teardown.c +@@ -12,6 +12,9 @@ + */ + + #include "qemu/osdep.h" ++#include "qemu/config-file.h" ++#include "qemu/option.h" ++#include "qemu/module.h" + #include + #include + #include +@@ -144,3 +147,21 @@ void init_async_teardown(void) + clone(async_teardown_fn, new_stack_for_clone(), CLONE_VM, NULL); + sigprocmask(SIG_SETMASK, &old_signals, NULL); + } ++ ++static QemuOptsList qemu_run_with_opts = { ++ .name = "run-with", ++ .head = QTAILQ_HEAD_INITIALIZER(qemu_run_with_opts.head), ++ .desc = { ++ { ++ .name = "async-teardown", ++ .type = QEMU_OPT_BOOL, ++ }, ++ { /* end of list */ } ++ }, ++}; ++ ++static void register_teardown(void) ++{ ++ qemu_add_opts(&qemu_run_with_opts); ++} ++opts_init(register_teardown); +-- +2.39.3 + diff --git a/kvm-util-mmap-alloc-qemu_fd_getfs.patch b/kvm-util-mmap-alloc-qemu_fd_getfs.patch new file mode 100644 index 0000000..b0e66f6 --- /dev/null +++ b/kvm-util-mmap-alloc-qemu_fd_getfs.patch @@ -0,0 +1,95 @@ +From 439a8cdd010dfd253fc2277ae4ec605b5ba621d9 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Wed, 19 Apr 2023 12:17:36 -0400 +Subject: [PATCH 02/56] util/mmap-alloc: qemu_fd_getfs() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [1/50] 8970b5ae611a933d693e0c90cbf4eda073635494 (peterx/qemu-kvm) + +This new helper fetches file system type for a fd. Only Linux is +implemented so far. Currently only tmpfs and hugetlbfs are defined, +but it can grow as needed. + +Signed-off-by: Peter Xu +Reviewed-by: David Hildenbrand +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit fa45f8dab9613993c042176ea2d25552bfebc955) +Signed-off-by: Peter Xu +--- + include/qemu/mmap-alloc.h | 7 +++++++ + util/mmap-alloc.c | 28 ++++++++++++++++++++++++++++ + 2 files changed, 35 insertions(+) + +diff --git a/include/qemu/mmap-alloc.h b/include/qemu/mmap-alloc.h +index 2825e231a7..8344daaa03 100644 +--- a/include/qemu/mmap-alloc.h ++++ b/include/qemu/mmap-alloc.h +@@ -1,8 +1,15 @@ + #ifndef QEMU_MMAP_ALLOC_H + #define QEMU_MMAP_ALLOC_H + ++typedef enum { ++ QEMU_FS_TYPE_UNKNOWN = 0, ++ QEMU_FS_TYPE_TMPFS, ++ QEMU_FS_TYPE_HUGETLBFS, ++ QEMU_FS_TYPE_NUM, ++} QemuFsType; + + size_t qemu_fd_getpagesize(int fd); ++QemuFsType qemu_fd_getfs(int fd); + + /** + * qemu_ram_mmap: mmap anonymous memory, the specified file or device. +diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c +index 5ed7d29183..ed14f9c64d 100644 +--- a/util/mmap-alloc.c ++++ b/util/mmap-alloc.c +@@ -27,8 +27,36 @@ + + #ifdef CONFIG_LINUX + #include ++#include + #endif + ++QemuFsType qemu_fd_getfs(int fd) ++{ ++#ifdef CONFIG_LINUX ++ struct statfs fs; ++ int ret; ++ ++ if (fd < 0) { ++ return QEMU_FS_TYPE_UNKNOWN; ++ } ++ ++ do { ++ ret = fstatfs(fd, &fs); ++ } while (ret != 0 && errno == EINTR); ++ ++ switch (fs.f_type) { ++ case TMPFS_MAGIC: ++ return QEMU_FS_TYPE_TMPFS; ++ case HUGETLBFS_MAGIC: ++ return QEMU_FS_TYPE_HUGETLBFS; ++ default: ++ return QEMU_FS_TYPE_UNKNOWN; ++ } ++#else ++ return QEMU_FS_TYPE_UNKNOWN; ++#endif ++} ++ + size_t qemu_fd_getpagesize(int fd) + { + #ifdef CONFIG_LINUX +-- +2.39.1 + diff --git a/kvm-vhost-fix-vhost_dev_enable_notifiers-error-case.patch b/kvm-vhost-fix-vhost_dev_enable_notifiers-error-case.patch new file mode 100644 index 0000000..3282c24 --- /dev/null +++ b/kvm-vhost-fix-vhost_dev_enable_notifiers-error-case.patch @@ -0,0 +1,138 @@ +From ac54f5f746782da89ab674733af5622e524b58eb Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Fri, 2 Jun 2023 18:27:35 +0200 +Subject: [PATCH 4/6] vhost: fix vhost_dev_enable_notifiers() error case +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Laurent Vivier +RH-MergeRequest: 176: vhost: fix vhost_dev_enable_notifiers() error case +RH-Jira: RHEL-330 +RH-Acked-by: MST +RH-Acked-by: Cindy Lu +RH-Acked-by: Eugenio Pérez +RH-Acked-by: Jason Wang +RH-Commit: [1/1] fd30d7501be59f7e5b9d6fc5ed84efcc4037d08e (lvivier/qemu-kvm-centos) + +JIRA: https://issues.redhat.com/browse/RHEL-330 + +in vhost_dev_enable_notifiers(), if virtio_bus_set_host_notifier(true) +fails, we call vhost_dev_disable_notifiers() that executes +virtio_bus_set_host_notifier(false) on all queues, even on queues that +have failed to be initialized. + +This triggers a core dump in memory_region_del_eventfd(): + + virtio_bus_set_host_notifier: unable to init event notifier: Too many open files (-24) + vhost VQ 1 notifier binding failed: 24 + .../softmmu/memory.c:2611: memory_region_del_eventfd: Assertion `i != mr->ioeventfd_nb' failed. + +Fix the problem by providing to vhost_dev_disable_notifiers() the +number of queues to disable. + +Fixes: 8771589b6f81 ("vhost: simplify vhost_dev_enable_notifiers") +Cc: longpeng2@huawei.com +Signed-off-by: Laurent Vivier +Message-Id: <20230602162735.3670785-1-lvivier@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Philippe Mathieu-Daudé +(cherry picked from commit 92099aa4e9a3bb6856c290afaf41c76f9e3dd9fd) +--- + hw/virtio/vhost.c | 65 ++++++++++++++++++++++++++--------------------- + 1 file changed, 36 insertions(+), 29 deletions(-) + +diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c +index a266396576..ae0a033e60 100644 +--- a/hw/virtio/vhost.c ++++ b/hw/virtio/vhost.c +@@ -1545,6 +1545,40 @@ void vhost_dev_cleanup(struct vhost_dev *hdev) + memset(hdev, 0, sizeof(struct vhost_dev)); + } + ++static void vhost_dev_disable_notifiers_nvqs(struct vhost_dev *hdev, ++ VirtIODevice *vdev, ++ unsigned int nvqs) ++{ ++ BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); ++ int i, r; ++ ++ /* ++ * Batch all the host notifiers in a single transaction to avoid ++ * quadratic time complexity in address_space_update_ioeventfds(). ++ */ ++ memory_region_transaction_begin(); ++ ++ for (i = 0; i < nvqs; ++i) { ++ r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i, ++ false); ++ if (r < 0) { ++ error_report("vhost VQ %d notifier cleanup failed: %d", i, -r); ++ } ++ assert(r >= 0); ++ } ++ ++ /* ++ * The transaction expects the ioeventfds to be open when it ++ * commits. Do it now, before the cleanup loop. ++ */ ++ memory_region_transaction_commit(); ++ ++ for (i = 0; i < nvqs; ++i) { ++ virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i); ++ } ++ virtio_device_release_ioeventfd(vdev); ++} ++ + /* Stop processing guest IO notifications in qemu. + * Start processing them in vhost in kernel. + */ +@@ -1574,7 +1608,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) + if (r < 0) { + error_report("vhost VQ %d notifier binding failed: %d", i, -r); + memory_region_transaction_commit(); +- vhost_dev_disable_notifiers(hdev, vdev); ++ vhost_dev_disable_notifiers_nvqs(hdev, vdev, i); + return r; + } + } +@@ -1591,34 +1625,7 @@ int vhost_dev_enable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) + */ + void vhost_dev_disable_notifiers(struct vhost_dev *hdev, VirtIODevice *vdev) + { +- BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev))); +- int i, r; +- +- /* +- * Batch all the host notifiers in a single transaction to avoid +- * quadratic time complexity in address_space_update_ioeventfds(). +- */ +- memory_region_transaction_begin(); +- +- for (i = 0; i < hdev->nvqs; ++i) { +- r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i, +- false); +- if (r < 0) { +- error_report("vhost VQ %d notifier cleanup failed: %d", i, -r); +- } +- assert (r >= 0); +- } +- +- /* +- * The transaction expects the ioeventfds to be open when it +- * commits. Do it now, before the cleanup loop. +- */ +- memory_region_transaction_commit(); +- +- for (i = 0; i < hdev->nvqs; ++i) { +- virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), hdev->vq_index + i); +- } +- virtio_device_release_ioeventfd(vdev); ++ vhost_dev_disable_notifiers_nvqs(hdev, vdev, hdev->nvqs); + } + + /* Test and clear event pending status. +-- +2.39.3 + diff --git a/kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch b/kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch new file mode 100644 index 0000000..fd29eb7 --- /dev/null +++ b/kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch @@ -0,0 +1,67 @@ +From 4e30ca551fb3740a428017a0debf0a6aab976639 Mon Sep 17 00:00:00 2001 +From: Ani Sinha +Date: Mon, 19 Jun 2023 12:22:09 +0530 +Subject: [PATCH 6/6] vhost-vdpa: do not cleanup the vdpa/vhost-net structures + if peer nic is present + +RH-Author: Ani Sinha +RH-MergeRequest: 174: vhost-vdpa: do not cleanup the vdpa/vhost-net structures if peer nic is present +RH-Bugzilla: 2128929 +RH-Acked-by: Igor Mammedov +RH-Acked-by: Miroslav Rezanina +RH-Commit: [1/1] c70d4e5fd93256326d318e0b507db6b9eb93ad86 (anisinha/centos-qemu-kvm) + +When a peer nic is still attached to the vdpa backend, it is too early to free +up the vhost-net and vdpa structures. If these structures are freed here, then +QEMU crashes when the guest is being shut down. The following call chain +would result in an assertion failure since the pointer returned from +vhost_vdpa_get_vhost_net() would be NULL: + +do_vm_stop() -> vm_state_notify() -> virtio_set_status() -> +virtio_net_vhost_status() -> get_vhost_net(). + +Therefore, we defer freeing up the structures until at guest shutdown +time when qemu_cleanup() calls net_cleanup() which then calls +qemu_del_net_client() which would eventually call vhost_vdpa_cleanup() +again to free up the structures. This time, the loop in net_cleanup() +ensures that vhost_vdpa_cleanup() will be called one last time when +all the peer nics are detached and freed. + +All unit tests pass with this change. + +CC: imammedo@redhat.com +CC: jusual@redhat.com +CC: mst@redhat.com +Fixes: CVE-2023-3301 +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2128929 +Signed-off-by: Ani Sinha +Message-Id: <20230619065209.442185-1-anisinha@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit a0d7215e339b61c7d7a7b3fcf754954d80d93eb8) +--- + net/vhost-vdpa.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c +index 99904a0da7..8c8900f0f4 100644 +--- a/net/vhost-vdpa.c ++++ b/net/vhost-vdpa.c +@@ -184,6 +184,14 @@ static void vhost_vdpa_cleanup(NetClientState *nc) + { + VhostVDPAState *s = DO_UPCAST(VhostVDPAState, nc, nc); + ++ /* ++ * If a peer NIC is attached, do not cleanup anything. ++ * Cleanup will happen as a part of qemu_cleanup() -> net_cleanup() ++ * when the guest is shutting down. ++ */ ++ if (nc->peer && nc->peer->info->type == NET_CLIENT_DRIVER_NIC) { ++ return; ++ } + qemu_vfree(s->cvq_cmd_out_buffer); + qemu_vfree(s->status); + if (s->vhost_net) { +-- +2.39.3 + diff --git a/kvm-vl.c-Create-late-backends-before-migration-object.patch b/kvm-vl.c-Create-late-backends-before-migration-object.patch new file mode 100644 index 0000000..e1eef6d --- /dev/null +++ b/kvm-vl.c-Create-late-backends-before-migration-object.patch @@ -0,0 +1,58 @@ +From 63e2339a6f38706c6fc5eb251426812520db6a6d Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Wed, 19 Apr 2023 12:17:37 -0400 +Subject: [PATCH 03/56] vl.c: Create late backends before migration object +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +RH-MergeRequest: 162: migration: Pretty failures for postcopy on unsupported memory types +RH-Bugzilla: 2057267 +RH-Acked-by: Leonardo Brás +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: quintela1 +RH-Commit: [2/50] 7209bb94faa48650388be8fef08c77afd26517d8 (peterx/qemu-kvm) + +The migration object may want to check against different types of memory +when initialized. Delay the creation to be after late backends. + +Signed-off-by: Peter Xu +Reviewed-by: Juan Quintela +Reviewed-by: David Hildenbrand +Signed-off-by: Juan Quintela +(cherry picked from commit cb9d8b8ce1aaf38f53295fc59ec1b8b7eb4338d2) +Signed-off-by: Peter Xu +--- + softmmu/vl.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/softmmu/vl.c b/softmmu/vl.c +index ad4173138d..a44b49430b 100644 +--- a/softmmu/vl.c ++++ b/softmmu/vl.c +@@ -3592,14 +3592,19 @@ void qemu_init(int argc, char **argv) + machine_class->name, machine_class->deprecation_reason); + } + ++ /* ++ * Create backends before creating migration objects, so that it can ++ * check against compatibilities on the backend memories (e.g. postcopy ++ * over memory-backend-file objects). ++ */ ++ qemu_create_late_backends(); ++ + /* + * Note: creates a QOM object, must run only after global and + * compat properties have been set up. + */ + migration_object_init(); + +- qemu_create_late_backends(); +- + /* parse features once if machine provides default cpu_type */ + current_machine->cpu_type = machine_class->default_cpu_type; + if (cpu_option) { +-- +2.39.1 + diff --git a/kvm-x86.conf b/kvm-x86.conf new file mode 100644 index 0000000..3f7842a --- /dev/null +++ b/kvm-x86.conf @@ -0,0 +1,12 @@ +# Setting modprobe kvm_intel/kvm_amd nested = 1 +# only enables Nested Virtualization until the next reboot or +# module reload. Uncomment the option applicable +# to your system below to enable the feature permanently. +# +# User changes in this file are preserved across upgrades. +# +# For Intel +#options kvm_intel nested=1 +# +# For AMD +#options kvm_amd nested=1 diff --git a/kvm.conf b/kvm.conf new file mode 100644 index 0000000..24e60e9 --- /dev/null +++ b/kvm.conf @@ -0,0 +1,3 @@ +# +# User changes in this file are preserved across upgrades. +# diff --git a/modules-load.conf b/modules-load.conf new file mode 100644 index 0000000..45b477d --- /dev/null +++ b/modules-load.conf @@ -0,0 +1,4 @@ +# When using SELinux in libvirt, automatic loading of the kvm.ko kernel +# module might not work when qemu-kvm tries to access /dev/kvm - thus we +# simply always load this module during the boot process already. +kvm diff --git a/qemu-ga.sysconfig b/qemu-ga.sysconfig new file mode 100644 index 0000000..a78b428 --- /dev/null +++ b/qemu-ga.sysconfig @@ -0,0 +1,19 @@ +# This is a systemd environment file, not a shell script. +# It provides settings for "/lib/systemd/system/qemu-guest-agent.service". + +# Comma-separated blocked RPCs to disable, or empty list to enable all. +# +# You can get the list of RPC commands using "qemu-ga --block-rpcs='?'". +# There should be no spaces between commas and commands in the block list. +BLOCK_RPCS=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-exec-status + +# Fsfreeze hook script specification. +# +# FSFREEZE_HOOK_PATHNAME=/dev/null : disables the feature. +# +# FSFREEZE_HOOK_PATHNAME=/path/to/executable : enables the feature with the +# specified binary or shell script. +# +# FSFREEZE_HOOK_PATHNAME= : enables the feature with the +# default value (invoke "qemu-ga --help" to interrogate). +FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook diff --git a/qemu-guest-agent.service b/qemu-guest-agent.service new file mode 100644 index 0000000..244da02 --- /dev/null +++ b/qemu-guest-agent.service @@ -0,0 +1,19 @@ +[Unit] +Description=QEMU Guest Agent +BindsTo=dev-virtio\x2dports-org.qemu.guest_agent.0.device +After=dev-virtio\x2dports-org.qemu.guest_agent.0.device +IgnoreOnIsolate=True + +[Service] +UMask=0077 +EnvironmentFile=/etc/sysconfig/qemu-ga +ExecStart=/usr/bin/qemu-ga \ + --method=virtio-serial \ + --path=/dev/virtio-ports/org.qemu.guest_agent.0 \ + --block-rpcs=${BLOCK_RPCS} \ + -F${FSFREEZE_HOOK_PATHNAME} +Restart=always +RestartSec=0 + +[Install] +WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device diff --git a/qemu-kvm.spec b/qemu-kvm.spec new file mode 100644 index 0000000..ad8ea7e --- /dev/null +++ b/qemu-kvm.spec @@ -0,0 +1,4894 @@ +%global libfdt_version 1.6.0 +%global libseccomp_version 2.4.0 +%global libusbx_version 1.0.23 +%global meson_version 0.61.3 +%global usbredir_version 0.7.1 +%global ipxe_version 20200823-5.git4bd064de + +# LTO does not work with the coroutines of QEMU on non-x86 architectures +# (see BZ 1952483 and 1950192 for more information) +%ifnarch x86_64 + %global _lto_cflags %%{nil} +%endif + +%global have_usbredir 1 +%global have_opengl 1 +%global have_fdt 1 +%global have_modules_load 0 +%global have_memlock_limits 0 +# Some of these are not relevant for RHEL, but defining them +# makes it easier to sync the dependency list with Fedora +%global have_block_rbd 1 +%global enable_werror 1 +%global have_clang 1 +%global have_safe_stack 0 + + +%if %{have_clang} +%global toolchain clang +%ifarch x86_64 +%global have_safe_stack 1 +%endif +%else +%global toolchain gcc +%global cc_suffix .gcc +%endif + + + +# Release candidate version tracking +# global rcver rc4 +%if 0%{?rcver:1} +%global rcrel .%{rcver} +%global rcstr -%{rcver} +%endif + +%global have_pmem 1 +%ifnarch x86_64 + %global have_pmem 0 +%endif + +%global have_numactl 1 +%ifarch s390x + %global have_numactl 0 +%endif + +%global tools_only 0 +%ifarch %{power64} + %global tools_only 1 +%endif + +%ifnarch %{ix86} x86_64 + %global have_usbredir 0 +%endif + +%ifnarch s390x + %global have_librdma 1 +%else + %global have_librdma 0 +%endif + +%global modprobe_kvm_conf %{_sourcedir}/kvm.conf +%ifarch s390x + %global modprobe_kvm_conf %{_sourcedir}/kvm-s390x.conf +%endif +%ifarch %{ix86} x86_64 + %global modprobe_kvm_conf %{_sourcedir}/kvm-x86.conf +%endif + +%ifarch %{ix86} + %global kvm_target i386 +%endif +%ifarch x86_64 + %global kvm_target x86_64 +%else + %global have_opengl 0 +%endif +%ifarch %{power64} + %global kvm_target ppc64 + %global have_memlock_limits 1 +%endif +%ifarch s390x + %global kvm_target s390x + %global have_modules_load 1 +%endif +%ifarch ppc + %global kvm_target ppc +%endif +%ifarch aarch64 + %global kvm_target aarch64 +%endif + +%global target_list %{kvm_target}-softmmu +%global block_drivers_rw_list qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,compress,virtio-blk-vdpa-blk,virtio-blk-vfio-pci,virtio-blk-vhost-user,io_uring,nvme-io_uring +%global block_drivers_ro_list vdi,vmdk,vhdx,vpc,https +%define qemudocdir %{_docdir}/%{name} +%global firmwaredirs "%{_datadir}/qemu-firmware:%{_datadir}/ipxe/qemu:%{_datadir}/seavgabios:%{_datadir}/seabios" + +#Versions of various parts: + +%global requires_all_modules \ +%if %{have_opengl} \ +Requires: %{name}-ui-opengl = %{epoch}:%{version}-%{release} \ +Requires: %{name}-ui-egl-headless = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} \ +%ifarch s390x \ +Requires: %{name}-device-display-virtio-gpu-ccw = %{epoch}:%{version}-%{release} \ +%else \ +Requires: %{name}-device-display-virtio-gpu-pci = %{epoch}:%{version}-%{release} \ +%endif \ +%ifarch x86_64 %{power64} \ +Requires: %{name}-device-display-virtio-vga = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-device-usb-host = %{epoch}:%{version}-%{release} \ +%if %{have_usbredir} \ +Requires: %{name}-device-usb-redirect = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-block-blkio = %{epoch}:%{version}-%{release} \ +Requires: %{name}-block-rbd = %{epoch}:%{version}-%{release} \ +Requires: %{name}-audio-pa = %{epoch}:%{version}-%{release} + +# Since SPICE is removed from RHEL-9, the following Obsoletes: +# removes {name}-ui-spice for upgrades from RHEL-8 +# The "<= {version}" assumes RHEL-9 version >= RHEL-8 version (in +# other words RHEL-9 rebases are done together/before RHEL-8 ones) + +# In addition, we obsolete some block drivers as we are no longer support +# them in default qemu-kvm installation. + +# Note: ssh driver wasn't removed yet just disabled due to late handling + +%global obsoletes_some_modules \ +Obsoletes: %{name}-ui-spice <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-gluster <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-iscsi <= %{epoch}:%{version} \ +Obsoletes: %{name}-block-ssh <= %{epoch}:%{version} \ + + +Summary: QEMU is a machine emulator and virtualizer +Name: qemu-kvm +Version: 8.0.0 +Release: 7%{?rcrel}%{?dist}%{?cc_suffix} +# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped +# Epoch 15 used for RHEL 8 +# Epoch 17 used for RHEL 9 (due to release versioning offset in RHEL 8.5) +Epoch: 17 +License: GPLv2 and GPLv2+ and CC-BY +URL: http://www.qemu.org/ +ExclusiveArch: x86_64 %{power64} aarch64 s390x + + +Source0: http://wiki.qemu.org/download/qemu-%{version}%{?rcstr}.tar.xz + +Source10: qemu-guest-agent.service +Source11: 99-qemu-guest-agent.rules +Source12: bridge.conf +Source13: qemu-ga.sysconfig +Source21: modules-load.conf +Source26: vhost.conf +Source27: kvm.conf +Source28: 95-kvm-memlock.conf +Source30: kvm-s390x.conf +Source31: kvm-x86.conf +Source36: README.tests + + +Patch0004: 0004-Initial-redhat-build.patch +Patch0005: 0005-Enable-disable-devices-for-RHEL.patch +Patch0006: 0006-Machine-type-related-general-changes.patch +Patch0007: 0007-Add-aarch64-machine-types.patch +Patch0008: 0008-Add-ppc64-machine-types.patch +Patch0009: 0009-Add-s390x-machine-types.patch +Patch0010: 0010-Add-x86_64-machine-types.patch +Patch0011: 0011-Enable-make-check.patch +Patch0012: 0012-vfio-cap-number-of-devices-that-can-be-assigned.patch +Patch0013: 0013-Add-support-statement-to-help-output.patch +Patch0014: 0014-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch +Patch0015: 0015-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch +Patch0016: 0016-qga-linux-add-usb-support-to-guest-get-fsinfo.patch +Patch0017: 0017-Add-RHEL-9.2.0-compat-structure.patch +Patch0018: 0018-redhat-hw-i386-pc-Update-x86-machine-type-compatibil.patch +Patch0019: 0019-Disable-unwanted-new-devices.patch +# For bz#2087047 - Disk detach is unsuccessful while the guest is still booting +Patch20: kvm-acpi-pcihp-allow-repeating-hot-unplug-requests.patch +# For bz#1934134 - ACPI table limits warning when booting guest with 512 VCPUs +Patch21: kvm-hw-acpi-limit-warning-on-acpi-table-size-to-pc-machi.patch +# For bz#1934134 - ACPI table limits warning when booting guest with 512 VCPUs +Patch22: kvm-hw-acpi-Mark-acpi-blobs-as-resizable-on-RHEL-pc-mach.patch +# For bz#2058982 - Qemu core dump if cut off nfs storage during migration +Patch23: kvm-migration-Handle-block-device-inactivation-failures-.patch +# For bz#2058982 - Qemu core dump if cut off nfs storage during migration +Patch24: kvm-migration-Minor-control-flow-simplification.patch +# For bz#2058982 - Qemu core dump if cut off nfs storage during migration +Patch25: kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch26: kvm-util-mmap-alloc-qemu_fd_getfs.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch27: kvm-vl.c-Create-late-backends-before-migration-object.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch28: kvm-migration-postcopy-Detect-file-system-on-dest-host.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch29: kvm-migration-mark-mixed-functions-that-can-suspend.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch30: kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch31: kvm-migration-remove-extra-whitespace-character-for-code.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch32: kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch33: kvm-migration-Update-atomic-stats-out-of-the-mutex.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch34: kvm-migration-Make-multifd_bytes-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch35: kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch36: kvm-migration-Make-precopy_bytes-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch37: kvm-migration-Make-downtime_bytes-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch38: kvm-migration-Make-dirty_sync_count-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch39: kvm-migration-Make-postcopy_requests-atomic.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch40: kvm-migration-Rename-duplicate-to-zero_pages.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch41: kvm-migration-Rename-normal-to-normal_pages.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch42: kvm-migration-rename-enabled_capabilities-to-capabilitie.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch43: kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch44: kvm-migration-move-migration_global_dump-to-migration-hm.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch45: kvm-spice-move-client_migrate_info-command-to-ui.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch46: kvm-migration-Create-migrate_cap_set.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch47: kvm-migration-Create-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch48: kvm-migration-Move-migrate_colo_enabled-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch49: kvm-migration-Move-migrate_use_compression-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch50: kvm-migration-Move-migrate_use_events-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch51: kvm-migration-Move-migrate_use_multifd-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch52: kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch53: kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch54: kvm-migration-Move-migrate_use_block-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch55: kvm-migration-Move-migrate_use_return-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch56: kvm-migration-Create-migrate_rdma_pin_all-function.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch57: kvm-migration-Move-migrate_caps_check-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch58: kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch59: kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch60: kvm-migration-Move-migrate_cap_set-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch61: kvm-migration-Move-parameters-functions-to-option.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch62: kvm-migration-Use-migrate_max_postcopy_bandwidth.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch63: kvm-migration-Move-migrate_use_block_incremental-to-opti.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch64: kvm-migration-Create-migrate_throttle_trigger_threshold.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch65: kvm-migration-Create-migrate_checkpoint_delay.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch66: kvm-migration-Create-migrate_max_cpu_throttle.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch67: kvm-migration-Move-migrate_announce_params-to-option.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch68: kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch69: kvm-migration-Create-migrate_cpu_throttle_increment-func.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch70: kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch71: kvm-migration-Move-migrate_postcopy-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch72: kvm-migration-Create-migrate_max_bandwidth-function.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch73: kvm-migration-Move-migrate_use_tls-to-options.c.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch74: kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch +# For bz#2057267 - Migration with postcopy fail when vm set with shared memory +Patch75: kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch +# For bz#2185688 - [qemu-kvm] no response with QMP command block_resize +Patch76: kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch +# For bz#2185688 - [qemu-kvm] no response with QMP command block_resize +Patch77: kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch +# For bz#2185688 - [qemu-kvm] no response with QMP command block_resize +Patch78: kvm-iotests-Use-alternative-CPU-type-that-is-not-depreca.patch +# For bz#2185688 - [qemu-kvm] no response with QMP command block_resize +Patch79: kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch +# For bz#2186725 - Qemu hang when commit during fio running(iothread enable) +Patch80: kvm-block-compile-out-assert_bdrv_graph_readable-by-defa.patch +# For bz#2186725 - Qemu hang when commit during fio running(iothread enable) +Patch81: kvm-graph-lock-Disable-locking-for-now.patch +# For bz#2186725 - Qemu hang when commit during fio running(iothread enable) +Patch82: kvm-nbd-server-Fix-drained_poll-to-wake-coroutine-in-rig.patch +# For bz#2186725 - Qemu hang when commit during fio running(iothread enable) +Patch83: kvm-iotests-Test-commit-with-iothreads-and-ongoing-I-O.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch84: kvm-memory-prevent-dma-reentracy-issues.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch85: kvm-async-Add-an-optional-reentrancy-guard-to-the-BH-API.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch86: kvm-checkpatch-add-qemu_bh_new-aio_bh_new-checks.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch87: kvm-hw-replace-most-qemu_bh_new-calls-with-qemu_bh_new_g.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch88: kvm-lsi53c895a-disable-reentrancy-detection-for-script-R.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch89: kvm-bcm2835_property-disable-reentrancy-detection-for-io.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch90: kvm-raven-disable-reentrancy-detection-for-iomem.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch91: kvm-apic-disable-reentrancy-detection-for-apic-msi.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch92: kvm-async-avoid-use-after-free-on-re-entrancy-guard.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch93: kvm-loongarch-mark-loongarch_ipi_iocsr-re-entrnacy-safe.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch94: kvm-memory-stricter-checks-prior-to-unsetting-engaged_in.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch95: kvm-lsi53c895a-disable-reentrancy-detection-for-MMIO-reg.patch +# For RHEL-516 - CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9] +Patch96: kvm-hw-scsi-lsi53c895a-Fix-reentrancy-issues-in-the-LSI-.patch +# For bz#2189423 - Failed to migrate VM from rhel 9.3 to rhel 9.2 +Patch97: kvm-hw-pci-Disable-PCI_ERR_UNCOR_MASK-register-for-machi.patch +# For bz#2196289 - Fix number of ready channels on multifd +Patch98: kvm-multifd-Fix-the-number-of-channels-ready.patch +# For bz#2168500 - [IBM 9.3 FEAT] KVM: Improve memory reclaiming for z15 Secure Execution guests - qemu part +Patch99: kvm-util-async-teardown-wire-up-query-command-line-optio.patch +# For bz#2168500 - [IBM 9.3 FEAT] KVM: Improve memory reclaiming for z15 Secure Execution guests - qemu part +Patch100: kvm-s390x-pv-Fix-spurious-warning-with-asynchronous-tear.patch +# For bz#2216201 - [qemu-kvm]VM reports vulnerabilty to mmio_stale_data on patched host with microcode +Patch101: kvm-target-i386-add-support-for-FLUSH_L1D-feature.patch +# For bz#2216201 - [qemu-kvm]VM reports vulnerabilty to mmio_stale_data on patched host with microcode +Patch102: kvm-target-i386-add-support-for-FB_CLEAR-feature.patch +# For bz#2180076 - [qemu-kvm] support fd passing for libblkio QEMU BlockDrivers +Patch103: kvm-block-blkio-use-qemu_open-to-support-fd-passing-for-.patch +# For bz#2180076 - [qemu-kvm] support fd passing for libblkio QEMU BlockDrivers +Patch104: kvm-qapi-add-fdset-feature-for-BlockdevOptionsVirtioBlkV.patch +# For bz#2171363 - [aarch64] Kernel hits Call trace with irregular CPU-to-NUMA association +Patch105: kvm-numa-Validate-cluster-and-NUMA-node-boundary-if-requ.patch +# For bz#2171363 - [aarch64] Kernel hits Call trace with irregular CPU-to-NUMA association +Patch106: kvm-hw-arm-Validate-cluster-and-NUMA-node-boundary.patch +# For bz#2171363 - [aarch64] Kernel hits Call trace with irregular CPU-to-NUMA association +Patch107: kvm-hw-arm-virt-Validate-cluster-and-NUMA-node-boundary-.patch +# For RHEL-330 - [virtual network][qemu-kvm-8.0.0-rc1]qemu core dump: qemu-kvm: ../softmmu/memory.c:2592: void memory_region_del_eventfd(MemoryRegion *, hwaddr, unsigned int, _Bool, uint64_t, EventNotifier *): Assertion `i != mr->ioeventfd_nb' failed +Patch108: kvm-vhost-fix-vhost_dev_enable_notifiers-error-case.patch +# For bz#2218644 - query-stats QMP command interrupts vcpus, the Max Latencies could be more than 100us (rhel 9.3.0 clone) +Patch109: kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch +# For bz#2128929 - [rhel9.2] hotplug/hotunplug mlx vdpa device to the occupied addr port, then qemu core dump occurs after shutdown guest +Patch110: kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch + +%if %{have_clang} +BuildRequires: clang +%if %{have_safe_stack} +BuildRequires: compiler-rt +%endif +%else +BuildRequires: gcc +%endif +BuildRequires: meson >= %{meson_version} +BuildRequires: ninja-build +BuildRequires: zlib-devel +BuildRequires: glib2-devel +BuildRequires: gnutls-devel +BuildRequires: cyrus-sasl-devel +BuildRequires: libaio-devel +BuildRequires: libblkio-devel +BuildRequires: liburing-devel +BuildRequires: python3-devel +BuildRequires: libattr-devel +BuildRequires: libusbx-devel >= %{libusbx_version} +%if %{have_usbredir} +BuildRequires: usbredir-devel >= %{usbredir_version} +%endif +BuildRequires: texinfo +BuildRequires: python3-sphinx +BuildRequires: python3-sphinx_rtd_theme +BuildRequires: libseccomp-devel >= %{libseccomp_version} +# For network block driver +BuildRequires: libcurl-devel +%if %{have_block_rbd} +BuildRequires: librbd-devel +%endif +# We need both because the 'stap' binary is probed for by configure +BuildRequires: systemtap +BuildRequires: systemtap-sdt-devel +# For VNC PNG support +BuildRequires: libpng-devel +# For virtiofs +BuildRequires: libcap-ng-devel +# Hard requirement for version >= 1.3 +BuildRequires: pixman-devel +# For rdma +%if %{have_librdma} +BuildRequires: rdma-core-devel +%endif +%if %{have_fdt} +BuildRequires: libfdt-devel >= %{libfdt_version} +%endif +# For compressed guest memory dumps +BuildRequires: lzo-devel snappy-devel +# For NUMA memory binding +%if %{have_numactl} +BuildRequires: numactl-devel +%endif +# qemu-pr-helper multipath support (requires libudev too) +BuildRequires: device-mapper-multipath-devel +BuildRequires: systemd-devel +%if %{have_pmem} +BuildRequires: libpmem-devel +%endif +# qemu-keymap +BuildRequires: pkgconfig(xkbcommon) +%if %{have_opengl} +BuildRequires: pkgconfig(epoxy) +BuildRequires: pkgconfig(libdrm) +BuildRequires: pkgconfig(gbm) +%endif +BuildRequires: perl-Test-Harness +BuildRequires: libslirp-devel +BuildRequires: pulseaudio-libs-devel +BuildRequires: spice-protocol +BuildRequires: capstone-devel + +# Requires for qemu-kvm package +Requires: %{name}-core = %{epoch}:%{version}-%{release} +Requires: %{name}-docs = %{epoch}:%{version}-%{release} +Requires: %{name}-tools = %{epoch}:%{version}-%{release} +Requires: qemu-pr-helper = %{epoch}:%{version}-%{release} +Requires: virtiofsd >= 1.5.0 +%{requires_all_modules} + +%description +%{name} is an open source virtualizer that provides hardware +emulation for the KVM hypervisor. %{name} acts as a virtual +machine monitor together with the KVM kernel modules, and emulates the +hardware for a full system such as a PC and its associated peripherals. + + +%package core +Summary: %{name} core components +%{obsoletes_some_modules} +Requires: %{name}-common = %{epoch}:%{version}-%{release} +Requires: qemu-img = %{epoch}:%{version}-%{release} +%ifarch %{ix86} x86_64 +Requires: edk2-ovmf +%endif +%ifarch aarch64 +Requires: edk2-aarch64 +%endif + +Requires: libseccomp >= %{libseccomp_version} +Requires: libusbx >= %{libusbx_version} +Requires: capstone +%if %{have_fdt} +Requires: libfdt >= %{libfdt_version} +%endif + +%description core +%{name} is an open source virtualizer that provides hardware +emulation for the KVM hypervisor. %{name} acts as a virtual +machine monitor together with the KVM kernel modules, and emulates the +hardware for a full system such as a PC and its associated peripherals. +This is a minimalistic installation of %{name}. Functionality provided by +this package is not ensured and it can change in a future version as some +functionality can be split out to separate package. +Before updating this package, it is recommended to check the package +changelog for information on functionality which might have been moved to +a separate package to prevent issues due to the moved functionality. +If apps opt-in to minimalist packaging by depending on %{name}-core, they +explicitly accept that features may disappear from %{name}-core in future +updates. + +%package common +Summary: QEMU common files needed by all QEMU targets +Requires(post): /usr/bin/getent +Requires(post): /usr/sbin/groupadd +Requires(post): /usr/sbin/useradd +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%ifarch %{ix86} x86_64 +Requires: seabios-bin >= 1.10.2-1 +%endif +%ifnarch aarch64 s390x +Requires: seavgabios-bin >= 1.12.0-3 +Requires: ipxe-roms-qemu >= %{ipxe_version} +%endif +# Removal -gl modules as they do not provide any functionality - see bz#2149022 +Obsoletes: %{name}-device-display-virtio-gpu-gl <= %{epoch}:%{version} +Obsoletes: %{name}-device-display-virtio-gpu-pci-gl <= %{epoch}:%{version} +Obsoletes: %{name}-device-display-virtio-vga-gl <= %{epoch}:%{version} + +%description common +%{name} is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides documentation and auxiliary programs used with %{name}. + + +%package tools +Summary: %{name} support tools +%description tools +%{name}-tools provides various tools related to %{name} usage. + + +%package docs +Summary: %{name} documentation +%description docs +%{name}-docs provides documentation files regarding %{name}. + + +%package -n qemu-pr-helper +Summary: qemu-pr-helper utility for %{name} +%description -n qemu-pr-helper +This package provides the qemu-pr-helper utility that is required for certain +SCSI features. + + +%package -n qemu-img +Summary: QEMU command line tool for manipulating disk images +%description -n qemu-img +This package provides a command line tool for manipulating disk images. + + +%package -n qemu-guest-agent +Summary: QEMU guest agent +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units +%description -n qemu-guest-agent +%{name} is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides an agent to run inside guests, which communicates +with the host over a virtio-serial channel named "org.qemu.guest_agent.0" + +This package does not need to be installed on the host OS. + + +%package tests +Summary: tests for the %{name} package +Requires: %{name} = %{epoch}:%{version}-%{release} + +%define testsdir %{_libdir}/%{name}/tests-src + +%description tests +The %{name}-tests rpm contains tests that can be used to verify +the functionality of the installed %{name} package + +Install this package if you want access to the avocado_qemu +tests, or qemu-iotests. + + +%package block-blkio +Summary: QEMU libblkio block drivers +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-blkio +This package provides the additional libblkio block drivers for QEMU. + +Install this package if you want to use virtio-blk-vdpa-blk, +virtio-blk-vfio-pci, virtio-blk-vhost-user, io_uring, and nvme-io_uring block +drivers provided by libblkio. + + +%package block-curl +Summary: QEMU CURL block driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-curl +This package provides the additional CURL block driver for QEMU. + +Install this package if you want to access remote disks over +http, https, ftp and other transports provided by the CURL library. + + +%if %{have_block_rbd} +%package block-rbd +Summary: QEMU Ceph/RBD block driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-rbd +This package provides the additional Ceph/RBD block driver for QEMU. + +Install this package if you want to access remote Ceph volumes +using the rbd protocol. +%endif + + +%package audio-pa +Summary: QEMU PulseAudio audio driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description audio-pa +This package provides the additional PulseAudio audio driver for QEMU. + + +%if %{have_opengl} +%package ui-opengl +Summary: QEMU opengl support +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: mesa-libGL +Requires: mesa-libEGL +Requires: mesa-dri-drivers +%description ui-opengl +This package provides opengl support. + +%package ui-egl-headless +Summary: QEMU EGL headless driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-ui-opengl%{?_isa} = %{epoch}:%{version}-%{release} +%description ui-egl-headless +This package provides the additional egl-headless UI for QEMU. +%endif + + +%package device-display-virtio-gpu +Summary: QEMU virtio-gpu display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu +This package provides the virtio-gpu display device for QEMU. + +%ifarch s390x +%package device-display-virtio-gpu-ccw +Summary: QEMU virtio-gpu-ccw display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu-ccw +This package provides the virtio-gpu-ccw display device for QEMU. +%else +%package device-display-virtio-gpu-pci +Summary: QEMU virtio-gpu-pci display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: %{name}-device-display-virtio-gpu = %{epoch}:%{version}-%{release} +%description device-display-virtio-gpu-pci +This package provides the virtio-gpu-pci display device for QEMU. +%endif + +%ifarch x86_64 %{power64} +%package device-display-virtio-vga +Summary: QEMU virtio-vga display device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-display-virtio-vga +This package provides the virtio-vga display device for QEMU. +%endif + +%package device-usb-host +Summary: QEMU usb host device +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description device-usb-host +This package provides the USB pass through driver for QEMU. + +%if %{have_usbredir} +%package device-usb-redirect +Summary: QEMU usbredir support +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: usbredir >= 0.7.1 +Provides: %{name}-hw-usbredir +Obsoletes: %{name}-hw-usbredir <= %{epoch}:%{version} + +%description device-usb-redirect +This package provides usbredir support. +%endif + +%prep +%setup -q -n qemu-%{version}%{?rcstr} +%autopatch -p1 + +%global qemu_kvm_build qemu_kvm_build +mkdir -p %{qemu_kvm_build} + + +%build + +# Necessary hack for ZUUL CI +ulimit -n 10240 + +%define disable_everything \\\ + --audio-drv-list= \\\ + --disable-alsa \\\ + --disable-attr \\\ + --disable-auth-pam \\\ + --disable-avx2 \\\ + --disable-avx512f \\\ + --disable-avx512bw \\\ + --disable-blkio \\\ + --disable-block-drv-whitelist-in-tools \\\ + --disable-bochs \\\ + --disable-bpf \\\ + --disable-brlapi \\\ + --disable-bsd-user \\\ + --disable-bzip2 \\\ + --disable-cap-ng \\\ + --disable-capstone \\\ + --disable-cfi \\\ + --disable-cfi-debug \\\ + --disable-cloop \\\ + --disable-cocoa \\\ + --disable-coreaudio \\\ + --disable-coroutine-pool \\\ + --disable-crypto-afalg \\\ + --disable-curl \\\ + --disable-curses \\\ + --disable-dbus-display \\\ + --disable-debug-info \\\ + --disable-debug-mutex \\\ + --disable-debug-tcg \\\ + --disable-dmg \\\ + --disable-docs \\\ + --disable-dsound \\\ + --disable-fdt \\\ + --disable-fuse \\\ + --disable-fuse-lseek \\\ + --disable-gcrypt \\\ + --disable-gettext \\\ + --disable-gio \\\ + --disable-glusterfs \\\ + --disable-gnutls \\\ + --disable-gtk \\\ + --disable-guest-agent \\\ + --disable-guest-agent-msi \\\ + --disable-hax \\\ + --disable-hvf \\\ + --disable-iconv \\\ + --disable-jack \\\ + --disable-kvm \\\ + --disable-l2tpv3 \\\ + --disable-libdaxctl \\\ + --disable-libdw \\\ + --disable-libiscsi \\\ + --disable-libnfs \\\ + --disable-libpmem \\\ + --disable-libssh \\\ + --disable-libudev \\\ + --disable-libusb \\\ + --disable-libvduse \\\ + --disable-linux-aio \\\ + --disable-linux-io-uring \\\ + --disable-linux-user \\\ + --disable-live-block-migration \\\ + --disable-lto \\\ + --disable-lzfse \\\ + --disable-lzo \\\ + --disable-malloc-trim \\\ + --disable-membarrier \\\ + --disable-modules \\\ + --disable-module-upgrades \\\ + --disable-mpath \\\ + --disable-multiprocess \\\ + --disable-netmap \\\ + --disable-nettle \\\ + --disable-numa \\\ + --disable-nvmm \\\ + --disable-opengl \\\ + --disable-oss \\\ + --disable-pa \\\ + --disable-parallels \\\ + --disable-pie \\\ + --disable-pvrdma \\\ + --disable-qcow1 \\\ + --disable-qed \\\ + --disable-qga-vss \\\ + --disable-qom-cast-debug \\\ + --disable-rbd \\\ + --disable-rdma \\\ + --disable-replication \\\ + --disable-rng-none \\\ + --disable-safe-stack \\\ + --disable-sanitizers \\\ + --disable-sdl \\\ + --disable-sdl-image \\\ + --disable-seccomp \\\ + --disable-selinux \\\ + --disable-slirp \\\ + --disable-slirp-smbd \\\ + --disable-smartcard \\\ + --disable-snappy \\\ + --disable-sndio \\\ + --disable-sparse \\\ + --disable-spice \\\ + --disable-spice-protocol \\\ + --disable-strip \\\ + --disable-system \\\ + --disable-tcg \\\ + --disable-tools \\\ + --disable-tpm \\\ + --disable-u2f \\\ + --disable-usb-redir \\\ + --disable-user \\\ + --disable-vde \\\ + --disable-vdi \\\ + --disable-vduse-blk-export \\\ + --disable-vhost-crypto \\\ + --disable-vhost-kernel \\\ + --disable-vhost-net \\\ + --disable-vhost-user \\\ + --disable-vhost-user-blk-server \\\ + --disable-vhost-vdpa \\\ + --disable-virglrenderer \\\ + --disable-virtfs \\\ + --disable-vnc \\\ + --disable-vnc-jpeg \\\ + --disable-png \\\ + --disable-vnc-sasl \\\ + --disable-vte \\\ + --disable-vvfat \\\ + --disable-werror \\\ + --disable-whpx \\\ + --disable-xen \\\ + --disable-xen-pci-passthrough \\\ + --disable-xkbcommon \\\ + --disable-zstd \\\ + --with-git-submodules=ignore \\\ + --without-default-devices + + +run_configure() { + ../configure \ + --cc=%{__cc} \ + --cxx=/bin/false \ + --prefix="%{_prefix}" \ + --libdir="%{_libdir}" \ + --datadir="%{_datadir}" \ + --sysconfdir="%{_sysconfdir}" \ + --interp-prefix=%{_prefix}/qemu-%M \ + --localstatedir="%{_localstatedir}" \ + --docdir="%{_docdir}" \ + --libexecdir="%{_libexecdir}" \ + --extra-ldflags="%{build_ldflags}" \ + --extra-cflags="%{optflags} -Wno-string-plus-int" \ + --with-pkgversion="%{name}-%{version}-%{release}" \ + --with-suffix="%{name}" \ + --firmwarepath=%{firmwaredirs} \ + --meson="%{__meson}" \ + --enable-trace-backends=dtrace \ + --with-coroutine=ucontext \ + --with-git=git \ + --tls-priority=@QEMU,SYSTEM \ + %{disable_everything} \ + --with-devices-%{kvm_target}=%{kvm_target}-rh-devices \ + "$@" + + echo "config-host.mak contents:" + echo "===" + cat config-host.mak + echo "===" +} + + +pushd %{qemu_kvm_build} +run_configure \ +%if %{defined target_list} + --target-list="%{target_list}" \ +%endif +%if %{defined block_drivers_rw_list} + --block-drv-rw-whitelist=%{block_drivers_rw_list} \ +%endif +%if %{defined block_drivers_ro_list} + --block-drv-ro-whitelist=%{block_drivers_ro_list} \ +%endif + --enable-attr \ + --enable-blkio \ + --enable-cap-ng \ + --enable-capstone \ + --enable-coroutine-pool \ + --enable-curl \ + --enable-debug-info \ + --enable-docs \ +%if %{have_fdt} + --enable-fdt=system \ +%endif + --enable-gnutls \ + --enable-guest-agent \ + --enable-iconv \ + --enable-kvm \ +%if %{have_pmem} + --enable-libpmem \ +%endif + --enable-libusb \ + --enable-libudev \ + --enable-linux-aio \ + --enable-linux-io-uring \ + --enable-lzo \ + --enable-malloc-trim \ + --enable-modules \ + --enable-mpath \ +%if %{have_numactl} + --enable-numa \ +%endif +%if %{have_opengl} + --enable-opengl \ +%endif + --enable-pa \ + --enable-pie \ +%if %{have_block_rbd} + --enable-rbd \ +%endif +%if %{have_librdma} + --enable-rdma \ +%endif + --enable-seccomp \ + --enable-selinux \ + --enable-slirp \ + --enable-snappy \ + --enable-spice-protocol \ + --enable-system \ + --enable-tcg \ + --enable-tools \ + --enable-tpm \ +%if %{have_usbredir} + --enable-usb-redir \ +%endif + --enable-vdi \ + --enable-vhost-kernel \ + --enable-vhost-net \ + --enable-vhost-user \ + --enable-vhost-user-blk-server \ + --enable-vhost-vdpa \ + --enable-vnc \ + --enable-png \ + --enable-vnc-sasl \ +%if %{enable_werror} + --enable-werror \ +%endif + --enable-xkbcommon \ +%if %{have_safe_stack} + --enable-safe-stack \ +%endif + +%if %{tools_only} +%make_build qemu-img +%make_build qemu-io +%make_build qemu-nbd +%make_build storage-daemon/qemu-storage-daemon + +%make_build docs/qemu-img.1 +%make_build docs/qemu-nbd.8 +%make_build docs/qemu-storage-daemon.1 +%make_build docs/qemu-storage-daemon-qmp-ref.7 + +%make_build qga/qemu-ga +%make_build docs/qemu-ga.8 +# endif tools_only +%endif + + +%if !%{tools_only} +%make_build + +# Setup back compat qemu-kvm binary +%{__python3} scripts/tracetool.py --backend dtrace --format stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm.stp + +%{__python3} scripts/tracetool.py --backends=dtrace --format=log-stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm-log.stp + +%{__python3} scripts/tracetool.py --backend dtrace --format simpletrace-stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --probe-prefix qemu.kvm \ + trace/trace-events-all qemu-kvm-simpletrace.stp + +cp -a %{kvm_target}-softmmu/qemu-system-%{kvm_target} qemu-kvm + +%ifarch s390x + # Copy the built new images into place for "make check": + cp pc-bios/s390-ccw/s390-ccw.img pc-bios/s390-ccw/s390-netboot.img pc-bios/ +%endif + +popd +# endif !tools_only +%endif + + + +%install +# Install qemu-guest-agent service and udev rules +install -D -m 0644 %{_sourcedir}/qemu-guest-agent.service %{buildroot}%{_unitdir}/qemu-guest-agent.service +install -D -m 0644 %{_sourcedir}/qemu-ga.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/qemu-ga +install -D -m 0644 %{_sourcedir}/99-qemu-guest-agent.rules %{buildroot}%{_udevrulesdir}/99-qemu-guest-agent.rules + + +# Install qemu-ga fsfreeze bits +mkdir -p %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook.d +install -p scripts/qemu-guest-agent/fsfreeze-hook %{buildroot}%{_sysconfdir}/qemu-ga/fsfreeze-hook +mkdir -p %{buildroot}%{_datadir}/%{name}/qemu-ga/fsfreeze-hook.d/ +install -p -m 0644 scripts/qemu-guest-agent/fsfreeze-hook.d/*.sample %{buildroot}%{_datadir}/%{name}/qemu-ga/fsfreeze-hook.d/ +mkdir -p -v %{buildroot}%{_localstatedir}/log/qemu-ga/ + + +%if %{tools_only} +pushd %{qemu_kvm_build} +install -D -p -m 0755 qga/qemu-ga %{buildroot}%{_bindir}/qemu-ga +install -D -p -m 0755 qemu-img %{buildroot}%{_bindir}/qemu-img +install -D -p -m 0755 qemu-io %{buildroot}%{_bindir}/qemu-io +install -D -p -m 0755 qemu-nbd %{buildroot}%{_bindir}/qemu-nbd +install -D -p -m 0755 storage-daemon/qemu-storage-daemon %{buildroot}%{_bindir}/qemu-storage-daemon + +mkdir -p %{buildroot}%{_mandir}/man1/ +mkdir -p %{buildroot}%{_mandir}/man7/ +mkdir -p %{buildroot}%{_mandir}/man8/ + +install -D -p -m 644 docs/qemu-img.1* %{buildroot}%{_mandir}/man1 +install -D -p -m 644 docs/qemu-nbd.8* %{buildroot}%{_mandir}/man8 +install -D -p -m 644 docs/qemu-storage-daemon.1* %{buildroot}%{_mandir}/man1 +install -D -p -m 644 docs/qemu-storage-daemon-qmp-ref.7* %{buildroot}%{_mandir}/man7 +install -D -p -m 644 docs/qemu-ga.8* %{buildroot}%{_mandir}/man8 +popd +# endif tools_only +%endif + +%if !%{tools_only} + +install -D -p -m 0644 %{_sourcedir}/vhost.conf %{buildroot}%{_sysconfdir}/modprobe.d/vhost.conf +install -D -p -m 0644 %{modprobe_kvm_conf} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kvm.conf + +# Create new directories and put them all under tests-src +mkdir -p %{buildroot}%{testsdir}/python +mkdir -p %{buildroot}%{testsdir}/tests +mkdir -p %{buildroot}%{testsdir}/tests/avocado +mkdir -p %{buildroot}%{testsdir}/tests/qemu-iotests +mkdir -p %{buildroot}%{testsdir}/scripts/qmp + + +install -m 0644 scripts/dump-guest-memory.py \ + %{buildroot}%{_datadir}/%{name} + +# Install avocado_qemu tests +cp -R %{qemu_kvm_build}/tests/avocado/* %{buildroot}%{testsdir}/tests/avocado/ + +# Install qemu.py and qmp/ scripts required to run avocado_qemu tests +cp -R %{qemu_kvm_build}/python/qemu %{buildroot}%{testsdir}/python +cp -R %{qemu_kvm_build}/scripts/qmp/* %{buildroot}%{testsdir}/scripts/qmp +install -p -m 0644 tests/Makefile.include %{buildroot}%{testsdir}/tests/ + +# Install qemu-iotests +cp -R tests/qemu-iotests/* %{buildroot}%{testsdir}/tests/qemu-iotests/ +cp -ur %{qemu_kvm_build}/tests/qemu-iotests/* %{buildroot}%{testsdir}/tests/qemu-iotests/ + +install -p -m 0644 %{_sourcedir}/README.tests %{buildroot}%{testsdir}/README + +# Do the actual qemu tree install +pushd %{qemu_kvm_build} +%make_install +popd + +mkdir -p %{buildroot}%{_datadir}/systemtap/tapset + +install -m 0755 %{qemu_kvm_build}/%{kvm_target}-softmmu/qemu-system-%{kvm_target} %{buildroot}%{_libexecdir}/qemu-kvm +install -m 0644 %{qemu_kvm_build}/qemu-kvm.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -m 0644 %{qemu_kvm_build}/qemu-kvm-log.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -m 0644 %{qemu_kvm_build}/qemu-kvm-simpletrace.stp %{buildroot}%{_datadir}/systemtap/tapset/ +install -d -m 0755 "%{buildroot}%{_datadir}/%{name}/systemtap/script.d" +install -c -m 0644 %{qemu_kvm_build}/scripts/systemtap/script.d/qemu_kvm.stp "%{buildroot}%{_datadir}/%{name}/systemtap/script.d/" +install -d -m 0755 "%{buildroot}%{_datadir}/%{name}/systemtap/conf.d" +install -c -m 0644 %{qemu_kvm_build}/scripts/systemtap/conf.d/qemu_kvm.conf "%{buildroot}%{_datadir}/%{name}/systemtap/conf.d/" + + +rm %{buildroot}/%{_datadir}/applications/qemu.desktop +rm %{buildroot}%{_bindir}/qemu-system-%{kvm_target} +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-simpletrace.stp +rm %{buildroot}%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-log.stp +rm %{buildroot}%{_bindir}/elf2dmp + +# Install simpletrace +install -m 0755 scripts/simpletrace.py %{buildroot}%{_datadir}/%{name}/simpletrace.py +# Avoid ambiguous 'python' interpreter name +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool scripts/tracetool/*.py +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool/backend +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool/backend scripts/tracetool/backend/*.py +mkdir -p %{buildroot}%{_datadir}/%{name}/tracetool/format +install -m 0644 -t %{buildroot}%{_datadir}/%{name}/tracetool/format scripts/tracetool/format/*.py + +mkdir -p %{buildroot}%{qemudocdir} +install -p -m 0644 -t %{buildroot}%{qemudocdir} README.rst README.systemtap COPYING COPYING.LIB LICENSE docs/interop/qmp-spec.txt + +# Rename man page +pushd %{buildroot}%{_mandir}/man1/ +for fn in qemu.1*; do + mv $fn "qemu-kvm${fn#qemu}" +done +popd + +install -D -p -m 0644 qemu.sasl %{buildroot}%{_sysconfdir}/sasl2/%{name}.conf + +# Provided by package openbios +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-ppc +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-sparc32 +rm -rf %{buildroot}%{_datadir}/%{name}/openbios-sparc64 +# Provided by package SLOF +rm -rf %{buildroot}%{_datadir}/%{name}/slof.bin + +# Remove unpackaged files. +rm -rf %{buildroot}%{_datadir}/%{name}/palcode-clipper +rm -rf %{buildroot}%{_datadir}/%{name}/petalogix*.dtb +rm -f %{buildroot}%{_datadir}/%{name}/bamboo.dtb +rm -f %{buildroot}%{_datadir}/%{name}/ppc_rom.bin +rm -rf %{buildroot}%{_datadir}/%{name}/s390-zipl.rom +rm -rf %{buildroot}%{_datadir}/%{name}/u-boot.e500 +rm -rf %{buildroot}%{_datadir}/%{name}/qemu_vga.ndrv +rm -rf %{buildroot}%{_datadir}/%{name}/skiboot.lid +rm -rf %{buildroot}%{_datadir}/%{name}/qboot.rom + +rm -rf %{buildroot}%{_datadir}/%{name}/s390-ccw.img +rm -rf %{buildroot}%{_datadir}/%{name}/s390-netboot.img +rm -rf %{buildroot}%{_datadir}/%{name}/hppa-firmware.img +rm -rf %{buildroot}%{_datadir}/%{name}/canyonlands.dtb +rm -rf %{buildroot}%{_datadir}/%{name}/u-boot-sam460-20100605.bin + +rm -rf %{buildroot}%{_datadir}/%{name}/firmware +rm -rf %{buildroot}%{_datadir}/%{name}/edk2-*.fd +rm -rf %{buildroot}%{_datadir}/%{name}/edk2-licenses.txt + +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-sifive_u-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-virt-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv32-generic-fw_dynamic.* +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-sifive_u-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-virt-fw_jump.bin +rm -rf %{buildroot}%{_datadir}/%{name}/opensbi-riscv64-generic-fw_dynamic.* +rm -rf %{buildroot}%{_datadir}/%{name}/qemu-nsis.bmp +rm -rf %{buildroot}%{_datadir}/%{name}/npcm7xx_bootrom.bin + +# Remove virtfs-proxy-helper files +rm -rf %{buildroot}%{_libexecdir}/virtfs-proxy-helper +rm -rf %{buildroot}%{_mandir}/man1/virtfs-proxy-helper* + +%ifarch s390x + # Use the s390-*.img that we've just built, not the pre-built ones + install -m 0644 %{qemu_kvm_build}/pc-bios/s390-ccw/s390-ccw.img %{buildroot}%{_datadir}/%{name}/ + install -m 0644 %{qemu_kvm_build}/pc-bios/s390-ccw/s390-netboot.img %{buildroot}%{_datadir}/%{name}/ +%else + rm -rf %{buildroot}%{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so +%endif + +%ifnarch x86_64 + rm -rf %{buildroot}%{_datadir}/%{name}/kvmvapic.bin + rm -rf %{buildroot}%{_datadir}/%{name}/linuxboot.bin + rm -rf %{buildroot}%{_datadir}/%{name}/multiboot.bin + rm -rf %{buildroot}%{_datadir}/%{name}/multiboot_dma.bin + rm -rf %{buildroot}%{_datadir}/%{name}/pvh.bin +%endif + +# Remove sparc files +rm -rf %{buildroot}%{_datadir}/%{name}/QEMU,tcx.bin +rm -rf %{buildroot}%{_datadir}/%{name}/QEMU,cgthree.bin + +# Remove ivshmem example programs +rm -rf %{buildroot}%{_bindir}/ivshmem-client +rm -rf %{buildroot}%{_bindir}/ivshmem-server + +# Remove efi roms +rm -rf %{buildroot}%{_datadir}/%{name}/efi*.rom + +# Provided by package ipxe +rm -rf %{buildroot}%{_datadir}/%{name}/pxe*rom +# Provided by package vgabios +rm -rf %{buildroot}%{_datadir}/%{name}/vgabios*bin +# Provided by package seabios +rm -rf %{buildroot}%{_datadir}/%{name}/bios*.bin +rm -rf %{buildroot}%{_datadir}/%{name}/sgabios.bin + +# Remove vof roms +rm -rf %{buildroot}%{_datadir}/%{name}/vof-nvram.bin +rm -rf %{buildroot}%{_datadir}/%{name}/vof.bin + +%if %{have_modules_load} + install -D -p -m 644 %{_sourcedir}/modules-load.conf %{buildroot}%{_sysconfdir}/modules-load.d/kvm.conf +%endif + +%if %{have_memlock_limits} + install -D -p -m 644 %{_sourcedir}/95-kvm-memlock.conf %{buildroot}%{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif + +# Install rules to use the bridge helper with libvirt's virbr0 +install -D -m 0644 %{_sourcedir}/bridge.conf %{buildroot}%{_sysconfdir}/%{name}/bridge.conf + +# Install qemu-pr-helper service +install -m 0644 contrib/systemd/qemu-pr-helper.service %{buildroot}%{_unitdir} +install -m 0644 contrib/systemd/qemu-pr-helper.socket %{buildroot}%{_unitdir} + +# We do not support gl display devices so we can remove their modules as they +# do not have expected functionality included. +# +# https://gitlab.com/qemu-project/qemu/-/issues/1352 was filed to stop building these +# modules in case all dependencies are not satisfied. + +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-gl.so +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-gpu-pci-gl.so +rm -rf %{buildroot}%{_libdir}/%{name}/hw-display-virtio-vga-gl.so + +# We need to make the block device modules and other qemu SO files executable +# otherwise RPM won't pick up their dependencies. +chmod +x %{buildroot}%{_libdir}/%{name}/*.so + +# Remove docs we don't care about +find %{buildroot}%{qemudocdir} -name .buildinfo -delete +rm -rf %{buildroot}%{qemudocdir}/specs + +# endif !tools_only +%endif + +%check +%if !%{tools_only} + +pushd %{qemu_kvm_build} +echo "Testing %{name}-build" +#%make_build check +make V=1 check +popd + +# endif !tools_only +%endif + +%post -n qemu-guest-agent +%systemd_post qemu-guest-agent.service +%preun -n qemu-guest-agent +%systemd_preun qemu-guest-agent.service +%postun -n qemu-guest-agent +%systemd_postun_with_restart qemu-guest-agent.service + +%if !%{tools_only} +%post common +getent group kvm >/dev/null || groupadd -g 36 -r kvm +getent group qemu >/dev/null || groupadd -g 107 -r qemu +getent passwd qemu >/dev/null || \ +useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ + -c "qemu user" qemu + +# If this is a new installation, then load kvm modules now, so we can make +# sure that the user gets a system where KVM is ready to use. In case of +# an upgrade, don't try to modprobe again in case the user unloaded the +# kvm module on purpose. +%if %{have_modules_load} + if [ "$1" = "1" ]; then + modprobe -b kvm &> /dev/null || : + fi +%endif +# endif !tools_only +%endif + + + +%files -n qemu-img +%{_bindir}/qemu-img +%{_bindir}/qemu-io +%{_bindir}/qemu-nbd +%{_bindir}/qemu-storage-daemon +%{_mandir}/man1/qemu-img.1* +%{_mandir}/man8/qemu-nbd.8* +%{_mandir}/man1/qemu-storage-daemon.1* +%{_mandir}/man7/qemu-storage-daemon-qmp-ref.7* + + +%files -n qemu-guest-agent +%doc COPYING README.rst +%{_bindir}/qemu-ga +%{_mandir}/man8/qemu-ga.8* +%{_unitdir}/qemu-guest-agent.service +%{_udevrulesdir}/99-qemu-guest-agent.rules +%config(noreplace) %{_sysconfdir}/sysconfig/qemu-ga +%{_sysconfdir}/qemu-ga +%{_datadir}/%{name}/qemu-ga +%dir %{_localstatedir}/log/qemu-ga + + +%if !%{tools_only} +%files +# Deliberately empty + +%files tools +%{_bindir}/qemu-keymap +%{_bindir}/qemu-edid +%{_bindir}/qemu-trace-stap +%{_datadir}/%{name}/simpletrace.py* +%{_datadir}/%{name}/tracetool/*.py* +%{_datadir}/%{name}/tracetool/backend/*.py* +%{_datadir}/%{name}/tracetool/format/*.py* +%{_datadir}/%{name}/dump-guest-memory.py* +%{_datadir}/%{name}/trace-events-all +%{_mandir}/man1/qemu-trace-stap.1* + +%files -n qemu-pr-helper +%{_bindir}/qemu-pr-helper +%{_unitdir}/qemu-pr-helper.service +%{_unitdir}/qemu-pr-helper.socket +%{_mandir}/man8/qemu-pr-helper.8* + +%files docs +%doc %{qemudocdir} + +%files common +%license COPYING COPYING.LIB LICENSE +%{_mandir}/man7/qemu-qmp-ref.7* +%{_mandir}/man7/qemu-cpu-models.7* +%{_mandir}/man7/qemu-ga-ref.7* + +%dir %{_datadir}/%{name}/ +%{_datadir}/%{name}/keymaps/ +%{_mandir}/man1/%{name}.1* +%{_mandir}/man7/qemu-block-drivers.7* +%attr(4755, -, -) %{_libexecdir}/qemu-bridge-helper +%config(noreplace) %{_sysconfdir}/sasl2/%{name}.conf +%ghost %{_sysconfdir}/kvm +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/bridge.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/vhost.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/kvm.conf + +%ifarch x86_64 + %{_datadir}/%{name}/linuxboot.bin + %{_datadir}/%{name}/multiboot.bin + %{_datadir}/%{name}/multiboot_dma.bin + %{_datadir}/%{name}/kvmvapic.bin + %{_datadir}/%{name}/pvh.bin +%endif +%ifarch s390x + %{_datadir}/%{name}/s390-ccw.img + %{_datadir}/%{name}/s390-netboot.img +%endif +%{_datadir}/icons/* +%{_datadir}/%{name}/linuxboot_dma.bin +%if %{have_modules_load} + %{_sysconfdir}/modules-load.d/kvm.conf +%endif +%if %{have_memlock_limits} + %{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif + +%files core +%{_libexecdir}/qemu-kvm +%{_datadir}/systemtap/tapset/qemu-kvm.stp +%{_datadir}/systemtap/tapset/qemu-kvm-log.stp +%{_datadir}/systemtap/tapset/qemu-kvm-simpletrace.stp +%{_datadir}/%{name}/systemtap/script.d/qemu_kvm.stp +%{_datadir}/%{name}/systemtap/conf.d/qemu_kvm.conf + +%ifarch x86_64 + %{_libdir}/%{name}/accel-tcg-%{kvm_target}.so +%endif + +%files device-display-virtio-gpu +%{_libdir}/%{name}/hw-display-virtio-gpu.so + +%ifarch s390x +%files device-display-virtio-gpu-ccw + %{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so +%else +%files device-display-virtio-gpu-pci + %{_libdir}/%{name}/hw-display-virtio-gpu-pci.so +%endif + +%ifarch x86_64 %{power64} +%files device-display-virtio-vga + %{_libdir}/%{name}/hw-display-virtio-vga.so +%endif + +%files tests +%{testsdir} +%{_libdir}/%{name}/accel-qtest-%{kvm_target}.so + +%files block-blkio +%{_libdir}/%{name}/block-blkio.so + +%files block-curl +%{_libdir}/%{name}/block-curl.so +%if %{have_block_rbd} +%files block-rbd +%{_libdir}/%{name}/block-rbd.so +%endif +%files audio-pa +%{_libdir}/%{name}/audio-pa.so + +%if %{have_opengl} +%files ui-opengl +%{_libdir}/%{name}/ui-opengl.so +%files ui-egl-headless +%{_libdir}/%{name}/ui-egl-headless.so +%endif + +%files device-usb-host +%{_libdir}/%{name}/hw-usb-host.so + +%if %{have_usbredir} +%files device-usb-redirect + %{_libdir}/%{name}/hw-usb-redirect.so +%endif + +# endif !tools_only +%endif + +%changelog +* Mon Jul 10 2023 Miroslav Rezanina - 8.0.0-7 +- kvm-numa-Validate-cluster-and-NUMA-node-boundary-if-requ.patch [bz#2171363] +- kvm-hw-arm-Validate-cluster-and-NUMA-node-boundary.patch [bz#2171363] +- kvm-hw-arm-virt-Validate-cluster-and-NUMA-node-boundary-.patch [bz#2171363] +- kvm-vhost-fix-vhost_dev_enable_notifiers-error-case.patch [RHEL-330] +- kvm-kvm-reuse-per-vcpu-stats-fd-to-avoid-vcpu-interrupti.patch [bz#2218644] +- kvm-vhost-vdpa-do-not-cleanup-the-vdpa-vhost-net-structu.patch [bz#2128929] +- Resolves: bz#2171363 + ([aarch64] Kernel hits Call trace with irregular CPU-to-NUMA association) +- Resolves: RHEL-330 + ([virtual network][qemu-kvm-8.0.0-rc1]qemu core dump: qemu-kvm: ../softmmu/memory.c:2592: void memory_region_del_eventfd(MemoryRegion *, hwaddr, unsigned int, _Bool, uint64_t, EventNotifier *): Assertion `i != mr->ioeventfd_nb' failed) +- Resolves: bz#2218644 + (query-stats QMP command interrupts vcpus, the Max Latencies could be more than 100us (rhel 9.3.0 clone)) +- Resolves: bz#2128929 + ([rhel9.2] hotplug/hotunplug mlx vdpa device to the occupied addr port, then qemu core dump occurs after shutdown guest) + +* Mon Jun 26 2023 Miroslav Rezanina - 8.0.0-6 +- kvm-target-i386-add-support-for-FLUSH_L1D-feature.patch [bz#2216201] +- kvm-target-i386-add-support-for-FB_CLEAR-feature.patch [bz#2216201] +- kvm-block-blkio-use-qemu_open-to-support-fd-passing-for-.patch [bz#2180076] +- kvm-qapi-add-fdset-feature-for-BlockdevOptionsVirtioBlkV.patch [bz#2180076] +- kvm-Enable-libblkio-block-drivers.patch [bz#2213317] +- Resolves: bz#2216201 + ([qemu-kvm]VM reports vulnerabilty to mmio_stale_data on patched host with microcode) +- Resolves: bz#2180076 + ([qemu-kvm] support fd passing for libblkio QEMU BlockDrivers) +- Resolves: bz#2213317 + (Enable libblkio-based block drivers in QEMU) + +* Tue Jun 13 2023 Miroslav Rezanina - 8.0.0-5 +- kvm-block-compile-out-assert_bdrv_graph_readable-by-defa.patch [bz#2186725] +- kvm-graph-lock-Disable-locking-for-now.patch [bz#2186725] +- kvm-nbd-server-Fix-drained_poll-to-wake-coroutine-in-rig.patch [bz#2186725] +- kvm-iotests-Test-commit-with-iothreads-and-ongoing-I-O.patch [bz#2186725] +- kvm-memory-prevent-dma-reentracy-issues.patch [RHEL-516] +- kvm-async-Add-an-optional-reentrancy-guard-to-the-BH-API.patch [RHEL-516] +- kvm-checkpatch-add-qemu_bh_new-aio_bh_new-checks.patch [RHEL-516] +- kvm-hw-replace-most-qemu_bh_new-calls-with-qemu_bh_new_g.patch [RHEL-516] +- kvm-lsi53c895a-disable-reentrancy-detection-for-script-R.patch [RHEL-516] +- kvm-bcm2835_property-disable-reentrancy-detection-for-io.patch [RHEL-516] +- kvm-raven-disable-reentrancy-detection-for-iomem.patch [RHEL-516] +- kvm-apic-disable-reentrancy-detection-for-apic-msi.patch [RHEL-516] +- kvm-async-avoid-use-after-free-on-re-entrancy-guard.patch [RHEL-516] +- kvm-loongarch-mark-loongarch_ipi_iocsr-re-entrnacy-safe.patch [RHEL-516] +- kvm-memory-stricter-checks-prior-to-unsetting-engaged_in.patch [RHEL-516] +- kvm-lsi53c895a-disable-reentrancy-detection-for-MMIO-reg.patch [RHEL-516] +- kvm-hw-scsi-lsi53c895a-Fix-reentrancy-issues-in-the-LSI-.patch [RHEL-516] +- kvm-hw-pci-Disable-PCI_ERR_UNCOR_MASK-register-for-machi.patch [bz#2189423] +- kvm-multifd-Fix-the-number-of-channels-ready.patch [bz#2196289] +- kvm-util-async-teardown-wire-up-query-command-line-optio.patch [bz#2168500] +- kvm-s390x-pv-Fix-spurious-warning-with-asynchronous-tear.patch [bz#2168500] +- Resolves: bz#2186725 + (Qemu hang when commit during fio running(iothread enable)) +- Resolves: RHEL-516 + (CVE-2023-2680 qemu-kvm: QEMU: hcd-ehci: DMA reentrancy issue (incomplete fix for CVE-2021-3750) [rhel-9]) +- Resolves: bz#2189423 + (Failed to migrate VM from rhel 9.3 to rhel 9.2) +- Resolves: bz#2196289 + (Fix number of ready channels on multifd) +- Resolves: bz#2168500 + ([IBM 9.3 FEAT] KVM: Improve memory reclaiming for z15 Secure Execution guests - qemu part) + +* Mon May 22 2023 Miroslav Rezanina - 8.0.0-4 +- kvm-migration-Attempt-disk-reactivation-in-more-failure-.patch [bz#2058982] +- kvm-util-mmap-alloc-qemu_fd_getfs.patch [bz#2057267] +- kvm-vl.c-Create-late-backends-before-migration-object.patch [bz#2057267] +- kvm-migration-postcopy-Detect-file-system-on-dest-host.patch [bz#2057267] +- kvm-migration-mark-mixed-functions-that-can-suspend.patch [bz#2057267] +- kvm-postcopy-ram-do-not-use-qatomic_mb_read.patch [bz#2057267] +- kvm-migration-remove-extra-whitespace-character-for-code.patch [bz#2057267] +- kvm-migration-Merge-ram_counters-and-ram_atomic_counters.patch [bz#2057267] +- kvm-migration-Update-atomic-stats-out-of-the-mutex.patch [bz#2057267] +- kvm-migration-Make-multifd_bytes-atomic.patch [bz#2057267] +- kvm-migration-Make-dirty_sync_missed_zero_copy-atomic.patch [bz#2057267] +- kvm-migration-Make-precopy_bytes-atomic.patch [bz#2057267] +- kvm-migration-Make-downtime_bytes-atomic.patch [bz#2057267] +- kvm-migration-Make-dirty_sync_count-atomic.patch [bz#2057267] +- kvm-migration-Make-postcopy_requests-atomic.patch [bz#2057267] +- kvm-migration-Rename-duplicate-to-zero_pages.patch [bz#2057267] +- kvm-migration-Rename-normal-to-normal_pages.patch [bz#2057267] +- kvm-migration-rename-enabled_capabilities-to-capabilitie.patch [bz#2057267] +- kvm-migration-Pass-migrate_caps_check-the-old-and-new-ca.patch [bz#2057267] +- kvm-migration-move-migration_global_dump-to-migration-hm.patch [bz#2057267] +- kvm-spice-move-client_migrate_info-command-to-ui.patch [bz#2057267] +- kvm-migration-Create-migrate_cap_set.patch [bz#2057267] +- kvm-migration-Create-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_colo_enabled-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_compression-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_events-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_multifd-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_zero_copy_send-to-options.patch [bz#2057267] +- kvm-migration-Move-migrate_use_xbzrle-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_block-to-options.c.patch [bz#2057267] +- kvm-migration-Move-migrate_use_return-to-options.c.patch [bz#2057267] +- kvm-migration-Create-migrate_rdma_pin_all-function.patch [bz#2057267] +- kvm-migration-Move-migrate_caps_check-to-options.c.patch [bz#2057267] +- kvm-migration-Move-qmp_query_migrate_capabilities-to-opt.patch [bz#2057267] +- kvm-migration-Move-qmp_migrate_set_capabilities-to-optio.patch [bz#2057267] +- kvm-migration-Move-migrate_cap_set-to-options.c.patch [bz#2057267] +- kvm-migration-Move-parameters-functions-to-option.c.patch [bz#2057267] +- kvm-migration-Use-migrate_max_postcopy_bandwidth.patch [bz#2057267] +- kvm-migration-Move-migrate_use_block_incremental-to-opti.patch [bz#2057267] +- kvm-migration-Create-migrate_throttle_trigger_threshold.patch [bz#2057267] +- kvm-migration-Create-migrate_checkpoint_delay.patch [bz#2057267] +- kvm-migration-Create-migrate_max_cpu_throttle.patch [bz#2057267] +- kvm-migration-Move-migrate_announce_params-to-option.c.patch [bz#2057267] +- kvm-migration-Create-migrate_cpu_throttle_initial-to-opt.patch [bz#2057267] +- kvm-migration-Create-migrate_cpu_throttle_increment-func.patch [bz#2057267] +- kvm-migration-Create-migrate_cpu_throttle_tailslow-funct.patch [bz#2057267] +- kvm-migration-Move-migrate_postcopy-to-options.c.patch [bz#2057267] +- kvm-migration-Create-migrate_max_bandwidth-function.patch [bz#2057267] +- kvm-migration-Move-migrate_use_tls-to-options.c.patch [bz#2057267] +- kvm-migration-Move-qmp_migrate_set_parameters-to-options.patch [bz#2057267] +- kvm-migration-Allow-postcopy_ram_supported_by_host-to-re.patch [bz#2057267] +- kvm-block-bdrv-blk_co_unref-for-calls-in-coroutine-conte.patch [bz#2185688] +- kvm-block-Don-t-call-no_coroutine_fns-in-qmp_block_resiz.patch [bz#2185688] +- kvm-iotests-Use-alternative-CPU-type-that-is-not-depreca.patch [bz#2185688] +- kvm-iotests-Test-resizing-image-attached-to-an-iothread.patch [bz#2185688] +- kvm-Enable-Linux-io_uring.patch [bz#1947230] +- Resolves: bz#2058982 + (Qemu core dump if cut off nfs storage during migration) +- Resolves: bz#2057267 + (Migration with postcopy fail when vm set with shared memory) +- Resolves: bz#2185688 + ([qemu-kvm] no response with QMP command block_resize) +- Resolves: bz#1947230 + (Enable QEMU support for io_uring in RHEL9) + +* Mon May 15 2023 Miroslav Rezanina - 8.0.0-3 +- kvm-migration-Handle-block-device-inactivation-failures-.patch [bz#2058982] +- kvm-migration-Minor-control-flow-simplification.patch [bz#2058982] +- Resolves: bz#2058982 + (Qemu core dump if cut off nfs storage during migration) + +* Mon May 08 2023 Miroslav Rezanina - 8.0.0-2 +- kvm-acpi-pcihp-allow-repeating-hot-unplug-requests.patch [bz#2087047] +- kvm-hw-acpi-limit-warning-on-acpi-table-size-to-pc-machi.patch [bz#1934134] +- kvm-hw-acpi-Mark-acpi-blobs-as-resizable-on-RHEL-pc-mach.patch [bz#1934134] +- Resolves: bz#2087047 + (Disk detach is unsuccessful while the guest is still booting) +- Resolves: bz#1934134 + (ACPI table limits warning when booting guest with 512 VCPUs) + +* Thu Apr 20 2023 Miroslav Rezanina - 8.0.0-1 +- Rebase to QEMU 8.0.0 +- Resolves: bz#2180898 + (Rebase to QEMU 8.0.0 for RHEL 9.3.0) + +* Mon Mar 20 2023 Miroslav Rezanina - 7.2.0-14 +- Rebuild for 9.2 release +- Resolves: bz#2173590 + (bugs in emulation of BMI instructions (for libguestfs without KVM)) +- Resolves: bz#2156876 + ([virtual network][rhel7.9_guest] qemu-kvm: vhost vring error in virtqueue 1: Invalid argument (22)) + +* Mon Mar 20 2023 Miroslav Rezanina - 7.2.0-13 +- kvm-target-i386-fix-operand-size-of-unary-SSE-operations.patch [bz#2173590] +- kvm-tests-tcg-i386-Introduce-and-use-reg_t-consistently.patch [bz#2173590] +- kvm-target-i386-Fix-BEXTR-instruction.patch [bz#2173590] +- kvm-target-i386-Fix-C-flag-for-BLSI-BLSMSK-BLSR.patch [bz#2173590] +- kvm-target-i386-fix-ADOX-followed-by-ADCX.patch [bz#2173590] +- kvm-target-i386-Fix-32-bit-AD-CO-X-insns-in-64-bit-mode.patch [bz#2173590] +- kvm-target-i386-Fix-BZHI-instruction.patch [bz#2173590] +- kvm-intel-iommu-fail-DEVIOTLB_UNMAP-without-dt-mode.patch [bz#2156876] +- Resolves: bz#2173590 + (bugs in emulation of BMI instructions (for libguestfs without KVM)) +- Resolves: bz#2156876 + ([virtual network][rhel7.9_guest] qemu-kvm: vhost vring error in virtqueue 1: Invalid argument (22)) + +* Sun Mar 12 2023 Miroslav Rezanina - 7.2.0-12 +- kvm-scsi-protect-req-aiocb-with-AioContext-lock.patch [bz#2155748] +- kvm-dma-helpers-prevent-dma_blk_cb-vs-dma_aio_cancel-rac.patch [bz#2155748] +- kvm-virtio-scsi-reset-SCSI-devices-from-main-loop-thread.patch [bz#2155748] +- kvm-qatomic-add-smp_mb__before-after_rmw.patch [bz#2175660] +- kvm-qemu-thread-posix-cleanup-fix-document-QemuEvent.patch [bz#2175660] +- kvm-qemu-thread-win32-cleanup-fix-document-QemuEvent.patch [bz#2175660] +- kvm-edu-add-smp_mb__after_rmw.patch [bz#2175660] +- kvm-aio-wait-switch-to-smp_mb__after_rmw.patch [bz#2175660] +- kvm-qemu-coroutine-lock-add-smp_mb__after_rmw.patch [bz#2175660] +- kvm-physmem-add-missing-memory-barrier.patch [bz#2175660] +- kvm-async-update-documentation-of-the-memory-barriers.patch [bz#2175660] +- kvm-async-clarify-usage-of-barriers-in-the-polling-case.patch [bz#2175660] +- Resolves: bz#2155748 + (qemu crash on void blk_drain(BlockBackend *): Assertion qemu_in_main_thread() failed) +- Resolves: bz#2175660 + (Guest hangs when starting or rebooting) + +* Mon Mar 06 2023 Miroslav Rezanina - 7.2.0-11 +- kvm-hw-smbios-fix-field-corruption-in-type-4-table.patch [bz#2169904] +- Resolves: bz#2169904 + ([SVVP] job 'Check SMBIOS Table Specific Requirements' failed on win2022) + +* Tue Feb 21 2023 Miroslav Rezanina - 7.2.0-10 +- kvm-block-temporarily-hold-the-new-AioContext-of-bs_top-.patch [bz#2168209] +- Resolves: bz#2168209 + (Qemu coredump after do snapshot of mirrored top image and its converted base image(iothread enabled)) + +* Fri Feb 17 2023 Miroslav Rezanina - 7.2.0-9 +- kvm-tests-qtest-netdev-test-stream-and-dgram-backends.patch [bz#2169232] +- kvm-net-stream-add-a-new-option-to-automatically-reconne.patch [bz#2169232] +- kvm-linux-headers-Update-to-v6.1.patch [bz#2158704] +- kvm-util-userfaultfd-Add-uffd_open.patch [bz#2158704] +- kvm-util-userfaultfd-Support-dev-userfaultfd.patch [bz#2158704] +- kvm-io-Add-support-for-MSG_PEEK-for-socket-channel.patch [bz#2169732] +- kvm-migration-check-magic-value-for-deciding-the-mapping.patch [bz#2169732] +- kvm-target-s390x-arch_dump-Fix-memory-corruption-in-s390.patch [bz#2168172] +- Resolves: bz#2169232 + (RFE: reconnect option for stream socket back-end) +- Resolves: bz#2158704 + (RFE: Prefer /dev/userfaultfd over userfaultfd(2) syscall) +- Resolves: bz#2169732 + (Multifd migration fails under a weak network/socket ordering race) +- Resolves: bz#2168172 + ([s390x] qemu-kvm coredumps when SE crashes) + +* Thu Feb 09 2023 Miroslav Rezanina - 7.2.0-8 +- kvm-qcow2-Fix-theoretical-corruption-in-store_bitmap-err.patch [bz#2150180] +- kvm-qemu-img-commit-Report-errors-while-closing-the-imag.patch [bz#2150180] +- kvm-qemu-img-bitmap-Report-errors-while-closing-the-imag.patch [bz#2150180] +- kvm-qemu-iotests-Test-qemu-img-bitmap-commit-exit-code-o.patch [bz#2150180] +- kvm-accel-tcg-Test-CPUJumpCache-in-tb_jmp_cache_clear_pa.patch [bz#2165280] +- kvm-block-Improve-empty-format-specific-info-dump.patch [bz#1860292] +- kvm-block-file-Add-file-specific-image-info.patch [bz#1860292] +- kvm-block-vmdk-Change-extent-info-type.patch [bz#1860292] +- kvm-block-Split-BlockNodeInfo-off-of-ImageInfo.patch [bz#1860292] +- kvm-qemu-img-Use-BlockNodeInfo.patch [bz#1860292] +- kvm-block-qapi-Let-bdrv_query_image_info-recurse.patch [bz#1860292] +- kvm-block-qapi-Introduce-BlockGraphInfo.patch [bz#1860292] +- kvm-block-qapi-Add-indentation-to-bdrv_node_info_dump.patch [bz#1860292] +- kvm-iotests-Filter-child-node-information.patch [bz#1860292] +- kvm-iotests-106-214-308-Read-only-one-size-line.patch [bz#1860292] +- kvm-qemu-img-Let-info-print-block-graph.patch [bz#1860292] +- kvm-qemu-img-Change-info-key-names-for-protocol-nodes.patch [bz#1860292] +- kvm-Revert-vhost-user-Monitor-slave-channel-in-vhost_use.patch [bz#2155173] +- kvm-Revert-vhost-user-Introduce-nested-event-loop-in-vho.patch [bz#2155173] +- kvm-virtio-rng-pci-fix-transitional-migration-compat-for.patch [bz#2162569] +- Resolves: bz#2150180 + (qemu-img finishes successfully while having errors in commit or bitmaps operations) +- Resolves: bz#2165280 + ([kvm-unit-tests] debug-wp-migration fails) +- Resolves: bz#1860292 + (RFE: add extent_size_hint information to qemu-img info) +- Resolves: bz#2155173 + ([vhost-user] unable to start vhost net: 71: falling back on userspace) +- Resolves: bz#2162569 + ([transitional device][virtio-rng-pci-transitional]Stable Guest ABI failed between RHEL 8.6 to RHEL 9.2) + +* Mon Feb 06 2023 Miroslav Rezanina - 7.2.0-7 +- kvm-vdpa-use-v-shadow_vqs_enabled-in-vhost_vdpa_svqs_sta.patch [bz#2104412] +- kvm-vhost-set-SVQ-device-call-handler-at-SVQ-start.patch [bz#2104412] +- kvm-vhost-allocate-SVQ-device-file-descriptors-at-device.patch [bz#2104412] +- kvm-vhost-move-iova_tree-set-to-vhost_svq_start.patch [bz#2104412] +- kvm-vdpa-add-vhost_vdpa_net_valid_svq_features.patch [bz#2104412] +- kvm-vdpa-request-iova_range-only-once.patch [bz#2104412] +- kvm-vdpa-move-SVQ-vring-features-check-to-net.patch [bz#2104412] +- kvm-vdpa-allocate-SVQ-array-unconditionally.patch [bz#2104412] +- kvm-vdpa-add-asid-parameter-to-vhost_vdpa_dma_map-unmap.patch [bz#2104412] +- kvm-vdpa-store-x-svq-parameter-in-VhostVDPAState.patch [bz#2104412] +- kvm-vdpa-add-shadow_data-to-vhost_vdpa.patch [bz#2104412] +- kvm-vdpa-always-start-CVQ-in-SVQ-mode-if-possible.patch [bz#2104412] +- kvm-vdpa-fix-VHOST_BACKEND_F_IOTLB_ASID-flag-check.patch [bz#2104412] +- kvm-spec-Disable-VDUSE.patch [bz#2128222] +- Resolves: bz#2104412 + (vDPA ASID support in Qemu) +- Resolves: bz#2128222 + (VDUSE block export should be disabled in builds for now) + +* Mon Jan 30 2023 Miroslav Rezanina - 7.2.0-6 +- kvm-virtio_net-Modify-virtio_net_get_config-to-early-ret.patch [bz#2141088] +- kvm-virtio_net-copy-VIRTIO_NET_S_ANNOUNCE-if-device-mode.patch [bz#2141088] +- kvm-vdpa-handle-VIRTIO_NET_CTRL_ANNOUNCE-in-vhost_vdpa_n.patch [bz#2141088] +- kvm-vdpa-do-not-handle-VIRTIO_NET_F_GUEST_ANNOUNCE-in-vh.patch [bz#2141088] +- kvm-s390x-pv-Implement-a-CGS-check-helper.patch [bz#2122523] +- kvm-s390x-pci-coalesce-unmap-operations.patch [bz#2163701] +- kvm-s390x-pci-shrink-DMA-aperture-to-be-bound-by-vfio-DM.patch [bz#2163701] +- kvm-s390x-pci-reset-ISM-passthrough-devices-on-shutdown-.patch [bz#2163701] +- kvm-qga-linux-add-usb-support-to-guest-get-fsinfo.patch [bz#2149191] +- Resolves: bz#2141088 + (vDPA SVQ guest announce support) +- Resolves: bz#2122523 + (Secure guest can't boot with maximal number of vcpus (248)) +- Resolves: bz#2163701 + ([s390x] VM fails to start with ISM passed through) +- Resolves: bz#2149191 + ([RFE][guest-agent] - USB bus type support) + +* Tue Jan 17 2023 Miroslav Rezanina - 7.2.0-5 +- kvm-virtio-introduce-macro-VIRTIO_CONFIG_IRQ_IDX.patch [bz#1905805] +- kvm-virtio-pci-decouple-notifier-from-interrupt-process.patch [bz#1905805] +- kvm-virtio-pci-decouple-the-single-vector-from-the-inter.patch [bz#1905805] +- kvm-vhost-introduce-new-VhostOps-vhost_set_config_call.patch [bz#1905805] +- kvm-vhost-vdpa-add-support-for-config-interrupt.patch [bz#1905805] +- kvm-virtio-add-support-for-configure-interrupt.patch [bz#1905805] +- kvm-vhost-add-support-for-configure-interrupt.patch [bz#1905805] +- kvm-virtio-net-add-support-for-configure-interrupt.patch [bz#1905805] +- kvm-virtio-mmio-add-support-for-configure-interrupt.patch [bz#1905805] +- kvm-virtio-pci-add-support-for-configure-interrupt.patch [bz#1905805] +- kvm-s390x-s390-virtio-ccw-Activate-zPCI-features-on-s390.patch [bz#2159408] +- kvm-vhost-fix-vq-dirty-bitmap-syncing-when-vIOMMU-is-ena.patch [bz#2124856] +- kvm-block-drop-bdrv_remove_filter_or_cow_child.patch [bz#2155112] +- kvm-qed-Don-t-yield-in-bdrv_qed_co_drain_begin.patch [bz#2155112] +- kvm-test-bdrv-drain-Don-t-yield-in-.bdrv_co_drained_begi.patch [bz#2155112] +- kvm-block-Revert-.bdrv_drained_begin-end-to-non-coroutin.patch [bz#2155112] +- kvm-block-Remove-drained_end_counter.patch [bz#2155112] +- kvm-block-Inline-bdrv_drain_invoke.patch [bz#2155112] +- kvm-block-Fix-locking-for-bdrv_reopen_queue_child.patch [bz#2155112] +- kvm-block-Drain-individual-nodes-during-reopen.patch [bz#2155112] +- kvm-block-Don-t-use-subtree-drains-in-bdrv_drop_intermed.patch [bz#2155112] +- kvm-stream-Replace-subtree-drain-with-a-single-node-drai.patch [bz#2155112] +- kvm-block-Remove-subtree-drains.patch [bz#2155112] +- kvm-block-Call-drain-callbacks-only-once.patch [bz#2155112] +- kvm-block-Remove-ignore_bds_parents-parameter-from-drain.patch [bz#2155112] +- kvm-block-Drop-out-of-coroutine-in-bdrv_do_drained_begin.patch [bz#2155112] +- kvm-block-Don-t-poll-in-bdrv_replace_child_noperm.patch [bz#2155112] +- kvm-block-Remove-poll-parameter-from-bdrv_parent_drained.patch [bz#2155112] +- kvm-accel-introduce-accelerator-blocker-API.patch [bz#1979276] +- kvm-KVM-keep-track-of-running-ioctls.patch [bz#1979276] +- kvm-kvm-Atomic-memslot-updates.patch [bz#1979276] +- Resolves: bz#1905805 + (support config interrupt in vhost-vdpa qemu) +- Resolves: bz#2159408 + ([s390x] VMs with ISM passthrough don't autostart after leapp upgrade from RHEL 8) +- Resolves: bz#2124856 + (VM with virtio interface and iommu=on will crash when try to migrate) +- Resolves: bz#2155112 + (Qemu coredump after do snapshot of mirrored top image and its converted base image(iothread enabled)) +- Resolves: bz#1979276 + (SVM: non atomic memslot updates cause boot failure with seabios and cpu-pm=on) + +* Thu Jan 12 2023 Miroslav Rezanina - 7.2.0-4 +- kvm-virtio-rng-pci-fix-migration-compat-for-vectors.patch [bz#2155749] +- kvm-Update-QGA-service-for-new-command-line.patch [bz#2156515] +- Resolves: bz#2155749 + ([regression][stable guest abi][qemu-kvm7.2]Migration failed due to virtio-rng device between RHEL8.8 and RHEL9.2/MSI-X) +- Resolves: bz#2156515 + ([guest-agent] Replace '-blacklist' to '-block-rpcs' in qemu-ga config file) + +* Wed Jan 04 2023 Miroslav Rezanina - 7.2.0-3 +- kvm-hw-arm-virt-Introduce-virt_set_high_memmap-helper.patch [bz#2113840] +- kvm-hw-arm-virt-Rename-variable-size-to-region_size-in-v.patch [bz#2113840] +- kvm-hw-arm-virt-Introduce-variable-region_base-in-virt_s.patch [bz#2113840] +- kvm-hw-arm-virt-Introduce-virt_get_high_memmap_enabled-h.patch [bz#2113840] +- kvm-hw-arm-virt-Improve-high-memory-region-address-assig.patch [bz#2113840] +- kvm-hw-arm-virt-Add-compact-highmem-property.patch [bz#2113840] +- kvm-hw-arm-virt-Add-properties-to-disable-high-memory-re.patch [bz#2113840] +- kvm-hw-arm-virt-Enable-compat-high-memory-region-address.patch [bz#2113840] +- Resolves: bz#2113840 + ([RHEL9.2] Memory mapping optimization for virt machine) + +* Tue Dec 20 2022 Miroslav Rezanina - 7.2.0-2 +- Fix updating from 7.1.0 +- kvm-redhat-fix-virt-rhel9.2.0-compat-props.patch[bz#2154640] +- Resolves: bz#2154640 + ([aarch64] qemu fails to load "efi-virtio.rom" romfile when creating virtio-net-pci) + +* Thu Dec 15 2022 Miroslav Rezanina - 7.2.0-1 +- Rebase to QEMU 7.2.0 [bz#2135806] +- Resolves: bz#2135806 + (Rebase to QEMU 7.2 for RHEL 9.2.0) + +* Wed Dec 14 2022 Jon Maloy - 7.1.0-7 +- kvm-hw-acpi-erst.c-Fix-memory-handling-issues.patch [bz#2149108] +- Resolves: bz#2149108 + (CVE-2022-4172 qemu-kvm: QEMU: ACPI ERST: memory corruption issues in read_erst_record and write_erst_record [rhel-9]) + +* Fri Dec 02 2022 Miroslav Rezanina - 7.1.0-6 +- kvm-block-move-bdrv_qiov_is_aligned-to-file-posix.patch [bz#2143170] +- kvm-block-use-the-request-length-for-iov-alignment.patch [bz#2143170] +- Resolves: bz#2143170 + (The installation can not start when install files (iso) locate on a 4k disk) + +* Mon Nov 14 2022 Miroslav Rezanina - 7.1.0-5 +- kvm-rtl8139-Remove-unused-variable.patch [bz#2141218] +- kvm-qemu-img-remove-unused-variable.patch [bz#2141218] +- kvm-host-libusb-Remove-unused-variable.patch [bz#2141218] +- Resolves: bz#2141218 + (qemu-kvm build fails with clang 15.0.1 due to false unused variable error) + +* Tue Nov 01 2022 Miroslav Rezanina - 7.1.0-4 +- kvm-Revert-intel_iommu-Fix-irqchip-X2APIC-configuration-.patch [bz#2126095] +- Resolves: bz#2126095 + ([rhel9.2][intel_iommu]Booting guest with "-device intel-iommu,intremap=on,device-iotlb=on,caching-mode=on" causes kernel call trace) + +* Thu Oct 13 2022 Jon Maloy - 7.1.0-3 +- kvm-target-i386-kvm-fix-kvmclock_current_nsec-Assertion-.patch [bz#2108531] +- Resolves: bz#2108531 + (Windows guest reboot after migration with wsl2 installed inside) + +* Thu Sep 29 2022 Miroslav Rezanina - 7.1.0-2 +- kvm-vdpa-Skip-the-maps-not-in-the-iova-tree.patch [RHELX-57] +- kvm-vdpa-do-not-save-failed-dma-maps-in-SVQ-iova-tree.patch [RHELX-57] +- kvm-util-accept-iova_tree_remove_parameter-by-value.patch [RHELX-57] +- kvm-vdpa-Remove-SVQ-vring-from-iova_tree-at-shutdown.patch [RHELX-57] +- kvm-vdpa-Make-SVQ-vring-unmapping-return-void.patch [RHELX-57] +- kvm-vhost-Always-store-new-kick-fd-on-vhost_svq_set_svq_.patch [RHELX-57] +- kvm-vdpa-Use-ring-hwaddr-at-vhost_vdpa_svq_unmap_ring.patch [RHELX-57] +- kvm-vhost-stop-transfer-elem-ownership-in-vhost_handle_g.patch [RHELX-57] +- kvm-vhost-use-SVQ-element-ndescs-instead-of-opaque-data-.patch [RHELX-57] +- kvm-vhost-Delete-useless-read-memory-barrier.patch [RHELX-57] +- kvm-vhost-Do-not-depend-on-NULL-VirtQueueElement-on-vhos.patch [RHELX-57] +- kvm-vhost_net-Add-NetClientInfo-start-callback.patch [RHELX-57] +- kvm-vhost_net-Add-NetClientInfo-stop-callback.patch [RHELX-57] +- kvm-vdpa-add-net_vhost_vdpa_cvq_info-NetClientInfo.patch [RHELX-57] +- kvm-vdpa-Move-command-buffers-map-to-start-of-net-device.patch [RHELX-57] +- kvm-vdpa-extract-vhost_vdpa_net_cvq_add-from-vhost_vdpa_.patch [RHELX-57] +- kvm-vhost_net-add-NetClientState-load-callback.patch [RHELX-57] +- kvm-vdpa-Add-virtio-net-mac-address-via-CVQ-at-start.patch [RHELX-57] +- kvm-vdpa-Delete-CVQ-migration-blocker.patch [RHELX-57] +- kvm-vdpa-Make-VhostVDPAState-cvq_cmd_in_buffer-control-a.patch [RHELX-57] +- kvm-vdpa-extract-vhost_vdpa_net_load_mac-from-vhost_vdpa.patch [RHELX-57] +- kvm-vdpa-Add-vhost_vdpa_net_load_mq.patch [RHELX-57] +- kvm-vdpa-validate-MQ-CVQ-commands.patch [RHELX-57] +- kvm-virtio-net-Update-virtio-net-curr_queue_pairs-in-vdp.patch [RHELX-57] +- kvm-vdpa-Allow-MQ-feature-in-SVQ.patch [RHELX-57] +- kvm-i386-reset-KVM-nested-state-upon-CPU-reset.patch [bz#2125281] +- kvm-i386-do-kvm_put_msr_feature_control-first-thing-when.patch [bz#2125281] +- kvm-Revert-Re-enable-capstone-internal-build.patch [bz#2127825] +- kvm-spec-Use-capstone-package.patch [bz#2127825] +- Resolves: RHELX-57 + (vDPA SVQ Multiqueue support ) +- Resolves: bz#2125281 + ([RHEL9.1] Guests in VMX root operation fail to reboot with QEMU's 'system_reset' command [rhel-9.2.0]) +- Resolves: bz#2127825 + (Use capstone for qemu-kvm build) + +* Mon Sep 05 2022 Miroslav Rezanina - 7.1.0-1 +- Rebase to QEMU 7.1.0 [bz#2111769] +- Resolves: bz#2111769 + (Rebase to QEMU 7.1.0) + +* Mon Aug 15 2022 Miroslav Rezanina - 7.0.0-11 +- kvm-QIOChannelSocket-Fix-zero-copy-flush-returning-code-.patch [bz#2107466] +- kvm-Add-dirty-sync-missed-zero-copy-migration-stat.patch [bz#2107466] +- kvm-migration-multifd-Report-to-user-when-zerocopy-not-w.patch [bz#2107466] +- kvm-migration-Avoid-false-positive-on-non-supported-scen.patch [bz#2107466] +- kvm-migration-add-remaining-params-has_-true-in-migratio.patch [bz#2107466] +- kvm-QIOChannelSocket-Add-support-for-MSG_ZEROCOPY-IPV6.patch [bz#2107466] +- kvm-pc-bios-s390-ccw-Fix-booting-with-logical-block-size.patch [bz#2112303] +- kvm-vdpa-Fix-bad-index-calculus-at-vhost_vdpa_get_vring_.patch [bz#2116876] +- kvm-vdpa-Fix-index-calculus-at-vhost_vdpa_svqs_start.patch [bz#2116876] +- kvm-vdpa-Fix-memory-listener-deletions-of-iova-tree.patch [bz#2116876] +- kvm-vdpa-Fix-file-descriptor-leak-on-get-features-error.patch [bz#2116876] +- Resolves: bz#2107466 + (zerocopy capability can be enabled when set migrate capabilities with multifd and compress/xbzrle together) +- Resolves: bz#2112303 + (virtio-blk: Can't boot fresh installation from used 512 cluster_size image under certain conditions) +- Resolves: bz#2116876 + (Fixes for vDPA control virtqueue support in Qemu) + +* Mon Aug 08 2022 Miroslav Rezanina - 7.0.0-10 +- kvm-vhost-Track-descriptor-chain-in-private-at-SVQ.patch [bz#1939363] +- kvm-vhost-Fix-device-s-used-descriptor-dequeue.patch [bz#1939363] +- kvm-hw-virtio-Replace-g_memdup-by-g_memdup2.patch [bz#1939363] +- kvm-vhost-Fix-element-in-vhost_svq_add-failure.patch [bz#1939363] +- kvm-meson-create-have_vhost_-variables.patch [bz#1939363] +- kvm-meson-use-have_vhost_-variables-to-pick-sources.patch [bz#1939363] +- kvm-vhost-move-descriptor-translation-to-vhost_svq_vring.patch [bz#1939363] +- kvm-virtio-net-Expose-MAC_TABLE_ENTRIES.patch [bz#1939363] +- kvm-virtio-net-Expose-ctrl-virtqueue-logic.patch [bz#1939363] +- kvm-vdpa-Avoid-compiler-to-squash-reads-to-used-idx.patch [bz#1939363] +- kvm-vhost-Reorder-vhost_svq_kick.patch [bz#1939363] +- kvm-vhost-Move-vhost_svq_kick-call-to-vhost_svq_add.patch [bz#1939363] +- kvm-vhost-Check-for-queue-full-at-vhost_svq_add.patch [bz#1939363] +- kvm-vhost-Decouple-vhost_svq_add-from-VirtQueueElement.patch [bz#1939363] +- kvm-vhost-Add-SVQDescState.patch [bz#1939363] +- kvm-vhost-Track-number-of-descs-in-SVQDescState.patch [bz#1939363] +- kvm-vhost-add-vhost_svq_push_elem.patch [bz#1939363] +- kvm-vhost-Expose-vhost_svq_add.patch [bz#1939363] +- kvm-vhost-add-vhost_svq_poll.patch [bz#1939363] +- kvm-vhost-Add-svq-avail_handler-callback.patch [bz#1939363] +- kvm-vdpa-Export-vhost_vdpa_dma_map-and-unmap-calls.patch [bz#1939363] +- kvm-vhost-net-vdpa-add-stubs-for-when-no-virtio-net-devi.patch [bz#1939363] +- kvm-vdpa-manual-forward-CVQ-buffers.patch [bz#1939363] +- kvm-vdpa-Buffer-CVQ-support-on-shadow-virtqueue.patch [bz#1939363] +- kvm-vdpa-Extract-get-features-part-from-vhost_vdpa_get_m.patch [bz#1939363] +- kvm-vdpa-Add-device-migration-blocker.patch [bz#1939363] +- kvm-vdpa-Add-x-svq-to-NetdevVhostVDPAOptions.patch [bz#1939363] +- kvm-redhat-Update-linux-headers-linux-kvm.h-to-v5.18-rc6.patch [bz#2111994] +- kvm-target-s390x-kvm-Honor-storage-keys-during-emulation.patch [bz#2111994] +- kvm-kvm-don-t-use-perror-without-useful-errno.patch [bz#2095608] +- kvm-multifd-Copy-pages-before-compressing-them-with-zlib.patch [bz#2099934] +- kvm-Revert-migration-Simplify-unqueue_page.patch [bz#2099934] +- Resolves: bz#1939363 + (vDPA control virtqueue support in Qemu) +- Resolves: bz#2111994 + (RHEL9: skey test in kvm_unit_test got failed) +- Resolves: bz#2095608 + (Please correct the error message when try to start qemu with "-M kernel-irqchip=split") +- Resolves: bz#2099934 + (Guest reboot on destination host after postcopy migration completed) + +* Mon Jul 18 2022 Miroslav Rezanina - 7.0.0-9 +- kvm-virtio-iommu-Add-bypass-mode-support-to-assigned-dev.patch [bz#2100106] +- kvm-virtio-iommu-Use-recursive-lock-to-avoid-deadlock.patch [bz#2100106] +- kvm-virtio-iommu-Add-an-assert-check-in-translate-routin.patch [bz#2100106] +- kvm-virtio-iommu-Fix-the-partial-copy-of-probe-request.patch [bz#2100106] +- kvm-virtio-iommu-Fix-migration-regression.patch [bz#2100106] +- kvm-pc-bios-s390-ccw-virtio-Introduce-a-macro-for-the-DA.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-bootmap-Improve-the-guessing-logic-.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-blkdev-Simplify-fix-virtio_i.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-blkdev-Remove-virtio_assume_.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-Set-missing-status-bits-whil.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-Read-device-config-after-fea.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-Beautify-the-code-for-readin.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-Split-virtio-scsi-code-from-virtio_.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-virtio-blkdev-Request-the-right-fea.patch [bz#2098077] +- kvm-pc-bios-s390-ccw-netboot.mak-Ignore-Clang-s-warnings.patch [bz#2098077] +- kvm-hw-block-fdc-Prevent-end-of-track-overrun-CVE-2021-3.patch [bz#1951522] +- kvm-tests-qtest-fdc-test-Add-a-regression-test-for-CVE-2.patch [bz#1951522] +- Resolves: bz#2100106 + (Fix virtio-iommu/vfio bypass) +- Resolves: bz#2098077 + (virtio-blk: Can't boot fresh installation from used virtio-blk dasd disk under certain conditions) +- Resolves: bz#1951522 + (CVE-2021-3507 qemu-kvm: QEMU: fdc: heap buffer overflow in DMA read data transfers [rhel-9.0]) + +* Tue Jul 05 2022 Camilla Conte - 7.0.0-8 +- kvm-tests-avocado-update-aarch64_virt-test-to-exercise-c.patch [bz#2060839] +- kvm-RHEL-only-tests-avocado-Switch-aarch64-tests-from-a5.patch [bz#2060839] +- kvm-RHEL-only-AArch64-Drop-unsupported-CPU-types.patch [bz#2060839] +- kvm-target-i386-deprecate-CPUs-older-than-x86_64-v2-ABI.patch [bz#2060839] +- kvm-target-s390x-deprecate-CPUs-older-than-z14.patch [bz#2060839] +- kvm-target-arm-deprecate-named-CPU-models.patch [bz#2060839] +- kvm-meson.build-Fix-docker-test-build-alpine-when-includ.patch [bz#1968509] +- kvm-QIOChannel-Add-flags-on-io_writev-and-introduce-io_f.patch [bz#1968509] +- kvm-QIOChannelSocket-Implement-io_writev-zero-copy-flag-.patch [bz#1968509] +- kvm-migration-Add-zero-copy-send-parameter-for-QMP-HMP-f.patch [bz#1968509] +- kvm-migration-Add-migrate_use_tls-helper.patch [bz#1968509] +- kvm-multifd-multifd_send_sync_main-now-returns-negative-.patch [bz#1968509] +- kvm-multifd-Send-header-packet-without-flags-if-zero-cop.patch [bz#1968509] +- kvm-multifd-Implement-zero-copy-write-in-multifd-migrati.patch [bz#1968509] +- kvm-QIOChannelSocket-Introduce-assert-and-reduce-ifdefs-.patch [bz#1968509] +- kvm-QIOChannelSocket-Fix-zero-copy-send-so-socket-flush-.patch [bz#1968509] +- kvm-migration-Change-zero_copy_send-from-migration-param.patch [bz#1968509] +- kvm-migration-Allow-migrate-recover-to-run-multiple-time.patch [bz#2096143] +- Resolves: bz#2060839 + (Consider deprecating CPU models like "kvm64" / "qemu64" on RHEL 9) +- Resolves: bz#1968509 + (Use MSG_ZEROCOPY on QEMU Live Migration) +- Resolves: bz#2096143 + (The migration port is not released if use it again for recovering postcopy migration) + +* Mon Jun 27 2022 Miroslav Rezanina - 7.0.0-7 +- kvm-coroutine-ucontext-use-QEMU_DEFINE_STATIC_CO_TLS.patch [bz#1952483] +- kvm-coroutine-use-QEMU_DEFINE_STATIC_CO_TLS.patch [bz#1952483] +- kvm-coroutine-win32-use-QEMU_DEFINE_STATIC_CO_TLS.patch [bz#1952483] +- kvm-Enable-virtio-iommu-pci-on-x86_64.patch [bz#2094252] +- kvm-linux-aio-fix-unbalanced-plugged-counter-in-laio_io_.patch [bz#2092788] +- kvm-linux-aio-explain-why-max-batch-is-checked-in-laio_i.patch [bz#2092788] +- Resolves: bz#1952483 + (RFE: QEMU's coroutines fail with CFLAGS=-flto on non-x86_64 architectures) +- Resolves: bz#2094252 + (Compile the virtio-iommu device on x86_64) +- Resolves: bz#2092788 + (Stalled IO Operations in VM) + +* Mon Jun 13 2022 Miroslav Rezanina - 7.0.0-6 +- kvm-Introduce-event-loop-base-abstract-class.patch [bz#2031024] +- kvm-util-main-loop-Introduce-the-main-loop-into-QOM.patch [bz#2031024] +- kvm-util-event-loop-base-Introduce-options-to-set-the-th.patch [bz#2031024] +- kvm-qcow2-Improve-refcount-structure-rebuilding.patch [bz#2072379] +- kvm-iotests-108-Test-new-refcount-rebuild-algorithm.patch [bz#2072379] +- kvm-qcow2-Add-errp-to-rebuild_refcount_structure.patch [bz#2072379] +- kvm-iotests-108-Fix-when-missing-user_allow_other.patch [bz#2072379] +- kvm-virtio-net-setup-vhost_dev-and-notifiers-for-cvq-onl.patch [bz#2070804] +- kvm-virtio-net-align-ctrl_vq-index-for-non-mq-guest-for-.patch [bz#2070804] +- kvm-vhost-vdpa-fix-improper-cleanup-in-net_init_vhost_vd.patch [bz#2070804] +- kvm-vhost-net-fix-improper-cleanup-in-vhost_net_start.patch [bz#2070804] +- kvm-vhost-vdpa-backend-feature-should-set-only-once.patch [bz#2070804] +- kvm-vhost-vdpa-change-name-and-polarity-for-vhost_vdpa_o.patch [bz#2070804] +- kvm-virtio-net-don-t-handle-mq-request-in-userspace-hand.patch [bz#2070804] +- kvm-Revert-globally-limit-the-maximum-number-of-CPUs.patch [bz#2094270] +- kvm-vfio-common-remove-spurious-warning-on-vfio_listener.patch [bz#2086262] +- Resolves: bz#2031024 + (Add support for fixing thread pool size [QEMU]) +- Resolves: bz#2072379 + (Fail to rebuild the reference count tables of qcow2 image on host block devices (e.g. LVs)) +- Resolves: bz#2070804 + (PXE boot crash qemu when using multiqueue vDPA) +- Resolves: bz#2094270 + (Do not set the hard vCPU limit to the soft vCPU limit in downstream qemu-kvm anymore) +- Resolves: bz#2086262 + ([Win11][tpm]vfio_listener_region_del received unaligned region) + +* Mon May 30 2022 Miroslav Rezanina - 7.0.0-5 +- kvm-qemu-nbd-Pass-max-connections-to-blockdev-layer.patch [bz#1708300] +- kvm-nbd-server-Allow-MULTI_CONN-for-shared-writable-expo.patch [bz#1708300] +- Resolves: bz#1708300 + (RFE: qemu-nbd vs NBD_FLAG_CAN_MULTI_CONN) + +* Thu May 19 2022 Miroslav Rezanina - 7.0.0-4 +- kvm-qapi-machine.json-Add-cluster-id.patch [bz#2041823] +- kvm-qtest-numa-test-Specify-CPU-topology-in-aarch64_numa.patch [bz#2041823] +- kvm-hw-arm-virt-Consider-SMP-configuration-in-CPU-topolo.patch [bz#2041823] +- kvm-qtest-numa-test-Correct-CPU-and-NUMA-association-in-.patch [bz#2041823] +- kvm-hw-arm-virt-Fix-CPU-s-default-NUMA-node-ID.patch [bz#2041823] +- kvm-hw-acpi-aml-build-Use-existing-CPU-topology-to-build.patch [bz#2041823] +- kvm-coroutine-Rename-qemu_coroutine_inc-dec_pool_size.patch [bz#2079938] +- kvm-coroutine-Revert-to-constant-batch-size.patch [bz#2079938] +- kvm-virtio-scsi-fix-ctrl-and-event-handler-functions-in-.patch [bz#2079347] +- kvm-virtio-scsi-don-t-waste-CPU-polling-the-event-virtqu.patch [bz#2079347] +- kvm-virtio-scsi-clean-up-virtio_scsi_handle_event_vq.patch [bz#2079347] +- kvm-virtio-scsi-clean-up-virtio_scsi_handle_ctrl_vq.patch [bz#2079347] +- kvm-virtio-scsi-clean-up-virtio_scsi_handle_cmd_vq.patch [bz#2079347] +- kvm-virtio-scsi-move-request-related-items-from-.h-to-.c.patch [bz#2079347] +- kvm-Revert-virtio-scsi-Reject-scsi-cd-if-data-plane-enab.patch [bz#1995710] +- kvm-migration-Fix-operator-type.patch [bz#2064530] +- Resolves: bz#2041823 + ([aarch64][numa] When there are at least 6 Numa nodes serial log shows 'arch topology borken') +- Resolves: bz#2079938 + (qemu coredump when boot with multi disks (qemu) failed to set up stack guard page: Cannot allocate memory) +- Resolves: bz#2079347 + (Guest boot blocked when scsi disks using same iothread and 100% CPU consumption) +- Resolves: bz#1995710 + (RFE: Allow virtio-scsi CD-ROM media change with IOThreads) +- Resolves: bz#2064530 + (Rebuild qemu-kvm with clang-14) + +* Thu May 12 2022 Miroslav Rezanina - 7.0.0-3 +- kvm-hw-arm-virt-Remove-the-dtb-kaslr-seed-machine-option.patch [bz#2046029] +- kvm-hw-arm-virt-Fix-missing-initialization-in-instance-c.patch [bz#2046029] +- kvm-Enable-virtio-iommu-pci-on-aarch64.patch [bz#1477099] +- kvm-sysemu-tpm-Add-a-stub-function-for-TPM_IS_CRB.patch [bz#2037612] +- kvm-vfio-common-remove-spurious-tpm-crb-cmd-misalignment.patch [bz#2037612] +- Resolves: bz#2046029 + ([WRB] New machine type property - dtb-kaslr-seed) +- Resolves: bz#1477099 + (virtio-iommu (including ACPI, VHOST/VFIO integration, migration support)) +- Resolves: bz#2037612 + ([Win11][tpm][QL41112 PF] vfio_listener_region_add received unaligned region) + +* Fri May 06 2022 Miroslav Rezanina - 7.0.0-2 +- kvm-configs-devices-aarch64-softmmu-Enable-CONFIG_VIRTIO.patch [bz#2044162] +- kvm-target-ppc-cpu-models-Fix-ppc_cpu_aliases-list-for-R.patch [bz#2081022] +- Resolves: bz#2044162 + ([RHEL9.1] Enable virtio-mem as tech-preview on ARM64 QEMU) +- Resolves: bz#2081022 + (Build regression on ppc64le with c9s qemu-kvm 7.0.0-1 changes) + +* Wed Apr 20 2022 Miroslav Rezanina - 7.0.0-1 +- Rebase to QEMU 7.0.0 [bz#2064757] +- Do not build ssh block driver anymore [bz#2064500] +- Removed hpet and parallel port support [bz#2065042] +- Compatibility support [bz#2064782 bz#2064771] +- Resolves: bz#2064757 + (Rebase to QEMU 7.0.0) +- Resolves: bz#2064500 + (Install qemu-kvm-6.2.0-11.el9_0.1 failed as conflict with qemu-kvm-block-ssh-6.2.0-11.el9_0.1) +- Resolves: bz#2065042 + (Remove upstream-only devices from the qemu-kvm binary) +- Resolves: bz#2064782 + (Update machine type compatibility for QEMU 7.0.0 update [s390x]) +- Resolves: bz#2064771 + (Update machine type compatibility for QEMU 7.0.0 update [x86_64]) + +* Thu Apr 14 2022 Miroslav Rezanina - 6.2.0-13 +- kvm-RHEL-disable-seqpacket-for-vhost-vsock-device-in-rhe.patch [bz#2065589] +- Resolves: bz#2065589 + (RHEL 9.0 guest with vsock device migration failed from RHEL 9.0 > RHEL 8.6 [rhel-9.1.0]) + +* Mon Mar 21 2022 Miroslav Rezanina - 6.2.0-12 +- kvm-RHEL-mark-old-machine-types-as-deprecated.patch [bz#2062813] +- kvm-hw-virtio-vdpa-Fix-leak-of-host-notifier-memory-regi.patch [bz#2062828] +- kvm-spec-Fix-obsolete-for-spice-subpackages.patch [bz#2062819 bz#2062817] +- kvm-spec-Obsolete-old-usb-redir-subpackage.patch [bz#2062819] +- kvm-spec-Obsolete-ssh-driver.patch [bz#2062817] +- Resolves: bz#2062828 + ([virtual network][rhel9][vDPA] qemu crash after hot unplug vdpa device [rhel-9.1.0]) +- Resolves: bz#2062819 + (Broken upgrade path due to qemu-kvm-hw-usbredir rename [rhel-9.1.0]) +- Resolves: bz#2062817 + (Missing qemu-kvm-block-ssh obsolete breaks upgrade path [rhel-9.1.0]) +- Resolves: bz#2062813 + (Mark all RHEL-8 and earlier machine types as deprecated [rhel-9.1.0]) + +* Tue Mar 01 2022 Miroslav Rezanina - 6.2.0-11 +- kvm-spec-Remove-qemu-virtiofsd.patch [bz#2055284] +- Resolves: bz#2055284 + (Remove the qemu-virtiofsd subpackage) + +* Thu Feb 24 2022 Miroslav Rezanina - 6.2.0-10 +- kvm-Revert-ui-clipboard-Don-t-use-g_autoptr-just-to-free.patch [bz#2042820] +- kvm-ui-avoid-compiler-warnings-from-unused-clipboard-inf.patch [bz#2042820] +- kvm-ui-clipboard-fix-use-after-free-regression.patch [bz#2042820] +- kvm-ui-vnc.c-Fixed-a-deadlock-bug.patch [bz#2042820] +- kvm-memory-Fix-incorrect-calls-of-log_global_start-stop.patch [bz#2044818] +- kvm-memory-Fix-qemu-crash-on-starting-dirty-log-twice-wi.patch [bz#2044818] +- Resolves: bz#2042820 + (qemu crash when try to copy and paste contents from client to VM) +- Resolves: bz#2044818 + (Qemu Core Dumped when migrate -> migrate_cancel -> migrate again during guest is paused) + +* Thu Feb 17 2022 Miroslav Rezanina - 6.2.0-9 +- kvm-block-Lock-AioContext-for-drain_end-in-blockdev-reop.patch [bz#2046659] +- kvm-iotests-Test-blockdev-reopen-with-iothreads-and-thro.patch [bz#2046659] +- kvm-block-nbd-Delete-reconnect-delay-timer-when-done.patch [bz#2033626] +- kvm-block-nbd-Assert-there-are-no-timers-when-closed.patch [bz#2033626] +- kvm-iotests.py-Add-QemuStorageDaemon-class.patch [bz#2033626] +- kvm-iotests-281-Test-lingering-timers.patch [bz#2033626] +- kvm-block-nbd-Move-s-ioc-on-AioContext-change.patch [bz#2033626] +- kvm-iotests-281-Let-NBD-connection-yield-in-iothread.patch [bz#2033626] +- Resolves: bz#2046659 + (qemu crash after execute blockdev-reopen with iothread) +- Resolves: bz#2033626 + (Qemu core dump when start guest with nbd node or do block jobs to nbd node) + +* Mon Feb 14 2022 Miroslav Rezanina - 6.2.0-8 +- kvm-numa-Enable-numa-for-SGX-EPC-sections.patch [bz#2033708] +- kvm-numa-Support-SGX-numa-in-the-monitor-and-Libvirt-int.patch [bz#2033708] +- kvm-doc-Add-the-SGX-numa-description.patch [bz#2033708] +- kvm-Enable-SGX-RH-Only.patch [bz#2033708] +- kvm-qapi-Cleanup-SGX-related-comments-and-restore-sectio.patch [bz#2033708] +- kvm-block-io-Update-BSC-only-if-want_zero-is-true.patch [bz#2041461] +- kvm-iotests-block-status-cache-New-test.patch [bz#2041461] +- kvm-iotests-Test-qemu-img-convert-of-zeroed-data-cluster.patch [bz#1882917] +- kvm-qemu-img-make-is_allocated_sectors-more-efficient.patch [bz#1882917] +- kvm-block-backend-prevent-dangling-BDS-pointers-across-a.patch [bz#2040123] +- kvm-iotests-stream-error-on-reset-New-test.patch [bz#2040123] +- kvm-hw-arm-smmuv3-Fix-device-reset.patch [bz#2042481] +- Resolves: bz#2033708 + ([Intel 9.0 Feat] qemu-kvm: SGX 1.5 (SGX1 + Flexible Launch Control) support) +- Resolves: bz#2041461 + (Inconsistent block status reply in qemu-nbd) +- Resolves: bz#1882917 + (the target image size is incorrect when converting a badly fragmented file) +- Resolves: bz#2040123 + (Qemu core dumped when do block-stream to a snapshot node on non-enough space storage) +- Resolves: bz#2042481 + ([aarch64] Launch guest with "default-bus-bypass-iommu=off,iommu=smmuv3" and "iommu_platform=on", guest hangs after system_reset) + +* Mon Feb 07 2022 Miroslav Rezanina - 6.2.0-7 +- kvm-qemu-storage-daemon-Add-vhost-user-blk-help.patch [bz#1962088] +- kvm-qemu-storage-daemon-Fix-typo-in-vhost-user-blk-help.patch [bz#1962088] +- kvm-virtiofsd-Drop-membership-of-all-supplementary-group.patch [bz#2046201] +- kvm-block-rbd-fix-handling-of-holes-in-.bdrv_co_block_st.patch [bz#2034791] +- kvm-block-rbd-workaround-for-ceph-issue-53784.patch [bz#2034791] +- Resolves: bz#1962088 + ([QSD] wrong help message for the fuse) +- Resolves: bz#2046201 + (CVE-2022-0358 qemu-kvm: QEMU: virtiofsd: potential privilege escalation via CVE-2018-13405 [rhel-9.0]) +- Resolves: bz#2034791 + (Booting from Local Snapshot Core Dumped Whose Backing File Is Based on RBD) + +* Wed Feb 02 2022 Miroslav Rezanina - 6.2.0-6 +- Moving feature support out of qemu-kvm-core to separate packages (can + cause loss of functionality when using only qemu-kvm-core - qemu-kvm keeps + same feature set). +- kvm-spec-Rename-qemu-kvm-hw-usbredir-to-qemu-kvm-device-.patch [bz#2022847] +- kvm-spec-Split-qemu-kvm-ui-opengl.patch [bz#2022847] +- kvm-spec-Introduce-packages-for-virtio-gpu-modules.patch [bz#2022847] +- kvm-spec-Introduce-device-display-virtio-vga-packages.patch [bz#2022847] +- kvm-spec-Move-usb-host-module-to-separate-package.patch [bz#2022847] +- kvm-spec-Move-qtest-accel-module-to-tests-package.patch [bz#2022847] +- kvm-spec-Extend-qemu-kvm-core-description.patch [bz#2022847] +- Resolves: bz#2022847 + (qemu-kvm: Align package split with Fedora) + +* Tue Jan 25 2022 Miroslav Rezanina - 6.2.0-5 +- kvm-x86-Add-q35-RHEL-8.6.0-machine-type.patch [bz#1945666] +- kvm-x86-Add-q35-RHEL-9.0.0-machine-type.patch [bz#1945666] +- kvm-softmmu-fix-device-deletion-events-with-device-JSON-.patch [bz#2036669] +- Resolves: bz#1945666 + (9.0: x86 machine types) +- Resolves: bz#2036669 + (DEVICE_DELETED event is not delivered for device frontend if -device is configured via JSON) + +* Mon Jan 17 2022 Miroslav Rezanina - 6.2.0-4 +- kvm-block-nvme-fix-infinite-loop-in-nvme_free_req_queue_.patch [bz#2024544] +- kvm-rhel-machine-types-x86-set-prefer_sockets.patch [bz#2028623] +- Resolves: bz#2024544 + (Fio workers hangs when running fio with 32 jobs iodepth 32 and QEMU's userspace NVMe driver) +- Resolves: bz#2028623 + ([9.0] machine types: 6.2: Fix prefer_sockets) + +* Mon Jan 10 2022 Miroslav Rezanina - 6.2.0-3 +- kvm-hw-arm-virt-Register-iommu-as-a-class-property.patch [bz#2031044] +- kvm-hw-arm-virt-Register-its-as-a-class-property.patch [bz#2031044] +- kvm-hw-arm-virt-Rename-default_bus_bypass_iommu.patch [bz#2031044] +- kvm-hw-arm-virt-Expose-the-RAS-option.patch [bz#2031044] +- kvm-hw-arm-virt-Add-9.0-machine-type-and-remove-8.5-one.patch [bz#2031044] +- kvm-hw-arm-virt-Check-no_tcg_its-and-minor-style-changes.patch [bz#2031044] +- Resolves: bz#2031044 + (Add rhel-9.0.0 machine types for RHEL 9.0 [aarch64]) + +* Fri Jan 07 2022 Miroslav Rezanina - 6.2.0-2 +- kvm-redhat-Add-rhel8.6.0-and-rhel9.0.0-machine-types-for.patch [bz#2008060] +- kvm-redhat-Enable-virtio-mem-as-tech-preview-on-x86-64.patch [bz#2014484] +- Resolves: bz#2008060 + (Fix CPU Model for new IBM Z Hardware - qemu part) +- Resolves: bz#2014484 + ([RHEL9] Enable virtio-mem as tech-preview on x86-64 - QEMU) + +* Thu Dec 16 2021 Miroslav Rezanina - 6.2.0-1 +- Rebase to QEMU 6.2.0 [bz#2027697] +- Resolves: bz#2027697 + (Rebase to QEMU 6.2.0) + +* Wed Nov 24 2021 Miroslav Rezanina - 6.1.0-8 +- kvm-Move-ksmtuned-files-to-separate-package.patch [bz#1971678] +- Resolves: bz#1971678 + (Split out ksmtuned package from qemu-kvm) + +* Fri Nov 19 2021 Miroslav Rezanina - 6.1.0-7 +- kvm-migration-Make-migration-blocker-work-for-snapshots-.patch [bz#1996609] +- kvm-migration-Add-migrate_add_blocker_internal.patch [bz#1996609] +- kvm-dump-guest-memory-Block-live-migration.patch [bz#1996609] +- kvm-spec-Build-the-VDI-block-driver.patch [bz#2013331] +- kvm-spec-Explicitly-include-compress-filter.patch [bz#1980035] +- Resolves: bz#1996609 + (Qemu hit core dump when dump guest memory during live migration) +- Resolves: bz#2013331 + (RFE: qemu-img cannot convert from vdi format) +- Resolves: bz#1980035 + (RFE: Enable compress filter so we can create new, compressed qcow2 files via qemu-nbd) + +* Mon Oct 18 2021 Miroslav Rezanina - 6.1.0-6 +- kvm-hw-arm-virt-Add-hw_compat_rhel_8_5-to-8.5-machine-ty.patch [bz#1998942] +- Resolves: bz#1998942 + (Add machine type compatibility update for 6.1 rebase [aarch64]) + +* Mon Oct 11 2021 Miroslav Rezanina - 6.1.0-5 +- kvm-virtio-balloon-Fix-page-poison-subsection-name.patch [bz#1984401] +- kvm-spec-Remove-block-curl-and-block-ssh-dependency.patch [bz#2010985] +- Resolves: bz#1984401 + (fails to revert snapshot of a VM [balloon/page-poison]) +- Resolves: bz#2010985 + (Remove dependency on qemu-kvm-block-curl and qemu-kvm-block-ssh [rhel-9.0.0]) + +* Tue Oct 05 2021 Miroslav Rezanina - 6.1.0-4 +- kvm-redhat-Define-hw_compat_rhel_8_5.patch [bz#1998943] +- kvm-redhat-Add-s390x-machine-type-compatibility-update-f.patch [bz#1998943] +- Resolves: bz#1998943 + (Add machine type compatibility update for 6.1 rebase [s390x]) + +* Fri Sep 24 2021 Miroslav Rezanina - 6.1.0-3 +- kvm-disable-sga-device.patch [bz#2000845] +- kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch [bz#2005026] +- Resolves: bz#2000845 + (RFE: Remove SGA, deprecate cirrus, and set defaults for QEMU machine-types in RHEL9) +- Resolves: bz#2005026 + ([s390][virtio-fs] Umount virtiofs shared folder failure from guest side [rhel-9.0.0]) + +* Fri Sep 10 2021 Miroslav Rezanina - 6.1.0-2 +- kvm-hw-arm-virt-Remove-9.0-machine-type.patch [bz#2002937] +- kvm-remove-sgabios-dependency.patch [bz#2000845] +- kvm-enable-pulseaudio.patch [bz#1997725] +- kvm-spec-disable-use-of-gcrypt-for-crypto-backends-in-fa.patch [bz#1990068] +- Resolves: bz#2002937 + ([qemu][aarch64] Remove 9.0 machine types in arm virt for 9-Beta) +- Resolves: bz#2000845 + (RFE: Remove SGA, deprecate cirrus, and set defaults for QEMU machine-types in RHEL9) +- Resolves: bz#1997725 + (RFE: enable pulseaudio backend on QEMU) +- Resolves: bz#1990068 + (Disable use of gcrypt for crypto backends in favour of gnutls) + +* Thu Sep 02 2021 Miroslav Rezanina - 6.1.0-1 +- Rebase to QEMU 6.1.0 [bz#1997408] +- Resolves: #bz#1997408 + (Rebase to QEMU 6.1.0) + +* Fri Aug 27 2021 Miroslav Rezanina - 6.0.0-13 +- kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch [bz#1951814] +- kvm-disable-ac97-audio.patch [bz#1995819] +- kvm-redhat-Disable-LTO-on-non-x86-architectures.patch [bz#1950192] +- kvm-redhat-Enable-the-test-block-iothread-test-again.patch [bz#1950192] +- Resolves: bz#1951814 + (RFE: Warning when using qcow2-v2 (compat=0.10)) +- Resolves: bz#1995819 + (RFE: Remove ac97 audio support from QEMU) +- Resolves: bz#1950192 + (RHEL9: when ioeventfd=off and 8.4guest, (qemu) qemu-kvm: ../util/qemu-coroutine-lock.c:57: qemu_co_queue_wait_impl: Assertion `qemu_in_coroutine()' failed.) + +* Fri Aug 20 2021 Miroslav Rezanina - 6.0.0-12.el9 +- kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch [bz#1974683] +- kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch [bz#1974683] +- kvm-Remove-RHEL-7.0.0-machine-type.patch [bz#1968519] +- kvm-Remove-RHEL-7.1.0-machine-type.patch [bz#1968519] +- kvm-Remove-RHEL-7.2.0-machine-type.patch [bz#1968519] +- kvm-Remove-RHEL-7.3.0-machine-types.patch [bz#1968519] +- kvm-Remove-RHEL-7.4.0-machine-types.patch [bz#1968519] +- kvm-Remove-RHEL-7.5.0-machine-types.patch [bz#1968519] +- kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch [bz#1957194] +- kvm-migration-failover-reset-partially_hotplugged.patch [bz#1957194] +- kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch [bz#1957194] +- kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch [bz#1957194] +- kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch [bz#1957194] +- kvm-ratelimit-protect-with-a-mutex.patch [bz#1957194] +- kvm-Update-Linux-headers-to-5.13-rc4.patch [bz#1957194] +- kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch [bz#1957194] +- kvm-iothread-generalize-iothread_set_param-iothread_get_.patch [bz#1957194] +- kvm-iothread-add-aio-max-batch-parameter.patch [bz#1957194] +- kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch [bz#1957194] +- kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch [bz#1957194] +- kvm-migration-move-wait-unplug-loop-to-its-own-function.patch [bz#1957194] +- kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch [bz#1957194] +- kvm-aarch64-Add-USB-storage-devices.patch [bz#1957194] +- kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch [bz#1957194] +- kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch [bz#1957194] +- kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch [bz#1957194] +- kvm-audio-Never-send-migration-section.patch [bz#1957194] +- kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch [bz#1939509 bz#1940132] +- kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch [bz#1939509 bz#1940132] +- kvm-configure-Fix-endianess-test-with-LTO.patch [bz#1939509 bz#1940132] +- kvm-spec-Switch-toolchain-to-Clang-LLVM.patch [bz#1939509 bz#1940132] +- kvm-spec-Use-safe-stack-for-x86_64.patch [bz#1939509 bz#1940132] +- kvm-spec-Reenable-write-support-for-VMDK-etc.-in-tools.patch [bz#1989841] +- Resolves: bz#1974683 + (Fail to set migrate incoming for 2nd time after the first time failed) +- Resolves: bz#1968519 + (Remove all the old 7.0-7.5 machine types) +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) +- Resolves: bz#1939509 + (QEMU: enable SafeStack) +- Resolves: bz#1940132 + (QEMU: switch build toolchain to Clang/LLVM) +- Resolves: bz#1989841 + (RFE: qemu-img cannot convert images into vmdk and vpc formats) + +* Tue Aug 10 2021 Mohan Boddu - 17:6.0.0-11.1 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Sat Aug 07 2021 Miroslav Rezanina - 6.0.0-11 +- kvm-arm-virt-Register-iommu-as-a-class-property.patch [bz#1838608] +- kvm-arm-virt-Register-its-as-a-class-property.patch [bz#1838608] +- kvm-arm-virt-Enable-ARM-RAS-support.patch [bz#1838608] +- kvm-block-Fix-in_flight-leak-in-request-padding-error-pa.patch [bz#1972079] +- kvm-spec-Remove-buildldflags.patch [bz#1973029] +- kvm-spec-Use-make_build-macro.patch [bz#1973029] +- kvm-spec-Drop-make-install-sharedir-and-datadir-usage.patch [bz#1973029] +- kvm-spec-use-make_install-macro.patch [bz#1973029] +- kvm-spec-parallelize-make-check.patch [bz#1973029] +- kvm-spec-Drop-explicit-build-id.patch [bz#1973029] +- kvm-spec-use-build_ldflags.patch [bz#1973029] +- kvm-Move-virtiofsd-to-separate-package.patch [bz#1979728] +- kvm-Utilize-firmware-configure-option.patch [bz#1980139] +- Resolves: bz#1838608 + (aarch64: Enable ARMv8 RAS virtualization support) +- Resolves: bz#1972079 + (Windows Installation blocked on 4k disk when using blk+raw+iothread) +- Resolves: bz#1973029 + (Spec file cleanups) +- Resolves: bz#1979728 + (Split out virtiofsd subpackage) +- Resolves: bz#1980139 + (Use configure --firmwarepath more) + +* Sun Jul 25 2021 Miroslav Rezanina - 6.0.0-10 +- kvm-s390x-css-Introduce-an-ESW-struct.patch [bz#1957194] +- kvm-s390x-css-Split-out-the-IRB-sense-data.patch [bz#1957194] +- kvm-s390x-css-Refactor-IRB-construction.patch [bz#1957194] +- kvm-s390x-css-Add-passthrough-IRB.patch [bz#1957194] +- kvm-vhost-user-blk-Fail-gracefully-on-too-large-queue-si.patch [bz#1957194] +- kvm-vhost-user-blk-Make-sure-to-set-Error-on-realize-fai.patch [bz#1957194] +- kvm-vhost-user-blk-Don-t-reconnect-during-initialisation.patch [bz#1957194] +- kvm-vhost-user-blk-Improve-error-reporting-in-realize.patch [bz#1957194] +- kvm-vhost-user-blk-Get-more-feature-flags-from-vhost-dev.patch [bz#1957194] +- kvm-virtio-Fail-if-iommu_platform-is-requested-but-unsup.patch [bz#1957194] +- kvm-vhost-user-blk-Check-that-num-queues-is-supported-by.patch [bz#1957194] +- kvm-vhost-user-Fix-backends-without-multiqueue-support.patch [bz#1957194] +- kvm-file-posix-fix-max_iov-for-dev-sg-devices.patch [bz#1957194] +- kvm-scsi-generic-pass-max_segments-via-max_iov-field-in-.patch [bz#1957194] +- kvm-osdep-provide-ROUND_DOWN-macro.patch [bz#1957194] +- kvm-block-backend-align-max_transfer-to-request-alignmen.patch [bz#1957194] +- kvm-block-add-max_hw_transfer-to-BlockLimits.patch [bz#1957194] +- kvm-file-posix-try-BLKSECTGET-on-block-devices-too-do-no.patch [bz#1957194] +- kvm-block-Add-option-to-use-driver-whitelist-even-in-too.patch [bz#1957782] +- kvm-spec-Restrict-block-drivers-in-tools.patch [bz#1957782] +- kvm-Move-tools-to-separate-package.patch [bz#1972285] +- kvm-Split-qemu-pr-helper-to-separate-package.patch [bz#1972300] +- kvm-spec-RPM_BUILD_ROOT-buildroot.patch [bz#1973029] +- kvm-spec-More-use-of-name-instead-of-qemu-kvm.patch [bz#1973029] +- kvm-spec-Use-qemu-pr-helper.service-from-qemu.git.patch [bz#1973029] +- kvm-spec-Use-_sourcedir-for-referencing-sources.patch [bz#1973029] +- kvm-spec-Add-tools_only.patch [bz#1973029] +- kvm-spec-build-Add-run_configure-helper.patch [bz#1973029] +- kvm-spec-build-Disable-more-bits-with-disable_everything.patch [bz#1973029] +- kvm-spec-build-Add-macros-for-some-configure-parameters.patch [bz#1973029] +- kvm-spec-files-Move-qemu-guest-agent-and-qemu-img-earlie.patch [bz#1973029] +- kvm-spec-install-Remove-redundant-bits.patch [bz#1973029] +- kvm-spec-install-Add-modprobe_kvm_conf-macro.patch [bz#1973029] +- kvm-spec-install-Remove-qemu-guest-agent-etc-qemu-kvm-us.patch [bz#1973029] +- kvm-spec-install-clean-up-qemu-ga-section.patch [bz#1973029] +- kvm-spec-install-Use-a-single-tools_only-section.patch [bz#1973029] +- kvm-spec-Make-tools_only-not-cross-spec-sections.patch [bz#1973029] +- kvm-spec-install-Limit-time-spent-in-qemu_kvm_build.patch [bz#1973029] +- kvm-spec-misc-syntactic-merges-with-Fedora.patch [bz#1973029] +- kvm-spec-Use-Fedora-s-pattern-for-specifying-rc-version.patch [bz#1973029] +- kvm-spec-files-don-t-use-fine-grained-docs-file-list.patch [bz#1973029] +- kvm-spec-files-Add-licenses-to-qemu-common-too.patch [bz#1973029] +- kvm-spec-install-Drop-python3-shebang-fixup.patch [bz#1973029] +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) +- Resolves: bz#1957782 + (VMDK support should be read-only) +- Resolves: bz#1972285 + (Split out a qemu-kvm-tools subpackage) +- Resolves: bz#1972300 + (Split out a qemu-pr-helper subpackage) +- Resolves: bz#1973029 + (Spec file cleanups) + +* Mon Jul 19 2021 Miroslav Rezanina - 6.0.0-9 +- kvm-s390x-cpumodel-add-3931-and-3932.patch [bz#1932191] +- kvm-spapr-Fix-EEH-capability-issue-on-KVM-guest-for-PCI-.patch [bz#1957194] +- kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch [bz#1957194] +- kvm-redhat-Move-qemu-kvm-docs-dependency-to-qemu-kvm.patch [bz#1957194] +- kvm-redhat-introducting-qemu-kvm-hw-usbredir.patch [bz#1957194] +- kvm-redhat-use-the-standard-vhost-user-JSON-path.patch [bz#1957194] +- Resolves: bz#1932191 + ([IBM 9.0 FEAT] CPU Model for new IBM Z Hardware - qemu part (kvm)) +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) + +* Mon Jul 12 2021 Miroslav Rezanina - 6.0.0-8 +- kvm-Disable-TPM-passthrough.patch [bz#1978911] +- kvm-redhat-Replace-the-kvm-setup.service-with-a-etc-modu.patch [bz#1978837] +- Resolves: bz#1978911 + (Remove TPM Passthrough option from RHEL 9) +- Resolves: bz#1978837 + (Remove/replace kvm-setup.service) + +* Mon Jun 28 2021 Miroslav Rezanina - 6.0.0-7 +- kvm-aarch64-rh-devices-add-CONFIG_PXB.patch [bz#1967502] +- kvm-virtio-gpu-handle-partial-maps-properly.patch [bz#1974795] +- kvm-x86-Add-x86-rhel8.5-machine-types.patch [bz#1957194] +- kvm-redhat-x86-Enable-kvm-asyncpf-int-by-default.patch [bz#1957194] +- kvm-block-backend-add-drained_poll.patch [bz#1957194] +- kvm-nbd-server-Use-drained-block-ops-to-quiesce-the-serv.patch [bz#1957194] +- kvm-disable-CONFIG_USB_STORAGE_BOT.patch [bz#1957194] +- kvm-doc-Fix-some-mistakes-in-the-SEV-documentation.patch [bz#1957194] +- kvm-docs-Add-SEV-ES-documentation-to-amd-memory-encrypti.patch [bz#1957194] +- kvm-docs-interop-firmware.json-Add-SEV-ES-support.patch [bz#1957194] +- kvm-qga-drop-StandardError-syslog.patch [bz#1947977] +- kvm-Remove-iscsi-support.patch [bz#1967133] +- Resolves: bz#1967502 + ([aarch64] [qemu] Compile the PCIe expander bridge) +- Resolves: bz#1974795 + ([RHEL9-beta] [aarch64] Launch guest with virtio-gpu-pci and virtual smmu causes "virtio_gpu_dequeue_ctrl_func" ERROR) +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) +- Resolves: bz#1947977 + (remove StandardError=syslog from qemu-guest-agent.service) +- Resolves: bz#1967133 + (QEMU: disable libiscsi in RHEL-9) + +* Mon Jun 21 2021 Miroslav Rezanina - 6.0.0-6 +- kvm-yank-Unregister-function-when-using-TLS-migration.patch [bz#1972462] +- kvm-pc-bios-s390-ccw-don-t-try-to-read-the-next-block-if.patch [bz#1957194] +- kvm-redhat-Install-the-s390-netboot.img-that-we-ve-built.patch [bz#1957194] +- kvm-sockets-update-SOCKET_ADDRESS_TYPE_FD-listen-2-backl.patch [bz#1957194] +- kvm-target-i386-sev-add-support-to-query-the-attestation.patch [bz#1957194] +- kvm-spapr-Don-t-hijack-current_machine-boot_order.patch [bz#1957194] +- kvm-target-i386-Add-CPU-model-versions-supporting-xsaves.patch [bz#1957194] +- kvm-spapr-Remove-stale-comment-about-power-saving-LPCR-b.patch [bz#1957194] +- kvm-spapr-Set-LPCR-to-current-AIL-mode-when-starting-a-n.patch [bz#1957194] +- Specfile cleanup [bz#1973029] +- Resolves: bz#1972462 + (QEMU core dump when doing TLS migration via TCP) +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) +- Resolves: bz#1973029 + (Spec file cleanups) + +* Tue Jun 08 2021 Miroslav Rezanina - 6.0.0-5 +- kvm-arm-virt-Register-highmem-and-gic-version-as-class-p.patch [bz#1952449] +- kvm-hw-arm-virt-Add-8.5-and-9.0-machine-types-and-remove.patch [bz#1952449] +- kvm-aarch64-rh-devices-add-CONFIG_PVPANIC_PCI.patch [bz#1747467] +- kvm-spec-Do-not-build-qemu-kvm-block-gluster.patch [bz#1964795] +- kvm-spec-Do-not-link-pcnet-and-ne2k_pci-roms.patch [bz#1965961] +- kvm-redhat-s390x-add-rhel-8.5.0-compat-machine.patch [bz#1957194] +- kvm-redhat-add-missing-entries-in-hw_compat_rhel_8_4.patch [bz#1957194] +- kvm-redhat-Define-pseries-rhel8.5.0-machine-type.patch [bz#1957194] +- kvm-virtio-net-failover-add-missing-remove_migration_sta.patch [bz#1957194] +- kvm-hw-arm-virt-Disable-PL011-clock-migration-through-hw.patch [bz#1957194] +- kvm-virtio-blk-Fix-rollback-path-in-virtio_blk_data_plan.patch [bz#1957194] +- kvm-virtio-blk-Configure-all-host-notifiers-in-a-single-.patch [bz#1957194] +- kvm-virtio-scsi-Set-host-notifiers-and-callbacks-separat.patch [bz#1957194] +- kvm-virtio-scsi-Configure-all-host-notifiers-in-a-single.patch [bz#1957194] +- kvm-hw-arm-smmuv3-Another-range-invalidation-fix.patch [bz#1957194] +- Resolves: bz#1952449 + ([aarch64] define RHEL9 machine types) +- Resolves: bz#1747467 + ([aarch64] [qemu] PVPANIC support) +- Resolves: bz#1964795 + (Remove qemu-kvm-block-gluster package) +- Resolves: bz#1965961 + (Remove links to not build roms) +- Resolves: bz#1957194 + (Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta) + +* Mon May 31 2021 Miroslav Rezanina - 6.0.0-4 +- kvm-s390x-redhat-disable-experimental-3270-device.patch +- Resolves: bz#1962479 + (Disable the 'x-terminal3270' device in qemu-kvm on s390x) + +* Tue May 25 2021 Miroslav Reznaina - 6.0.0-3 +- kvm-hw-s390x-Remove-the-RHEL7-only-machine-type.patch [bz#1944730] +- Resolves: bz#1944730 + (Remove RHEL7 machine type (s390-ccw-virtio-rhel7.5.0)) + +* Thu May 13 2021 Miroslav Rezanina - 6.0.0-2 +- kvm-Remove-message-with-running-VM-count.patch [bz#1914461] +- kvm-Remove-SPICE-and-QXL-from-x86_64-rh-devices.mak.patch [bz#1906168] +- kvm-spec-file-build-qemu-kvm-without-SPICE-and-QXL.patch [bz#1906168] +- kvm-spec-file-Obsolete-qemu-kvm-ui-spice.patch [bz#1906168] +- Resolves: bz#1914461 + (Remove KVM guest count and limit info message) +- Resolves: bz#1906168 + ([RHEL-9] qemu-kvm spec-file: Do not BuildRequire spice) + +* Fri Apr 30 2021 Miroslav Rezanina - 6.0.0-1 +- Rebase to QEMU 6.0 +- Resolves: bz#1872569 + +* Mon Apr 26 2021 Miroslav Rezanina - 5.2.0-16 +- kvm-Limit-build-on-Power-to-qemu-img-and-qemu-ga-only.patch [bz#1944056] +- Resolves: bz#1944056 + (Do not build qemu-kvm for Power) + +* Fri Apr 16 2021 Mohan Boddu - 15:5.2.0-15 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Sat Mar 20 2021 Danilo Cesar Lemes de Paula - 5.2.0-14.el8 +- kvm-vhost-user-blk-fix-blkcfg-num_queues-endianness.patch [bz#1937004] +- kvm-block-export-fix-blk_size-double-byteswap.patch [bz#1937004] +- kvm-block-export-use-VIRTIO_BLK_SECTOR_BITS.patch [bz#1937004] +- kvm-block-export-fix-vhost-user-blk-export-sector-number.patch [bz#1937004] +- kvm-block-export-port-virtio-blk-discard-write-zeroes-in.patch [bz#1937004] +- kvm-block-export-port-virtio-blk-read-write-range-check.patch [bz#1937004] +- kvm-spec-ui-spice-sub-package.patch [bz#1936373] +- kvm-spec-ui-opengl-sub-package.patch [bz#1936373] +- Resolves: bz#1937004 + (vhost-user-blk server endianness and input validation fixes) +- Resolves: bz#1936373 + (move spice & opengl modules to rpm subpackages) + +* Tue Mar 16 2021 Danilo Cesar Lemes de Paula - 5.2.0-13.el8 +- kvm-i386-acpi-restore-device-paths-for-pre-5.1-vms.patch [bz#1934158] +- Resolves: bz#1934158 + (Windows guest looses network connectivity when NIC was configured with static IP) + +* Mon Mar 15 2021 Danilo Cesar Lemes de Paula - 5.2.0-12.el8 +- kvm-scsi-disk-move-scsi_handle_rw_error-earlier.patch [bz#1927530] +- kvm-scsi-disk-do-not-complete-requests-early-for-rerror-.patch [bz#1927530] +- kvm-scsi-introduce-scsi_sense_from_errno.patch [bz#1927530] +- kvm-scsi-disk-pass-SCSI-status-to-scsi_handle_rw_error.patch [bz#1927530] +- kvm-scsi-disk-pass-guest-recoverable-errors-through-even.patch [bz#1927530] +- kvm-hw-intc-arm_gic-Fix-interrupt-ID-in-GICD_SGIR-regist.patch [bz#1936948] +- Resolves: bz#1927530 + (RHEL8 Hypervisor - OVIRT - Issues seen on a virtualization guest with direct passthrough LUNS pausing when a host gets a Thin threshold warning) +- Resolves: bz#1936948 + (CVE-2021-20221 virt:av/qemu-kvm: qemu: out-of-bound heap buffer access via an interrupt ID field [rhel-av-8.4.0]) + +* Mon Mar 08 2021 Danilo Cesar Lemes de Paula - 5.2.0-11.el8 +- kvm-qxl-set-qxl.ssd.dcl.con-on-secondary-devices.patch [bz#1932190] +- kvm-qxl-also-notify-the-rendering-is-done-when-skipping-.patch [bz#1932190] +- kvm-virtiofsd-Save-error-code-early-at-the-failure-calls.patch [bz#1935071] +- kvm-virtiofs-drop-remapped-security.capability-xattr-as-.patch [bz#1935071] +- Resolves: bz#1932190 + (Timeout when dump the screen from 2nd VGA) +- Resolves: bz#1935071 + (CVE-2021-20263 virt:8.4/qemu-kvm: QEMU: virtiofsd: 'security.capabilities' is not dropped with xattrmap option [rhel-av-8]) + +* Wed Mar 03 2021 Danilo Cesar Lemes de Paula - 5.2.0-10.el8 +- kvm-migration-dirty-bitmap-Use-struct-for-alias-map-inne.patch [bz#1930757] +- kvm-migration-dirty-bitmap-Allow-control-of-bitmap-persi.patch [bz#1930757] +- kvm-qemu-iotests-300-Add-test-case-for-modifying-persist.patch [bz#1930757] +- kvm-failover-fix-indentantion.patch [bz#1819991] +- kvm-failover-Use-always-atomics-for-primary_should_be_hi.patch [bz#1819991] +- kvm-failover-primary-bus-is-only-used-once-and-where-it-.patch [bz#1819991] +- kvm-failover-Remove-unused-parameter.patch [bz#1819991] +- kvm-failover-Remove-external-partially_hotplugged-proper.patch [bz#1819991] +- kvm-failover-qdev_device_add-returns-err-or-dev-set.patch [bz#1819991] +- kvm-failover-Rename-bool-to-failover_primary_hidden.patch [bz#1819991] +- kvm-failover-g_strcmp0-knows-how-to-handle-NULL.patch [bz#1819991] +- kvm-failover-Remove-primary_device_opts.patch [bz#1819991] +- kvm-failover-remove-standby_id-variable.patch [bz#1819991] +- kvm-failover-Remove-primary_device_dict.patch [bz#1819991] +- kvm-failover-Remove-memory-leak.patch [bz#1819991] +- kvm-failover-simplify-virtio_net_find_primary.patch [bz#1819991] +- kvm-failover-should_be_hidden-should-take-a-bool.patch [bz#1819991] +- kvm-failover-Rename-function-to-hide_device.patch [bz#1819991] +- kvm-failover-virtio_net_connect_failover_devices-does-no.patch [bz#1819991] +- kvm-failover-Rename-to-failover_find_primary_device.patch [bz#1819991] +- kvm-failover-simplify-qdev_device_add-failover-case.patch [bz#1819991] +- kvm-failover-simplify-qdev_device_add.patch [bz#1819991] +- kvm-failover-make-sure-that-id-always-exist.patch [bz#1819991] +- kvm-failover-remove-failover_find_primary_device-error-p.patch [bz#1819991] +- kvm-failover-split-failover_find_primary_device_id.patch [bz#1819991] +- kvm-failover-We-don-t-need-to-cache-primary_device_id-an.patch [bz#1819991] +- kvm-failover-Caller-of-this-two-functions-already-have-p.patch [bz#1819991] +- kvm-failover-simplify-failover_unplug_primary.patch [bz#1819991] +- kvm-failover-Remove-primary_dev-member.patch [bz#1819991] +- kvm-virtio-net-add-missing-object_unref.patch [bz#1819991] +- kvm-x86-cpu-Populate-SVM-CPUID-feature-bits.patch [bz#1926785] +- kvm-i386-Add-the-support-for-AMD-EPYC-3rd-generation-pro.patch [bz#1926785] +- Resolves: bz#1930757 + (Allow control of block-dirty-bitmap persistence via 'block-bitmap-mapping') +- Resolves: bz#1819991 + (Hostdev type interface with net failover enabled exists in domain xml and doesn't reattach to host after hot-unplug) +- Resolves: bz#1926785 + ([RFE] AMD Milan - Add KVM/support for EPYC-Milan CPU Model - Fast Train) + +* Mon Mar 01 2021 Danilo Cesar Lemes de Paula - 5.2.0-9.el8 +- kvm-docs-generate-qemu-storage-daemon-qmp-ref-7-man-page.patch [bz#1901323] +- kvm-docs-add-qemu-storage-daemon-1-man-page.patch [bz#1901323] +- kvm-docs-Add-qemu-storage-daemon-1-manpage-to-meson.buil.patch [bz#1901323] +- kvm-qemu-storage-daemon-Enable-object-add.patch [bz#1901323] +- kvm-spec-Package-qemu-storage-daemon.patch [bz#1901323] +- kvm-default-configs-Enable-vhost-user-blk.patch [bz#1930033] +- kvm-qemu-nbd-Use-SOMAXCONN-for-socket-listen-backlog.patch [bz#1925345] +- kvm-pcie-don-t-set-link-state-active-if-the-slot-is-empt.patch [bz#1917654] +- Resolves: bz#1901323 + (QSD (QEMU Storage Daemon): basic support - TechPreview) +- Resolves: bz#1930033 + (enable vhost-user-blk device) +- Resolves: bz#1925345 + (qemu-nbd needs larger backlog for Unix socket listen()) +- Resolves: bz#1917654 + ([failover vf migration][RHEL84 vm] After start a vm with a failover vf + a failover virtio net device, the failvoer vf do not exist in the vm) + +* Fri Feb 19 2021 Eduardo Lima (Etrunko) - 5.2.0-8.el8 +- kvm-block-nbd-only-detach-existing-iochannel-from-aio_co.patch [bz#1887883] +- kvm-block-nbd-only-enter-connection-coroutine-if-it-s-pr.patch [bz#1887883] +- kvm-nbd-make-nbd_read-return-EIO-on-error.patch [bz#1887883] +- kvm-virtio-move-use-disabled-flag-property-to-hw_compat_.patch [bz#1907255] +- kvm-virtiofsd-extract-lo_do_open-from-lo_open.patch [bz#1920740] +- kvm-virtiofsd-optionally-return-inode-pointer-from-lo_do.patch [bz#1920740] +- kvm-virtiofsd-prevent-opening-of-special-files-CVE-2020-.patch [bz#1920740] +- kvm-spapr-Adjust-firmware-path-of-PCI-devices.patch [bz#1920941] +- kvm-pci-reject-too-large-ROMs.patch [bz#1917830] +- kvm-pci-add-romsize-property.patch [bz#1917830] +- kvm-redhat-Add-some-devices-for-exporting-upstream-machi.patch [bz#1917826] +- kvm-vhost-Check-for-valid-vdev-in-vhost_backend_handle_i.patch [bz#1880299] +- Resolves: bz#1887883 + (qemu blocks client progress with various NBD actions) +- Resolves: bz#1907255 + (Migrate failed with vhost-vsock-pci from RHEL-AV 8.3.1 to RHEL-AV 8.2.1) +- Resolves: bz#1920740 + (CVE-2020-35517 virt:8.4/qemu-kvm: QEMU: virtiofsd: potential privileged host device access from guest [rhel-av-8.4.0]) +- Resolves: bz#1920941 + ([ppc64le] [AV]--disk cdimage.iso,bus=usb fails to boot) +- Resolves: bz#1917830 + (Add romsize property to qemu-kvm) +- Resolves: bz#1917826 + (Add extra device support to qemu-kvm, but not to rhel machine types) +- Resolves: bz#1880299 + (vhost-user mq connection fails to restart after kill host testpmd which acts as vhost-user client) + +* Fri Feb 12 2021 Eduardo Lima (Etrunko) - 5.2.0-7.el8 +- kvm-virtio-Add-corresponding-memory_listener_unregister-.patch [bz#1903521] +- kvm-block-Honor-blk_set_aio_context-context-requirements.patch [bz#1918966 bz#1918968] +- kvm-nbd-server-Quiesce-coroutines-on-context-switch.patch [bz#1918966 bz#1918968] +- kvm-block-Avoid-processing-BDS-twice-in-bdrv_set_aio_con.patch [bz#1918966 bz#1918968] +- kvm-storage-daemon-Call-bdrv_close_all-on-exit.patch [bz#1918966 bz#1918968] +- kvm-block-move-blk_exp_close_all-to-qemu_cleanup.patch [bz#1918966 bz#1918968] +- Resolves: bz#1903521 + (hot unplug vhost-user cause qemu crash: qemu-kvm: ../softmmu/memory.c:2818: do_address_space_destroy: Assertion `QTAILQ_EMPTY(&as->listeners)' failed.) +- Resolves: bz#1918966 + ([incremental_backup] qemu aborts if guest reboot during backup when using virtio-blk: "aio_co_schedule: Co-routine was already scheduled in 'aio_co_schedule'") +- Resolves: bz#1918968 + ([incremental_backup] qemu deadlock after poweroff in guest during backup in nbd_export_close_all()) + +* Tue Feb 09 2021 Eduardo Lima (Etrunko) - 5.2.0-6.el8 +- kvm-scsi-fix-device-removal-race-vs-IO-restart-callback-.patch [bz#1854811] +- kvm-tracetool-also-strip-l-and-ll-from-systemtap-format-.patch [bz#1907264] +- kvm-redhat-moving-all-documentation-files-to-qemu-kvm-do.patch [bz#1881170 bz#1924766] +- kvm-hw-arm-smmuv3-Fix-addr_mask-for-range-based-invalida.patch [bz#1834152] +- kvm-redhat-makes-qemu-respect-system-s-crypto-profile.patch [bz#1902219] +- kvm-vhost-Unbreak-SMMU-and-virtio-iommu-on-dev-iotlb-sup.patch [bz#1925028] +- kvm-docs-set-CONFDIR-when-running-sphinx.patch [bz#1902537] +- Resolves: bz#1854811 + (scsi-bus.c: use-after-free due to race between device unplug and I/O operation causes guest crash) +- Resolves: bz#1907264 + (systemtap: invalid or missing conversion specifier at the trace event vhost_vdpa_set_log_base) +- Resolves: bz#1881170 + (split documentation from the qemu-kvm-core package to its own subpackage) +- Resolves: bz#1924766 + (split documentation from the qemu-kvm-core package to its own subpackage [av-8.4.0]) +- Resolves: bz#1834152 + ([aarch64] QEMU SMMUv3 device: Support range invalidation) +- Resolves: bz#1902219 + (QEMU doesn't honour system crypto policies) +- Resolves: bz#1925028 + (vsmmuv3/vhost and virtio-iommu/vhost regression) +- Resolves: bz#1902537 + (The default fsfreeze-hook path from man page and qemu-ga --help command are different) + +* Tue Feb 02 2021 Eduardo Lima (Etrunko) - 5.2.0-5.el8 +- kvm-spapr-Allow-memory-unplug-to-always-succeed.patch [bz#1914069] +- kvm-spapr-Improve-handling-of-memory-unplug-with-old-gue.patch [bz#1914069] +- kvm-x86-cpu-Add-AVX512_FP16-cpu-feature.patch [bz#1838738] +- kvm-q35-Increase-max_cpus-to-710-on-pc-q35-rhel8-machine.patch [bz#1904268] +- kvm-config-enable-VFIO_CCW.patch [bz#1922170] +- Resolves: bz#1914069 + ([ppc64le] have this fix for rhel8.4 av (spapr: Allow memory unplug to always succeed)) +- Resolves: bz#1838738 + ([Intel 8.4 FEAT] qemu-kvm Sapphire Rapids (SPR) New Instructions (NIs) - Fast Train) +- Resolves: bz#1904268 + ([RFE] [HPEMC] qemu-kvm: support up to 710 VCPUs) +- Resolves: bz#1922170 + (Enable vfio-ccw in AV) + +* Wed Jan 27 2021 Danilo Cesar Lemes de Paula - 5.2.0-4.el8 +- kvm-Drop-bogus-IPv6-messages.patch [bz#1918061] +- Resolves: bz#1918061 + (CVE-2020-10756 virt:rhel/qemu-kvm: QEMU: slirp: networking out-of-bounds read information disclosure vulnerability [rhel-av-8]) + +* Mon Jan 18 2021 Danilo Cesar Lemes de Paula - 5.2.0-3.el8 +- kvm-block-nvme-Implement-fake-truncate-coroutine.patch [bz#1848834] +- kvm-spec-find-system-python-via-meson.patch [bz#1899619] +- kvm-build-system-use-b_staticpic-false.patch [bz#1899619] +- kvm-spapr-Fix-buffer-overflow-in-spapr_numa_associativit.patch [bz#1908693] +- kvm-usb-hcd-xhci-pci-Fixup-capabilities-ordering-again.patch [bz#1912846] +- kvm-qga-commands-posix-Send-CCW-address-on-s390x-with-th.patch [bz#1755075] +- kvm-AArch64-machine-types-cleanup.patch [bz#1895276] +- kvm-hw-arm-virt-Add-8.4-Machine-type.patch [bz#1895276] +- kvm-udev-kvm-check-remove-the-exceeded-subscription-limi.patch [bz#1914463] +- kvm-memory-Rename-memory_region_notify_one-to-memory_reg.patch [bz#1845758] +- kvm-memory-Add-IOMMUTLBEvent.patch [bz#1845758] +- kvm-memory-Add-IOMMU_NOTIFIER_DEVIOTLB_UNMAP-IOMMUTLBNot.patch [bz#1845758] +- kvm-intel_iommu-Skip-page-walking-on-device-iotlb-invali.patch [bz#1845758] +- kvm-memory-Skip-bad-range-assertion-if-notifier-is-DEVIO.patch [bz#1845758] +- kvm-RHEL-Switch-pvpanic-test-to-q35.patch [bz#1885555] +- kvm-8.4-x86-machine-type.patch [bz#1885555] +- kvm-memory-clamp-cached-translation-in-case-it-points-to.patch [bz#1904392] +- Resolves: bz#1848834 + (Failed to create luks format image on NVMe device) +- Resolves: bz#1899619 + (QEMU 5.2 is built with PIC objects instead of PIE) +- Resolves: bz#1908693 + ([ppc64le]boot up a guest with 128 numa nodes ,qemu got coredump) +- Resolves: bz#1912846 + (qemu-kvm: Failed to load xhci:parent_obj during migration) +- Resolves: bz#1755075 + ([qemu-guest-agent] fsinfo doesn't return disk info on s390x) +- Resolves: bz#1895276 + (Machine types update for aarch64 for QEMU 5.2.0) +- Resolves: bz#1914463 + (Remove KVM guest count and limit info message) +- Resolves: bz#1845758 + (qemu core dumped: qemu-kvm: /builddir/build/BUILD/qemu-4.2.0/memory.c:1928: memory_region_notify_one: Assertion `entry->iova >= notifier->start && entry_end <= notifier->end' failed.) +- Resolves: bz#1885555 + (8.4 machine types for x86) +- Resolves: bz#1904392 + (CVE-2020-27821 virt:8.4/qemu-kvm: QEMU: heap buffer overflow in msix_table_mmio_write() in hw/pci/msix.c [rhel-av-8]) + +* Tue Dec 15 2020 Danilo Cesar Lemes de Paula - 5.2.0-2.el8 +- kvm-redhat-Define-hw_compat_8_3.patch [bz#1893935] +- kvm-redhat-Add-spapr_machine_rhel_default_class_options.patch [bz#1893935] +- kvm-redhat-Define-pseries-rhel8.4.0-machine-type.patch [bz#1893935] +- kvm-redhat-s390x-add-rhel-8.4.0-compat-machine.patch [bz#1836282] +- Resolves: bz#1836282 + (New machine type for qemu-kvm on s390x in RHEL-AV) +- Resolves: bz#1893935 + (New machine type on RHEL-AV 8.4 for ppc64le) + +* Wed Dec 09 2020 Miroslav Rezanina - 5.2.0-1.el8 +- Rebase to QEMU 5.2.0 [bz#1905933] +- Resolves: bz#1905933 + (Rebase qemu-kvm to version 5.2.0) + +* Tue Dec 01 2020 Danilo Cesar Lemes de Paula - 5.1.0-16.el8 +- kvm-redhat-introduces-disable_everything-macro-into-the-.patch [bz#1884611] +- kvm-redhat-scripts-extract_build_cmd.py-Avoid-listing-em.patch [bz#1884611] +- kvm-redhat-Removing-unecessary-configurations.patch [bz#1884611] +- kvm-redhat-Fixing-rh-local-build.patch [bz#1884611] +- kvm-redhat-allow-Makefile-rh-prep-builddep-to-fail.patch [bz#1884611] +- kvm-redhat-adding-rh-rpm-target.patch [bz#1884611] +- kvm-redhat-move-shareable-files-from-qemu-kvm-core-to-qe.patch [bz#1884611] +- kvm-redhat-Add-qemu-kiwi-subpackage.patch [bz#1884611] +- Resolves: bz#1884611 + (Build kata-specific version of qemu) + +* Mon Nov 16 2020 Danilo Cesar Lemes de Paula - 5.1.0-15.el8 +- kvm-redhat-add-un-pre-install-systemd-hooks-for-qemu-ga.patch [bz#1882719] +- kvm-rcu-Implement-drain_call_rcu.patch [bz#1812399 bz#1866707] +- kvm-libqtest-Rename-qmp_assert_error_class-to-qmp_expect.patch [bz#1812399 bz#1866707] +- kvm-qtest-rename-qtest_qmp_receive-to-qtest_qmp_receive_.patch [bz#1812399 bz#1866707] +- kvm-qtest-Reintroduce-qtest_qmp_receive-with-QMP-event-b.patch [bz#1812399 bz#1866707] +- kvm-qtest-remove-qtest_qmp_receive_success.patch [bz#1812399 bz#1866707] +- kvm-device-plug-test-use-qtest_qmp-to-send-the-device_de.patch [bz#1812399 bz#1866707] +- kvm-qtest-switch-users-back-to-qtest_qmp_receive.patch [bz#1812399 bz#1866707] +- kvm-qtest-check-that-drives-are-really-appearing-and-dis.patch [bz#1812399 bz#1866707] +- kvm-qemu-iotests-qtest-rewrite-test-067-as-a-qtest.patch [bz#1812399 bz#1866707] +- kvm-qdev-add-check-if-address-free-callback-for-buses.patch [bz#1812399 bz#1866707] +- kvm-scsi-scsi_bus-switch-search-direction-in-scsi_device.patch [bz#1812399 bz#1866707] +- kvm-device_core-use-drain_call_rcu-in-in-qmp_device_add.patch [bz#1812399 bz#1866707] +- kvm-device-core-use-RCU-for-list-of-children-of-a-bus.patch [bz#1812399 bz#1866707] +- kvm-scsi-switch-to-bus-check_address.patch [bz#1812399 bz#1866707] +- kvm-device-core-use-atomic_set-on-.realized-property.patch [bz#1812399 bz#1866707] +- kvm-scsi-scsi-bus-scsi_device_find-don-t-return-unrealiz.patch [bz#1812399] +- kvm-scsi-scsi_bus-Add-scsi_device_get.patch [bz#1812399 bz#1866707] +- kvm-virtio-scsi-use-scsi_device_get.patch [bz#1812399 bz#1866707] +- kvm-scsi-scsi_bus-fix-races-in-REPORT-LUNS.patch [bz#1812399 bz#1866707] +- kvm-tests-migration-fix-memleak-in-wait_command-wait_com.patch [bz#1812399 bz#1866707] +- kvm-libqtest-fix-the-order-of-buffered-events.patch [bz#1812399 bz#1866707] +- kvm-libqtest-fix-memory-leak-in-the-qtest_qmp_event_ref.patch [bz#1812399 bz#1866707] +- kvm-iotests-add-filter_qmp_virtio_scsi-function.patch [bz#1812399 bz#1866707] +- kvm-iotests-rewrite-iotest-240-in-python.patch [bz#1812399 bz#1866707] +- Resolves: bz#1812399 + (Qemu crash when detach disk with cache="none" discard="ignore" io="native") +- Resolves: bz#1866707 + (qemu-kvm is crashing with error "scsi_target_emulate_report_luns: Assertion `i == n + 8' failed") +- Resolves: bz#1882719 + (qemu-ga service still active and can work after qemu-guest-agent been removed) + +* Tue Oct 13 2020 Danilo Cesar Lemes de Paula - 5.1.0-14.el8_3 +- kvm-virtiofsd-avoid-proc-self-fd-tempdir.patch [bz#1884276] +- Resolves: bz#1884276 + (Pod with kata-runtime won't start, QEMU: "vhost_user_dev init failed, Operation not permitted" [mkdtemp failing in sandboxing]) + +* Thu Oct 08 2020 Danilo Cesar Lemes de Paula - 5.1.0-13.el8_3 +- kvm-x86-lpc9-let-firmware-negotiate-CPU-hotplug-with-SMI.patch [bz#1846886] +- kvm-x86-cpuhp-prevent-guest-crash-on-CPU-hotplug-when-br.patch [bz#1846886] +- kvm-x86-cpuhp-refuse-cpu-hot-unplug-request-earlier-if-n.patch [bz#1846886] +- Resolves: bz#1846886 + (Guest hit soft lockup or reboots if hotplug vcpu under ovmf) + +* Mon Oct 05 2020 Danilo Cesar Lemes de Paula - 5.1.0-12.el8_3 +- kvm-virtio-skip-legacy-support-check-on-machine-types-le.patch [bz#1868449] +- kvm-vhost-vsock-pci-force-virtio-version-1.patch [bz#1868449] +- kvm-vhost-user-vsock-pci-force-virtio-version-1.patch [bz#1868449] +- kvm-vhost-vsock-ccw-force-virtio-version-1.patch [bz#1868449] +- Resolves: bz#1868449 + (vhost_vsock error: device is modern-only, use disable-legacy=on) + +* Mon Oct 05 2020 Danilo Cesar Lemes de Paula - 5.1.0-11.el8_3 +- kvm-migration-increase-max-bandwidth-to-128-MiB-s-1-Gib-.patch [bz#1874004] +- kvm-redhat-Make-all-generated-so-files-executable-not-on.patch [bz#1876635] +- Resolves: bz#1874004 + (Live migration performance is poor during guest installation process on power host) +- Resolves: bz#1876635 + (VM fails to start with a passthrough smartcard) + +* Mon Sep 28 2020 Danilo Cesar Lemes de Paula - 5.1.0-10.el8 +- kvm-qemu-img-Support-bitmap-merge-into-backing-image.patch [bz#1877209] +- Resolves: bz#1877209 + ('qemu-img bitmaps --merge' failed when trying to merge top volume bitmap to base volume bitmap) + +* Mon Sep 21 2020 Danilo Cesar Lemes de Paula - 5.1.0-9.el8 +- kvm-hw-nvram-fw_cfg-fix-FWCfgDataGeneratorClass-get_data.patch [bz#1688978] +- Resolves: bz#1688978 + (RFE: forward host preferences for cipher suites and CA certs to guest firmware) + +* Thu Sep 17 2020 Danilo Cesar Lemes de Paula - 5.1.0-8.el8 +- kvm-redhat-link-etc-qemu-ga-fsfreeze-hook-to-etc-qemu-kv.patch [bz#1738820] +- kvm-seccomp-fix-killing-of-whole-process-instead-of-thre.patch [bz#1752376] +- kvm-Revert-Drop-bogus-IPv6-messages.patch [bz#1867075] +- kvm-block-rbd-add-namespace-to-qemu_rbd_strong_runtime_o.patch [bz#1821528] +- Resolves: bz#1738820 + ('-F' option of qemu-ga command cause the guest-fsfreeze-freeze command doesn't work) +- Resolves: bz#1752376 + (qemu use SCMP_ACT_TRAP even SCMP_ACT_KILL_PROCESS is available) +- Resolves: bz#1821528 + (missing namespace attribute when access the rbd image with namespace) +- Resolves: bz#1867075 + (CVE-2020-10756 virt:8.3/qemu-kvm: QEMU: slirp: networking out-of-bounds read information disclosure vulnerability [rhel-av-8]) + +* Tue Sep 15 2020 Danilo Cesar Lemes de Paula - 5.1.0-7.el8 +- kvm-target-ppc-Add-experimental-option-for-enabling-secu.patch [bz#1789757 bz#1870384] +- kvm-target-arm-Move-start-powered-off-property-to-generi.patch [bz#1849483] +- kvm-target-arm-Move-setting-of-CPU-halted-state-to-gener.patch [bz#1849483] +- kvm-ppc-spapr-Use-start-powered-off-CPUState-property.patch [bz#1849483] +- Resolves: bz#1789757 + ([IBM 8.4 FEAT] Add machine option to enable secure VM support) +- Resolves: bz#1849483 + (Failed to boot up guest when hotplugging vcpus on bios stage) +- Resolves: bz#1870384 + ([IBM 8.3 FEAT] Add interim/unsupported machine option to enable secure VM support for testing purposes) + +* Thu Sep 10 2020 Danilo Cesar Lemes de Paula - 5.1.0-6.el8 +- kvm-spec-Move-qemu-pr-helper-back-to-usr-bin.patch [bz#1869635] +- kvm-Bump-required-libusbx-version.patch [bz#1856591] +- Resolves: bz#1856591 + (libusbx isn't updated with qemu-kvm) +- Resolves: bz#1869635 + ('/usr/bin/qemu-pr-helper' is not a suitable pr helper: No such file or directory) + +* Tue Sep 08 2020 Danilo Cesar Lemes de Paula - 5.1.0-5.el8 +- kvm-Revert-i386-Fix-pkg_id-offset-for-EPYC-cpu-models.patch [bz#1873417] +- kvm-Revert-target-i386-Enable-new-apic-id-encoding-for-E.patch [bz#1873417] +- kvm-Revert-hw-i386-Move-arch_id-decode-inside-x86_cpus_i.patch [bz#1873417] +- kvm-Revert-i386-Introduce-use_epyc_apic_id_encoding-in-X.patch [bz#1873417] +- kvm-Revert-hw-i386-Introduce-apicid-functions-inside-X86.patch [bz#1873417] +- kvm-Revert-target-i386-Cleanup-and-use-the-EPYC-mode-top.patch [bz#1873417] +- kvm-Revert-hw-386-Add-EPYC-mode-topology-decoding-functi.patch [bz#1873417] +- kvm-nvram-Exit-QEMU-if-NVRAM-cannot-contain-all-prom-env.patch [bz#1867739] +- kvm-usb-fix-setup_len-init-CVE-2020-14364.patch [bz#1869715] +- kvm-Remove-explicit-glusterfs-api-dependency.patch [bz#1872853] +- kvm-disable-virgl.patch [bz#1831271] +- Resolves: bz#1831271 + (Drop virgil acceleration support and remove virglrenderer dependency) +- Resolves: bz#1867739 + (-prom-env does not validate input) +- Resolves: bz#1869715 + (CVE-2020-14364 qemu-kvm: QEMU: usb: out-of-bounds r/w access issue while processing usb packets [rhel-av-8.3.0]) +- Resolves: bz#1872853 + (move the glusterfs dependency out of qemu-kvm-core to the glusterfs module) +- Resolves: bz#1873417 + (AMD/NUMA topology - revert 5.1 changes) + +* Thu Aug 27 2020 Danilo Cesar Lemes de Paula - 5.1.0-4.el8 +- kvm-Drop-bogus-IPv6-messages.patch [bz#1867075] +- kvm-machine-types-numa-set-numa_mem_supported-on-old-mac.patch [bz#1849707] +- kvm-machine_types-numa-compatibility-for-auto_enable_num.patch [bz#1849707] +- kvm-migration-Add-block-bitmap-mapping-parameter.patch [bz#1790492] +- kvm-iotests.py-Let-wait_migration-return-on-failure.patch [bz#1790492] +- kvm-iotests-Test-node-bitmap-aliases-during-migration.patch [bz#1790492] +- Resolves: bz#1790492 + ('dirty-bitmaps' migration capability should allow configuring target nodenames) +- Resolves: bz#1849707 + (8.3 machine types for x86 - 5.1 update) +- Resolves: bz#1867075 + (CVE-2020-10756 virt:8.3/qemu-kvm: QEMU: slirp: networking out-of-bounds read information disclosure vulnerability [rhel-av-8]) + +* Wed Aug 19 2020 Danilo Cesar Lemes de Paula - 5.1.0-3.el8 +- kvm-redhat-Update-hw_compat_8_2.patch [bz#1843348] +- kvm-redhat-update-pseries-rhel8.2.0-machine-type.patch [bz#1843348] +- kvm-Disable-TPM-passthrough-backend-on-ARM.patch [bz#1801242] +- kvm-Require-libfdt-1.6.0.patch [bz#1867847] +- Resolves: bz#1801242 + ([aarch64] vTPM support in machvirt) +- Resolves: bz#1843348 + (8.3 machine types for POWER) +- Resolves: bz#1867847 + ([ppc] virt module 7629: /usr/libexec/qemu-kvm: undefined symbol: fdt_check_full, version LIBFDT_1.2) + +* Wed Aug 12 2020 Danilo Cesar Lemes de Paula - 5.1.0-2.el8 +- kvm-redhat-define-hw_compat_8_2.patch [bz#1853265] +- Resolves: bz#1853265 + (Forward and backward migration from rhel-av-8.3.0(qemu-kvm-5.0.0) to rhel-av-8.2.1(qemu-kvm-4.2.0) failed with "qemu-kvm: error while loading state for instance 0x0 of device 'spapr'") + +* Wed Aug 12 2020 Danilo Cesar Lemes de Paula - 5.1.0-1.el8 +- Quick changelog fix to reflect the current fixes: +- Resolve: bz#1781911 +- Resolve: bz#1841529 +- Resolve: bz#1842902 +- Resolve: bz#1818843 +- Resolve: bz#1819292 +- Resolve: bz#1801242 + +* Wed Aug 12 2020 Danilo Cesar Lemes de Paula - 5.1.0-0.el8 +- Rebase to 5.1.0 +- Resolves: bz#1809650 + +* Tue Jul 07 2020 Danilo Cesar Lemes de Paula - 4.2.0-29.el8 +- kvm-virtio-net-fix-removal-of-failover-device.patch [bz#1820120] +- Resolves: bz#1820120 + (After hotunplugging the vitrio device and netdev, hotunpluging the failover VF will cause qemu core dump) + +* Sun Jun 28 2020 Danilo Cesar Lemes de Paula - 4.2.0-28.el8 +- kvm-virtio-blk-Refactor-the-code-that-processes-queued-r.patch [bz#1812765] +- kvm-virtio-blk-On-restart-process-queued-requests-in-the.patch [bz#1812765] +- kvm-Fix-use-afte-free-in-ip_reass-CVE-2020-1983.patch [bz#1838082] +- Resolves: bz#1812765 + (qemu with iothreads enabled crashes on resume after enospc pause for disk extension) +- Resolves: bz#1838082 + (CVE-2020-1983 virt:8.2/qemu-kvm: QEMU: slirp: use-after-free in ip_reass() function in ip_input.c [rhel-av-8]) + +* Thu Jun 18 2020 Eduardo Lima (Etrunko) - 4.2.0-27.el8 +- kvm-hw-pci-pcie-Move-hot-plug-capability-check-to-pre_pl.patch [bz#1820531] +- kvm-spec-Fix-python-shenigans-for-tests.patch [bz#1845779] +- kvm-target-i386-Add-ARCH_CAPABILITIES-related-bits-into-.patch [bz#1840342] +- Resolves: bz#1820531 + (qmp command query-pci get wrong result after hotplug device under hotplug=off controller) +- Resolves: bz#1840342 + ([Intel 8.2.1 Bug] qemu-kvm Add ARCH_CAPABILITIES to Icelake-Server cpu model - Fast Train) +- Resolves: bz#1845779 + (Install 'qemu-kvm-tests' failed as nothing provides /usr/libexec/platform-python3 - virt module 6972) + +* Wed Jun 17 2020 Eduardo Lima (Etrunko) - 4.2.0-26.el8 +- kvm-nbd-server-Avoid-long-error-message-assertions-CVE-2.patch [bz#1845384] +- kvm-block-Call-attention-to-truncation-of-long-NBD-expor.patch [bz#1845384] +- Resolves: bz#1845384 + (CVE-2020-10761 virt:8.2/qemu-kvm: QEMU: nbd: reachable assertion failure in nbd_negotiate_send_rep_verr via remote client [rhel-av-8]) + +* Tue Jun 09 2020 Danilo Cesar Lemes de Paula - 4.2.0-25.el8 +- kvm-enable-ramfb.patch [bz#1841068] +- kvm-block-Add-flags-to-BlockDriver.bdrv_co_truncate.patch [bz#1780574] +- kvm-block-Add-flags-to-bdrv-_co-_truncate.patch [bz#1780574] +- kvm-block-backend-Add-flags-to-blk_truncate.patch [bz#1780574] +- kvm-qcow2-Support-BDRV_REQ_ZERO_WRITE-for-truncate.patch [bz#1780574] +- kvm-raw-format-Support-BDRV_REQ_ZERO_WRITE-for-truncate.patch [bz#1780574] +- kvm-file-posix-Support-BDRV_REQ_ZERO_WRITE-for-truncate.patch [bz#1780574] +- kvm-block-truncate-Don-t-make-backing-file-data-visible.patch [bz#1780574] +- kvm-iotests-Add-qemu_io_log.patch [bz#1780574] +- kvm-iotests-Filter-testfiles-out-in-filter_img_info.patch [bz#1780574] +- kvm-iotests-Test-committing-to-short-backing-file.patch [bz#1780574] +- kvm-qcow2-Forward-ZERO_WRITE-flag-for-full-preallocation.patch [bz#1780574] +- kvm-i386-Add-MSR-feature-bit-for-MDS-NO.patch [bz#1769912] +- kvm-i386-Add-macro-for-stibp.patch [bz#1769912] +- kvm-target-i386-Add-new-bit-definitions-of-MSR_IA32_ARCH.patch [bz#1769912] +- kvm-i386-Add-new-CPU-model-Cooperlake.patch [bz#1769912] +- kvm-target-i386-Add-missed-features-to-Cooperlake-CPU-mo.patch [bz#1769912] +- Resolves: bz#1769912 + ([Intel 8.2.1 Feature] introduce Cooper Lake cpu model - qemu-kvm Fast Train) +- Resolves: bz#1780574 + (Data corruption with resizing short overlay over longer backing files) +- Resolves: bz#1841068 + (RFE: please support the "ramfb" display device model) + +* Mon Jun 08 2020 Danilo Cesar Lemes de Paula - 4.2.0-24.el8 +- kvm-target-i386-set-the-CPUID-level-to-0x14-on-old-machi.patch [bz#1513681] +- kvm-block-curl-HTTP-header-fields-allow-whitespace-aroun.patch [bz#1841038] +- kvm-block-curl-HTTP-header-field-names-are-case-insensit.patch [bz#1841038] +- kvm-MAINTAINERS-fix-qcow2-bitmap.c-under-Dirty-Bitmaps-h.patch [bz#1779893 bz#1779904] +- kvm-iotests-Let-_make_test_img-parse-its-parameters.patch [bz#1779893 bz#1779904] +- kvm-qemu_img-add-cvtnum_full-to-print-error-reports.patch [bz#1779893 bz#1779904] +- kvm-block-Make-it-easier-to-learn-which-BDS-support-bitm.patch [bz#1779893 bz#1779904] +- kvm-blockdev-Promote-several-bitmap-functions-to-non-sta.patch [bz#1779893 bz#1779904] +- kvm-blockdev-Split-off-basic-bitmap-operations-for-qemu-.patch [bz#1779893 bz#1779904] +- kvm-qemu-img-Add-bitmap-sub-command.patch [bz#1779893 bz#1779904] +- kvm-iotests-Fix-test-178.patch [bz#1779893 bz#1779904] +- kvm-qcow2-Expose-bitmaps-size-during-measure.patch [bz#1779893 bz#1779904] +- kvm-qemu-img-Factor-out-code-for-merging-bitmaps.patch [bz#1779893 bz#1779904] +- kvm-qemu-img-Add-convert-bitmaps-option.patch [bz#1779893 bz#1779904] +- kvm-iotests-Add-test-291-to-for-qemu-img-bitmap-coverage.patch [bz#1779893 bz#1779904] +- kvm-iotests-Add-more-skip_if_unsupported-statements-to-t.patch [bz#1778593] +- kvm-iotests-don-t-use-format-for-drive_add.patch [bz#1778593] +- kvm-iotests-055-refactor-compressed-backup-to-vmdk.patch [bz#1778593] +- kvm-iotests-055-skip-vmdk-target-tests-if-vmdk-is-not-wh.patch [bz#1778593] +- kvm-backup-Improve-error-for-bdrv_getlength-failure.patch [bz#1778593] +- kvm-backup-Make-sure-that-source-and-target-size-match.patch [bz#1778593] +- kvm-iotests-Backup-with-different-source-target-size.patch [bz#1778593] +- kvm-iotests-109-Don-t-mirror-with-mismatched-size.patch [bz#1778593] +- kvm-iotests-229-Use-blkdebug-to-inject-an-error.patch [bz#1778593] +- kvm-mirror-Make-sure-that-source-and-target-size-match.patch [bz#1778593] +- kvm-iotests-Mirror-with-different-source-target-size.patch [bz#1778593] +- Resolves: bz#1513681 + ([Intel 8.2.1 Feat] qemu-kvm PT VMX -- Fast Train) +- Resolves: bz#1778593 + (Qemu coredump when backup to a existing small size image) +- Resolves: bz#1779893 + (RFE: Copy bitmaps with qemu-img convert) +- Resolves: bz#1779904 + (RFE: ability to estimate bitmap space utilization for qcow2) +- Resolves: bz#1841038 + (qemu-img: /var/tmp/v2vovl56bced.qcow2: CURL: Error opening file: Server does not support 'range' (byte ranges) with HTTP/2 server in VMware ESXi 7) + +* Thu Jun 04 2020 Danilo Cesar Lemes de Paula - 4.2.0-23.el8 +- kvm-target-arm-Fix-PAuth-sbox-functions.patch [bz#1813940] +- kvm-Don-t-leak-memory-when-reallocation-fails.patch [bz#1749737] +- kvm-Replace-remaining-malloc-free-user-with-glib.patch [bz#1749737] +- kvm-Revert-RHEL-disable-hostmem-memfd.patch [bz#1839030] +- kvm-block-introducing-bdrv_co_delete_file-interface.patch [bz#1827630] +- kvm-block.c-adding-bdrv_co_delete_file.patch [bz#1827630] +- kvm-crypto.c-cleanup-created-file-when-block_crypto_co_c.patch [bz#1827630] +- Resolves: bz#1749737 + (CVE-2019-15890 qemu-kvm: QEMU: Slirp: use-after-free during packet reassembly [rhel-av-8]) +- Resolves: bz#1813940 + (CVE-2020-10702 virt:8.1/qemu-kvm: qemu: weak signature generation in Pointer Authentication support for ARM [rhel-av-8]) +- Resolves: bz#1827630 + (volume creation leaving uncleaned stuff behind on error (vol-clone/libvirt/qemu-kvm)) +- Resolves: bz#1839030 + (RFE: enable the "memfd" memory backend) + +* Mon May 25 2020 Danilo Cesar Lemes de Paula - 4.2.0-22.el8 +- kvm-block-always-fill-entire-LUKS-header-space-with-zero.patch [bz#1775462] +- kvm-numa-remove-not-needed-check.patch [bz#1600217] +- kvm-numa-properly-check-if-numa-is-supported.patch [bz#1600217] +- kvm-numa-Extend-CLI-to-provide-initiator-information-for.patch [bz#1600217] +- kvm-numa-Extend-CLI-to-provide-memory-latency-and-bandwi.patch [bz#1600217] +- kvm-numa-Extend-CLI-to-provide-memory-side-cache-informa.patch [bz#1600217] +- kvm-hmat-acpi-Build-Memory-Proximity-Domain-Attributes-S.patch [bz#1600217] +- kvm-hmat-acpi-Build-System-Locality-Latency-and-Bandwidt.patch [bz#1600217] +- kvm-hmat-acpi-Build-Memory-Side-Cache-Information-Struct.patch [bz#1600217] +- kvm-tests-numa-Add-case-for-QMP-build-HMAT.patch [bz#1600217] +- kvm-tests-bios-tables-test-add-test-cases-for-ACPI-HMAT.patch [bz#1600217] +- kvm-ACPI-add-expected-files-for-HMAT-tests-acpihmat.patch [bz#1600217] +- Resolves: bz#1600217 + ([Intel 8.2.1 FEAT] KVM ACPI HMAT support - qemu-kvm Fast Train) +- Resolves: bz#1775462 + (Creating luks-inside-qcow2 images with cluster_size=2k/4k will get a corrupted image) + +* Mon May 11 2020 Danilo Cesar Lemes de Paula - 4.2.0-21.el8 +- kvm-hw-pci-pcie-Forbid-hot-plug-if-it-s-disabled-on-the-.patch [bz#1820531] +- kvm-hw-pci-pcie-Replace-PCI_DEVICE-casts-with-existing-v.patch [bz#1820531] +- kvm-tools-virtiofsd-passthrough_ll-Fix-double-close.patch [bz#1817445] +- kvm-virtiofsd-add-rlimit-nofile-NUM-option.patch [bz#1817445] +- kvm-virtiofsd-stay-below-fs.file-max-sysctl-value-CVE-20.patch [bz#1817445] +- kvm-virtiofsd-jail-lo-proc_self_fd.patch [bz#1817445] +- kvm-virtiofsd-Show-submounts.patch [bz#1817445] +- kvm-virtiofsd-only-retain-file-system-capabilities.patch [bz#1817445] +- kvm-virtiofsd-drop-all-capabilities-in-the-wait-parent-p.patch [bz#1817445] +- Resolves: bz#1817445 + (CVE-2020-10717 virt:8.2/qemu-kvm: QEMU: virtiofsd: guest may open maximum file descriptor to cause DoS [rhel-av-8]) +- Resolves: bz#1820531 + (qmp command query-pci get wrong result after hotplug device under hotplug=off controller) + +* Fri May 01 2020 Jon Maloy - 4.2.0-20.el8 +- kvm-pcie_root_port-Add-hotplug-disabling-option.patch [bz#1790899] +- kvm-compat-disable-edid-for-virtio-gpu-ccw.patch [bz#1816793] +- Resolves: bz#1790899 + ([RFE] QEMU devices should have the option to enable/disable hotplug/unplug) +- Resolves: bz#1816793 + ('edid' compat handling missing for virtio-gpu-ccw) + +* Tue Apr 14 2020 Danilo Cesar Lemes de Paula - 4.2.0-19.el8_2 +- kvm-target-i386-do-not-set-unsupported-VMX-secondary-exe.patch [bz#1822682] +- Resolves: bz#1822682 + (QEMU-4.2 fails to start a VM on Azure) + +* Thu Apr 09 2020 Danilo Cesar Lemes de Paula - 4.2.0-18.el8_2 +- kvm-job-take-each-job-s-lock-individually-in-job_txn_app.patch [bz#1817621] +- kvm-replication-assert-we-own-context-before-job_cancel_.patch [bz#1817621] +- kvm-backup-don-t-acquire-aio_context-in-backup_clean.patch [bz#1817621] +- kvm-block-backend-Reorder-flush-pdiscard-function-defini.patch [bz#1817621] +- kvm-block-Increase-BB.in_flight-for-coroutine-and-sync-i.patch [bz#1817621] +- kvm-block-Fix-blk-in_flight-during-blk_wait_while_draine.patch [bz#1817621] +- Resolves: bz#1817621 + (Crash and deadlock with block jobs when using io-threads) + +* Mon Mar 30 2020 Danilo Cesar Lemes de Paula - 4.2.0-17.el8 +- kvm-block-pass-BlockDriver-reference-to-the-.bdrv_co_cre.patch [bz#1816007] +- kvm-block-trickle-down-the-fallback-image-creation-funct.patch [bz#1816007] +- kvm-Revert-mirror-Don-t-let-an-operation-wait-for-itself.patch [bz#1794692] +- kvm-mirror-Wait-only-for-in-flight-operations.patch [bz#1794692] +- Resolves: bz#1794692 + (Mirror block job stops making progress) +- Resolves: bz#1816007 + (qemu-img convert failed to convert with block device as target) + +* Tue Mar 24 2020 Danilo Cesar Lemes de Paula - 4.2.0-16.el8 +- kvm-migration-Rate-limit-inside-host-pages.patch [bz#1814336] +- kvm-build-sys-do-not-make-qemu-ga-link-with-pixman.patch [bz#1811670] +- Resolves: bz#1811670 + (Unneeded qemu-guest-agent dependency on pixman) +- Resolves: bz#1814336 + ([POWER9] QEMU migration-test triggers a kernel warning) + +* Tue Mar 17 2020 Danilo Cesar Lemes de Paula - 4.2.0-15.el8 +- kvm-block-nbd-Fix-hang-in-.bdrv_close.patch [bz#1640894] +- kvm-block-Generic-file-creation-fallback.patch [bz#1640894] +- kvm-file-posix-Drop-hdev_co_create_opts.patch [bz#1640894] +- kvm-iscsi-Drop-iscsi_co_create_opts.patch [bz#1640894] +- kvm-iotests-Add-test-for-image-creation-fallback.patch [bz#1640894] +- kvm-block-Fix-leak-in-bdrv_create_file_fallback.patch [bz#1640894] +- kvm-iotests-Use-complete_and_wait-in-155.patch [bz#1790482 bz#1805143] +- kvm-block-Introduce-bdrv_reopen_commit_post-step.patch [bz#1790482 bz#1805143] +- kvm-block-qcow2-Move-bitmap-reopen-into-bdrv_reopen_comm.patch [bz#1790482 bz#1805143] +- kvm-iotests-Refactor-blockdev-reopen-test-for-iothreads.patch [bz#1790482 bz#1805143] +- kvm-block-bdrv_reopen-with-backing-file-in-different-Aio.patch [bz#1790482 bz#1805143] +- kvm-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch [bz#1790482 bz#1805143] +- kvm-block-Make-bdrv_get_cumulative_perm-public.patch [bz#1790482 bz#1805143] +- kvm-block-Relax-restrictions-for-blockdev-snapshot.patch [bz#1790482 bz#1805143] +- kvm-iotests-Fix-run_job-with-use_log-False.patch [bz#1790482 bz#1805143] +- kvm-iotests-Test-mirror-with-temporarily-disabled-target.patch [bz#1790482 bz#1805143] +- kvm-block-Fix-cross-AioContext-blockdev-snapshot.patch [bz#1790482 bz#1805143] +- kvm-iotests-Add-iothread-cases-to-155.patch [bz#1790482 bz#1805143] +- kvm-qapi-Add-allow-write-only-overlay-feature-for-blockd.patch [bz#1790482 bz#1805143] +- kvm-exec-rom_reset-Free-rom-data-during-inmigrate-skip.patch [bz#1809380] +- Resolves: bz#1640894 + (Fix generic file creation fallback for qemu-img nvme:// image creation support) +- Resolves: bz#1790482 + (bitmaps in backing images can't be modified) +- Resolves: bz#1805143 + (allow late/lazy opening of backing chain for shallow blockdev-mirror) +- Resolves: bz#1809380 + (guest hang during reboot process after migration from RHEl7.8 to RHEL8.2.0.) + +* Wed Mar 11 2020 Danilo Cesar Lemes de Paula - 4.2.0-14.el8 +- kvm-hw-smbios-set-new-default-SMBIOS-fields-for-Windows-.patch [bz#1782529] +- kvm-migration-multifd-clean-pages-after-filling-packet.patch [bz#1738451] +- kvm-migration-Make-sure-that-we-don-t-call-write-in-case.patch [bz#1738451] +- kvm-migration-multifd-fix-nullptr-access-in-terminating-.patch [bz#1738451] +- kvm-migration-multifd-fix-destroyed-mutex-access-in-term.patch [bz#1738451] +- kvm-multifd-Make-sure-that-we-don-t-do-any-IO-after-an-e.patch [bz#1738451] +- kvm-qemu-file-Don-t-do-IO-after-shutdown.patch [bz#1738451] +- kvm-migration-Don-t-send-data-if-we-have-stopped.patch [bz#1738451] +- kvm-migration-Create-migration_is_running.patch [bz#1738451] +- kvm-migration-multifd-fix-nullptr-access-in-multifd_send.patch [bz#1738451] +- kvm-migration-Maybe-VM-is-paused-when-migration-is-cance.patch [bz#1738451] +- kvm-virtiofsd-Remove-fuse_req_getgroups.patch [bz#1797064] +- kvm-virtiofsd-fv_create_listen_socket-error-path-socket-.patch [bz#1797064] +- kvm-virtiofsd-load_capng-missing-unlock.patch [bz#1797064] +- kvm-virtiofsd-do_read-missing-NULL-check.patch [bz#1797064] +- kvm-tools-virtiofsd-fuse_lowlevel-Fix-fuse_out_header-er.patch [bz#1797064] +- kvm-virtiofsd-passthrough_ll-cleanup-getxattr-listxattr.patch [bz#1797064] +- kvm-virtiofsd-Fix-xattr-operations.patch [bz#1797064] +- Resolves: bz#1738451 + (qemu on src host core dump after set multifd-channels and do migration twice (first migration execute migrate_cancel)) +- Resolves: bz#1782529 + (Windows Update Enablement with default smbios strings in qemu) +- Resolves: bz#1797064 + (virtiofsd: Fixes) + +* Sat Feb 29 2020 Danilo Cesar Lemes de Paula - 4.2.0-13.el8 +- kvm-target-i386-kvm-initialize-feature-MSRs-very-early.patch [bz#1791648] +- kvm-target-i386-add-a-ucode-rev-property.patch [bz#1791648] +- kvm-target-i386-kvm-initialize-microcode-revision-from-K.patch [bz#1791648] +- kvm-target-i386-fix-TCG-UCODE_REV-access.patch [bz#1791648] +- kvm-target-i386-check-for-availability-of-MSR_IA32_UCODE.patch [bz#1791648] +- kvm-target-i386-enable-monitor-and-ucode-revision-with-c.patch [bz#1791648] +- kvm-qcow2-Fix-qcow2_alloc_cluster_abort-for-external-dat.patch [bz#1703907] +- kvm-mirror-Store-MirrorOp.co-for-debuggability.patch [bz#1794692] +- kvm-mirror-Don-t-let-an-operation-wait-for-itself.patch [bz#1794692] +- Resolves: bz#1703907 + ([upstream]QEMU coredump when converting to qcow2: external data file images on block devices with copy_offloading) +- Resolves: bz#1791648 + ([RFE] Passthrough host CPU microcode version to KVM guest if using CPU passthrough) +- Resolves: bz#1794692 + (Mirror block job stops making progress) + +* Mon Feb 24 2020 Danilo Cesar Lemes de Paula - 4.2.0-12.el8 +- kvm-vhost-user-gpu-Drop-trailing-json-comma.patch [bz#1805334] +- Resolves: bz#1805334 + (vhost-user/50-qemu-gpu.json is not valid JSON) + +* Sun Feb 23 2020 Danilo Cesar Lemes de Paula - 4.2.0-11.el8 +- kvm-spapr-Enable-DD2.3-accelerated-count-cache-flush-in-.patch [bz#1796240] +- kvm-util-add-slirp_fmt-helpers.patch [bz#1798994] +- kvm-tcp_emu-fix-unsafe-snprintf-usages.patch [bz#1798994] +- kvm-virtio-add-ability-to-delete-vq-through-a-pointer.patch [bz#1791590] +- kvm-virtio-make-virtio_delete_queue-idempotent.patch [bz#1791590] +- kvm-virtio-reset-region-cache-when-on-queue-deletion.patch [bz#1791590] +- kvm-virtio-net-delete-also-control-queue-when-TX-RX-dele.patch [bz#1791590] +- Resolves: bz#1791590 + ([Q35] No "DEVICE_DELETED" event in qmp after unplug virtio-net-pci device) +- Resolves: bz#1796240 + (Enable hw accelerated cache-count-flush by default for POWER9 DD2.3 cpus) +- Resolves: bz#1798994 + (CVE-2020-8608 qemu-kvm: QEMU: Slirp: potential OOB access due to unsafe snprintf() usages [rhel-av-8.2.0]) + +* Fri Feb 14 2020 Danilo Cesar Lemes de Paula - 4.2.0-10.el8 +- kvm-i386-Resolve-CPU-models-to-v1-by-default.patch [bz#1779078 bz#1787291 bz#1779078 bz#1779078] +- kvm-iotests-Support-job-complete-in-run_job.patch [bz#1781637] +- kvm-iotests-Create-VM.blockdev_create.patch [bz#1781637] +- kvm-block-Activate-recursively-even-for-already-active-n.patch [bz#1781637] +- kvm-hmp-Allow-using-qdev-ID-for-qemu-io-command.patch [bz#1781637] +- kvm-iotests-Test-external-snapshot-with-VM-state.patch [bz#1781637] +- kvm-iotests.py-Let-wait_migration-wait-even-more.patch [bz#1781637] +- kvm-blockdev-fix-coding-style-issues-in-drive_backup_pre.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-blockdev-unify-qmp_drive_backup-and-drive-backup-tra.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-blockdev-unify-qmp_blockdev_backup-and-blockdev-back.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-blockdev-honor-bdrv_try_set_aio_context-context-requ.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-backup-top-Begin-drain-earlier.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-block-backup-top-Don-t-acquire-context-while-droppin.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-blockdev-Acquire-AioContext-on-dirty-bitmap-function.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-blockdev-Return-bs-to-the-proper-context-on-snapshot.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-iotests-Test-handling-of-AioContexts-with-some-block.patch [bz#1745606 bz#1746217 bz#1773517 bz#1779036 bz#1782111 bz#1782175 bz#1783965] +- kvm-target-arm-monitor-query-cpu-model-expansion-crashed.patch [bz#1801320] +- kvm-docs-arm-cpu-features-Make-kvm-no-adjvtime-comment-c.patch [bz#1801320] +- Resolves: bz#1745606 + (Qemu hang when do incremental live backup in transaction mode without bitmap) +- Resolves: bz#1746217 + (Src qemu hang when do storage vm migration during guest installation) +- Resolves: bz#1773517 + (Src qemu hang when do storage vm migration with dataplane enable) +- Resolves: bz#1779036 + (Qemu coredump when do snapshot in transaction mode with one snapshot path not exist) +- Resolves: bz#1779078 + (RHVH 4.4: Failed to run VM on 4.3/4.4 engine (Exit message: the CPU is incompatible with host CPU: Host CPU does not provide required features: hle, rtm)) +- Resolves: bz#1781637 + (qemu crashed when do mem and disk snapshot) +- Resolves: bz#1782111 + (Qemu hang when do full backup on multi-disks with one job's 'job-id' missed in transaction mode(data plane enable)) +- Resolves: bz#1782175 + (Qemu core dump when add persistent bitmap(data plane enable)) +- Resolves: bz#1783965 + (Qemu core dump when do backup with sync: bitmap and no bitmap provided) +- Resolves: bz#1787291 + (RHVH 4.4: Failed to run VM on 4.3/4.4 engine (Exit message: the CPU is incompatible with host CPU: Host CPU does not provide required features: hle, rtm) [rhel-8.1.0.z]) +- Resolves: bz#1801320 + (aarch64: backport query-cpu-model-expansion and adjvtime document fixes) + +* Mon Feb 10 2020 Danilo Cesar Lemes de Paula - 4.2.0-9.el8 +- kvm-ppc-Deassert-the-external-interrupt-pin-in-KVM-on-re.patch [bz#1776638] +- kvm-xics-Don-t-deassert-outputs.patch [bz#1776638] +- kvm-ppc-Don-t-use-CPUPPCState-irq_input_state-with-moder.patch [bz#1776638] +- kvm-trace-update-qemu-trace-stap-to-Python-3.patch [bz#1787395] +- kvm-redhat-Remove-redundant-fix-for-qemu-trace-stap.patch [bz#1787395] +- kvm-iscsi-Cap-block-count-from-GET-LBA-STATUS-CVE-2020-1.patch [bz#1794503] +- kvm-tpm-ppi-page-align-PPI-RAM.patch [bz#1787444] +- kvm-target-arm-kvm-trivial-Clean-up-header-documentation.patch [bz#1647366] +- kvm-target-arm-kvm64-kvm64-cpus-have-timer-registers.patch [bz#1647366] +- kvm-tests-arm-cpu-features-Check-feature-default-values.patch [bz#1647366] +- kvm-target-arm-kvm-Implement-virtual-time-adjustment.patch [bz#1647366] +- kvm-target-arm-cpu-Add-the-kvm-no-adjvtime-CPU-property.patch [bz#1647366] +- kvm-migration-Define-VMSTATE_INSTANCE_ID_ANY.patch [bz#1529231] +- kvm-migration-Change-SaveStateEntry.instance_id-into-uin.patch [bz#1529231] +- kvm-apic-Use-32bit-APIC-ID-for-migration-instance-ID.patch [bz#1529231] +- Resolves: bz#1529231 + ([q35] VM hangs after migration with 200 vCPUs) +- Resolves: bz#1647366 + (aarch64: Add support for the kvm-no-adjvtime ARM CPU feature) +- Resolves: bz#1776638 + (Guest failed to boot up after system_reset 20 times) +- Resolves: bz#1787395 + (qemu-trace-stap list : TypeError: startswith first arg must be bytes or a tuple of bytes, not str) +- Resolves: bz#1787444 + (Broken postcopy migration with vTPM device) +- Resolves: bz#1794503 + (CVE-2020-1711 qemu-kvm: QEMU: block: iscsi: OOB heap access via an unexpected response of iSCSI Server [rhel-av-8.2.0]) + +* Fri Jan 31 2020 Miroslav Rezanina - 4.2.0-8.el8 +- kvm-target-arm-arch_dump-Add-SVE-notes.patch [bz#1725084] +- kvm-vhost-Add-names-to-section-rounded-warning.patch [bz#1779041] +- kvm-vhost-Only-align-sections-for-vhost-user.patch [bz#1779041] +- kvm-vhost-coding-style-fix.patch [bz#1779041] +- kvm-virtio-fs-fix-MSI-X-nvectors-calculation.patch [bz#1694164] +- kvm-vhost-user-fs-remove-vhostfd-property.patch [bz#1694164] +- kvm-build-rename-CONFIG_LIBCAP-to-CONFIG_LIBCAP_NG.patch [bz#1694164] +- kvm-virtiofsd-Pull-in-upstream-headers.patch [bz#1694164] +- kvm-virtiofsd-Pull-in-kernel-s-fuse.h.patch [bz#1694164] +- kvm-virtiofsd-Add-auxiliary-.c-s.patch [bz#1694164] +- kvm-virtiofsd-Add-fuse_lowlevel.c.patch [bz#1694164] +- kvm-virtiofsd-Add-passthrough_ll.patch [bz#1694164] +- kvm-virtiofsd-Trim-down-imported-files.patch [bz#1694164] +- kvm-virtiofsd-Format-imported-files-to-qemu-style.patch [bz#1694164] +- kvm-virtiofsd-remove-mountpoint-dummy-argument.patch [bz#1694164] +- kvm-virtiofsd-remove-unused-notify-reply-support.patch [bz#1694164] +- kvm-virtiofsd-Remove-unused-enum-fuse_buf_copy_flags.patch [bz#1694164] +- kvm-virtiofsd-Fix-fuse_daemonize-ignored-return-values.patch [bz#1694164] +- kvm-virtiofsd-Fix-common-header-and-define-for-QEMU-buil.patch [bz#1694164] +- kvm-virtiofsd-Trim-out-compatibility-code.patch [bz#1694164] +- kvm-vitriofsd-passthrough_ll-fix-fallocate-ifdefs.patch [bz#1694164] +- kvm-virtiofsd-Make-fsync-work-even-if-only-inode-is-pass.patch [bz#1694164] +- kvm-virtiofsd-Add-options-for-virtio.patch [bz#1694164] +- kvm-virtiofsd-add-o-source-PATH-to-help-output.patch [bz#1694164] +- kvm-virtiofsd-Open-vhost-connection-instead-of-mounting.patch [bz#1694164] +- kvm-virtiofsd-Start-wiring-up-vhost-user.patch [bz#1694164] +- kvm-virtiofsd-Add-main-virtio-loop.patch [bz#1694164] +- kvm-virtiofsd-get-set-features-callbacks.patch [bz#1694164] +- kvm-virtiofsd-Start-queue-threads.patch [bz#1694164] +- kvm-virtiofsd-Poll-kick_fd-for-queue.patch [bz#1694164] +- kvm-virtiofsd-Start-reading-commands-from-queue.patch [bz#1694164] +- kvm-virtiofsd-Send-replies-to-messages.patch [bz#1694164] +- kvm-virtiofsd-Keep-track-of-replies.patch [bz#1694164] +- kvm-virtiofsd-Add-Makefile-wiring-for-virtiofsd-contrib.patch [bz#1694164] +- kvm-virtiofsd-Fast-path-for-virtio-read.patch [bz#1694164] +- kvm-virtiofsd-add-fd-FDNUM-fd-passing-option.patch [bz#1694164] +- kvm-virtiofsd-make-f-foreground-the-default.patch [bz#1694164] +- kvm-virtiofsd-add-vhost-user.json-file.patch [bz#1694164] +- kvm-virtiofsd-add-print-capabilities-option.patch [bz#1694164] +- kvm-virtiofs-Add-maintainers-entry.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-create-new-files-in-caller-.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-lo_map-for-ino-fh-indir.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-ino_map-to-hide-lo_inod.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-dirp_map-to-hide-lo_dir.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-fd_map-to-hide-file-des.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-fallback-for-racy-ops.patch [bz#1694164] +- kvm-virtiofsd-validate-path-components.patch [bz#1694164] +- kvm-virtiofsd-Plumb-fuse_bufvec-through-to-do_write_buf.patch [bz#1694164] +- kvm-virtiofsd-Pass-write-iov-s-all-the-way-through.patch [bz#1694164] +- kvm-virtiofsd-add-fuse_mbuf_iter-API.patch [bz#1694164] +- kvm-virtiofsd-validate-input-buffer-sizes-in-do_write_bu.patch [bz#1694164] +- kvm-virtiofsd-check-input-buffer-size-in-fuse_lowlevel.c.patch [bz#1694164] +- kvm-virtiofsd-prevent-.-escape-in-lo_do_lookup.patch [bz#1694164] +- kvm-virtiofsd-prevent-.-escape-in-lo_do_readdir.patch [bz#1694164] +- kvm-virtiofsd-use-proc-self-fd-O_PATH-file-descriptor.patch [bz#1694164] +- kvm-virtiofsd-sandbox-mount-namespace.patch [bz#1694164] +- kvm-virtiofsd-move-to-an-empty-network-namespace.patch [bz#1694164] +- kvm-virtiofsd-move-to-a-new-pid-namespace.patch [bz#1694164] +- kvm-virtiofsd-add-seccomp-whitelist.patch [bz#1694164] +- kvm-virtiofsd-Parse-flag-FUSE_WRITE_KILL_PRIV.patch [bz#1694164] +- kvm-virtiofsd-cap-ng-helpers.patch [bz#1694164] +- kvm-virtiofsd-Drop-CAP_FSETID-if-client-asked-for-it.patch [bz#1694164] +- kvm-virtiofsd-set-maximum-RLIMIT_NOFILE-limit.patch [bz#1694164] +- kvm-virtiofsd-fix-libfuse-information-leaks.patch [bz#1694164] +- kvm-virtiofsd-add-syslog-command-line-option.patch [bz#1694164] +- kvm-virtiofsd-print-log-only-when-priority-is-high-enoug.patch [bz#1694164] +- kvm-virtiofsd-Add-ID-to-the-log-with-FUSE_LOG_DEBUG-leve.patch [bz#1694164] +- kvm-virtiofsd-Add-timestamp-to-the-log-with-FUSE_LOG_DEB.patch [bz#1694164] +- kvm-virtiofsd-Handle-reinit.patch [bz#1694164] +- kvm-virtiofsd-Handle-hard-reboot.patch [bz#1694164] +- kvm-virtiofsd-Kill-threads-when-queues-are-stopped.patch [bz#1694164] +- kvm-vhost-user-Print-unexpected-slave-message-types.patch [bz#1694164] +- kvm-contrib-libvhost-user-Protect-slave-fd-with-mutex.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-add-renameat2-support.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-disable-readdirplus-on-cach.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-control-readdirplus.patch [bz#1694164] +- kvm-virtiofsd-rename-unref_inode-to-unref_inode_lolocked.patch [bz#1694164] +- kvm-virtiofsd-fail-when-parent-inode-isn-t-known-in-lo_d.patch [bz#1694164] +- kvm-virtiofsd-extract-root-inode-init-into-setup_root.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-clean-up-cache-related-opti.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-use-hashtable.patch [bz#1694164] +- kvm-virtiofsd-Clean-up-inodes-on-destroy.patch [bz#1694164] +- kvm-virtiofsd-support-nanosecond-resolution-for-file-tim.patch [bz#1694164] +- kvm-virtiofsd-fix-error-handling-in-main.patch [bz#1694164] +- kvm-virtiofsd-cleanup-allocated-resource-in-se.patch [bz#1694164] +- kvm-virtiofsd-fix-memory-leak-on-lo.source.patch [bz#1694164] +- kvm-virtiofsd-add-helper-for-lo_data-cleanup.patch [bz#1694164] +- kvm-virtiofsd-Prevent-multiply-running-with-same-vhost_u.patch [bz#1694164] +- kvm-virtiofsd-enable-PARALLEL_DIROPS-during-INIT.patch [bz#1694164] +- kvm-virtiofsd-fix-incorrect-error-handling-in-lo_do_look.patch [bz#1694164] +- kvm-Virtiofsd-fix-memory-leak-on-fuse-queueinfo.patch [bz#1694164] +- kvm-virtiofsd-Support-remote-posix-locks.patch [bz#1694164] +- kvm-virtiofsd-use-fuse_lowlevel_is_virtio-in-fuse_sessio.patch [bz#1694164] +- kvm-virtiofsd-prevent-fv_queue_thread-vs-virtio_loop-rac.patch [bz#1694164] +- kvm-virtiofsd-make-lo_release-atomic.patch [bz#1694164] +- kvm-virtiofsd-prevent-races-with-lo_dirp_put.patch [bz#1694164] +- kvm-virtiofsd-rename-inode-refcount-to-inode-nlookup.patch [bz#1694164] +- kvm-libvhost-user-Fix-some-memtable-remap-cases.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-fix-refcounting-on-remove-r.patch [bz#1694164] +- kvm-virtiofsd-introduce-inode-refcount-to-prevent-use-af.patch [bz#1694164] +- kvm-virtiofsd-do-not-always-set-FUSE_FLOCK_LOCKS.patch [bz#1694164] +- kvm-virtiofsd-convert-more-fprintf-and-perror-to-use-fus.patch [bz#1694164] +- kvm-virtiofsd-Reset-O_DIRECT-flag-during-file-open.patch [bz#1694164] +- kvm-virtiofsd-Fix-data-corruption-with-O_APPEND-write-in.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-Use-cache_readdir-for-direc.patch [bz#1694164] +- kvm-virtiofsd-add-definition-of-fuse_buf_writev.patch [bz#1694164] +- kvm-virtiofsd-use-fuse_buf_writev-to-replace-fuse_buf_wr.patch [bz#1694164] +- kvm-virtiofsd-process-requests-in-a-thread-pool.patch [bz#1694164] +- kvm-virtiofsd-prevent-FUSE_INIT-FUSE_DESTROY-races.patch [bz#1694164] +- kvm-virtiofsd-fix-lo_destroy-resource-leaks.patch [bz#1694164] +- kvm-virtiofsd-add-thread-pool-size-NUM-option.patch [bz#1694164] +- kvm-virtiofsd-Convert-lo_destroy-to-take-the-lo-mutex-lo.patch [bz#1694164] +- kvm-virtiofsd-passthrough_ll-Pass-errno-to-fuse_reply_er.patch [bz#1694164] +- kvm-virtiofsd-stop-all-queue-threads-on-exit-in-virtio_l.patch [bz#1694164] +- kvm-virtiofsd-add-some-options-to-the-help-message.patch [bz#1694164] +- kvm-redhat-ship-virtiofsd-vhost-user-device-backend.patch [bz#1694164] +- Resolves: bz#1694164 + (virtio-fs: host<->guest shared file system (qemu)) +- Resolves: bz#1725084 + (aarch64: support dumping SVE registers) +- Resolves: bz#1779041 + (netkvm: no connectivity Windows guest with q35 + hugepages + vhost + hv_synic) + +* Tue Jan 21 2020 Miroslav Rezanina - 4.2.0-7.el8 +- kvm-tcp_emu-Fix-oob-access.patch [bz#1791568] +- kvm-slirp-use-correct-size-while-emulating-IRC-commands.patch [bz#1791568] +- kvm-slirp-use-correct-size-while-emulating-commands.patch [bz#1791568] +- kvm-RHEL-hw-i386-disable-nested-PERF_GLOBAL_CTRL-MSR-sup.patch [bz#1559846] +- Resolves: bz#1559846 + (Nested KVM: limit VMX features according to CPU models - Fast Train) +- Resolves: bz#1791568 + (CVE-2020-7039 qemu-kvm: QEMU: slirp: OOB buffer access while emulating tcp protocols in tcp_emu() [rhel-av-8.2.0]) + +* Wed Jan 15 2020 Danilo Cesar Lemes de Paula - 4.2.0-6.el8 +- kvm-spapr-Don-t-trigger-a-CAS-reboot-for-XICS-XIVE-mode-.patch [bz#1733893] +- kvm-vfio-pci-Don-t-remove-irqchip-notifier-if-not-regist.patch [bz#1782678] +- kvm-virtio-don-t-enable-notifications-during-polling.patch [bz#1789301] +- kvm-usbredir-Prevent-recursion-in-usbredir_write.patch [bz#1790844] +- kvm-xhci-recheck-slot-status.patch [bz#1790844] +- Resolves: bz#1733893 + (Boot a guest with "-prom-env 'auto-boot?=false'", SLOF failed to enter the boot entry after input "boot" followed by "0 > " on VNC) +- Resolves: bz#1782678 + (qemu core dump after hot-unplugging the XXV710/XL710 PF) +- Resolves: bz#1789301 + (virtio-blk/scsi: fix notification suppression during AioContext polling) +- Resolves: bz#1790844 + (USB related fixes) + +* Tue Jan 07 2020 Danilo Cesar Lemes de Paula - 4.2.0-5.el8 +- kvm-i386-Remove-cpu64-rhel6-CPU-model.patch [bz#1741345] +- kvm-Reallocate-dirty_bmap-when-we-change-a-slot.patch [bz#1772774] +- Resolves: bz#1741345 + (Remove the "cpu64-rhel6" CPU from qemu-kvm) +- Resolves: bz#1772774 + (qemu-kvm core dump during migration+reboot ( Assertion `mem->dirty_bmap' failed )) + +* Fri Dec 13 2019 Danilo Cesar Lemes de Paula - 4.2.0-4.el8 +- Rebase to qemu-4.2 +- Resolves: bz#1783250 + (rebase qemu-kvm to 4.2) + +* Tue Dec 10 2019 Danilo Cesar Lemes de Paula - 4.1.0-18.el8 +- kvm-LUKS-support-preallocation.patch [bz#1534951] +- kvm-nbd-add-empty-.bdrv_reopen_prepare.patch [bz#1718727] +- kvm-qdev-qbus-add-hidden-device-support.patch [bz#1757796] +- kvm-pci-add-option-for-net-failover.patch [bz#1757796] +- kvm-pci-mark-devices-partially-unplugged.patch [bz#1757796] +- kvm-pci-mark-device-having-guest-unplug-request-pending.patch [bz#1757796] +- kvm-qapi-add-unplug-primary-event.patch [bz#1757796] +- kvm-qapi-add-failover-negotiated-event.patch [bz#1757796] +- kvm-migration-allow-unplug-during-migration-for-failover.patch [bz#1757796] +- kvm-migration-add-new-migration-state-wait-unplug.patch [bz#1757796] +- kvm-libqos-tolerate-wait-unplug-migration-state.patch [bz#1757796] +- kvm-net-virtio-add-failover-support.patch [bz#1757796] +- kvm-vfio-unplug-failover-primary-device-before-migration.patch [bz#1757796] +- kvm-net-virtio-fix-dev_unplug_pending.patch [bz#1757796] +- kvm-net-virtio-return-early-when-failover-primary-alread.patch [bz#1757796] +- kvm-net-virtio-fix-re-plugging-of-primary-device.patch [bz#1757796] +- kvm-net-virtio-return-error-when-device_opts-arg-is-NULL.patch [bz#1757796] +- kvm-vfio-don-t-ignore-return-value-of-migrate_add_blocke.patch [bz#1757796] +- kvm-hw-vfio-pci-Fix-double-free-of-migration_blocker.patch [bz#1757796] +- Resolves: bz#1534951 + (RFE: Support preallocation mode for luks format) +- Resolves: bz#1718727 + (Committing changes to the backing file over NBD fails with reopening files not supported) +- Resolves: bz#1757796 + (RFE: support for net failover devices in qemu) + +* Mon Dec 02 2019 Danilo Cesar Lemes de Paula - 4.1.0-17.el8 +- kvm-qemu-pr-helper-fix-crash-in-mpath_reconstruct_sense.patch [bz#1772322] +- Resolves: bz#1772322 + (qemu-pr-helper: fix crash in mpath_reconstruct_sense) + +* Wed Nov 27 2019 Danilo Cesar Lemes de Paula - 4.1.0-16.el8 +- kvm-curl-Keep-pointer-to-the-CURLState-in-CURLSocket.patch [bz#1745209] +- kvm-curl-Keep-socket-until-the-end-of-curl_sock_cb.patch [bz#1745209] +- kvm-curl-Check-completion-in-curl_multi_do.patch [bz#1745209] +- kvm-curl-Pass-CURLSocket-to-curl_multi_do.patch [bz#1745209] +- kvm-curl-Report-only-ready-sockets.patch [bz#1745209] +- kvm-curl-Handle-success-in-multi_check_completion.patch [bz#1745209] +- kvm-curl-Check-curl_multi_add_handle-s-return-code.patch [bz#1745209] +- kvm-vhost-user-save-features-if-the-char-dev-is-closed.patch [bz#1738768] +- kvm-block-snapshot-Restrict-set-of-snapshot-nodes.patch [bz#1658981] +- kvm-iotests-Test-internal-snapshots-with-blockdev.patch [bz#1658981] +- kvm-qapi-Add-feature-flags-to-commands-in-qapi-introspec.patch [bz#1658981] +- kvm-qapi-Allow-introspecting-fix-for-savevm-s-cooperatio.patch [bz#1658981] +- kvm-block-Remove-backing-null-from-bs-explicit_-options.patch [bz#1773925] +- kvm-iotests-Test-multiple-blockdev-snapshot-calls.patch [bz#1773925] +- Resolves: bz#1658981 + (qemu failed to create internal snapshot via 'savevm' when using blockdev) +- Resolves: bz#1738768 + (Guest fails to recover receiving packets after vhost-user reconnect) +- Resolves: bz#1745209 + (qemu-img gets stuck when stream-converting from http) +- Resolves: bz#1773925 + (Fail to do blockcommit with more than one snapshots) + +* Thu Nov 14 2019 Danilo Cesar Lemes de Paula - 4.1.0-15.el8 +- kvm-virtio-blk-Add-blk_drain-to-virtio_blk_device_unreal.patch [bz#1706759] +- kvm-Revert-qcow2-skip-writing-zero-buffers-to-empty-COW-.patch [bz#1772473] +- kvm-coroutine-Add-qemu_co_mutex_assert_locked.patch [bz#1772473] +- kvm-qcow2-Fix-corruption-bug-in-qcow2_detect_metadata_pr.patch [bz#1772473] +- Resolves: bz#1706759 + (qemu core dump when unplug a 16T GPT type disk from win2019 guest) +- Resolves: bz#1772473 + (Import fixes from 8.1.0 into 8.1.1 branch) + +* Tue Oct 29 2019 Danilo Cesar Lemes de Paula - 4.1.0-14.el8 +- kvm-Revert-qcow2-skip-writing-zero-buffers-to-empty-COW-.patch [bz#1751934] +- kvm-coroutine-Add-qemu_co_mutex_assert_locked.patch [bz#1764721] +- kvm-qcow2-Fix-corruption-bug-in-qcow2_detect_metadata_pr.patch [bz#1764721] +- Resolves: bz#1751934 + (Fail to install guest when xfs is the host filesystem) +- Resolves: bz#1764721 + (qcow2 image corruption due to incorrect locking in preallocation detection) + +* Fri Sep 27 2019 Danilo Cesar Lemes de Paula - 4.1.0-13.el8 +- kvm-nbd-server-attach-client-channel-to-the-export-s-Aio.patch [bz#1748253] +- kvm-virtio-blk-schedule-virtio_notify_config-to-run-on-m.patch [bz#1744955] +- Resolves: bz#1744955 + (Qemu hang when block resize a qcow2 image) +- Resolves: bz#1748253 + (QEMU crashes (core dump) when using the integrated NDB server with data-plane) + +* Thu Sep 26 2019 Danilo Cesar Lemes de Paula - 4.1.0-12.el8 +- kvm-block-Use-QEMU_IS_ALIGNED.patch [bz#1745922] +- kvm-block-qcow2-Fix-corruption-introduced-by-commit-8ac0.patch [bz#1745922] +- kvm-block-qcow2-refactor-encryption-code.patch [bz#1745922] +- kvm-qemu-iotests-Add-test-for-bz-1745922.patch [bz#1745922] +- Resolves: bz#1745922 + (Luks-inside-qcow2 snapshot cannot boot after 'qemu-img rebase') + +* Mon Sep 23 2019 Danilo Cesar Lemes de Paula - 4.1.0-11.el8 +- kvm-blockjob-update-nodes-head-while-removing-all-bdrv.patch [bz#1746631] +- kvm-hostmem-file-fix-pmem-file-size-check.patch [bz#1724008 bz#1736788] +- kvm-memory-fetch-pmem-size-in-get_file_size.patch [bz#1724008 bz#1736788] +- kvm-pr-manager-Fix-invalid-g_free-crash-bug.patch [bz#1753992] +- Resolves: bz#1724008 + (QEMU core dumped "memory_region_get_ram_ptr: Assertion `mr->ram_block' failed") +- Resolves: bz#1736788 + (QEMU core dumped if boot guest with nvdimm backed by /dev/dax0.0 and option pmem=off) +- Resolves: bz#1746631 + (Qemu core dump when do block commit under stress) +- Resolves: bz#1753992 + (core dump when testing persistent reservation in guest) + +* Mon Sep 16 2019 Danilo Cesar Lemes de Paula - 4.1.0-10.el8 +- kvm-spapr-xive-Mask-the-EAS-when-allocating-an-IRQ.patch [bz#1748725] +- kvm-block-create-Do-not-abort-if-a-block-driver-is-not-a.patch [bz#1746267] +- kvm-virtio-blk-Cancel-the-pending-BH-when-the-dataplane-.patch [bz#1717321] +- kvm-Using-ip_deq-after-m_free-might-read-pointers-from-a.patch [bz#1749737] +- Resolves: bz#1717321 + (qemu-kvm core dumped when repeat "system_reset" multiple times during guest boot) +- Resolves: bz#1746267 + (qemu coredump: qemu-kvm: block/create.c:68: qmp_blockdev_create: Assertion `drv' failed) +- Resolves: bz#1748725 + ([ppc][migration][v6.3-rc1-p1ce8930]basic migration failed with "qemu-kvm: KVM_SET_DEVICE_ATTR failed: Group 3 attr 0x0000000000001309: Device or resource busy") +- Resolves: bz#1749737 + (CVE-2019-15890 qemu-kvm: QEMU: Slirp: use-after-free during packet reassembly [rhel-av-8]) + +* Tue Sep 10 2019 Danilo Cesar Lemes de Paula - 4.1.0-9.el8 +- kvm-migration-always-initialise-ram_counters-for-a-new-m.patch [bz#1734316] +- kvm-migration-add-qemu_file_update_transfer-interface.patch [bz#1734316] +- kvm-migration-add-speed-limit-for-multifd-migration.patch [bz#1734316] +- kvm-migration-update-ram_counters-for-multifd-sync-packe.patch [bz#1734316] +- kvm-spapr-pci-Consolidate-de-allocation-of-MSIs.patch [bz#1750200] +- kvm-spapr-pci-Free-MSIs-during-reset.patch [bz#1750200] +- Resolves: bz#1734316 + (multifd migration does not honour speed limits, consumes entire bandwidth of NIC) +- Resolves: bz#1750200 + ([RHEL8.1][QEMU4.1]boot up guest with vf device,then system_reset guest,error prompt(qemu-kvm: Can't allocate MSIs for device 2800: IRQ 4904 is not free)) + +* Mon Sep 09 2019 Danilo Cesar Lemes de Paula - 4.1.0-8.el8 +- kvm-migration-Do-not-re-read-the-clock-on-pre_save-in-ca.patch [bz#1747836] +- kvm-ehci-fix-queue-dev-null-ptr-dereference.patch [bz#1746790] +- kvm-spapr-Use-SHUTDOWN_CAUSE_SUBSYSTEM_RESET-for-CAS-reb.patch [bz#1743477] +- kvm-file-posix-Handle-undetectable-alignment.patch [bz#1749134] +- kvm-block-posix-Always-allocate-the-first-block.patch [bz#1749134] +- kvm-iotests-Test-allocate_first_block-with-O_DIRECT.patch [bz#1749134] +- Resolves: bz#1743477 + (Since bd94bc06479a "spapr: change default interrupt mode to 'dual'", QEMU resets the machine to select the appropriate interrupt controller. And -no-reboot prevents that.) +- Resolves: bz#1746790 + (qemu core dump while migrate from RHEL7.6 to RHEL8.1) +- Resolves: bz#1747836 + (Call traces after guest migration due to incorrect handling of the timebase) +- Resolves: bz#1749134 + (I/O error when virtio-blk disk is backed by a raw image on 4k disk) + +* Fri Sep 06 2019 Danilo Cesar Lemes de Paula - 4.1.0-7.el8 +- kvm-trace-Clarify-DTrace-SystemTap-help-message.patch [bz#1516220] +- kvm-socket-Add-backlog-parameter-to-socket_listen.patch [bz#1726898] +- kvm-socket-Add-num-connections-to-qio_channel_socket_syn.patch [bz#1726898] +- kvm-socket-Add-num-connections-to-qio_channel_socket_asy.patch [bz#1726898] +- kvm-socket-Add-num-connections-to-qio_net_listener_open_.patch [bz#1726898] +- kvm-multifd-Use-number-of-channels-as-listen-backlog.patch [bz#1726898] +- kvm-pseries-Fix-compat_pvr-on-reset.patch [bz#1744107] +- kvm-spapr-Set-compat-mode-in-spapr_core_plug.patch [bz#1744107] +- Resolves: bz#1516220 + (-trace help prints an incomplete list of trace events) +- Resolves: bz#1726898 + (Parallel migration fails with error "Unable to write to socket: Connection reset by peer" now and then) +- Resolves: bz#1744107 + (Migration from P8(qemu4.1) to P9(qemu4.1), after migration, qemu crash on destination with error message "qemu-kvm: error while loading state for instance 0x1 of device 'cpu'") + +* Wed Sep 04 2019 Danilo Cesar Lemes de Paula - 4.1.0-6.el8 +- kvm-memory-Refactor-memory_region_clear_coalescing.patch [bz#1743142] +- kvm-memory-Split-zones-when-do-coalesced_io_del.patch [bz#1743142] +- kvm-memory-Remove-has_coalesced_range-counter.patch [bz#1743142] +- kvm-memory-Fix-up-memory_region_-add-del-_coalescing.patch [bz#1743142] +- kvm-enable-virgl-for-real-this-time.patch [bz#1559740] +- Resolves: bz#1559740 + ([RFE] Enable virgl as TechPreview (qemu)) +- Resolves: bz#1743142 + (Boot guest with multiple e1000 devices, qemu will crash after several guest reboots: kvm_mem_ioeventfd_add: error adding ioeventfd: No space left on device (28)) + +* Tue Aug 27 2019 Danilo Cesar Lemes de Paula - 4.1.0-5.el8 +- kvm-redhat-s390x-Rename-s390-ccw-virtio-rhel8.0.0-to-s39.patch [bz#1693772] +- kvm-redhat-s390x-Add-proper-compatibility-options-for-th.patch [bz#1693772] +- kvm-enable-virgl.patch [bz#1559740] +- kvm-redhat-update-pseries-rhel8.1.0-machine-type.patch [bz#1744170] +- kvm-Do-not-run-iotests-on-brew-build.patch [bz#1742197 bz#1742819] +- Resolves: bz#1559740 + ([RFE] Enable virgl as TechPreview (qemu)) +- Resolves: bz#1693772 + ([IBM zKVM] RHEL AV 8.1.0 machine type update for s390x) +- Resolves: bz#1742197 + (Remove iotests from qemu-kvm builds [RHEL AV 8.1.0]) +- Resolves: bz#1742819 + (Remove iotests from qemu-kvm builds [RHEL 8.1.0]) +- Resolves: bz#1744170 + ([IBM Power] New 8.1.0 machine type for pseries) + +* Tue Aug 20 2019 Danilo Cesar Lemes de Paula - 4.1.0-4.el8 +- kvm-RHEL-disable-hostmem-memfd.patch [bz#1738626 bz#1740797] +- Resolves: bz#1738626 + (Disable memfd in QEMU) +- Resolves: bz#1740797 + (Disable memfd in QEMU) + +* Mon Aug 19 2019 Danilo Cesar Lemes de Paula - 4.1.0-3.el8 +- kvm-x86-machine-types-pc_rhel_8_0_compat.patch [bz#1719649] +- kvm-x86-machine-types-q35-Fixup-units_per_default_bus.patch [bz#1719649] +- kvm-x86-machine-types-Fixup-dynamic-sysbus-entries.patch [bz#1719649] +- kvm-x86-machine-types-add-pc-q35-rhel8.1.0.patch [bz#1719649] +- kvm-machine-types-Update-hw_compat_rhel_8_0-from-hw_comp.patch [bz#1719649] +- kvm-virtio-Make-disable-legacy-disable-modern-compat-pro.patch [bz#1719649] +- Resolves: bz#1719649 + (8.1 machine type for x86) + +* Mon Aug 19 2019 Danilo Cesar Lemes de Paula - 4.1.0-2.el8 +- kvm-spec-Update-seavgabios-dependency.patch [bz#1725664] +- kvm-pc-Don-t-make-die-id-mandatory-unless-necessary.patch [bz#1741451] +- kvm-display-bochs-fix-pcie-support.patch [bz#1733977 bz#1740692] +- kvm-spapr-Reset-CAS-IRQ-subsystem-after-devices.patch [bz#1733977] +- kvm-spapr-xive-Fix-migration-of-hot-plugged-CPUs.patch [bz#1733977] +- kvm-riscv-roms-Fix-make-rules-for-building-sifive_u-bios.patch [bz#1733977 bz#1740692] +- kvm-Update-version-for-v4.1.0-release.patch [bz#1733977 bz#1740692] +- Resolves: bz#1725664 + (Update seabios dependency) +- Resolves: bz#1733977 + (Qemu core dumped: /home/ngu/qemu/hw/intc/xics_kvm.c:321: ics_kvm_set_irq: Assertion `kernel_xics_fd != -1' failed) +- Resolves: bz#1740692 + (Backport QEMU 4.1.0 rc5 & ga patches) +- Resolves: bz#1741451 + (Failed to hot-plug vcpus) + +* Wed Aug 14 2019 Miroslav Rezanina - 4.1.0-1.el8 +- Rebase to qemu 4.1.0 rc4 [bz#1705235] +- Resolves: bz#1705235 + (Rebase qemu-kvm for RHEL-AV 8.1.0) + +* Tue Jul 23 2019 Danilo Cesar Lemes de Paula - 4.0.0-6.el8 +- kvm-x86_64-rh-devices-add-missing-TPM-passthrough.patch [bz#1519013] +- kvm-x86_64-rh-devices-enable-TPM-emulation.patch [bz#1519013] +- kvm-vfio-increase-the-cap-on-number-of-assigned-devices-.patch [bz#1719823] +- Resolves: bz#1519013 + ([RFE] QEMU Software TPM support (vTPM, or TPM emulation)) +- Resolves: bz#1719823 + ([RHEL 8.1] [RFE] increase the maximum of vfio devices to more than 32 in qemu-kvm) + +* Mon Jul 08 2019 Miroslav Rezanina - 4.0.0-5.el8 +- kvm-qemu-kvm.spec-bump-libseccomp-2.4.0.patch [bz#1720306] +- kvm-qxl-check-release-info-object.patch [bz#1712717] +- kvm-target-i386-add-MDS-NO-feature.patch [bz#1722839] +- kvm-block-file-posix-Unaligned-O_DIRECT-block-status.patch [bz#1588356] +- kvm-iotests-Test-unaligned-raw-images-with-O_DIRECT.patch [bz#1588356] +- kvm-rh-set-CONFIG_BOCHS_DISPLAY-y-for-x86.patch [bz#1707118] +- Resolves: bz#1588356 + (qemu crashed on the source host when do storage migration with source qcow2 disk created by 'qemu-img') +- Resolves: bz#1707118 + (enable device: bochs-display (QEMU)) +- Resolves: bz#1712717 + (CVE-2019-12155 qemu-kvm: QEMU: qxl: null pointer dereference while releasing spice resources [rhel-av-8]) +- Resolves: bz#1720306 + (VM failed to start with error "failed to install seccomp syscall filter in the kernel") +- Resolves: bz#1722839 + ([Intel 8.1 FEAT] MDS_NO exposure to guest - Fast Train) + +* Tue Jun 11 2019 Danilo Cesar Lemes de Paula - 4.0.0-4.el8 +- kvm-Disable-VXHS-support.patch [bz#1714937] +- kvm-aarch64-Add-virt-rhel8.1.0-machine-type-for-ARM.patch [bz#1713735] +- kvm-aarch64-Allow-ARM-VIRT-iommu-option-in-RHEL8.1-machi.patch [bz#1713735] +- kvm-usb-call-reset-handler-before-updating-state.patch [bz#1713679] +- kvm-usb-host-skip-reset-for-untouched-devices.patch [bz#1713679] +- kvm-usb-host-avoid-libusb_set_configuration-calls.patch [bz#1713679] +- kvm-aarch64-Compile-out-IOH3420.patch [bz#1627283] +- kvm-vl-Fix-drive-blockdev-persistent-reservation-managem.patch [bz#1714891] +- kvm-vl-Document-why-objects-are-delayed.patch [bz#1714891] +- Resolves: bz#1627283 + (Compile out IOH3420 on aarch64) +- Resolves: bz#1713679 + (Detached device when trying to upgrade USB device firmware when in doing USB Passthrough via QEMU) +- Resolves: bz#1713735 + (Allow ARM VIRT iommu option in RHEL8.1 machine) +- Resolves: bz#1714891 + (Guest with persistent reservation manager for a disk fails to start) +- Resolves: bz#1714937 + (Disable VXHS support) + +* Tue May 28 2019 Danilo Cesar Lemes de Paula - 4.0.0-3.el8 +- kvm-redhat-fix-cut-n-paste-garbage-in-hw_compat-comments.patch [bz#1709726] +- kvm-compat-Generic-hw_compat_rhel_8_0.patch [bz#1709726] +- kvm-redhat-sync-pseries-rhel7.6.0-with-rhel-av-8.0.1.patch [bz#1709726] +- kvm-redhat-define-pseries-rhel8.1.0-machine-type.patch [bz#1709726] +- Resolves: bz#1709726 + (Forward and backward migration failed with "qemu-kvm: error while loading state for instance 0x0 of device 'spapr'") + +* Sat May 25 2019 Danilo Cesar Lemes de Paula - 4.0.0-2.el8 +- kvm-target-i386-define-md-clear-bit.patch [bz#1703297 bz#1703304 bz#1703310 bz#1707274] +- Resolves: bz#1703297 + (CVE-2018-12126 virt:8.0.0/qemu-kvm: hardware: Microarchitectural Store Buffer Data Sampling (MSBDS) [rhel-av-8]) +- Resolves: bz#1703304 + (CVE-2018-12130 virt:8.0.0/qemu-kvm: hardware: Microarchitectural Fill Buffer Data Sampling (MFBDS) [rhel-av-8]) +- Resolves: bz#1703310 + (CVE-2018-12127 virt:8.0.0/qemu-kvm: hardware: Micro-architectural Load Port Data Sampling - Information Leak (MLPDS) [rhel-av-8]) +- Resolves: bz#1707274 + (CVE-2019-11091 virt:8.0.0/qemu-kvm: hardware: Microarchitectural Data Sampling Uncacheable Memory (MDSUM) [rhel-av-8.1.0]) + +* Wed May 15 2019 Danilo Cesar Lemes de Paula - 3.1.0-26.el8 +- kvm-target-ppc-spapr-Add-SPAPR_CAP_LARGE_DECREMENTER.patch [bz#1698711] +- kvm-target-ppc-spapr-Add-workaround-option-to-SPAPR_CAP_.patch [bz#1698711] +- kvm-target-ppc-spapr-Add-SPAPR_CAP_CCF_ASSIST.patch [bz#1698711] +- kvm-target-ppc-tcg-make-spapr_caps-apply-cap-cfpc-sbbc-i.patch [bz#1698711] +- kvm-target-ppc-spapr-Enable-mitigations-by-default-for-p.patch [bz#1698711] +- kvm-slirp-ensure-there-is-enough-space-in-mbuf-to-null-t.patch [bz#1693076] +- kvm-slirp-don-t-manipulate-so_rcv-in-tcp_emu.patch [bz#1693076] +- Resolves: bz#1693076 + (CVE-2019-6778 qemu-kvm: QEMU: slirp: heap buffer overflow in tcp_emu() [rhel-av-8]) +- Resolves: bz#1698711 + (Enable Spectre / Meltdown mitigations by default in pseries-rhel8.0.0 machine type) + +* Mon May 06 2019 Danilo Cesar Lemes de Paula - 3.1.0-25.el8 +- kvm-redhat-enable-tpmdev-passthrough.patch [bz#1688312] +- kvm-exec-Only-count-mapped-memory-backends-for-qemu_getr.patch [bz#1680492] +- kvm-Enable-libpmem-to-support-nvdimm.patch [bz#1705149] +- Resolves: bz#1680492 + (Qemu quits suddenly while system_reset after hot-plugging unsupported memory by compatible guest on P9 with 1G huge page set) +- Resolves: bz#1688312 + ([RFE] enable TPM passthrough at compile time (qemu-kvm)) +- Resolves: bz#1705149 + (libpmem support is not enabled in qemu-kvm) + +* Fri Apr 26 2019 Danilo Cesar Lemes de Paula - 3.1.0-24.el8 +- kvm-x86-host-phys-bits-limit-option.patch [bz#1688915] +- kvm-rhel-Set-host-phys-bits-limit-48-on-rhel-machine-typ.patch [bz#1688915] +- Resolves: bz#1688915 + ([Intel 8.0 Alpha] physical bits should <= 48 when host with 5level paging &EPT5 and qemu command with "-cpu qemu64" parameters.) + +* Tue Apr 23 2019 Danilo Cesar Lemes de Paula - 3.1.0-23.el8 +- kvm-device_tree-Fix-integer-overflowing-in-load_device_t.patch [bz#1693173] +- Resolves: bz#1693173 + (CVE-2018-20815 qemu-kvm: QEMU: device_tree: heap buffer overflow while loading device tree blob [rhel-av-8]) + +* Mon Apr 15 2019 Danilo Cesar Lemes de Paula - 3.1.0-22.el8 +- kvm-i386-kvm-Disable-arch_capabilities-if-MSR-can-t-be-s.patch [bz#1687578] +- kvm-i386-Make-arch_capabilities-migratable.patch [bz#1687578] +- Resolves: bz#1687578 + (Incorrect CVE vulnerabilities reported on Cascade Lake cpus) + +* Thu Apr 11 2019 Danilo Cesar Lemes de Paula - 3.1.0-21.el8 +- kvm-Remove-7-qcow2-and-luks-iotests-that-are-taking-25-s.patch [bz#1683473] +- kvm-spapr-fix-out-of-bounds-write-in-spapr_populate_drme.patch [bz#1674438] +- kvm-qcow2-include-LUKS-payload-overhead-in-qemu-img-meas.patch [bz#1655065] +- kvm-iotests-add-LUKS-payload-overhead-to-178-qemu-img-me.patch [bz#1655065] +- kvm-vnc-detect-and-optimize-pageflips.patch [bz#1666206] +- kvm-Load-kvm-module-during-boot.patch [bz#1676907 bz#1685995] +- kvm-hostmem-file-reject-invalid-pmem-file-sizes.patch [bz#1669053] +- kvm-iotests-Fix-test-200-on-s390x-without-virtio-pci.patch [bz#1687582] +- kvm-block-file-posix-do-not-fail-on-unlock-bytes.patch [bz#1652572] +- Resolves: bz#1652572 + (QEMU core dumped if stop nfs service during migration) +- Resolves: bz#1655065 + ([rhel.8.0][fast train]'qemu-img measure' size does not match the real allocated size for luks-inside-qcow2 image) +- Resolves: bz#1666206 + (vnc server should detect page-flips and avoid sending fullscreen updates then.) +- Resolves: bz#1669053 + (Guest call trace when boot with nvdimm device backed by /dev/dax) +- Resolves: bz#1674438 + (RHEL8.0 - Guest reboot fails after memory hotplug multiple times (kvm)) +- Resolves: bz#1676907 + (/dev/kvm device exists but kernel module is not loaded on boot up causing VM start to fail in libvirt) +- Resolves: bz#1683473 + (Remove 7 qcow2 & luks iotests from rhel8 fast train build %check phase) +- Resolves: bz#1685995 + (/dev/kvm device exists but kernel module is not loaded on boot up causing VM start to fail in libvirt) +- Resolves: bz#1687582 + (QEMU IOTEST 200 fails with 'virtio-scsi-pci is not a valid device model name') + +* Fri Mar 15 2019 Danilo Cesar Lemes de Paula - 3.1.0-20.el8 +- kvm-i386-Add-stibp-flag-name.patch [bz#1686260] +- Resolves: bz#1686260 + (stibp is missing on qemu 3.0 and qemu 3.1) + +* Fri Mar 15 2019 Danilo Cesar Lemes de Paula - 3.1.0-19.el8 +- kvm-migration-Fix-cancel-state.patch [bz#1608649] +- kvm-migration-rdma-Fix-qemu_rdma_cleanup-null-check.patch [bz#1608649] +- Resolves: bz#1608649 + (Query-migrate get "failed" status after migrate-cancel) + +* Tue Feb 26 2019 Danilo Cesar Lemes de Paula - 3.1.0-18.el8 +- kvm-target-i386-Disable-MPX-support-on-named-CPU-models.patch [bz#1661030] +- kvm-i386-remove-the-new-CPUID-PCONFIG-from-Icelake-Serve.patch [bz#1661515] +- kvm-i386-remove-the-INTEL_PT-CPUID-bit-from-named-CPU-mo.patch [bz#1661515] +- kvm-Revert-i386-Add-CPUID-bit-for-PCONFIG.patch [bz#1661515] +- Resolves: bz#1661030 + (Remove MPX support from 8.0 machine types) +- Resolves: bz#1661515 + (Remove PCONFIG and INTEL_PT from Icelake-* CPU models) + +* Tue Feb 26 2019 Danilo Cesar Lemes de Paula - 3.1.0-17.el8 +- kvm-block-Apply-auto-read-only-for-ro-whitelist-drivers.patch [bz#1678968] +- Resolves: bz#1678968 + (-blockdev: auto-read-only is ineffective for drivers on read-only whitelist) + +* Mon Feb 25 2019 Danilo Cesar Lemes de Paula - 3.1.0-16.el8 +- kvm-fdc-Revert-downstream-disablement-of-device-floppy.patch [bz#1664997] +- kvm-fdc-Restrict-floppy-controllers-to-RHEL-7-machine-ty.patch [bz#1664997] +- Resolves: bz#1664997 + (Restrict floppy device to RHEL-7 machine types) + +* Wed Feb 13 2019 Danilo Cesar Lemes de Paula - 3.1.0-15.el8 +- kvm-Add-raw-qcow2-nbd-and-luks-iotests-to-run-during-the.patch [bz#1664855] +- kvm-Introduce-the-qemu-kvm-tests-rpm.patch [bz#1669924] +- Resolves: bz#1664855 + (Run iotests in qemu-kvm build %check phase) +- Resolves: bz#1669924 + (qemu-kvm packaging: Package the avocado_qemu tests and qemu-iotests in a new rpm) + +* Tue Feb 12 2019 Danilo Cesar Lemes de Paula - 3.1.0-14.el8 +- kvm-doc-fix-the-configuration-path.patch [bz#1644985] +- Resolves: bz#1644985 + (The "fsfreeze-hook" script path shown by command "qemu-ga --help" or "man qemu-ga" is wrong - Fast Train) + +* Mon Feb 11 2019 Danilo Cesar Lemes de Paula - 3.1.0-13.el8 +- kvm-Acceptance-tests-add-Linux-initrd-checking-test.patch [bz#1669922] +- kvm-mmap-alloc-unfold-qemu_ram_mmap.patch [bz#1671519] +- kvm-mmap-alloc-fix-hugetlbfs-misaligned-length-in-ppc64.patch [bz#1671519] +- kvm-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch [bz#1653590] +- kvm-block-Fix-invalidate_cache-error-path-for-parent-act.patch [bz#1673014] +- kvm-virtio-scsi-Move-BlockBackend-back-to-the-main-AioCo.patch [bz#1656276 bz#1662508] +- kvm-scsi-disk-Acquire-the-AioContext-in-scsi_-_realize.patch [bz#1656276 bz#1662508] +- kvm-virtio-scsi-Forbid-devices-with-different-iothreads-.patch [bz#1656276 bz#1662508] +- Resolves: bz#1653590 + ([Fast train]had better stop qemu immediately while guest was making use of an improper page size) +- Resolves: bz#1656276 + (qemu-kvm core dumped after hotplug the deleted disk with iothread parameter) +- Resolves: bz#1662508 + (Qemu core dump when start guest with two disks using same drive) +- Resolves: bz#1669922 + (Backport avocado-qemu tests for QEMU 3.1) +- Resolves: bz#1671519 + (RHEL8.0 Snapshot3 - qemu doesn't free up hugepage memory when hotplug/hotunplug using memory-backend-file (qemu-kvm)) +- Resolves: bz#1673014 + (Local VM and migrated VM on the same host can run with same RAW file as visual disk source while without shareable configured or lock manager enabled) + +* Fri Feb 08 2019 Danilo Cesar Lemes de Paula - 3.1.0-12.el8 +- kvm-io-ensure-UNIX-client-doesn-t-unlink-server-socket.patch [bz#1665896] +- kvm-scsi-disk-Don-t-use-empty-string-as-device-id.patch [bz#1668248] +- kvm-scsi-disk-Add-device_id-property.patch [bz#1668248] +- Resolves: bz#1665896 + (VNC unix listener socket is deleted after first client quits) +- Resolves: bz#1668248 + ("An unknown error has occurred" when using cdrom to install the system with two blockdev disks.(when choose installation destination)) + +* Thu Jan 31 2019 Danilo Cesar Lemes de Paula - 3.1.0-11.el8 +- kvm-Fix-fsfreeze-hook-path-in-the-man-page.patch [bz#1644985] +- kvm-json-Fix-handling-when-not-interpolating.patch [bz#1668244] +- Resolves: bz#1644985 + (The "fsfreeze-hook" script path shown by command "qemu-ga --help" or "man qemu-ga" is wrong - Fast Train) +- Resolves: bz#1668244 + (qemu-img: /var/tmp/v2vovl9951f8.qcow2: CURL: Error opening file: The requested URL returned error: 404 Not Found) + +* Tue Jan 29 2019 Danilo Cesar Lemes de Paula - 3.1.0-10.el8 +- kvm-throttle-groups-fix-restart-coroutine-iothread-race.patch [bz#1655947] +- kvm-iotests-add-238-for-throttling-tgm-unregister-iothre.patch [bz#1655947] +- Resolves: bz#1655947 + (qemu-kvm core dumped after unplug the device which was set io throttling parameters) + +* Tue Jan 29 2019 Danilo Cesar Lemes de Paula - 3.1.0-9.el8 +- kvm-migration-rdma-unregister-fd-handler.patch [bz#1666601] +- kvm-s390x-tod-Properly-stop-the-KVM-TOD-while-the-guest-.patch [bz#1659127] +- kvm-hw-s390x-Fix-bad-mask-in-time2tod.patch [bz#1659127] +- Resolves: bz#1659127 + (Stress guest and stop it, then do live migration, guest hit call trace on destination end) +- Resolves: bz#1666601 + ([q35] dst qemu core dumped when do rdma migration with Mellanox IB QDR card) + +* Thu Jan 24 2019 Danilo Cesar Lemes de Paula - 3.1.0-7.el8 +- kvm-i386-kvm-expose-HV_CPUID_ENLIGHTMENT_INFO.EAX-and-HV.patch [bz#1653511] +- kvm-i386-kvm-add-a-comment-explaining-why-.feat_names-ar.patch [bz#1653511] +- Resolves: bz#1653511 + (qemu doesn't report all support cpu features which cause libvirt cannot get the support status of hv_tlbflush) + +* Wed Jan 23 2019 Danilo Cesar Lemes de Paula - 3.1.0-6.el8 +- kvm-spapr-Fix-ibm-max-associativity-domains-property-num.patch [bz#1653114] +- kvm-cpus-ignore-ESRCH-in-qemu_cpu_kick_thread.patch [bz#1668205] +- Resolves: bz#1653114 + (Incorrect NUMA nodes passed to qemu-kvm guest in ibm,max-associativity-domains property) +- Resolves: bz#1668205 + (Guest quit with error when hotunplug cpu) + +* Mon Jan 21 2019 Danilo Cesar Lemes de Paula - 3.1.0-5.el8 +- kvm-virtio-Helper-for-registering-virtio-device-types.patch [bz#1648023] +- kvm-virtio-Provide-version-specific-variants-of-virtio-P.patch [bz#1648023] +- kvm-globals-Allow-global-properties-to-be-optional.patch [bz#1648023] +- kvm-virtio-Make-disable-legacy-disable-modern-compat-pro.patch [bz#1648023] +- kvm-aarch64-Add-virt-rhel8.0.0-machine-type-for-ARM.patch [bz#1656504] +- kvm-aarch64-Set-virt-rhel8.0.0-max_cpus-to-512.patch [bz#1656504] +- kvm-aarch64-Use-256MB-ECAM-region-by-default.patch [bz#1656504] +- Resolves: bz#1648023 + (Provide separate device types for transitional virtio PCI devices - Fast Train) +- Resolves: bz#1656504 + (Machine types for qemu-kvm based on rebase to qemu-3.1 (aarch64)) + +* Fri Jan 11 2019 Danilo Cesar Lemes de Paula - 3.1.0-4.el8 +- kvm-hw-s390x-s390-virtio-ccw-Add-machine-types-for-RHEL8.patch [bz#1656510] +- kvm-spapr-Add-H-Call-H_HOME_NODE_ASSOCIATIVITY.patch [bz#1661967] +- kvm-redhat-Fixing-.gitpublish-to-include-AV-information.patch [] +- Resolves: bz#1656510 + (Machine types for qemu-kvm based on rebase to qemu-3.1 (s390x)) +- Resolves: bz#1661967 + (Kernel prints the message "VPHN is not supported. Disabling polling...") + +* Thu Jan 03 2019 Danilo Cesar Lemes de Paula - 3.1.0-3.el8 +- kvm-redhat-define-pseries-rhel8.0.0-machine-type.patch [bz#1656508] +- Resolves: bz#1656508 + (Machine types for qemu-kvm based on rebase to qemu-3.1 (ppc64le)) + +* Fri Dec 21 2018 Danilo Cesar Lemes de Paula - 3.1.0-2.el8 +- kvm-pc-7.5-compat-entries.patch [bz#1655820] +- kvm-compat-Generic-HW_COMPAT_RHEL7_6.patch [bz#1655820] +- kvm-pc-PC_RHEL7_6_COMPAT.patch [bz#1655820] +- kvm-pc-Add-compat-for-pc-i440fx-rhel7.6.0-machine-type.patch [bz#1655820] +- kvm-pc-Add-pc-q35-8.0.0-machine-type.patch [bz#1655820] +- kvm-pc-Add-x-migrate-smi-count-off-to-PC_RHEL7_6_COMPAT.patch [bz#1655820] +- kvm-clear-out-KVM_ASYNC_PF_DELIVERY_AS_PF_VMEXIT-for.patch [bz#1659604] +- kvm-Add-edk2-Requires-to-qemu-kvm.patch [bz#1660208] +- Resolves: bz#1655820 + (Can't migarate between rhel8 and rhel7 when guest has device "video") +- Resolves: bz#1659604 + (8->7 migration failed: qemu-kvm: error: failed to set MSR 0x4b564d02 to 0x27fc13285) +- Resolves: bz#1660208 + (qemu-kvm: Should depend on the architecture-appropriate guest firmware) + +* Thu Dec 13 2018 Danilo Cesar Lemes de Paula - 3.1.0-1.el8 +- Rebase to qemu-kvm 3.1.0 + +* Tue Dec 11 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-47 +- kvm-Disable-CONFIG_IPMI-and-CONFIG_I2C-for-ppc64.patch [bz#1640044] +- kvm-Disable-CONFIG_CAN_BUS-and-CONFIG_CAN_SJA1000.patch [bz#1640042] +- Resolves: bz#1640042 + (Disable CONFIG_CAN_BUS and CONFIG_CAN_SJA1000 config switches) +- Resolves: bz#1640044 + (Disable CONFIG_I2C and CONFIG_IPMI in default-configs/ppc64-softmmu.mak) + +* Tue Dec 11 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-46 +- kvm-qcow2-Give-the-refcount-cache-the-minimum-possible-s.patch [bz#1656507] +- kvm-docs-Document-the-new-default-sizes-of-the-qcow2-cac.patch [bz#1656507] +- kvm-qcow2-Fix-Coverity-warning-when-calculating-the-refc.patch [bz#1656507] +- kvm-include-Add-IEC-binary-prefixes-in-qemu-units.h.patch [bz#1656507] +- kvm-qcow2-Options-documentation-fixes.patch [bz#1656507] +- kvm-include-Add-a-lookup-table-of-sizes.patch [bz#1656507] +- kvm-qcow2-Make-sizes-more-humanly-readable.patch [bz#1656507] +- kvm-qcow2-Avoid-duplication-in-setting-the-refcount-cach.patch [bz#1656507] +- kvm-qcow2-Assign-the-L2-cache-relatively-to-the-image-si.patch [bz#1656507] +- kvm-qcow2-Increase-the-default-upper-limit-on-the-L2-cac.patch [bz#1656507] +- kvm-qcow2-Resize-the-cache-upon-image-resizing.patch [bz#1656507] +- kvm-qcow2-Set-the-default-cache-clean-interval-to-10-min.patch [bz#1656507] +- kvm-qcow2-Explicit-number-replaced-by-a-constant.patch [bz#1656507] +- kvm-block-backend-Set-werror-rerror-defaults-in-blk_new.patch [bz#1657637] +- kvm-qcow2-Fix-cache-clean-interval-documentation.patch [bz#1656507] +- Resolves: bz#1656507 + ([RHEL.8] qcow2 cache is too small) +- Resolves: bz#1657637 + (Wrong werror default for -device drive=) + +* Thu Dec 06 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-45 +- kvm-target-ppc-add-basic-support-for-PTCR-on-POWER9.patch [bz#1639069] +- kvm-linux-headers-Update-for-nested-KVM-HV-downstream-on.patch [bz#1639069] +- kvm-target-ppc-Add-one-reg-id-for-ptcr.patch [bz#1639069] +- kvm-ppc-spapr_caps-Add-SPAPR_CAP_NESTED_KVM_HV.patch [bz#1639069] +- kvm-Re-enable-CONFIG_HYPERV_TESTDEV.patch [bz#1651195] +- kvm-qxl-use-guest_monitor_config-for-local-renderer.patch [bz#1610163] +- kvm-Declare-cirrus-vga-as-deprecated.patch [bz#1651994] +- kvm-Do-not-build-bluetooth-support.patch [bz#1654651] +- kvm-vfio-helpers-Fix-qemu_vfio_open_pci-crash.patch [bz#1645840] +- kvm-balloon-Allow-multiple-inhibit-users.patch [bz#1650272] +- kvm-Use-inhibit-to-prevent-ballooning-without-synchr.patch [bz#1650272] +- kvm-vfio-Inhibit-ballooning-based-on-group-attachment-to.patch [bz#1650272] +- kvm-vfio-ccw-pci-Allow-devices-to-opt-in-for-ballooning.patch [bz#1650272] +- kvm-vfio-pci-Handle-subsystem-realpath-returning-NULL.patch [bz#1650272] +- kvm-vfio-pci-Fix-failure-to-close-file-descriptor-on-err.patch [bz#1650272] +- kvm-postcopy-Synchronize-usage-of-the-balloon-inhibitor.patch [bz#1650272] +- Resolves: bz#1610163 + (guest shows border blurred screen with some resolutions when qemu boot with -device qxl-vga ,and guest on rhel7.6 has no such question) +- Resolves: bz#1639069 + ([IBM 8.0 FEAT] POWER9 - Nested virtualization in RHEL8.0 KVM for ppc64le - qemu-kvm side) +- Resolves: bz#1645840 + (Qemu core dump when hotplug nvme:// drive via -blockdev) +- Resolves: bz#1650272 + (Ballooning is incompatible with vfio assigned devices, but not prevented) +- Resolves: bz#1651195 + (Re-enable hyperv-testdev device) +- Resolves: bz#1651994 + (Declare the "Cirrus VGA" device emulation of QEMU as deprecated in RHEL8) +- Resolves: bz#1654651 + (Qemu: hw: bt: keep bt/* objects from building [rhel-8.0]) + +* Tue Nov 27 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-43 +- kvm-block-Make-more-block-drivers-compile-time-configura.patch [bz#1598842 bz#1598842] +- kvm-RHEL8-Add-disable-configure-options-to-qemu-spec-fil.patch [bz#1598842] +- Resolves: bz#1598842 + (Compile out unused block drivers) + +* Mon Nov 26 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-43 + +- kvm-configure-add-test-for-libudev.patch [bz#1636185] +- kvm-qga-linux-report-disk-serial-number.patch [bz#1636185] +- kvm-qga-linux-return-disk-device-in-guest-get-fsinfo.patch [bz#1636185] +- kvm-qemu-error-introduce-error-warn-_report_once.patch [bz#1625173] +- kvm-intel-iommu-start-to-use-error_report_once.patch [bz#1625173] +- kvm-intel-iommu-replace-more-vtd_err_-traces.patch [bz#1625173] +- kvm-intel_iommu-introduce-vtd_reset_caches.patch [bz#1625173] +- kvm-intel_iommu-better-handling-of-dmar-state-switch.patch [bz#1625173] +- kvm-intel_iommu-move-ce-fetching-out-when-sync-shadow.patch [bz#1625173 bz#1629616] +- kvm-intel_iommu-handle-invalid-ce-for-shadow-sync.patch [bz#1625173 bz#1629616] +- kvm-block-remove-bdrv_dirty_bitmap_make_anon.patch [bz#1518989] +- kvm-block-simplify-code-around-releasing-bitmaps.patch [bz#1518989] +- kvm-hbitmap-Add-advance-param-to-hbitmap_iter_next.patch [bz#1518989] +- kvm-test-hbitmap-Add-non-advancing-iter_next-tests.patch [bz#1518989] +- kvm-block-dirty-bitmap-Add-bdrv_dirty_iter_next_area.patch [bz#1518989] +- kvm-blockdev-backup-add-bitmap-argument.patch [bz#1518989] +- kvm-dirty-bitmap-switch-assert-fails-to-errors-in-bdrv_m.patch [bz#1518989] +- kvm-dirty-bitmap-rename-bdrv_undo_clear_dirty_bitmap.patch [bz#1518989] +- kvm-dirty-bitmap-make-it-possible-to-restore-bitmap-afte.patch [bz#1518989] +- kvm-blockdev-rename-block-dirty-bitmap-clear-transaction.patch [bz#1518989] +- kvm-qapi-add-transaction-support-for-x-block-dirty-bitma.patch [bz#1518989] +- kvm-block-dirty-bitmaps-add-user_locked-status-checker.patch [bz#1518989] +- kvm-block-dirty-bitmaps-fix-merge-permissions.patch [bz#1518989] +- kvm-block-dirty-bitmaps-allow-clear-on-disabled-bitmaps.patch [bz#1518989] +- kvm-block-dirty-bitmaps-prohibit-enable-disable-on-locke.patch [bz#1518989] +- kvm-block-backup-prohibit-backup-from-using-in-use-bitma.patch [bz#1518989] +- kvm-nbd-forbid-use-of-frozen-bitmaps.patch [bz#1518989] +- kvm-bitmap-Update-count-after-a-merge.patch [bz#1518989] +- kvm-iotests-169-drop-deprecated-autoload-parameter.patch [bz#1518989] +- kvm-block-qcow2-improve-error-message-in-qcow2_inactivat.patch [bz#1518989] +- kvm-bloc-qcow2-drop-dirty_bitmaps_loaded-state-variable.patch [bz#1518989] +- kvm-dirty-bitmaps-clean-up-bitmaps-loading-and-migration.patch [bz#1518989] +- kvm-iotests-improve-169.patch [bz#1518989] +- kvm-iotests-169-add-cases-for-source-vm-resuming.patch [bz#1518989] +- kvm-pc-dimm-turn-alignment-assert-into-check.patch [bz#1630116] +- Resolves: bz#1518989 + (RFE: QEMU Incremental live backup) +- Resolves: bz#1625173 + ([NVMe Device Assignment] Guest could not boot up with q35+iommu) +- Resolves: bz#1629616 + (boot guest with q35+vIOMMU+ device assignment, qemu terminal shows "qemu-kvm: VFIO_UNMAP_DMA: -22" when return assigned network devices from vfio driver to ixgbe in guest) +- Resolves: bz#1630116 + (pc_dimm_get_free_addr: assertion failed: (QEMU_ALIGN_UP(address_space_start, align) == address_space_start)) +- Resolves: bz#1636185 + ([RFE] Report disk device name and serial number (qemu-guest-agent on Linux)) + +* Mon Nov 05 2018 Danilo Cesar Lemes de Paula - 2.12.0-42.el8 +- kvm-luks-Allow-share-rw-on.patch [bz#1629701] +- kvm-redhat-reenable-gluster-support.patch [bz#1599340] +- kvm-redhat-bump-libusb-requirement.patch [bz#1627970] +- Resolves: bz#1599340 + (Reenable glusterfs in qemu-kvm once BZ#1567292 gets fixed) +- Resolves: bz#1627970 + (symbol lookup error: /usr/libexec/qemu-kvm: undefined symbol: libusb_set_option) +- Resolves: bz#1629701 + ("share-rw=on" does not work for luks format image - Fast Train) + +* Tue Oct 16 2018 Danilo Cesar Lemes de Paula - 2.12.0-41.el8 +- kvm-block-rbd-pull-out-qemu_rbd_convert_options.patch [bz#1635585] +- kvm-block-rbd-Attempt-to-parse-legacy-filenames.patch [bz#1635585] +- kvm-block-rbd-add-deprecation-documentation-for-filename.patch [bz#1635585] +- kvm-block-rbd-add-iotest-for-rbd-legacy-keyvalue-filenam.patch [bz#1635585] +- Resolves: bz#1635585 + (rbd json format of 7.6 is incompatible with 7.5) + +* Tue Oct 16 2018 Danilo Cesar Lemes de Paula - 2.12.0-40.el8 +- kvm-vnc-call-sasl_server_init-only-when-required.patch [bz#1609327] +- kvm-nbd-server-fix-NBD_CMD_CACHE.patch [bz#1636142] +- kvm-nbd-fix-NBD_FLAG_SEND_CACHE-value.patch [bz#1636142] +- kvm-test-bdrv-drain-bdrv_drain-works-with-cross-AioConte.patch [bz#1637976] +- kvm-block-Use-bdrv_do_drain_begin-end-in-bdrv_drain_all.patch [bz#1637976] +- kvm-block-Remove-recursive-parameter-from-bdrv_drain_inv.patch [bz#1637976] +- kvm-block-Don-t-manually-poll-in-bdrv_drain_all.patch [bz#1637976] +- kvm-tests-test-bdrv-drain-bdrv_drain_all-works-in-corout.patch [bz#1637976] +- kvm-block-Avoid-unnecessary-aio_poll-in-AIO_WAIT_WHILE.patch [bz#1637976] +- kvm-block-Really-pause-block-jobs-on-drain.patch [bz#1637976] +- kvm-block-Remove-bdrv_drain_recurse.patch [bz#1637976] +- kvm-test-bdrv-drain-Add-test-for-node-deletion.patch [bz#1637976] +- kvm-block-Drain-recursively-with-a-single-BDRV_POLL_WHIL.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-node-deletion-in-subtree-recurs.patch [bz#1637976] +- kvm-block-Don-t-poll-in-parent-drain-callbacks.patch [bz#1637976] +- kvm-test-bdrv-drain-Graph-change-through-parent-callback.patch [bz#1637976] +- kvm-block-Defer-.bdrv_drain_begin-callback-to-polling-ph.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-that-bdrv_drain_invoke-doesn-t-.patch [bz#1637976] +- kvm-block-Allow-AIO_WAIT_WHILE-with-NULL-ctx.patch [bz#1637976] +- kvm-block-Move-bdrv_drain_all_begin-out-of-coroutine-con.patch [bz#1637976] +- kvm-block-ignore_bds_parents-parameter-for-drain-functio.patch [bz#1637976] +- kvm-block-Allow-graph-changes-in-bdrv_drain_all_begin-en.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-graph-changes-in-drain_all-sect.patch [bz#1637976] +- kvm-block-Poll-after-drain-on-attaching-a-node.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-bdrv_append-to-drained-node.patch [bz#1637976] +- kvm-block-linux-aio-acquire-AioContext-before-qemu_laio_.patch [bz#1637976] +- kvm-util-async-use-qemu_aio_coroutine_enter-in-co_schedu.patch [bz#1637976] +- kvm-job-Fix-nested-aio_poll-hanging-in-job_txn_apply.patch [bz#1637976] +- kvm-job-Fix-missing-locking-due-to-mismerge.patch [bz#1637976] +- kvm-blockjob-Wake-up-BDS-when-job-becomes-idle.patch [bz#1637976] +- kvm-aio-wait-Increase-num_waiters-even-in-home-thread.patch [bz#1637976] +- kvm-test-bdrv-drain-Drain-with-block-jobs-in-an-I-O-thre.patch [bz#1637976] +- kvm-test-blockjob-Acquire-AioContext-around-job_cancel_s.patch [bz#1637976] +- kvm-job-Use-AIO_WAIT_WHILE-in-job_finish_sync.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-AIO_WAIT_WHILE-in-completion-ca.patch [bz#1637976] +- kvm-block-Add-missing-locking-in-bdrv_co_drain_bh_cb.patch [bz#1637976] +- kvm-block-backend-Add-.drained_poll-callback.patch [bz#1637976] +- kvm-block-backend-Fix-potential-double-blk_delete.patch [bz#1637976] +- kvm-block-backend-Decrease-in_flight-only-after-callback.patch [bz#1637976] +- kvm-blockjob-Lie-better-in-child_job_drained_poll.patch [bz#1637976] +- kvm-block-Remove-aio_poll-in-bdrv_drain_poll-variants.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-nested-poll-in-bdrv_drain_poll_.patch [bz#1637976] +- kvm-job-Avoid-deadlocks-in-job_completed_txn_abort.patch [bz#1637976] +- kvm-test-bdrv-drain-AIO_WAIT_WHILE-in-job-.commit-.abort.patch [bz#1637976] +- kvm-test-bdrv-drain-Fix-outdated-comments.patch [bz#1637976] +- kvm-block-Use-a-single-global-AioWait.patch [bz#1637976] +- kvm-test-bdrv-drain-Test-draining-job-source-child-and-p.patch [bz#1637976] +- kvm-qemu-img-Fix-assert-when-mapping-unaligned-raw-file.patch [bz#1639374] +- kvm-iotests-Add-test-221-to-catch-qemu-img-map-regressio.patch [bz#1639374] +- Resolves: bz#1609327 + (qemu-kvm[37046]: Could not find keytab file: /etc/qemu/krb5.tab: Unknown error 49408) +- Resolves: bz#1636142 + (qemu NBD_CMD_CACHE flaws impacting non-qemu NBD clients) +- Resolves: bz#1637976 + (Crashes and hangs with iothreads vs. block jobs) +- Resolves: bz#1639374 + (qemu-img map 'Aborted (core dumped)' when specifying a plain file) + +* Tue Oct 16 2018 Danilo Cesar Lemes de Paula - +- kvm-linux-headers-update.patch [bz#1508142] +- kvm-s390x-cpumodel-Set-up-CPU-model-for-AP-device-suppor.patch [bz#1508142] +- kvm-s390x-kvm-enable-AP-instruction-interpretation-for-g.patch [bz#1508142] +- kvm-s390x-ap-base-Adjunct-Processor-AP-object-model.patch [bz#1508142] +- kvm-s390x-vfio-ap-Introduce-VFIO-AP-device.patch [bz#1508142] +- kvm-s390-doc-detailed-specifications-for-AP-virtualizati.patch [bz#1508142] +- Resolves: bz#1508142 + ([IBM 8.0 FEAT] KVM: Guest-dedicated Crypto Adapters - qemu part) + +* Mon Oct 15 2018 Danilo Cesar Lemes de Paula - 2.12.0-38.el8 +- kvm-Revert-hw-acpi-build-build-SRAT-memory-affinity-stru.patch [bz#1609235] +- kvm-add-udev-kvm-check.patch [bz#1552663] +- kvm-aio-posix-Don-t-count-ctx-notifier-as-progress-when-.patch [bz#1623085] +- kvm-aio-Do-aio_notify_accept-only-during-blocking-aio_po.patch [bz#1623085] +- kvm-aio-posix-fix-concurrent-access-to-poll_disable_cnt.patch [bz#1632622] +- kvm-aio-posix-compute-timeout-before-polling.patch [bz#1632622] +- kvm-aio-posix-do-skip-system-call-if-ctx-notifier-pollin.patch [bz#1632622] +- kvm-intel-iommu-send-PSI-always-even-if-across-PDEs.patch [bz#1450712] +- kvm-intel-iommu-remove-IntelIOMMUNotifierNode.patch [bz#1450712] +- kvm-intel-iommu-add-iommu-lock.patch [bz#1450712] +- kvm-intel-iommu-only-do-page-walk-for-MAP-notifiers.patch [bz#1450712] +- kvm-intel-iommu-introduce-vtd_page_walk_info.patch [bz#1450712] +- kvm-intel-iommu-pass-in-address-space-when-page-walk.patch [bz#1450712] +- kvm-intel-iommu-trace-domain-id-during-page-walk.patch [bz#1450712] +- kvm-util-implement-simple-iova-tree.patch [bz#1450712] +- kvm-intel-iommu-rework-the-page-walk-logic.patch [bz#1450712] +- kvm-i386-define-the-ssbd-CPUID-feature-bit-CVE-2018-3639.patch [bz#1633928] +- Resolves: bz#1450712 + (Booting nested guest with vIOMMU, the assigned network devices can not receive packets (qemu)) +- Resolves: bz#1552663 + (81-kvm-rhel.rules is no longer part of initscripts) +- Resolves: bz#1609235 + (Win2016 guest can't recognize pc-dimm hotplugged to node 0) +- Resolves: bz#1623085 + (VM doesn't boot from HD) +- Resolves: bz#1632622 + (~40% virtio_blk disk performance drop for win2012r2 guest when comparing qemu-kvm-rhev-2.12.0-9 with qemu-kvm-rhev-2.12.0-12) +- Resolves: bz#1633928 + (CVE-2018-3639 qemu-kvm: hw: cpu: speculative store bypass [rhel-8.0]) + +* Fri Oct 12 2018 Danilo Cesar Lemes de Paula - 2.12.0-37.el8 +- kvm-block-for-jobs-do-not-clear-user_paused-until-after-.patch [bz#1635583] +- kvm-iotests-Add-failure-matching-to-common.qemu.patch [bz#1635583] +- kvm-block-iotest-to-catch-abort-on-forced-blockjob-cance.patch [bz#1635583] +- Resolves: bz#1635583 + (Quitting VM causes qemu core dump once the block mirror job paused for no enough target space) + +* Fri Oct 12 2018 Danilo Cesar Lemes de Paula - qemu-kvm-2.12.0-36 +- kvm-check-Only-test-ivshm-when-it-is-compiled-in.patch [bz#1621817] +- kvm-Disable-ivshmem.patch [bz#1621817] +- kvm-mirror-Fail-gracefully-for-source-target.patch [bz#1637963] +- kvm-commit-Add-top-node-base-node-options.patch [bz#1637970] +- kvm-qemu-iotests-Test-commit-with-top-node-base-node.patch [bz#1637970] +- Resolves: bz#1621817 + (Disable IVSHMEM in RHEL 8) +- Resolves: bz#1637963 + (Segfault on 'blockdev-mirror' with same node as source and target) +- Resolves: bz#1637970 + (allow using node-names with block-commit) + +* Thu Oct 11 2018 Danilo Cesar Lemes de Paula - 2.12.0-35.el8 +- kvm-redhat-make-the-plugins-executable.patch [bz#1638304] +- Resolves: bz#1638304 + (the driver packages lack all the library Requires) + +* Thu Oct 11 2018 Danilo Cesar Lemes de Paula - 2.12.0-34.el8 +- kvm-seccomp-allow-sched_setscheduler-with-SCHED_IDLE-pol.patch [bz#1618356] +- kvm-seccomp-use-SIGSYS-signal-instead-of-killing-the-thr.patch [bz#1618356] +- kvm-seccomp-prefer-SCMP_ACT_KILL_PROCESS-if-available.patch [bz#1618356] +- kvm-configure-require-libseccomp-2.2.0.patch [bz#1618356] +- kvm-seccomp-set-the-seccomp-filter-to-all-threads.patch [bz#1618356] +- kvm-memory-cleanup-side-effects-of-memory_region_init_fo.patch [bz#1600365] +- Resolves: bz#1600365 + (QEMU core dumped when hotplug memory exceeding host hugepages and with discard-data=yes) +- Resolves: bz#1618356 + (qemu-kvm: Qemu: seccomp: blacklist is not applied to all threads [rhel-8]) + +* Fri Oct 05 2018 Danilo Cesar Lemes de Paula - 2.12.0-33.el8 +- kvm-migration-postcopy-Clear-have_listen_thread.patch [bz#1608765] +- kvm-migration-cleanup-in-error-paths-in-loadvm.patch [bz#1608765] +- kvm-jobs-change-start-callback-to-run-callback.patch [bz#1632939] +- kvm-jobs-canonize-Error-object.patch [bz#1632939] +- kvm-jobs-add-exit-shim.patch [bz#1632939] +- kvm-block-commit-utilize-job_exit-shim.patch [bz#1632939] +- kvm-block-mirror-utilize-job_exit-shim.patch [bz#1632939] +- kvm-jobs-utilize-job_exit-shim.patch [bz#1632939] +- kvm-block-backup-make-function-variables-consistently-na.patch [bz#1632939] +- kvm-jobs-remove-ret-argument-to-job_completed-privatize-.patch [bz#1632939] +- kvm-jobs-remove-job_defer_to_main_loop.patch [bz#1632939] +- kvm-block-commit-add-block-job-creation-flags.patch [bz#1632939] +- kvm-block-mirror-add-block-job-creation-flags.patch [bz#1632939] +- kvm-block-stream-add-block-job-creation-flags.patch [bz#1632939] +- kvm-block-commit-refactor-commit-to-use-job-callbacks.patch [bz#1632939] +- kvm-block-mirror-don-t-install-backing-chain-on-abort.patch [bz#1632939] +- kvm-block-mirror-conservative-mirror_exit-refactor.patch [bz#1632939] +- kvm-block-stream-refactor-stream-to-use-job-callbacks.patch [bz#1632939] +- kvm-tests-blockjob-replace-Blockjob-with-Job.patch [bz#1632939] +- kvm-tests-test-blockjob-remove-exit-callback.patch [bz#1632939] +- kvm-tests-test-blockjob-txn-move-.exit-to-.clean.patch [bz#1632939] +- kvm-jobs-remove-.exit-callback.patch [bz#1632939] +- kvm-qapi-block-commit-expose-new-job-properties.patch [bz#1632939] +- kvm-qapi-block-mirror-expose-new-job-properties.patch [bz#1632939] +- kvm-qapi-block-stream-expose-new-job-properties.patch [bz#1632939] +- kvm-block-backup-qapi-documentation-fixup.patch [bz#1632939] +- kvm-blockdev-document-transactional-shortcomings.patch [bz#1632939] +- Resolves: bz#1608765 + (After postcopy migration, do savevm and loadvm, guest hang and call trace) +- Resolves: bz#1632939 + (qemu blockjobs other than backup do not support job-finalize or job-dismiss) + +* Fri Sep 28 2018 Danilo Cesar Lemes de Paula - 2.12.0-32.el8 +- kvm-Re-enable-disabled-Hyper-V-enlightenments.patch [bz#1625185] +- kvm-Fix-annocheck-issues.patch [bz#1624164] +- kvm-exec-check-that-alignment-is-a-power-of-two.patch [bz#1630746] +- kvm-curl-Make-sslverify-off-disable-host-as-well-as-peer.patch [bz#1575925] +- Resolves: bz#1575925 + ("SSL: no alternative certificate subject name matches target host name" error even though sslverify = off) +- Resolves: bz#1624164 + (Review annocheck distro flag failures in qemu-kvm) +- Resolves: bz#1625185 + (Re-enable disabled Hyper-V enlightenments) +- Resolves: bz#1630746 + (qemu_ram_mmap: Assertion `is_power_of_2(align)' failed) + +* Tue Sep 11 2018 Danilo Cesar Lemes de Paula - 2.12.0-31.el8 +- kvm-i386-Disable-TOPOEXT-by-default-on-cpu-host.patch [bz#1619804] +- kvm-redhat-enable-opengl-add-build-and-runtime-deps.patch [bz#1618412] +- Resolves: bz#1618412 + (Enable opengl (for intel vgpu display)) +- Resolves: bz#1619804 + (kernel panic in init_amd_cacheinfo) + +* Wed Sep 05 2018 Danilo Cesar Lemes de Paula - 2.12.0-30.el8 +- kvm-redhat-Disable-vhost-crypto.patch [bz#1625668] +- Resolves: bz#1625668 + (Decide if we should disable 'vhost-crypto' or not) + +* Wed Sep 05 2018 Danilo Cesar Lemes de Paula - 2.12.0-29.el8 +- kvm-target-i386-sev-fix-memory-leaks.patch [bz#1615717] +- kvm-i386-Fix-arch_query_cpu_model_expansion-leak.patch [bz#1615717] +- kvm-redhat-Update-build-configuration.patch [bz#1573156] +- Resolves: bz#1573156 + (Update build configure for QEMU 2.12.0) +- Resolves: bz#1615717 + (Memory leaks) + +* Wed Aug 29 2018 Danilo Cesar Lemes de Paula - 2.12.0-27.el8 +- kvm-Fix-libusb-1.0.22-deprecated-libusb_set_debug-with-l.patch [bz#1622656] +- Resolves: bz#1622656 + (qemu-kvm fails to build due to libusb_set_debug being deprecated) + +* Fri Aug 17 2018 Danilo Cesar Lemes de Paula - 2.12.0-26.el8 +- kvm-redhat-remove-extra-in-rhel_rhev_conflicts-macro.patch [bz#1618752] +- Resolves: bz#1618752 + (qemu-kvm can't be installed in RHEL-8 as it Conflicts with itself.) + +* Thu Aug 16 2018 Danilo Cesar Lemes de Paula - 2.12.0-25.el8 +- kvm-Migration-TLS-Fix-crash-due-to-double-cleanup.patch [bz#1594384] +- Resolves: bz#1594384 + (2.12 migration fixes) + +* Tue Aug 14 2018 Danilo Cesar Lemes de Paula - 2.12.0-24.el8 +- kvm-Add-qemu-keymap-to-qemu-kvm-common.patch [bz#1593117] +- Resolves: bz#1593117 + (add qemu-keymap utility) + +* Fri Aug 10 2018 Danilo Cesar Lemes de Paula - 2.12.0-23.el8 +- Fixing an issue with some old command in the spec file + +* Fri Aug 10 2018 Danilo Cesar Lemes de Paula - 2.12.0-22.el8 +- Fix an issue with the build_configure script. +- Resolves: bz#1425820 + (Improve QEMU packaging layout with modularization of the block layer) + + +* Fri Aug 10 2018 Danilo Cesar Lemes de Paula - 2.12.0-20.el8 +- kvm-migration-stop-compressing-page-in-migration-thread.patch [bz#1594384] +- kvm-migration-stop-compression-to-allocate-and-free-memo.patch [bz#1594384] +- kvm-migration-stop-decompression-to-allocate-and-free-me.patch [bz#1594384] +- kvm-migration-detect-compression-and-decompression-error.patch [bz#1594384] +- kvm-migration-introduce-control_save_page.patch [bz#1594384] +- kvm-migration-move-some-code-to-ram_save_host_page.patch [bz#1594384] +- kvm-migration-move-calling-control_save_page-to-the-comm.patch [bz#1594384] +- kvm-migration-move-calling-save_zero_page-to-the-common-.patch [bz#1594384] +- kvm-migration-introduce-save_normal_page.patch [bz#1594384] +- kvm-migration-remove-ram_save_compressed_page.patch [bz#1594384] +- kvm-migration-block-dirty-bitmap-fix-memory-leak-in-dirt.patch [bz#1594384] +- kvm-migration-fix-saving-normal-page-even-if-it-s-been-c.patch [bz#1594384] +- kvm-migration-update-index-field-when-delete-or-qsort-RD.patch [bz#1594384] +- kvm-migration-introduce-decompress-error-check.patch [bz#1594384] +- kvm-migration-Don-t-activate-block-devices-if-using-S.patch [bz#1594384] +- kvm-migration-not-wait-RDMA_CM_EVENT_DISCONNECTED-event-.patch [bz#1594384] +- kvm-migration-block-dirty-bitmap-fix-dirty_bitmap_load.patch [bz#1594384] +- kvm-s390x-add-RHEL-7.6-machine-type-for-ccw.patch [bz#1595718] +- kvm-s390x-cpumodel-default-enable-bpb-and-ppa15-for-z196.patch [bz#1595718] +- kvm-linux-headers-asm-s390-kvm.h-header-sync.patch [bz#1612938] +- kvm-s390x-kvm-add-etoken-facility.patch [bz#1612938] +- Resolves: bz#1594384 + (2.12 migration fixes) +- Resolves: bz#1595718 + (Add ppa15/bpb to the default cpu model for z196 and higher in the 7.6 s390-ccw-virtio machine) +- Resolves: bz#1612938 + (Add etoken support to qemu-kvm for s390x KVM guests) + +* Fri Aug 10 2018 Danilo Cesar Lemes de Paula - 2.12.0-18.el8 + Mass import from RHEL 7.6 qemu-kvm-rhev, including fixes to the following BZs: + +- kvm-AArch64-Add-virt-rhel7.6-machine-type.patch [bz#1558723] +- kvm-cpus-Fix-event-order-on-resume-of-stopped-guest.patch [bz#1566153] +- kvm-qemu-img-Check-post-truncation-size.patch [bz#1523065] +- kvm-vga-catch-depth-0.patch [bz#1575541] +- kvm-Fix-x-hv-max-vps-compat-value-for-7.4-machine-type.patch [bz#1583959] +- kvm-ccid-card-passthru-fix-regression-in-realize.patch [bz#1584984] +- kvm-Use-4-MB-vram-for-cirrus.patch [bz#1542080] +- kvm-spapr_pci-Remove-unhelpful-pagesize-warning.patch [bz#1505664] +- kvm-rpm-Add-nvme-VFIO-driver-to-rw-whitelist.patch [bz#1416180] +- kvm-qobject-Use-qobject_to-instead-of-type-cast.patch [bz#1557995] +- kvm-qobject-Ensure-base-is-at-offset-0.patch [bz#1557995] +- kvm-qobject-use-a-QObjectBase_-struct.patch [bz#1557995] +- kvm-qobject-Replace-qobject_incref-QINCREF-qobject_decre.patch [bz#1557995] +- kvm-qobject-Modify-qobject_ref-to-return-obj.patch [bz#1557995] +- kvm-rbd-Drop-deprecated-drive-parameter-filename.patch [bz#1557995] +- kvm-iscsi-Drop-deprecated-drive-parameter-filename.patch [bz#1557995] +- kvm-block-Add-block-specific-QDict-header.patch [bz#1557995] +- kvm-qobject-Move-block-specific-qdict-code-to-block-qdic.patch [bz#1557995] +- kvm-block-Fix-blockdev-for-certain-non-string-scalars.patch [bz#1557995] +- kvm-block-Fix-drive-for-certain-non-string-scalars.patch [bz#1557995] +- kvm-block-Clean-up-a-misuse-of-qobject_to-in-.bdrv_co_cr.patch [bz#1557995] +- kvm-block-Factor-out-qobject_input_visitor_new_flat_conf.patch [bz#1557995] +- kvm-block-Make-remaining-uses-of-qobject-input-visitor-m.patch [bz#1557995] +- kvm-block-qdict-Simplify-qdict_flatten_qdict.patch [bz#1557995] +- kvm-block-qdict-Tweak-qdict_flatten_qdict-qdict_flatten_.patch [bz#1557995] +- kvm-block-qdict-Clean-up-qdict_crumple-a-bit.patch [bz#1557995] +- kvm-block-qdict-Simplify-qdict_is_list-some.patch [bz#1557995] +- kvm-check-block-qdict-Rename-qdict_flatten-s-variables-f.patch [bz#1557995] +- kvm-check-block-qdict-Cover-flattening-of-empty-lists-an.patch [bz#1557995] +- kvm-block-Fix-blockdev-blockdev-add-for-empty-objects-an.patch [bz#1557995] +- kvm-rbd-New-parameter-auth-client-required.patch [bz#1557995] +- kvm-rbd-New-parameter-key-secret.patch [bz#1557995] +- kvm-block-mirror-honor-ratelimit-again.patch [bz#1572856] +- kvm-block-mirror-Make-cancel-always-cancel-pre-READY.patch [bz#1572856] +- kvm-iotests-Add-test-for-cancelling-a-mirror-job.patch [bz#1572856] +- kvm-iotests-Split-214-off-of-122.patch [bz#1518738] +- kvm-block-Add-COR-filter-driver.patch [bz#1518738] +- kvm-block-BLK_PERM_WRITE-includes-._UNCHANGED.patch [bz#1518738] +- kvm-block-Add-BDRV_REQ_WRITE_UNCHANGED-flag.patch [bz#1518738] +- kvm-block-Set-BDRV_REQ_WRITE_UNCHANGED-for-COR-writes.patch [bz#1518738] +- kvm-block-quorum-Support-BDRV_REQ_WRITE_UNCHANGED.patch [bz#1518738] +- kvm-block-Support-BDRV_REQ_WRITE_UNCHANGED-in-filters.patch [bz#1518738] +- kvm-iotests-Clean-up-wrap-image-in-197.patch [bz#1518738] +- kvm-iotests-Copy-197-for-COR-filter-driver.patch [bz#1518738] +- kvm-iotests-Add-test-for-COR-across-nodes.patch [bz#1518738] +- kvm-qemu-io-Use-purely-string-blockdev-options.patch [bz#1576598] +- kvm-qemu-img-Use-only-string-options-in-img_open_opts.patch [bz#1576598] +- kvm-iotests-Add-test-for-U-force-share-conflicts.patch [bz#1576598] +- kvm-qemu-io-Drop-command-functions-return-values.patch [bz#1519617] +- kvm-qemu-io-Let-command-functions-return-error-code.patch [bz#1519617] +- kvm-qemu-io-Exit-with-error-when-a-command-failed.patch [bz#1519617] +- kvm-iotests.py-Add-qemu_io_silent.patch [bz#1519617] +- kvm-iotests-Let-216-make-use-of-qemu-io-s-exit-code.patch [bz#1519617] +- kvm-qcow2-Repair-OFLAG_COPIED-when-fixing-leaks.patch [bz#1527085] +- kvm-iotests-Repairing-error-during-snapshot-deletion.patch [bz#1527085] +- kvm-block-Make-bdrv_is_writable-public.patch [bz#1588039] +- kvm-qcow2-Do-not-mark-inactive-images-corrupt.patch [bz#1588039] +- kvm-iotests-Add-case-for-a-corrupted-inactive-image.patch [bz#1588039] +- kvm-main-loop-drop-spin_counter.patch [bz#1168213] +- kvm-target-ppc-Factor-out-the-parsing-in-kvmppc_get_cpu_.patch [bz#1560847] +- kvm-target-ppc-Don-t-require-private-l1d-cache-on-POWER8.patch [bz#1560847] +- kvm-ppc-spapr_caps-Don-t-disable-cap_cfpc-on-POWER8-by-d.patch [bz#1560847] +- kvm-qxl-fix-local-renderer-crash.patch [bz#1567733] +- kvm-qemu-img-Amendment-support-implies-create_opts.patch [bz#1537956] +- kvm-block-Add-Error-parameter-to-bdrv_amend_options.patch [bz#1537956] +- kvm-qemu-option-Pull-out-Supported-options-print.patch [bz#1537956] +- kvm-qemu-img-Add-print_amend_option_help.patch [bz#1537956] +- kvm-qemu-img-Recognize-no-creation-support-in-o-help.patch [bz#1537956] +- kvm-iotests-Test-help-option-for-unsupporting-formats.patch [bz#1537956] +- kvm-iotests-Rework-113.patch [bz#1537956] +- kvm-qemu-img-Resolve-relative-backing-paths-in-rebase.patch [bz#1569835] +- kvm-iotests-Add-test-for-rebasing-with-relative-paths.patch [bz#1569835] +- kvm-qemu-img-Special-post-backing-convert-handling.patch [bz#1527898] +- kvm-iotests-Test-post-backing-convert-target-behavior.patch [bz#1527898] +- kvm-migration-calculate-expected_downtime-with-ram_bytes.patch [bz#1564576] +- kvm-sheepdog-Fix-sd_co_create_opts-memory-leaks.patch [bz#1513543] +- kvm-qemu-iotests-reduce-chance-of-races-in-185.patch [bz#1513543] +- kvm-blockjob-do-not-cancel-timer-in-resume.patch [bz#1513543] +- kvm-nfs-Fix-error-path-in-nfs_options_qdict_to_qapi.patch [bz#1513543] +- kvm-nfs-Remove-processed-options-from-QDict.patch [bz#1513543] +- kvm-blockjob-drop-block_job_pause-resume_all.patch [bz#1513543] +- kvm-blockjob-expose-error-string-via-query.patch [bz#1513543] +- kvm-blockjob-Fix-assertion-in-block_job_finalize.patch [bz#1513543] +- kvm-blockjob-Wrappers-for-progress-counter-access.patch [bz#1513543] +- kvm-blockjob-Move-RateLimit-to-BlockJob.patch [bz#1513543] +- kvm-blockjob-Implement-block_job_set_speed-centrally.patch [bz#1513543] +- kvm-blockjob-Introduce-block_job_ratelimit_get_delay.patch [bz#1513543] +- kvm-blockjob-Add-block_job_driver.patch [bz#1513543] +- kvm-blockjob-Update-block-job-pause-resume-documentation.patch [bz#1513543] +- kvm-blockjob-Improve-BlockJobInfo.offset-len-documentati.patch [bz#1513543] +- kvm-job-Create-Job-JobDriver-and-job_create.patch [bz#1513543] +- kvm-job-Rename-BlockJobType-into-JobType.patch [bz#1513543] +- kvm-job-Add-JobDriver.job_type.patch [bz#1513543] +- kvm-job-Add-job_delete.patch [bz#1513543] +- kvm-job-Maintain-a-list-of-all-jobs.patch [bz#1513543] +- kvm-job-Move-state-transitions-to-Job.patch [bz#1513543] +- kvm-job-Add-reference-counting.patch [bz#1513543] +- kvm-job-Move-cancelled-to-Job.patch [bz#1513543] +- kvm-job-Add-Job.aio_context.patch [bz#1513543] +- kvm-job-Move-defer_to_main_loop-to-Job.patch [bz#1513543] +- kvm-job-Move-coroutine-and-related-code-to-Job.patch [bz#1513543] +- kvm-job-Add-job_sleep_ns.patch [bz#1513543] +- kvm-job-Move-pause-resume-functions-to-Job.patch [bz#1513543] +- kvm-job-Replace-BlockJob.completed-with-job_is_completed.patch [bz#1513543] +- kvm-job-Move-BlockJobCreateFlags-to-Job.patch [bz#1513543] +- kvm-blockjob-Split-block_job_event_pending.patch [bz#1513543] +- kvm-job-Add-job_event_.patch [bz#1513543] +- kvm-job-Move-single-job-finalisation-to-Job.patch [bz#1513543] +- kvm-job-Convert-block_job_cancel_async-to-Job.patch [bz#1513543] +- kvm-job-Add-job_drain.patch [bz#1513543] +- kvm-job-Move-.complete-callback-to-Job.patch [bz#1513543] +- kvm-job-Move-job_finish_sync-to-Job.patch [bz#1513543] +- kvm-job-Switch-transactions-to-JobTxn.patch [bz#1513543] +- kvm-job-Move-transactions-to-Job.patch [bz#1513543] +- kvm-job-Move-completion-and-cancellation-to-Job.patch [bz#1513543] +- kvm-block-Cancel-job-in-bdrv_close_all-callers.patch [bz#1513543] +- kvm-job-Add-job_yield.patch [bz#1513543] +- kvm-job-Add-job_dismiss.patch [bz#1513543] +- kvm-job-Add-job_is_ready.patch [bz#1513543] +- kvm-job-Add-job_transition_to_ready.patch [bz#1513543] +- kvm-job-Move-progress-fields-to-Job.patch [bz#1513543] +- kvm-job-Introduce-qapi-job.json.patch [bz#1513543] +- kvm-job-Add-JOB_STATUS_CHANGE-QMP-event.patch [bz#1513543] +- kvm-job-Add-lifecycle-QMP-commands.patch [bz#1513543] +- kvm-job-Add-query-jobs-QMP-command.patch [bz#1513543] +- kvm-blockjob-Remove-BlockJob.driver.patch [bz#1513543] +- kvm-iotests-Move-qmp_to_opts-to-VM.patch [bz#1513543] +- kvm-qemu-iotests-Test-job-with-block-jobs.patch [bz#1513543] +- kvm-vdi-Fix-vdi_co_do_create-return-value.patch [bz#1513543] +- kvm-vhdx-Fix-vhdx_co_create-return-value.patch [bz#1513543] +- kvm-job-Add-error-message-for-failing-jobs.patch [bz#1513543] +- kvm-block-create-Make-x-blockdev-create-a-job.patch [bz#1513543] +- kvm-qemu-iotests-Add-VM.get_qmp_events_filtered.patch [bz#1513543] +- kvm-qemu-iotests-Add-VM.qmp_log.patch [bz#1513543] +- kvm-qemu-iotests-Add-iotests.img_info_log.patch [bz#1513543] +- kvm-qemu-iotests-Add-VM.run_job.patch [bz#1513543] +- kvm-qemu-iotests-iotests.py-helper-for-non-file-protocol.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-206-for-blockdev-create-job.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-207-for-blockdev-create-job.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-210-for-blockdev-create-job.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-211-for-blockdev-create-job.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-212-for-blockdev-create-job.patch [bz#1513543] +- kvm-qemu-iotests-Rewrite-213-for-blockdev-create-job.patch [bz#1513543] +- kvm-block-create-Mark-blockdev-create-stable.patch [bz#1513543] +- kvm-jobs-fix-stale-wording.patch [bz#1513543] +- kvm-jobs-fix-verb-references-in-docs.patch [bz#1513543] +- kvm-iotests-Fix-219-s-timing.patch [bz#1513543] +- kvm-iotests-improve-pause_job.patch [bz#1513543] +- kvm-rpm-Whitelist-copy-on-read-block-driver.patch [bz#1518738] +- kvm-rpm-add-throttle-driver-to-rw-whitelist.patch [bz#1591076] +- kvm-usb-host-skip-open-on-pending-postload-bh.patch [bz#1572851] +- kvm-i386-Define-the-Virt-SSBD-MSR-and-handling-of-it-CVE.patch [bz#1574216] +- kvm-i386-define-the-AMD-virt-ssbd-CPUID-feature-bit-CVE-.patch [bz#1574216] +- kvm-block-file-posix-Pass-FD-to-locking-helpers.patch [bz#1519144] +- kvm-block-file-posix-File-locking-during-creation.patch [bz#1519144] +- kvm-iotests-Add-creation-test-to-153.patch [bz#1519144] +- kvm-vhost-user-add-Net-prefix-to-internal-state-structur.patch [bz#1526645] +- kvm-virtio-support-setting-memory-region-based-host-noti.patch [bz#1526645] +- kvm-vhost-user-support-receiving-file-descriptors-in-sla.patch [bz#1526645] +- kvm-osdep-add-wait.h-compat-macros.patch [bz#1526645] +- kvm-vhost-user-bridge-support-host-notifier.patch [bz#1526645] +- kvm-vhost-allow-backends-to-filter-memory-sections.patch [bz#1526645] +- kvm-vhost-user-allow-slave-to-send-fds-via-slave-channel.patch [bz#1526645] +- kvm-vhost-user-introduce-shared-vhost-user-state.patch [bz#1526645] +- kvm-vhost-user-support-registering-external-host-notifie.patch [bz#1526645] +- kvm-libvhost-user-support-host-notifier.patch [bz#1526645] +- kvm-block-Introduce-API-for-copy-offloading.patch [bz#1482537] +- kvm-raw-Check-byte-range-uniformly.patch [bz#1482537] +- kvm-raw-Implement-copy-offloading.patch [bz#1482537] +- kvm-qcow2-Implement-copy-offloading.patch [bz#1482537] +- kvm-file-posix-Implement-bdrv_co_copy_range.patch [bz#1482537] +- kvm-iscsi-Query-and-save-device-designator-when-opening.patch [bz#1482537] +- kvm-iscsi-Create-and-use-iscsi_co_wait_for_task.patch [bz#1482537] +- kvm-iscsi-Implement-copy-offloading.patch [bz#1482537] +- kvm-block-backend-Add-blk_co_copy_range.patch [bz#1482537] +- kvm-qemu-img-Convert-with-copy-offloading.patch [bz#1482537] +- kvm-qcow2-Fix-src_offset-in-copy-offloading.patch [bz#1482537] +- kvm-iscsi-Don-t-blindly-use-designator-length-in-respons.patch [bz#1482537] +- kvm-file-posix-Fix-EINTR-handling.patch [bz#1482537] +- kvm-usb-storage-Add-rerror-werror-properties.patch [bz#1595180] +- kvm-numa-clarify-error-message-when-node-index-is-out-of.patch [bz#1578381] +- kvm-qemu-iotests-Update-026.out.nocache-reference-output.patch [bz#1528541] +- kvm-qcow2-Free-allocated-clusters-on-write-error.patch [bz#1528541] +- kvm-qemu-iotests-Test-qcow2-not-leaking-clusters-on-writ.patch [bz#1528541] +- kvm-qemu-options-Add-missing-newline-to-accel-help-text.patch [bz#1586313] +- kvm-xhci-fix-guest-triggerable-assert.patch [bz#1594135] +- kvm-virtio-gpu-tweak-scanout-disable.patch [bz#1589634] +- kvm-virtio-gpu-update-old-resource-too.patch [bz#1589634] +- kvm-virtio-gpu-disable-scanout-when-backing-resource-is-.patch [bz#1589634] +- kvm-block-Don-t-silently-truncate-node-names.patch [bz#1549654] +- kvm-pr-helper-fix-socket-path-default-in-help.patch [bz#1533158] +- kvm-pr-helper-fix-assertion-failure-on-failed-multipath-.patch [bz#1533158] +- kvm-pr-manager-helper-avoid-SIGSEGV-when-writing-to-the-.patch [bz#1533158] +- kvm-pr-manager-put-stubs-in-.c-file.patch [bz#1533158] +- kvm-pr-manager-add-query-pr-managers-QMP-command.patch [bz#1533158] +- kvm-pr-manager-helper-report-event-on-connection-disconn.patch [bz#1533158] +- kvm-pr-helper-avoid-error-on-PR-IN-command-with-zero-req.patch [bz#1533158] +- kvm-pr-helper-Rework-socket-path-handling.patch [bz#1533158] +- kvm-pr-manager-helper-fix-memory-leak-on-event.patch [bz#1533158] +- kvm-object-fix-OBJ_PROP_LINK_UNREF_ON_RELEASE-ambivalenc.patch [bz#1556678] +- kvm-usb-hcd-xhci-test-add-a-test-for-ccid-hotplug.patch [bz#1556678] +- kvm-Revert-usb-release-the-created-buses.patch [bz#1556678] +- kvm-file-posix-Fix-creation-locking.patch [bz#1599335] +- kvm-file-posix-Unlock-FD-after-creation.patch [bz#1599335] +- kvm-ahci-trim-signatures-on-raise-lower.patch [bz#1584914] +- kvm-ahci-fix-PxCI-register-race.patch [bz#1584914] +- kvm-ahci-don-t-schedule-unnecessary-BH.patch [bz#1584914] +- kvm-qcow2-Fix-qcow2_truncate-error-return-value.patch [bz#1595173] +- kvm-block-Convert-.bdrv_truncate-callback-to-coroutine_f.patch [bz#1595173] +- kvm-qcow2-Remove-coroutine-trampoline-for-preallocate_co.patch [bz#1595173] +- kvm-block-Move-bdrv_truncate-implementation-to-io.c.patch [bz#1595173] +- kvm-block-Use-tracked-request-for-truncate.patch [bz#1595173] +- kvm-file-posix-Make-.bdrv_co_truncate-asynchronous.patch [bz#1595173] +- kvm-block-Fix-copy-on-read-crash-with-partial-final-clus.patch [bz#1590640] +- kvm-block-fix-QEMU-crash-with-scsi-hd-and-drive_del.patch [bz#1599515] +- kvm-virtio-rng-process-pending-requests-on-DRIVER_OK.patch [bz#1576743] +- kvm-file-posix-specify-expected-filetypes.patch [bz#1525829] +- kvm-iotests-add-test-226-for-file-driver-types.patch [bz#1525829] +- kvm-block-dirty-bitmap-add-lock-to-bdrv_enable-disable_d.patch [bz#1207657] +- kvm-qapi-add-x-block-dirty-bitmap-enable-disable.patch [bz#1207657] +- kvm-qmp-transaction-support-for-x-block-dirty-bitmap-ena.patch [bz#1207657] +- kvm-qapi-add-x-block-dirty-bitmap-merge.patch [bz#1207657] +- kvm-qapi-add-disabled-parameter-to-block-dirty-bitmap-ad.patch [bz#1207657] +- kvm-block-dirty-bitmap-add-bdrv_enable_dirty_bitmap_lock.patch [bz#1207657] +- kvm-dirty-bitmap-fix-double-lock-on-bitmap-enabling.patch [bz#1207657] +- kvm-block-qcow2-bitmap-fix-free_bitmap_clusters.patch [bz#1207657] +- kvm-qcow2-add-overlap-check-for-bitmap-directory.patch [bz#1207657] +- kvm-blockdev-enable-non-root-nodes-for-backup-source.patch [bz#1207657] +- kvm-iotests-add-222-to-test-basic-fleecing.patch [bz#1207657] +- kvm-qcow2-Remove-dead-check-on-ret.patch [bz#1207657] +- kvm-block-Move-request-tracking-to-children-in-copy-offl.patch [bz#1207657] +- kvm-block-Fix-parameter-checking-in-bdrv_co_copy_range_i.patch [bz#1207657] +- kvm-block-Honour-BDRV_REQ_NO_SERIALISING-in-copy-range.patch [bz#1207657] +- kvm-backup-Use-copy-offloading.patch [bz#1207657] +- kvm-block-backup-disable-copy-offloading-for-backup.patch [bz#1207657] +- kvm-iotests-222-Don-t-run-with-luks.patch [bz#1207657] +- kvm-block-io-fix-copy_range.patch [bz#1207657] +- kvm-block-split-flags-in-copy_range.patch [bz#1207657] +- kvm-block-add-BDRV_REQ_SERIALISING-flag.patch [bz#1207657] +- kvm-block-backup-fix-fleecing-scheme-use-serialized-writ.patch [bz#1207657] +- kvm-nbd-server-Reject-0-length-block-status-request.patch [bz#1207657] +- kvm-nbd-server-fix-trace.patch [bz#1207657] +- kvm-nbd-server-refactor-NBDExportMetaContexts.patch [bz#1207657] +- kvm-nbd-server-add-nbd_meta_empty_or_pattern-helper.patch [bz#1207657] +- kvm-nbd-server-implement-dirty-bitmap-export.patch [bz#1207657] +- kvm-qapi-new-qmp-command-nbd-server-add-bitmap.patch [bz#1207657] +- kvm-docs-interop-add-nbd.txt.patch [bz#1207657] +- kvm-nbd-server-introduce-NBD_CMD_CACHE.patch [bz#1207657] +- kvm-nbd-server-Silence-gcc-false-positive.patch [bz#1207657] +- kvm-nbd-server-Fix-dirty-bitmap-logic-regression.patch [bz#1207657] +- kvm-nbd-server-fix-nbd_co_send_block_status.patch [bz#1207657] +- kvm-nbd-client-Add-x-dirty-bitmap-to-query-bitmap-from-s.patch [bz#1207657] +- kvm-iotests-New-test-223-for-exporting-dirty-bitmap-over.patch [bz#1207657] +- kvm-hw-char-serial-Only-retry-if-qemu_chr_fe_write-retur.patch [bz#1592817] +- kvm-hw-char-serial-retry-write-if-EAGAIN.patch [bz#1592817] +- kvm-throttle-groups-fix-hang-when-group-member-leaves.patch [bz#1535914] +- kvm-Disable-aarch64-devices-reappeared-after-2.12-rebase.patch [bz#1586357] +- kvm-Disable-split-irq-device.patch [bz#1586357] +- kvm-Disable-AT24Cx-i2c-eeprom.patch [bz#1586357] +- kvm-Disable-CAN-bus-devices.patch [bz#1586357] +- kvm-Disable-new-superio-devices.patch [bz#1586357] +- kvm-Disable-new-pvrdma-device.patch [bz#1586357] +- kvm-qdev-add-HotplugHandler-post_plug-callback.patch [bz#1607891] +- kvm-virtio-scsi-fix-hotplug-reset-vs-event-race.patch [bz#1607891] +- kvm-e1000-Fix-tso_props-compat-for-82540em.patch [bz#1608778] +- kvm-slirp-correct-size-computation-while-concatenating-m.patch [bz#1586255] +- kvm-s390x-sclp-fix-maxram-calculation.patch [bz#1595740] +- kvm-redhat-Make-gitpublish-profile-the-default-one.patch [bz#1425820] +- Resolves: bz#1168213 + (main-loop: WARNING: I/O thread spun for 1000 iterations while doing stream block device.) +- Resolves: bz#1207657 + (RFE: QEMU Incremental live backup - push and pull modes) +- Resolves: bz#1416180 + (QEMU VFIO based block driver for NVMe devices) +- Resolves: bz#1425820 + (Improve QEMU packaging layout with modularization of the block layer) +- Resolves: bz#1482537 + ([RFE] qemu-img copy-offloading (convert command)) +- Resolves: bz#1505664 + ("qemu-kvm: System page size 0x1000000 is not enabled in page_size_mask (0x11000). Performance may be slow" show up while using hugepage as guest's memory) +- Resolves: bz#1513543 + ([RFE] Add block job to create format on a storage device) +- Resolves: bz#1518738 + (Add 'copy-on-read' filter driver for use with blockdev-add) +- Resolves: bz#1519144 + (qemu-img: image locking doesn't cover image creation) +- Resolves: bz#1519617 + (The exit code should be non-zero when qemu-io reports an error) +- Resolves: bz#1523065 + ("qemu-img resize" should fail to decrease the size of logical partition/lvm/iSCSI image with raw format) +- Resolves: bz#1525829 + (can not boot up a scsi-block passthrough disk via -blockdev with error "cannot get SG_IO version number: Operation not supported. Is this a SCSI device?") +- Resolves: bz#1526645 + ([Intel 7.6 FEAT] vHost Data Plane Acceleration (vDPA) - vhost user client - qemu-kvm-rhev) +- Resolves: bz#1527085 + (The copied flag should be updated during '-r leaks') +- Resolves: bz#1527898 + ([RFE] qemu-img should leave cluster unallocated if it's read as zero throughout the backing chain) +- Resolves: bz#1528541 + (qemu-img check reports tons of leaked clusters after re-start nfs service to resume writing data in guest) +- Resolves: bz#1533158 + (QEMU support for libvirtd restarting qemu-pr-helper) +- Resolves: bz#1535914 + (Disable io throttling for one member disk of a group during io will induce the other one hang with io) +- Resolves: bz#1537956 + (RFE: qemu-img amend should list the true supported options) +- Resolves: bz#1542080 + (Qemu core dump at cirrus_invalidate_region) +- Resolves: bz#1549654 + (Reject node-names which would be truncated by the block layer commands) +- Resolves: bz#1556678 + (Hot plug usb-ccid for the 2nd time with the same ID as the 1st time failed) +- Resolves: bz#1557995 + (QAPI schema for RBD storage misses the 'password-secret' option) +- Resolves: bz#1558723 + (Create RHEL-7.6 QEMU machine type for AArch64) +- Resolves: bz#1560847 + ([Power8][FW b0320a_1812.861][rhel7.5rc2 3.10.0-861.el7.ppc64le][qemu-kvm-{ma,rhev}-2.10.0-21.el7_5.1.ppc64le] KVM guest does not default to ori type flush even with pseries-rhel7.5.0-sxxm) +- Resolves: bz#1564576 + (Pegas 1.1 - Require to backport qemu-kvm patch that fixes expected_downtime calculation during migration) +- Resolves: bz#1566153 + (IOERROR pause code lost after resuming a VM while I/O error is still present) +- Resolves: bz#1567733 + (qemu abort when migrate during guest reboot) +- Resolves: bz#1569835 + (qemu-img get wrong backing file path after rebasing image with relative path) +- Resolves: bz#1572851 + (Core dumped after migration when with usb-host) +- Resolves: bz#1572856 + ('block-job-cancel' can not cancel a "drive-mirror" job) +- Resolves: bz#1574216 + (CVE-2018-3639 qemu-kvm-rhev: hw: cpu: speculative store bypass [rhel-7.6]) +- Resolves: bz#1575541 + (qemu core dump while installing win10 guest) +- Resolves: bz#1576598 + (Segfault in qemu-io and qemu-img with -U --image-opts force-share=off) +- Resolves: bz#1576743 + (virtio-rng hangs when running on recent (2.x) QEMU versions) +- Resolves: bz#1578381 + (Error message need update when specify numa distance with node index >=128) +- Resolves: bz#1583959 + (Incorrect vcpu count limit for 7.4 machine types for windows guests) +- Resolves: bz#1584914 + (SATA emulator lags and hangs) +- Resolves: bz#1584984 + (Vm starts failed with 'passthrough' smartcard) +- Resolves: bz#1586255 + (CVE-2018-11806 qemu-kvm-rhev: QEMU: slirp: heap buffer overflow while reassembling fragmented datagrams [rhel-7.6]) +- Resolves: bz#1586313 + (-smp option is not easily found in the output of qemu help) +- Resolves: bz#1586357 + (Disable new devices in 2.12) +- Resolves: bz#1588039 + (Possible assertion failure in qemu when a corrupted image is used during an incoming migration) +- Resolves: bz#1589634 + (Migration failed when rebooting guest with multiple virtio videos) +- Resolves: bz#1590640 + (qemu-kvm: block/io.c:1098: bdrv_co_do_copy_on_readv: Assertion `skip_bytes < pnum' failed.) +- Resolves: bz#1591076 + (The driver of 'throttle' is not whitelisted) +- Resolves: bz#1592817 + (Retrying on serial_xmit if the pipe is broken may compromise the Guest) +- Resolves: bz#1594135 + (system_reset many times linux guests cause qemu process Aborted) +- Resolves: bz#1595173 + (blockdev-create is blocking) +- Resolves: bz#1595180 + (Can't set rerror/werror with usb-storage) +- Resolves: bz#1595740 + (RHEL-Alt-7.6 - qemu has error during migration of larger guests) +- Resolves: bz#1599335 + (Image creation locking is too tight and is not properly released) +- Resolves: bz#1599515 + (qemu core-dump with aio_read via hmp (util/qemu-thread-posix.c:64: qemu_mutex_lock_impl: Assertion `mutex->initialized' failed)) +- Resolves: bz#1607891 + (Hotplug events are sometimes lost with virtio-scsi + iothread) +- Resolves: bz#1608778 + (qemu/migration: migrate failed from RHEL.7.6 to RHEL.7.5 with e1000-82540em) + +* Mon Aug 06 2018 Danilo Cesar Lemes de Paula - 2.12.0-17.el8 +- kvm-linux-headers-Update-to-include-KVM_CAP_S390_HPAGE_1.patch [bz#1610906] +- kvm-s390x-Enable-KVM-huge-page-backing-support.patch [bz#1610906] +- kvm-redhat-s390x-add-hpage-1-to-kvm.conf.patch [bz#1610906] +- Resolves: bz#1610906 + ([IBM 8.0 FEAT] KVM: Huge Pages - libhugetlbfs Enablement - qemu-kvm part) + +* Tue Jul 31 2018 Danilo Cesar Lemes de Paula - 2.12.0-16.el8 +- kvm-spapr-Correct-inverted-test-in-spapr_pc_dimm_node.patch [bz#1601671] +- kvm-osdep-powerpc64-align-memory-to-allow-2MB-radix-THP-.patch [bz#1601317] +- kvm-RHEL-8.0-Add-pseries-rhel7.6.0-sxxm-machine-type.patch [bz#1595501] +- kvm-i386-Helpers-to-encode-cache-information-consistentl.patch [bz#1597739] +- kvm-i386-Add-cache-information-in-X86CPUDefinition.patch [bz#1597739] +- kvm-i386-Initialize-cache-information-for-EPYC-family-pr.patch [bz#1597739] +- kvm-i386-Add-new-property-to-control-cache-info.patch [bz#1597739] +- kvm-i386-Clean-up-cache-CPUID-code.patch [bz#1597739] +- kvm-i386-Populate-AMD-Processor-Cache-Information-for-cp.patch [bz#1597739] +- kvm-i386-Add-support-for-CPUID_8000_001E-for-AMD.patch [bz#1597739] +- kvm-i386-Fix-up-the-Node-id-for-CPUID_8000_001E.patch [bz#1597739] +- kvm-i386-Enable-TOPOEXT-feature-on-AMD-EPYC-CPU.patch [bz#1597739] +- kvm-i386-Remove-generic-SMT-thread-check.patch [bz#1597739] +- kvm-i386-Allow-TOPOEXT-to-be-enabled-on-older-kernels.patch [bz#1597739] +- Resolves: bz#1595501 + (Create pseries-rhel7.6.0-sxxm machine type) +- Resolves: bz#1597739 + (AMD EPYC/Zen SMT support for KVM / QEMU guest (qemu-kvm)) +- Resolves: bz#1601317 + (RHEL8.0 - qemu patch to align memory to allow 2MB THP) +- Resolves: bz#1601671 + (After rebooting guest,all the hot plug memory will be assigned to the 1st numa node.) + +* Tue Jul 24 2018 Danilo Cesar Lemes de Paula - 2.12.0-15.el8 +- kvm-spapr-Add-ibm-max-associativity-domains-property.patch [bz#1599593] +- kvm-Revert-spapr-Don-t-allow-memory-hotplug-to-memory-le.patch [bz#1599593] +- kvm-simpletrace-Convert-name-from-mapping-record-to-str.patch [bz#1594969] +- kvm-tests-fix-TLS-handshake-failure-with-TLS-1.3.patch [bz#1602403] +- Resolves: bz#1594969 + (simpletrace.py fails when running with Python 3) +- Resolves: bz#1599593 + (User can't hotplug memory to less memory numa node on rhel8) +- Resolves: bz#1602403 + (test-crypto-tlssession unit test fails with assertions) + +* Mon Jul 09 2018 Danilo Cesar Lemes de Paula - 2.12.0-14.el8 +- kvm-vfio-pci-Default-display-option-to-off.patch [bz#1590511] +- kvm-python-futurize-f-libfuturize.fixes.fix_print_with_i.patch [bz#1571533] +- kvm-python-futurize-f-lib2to3.fixes.fix_except.patch [bz#1571533] +- kvm-Revert-Defining-a-shebang-for-python-scripts.patch [bz#1571533] +- kvm-spec-Fix-ambiguous-python-interpreter-name.patch [bz#1571533] +- kvm-qemu-ga-blacklisting-guest-exec-and-guest-exec-statu.patch [bz#1518132] +- kvm-redhat-rewrap-build_configure.sh-cmdline-for-the-rh-.patch [] +- kvm-redhat-remove-the-VTD-LIVE_BLOCK_OPS-and-RHV-options.patch [] +- kvm-redhat-fix-the-rh-env-prep-target-s-dependency-on-th.patch [] +- kvm-redhat-remove-dead-code-related-to-s390-not-s390x.patch [] +- kvm-redhat-sync-compiler-flags-from-the-spec-file-to-rh-.patch [] +- kvm-redhat-sync-guest-agent-enablement-and-tcmalloc-usag.patch [] +- kvm-redhat-fix-up-Python-3-dependency-for-building-QEMU.patch [] +- kvm-redhat-fix-up-Python-dependency-for-SRPM-generation.patch [] +- kvm-redhat-disable-glusterfs-dependency-support-temporar.patch [] +- Resolves: bz#1518132 + (Ensure file access RPCs are disabled by default) +- Resolves: bz#1571533 + (Convert qemu-kvm python scripts to python3) +- Resolves: bz#1590511 + (Fails to start guest with Intel vGPU device) + +* Thu Jun 21 2018 Danilo C. L. de Paula - 2.12.0-13.el8 +- Resolves: bz#1508137 + ([IBM 8.0 FEAT] KVM: Interactive Bootloader (qemu)) +- Resolves: bz#1513558 + (Remove RHEL6 machine types) +- Resolves: bz#1568600 + (pc-i440fx-rhel7.6.0 and pc-q35-rhel7.6.0 machine types (x86)) +- Resolves: bz#1570029 + ([IBM 8.0 FEAT] KVM: 3270 Connectivity - qemu part) +- Resolves: bz#1578855 + (Enable Native Ceph support on non x86_64 CPUs) +- Resolves: bz#1585651 + (RHEL 7.6 new pseries machine type (ppc64le)) +- Resolves: bz#1592337 + ([IBM 8.0 FEAT] KVM: CPU Model z14 ZR1 (qemu-kvm)) + +* Tue May 15 2018 Danilo C. L. de Paula - 2.12.0-11.el8.1 +- Resolves: bz#1576468 + (Enable vhost_user in qemu-kvm 2.12) + +* Wed May 09 2018 Danilo de Paula - 2.12.0-11.el8 +- Resolves: bz#1574406 + ([RHEL 8][qemu-kvm] Failed to find romfile "efi-virtio.rom") +- Resolves: bz#1569675 + (Backwards compatibility of pc-*-rhel7.5.0 and older machine-types) +- Resolves: bz#1576045 + (Fix build issue by using python3) +- Resolves: bz#1571145 + (qemu-kvm segfaults on RHEL 8 when run guestfsd under TCG) + +* Fri Apr 20 2018 Danilo de Paula - 2.12.0-10.el +- Fixing some issues with packaging. +- Rebasing to 2.12.0-rc4 + +* Fri Apr 13 2018 Danilo de Paula - 2.11.0-7.el8 +- Bumping epoch for RHEL8 and dropping self-obsoleting + +* Thu Apr 12 2018 Danilo de Paula - 2.11.0-6.el8 +- Rebuilding + +* Mon Mar 05 2018 Danilo de Paula - 2.11.0-5.el8 +- Prepare building on RHEL-8.0 diff --git a/rpminspect.yaml b/rpminspect.yaml new file mode 100644 index 0000000..889796d --- /dev/null +++ b/rpminspect.yaml @@ -0,0 +1,11 @@ +--- +elf: + exclude_path: (.*s390-ccw.img.*)|(.*s390-netboot.img.*) +inspections: + badfuncs: off +annocheck: + - hardened: --skip-cf-protection --skip-property-note --ignore-unknown --verbose + - rhel-policy: --skip-cf-protection --skip-property-note --ignore-unknown --verbose + ignore: + - /usr/share/qemu-kvm/s390-ccw.img + - /usr/share/qemu-kvm/s390-netboot.img diff --git a/sources b/sources index e69de29..b5ace58 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (qemu-8.0.0.tar.xz) = 1f31d1e653dec2d35f1b7a5468ee3f471553b48eca8c8afafffcf9243c6b2260e78a5b73da3fe567f9b85d4133573eebd397747b3aec501fb24076263eb07b27 diff --git a/vhost.conf b/vhost.conf new file mode 100644 index 0000000..68d6d7f --- /dev/null +++ b/vhost.conf @@ -0,0 +1,3 @@ +# Increase default vhost memory map limit to match +# KVM's memory slot limit +options vhost max_mem_regions=509