diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a63ad11 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/qemu-6.0.0.tar.xz diff --git a/.qemu-kvm.metadata b/.qemu-kvm.metadata new file mode 100644 index 0000000..5f33345 --- /dev/null +++ b/.qemu-kvm.metadata @@ -0,0 +1 @@ +131854b10d8c1614ae137c647aa31b756782ba2e SOURCES/qemu-6.0.0.tar.xz diff --git a/SOURCES/0004-Initial-redhat-build.patch b/SOURCES/0004-Initial-redhat-build.patch new file mode 100644 index 0000000..a697dd3 --- /dev/null +++ b/SOURCES/0004-Initial-redhat-build.patch @@ -0,0 +1,230 @@ +From 431955e872aa010376b1f94665908c2ba8194b44 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 12 Oct 2018 07:31:11 +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-5.2.0-16.el9 + +Signed-off-by: Miroslav Rezanina + +Merged patches (6.0.0): +- 605758c902 Limit build on Power to qemu-img and qemu-ga only +--- + .gitignore | 1 + + README.systemtap | 43 + + configure | 5 - + hw/remote/memory.c | 2 +- + hw/remote/proxy.c | 2 +- + meson.build | 8 +- + redhat/Makefile | 90 + + redhat/Makefile.common | 50 + + redhat/README.tests | 39 + + redhat/qemu-kvm.spec.template | 3609 +++++++++++++++++++++++ + redhat/scripts/extract_build_cmd.py | 5 +- + redhat/scripts/process-patches.sh | 20 +- + redhat/udev-kvm-check.c | 19 +- + scripts/qemu-guest-agent/fsfreeze-hook | 2 +- + scripts/systemtap/conf.d/qemu_kvm.conf | 4 + + scripts/systemtap/script.d/qemu_kvm.stp | 1 + + tests/check-block.sh | 2 + + ui/vnc.c | 2 +- + 18 files changed, 3860 insertions(+), 44 deletions(-) + create mode 100644 README.systemtap + create mode 100644 redhat/Makefile + create mode 100644 redhat/Makefile.common + create mode 100644 redhat/README.tests + create mode 100644 redhat/qemu-kvm.spec.template + 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/configure b/configure +index 4f374b4889..53b2fa583a 100755 +--- a/configure ++++ b/configure +@@ -6383,10 +6383,6 @@ fi + mv $cross config-meson.cross + + rm -rf meson-private meson-info meson-logs +-unset staticpic +-if ! version_ge "$($meson --version)" 0.56.0; then +- staticpic=$(if test "$pie" = yes; then echo true; else echo false; fi) +-fi + NINJA=$ninja $meson setup \ + --prefix "$prefix" \ + --libdir "$libdir" \ +@@ -6406,7 +6402,6 @@ NINJA=$ninja $meson setup \ + -Dwerror=$(if test "$werror" = yes; then echo true; else echo false; fi) \ + -Dstrip=$(if test "$strip_opt" = yes; then echo true; else echo false; fi) \ + -Db_pie=$(if test "$pie" = yes; then echo true; else echo false; fi) \ +- ${staticpic:+-Db_staticpic=$staticpic} \ + -Db_coverage=$(if test "$gcov" = yes; then echo true; else echo false; fi) \ + -Db_lto=$lto -Dcfi=$cfi -Dcfi_debug=$cfi_debug \ + -Dmalloc=$malloc -Dmalloc_trim=$malloc_trim -Dsparse=$sparse \ +diff --git a/hw/remote/memory.c b/hw/remote/memory.c +index 32085b1e05..bf0047a81b 100644 +--- a/hw/remote/memory.c ++++ b/hw/remote/memory.c +@@ -43,7 +43,7 @@ void remote_sysmem_reconfig(MPQemuMsg *msg, Error **errp) + remote_sysmem_reset(); + + for (region = 0; region < msg->num_fds; region++) { +- g_autofree char *name; ++ g_autofree char *name = NULL; + subregion = g_new(MemoryRegion, 1); + name = g_strdup_printf("remote-mem-%u", suffix++); + memory_region_init_ram_from_fd(subregion, NULL, +diff --git a/hw/remote/proxy.c b/hw/remote/proxy.c +index 4fa4be079d..253c1aa7ec 100644 +--- a/hw/remote/proxy.c ++++ b/hw/remote/proxy.c +@@ -347,7 +347,7 @@ static void probe_pci_info(PCIDevice *dev, Error **errp) + PCI_BASE_ADDRESS_SPACE_IO : PCI_BASE_ADDRESS_SPACE_MEMORY; + + if (size) { +- g_autofree char *name; ++ g_autofree char *name = NULL; + pdev->region[i].dev = pdev; + pdev->region[i].present = true; + if (type == PCI_BASE_ADDRESS_SPACE_MEMORY) { +diff --git a/meson.build b/meson.build +index c6f4b0cf5e..06c15bd6d2 100644 +--- a/meson.build ++++ b/meson.build +@@ -1,6 +1,6 @@ + project('qemu', ['c'], meson_version: '>=0.55.0', +- default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto'] + +- (meson.version().version_compare('>=0.56.0') ? [ 'b_staticpic=false' ] : []), ++ default_options: ['warning_level=1', 'c_std=gnu99', 'cpp_std=gnu++11', 'b_colorout=auto', ++ 'b_staticpic=false' ], + version: run_command('head', meson.source_root() / 'VERSION').stdout().strip()) + + not_found = dependency('', required: false) +@@ -1482,7 +1482,9 @@ if capstone_opt == 'internal' + # Include all configuration defines via a header file, which will wind up + # as a dependency on the object file, and thus changes here will result + # in a rebuild. +- '-include', 'capstone-defs.h' ++ '-include', 'capstone-defs.h', ++ ++ '-Wp,-D_GLIBCXX_ASSERTIONS', + ] + + libcapstone = static_library('capstone', +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/tests/check-block.sh b/tests/check-block.sh +index f86cb863de..6d38340d49 100755 +--- a/tests/check-block.sh ++++ b/tests/check-block.sh +@@ -69,6 +69,8 @@ else + fi + fi + ++exit 0 ++ + cd tests/qemu-iotests + + # QEMU_CHECK_BLOCK_AUTO is used to disable some unstable sub-tests +diff --git a/ui/vnc.c b/ui/vnc.c +index 456db47d71..97ae92b181 100644 +--- a/ui/vnc.c ++++ b/ui/vnc.c +@@ -4146,7 +4146,7 @@ void vnc_display_open(const char *id, Error **errp) + + #ifdef CONFIG_VNC_SASL + if (sasl) { +- 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.27.0 + diff --git a/SOURCES/0005-Enable-disable-devices-for-RHEL.patch b/SOURCES/0005-Enable-disable-devices-for-RHEL.patch new file mode 100644 index 0000000..d80a533 --- /dev/null +++ b/SOURCES/0005-Enable-disable-devices-for-RHEL.patch @@ -0,0 +1,764 @@ +From f46ca4c7e719e0a70f8e0ffe3de882c017c216e7 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 2 Sep 2020 09:11:07 +0200 +Subject: Enable/disable devices for RHEL + +This commit adds all changes related to changes in supported devices. + +Signed-off-by: Miroslav Rezanina +--- + .../devices/aarch64-rh-devices.mak | 28 +++++ + default-configs/devices/aarch64-softmmu.mak | 10 +- + default-configs/devices/ppc64-rh-devices.mak | 36 ++++++ + default-configs/devices/ppc64-softmmu.mak | 10 +- + default-configs/devices/rh-virtio.mak | 10 ++ + default-configs/devices/s390x-rh-devices.mak | 16 +++ + default-configs/devices/s390x-softmmu.mak | 4 +- + default-configs/devices/x86_64-rh-devices.mak | 104 ++++++++++++++++++ + default-configs/devices/x86_64-softmmu.mak | 10 +- + .../devices/x86_64-upstream-devices.mak | 4 + + hw/acpi/ich9.c | 4 +- + hw/arm/meson.build | 2 +- + hw/block/fdc.c | 10 ++ + hw/char/parallel.c | 9 ++ + hw/cpu/meson.build | 5 +- + hw/display/cirrus_vga.c | 3 + + hw/ide/piix.c | 5 +- + hw/input/pckbd.c | 2 + + hw/net/e1000.c | 2 + + hw/ppc/spapr_cpu_core.c | 2 + + hw/timer/hpet.c | 8 ++ + hw/usb/meson.build | 2 +- + qemu-options.hx | 4 - + redhat/qemu-kvm.spec.template | 5 +- + target/arm/cpu_tcg.c | 10 ++ + target/ppc/cpu-models.c | 10 ++ + target/s390x/cpu_models.c | 3 + + target/s390x/kvm.c | 8 ++ + 28 files changed, 304 insertions(+), 22 deletions(-) + create mode 100644 default-configs/devices/aarch64-rh-devices.mak + create mode 100644 default-configs/devices/ppc64-rh-devices.mak + create mode 100644 default-configs/devices/rh-virtio.mak + create mode 100644 default-configs/devices/s390x-rh-devices.mak + create mode 100644 default-configs/devices/x86_64-rh-devices.mak + create mode 100644 default-configs/devices/x86_64-upstream-devices.mak + +diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak +new file mode 100644 +index 0000000000..a4d67274c0 +--- /dev/null ++++ b/default-configs/devices/aarch64-rh-devices.mak +@@ -0,0 +1,28 @@ ++include rh-virtio.mak ++ ++CONFIG_ARM_GIC_KVM=y ++CONFIG_ARM_GIC=y ++CONFIG_ARM_SMMUV3=y ++CONFIG_ARM_V7M=y ++CONFIG_ARM_VIRT=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_VFIO=y ++CONFIG_VFIO_PCI=y ++CONFIG_VIRTIO_MMIO=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_XIO3130=y ++CONFIG_NVDIMM=y ++CONFIG_ACPI_APEI=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_TIS_SYSBUS=y ++CONFIG_PTIMER=y ++CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y +diff --git a/default-configs/devices/aarch64-softmmu.mak b/default-configs/devices/aarch64-softmmu.mak +index 958b1e08e4..8f6867d48a 100644 +--- a/default-configs/devices/aarch64-softmmu.mak ++++ b/default-configs/devices/aarch64-softmmu.mak +@@ -1,8 +1,10 @@ + # Default configuration for aarch64-softmmu + + # We support all the 32 bit boards so need all their config +-include arm-softmmu.mak ++#include arm-softmmu.mak + +-CONFIG_XLNX_ZYNQMP_ARM=y +-CONFIG_XLNX_VERSAL=y +-CONFIG_SBSA_REF=y ++#CONFIG_XLNX_ZYNQMP_ARM=y ++#CONFIG_XLNX_VERSAL=y ++#CONFIG_SBSA_REF=y ++ ++include aarch64-rh-devices.mak +diff --git a/default-configs/devices/ppc64-rh-devices.mak b/default-configs/devices/ppc64-rh-devices.mak +new file mode 100644 +index 0000000000..5b01b7fac0 +--- /dev/null ++++ b/default-configs/devices/ppc64-rh-devices.mak +@@ -0,0 +1,36 @@ ++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_BOT=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_SPAPR=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_PASSTHROUGH=y +diff --git a/default-configs/devices/ppc64-softmmu.mak b/default-configs/devices/ppc64-softmmu.mak +index ae0841fa3a..040e5575e7 100644 +--- a/default-configs/devices/ppc64-softmmu.mak ++++ b/default-configs/devices/ppc64-softmmu.mak +@@ -1,11 +1,13 @@ + # Default configuration for ppc64-softmmu + + # Include all 32-bit boards +-include ppc-softmmu.mak ++#include ppc-softmmu.mak + + # For PowerNV +-CONFIG_POWERNV=y ++#CONFIG_POWERNV=y + + # For pSeries +-CONFIG_PSERIES=y +-CONFIG_NVDIMM=y ++#CONFIG_PSERIES=y ++#CONFIG_NVDIMM=y ++ ++include ppc64-rh-devices.mak +diff --git a/default-configs/devices/rh-virtio.mak b/default-configs/devices/rh-virtio.mak +new file mode 100644 +index 0000000000..94ede1b5f6 +--- /dev/null ++++ b/default-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/default-configs/devices/s390x-rh-devices.mak b/default-configs/devices/s390x-rh-devices.mak +new file mode 100644 +index 0000000000..08a15f3e01 +--- /dev/null ++++ b/default-configs/devices/s390x-rh-devices.mak +@@ -0,0 +1,16 @@ ++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_TERMINAL3270=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 +diff --git a/default-configs/devices/s390x-softmmu.mak b/default-configs/devices/s390x-softmmu.mak +index f2287a133f..3e2e388e91 100644 +--- a/default-configs/devices/s390x-softmmu.mak ++++ b/default-configs/devices/s390x-softmmu.mak +@@ -10,4 +10,6 @@ + + # Boards: + # +-CONFIG_S390_CCW_VIRTIO=y ++#CONFIG_S390_CCW_VIRTIO=y ++ ++include s390x-rh-devices.mak +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +new file mode 100644 +index 0000000000..9f41400530 +--- /dev/null ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -0,0 +1,104 @@ ++include rh-virtio.mak ++ ++CONFIG_AC97=y ++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_X86_ICH=y ++CONFIG_AHCI=y ++CONFIG_APIC=y ++CONFIG_APM=y ++CONFIG_BOCHS_DISPLAY=y ++CONFIG_DIMM=y ++CONFIG_E1000E_PCI_EXPRESS=y ++CONFIG_E1000_PCI=y ++CONFIG_EDU=y ++CONFIG_FDC=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_QXL=y ++CONFIG_RTL8139_PCI=y ++CONFIG_SCSI=y ++CONFIG_SERIAL=y ++CONFIG_SERIAL_ISA=y ++CONFIG_SERIAL_PCI=y ++CONFIG_SEV=y ++CONFIG_SGA=y ++CONFIG_SMBIOS=y ++CONFIG_SMBUS_EEPROM=y ++CONFIG_SPICE=y ++CONFIG_TEST_DEVICES=y ++CONFIG_USB=y ++CONFIG_USB_EHCI=y ++CONFIG_USB_EHCI_PCI=y ++CONFIG_USB_SMARTCARD=y ++CONFIG_USB_STORAGE_BOT=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_PCI=y ++CONFIG_VIRTIO_VGA=y ++CONFIG_VMMOUSE=y ++CONFIG_VMPORT=y ++CONFIG_VTD=y ++CONFIG_WDT_IB6300ESB=y ++CONFIG_WDT_IB700=y ++CONFIG_XIO3130=y ++CONFIG_TPM_CRB=y ++CONFIG_TPM_TIS_ISA=y ++CONFIG_TPM_EMULATOR=y ++CONFIG_TPM_PASSTHROUGH=y +diff --git a/default-configs/devices/x86_64-softmmu.mak b/default-configs/devices/x86_64-softmmu.mak +index 64b2ee2960..e57bcff7d9 100644 +--- a/default-configs/devices/x86_64-softmmu.mak ++++ b/default-configs/devices/x86_64-softmmu.mak +@@ -1,3 +1,11 @@ + # Default configuration for x86_64-softmmu + +-include i386-softmmu.mak ++#include i386-softmmu.mak ++ ++include x86_64-rh-devices.mak ++ ++# ++# RHEL: this is for the limited upstream machine type support, so to export ++# some more devices than what RHEL machines have. ++# ++include x86_64-upstream-devices.mak +diff --git a/default-configs/devices/x86_64-upstream-devices.mak b/default-configs/devices/x86_64-upstream-devices.mak +new file mode 100644 +index 0000000000..2cd20f54d2 +--- /dev/null ++++ b/default-configs/devices/x86_64-upstream-devices.mak +@@ -0,0 +1,4 @@ ++# We need "isa-parallel" ++CONFIG_PARALLEL=y ++# We need "hpet" ++CONFIG_HPET=y +diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c +index 853447cf9d..7f01fad64c 100644 +--- a/hw/acpi/ich9.c ++++ b/hw/acpi/ich9.c +@@ -374,8 +374,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) + static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN; + pm->acpi_memory_hotplug.is_enabled = true; + pm->cpu_hotplug_legacy = true; +- pm->disable_s3 = 0; +- pm->disable_s4 = 0; ++ pm->disable_s3 = 1; ++ pm->disable_s4 = 1; + pm->s4_val = 2; + + object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE, +diff --git a/hw/arm/meson.build b/hw/arm/meson.build +index be39117b9b..6fcc5ede50 100644 +--- a/hw/arm/meson.build ++++ b/hw/arm/meson.build +@@ -30,7 +30,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 a825c2acba..c62927bb3a 100644 +--- a/hw/block/fdc.c ++++ b/hw/block/fdc.c +@@ -49,6 +49,8 @@ + #include "trace.h" + #include "qom/object.h" + ++#include "hw/boards.h" ++ + /********************************************************/ + /* debug Floppy devices */ + +@@ -2554,6 +2556,14 @@ static void fdctrl_realize_common(DeviceState *dev, FDCtrl *fdctrl, + 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/char/parallel.c b/hw/char/parallel.c +index b45e67bfbb..e5f108211b 100644 +--- a/hw/char/parallel.c ++++ b/hw/char/parallel.c +@@ -29,6 +29,7 @@ + #include "chardev/char-parallel.h" + #include "chardev/char-fe.h" + #include "hw/acpi/aml-build.h" ++#include "hw/boards.h" + #include "hw/irq.h" + #include "hw/isa/isa.h" + #include "hw/qdev-properties.h" +@@ -534,6 +535,14 @@ static void parallel_isa_realizefn(DeviceState *dev, Error **errp) + int base; + uint8_t dummy; + ++ /* Restricted for Red Hat Enterprise Linux */ ++ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); ++ if (strstr(mc->name, "rhel")) { ++ error_setg(errp, "Device %s is not supported with machine type %s", ++ object_get_typename(OBJECT(dev)), mc->name); ++ return; ++ } ++ + if (!qemu_chr_fe_backend_connected(&s->chr)) { + error_setg(errp, "Can't create parallel device, empty char device"); + return; +diff --git a/hw/cpu/meson.build b/hw/cpu/meson.build +index 9e52fee9e7..bb71c9f3e7 100644 +--- a/hw/cpu/meson.build ++++ b/hw/cpu/meson.build +@@ -1,6 +1,7 @@ +-softmmu_ss.add(files('core.c', 'cluster.c')) ++#softmmu_ss.add(files('core.c', 'cluster.c')) ++softmmu_ss.add(files('core.c')) + + specific_ss.add(when: 'CONFIG_ARM11MPCORE', if_true: files('arm11mpcore.c')) + specific_ss.add(when: 'CONFIG_REALVIEW', if_true: files('realview_mpcore.c')) + specific_ss.add(when: 'CONFIG_A9MPCORE', if_true: files('a9mpcore.c')) +-specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c')) ++#specific_ss.add(when: 'CONFIG_A15MPCORE', if_true: files('a15mpcore.c')) +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index fdca6ca659..fa1a7eee51 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -2945,6 +2945,9 @@ 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. */ + if (s->vga.vram_size_mb != 4 && s->vga.vram_size_mb != 8 && +diff --git a/hw/ide/piix.c b/hw/ide/piix.c +index b9860e35a5..beb1ea6c46 100644 +--- a/hw/ide/piix.c ++++ b/hw/ide/piix.c +@@ -220,7 +220,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 = { +@@ -249,6 +250,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 dde85ba6c6..62cf60c9c9 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -597,6 +597,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_kbd_isa; + isa->build_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 4f75b44cfc..6f075fe235 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1797,6 +1797,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, +@@ -1809,6 +1810,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 4f316a6f9d..64178f0f9a 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -370,10 +370,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/timer/hpet.c b/hw/timer/hpet.c +index 9520471be2..202e032524 100644 +--- a/hw/timer/hpet.c ++++ b/hw/timer/hpet.c +@@ -733,6 +733,14 @@ static void hpet_realize(DeviceState *dev, Error **errp) + int i; + HPETTimer *timer; + ++ /* Restricted for Red Hat Enterprise Linux */ ++ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine()); ++ if (strstr(mc->name, "rhel")) { ++ error_setg(errp, "Device %s is not supported with machine type %s", ++ object_get_typename(OBJECT(dev)), mc->name); ++ return; ++ } ++ + if (!s->intcap) { + warn_report("Hpet's intcap not initialized"); + } +diff --git a/hw/usb/meson.build b/hw/usb/meson.build +index fb7a74e73a..674993aa4f 100644 +--- a/hw/usb/meson.build ++++ b/hw/usb/meson.build +@@ -55,7 +55,7 @@ softmmu_ss.add(when: 'CONFIG_USB_SMARTCARD', if_true: files('dev-smartcard-reade + if config_host.has_key('CONFIG_SMARTCARD') + 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/qemu-options.hx b/qemu-options.hx +index fd21002bd6..0d4fb61bf7 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -2327,10 +2327,6 @@ ERST + + DEF("no-hpet", 0, QEMU_OPTION_no_hpet, + "-no-hpet disable HPET\n", QEMU_ARCH_I386) +-SRST +-``-no-hpet`` +- Disable HPET support. +-ERST + + DEF("acpitable", HAS_ARG, QEMU_OPTION_acpitable, + "-acpitable [sig=str][,rev=n][,oem_id=str][,oem_table_id=str][,oem_rev=n][,asl_compiler_id=str][,asl_compiler_rev=n][,{data|file}=file1[:file2]...]\n" +diff --git a/target/arm/cpu_tcg.c b/target/arm/cpu_tcg.c +index 046e476f65..c3cd0ca039 100644 +--- a/target/arm/cpu_tcg.c ++++ b/target/arm/cpu_tcg.c +@@ -22,6 +22,7 @@ + /* 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 */ + #ifdef CONFIG_TCG + static bool arm_v7m_cpu_exec_interrupt(CPUState *cs, int interrupt_request) + { +@@ -375,6 +376,7 @@ static void cortex_a9_initfn(Object *obj) + cpu->ccsidr[1] = 0x200fe019; /* 16k L1 icache. */ + 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) +@@ -400,6 +402,7 @@ static const ARMCPRegInfo cortexa15_cp_reginfo[] = { + REGINFO_SENTINEL + }; + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void cortex_a7_initfn(Object *obj) + { + ARMCPU *cpu = ARM_CPU(obj); +@@ -445,6 +448,7 @@ static void cortex_a7_initfn(Object *obj) + cpu->ccsidr[2] = 0x711fe07a; /* 4096K L2 unified cache */ + define_arm_cp_regs(cpu, cortexa15_cp_reginfo); /* Same as A15 */ + } ++#endif /* disabled for RHEL */ + + static void cortex_a15_initfn(Object *obj) + { +@@ -488,6 +492,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); +@@ -927,6 +932,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 + /* +@@ -1004,6 +1010,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 }, +@@ -1019,7 +1026,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, +@@ -1050,6 +1059,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 87e4228614..6eaa65efff 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 401 family */ + POWERPC_DEF("401", CPU_POWERPC_401, 401, +@@ -740,8 +741,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, +@@ -760,6 +763,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, +@@ -782,6 +786,7 @@ + /* PowerPC CPU aliases */ + + PowerPCCPUAlias ppc_cpu_aliases[] = { ++#if 0 /* Embedded and 32-bit CPUs disabled for Red Hat Enterprise Linux */ + { "403", "403gc" }, + { "405", "405d4" }, + { "405cr", "405crc" }, +@@ -940,12 +945,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" }, +@@ -955,6 +963,7 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "power10", "power10_v1.0" }, + #endif + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* Generic PowerPCs */ + #if defined(TARGET_PPC64) + { "ppc64", "970fx_v3.1" }, +@@ -962,5 +971,6 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "ppc32", "604" }, + { "ppc", "604" }, + { "default", "604" }, ++#endif + { NULL, NULL } + }; +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 050dcf2d42..9254ff46bf 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -430,6 +430,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.c b/target/s390x/kvm.c +index 4fb3bbfef5..6c69d84b84 100644 +--- a/target/s390x/kvm.c ++++ b/target/s390x/kvm.c +@@ -2516,6 +2516,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.27.0 + diff --git a/SOURCES/0006-Machine-type-related-general-changes.patch b/SOURCES/0006-Machine-type-related-general-changes.patch new file mode 100644 index 0000000..5c503bc --- /dev/null +++ b/SOURCES/0006-Machine-type-related-general-changes.patch @@ -0,0 +1,994 @@ +From 80e9b92048e6fe7c7aef0e64cbc0f855bd3a6272 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 +--- + hw/acpi/ich9.c | 15 +++ + hw/acpi/piix4.c | 5 +- + hw/arm/virt.c | 2 +- + hw/char/serial.c | 16 +++ + hw/core/machine.c | 251 +++++++++++++++++++++++++++++++++++ + hw/display/vga-isa.c | 2 +- + hw/i386/pc_piix.c | 2 + + hw/i386/pc_q35.c | 2 + + hw/net/e1000e.c | 21 +++ + hw/net/rtl8139.c | 4 +- + hw/rtc/mc146818rtc.c | 6 + + hw/smbios/smbios.c | 46 ++++++- + hw/timer/i8254_common.c | 2 +- + hw/usb/hcd-uhci.c | 4 +- + hw/usb/hcd-xhci-pci.c | 59 ++++++-- + hw/usb/hcd-xhci-pci.h | 1 + + hw/usb/hcd-xhci.c | 20 +++ + hw/usb/hcd-xhci.h | 2 + + include/hw/acpi/ich9.h | 3 + + include/hw/boards.h | 33 +++++ + include/hw/firmware/smbios.h | 5 +- + include/hw/i386/pc.h | 3 + + include/hw/usb.h | 3 + + migration/migration.c | 2 + + migration/migration.h | 5 + + 25 files changed, 489 insertions(+), 25 deletions(-) + +diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c +index 7f01fad64c..33b0c6e33c 100644 +--- a/hw/acpi/ich9.c ++++ b/hw/acpi/ich9.c +@@ -369,6 +369,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp) + s->pm.enable_tco = value; + } + ++static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp) ++{ ++ ICH9LPCState *s = ICH9_LPC_DEVICE(obj); ++ return s->pm.force_rev1_fadt; ++} ++ ++static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp) ++{ ++ ICH9LPCState *s = ICH9_LPC_DEVICE(obj); ++ s->pm.force_rev1_fadt = value; ++} ++ + void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) + { + static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN; +@@ -391,6 +403,9 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) + object_property_add_bool(obj, "cpu-hotplug-legacy", + ich9_pm_get_cpu_hotplug_legacy, + ich9_pm_set_cpu_hotplug_legacy); ++ object_property_add_bool(obj, "__com.redhat_force-rev1-fadt", ++ ich9_pm_get_force_rev1_fadt, ++ ich9_pm_set_force_rev1_fadt); + object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED, + &pm->disable_s3, OBJ_PROP_FLAG_READWRITE); + object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED, +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index 8f8b0e95e5..9865d1a349 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -278,6 +278,7 @@ 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), +@@ -643,8 +644,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev) + + static Property piix4_pm_properties[] = { + DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0), +- DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0), +- DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0), ++ DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1), ++ DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1), + DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2), + DEFINE_PROP_BOOL("acpi-pci-hotplug-with-bridge-support", PIIX4PMState, + use_acpi_hotplug_bridge, true), +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 9f01d9041b..f904d3e98e 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -1522,7 +1522,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_30); ++ true, NULL, NULL, SMBIOS_ENTRY_POINT_30); + + smbios_get_tables(MACHINE(vms), NULL, 0, &smbios_tables, &smbios_tables_len, + &smbios_anchor, &smbios_anchor_len); +diff --git a/hw/char/serial.c b/hw/char/serial.c +index bc2e322970..cc378142a3 100644 +--- a/hw/char/serial.c ++++ b/hw/char/serial.c +@@ -37,6 +37,7 @@ + #include "trace.h" + #include "hw/qdev-properties.h" + #include "hw/qdev-properties-system.h" ++#include "migration/migration.h" + + #define UART_LCR_DLAB 0x80 /* Divisor latch access bit */ + +@@ -689,6 +690,9 @@ static int serial_post_load(void *opaque, int version_id) + static bool serial_thr_ipending_needed(void *opaque) + { + SerialState *s = opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } + + if (s->ier & UART_IER_THRI) { + bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI); +@@ -770,6 +774,10 @@ static const VMStateDescription vmstate_serial_xmit_fifo = { + static bool serial_fifo_timeout_timer_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return timer_pending(s->fifo_timeout_timer); + } + +@@ -787,6 +795,10 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = { + static bool serial_timeout_ipending_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return s->timeout_ipending != 0; + } + +@@ -804,6 +816,10 @@ static const VMStateDescription vmstate_serial_timeout_ipending = { + static bool serial_poll_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return s->poll_msl >= 0; + } + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 40def78183..848e7fdff6 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -36,6 +36,257 @@ + #include "hw/virtio/virtio.h" + #include "hw/virtio/virtio-pci.h" + ++/* ++ * 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"}, ++}; ++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 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); ++ ++/* The same as hw_compat_2_11 + hw_compat_2_10 */ ++GlobalProperty hw_compat_rhel_7_5[] = { ++ /* hw_compat_rhel_7_5 from hw_compat_2_11 */ ++ { "hpet", "hpet-offset-saved", "false" }, ++ /* hw_compat_rhel_7_5 from hw_compat_2_11 */ ++ { "virtio-blk-pci", "vectors", "2" }, ++ /* hw_compat_rhel_7_5 from hw_compat_2_11 */ ++ { "vhost-user-blk-pci", "vectors", "2" }, ++ /* hw_compat_rhel_7_5 from hw_compat_2_11 ++ bz 1608778 modified for our naming */ ++ { "e1000-82540em", "migrate_tso_props", "off" }, ++ /* hw_compat_rhel_7_5 from hw_compat_2_10 */ ++ { "virtio-mouse-device", "wheel-axis", "false" }, ++ /* hw_compat_rhel_7_5 from hw_compat_2_10 */ ++ { "virtio-tablet-device", "wheel-axis", "false" }, ++ { "cirrus-vga", "vgamem_mb", "16" }, ++ { "migration", "decompress-error-check", "off" }, ++}; ++const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5); ++ ++/* Mostly like hw_compat_2_9 except ++ * x-mtu-bypass-backend, x-migrate-msix has already been ++ * backported to RHEL7.4. shpc was already on in 7.4. ++ */ ++GlobalProperty hw_compat_rhel_7_4[] = { ++ { "intel-iommu", "pt", "off" }, ++}; ++ ++const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4); ++/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except ++ * disable-modern, disable-legacy, page-per-vq have already been ++ * backported to RHEL7.3 ++ */ ++GlobalProperty hw_compat_rhel_7_3[] = { ++ { "virtio-mmio", "format_transport_address", "off" }, ++ { "virtio-serial-device", "emergency-write", "off" }, ++ { "ioapic", "version", "0x11" }, ++ { "intel-iommu", "x-buggy-eim", "true" }, ++ { "virtio-pci", "x-ignore-backend-features", "on" }, ++ { "fw_cfg_mem", "x-file-slots", stringify(0x10) }, ++ { "fw_cfg_io", "x-file-slots", stringify(0x10) }, ++ { "pflash_cfi01", "old-multiple-chip-handling", "on" }, ++ { TYPE_PCI_DEVICE, "x-pcie-extcap-init", "off" }, ++ { "virtio-pci", "x-pcie-deverr-init", "off" }, ++ { "virtio-pci", "x-pcie-lnkctl-init", "off" }, ++ { "virtio-pci", "x-pcie-pm-init", "off" }, ++ { "virtio-net-device", "x-mtu-bypass-backend", "off" }, ++ { "e1000e", "__redhat_e1000e_7_3_intr_state", "on" }, ++}; ++const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3); ++ ++/* Mostly like hw_compat_2_4 + 2_3 but: ++ * we don't need "any_layout" as it has been backported to 7.2 ++ */ ++GlobalProperty hw_compat_rhel_7_2[] = { ++ { "virtio-blk-device", "scsi", "true" }, ++ { "e1000-82540em", "extra_mac_registers", "off" }, ++ { "virtio-pci", "x-disable-pcie", "on" }, ++ { "virtio-pci", "migrate-extra", "off" }, ++ { "fw_cfg_mem", "dma_enabled", "off" }, ++ { "fw_cfg_io", "dma_enabled", "off" }, ++ { "isa-fdc", "fallback", "144" }, ++ /* Optional because not all virtio-pci devices support legacy mode */ ++ { "virtio-pci", "disable-modern", "on", .optional = true }, ++ { "virtio-pci", "disable-legacy", "off", .optional = true }, ++ { TYPE_PCI_DEVICE, "x-pcie-lnksta-dllla", "off" }, ++ { "virtio-pci", "page-per-vq", "on" }, ++ /* hw_compat_rhel_7_2 - introduced with 2.10.0 */ ++ { "migration", "send-section-footer", "off" }, ++ /* hw_compat_rhel_7_2 - introduced with 2.10.0 */ ++ { "migration", "store-global-state", "off", ++ }, ++}; ++const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2); ++ ++/* Mostly like hw_compat_2_1 but: ++ * we don't need virtio-scsi-pci since 7.0 already had that on ++ * ++ * RH: Note, qemu-extended-regs should have been enabled in the 7.1 ++ * machine type, but was accidentally turned off in 7.2 onwards. ++ */ ++GlobalProperty hw_compat_rhel_7_1[] = { ++ { "intel-hda-generic", "old_msi_addr", "on" }, ++ { "VGA", "qemu-extended-regs", "off" }, ++ { "secondary-vga", "qemu-extended-regs", "off" }, ++ { "usb-mouse", "usb_version", stringify(1) }, ++ { "usb-kbd", "usb_version", stringify(1) }, ++ { "virtio-pci", "virtio-pci-bus-master-bug-migration", "on" }, ++ { "virtio-blk-pci", "any_layout", "off" }, ++ { "virtio-balloon-pci", "any_layout", "off" }, ++ { "virtio-serial-pci", "any_layout", "off" }, ++ { "virtio-9p-pci", "any_layout", "off" }, ++ { "virtio-rng-pci", "any_layout", "off" }, ++ /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ ++ { "migration", "send-configuration", "off" }, ++}; ++const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1); ++ + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c +index 90851e730b..a91c5d7467 100644 +--- a/hw/display/vga-isa.c ++++ b/hw/display/vga-isa.c +@@ -85,7 +85,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 46cc951073..62433d8022 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -179,6 +179,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, + SMBIOS_ENTRY_POINT_21); + } + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 53450190f5..fce52ca70b 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -198,6 +198,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, + SMBIOS_ENTRY_POINT_21); + } + +diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c +index a8a77eca95..6d39c1f1c4 100644 +--- a/hw/net/e1000e.c ++++ b/hw/net/e1000e.c +@@ -80,6 +80,11 @@ struct E1000EState { + + E1000ECore core; + ++ /* 7.3 had the intr_state field that was in the original e1000e code ++ * but that was removed prior to 2.7's release ++ */ ++ bool redhat_7_3_intr_state_enable; ++ uint32_t redhat_7_3_intr_state; + }; + + #define E1000E_MMIO_IDX 0 +@@ -95,6 +100,10 @@ struct E1000EState { + #define E1000E_MSIX_TABLE (0x0000) + #define E1000E_MSIX_PBA (0x2000) + ++/* Values as in RHEL 7.3 build and original upstream */ ++#define RH_E1000E_USE_MSI BIT(0) ++#define RH_E1000E_USE_MSIX BIT(1) ++ + static uint64_t + e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size) + { +@@ -306,6 +315,8 @@ e1000e_init_msix(E1000EState *s) + } else { + if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) { + msix_uninit(d, &s->msix, &s->msix); ++ } else { ++ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX; + } + } + } +@@ -477,6 +488,8 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp) + ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL); + if (ret) { + trace_e1000e_msi_init_fail(ret); ++ } else { ++ s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI; + } + + if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset, +@@ -600,6 +613,11 @@ static const VMStateDescription e1000e_vmstate_intr_timer = { + VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0, \ + e1000e_vmstate_intr_timer, E1000IntrDelayTimer) + ++static bool rhel_7_3_check(void *opaque, int version_id) ++{ ++ return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable; ++} ++ + static const VMStateDescription e1000e_vmstate = { + .name = "e1000e", + .version_id = 1, +@@ -611,6 +629,7 @@ static const VMStateDescription e1000e_vmstate = { + VMSTATE_MSIX(parent_obj, E1000EState), + + VMSTATE_UINT32(ioaddr, E1000EState), ++ VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check), + VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState), + VMSTATE_UINT8(core.rx_desc_len, E1000EState), + VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState, +@@ -659,6 +678,8 @@ static PropertyInfo e1000e_prop_disable_vnet, + + static Property e1000e_properties[] = { + DEFINE_NIC_PROPERTIES(E1000EState, conf), ++ DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState, ++ redhat_7_3_intr_state_enable, false), + DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false, + e1000e_prop_disable_vnet, bool), + DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven, +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 90b4fc63ce..3ffb9dd22c 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3179,7 +3179,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, +@@ -3260,7 +3260,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/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c +index 5d0fcacd0c..4a2e52031b 100644 +--- a/hw/rtc/mc146818rtc.c ++++ b/hw/rtc/mc146818rtc.c +@@ -44,6 +44,7 @@ + #include "qapi/visitor.h" + #include "exec/address-spaces.h" + #include "hw/rtc/mc146818rtc_regs.h" ++#include "migration/migration.h" + + #ifdef TARGET_I386 + #include "qapi/qapi-commands-misc-target.h" +@@ -822,6 +823,11 @@ static int rtc_post_load(void *opaque, int version_id) + static bool rtc_irq_reinject_on_ack_count_needed(void *opaque) + { + RTCState *s = (RTCState *)opaque; ++ ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return s->irq_reinject_on_ack_count != 0; + } + +diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c +index f22c4f5b73..a305a4bcea 100644 +--- a/hw/smbios/smbios.c ++++ b/hw/smbios/smbios.c +@@ -56,6 +56,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; +@@ -570,7 +573,7 @@ static void smbios_build_type_1_table(void) + + static void smbios_build_type_2_table(void) + { +- SMBIOS_BUILD_TABLE_PRE(2, 0x200, false); /* optional */ ++ SMBIOS_BUILD_TABLE_PRE(2, 0x200, smbios_type2_required); + + SMBIOS_TABLE_SET_STR(2, manufacturer_str, type2.manufacturer); + SMBIOS_TABLE_SET_STR(2, product_str, type2.product); +@@ -792,7 +795,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; +@@ -813,11 +819,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-uhci.c b/hw/usb/hcd-uhci.c +index 0cb02a6432..962a9622e5 100644 +--- a/hw/usb/hcd-uhci.c ++++ b/hw/usb/hcd-uhci.c +@@ -1167,12 +1167,14 @@ void usb_uhci_common_realize(PCIDevice *dev, Error **errp) + UHCIState *s = UHCI(dev); + uint8_t *pci_conf = s->dev.config; + int i; ++ int irq_pin; + + pci_conf[PCI_CLASS_PROG] = 0x00; + /* TODO: reset value should be 0. */ + pci_conf[USB_SBRN] = USB_RELEASE_1; // release number + +- pci_config_set_interrupt_pin(pci_conf, u->info.irq_pin + 1); ++ irq_pin = u->info.irq_pin; ++ pci_config_set_interrupt_pin(pci_conf, irq_pin + 1); + + if (s->masterbus) { + USBPort *ports[NB_PORTS]; +diff --git a/hw/usb/hcd-xhci-pci.c b/hw/usb/hcd-xhci-pci.c +index 9421734d0f..9bfe236a7d 100644 +--- a/hw/usb/hcd-xhci-pci.c ++++ b/hw/usb/hcd-xhci-pci.c +@@ -101,6 +101,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; +@@ -122,23 +149,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 | +@@ -151,6 +167,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, +@@ -195,11 +219,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 c193f79443..086a1feb1e 100644 +--- a/hw/usb/hcd-xhci-pci.h ++++ b/hw/usb/hcd-xhci-pci.h +@@ -39,6 +39,7 @@ typedef struct XHCIPciState { + XHCIState xhci; + OnOffAuto msi; + OnOffAuto msix; ++ bool rh_late_msi_cap; /* bz 1912846 */ + } XHCIPciState; + + #endif +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 46212b1e69..6d1f278aad 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -3490,9 +3490,27 @@ static const VMStateDescription vmstate_xhci_slot = { + } + }; + ++static int xhci_event_pre_save(void *opaque) ++{ ++ XHCIEvent *s = opaque; ++ ++ s->cve_2014_5263_a = ((uint8_t *)&s->type)[0]; ++ s->cve_2014_5263_b = ((uint8_t *)&s->type)[1]; ++ ++ return 0; ++} ++ ++bool migrate_cve_2014_5263_xhci_fields; ++ ++static bool xhci_event_cve_2014_5263(void *opaque, int version_id) ++{ ++ return migrate_cve_2014_5263_xhci_fields; ++} ++ + static const VMStateDescription vmstate_xhci_event = { + .name = "xhci-event", + .version_id = 1, ++ .pre_save = xhci_event_pre_save, + .fields = (VMStateField[]) { + VMSTATE_UINT32(type, XHCIEvent), + VMSTATE_UINT32(ccode, XHCIEvent), +@@ -3501,6 +3519,8 @@ static const VMStateDescription vmstate_xhci_event = { + VMSTATE_UINT32(flags, XHCIEvent), + VMSTATE_UINT8(slotid, XHCIEvent), + VMSTATE_UINT8(epid, XHCIEvent), ++ VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263), ++ VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263), + VMSTATE_END_OF_LIST() + } + }; +diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h +index 7bba361f3b..f450ffd13b 100644 +--- a/hw/usb/hcd-xhci.h ++++ b/hw/usb/hcd-xhci.h +@@ -149,6 +149,8 @@ typedef struct XHCIEvent { + uint32_t flags; + uint8_t slotid; + uint8_t epid; ++ uint8_t cve_2014_5263_a; ++ uint8_t cve_2014_5263_b; + } XHCIEvent; + + typedef struct XHCIInterrupter { +diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h +index df519e40b5..e1ecfbaf1f 100644 +--- a/include/hw/acpi/ich9.h ++++ b/include/hw/acpi/ich9.h +@@ -62,6 +62,9 @@ typedef struct ICH9LPCPMRegs { + bool smm_compat; + bool enable_tco; + TCOIORegs tco_regs; ++ ++ /* RH addition, see bz 1489800 */ ++ bool force_rev1_fadt; + } ICH9LPCPMRegs; + + #define ACPI_PM_PROP_TCO_ENABLED "enable_tco" +diff --git a/include/hw/boards.h b/include/hw/boards.h +index ad6c8fd537..2d7a65724a 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -413,4 +413,37 @@ 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_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 GlobalProperty hw_compat_rhel_7_5[]; ++extern const size_t hw_compat_rhel_7_5_len; ++ ++extern GlobalProperty hw_compat_rhel_7_4[]; ++extern const size_t hw_compat_rhel_7_4_len; ++ ++extern GlobalProperty hw_compat_rhel_7_3[]; ++extern const size_t hw_compat_rhel_7_3_len; ++ ++extern GlobalProperty hw_compat_rhel_7_2[]; ++extern const size_t hw_compat_rhel_7_2_len; ++ ++extern GlobalProperty hw_compat_rhel_7_1[]; ++extern const size_t hw_compat_rhel_7_1_len; ++ + #endif +diff --git a/include/hw/firmware/smbios.h b/include/hw/firmware/smbios.h +index 02a0ced0a0..67e38a1b13 100644 +--- a/include/hw/firmware/smbios.h ++++ b/include/hw/firmware/smbios.h +@@ -267,7 +267,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 dcf060b791..93c012ac95 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -107,6 +107,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; +diff --git a/include/hw/usb.h b/include/hw/usb.h +index 436e07b304..edb2cd94b6 100644 +--- a/include/hw/usb.h ++++ b/include/hw/usb.h +@@ -577,4 +577,7 @@ void usb_pcap_init(FILE *fp); + void usb_pcap_ctrl(USBPacket *p, bool setup); + void usb_pcap_data(USBPacket *p, bool setup); + ++/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */ ++extern bool migrate_cve_2014_5263_xhci_fields; ++ + #endif +diff --git a/migration/migration.c b/migration/migration.c +index 8ca034136b..4afc6069b6 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -167,6 +167,8 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot, + MIGRATION_CAPABILITY_X_COLO, + MIGRATION_CAPABILITY_VALIDATE_UUID); + ++bool migrate_pre_2_2; ++ + /* When we add fault tolerance, we could have several + migrations at once. For now we don't need to add + dynamic creation of migration */ +diff --git a/migration/migration.h b/migration/migration.h +index db6708326b..1b6c69751c 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -368,6 +368,11 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, + void migrate_add_address(SocketAddress *address); + + int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque); ++/* ++ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards ++ * migration compatibility. ++ */ ++extern bool migrate_pre_2_2; + + #define qemu_ram_foreach_block \ + #warning "Use foreach_not_ignored_block in migration code" +-- +2.27.0 + diff --git a/SOURCES/0007-Add-aarch64-machine-types.patch b/SOURCES/0007-Add-aarch64-machine-types.patch new file mode 100644 index 0000000..ae95071 --- /dev/null +++ b/SOURCES/0007-Add-aarch64-machine-types.patch @@ -0,0 +1,306 @@ +From ee8aeb6b79bde21b581090c479faf10e716a7e6d 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 +--- + hw/arm/virt.c | 211 +++++++++++++++++++++++++++++++++++++++++- + include/hw/arm/virt.h | 8 ++ + 2 files changed, 218 insertions(+), 1 deletion(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index f904d3e98e..080cf54ef1 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -80,6 +80,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) \ +@@ -106,7 +107,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 +@@ -2113,6 +2155,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); +@@ -2140,6 +2183,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) + { +@@ -2237,6 +2281,7 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name, + visit_type_OnOffAuto(v, name, &vms->acpi, errp); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_ras(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2264,6 +2309,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) + { +@@ -2584,6 +2630,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); +@@ -2910,3 +2957,165 @@ 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; ++ machine_class_allow_dynamic_sysbus_dev(mc, TYPE_TPM_TIS_SYSBUS); ++ 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->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_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; ++ object_property_add_bool(obj, "highmem", virt_get_highmem, ++ virt_set_highmem); ++ object_property_set_description(obj, "highmem", ++ "Set on/off to enable/disable using " ++ "physical address space above 32 bits"); ++ vms->gic_version = VIRT_GIC_VERSION_NOSEL; ++ object_property_add_str(obj, "gic-version", virt_get_gic_version, ++ virt_set_gic_version); ++ object_property_set_description(obj, "gic-version", ++ "Set GIC version. " ++ "Valid values are 2, 3, host and max"); ++ ++ vms->highmem_ecam = !vmc->no_highmem_ecam; ++ ++ if (vmc->no_its) { ++ vms->its = false; ++ } else { ++ /* Default allows ITS instantiation */ ++ vms->its = true; ++ object_property_add_bool(obj, "its", virt_get_its, ++ virt_set_its); ++ object_property_set_description(obj, "its", ++ "Set on/off to enable/disable " ++ "ITS instantiation"); ++ } ++ ++ /* Default disallows iommu instantiation */ ++ vms->iommu = VIRT_IOMMU_NONE; ++ object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu); ++ object_property_set_description(obj, "iommu", ++ "Set the IOMMU type. " ++ "Valid values are none and smmuv3"); ++ ++ /* 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; ++ ++ 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 rhel840_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_8_4, hw_compat_rhel_8_4_len); ++} ++DEFINE_RHEL_MACHINE_AS_LATEST(8, 4, 0) ++ ++static void rhel830_virt_options(MachineClass *mc) ++{ ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ ++ rhel840_virt_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_3, hw_compat_rhel_8_3_len); ++ vmc->no_kvm_steal_time = true; ++} ++DEFINE_RHEL_MACHINE(8, 3, 0) ++ ++static void rhel820_virt_options(MachineClass *mc) ++{ ++ rhel830_virt_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_8_2, hw_compat_rhel_8_2_len); ++ mc->numa_mem_supported = true; ++ mc->auto_enable_numa_with_memdev = false; ++} ++DEFINE_RHEL_MACHINE(8, 2, 0) +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index 921416f918..6c34864a0a 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -170,9 +170,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); + +-- +2.27.0 + diff --git a/SOURCES/0008-Add-ppc64-machine-types.patch b/SOURCES/0008-Add-ppc64-machine-types.patch new file mode 100644 index 0000000..4504703 --- /dev/null +++ b/SOURCES/0008-Add-ppc64-machine-types.patch @@ -0,0 +1,654 @@ +From d70214aa1d8bf7aae9ef3a6bbc04f01735722e3c 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 +--- + hw/ppc/spapr.c | 368 ++++++++++++++++++++++++++++++++++++++++ + hw/ppc/spapr_cpu_core.c | 13 ++ + include/hw/ppc/spapr.h | 4 + + target/ppc/compat.c | 13 +- + target/ppc/cpu.h | 1 + + target/ppc/kvm.c | 27 +++ + target/ppc/kvm_ppc.h | 13 ++ + 7 files changed, 438 insertions(+), 1 deletion(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index e4be00b732..f9e8dfdfc9 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1568,6 +1568,9 @@ static void spapr_machine_reset(MachineState *machine) + + 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() && +@@ -3254,6 +3257,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); +@@ -3327,6 +3344,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) +@@ -4554,6 +4577,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data) + smc->smp_threads_vsmt = true; + smc->nr_xirqs = SPAPR_NR_XIRQS; + xfc->match_nvt = spapr_match_nvt; ++ smc->has_power9_support = true; + } + + static const TypeInfo spapr_machine_info = { +@@ -4604,6 +4628,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-6.0 + */ +@@ -4694,6 +4719,7 @@ static void spapr_machine_4_1_class_options(MachineClass *mc) + } + + DEFINE_SPAPR_MACHINE(4_1, "4.1", false); ++#endif + + /* + * pseries-4.0 +@@ -4713,6 +4739,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); +@@ -4871,6 +4899,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false); + /* + * pseries-2.7 + */ ++#endif + + static bool phb_placement_2_7(SpaprMachineState *spapr, uint32_t index, + uint64_t *buid, hwaddr *pio, +@@ -4926,6 +4955,7 @@ static bool phb_placement_2_7(SpaprMachineState *spapr, uint32_t index, + return true; + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void spapr_machine_2_7_class_options(MachineClass *mc) + { + SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +@@ -5040,6 +5070,344 @@ 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.4.0 ++ * like pseries-5.2 ++ */ ++ ++static void spapr_machine_rhel840_class_options(MachineClass *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_4, ++ hw_compat_rhel_8_4_len); ++} ++ ++DEFINE_SPAPR_MACHINE(rhel840, "rhel8.4.0", true); ++ ++/* ++ * 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_rhel750_class_options(MachineClass *mc) ++{ ++ spapr_machine_rhel760_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); ++ ++} ++ ++DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", false); ++ ++/* ++ * pseries-rhel7.5.0-sxxm ++ * ++ * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default ++ */ ++ ++static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel750_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(rhel750sxxm, "rhel7.5.0-sxxm", false); ++ ++/* ++ * pseries-rhel7.4.0 ++ * like spapr_compat_2_9 ++ */ ++GlobalProperty spapr_compat_rhel7_4[] = { ++ { TYPE_POWERPC_CPU, "pre-2.10-migration", "on" }, ++}; ++const size_t spapr_compat_rhel7_4_len = G_N_ELEMENTS(spapr_compat_rhel7_4); ++ ++static void spapr_machine_rhel740_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel750_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); ++ compat_props_add(mc->compat_props, spapr_compat_rhel7_4, spapr_compat_rhel7_4_len); ++ smc->has_power9_support = false; ++ smc->pre_2_10_has_unused_icps = true; ++ smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED; ++ smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false); ++ ++/* ++ * pseries-rhel7.4.0-sxxm ++ * ++ * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default ++ */ ++ ++static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel740_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(rhel740sxxm, "rhel7.4.0-sxxm", false); ++ ++/* ++ * pseries-rhel7.3.0 ++ * like spapr_compat_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3 ++ */ ++GlobalProperty spapr_compat_rhel7_3[] = { ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0xf80000000" }, ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem64_win_size", "0" }, ++ { TYPE_POWERPC_CPU, "pre-2.8-migration", "on" }, ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-2.8-migration", "on" }, ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "pcie-extended-configuration-space", "off" }, ++}; ++const size_t spapr_compat_rhel7_3_len = G_N_ELEMENTS(spapr_compat_rhel7_3); ++ ++static void spapr_machine_rhel730_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel740_class_options(mc); ++ mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); ++ mc->default_machine_opts = "modern-hotplug-events=off"; ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); ++ compat_props_add(mc->compat_props, spapr_compat_rhel7_3, spapr_compat_rhel7_3_len); ++ ++ smc->phb_placement = phb_placement_2_7; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false); ++ ++/* ++ * pseries-rhel7.3.0-sxxm ++ * ++ * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default ++ */ ++ ++static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel730_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(rhel730sxxm, "rhel7.3.0-sxxm", false); ++ ++/* ++ * pseries-rhel7.2.0 ++ */ ++/* Should be like spapr_compat_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration" ++ * has been backported to RHEL7_2 so we don't need it here. ++ */ ++ ++GlobalProperty spapr_compat_rhel7_2[] = { ++ { "spapr-vlan", "use-rx-buffer-pools", "off" }, ++ { TYPE_SPAPR_PCI_HOST_BRIDGE, "ddw", "off" }, ++}; ++const size_t spapr_compat_rhel7_2_len = G_N_ELEMENTS(spapr_compat_rhel7_2); ++ ++static void spapr_machine_rhel720_class_options(MachineClass *mc) ++{ ++ SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel730_class_options(mc); ++ smc->use_ohci_by_default = true; ++ mc->has_hotpluggable_cpus = NULL; ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len); ++ compat_props_add(mc->compat_props, spapr_compat_rhel7_2, spapr_compat_rhel7_2_len); ++} ++ ++DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", 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 64178f0f9a..2bff13a6ab 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -24,6 +24,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) + { +@@ -250,6 +251,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; +@@ -261,6 +263,17 @@ static bool spapr_realize_vcpu(PowerPCCPU *cpu, SpaprMachineState *spapr, + cpu_ppc_set_vhyp(cpu, PPC_VIRTUAL_HYPERVISOR(spapr)); + kvmppc_set_papr(cpu); + ++ 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 bf7cab7a2c..54cdde8980 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -143,6 +143,7 @@ struct SpaprMachineClass { + bool pre_5_1_assoc_refpoints; + bool pre_5_2_numa_associativity; + ++ bool has_power9_support; + bool (*phb_placement)(SpaprMachineState *spapr, uint32_t index, + uint64_t *buid, hwaddr *pio, + hwaddr *mmio32, hwaddr *mmio64, +@@ -223,6 +224,9 @@ struct SpaprMachineState { + int fwnmi_machine_check_interlock; + QemuCond fwnmi_machine_check_interlock_cond; + ++ /* 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.h b/target/ppc/cpu.h +index e73416da68..4eb427a601 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -1347,6 +1347,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 104a308abb..cb0fb67383 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -89,6 +89,7 @@ static int cap_ppc_count_cache_flush_assist; + static int cap_ppc_nested_kvm_hv; + static int cap_large_decr; + static int cap_fwnmi; ++static int cap_ppc_secure_guest; + + static uint32_t debug_inst_opcode; + +@@ -136,6 +137,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); + /* +@@ -2551,6 +2553,16 @@ int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable) + return 0; + } + ++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(); +@@ -2947,3 +2959,18 @@ bool kvm_arch_cpu_check_are_resettable(void) + { + return true; + } ++ ++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 989f61ace0..2e7a5d3fc1 100644 +--- a/target/ppc/kvm_ppc.h ++++ b/target/ppc/kvm_ppc.h +@@ -39,6 +39,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); +@@ -72,6 +73,8 @@ int kvmppc_set_cap_nested_kvm_hv(int enable); + int kvmppc_get_cap_large_decr(void); + int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable); + 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); +@@ -381,6 +384,16 @@ static inline int kvmppc_enable_cap_large_decr(PowerPCCPU *cpu, int enable) + return -1; + } + ++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.27.0 + diff --git a/SOURCES/0009-Add-s390x-machine-types.patch b/SOURCES/0009-Add-s390x-machine-types.patch new file mode 100644 index 0000000..c768dd7 --- /dev/null +++ b/SOURCES/0009-Add-s390x-machine-types.patch @@ -0,0 +1,127 @@ +From 09eba380295aef0a27d3fbcdda43019ab2898e08 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 +--- + hw/s390x/s390-virtio-ccw.c | 87 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 86 insertions(+), 1 deletion(-) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 2972b607f3..8df6dd1c71 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -771,7 +771,7 @@ bool css_migration_enabled(void) + { \ + MachineClass *mc = MACHINE_CLASS(oc); \ + ccw_machine_##suffix##_class_options(mc); \ +- mc->desc = "VirtIO-ccw based S390 machine v" verstr; \ ++ mc->desc = "VirtIO-ccw based S390 machine " verstr; \ + if (latest) { \ + mc->alias = "s390-ccw-virtio"; \ + mc->is_default = true; \ +@@ -795,6 +795,7 @@ bool css_migration_enabled(void) + } \ + type_init(ccw_machine_register_##suffix) + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void ccw_machine_6_0_instance_options(MachineState *machine) + { + } +@@ -1071,6 +1072,90 @@ 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_rhel840_instance_options(MachineState *machine) ++{ ++} ++ ++static void ccw_machine_rhel840_class_options(MachineClass *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", true); ++ ++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_rhel750_instance_options(MachineState *machine) ++{ ++ static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 }; ++ ccw_machine_rhel760_instance_options(machine); ++ ++ /* before 2.12 we emulated the very first z900, and RHEL 7.5 is ++ based on 2.10 */ ++ s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat); ++ ++ /* bpb and ppa15 were only in the full model in RHEL 7.5 */ ++ s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15); ++ s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB); ++} ++ ++GlobalProperty ccw_compat_rhel_7_5[] = { ++ { ++ .driver = TYPE_SCLP_EVENT_FACILITY, ++ .property = "allow_all_mask_sizes", ++ .value = "off", ++ }, ++}; ++const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5); ++ ++static void ccw_machine_rhel750_class_options(MachineClass *mc) ++{ ++ ccw_machine_rhel760_class_options(mc); ++ compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); ++ compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len); ++ S390_CCW_MACHINE_CLASS(mc)->hpage_1m_allowed = false; ++} ++DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false); + + static void ccw_machine_register_types(void) + { +-- +2.27.0 + diff --git a/SOURCES/0010-Add-x86_64-machine-types.patch b/SOURCES/0010-Add-x86_64-machine-types.patch new file mode 100644 index 0000000..28de463 --- /dev/null +++ b/SOURCES/0010-Add-x86_64-machine-types.patch @@ -0,0 +1,972 @@ +From a082c53cc14afcd2ad77262575af50e164e75649 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 +--- + hw/i386/acpi-build.c | 3 + + hw/i386/pc.c | 277 ++++++++++++++++++++++++++++++++++++- + hw/i386/pc_piix.c | 225 +++++++++++++++++++++++++++++- + hw/i386/pc_q35.c | 214 +++++++++++++++++++++++++++- + include/hw/boards.h | 2 + + include/hw/i386/pc.h | 39 ++++++ + target/i386/cpu.c | 3 +- + target/i386/kvm/kvm.c | 4 + + tests/qtest/pvpanic-test.c | 5 +- + 9 files changed, 763 insertions(+), 9 deletions(-) + +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index de98750aef..7bd67f7877 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -231,6 +231,9 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) + pm->fadt.reset_reg = r; + pm->fadt.reset_val = 0xf; + pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; ++ if (object_property_get_bool(lpc, ++ "__com.redhat_force-rev1-fadt", NULL)) ++ pm->fadt.rev = 1; + pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; + pm->smi_on_cpuhp = + !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)); +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 8a84b25a03..edc02a68ca 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -355,6 +355,275 @@ 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[] = { ++ { 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" }, ++}; ++const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_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); ++ ++/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but: ++ * - x-hv-max-vps was backported to 7.5 ++ * - x-pci-hole64-fix was backported to 7.5 ++ */ ++GlobalProperty pc_rhel_7_5_compat[] = { ++ /* pc_rhel_7_5_compat from pc_compat_2_11 */ ++ { "Skylake-Server" "-" TYPE_X86_CPU, "clflushopt", "off" }, ++ /* pc_rhel_7_5_compat from pc_compat_2_12 */ ++ { TYPE_X86_CPU, "legacy-cache", "on" }, ++ /* pc_rhel_7_5_compat from pc_compat_2_12 */ ++ { TYPE_X86_CPU, "topoext", "off" }, ++ /* pc_rhel_7_5_compat from pc_compat_2_12 */ ++ { "EPYC-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) }, ++ /* pc_rhel_7_5_compat from pc_compat_2_12 */ ++ { "EPYC-IBPB-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) }, ++}; ++const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat); ++ ++GlobalProperty pc_rhel_7_4_compat[] = { ++ /* pc_rhel_7_4_compat from pc_compat_2_9 */ ++ { "mch", "extended-tseg-mbytes", stringify(0) }, ++ /* bz 1489800 */ ++ { "ICH9-LPC", "__com.redhat_force-rev1-fadt", "on" }, ++ /* pc_rhel_7_4_compat from pc_compat_2_10 */ ++ { "i440FX-pcihost", "x-pci-hole64-fix", "off" }, ++ /* pc_rhel_7_4_compat from pc_compat_2_10 */ ++ { "q35-pcihost", "x-pci-hole64-fix", "off" }, ++ /* pc_rhel_7_4_compat from pc_compat_2_10 */ ++ { TYPE_X86_CPU, "x-hv-max-vps", "0x40" }, ++}; ++const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat); ++ ++GlobalProperty pc_rhel_7_3_compat[] = { ++ /* pc_rhel_7_3_compat from pc_compat_2_8 */ ++ { "kvmclock", "x-mach-use-reliable-get-clock", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { TYPE_X86_CPU, "l3-cache", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { TYPE_X86_CPU, "full-cpuid-auto-level", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_7 */ ++ { "isa-pcspk", "migrate", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_6 */ ++ { TYPE_X86_CPU, "cpuid-0xb", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_8 */ ++ { "ICH9-LPC", "x-smi-broadcast", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_8 */ ++ { TYPE_X86_CPU, "vmware-cpuid-freq", "off" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_8 */ ++ { "Haswell-" TYPE_X86_CPU, "stepping", "1" }, ++ /* pc_rhel_7_3_compat from pc_compat_2_3 added in 2.9*/ ++ { TYPE_X86_CPU, "kvm-no-smi-migration", "on" }, ++}; ++const size_t pc_rhel_7_3_compat_len = G_N_ELEMENTS(pc_rhel_7_3_compat); ++ ++GlobalProperty pc_rhel_7_2_compat[] = { ++ { "phenom" "-" TYPE_X86_CPU, "rdtscp", "off"}, ++ { "qemu64" "-" TYPE_X86_CPU, "sse4a", "on" }, ++ { "qemu64" "-" TYPE_X86_CPU, "abm", "on" }, ++ { "Haswell-" TYPE_X86_CPU, "abm", "off" }, ++ { "Haswell-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, ++ { "Haswell-noTSX-" TYPE_X86_CPU, "abm", "off" }, ++ { "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, ++ { "Broadwell-" TYPE_X86_CPU, "abm", "off" }, ++ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, ++ { "Broadwell-noTSX-" TYPE_X86_CPU, "abm", "off" }, ++ { "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, ++ { "host" "-" TYPE_X86_CPU, "host-cache-info", "on" }, ++ { TYPE_X86_CPU, "check", "off" }, ++ { "qemu32" "-" TYPE_X86_CPU, "popcnt", "on" }, ++ { TYPE_X86_CPU, "arat", "off" }, ++ { "usb-redir", "streams", "off" }, ++ { TYPE_X86_CPU, "fill-mtrr-mask", "off" }, ++ { "apic-common", "legacy-instance-id", "on" }, ++}; ++const size_t pc_rhel_7_2_compat_len = G_N_ELEMENTS(pc_rhel_7_2_compat); ++ ++GlobalProperty pc_rhel_7_1_compat[] = { ++ { "kvm64" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "kvm32" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Conroe" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Penryn" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Nehalem" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Nehalem-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Westmere" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Westmere-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "SandyBridge" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "SandyBridge-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Haswell" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Haswell-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Broadwell" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Opteron_G1" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Opteron_G2" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Opteron_G3" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Opteron_G4" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Opteron_G5" "-" TYPE_X86_CPU, "vme", "off" }, ++ { "Haswell" "-" TYPE_X86_CPU, "f16c", "off" }, ++ { "Haswell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" }, ++ { "Haswell" "-" TYPE_X86_CPU, "rdrand", "off" }, ++ { "Haswell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" }, ++ { "Broadwell" "-" TYPE_X86_CPU, "f16c", "off" }, ++ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" }, ++ { "Broadwell" "-" TYPE_X86_CPU, "rdrand", "off" }, ++ { "Broadwell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" }, ++ { "coreduo" "-" TYPE_X86_CPU, "vmx", "on" }, ++ { "core2duo" "-" TYPE_X86_CPU, "vmx", "on" }, ++ { "qemu64" "-" TYPE_X86_CPU, "min-level", stringify(4) }, ++ { "kvm64" "-" TYPE_X86_CPU, "min-level", stringify(5) }, ++ { "pentium3" "-" TYPE_X86_CPU, "min-level", stringify(2) }, ++ { "n270" "-" TYPE_X86_CPU, "min-level", stringify(5) }, ++ { "Conroe" "-" TYPE_X86_CPU, "min-level", stringify(4) }, ++ { "Penryn" "-" TYPE_X86_CPU, "min-level", stringify(4) }, ++ { "Nehalem" "-" TYPE_X86_CPU, "min-level", stringify(4) }, ++ { "n270" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Penryn" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Conroe" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Nehalem" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Westmere" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "SandyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "IvyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Haswell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Haswell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Broadwell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++ { "Broadwell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, ++}; ++const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_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. ++ */ ++ ++/* ++ * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_* ++ * between our base and 1.5, less stuff backported to RHEL-7.0 ++ * (usb-device.msos-desc), less stuff for devices we changed ++ * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x, ++ * pci-serial-4x) in 7.0. ++ */ ++GlobalProperty pc_rhel_7_0_compat[] = { ++ { "virtio-scsi-pci", "any_layout", "off" }, ++ { "PIIX4_PM", "memory-hotplug-support", "off" }, ++ { "apic", "version", stringify(0x11) }, ++ { "nec-usb-xhci", "superspeed-ports-first", "off" }, ++ { "nec-usb-xhci", "force-pcie-endcap", "on" }, ++ { "pci-serial", "prog_if", stringify(0) }, ++ { "virtio-net-pci", "guest_announce", "off" }, ++ { "ICH9-LPC", "memory-hotplug-support", "off" }, ++ { "xio3130-downstream", COMPAT_PROP_PCP, "off" }, ++ { "ioh3420", COMPAT_PROP_PCP, "off" }, ++ { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" }, ++ { "e1000", "mitigation", "off" }, ++ { "virtio-net-pci", "ctrl_guest_offloads", "off" }, ++ { "Conroe" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Penryn" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Nehalem" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Nehalem-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Westmere" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Westmere-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Opteron_G1" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Opteron_G2" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Opteron_G3" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Opteron_G4" "-" TYPE_X86_CPU, "x2apic", "on" }, ++ { "Opteron_G5" "-" TYPE_X86_CPU, "x2apic", "on" }, ++}; ++const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat); ++ + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) + { + GSIState *s; +@@ -952,7 +1221,8 @@ void pc_memory_init(PCMachineState *pcms, + option_rom_mr = g_malloc(sizeof(*option_rom_mr)); + memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE, + &error_fatal); +- if (pcmc->pci_enabled) { ++ /* RH difference: See bz 1489800, explicitly make ROM ro */ ++ if (pcmc->pc_rom_ro) { + memory_region_set_readonly(option_rom_mr, true); + } + memory_region_add_subregion_overlap(rom_memory, +@@ -1702,6 +1972,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + pcmc->pvh_enabled = true; + pcmc->kvmclock_create_always = true; + assert(!mc->get_hotplug_handler); ++ pcmc->pc_rom_ro = true; ++ 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; +@@ -1713,7 +1985,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + mc->default_boot_order = "cad"; + mc->smp_parse = pc_smp_parse; + 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 62433d8022..d9c5df16d8 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" +@@ -176,8 +177,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, +@@ -316,6 +317,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); +@@ -927,3 +929,222 @@ 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; ++} ++ ++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; ++ 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; ++ compat_props_add(m->compat_props, hw_compat_rhel_8_4, ++ hw_compat_rhel_8_4_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); ++ ++static void pc_init_rhel750(MachineState *machine) ++{ ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel750_options(MachineClass *m) ++{ ++ pc_machine_rhel760_options(m); ++ m->alias = NULL; ++ m->is_default = 0; ++ m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)"; ++ m->auto_enable_numa_with_memhp = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); ++ compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750, ++ pc_machine_rhel750_options); ++ ++static void pc_init_rhel740(MachineState *machine) ++{ ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel740_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_machine_rhel750_options(m); ++ m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)"; ++ pcmc->pc_rom_ro = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); ++ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740, ++ pc_machine_rhel740_options); ++ ++static void pc_init_rhel730(MachineState *machine) ++{ ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel730_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_machine_rhel740_options(m); ++ m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)"; ++ pcmc->linuxboot_dma_enabled = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); ++ compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730, ++ pc_machine_rhel730_options); ++ ++ ++static void pc_init_rhel720(MachineState *machine) ++{ ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel720_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ X86MachineClass *x86mc = X86_MACHINE_CLASS(m); ++ pc_machine_rhel730_options(m); ++ m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)"; ++ /* From pc_i440fx_2_5_machine_options */ ++ x86mc->save_tsc_khz = false; ++ m->legacy_fw_cfg_order = 1; ++ /* Note: broken_reserved_end was already in 7.2 */ ++ /* From pc_i440fx_2_6_machine_options */ ++ pcmc->legacy_cpu_hotplug = true; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len); ++ compat_props_add(m->compat_props, pc_rhel_7_2_compat, pc_rhel_7_2_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720, ++ pc_machine_rhel720_options); ++ ++static void pc_compat_rhel710(MachineState *machine) ++{ ++ PCMachineState *pcms = PC_MACHINE(machine); ++ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); ++ ++ /* From pc_compat_2_2 */ ++ pcmc->rsdp_in_ram = false; ++ machine->suppress_vmdesc = true; ++ ++ /* From pc_compat_2_1 */ ++ pcmc->smbios_uuid_encoded = false; ++ x86_cpu_change_kvm_default("svm", NULL); ++ pcmc->enforce_aligned_dimm = false; ++ ++ /* Disable all the extra subsections that were added in 2.2 */ ++ migrate_pre_2_2 = true; ++ ++ /* From pc_i440fx_2_4_machine_options */ ++ pcmc->broken_reserved_end = true; ++} ++ ++static void pc_init_rhel710(MachineState *machine) ++{ ++ pc_compat_rhel710(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel710_options(MachineClass *m) ++{ ++ pc_machine_rhel720_options(m); ++ m->family = "pc_piix_Y"; ++ m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)"; ++ m->default_display = "cirrus"; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_1, hw_compat_rhel_7_1_len); ++ compat_props_add(m->compat_props, pc_rhel_7_1_compat, pc_rhel_7_1_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710, ++ pc_machine_rhel710_options); ++ ++static void pc_compat_rhel700(MachineState *machine) ++{ ++ PCMachineState *pcms = PC_MACHINE(machine); ++ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); ++ ++ pc_compat_rhel710(machine); ++ ++ /* Upstream enables it for everyone, we're a little more selective */ ++ x86_cpu_change_kvm_default("x2apic", NULL); ++ x86_cpu_change_kvm_default("svm", NULL); ++ pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ ++ pcmc->smbios_legacy_mode = true; ++ pcmc->has_reserved_memory = false; ++ migrate_cve_2014_5263_xhci_fields = true; ++} ++ ++static void pc_init_rhel700(MachineState *machine) ++{ ++ pc_compat_rhel700(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE); ++} ++ ++static void pc_machine_rhel700_options(MachineClass *m) ++{ ++ pc_machine_rhel710_options(m); ++ m->family = "pc_piix_Y"; ++ m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)"; ++ compat_props_add(m->compat_props, pc_rhel_7_0_compat, pc_rhel_7_0_compat_len); ++} ++ ++DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700, ++ pc_machine_rhel700_options); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index fce52ca70b..44109e4876 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -195,8 +195,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, +@@ -327,6 +327,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); +@@ -581,3 +582,212 @@ 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_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_rhel_options(m); ++ m->desc = "RHEL-8.4.0 PC (Q35 + ICH9, 2009)"; ++ 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); ++} ++ ++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->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); ++ ++static void pc_q35_init_rhel750(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel750_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel760_options(m); ++ m->alias = NULL; ++ m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)"; ++ m->auto_enable_numa_with_memhp = false; ++ pcmc->default_nic_model = "e1000"; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); ++ compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750, ++ pc_q35_machine_rhel750_options); ++ ++static void pc_q35_init_rhel740(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel740_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel750_options(m); ++ m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->pc_rom_ro = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); ++ compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740, ++ pc_q35_machine_rhel740_options); ++ ++static void pc_q35_init_rhel730(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel730_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_q35_machine_rhel740_options(m); ++ m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; ++ m->max_cpus = 255; ++ pcmc->linuxboot_dma_enabled = false; ++ compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); ++ compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730, ++ pc_q35_machine_rhel730_options); +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 2d7a65724a..90ae100bfc 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -243,6 +243,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 93c012ac95..79a7803a2f 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -128,6 +128,9 @@ struct PCMachineClass { + + /* create kvmclock device even when KVM PV features are not exposed */ + bool kvmclock_create_always; ++ ++ /* RH only, see bz 1489800 */ ++ bool pc_rom_ro; + }; + + #define TYPE_PC_MACHINE "generic-pc-machine" +@@ -275,6 +278,42 @@ extern const size_t pc_compat_1_5_len; + extern GlobalProperty pc_compat_1_4[]; + extern const size_t pc_compat_1_4_len; + ++extern GlobalProperty pc_rhel_compat[]; ++extern const size_t pc_rhel_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; ++ ++extern GlobalProperty pc_rhel_7_5_compat[]; ++extern const size_t pc_rhel_7_5_compat_len; ++ ++extern GlobalProperty pc_rhel_7_4_compat[]; ++extern const size_t pc_rhel_7_4_compat_len; ++ ++extern GlobalProperty pc_rhel_7_3_compat[]; ++extern const size_t pc_rhel_7_3_compat_len; ++ ++extern GlobalProperty pc_rhel_7_2_compat[]; ++extern const size_t pc_rhel_7_2_compat_len; ++ ++extern GlobalProperty pc_rhel_7_1_compat[]; ++extern const size_t pc_rhel_7_1_compat_len; ++ ++extern GlobalProperty pc_rhel_7_0_compat[]; ++extern const size_t pc_rhel_7_0_compat_len; ++ + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index ad99cad0e7..c30bb2a6b0 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -1882,7 +1882,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 6, +- .model = 6, ++ .model = 13, + .stepping = 3, + .features[FEAT_1_EDX] = + PPRO_FEATURES | +@@ -4264,6 +4264,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 7fe9f52710..4c69c2cb4b 100644 +--- a/target/i386/kvm/kvm.c ++++ b/target/i386/kvm/kvm.c +@@ -3181,6 +3181,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); + +@@ -3499,6 +3500,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 6dcad2db49..580c2c43d2 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.27.0 + diff --git a/SOURCES/0011-Enable-make-check.patch b/SOURCES/0011-Enable-make-check.patch new file mode 100644 index 0000000..b3af9a8 --- /dev/null +++ b/SOURCES/0011-Enable-make-check.patch @@ -0,0 +1,410 @@ +From 5f6a55a218029af944a8d02ab9264647315890d3 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 +--- + redhat/qemu-kvm.spec.template | 6 ++---- + tests/qemu-iotests/051 | 8 ++++---- + tests/qtest/bios-tables-test.c | 6 +++--- + tests/qtest/boot-serial-test.c | 6 +++++- + tests/qtest/cdrom-test.c | 4 ++++ + tests/qtest/cpu-plug-test.c | 4 ++-- + tests/qtest/e1000-test.c | 2 ++ + tests/qtest/fuzz-e1000e-test.c | 2 +- + tests/qtest/fuzz-virtio-scsi-test.c | 2 +- + tests/qtest/hd-geo-test.c | 4 ++++ + tests/qtest/libqos/meson.build | 2 +- + tests/qtest/lpc-ich9-test.c | 2 +- + tests/qtest/meson.build | 11 +++-------- + tests/qtest/prom-env-test.c | 4 ++++ + tests/qtest/test-x86-cpuid-compat.c | 2 ++ + tests/qtest/usb-hcd-xhci-test.c | 4 ++++ + tests/unit/meson.build | 2 +- + 17 files changed, 44 insertions(+), 27 deletions(-) + +diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 +index 7bf29343d7..fd63402d78 100755 +--- a/tests/qemu-iotests/051 ++++ b/tests/qemu-iotests/051 +@@ -174,9 +174,9 @@ run_qemu -drive if=virtio + case "$QEMU_DEFAULT_MACHINE" in + pc) + run_qemu -drive if=none,id=disk -device ide-cd,drive=disk +- run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk ++# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-cd,drive=disk + run_qemu -drive if=none,id=disk -device ide-hd,drive=disk +- run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk ++# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk + ;; + *) + ;; +@@ -225,9 +225,9 @@ run_qemu -drive file="$TEST_IMG",if=virtio,readonly=on + case "$QEMU_DEFAULT_MACHINE" in + pc) + run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-cd,drive=disk +- run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk ++# run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-cd,drive=disk + run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device ide-hd,drive=disk +- run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk ++# run_qemu -drive file="$TEST_IMG",if=none,id=disk,readonly=on -device lsi53c895a -device scsi-hd,drive=disk + ;; + *) + ;; +diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-tables-test.c +index 156d4174aa..b4a1074b77 100644 +--- a/tests/qtest/bios-tables-test.c ++++ b/tests/qtest/bios-tables-test.c +@@ -1299,7 +1299,7 @@ static void test_acpi_virt_tcg_numamem(void) + free_test_data(&data); + + } +- ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void test_acpi_virt_tcg_pxb(void) + { + test_data data = { +@@ -1331,7 +1331,7 @@ static void test_acpi_virt_tcg_pxb(void) + + free_test_data(&data); + } +- ++#endif + static void test_acpi_tcg_acpi_hmat(const char *machine) + { + test_data data; +@@ -1561,7 +1561,7 @@ int main(int argc, char *argv[]) + qtest_add_func("acpi/virt", test_acpi_virt_tcg); + qtest_add_func("acpi/virt/numamem", test_acpi_virt_tcg_numamem); + qtest_add_func("acpi/virt/memhp", test_acpi_virt_tcg_memhp); +- qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); ++/* qtest_add_func("acpi/virt/pxb", test_acpi_virt_tcg_pxb); */ + qtest_add_func("acpi/virt/oem-fields", test_acpi_oem_fields_virt); + } + ret = g_test_run(); +diff --git a/tests/qtest/boot-serial-test.c b/tests/qtest/boot-serial-test.c +index d74509b1c5..a64c55e384 100644 +--- a/tests/qtest/boot-serial-test.c ++++ b/tests/qtest/boot-serial-test.c +@@ -120,19 +120,23 @@ static testdef_t tests[] = { + { "ppc", "g3beige", "", "PowerPC,750" }, + { "ppc", "mac99", "", "PowerPC,G4" }, + { "ppc", "sam460ex", "-m 256", "DRAM: 256 MiB" }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "ppc64", "ppce500", "", "U-Boot" }, + { "ppc64", "40p", "-m 192", "Memory: 192M" }, + { "ppc64", "mac99", "", "PowerPC,970FX" }, ++#endif + { "ppc64", "pseries", + "-machine " PSERIES_DEFAULT_CAPABILITIES, + "Open Firmware" }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "ppc64", "powernv8", "", "OPAL" }, + { "ppc64", "powernv9", "", "OPAL" }, + { "ppc64", "sam460ex", "-device e1000", "8086 100e" }, ++#endif + { "i386", "isapc", "-cpu qemu32 -device sga", "SGABIOS" }, + { "i386", "pc", "-device sga", "SGABIOS" }, + { "i386", "q35", "-device sga", "SGABIOS" }, +- { "x86_64", "isapc", "-cpu qemu32 -device sga", "SGABIOS" }, ++ { "x86_64", "pc", "-cpu qemu32 -device sga", "SGABIOS" }, + { "x86_64", "q35", "-device sga", "SGABIOS" }, + { "sparc", "LX", "", "TMS390S10" }, + { "sparc", "SS-4", "", "MB86904" }, +diff --git a/tests/qtest/cdrom-test.c b/tests/qtest/cdrom-test.c +index 5af944a5fb..69d9bac38a 100644 +--- a/tests/qtest/cdrom-test.c ++++ b/tests/qtest/cdrom-test.c +@@ -140,6 +140,7 @@ static void add_x86_tests(void) + qtest_add_data_func("cdrom/boot/isapc", "-M isapc " + "-drive if=ide,media=cdrom,file=", test_cdboot); + } ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + qtest_add_data_func("cdrom/boot/am53c974", + "-device am53c974 -device scsi-cd,drive=cd1 " + "-drive if=none,id=cd1,format=raw,file=", test_cdboot); +@@ -155,6 +156,7 @@ static void add_x86_tests(void) + qtest_add_data_func("cdrom/boot/megasas-gen2", "-M q35 " + "-device megasas-gen2 -device scsi-cd,drive=cd1 " + "-blockdev file,node-name=cd1,filename=", test_cdboot); ++#endif + } + + static void add_s390x_tests(void) +@@ -220,6 +222,7 @@ int main(int argc, char **argv) + "magnum", "malta", "pica61", NULL + }; + add_cdrom_param_tests(mips64machines); ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + } else if (g_str_equal(arch, "arm") || g_str_equal(arch, "aarch64")) { + const char *armmachines[] = { + "realview-eb", "realview-eb-mpcore", "realview-pb-a8", +@@ -227,6 +230,7 @@ int main(int argc, char **argv) + "vexpress-a9", "virt", NULL + }; + add_cdrom_param_tests(armmachines); ++#endif + } else { + const char *nonemachine[] = { "none", NULL }; + add_cdrom_param_tests(nonemachine); +diff --git a/tests/qtest/cpu-plug-test.c b/tests/qtest/cpu-plug-test.c +index a1c689414b..a8f076711c 100644 +--- a/tests/qtest/cpu-plug-test.c ++++ b/tests/qtest/cpu-plug-test.c +@@ -110,8 +110,8 @@ static void add_pseries_test_case(const char *mname) + char *path; + PlugTestData *data; + +- if (!g_str_has_prefix(mname, "pseries-") || +- (g_str_has_prefix(mname, "pseries-2.") && atoi(&mname[10]) < 7)) { ++ if (!g_str_has_prefix(mname, "pseries-rhel") || ++ (g_str_has_prefix(mname, "pseries-rhel7.") && atoi(&mname[14]) < 4)) { + return; + } + data = g_new(PlugTestData, 1); +diff --git a/tests/qtest/e1000-test.c b/tests/qtest/e1000-test.c +index ea286d1793..a1847ac8ed 100644 +--- a/tests/qtest/e1000-test.c ++++ b/tests/qtest/e1000-test.c +@@ -22,9 +22,11 @@ struct QE1000 { + + static const char *models[] = { + "e1000", ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + "e1000-82540em", + "e1000-82544gc", + "e1000-82545em", ++#endif + }; + + static void *e1000_get_driver(void *obj, const char *interface) +diff --git a/tests/qtest/fuzz-e1000e-test.c b/tests/qtest/fuzz-e1000e-test.c +index 66229e6096..947fba73b7 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 aaf6d10e18..43727d62ac 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 -display none -m 512M " ++ s = qtest_init("-M pc-q35-rhel8.4.0 -display none -m 512M " + "-device virtio-scsi,num_queues=8,addr=03.0 "); + + qtest_outl(s, 0xcf8, 0x80001811); +diff --git a/tests/qtest/hd-geo-test.c b/tests/qtest/hd-geo-test.c +index f7b7cfbc2d..99cccf8638 100644 +--- a/tests/qtest/hd-geo-test.c ++++ b/tests/qtest/hd-geo-test.c +@@ -737,6 +737,7 @@ static void test_override_ide(void) + test_override(args, expected); + } + ++#if 0 /* Require lsi53c895a - not supported on RHEL */ + static void test_override_scsi(void) + { + TestArgs *args = create_args(); +@@ -781,6 +782,7 @@ static void test_override_scsi_2_controllers(void) + add_scsi_disk(args, 3, 1, 0, 1, 2, 0, 1, 0); + test_override(args, expected); + } ++#endif + + static void test_override_virtio_blk(void) + { +@@ -960,9 +962,11 @@ int main(int argc, char **argv) + qtest_add_func("hd-geo/ide/device/user/chst", test_ide_device_user_chst); + if (have_qemu_img()) { + qtest_add_func("hd-geo/override/ide", test_override_ide); ++#if 0 /* Require lsi53c895a - not supported on RHEL */ + qtest_add_func("hd-geo/override/scsi", test_override_scsi); + qtest_add_func("hd-geo/override/scsi_2_controllers", + test_override_scsi_2_controllers); ++#endif + qtest_add_func("hd-geo/override/virtio_blk", test_override_virtio_blk); + qtest_add_func("hd-geo/override/zero_chs", test_override_zero_chs); + qtest_add_func("hd-geo/override/scsi_hot_unplug", +diff --git a/tests/qtest/libqos/meson.build b/tests/qtest/libqos/meson.build +index 1cddf5bdaa..2f4a564105 100644 +--- a/tests/qtest/libqos/meson.build ++++ b/tests/qtest/libqos/meson.build +@@ -41,7 +41,7 @@ libqos_srcs = files('../libqtest.c', + 'virtio-serial.c', + + # qgraph machines: +- 'aarch64-xlnx-zcu102-machine.c', ++# 'aarch64-xlnx-zcu102-machine.c', + 'arm-imx25-pdk-machine.c', + 'arm-n800-machine.c', + 'arm-raspi2-machine.c', +diff --git a/tests/qtest/lpc-ich9-test.c b/tests/qtest/lpc-ich9-test.c +index fe0bef9980..7a9d51579b 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 0c76738921..b9a7426a7b 100644 +--- a/tests/qtest/meson.build ++++ b/tests/qtest/meson.build +@@ -71,7 +71,6 @@ qtests_i386 = \ + 'ide-test', + 'hd-geo-test', + 'boot-order-test', +- 'bios-tables-test', + 'rtc-test', + 'i440fx-test', + 'fw_cfg-test', +@@ -79,7 +78,6 @@ qtests_i386 = \ + 'drive_del-test', + 'tco-test', + 'cpu-plug-test', +- 'q35-test', + 'vmgenid-test', + 'migration-test', + 'test-x86-cpuid-compat', +@@ -130,17 +128,15 @@ qtests_moxie = [ 'boot-serial-test' ] + + qtests_ppc = \ + (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) + \ +- (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + \ +- ['boot-order-test', 'prom-env-test', 'boot-serial-test'] \ ++ (config_all_devices.has_key('CONFIG_M48T59') ? ['m48t59-test'] : []) + + qtests_ppc64 = \ + (config_all_devices.has_key('CONFIG_PSERIES') ? ['device-plug-test'] : []) + \ + (config_all_devices.has_key('CONFIG_POWERNV') ? ['pnv-xscom-test'] : []) + \ + (config_all_devices.has_key('CONFIG_PSERIES') ? ['rtas-test'] : []) + \ +- (slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \ ++ (slirp.found() ? ['pxe-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \ + (config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \ +- (config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \ + qtests_pci + ['migration-test', 'numa-test', 'cpu-plug-test', 'drive_del-test'] + + qtests_sh4 = (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +@@ -183,7 +179,7 @@ qtests_aarch64 = \ + ['arm-cpu-features', + 'numa-test', + 'boot-serial-test', +- 'xlnx-can-test', ++# 'xlnx-can-test', + 'migration-test'] + + qtests_s390x = \ +@@ -192,7 +188,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/prom-env-test.c b/tests/qtest/prom-env-test.c +index f41d80154a..f8dc478ce8 100644 +--- a/tests/qtest/prom-env-test.c ++++ b/tests/qtest/prom-env-test.c +@@ -89,10 +89,14 @@ int main(int argc, char *argv[]) + if (!strcmp(arch, "ppc")) { + add_tests(ppc_machines); + } else if (!strcmp(arch, "ppc64")) { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + add_tests(ppc_machines); + if (g_test_slow()) { ++#endif + qtest_add_data_func("prom-env/pseries", "pseries", test_machine); ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + } ++#endif + } else if (!strcmp(arch, "sparc")) { + add_tests(sparc_machines); + } else if (!strcmp(arch, "sparc64")) { +diff --git a/tests/qtest/test-x86-cpuid-compat.c b/tests/qtest/test-x86-cpuid-compat.c +index f28848e06e..6b2fd398a2 100644 +--- a/tests/qtest/test-x86-cpuid-compat.c ++++ b/tests/qtest/test-x86-cpuid-compat.c +@@ -300,6 +300,7 @@ int main(int argc, char **argv) + "-cpu 486,xlevel2=0xC0000002,xstore=on", + "xlevel2", 0xC0000002); + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + /* Check compatibility of old machine-types that didn't + * auto-increase level/xlevel/xlevel2: */ + +@@ -350,6 +351,7 @@ int main(int argc, char **argv) + add_cpuid_test("x86/cpuid/xlevel-compat/pc-i440fx-2.4/npt-on", + "-machine pc-i440fx-2.4 -cpu SandyBridge,svm=on,npt=on", + "xlevel", 0x80000008); ++#endif + + /* Test feature parsing */ + add_feature_test("x86/cpuid/features/plus", +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/unit/meson.build b/tests/unit/meson.build +index b3bc2109da..244d35f5d4 100644 +--- a/tests/unit/meson.build ++++ b/tests/unit/meson.build +@@ -65,7 +65,7 @@ if have_block + 'test-blockjob': [testblock], + 'test-blockjob-txn': [testblock], + 'test-block-backend': [testblock], +- 'test-block-iothread': [testblock], ++# 'test-block-iothread': [testblock], + 'test-write-threshold': [testblock], + 'test-crypto-hash': [crypto], + 'test-crypto-hmac': [crypto], +-- +2.27.0 + diff --git a/SOURCES/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch b/SOURCES/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..45abe27 --- /dev/null +++ b/SOURCES/0012-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,101 @@ +From 22c0f47f02c5db63f3857dabc6cc7cb6bfc78158 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. + +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 5c65aa0a98..327b86703a 100644 +--- a/hw/vfio/pci.c ++++ b/hw/vfio/pci.c +@@ -46,6 +46,9 @@ + + #define TYPE_VFIO_PCI_NOHOTPLUG "vfio-pci-nohotplug" + ++/* 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); + +@@ -2783,9 +2786,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 (!vdev->vbasedev.sysfsdev) { + if (!(~vdev->host.domain || ~vdev->host.bus || + ~vdev->host.slot || ~vdev->host.function)) { +@@ -3222,6 +3246,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 64777516d1..e0fe6ca97e 100644 +--- a/hw/vfio/pci.h ++++ b/hw/vfio/pci.h +@@ -139,6 +139,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.27.0 + diff --git a/SOURCES/0013-Add-support-statement-to-help-output.patch b/SOURCES/0013-Add-support-statement-to-help-output.patch new file mode 100644 index 0000000..8739e82 --- /dev/null +++ b/SOURCES/0013-Add-support-statement-to-help-output.patch @@ -0,0 +1,55 @@ +From ffd8eff2ce1d7eda81d425324593924c098f6c39 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 aadb526138..6c8498022b 100644 +--- a/softmmu/vl.c ++++ b/softmmu/vl.c +@@ -848,9 +848,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", + error_get_progname()); +@@ -867,6 +875,7 @@ static void help(int exitcode) + "\n" + QEMU_HELP_BOTTOM "\n"); + ++ print_rh_warning(); + exit(exitcode); + } + +-- +2.27.0 + diff --git a/SOURCES/0014-globally-limit-the-maximum-number-of-CPUs.patch b/SOURCES/0014-globally-limit-the-maximum-number-of-CPUs.patch new file mode 100644 index 0000000..b44ad7c --- /dev/null +++ b/SOURCES/0014-globally-limit-the-maximum-number-of-CPUs.patch @@ -0,0 +1,45 @@ +From b5dab6e678d9b53359b3a915421114258e803cad Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 21 Jan 2014 10:46:52 +0100 +Subject: globally limit the maximum number of CPUs + +We now globally limit the number of VCPUs. +Especially, there is no way one can specify more than +max_cpus VCPUs for a VM. + +This allows us the restore the ppc max_cpus limitation to the upstream +default and minimize the ppc hack in kvm-all.c. + +Signed-off-by: David Hildenbrand +Signed-off-by: Miroslav Rezanina +Signed-off-by: Danilo Cesar Lemes de Paula +--- + accel/kvm/kvm-all.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c +index b6d9f92f15..70a94ba76d 100644 +--- a/accel/kvm/kvm-all.c ++++ b/accel/kvm/kvm-all.c +@@ -2095,6 +2095,18 @@ static int kvm_init(MachineState *ms) + soft_vcpus_limit = kvm_recommended_vcpus(s); + hard_vcpus_limit = kvm_max_vcpus(s); + ++#ifdef HOST_PPC64 ++ /* ++ * On POWER, the kernel advertises a soft limit based on the ++ * number of CPU threads on the host. We want to allow exceeding ++ * this for testing purposes, so we don't want to set hard limit ++ * to soft limit as on x86. ++ */ ++#else ++ /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */ ++ hard_vcpus_limit = soft_vcpus_limit; ++#endif ++ + while (nc->name) { + if (nc->num > soft_vcpus_limit) { + warn_report("Number of %s cpus requested (%d) exceeds " +-- +2.27.0 + diff --git a/SOURCES/0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch b/SOURCES/0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch new file mode 100644 index 0000000..599e101 --- /dev/null +++ b/SOURCES/0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch @@ -0,0 +1,157 @@ +From 55fde02ee1a9aa0e812af8534a9adf553accc522 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 ++-- + docs/interop/live-block-operations.rst | 4 ++-- + docs/tools/qemu-trace-stap.rst | 14 +++++++------- + docs/tools/virtiofsd.rst | 2 +- + qemu-options.hx | 10 +++++----- + 5 files changed, 17 insertions(+), 17 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/docs/interop/live-block-operations.rst b/docs/interop/live-block-operations.rst +index 1073b930dc..881432253f 100644 +--- a/docs/interop/live-block-operations.rst ++++ b/docs/interop/live-block-operations.rst +@@ -129,7 +129,7 @@ To show some example invocations of command-line, we will use the + following invocation of QEMU, with a QMP server running over UNIX + socket:: + +- $ ./qemu-system-x86_64 -display none -no-user-config \ ++ $ qemu-kvm -display none -no-user-config \ + -M q35 -nodefaults -m 512 \ + -blockdev node-name=node-A,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./a.qcow2 \ + -device virtio-blk,drive=node-A,id=virtio0 \ +@@ -694,7 +694,7 @@ instance, with the following invocation. (As noted earlier, for + simplicity's sake, the destination QEMU is started on the same host, but + it could be located elsewhere):: + +- $ ./qemu-system-x86_64 -display none -no-user-config \ ++ $ qemu-kvm -display none -no-user-config \ + -M q35 -nodefaults -m 512 \ + -blockdev node-name=node-TargetDisk,driver=qcow2,file.driver=file,file.node-name=file,file.filename=./target-disk.qcow2 \ + -device virtio-blk,drive=node-TargetDisk,id=virtio0 \ +diff --git a/docs/tools/qemu-trace-stap.rst b/docs/tools/qemu-trace-stap.rst +index fb70445c75..0d9a783112 100644 +--- a/docs/tools/qemu-trace-stap.rst ++++ b/docs/tools/qemu-trace-stap.rst +@@ -45,19 +45,19 @@ The following commands are valid: + any of the listed names. If no *PATTERN* is given, the all possible + probes will be listed. + +- For example, to list all probes available in the ``qemu-system-x86_64`` ++ For example, to list all probes available in the ``qemu-kvm`` + binary: + + :: + +- $ qemu-trace-stap list qemu-system-x86_64 ++ $ qemu-trace-stap list qemu-kvm + + To filter the list to only cover probes related to QEMU's cryptographic + subsystem, in a binary outside ``$PATH`` + + :: + +- $ qemu-trace-stap list /opt/qemu/4.0.0/bin/qemu-system-x86_64 'qcrypto*' ++ $ qemu-trace-stap list /opt/qemu/4.0.0/bin/qemu-kvm 'qcrypto*' + + .. option:: run OPTIONS BINARY PATTERN... + +@@ -89,18 +89,18 @@ The following commands are valid: + Restrict the tracing session so that it only triggers for the process + identified by *PID*. + +- For example, to monitor all processes executing ``qemu-system-x86_64`` ++ For example, to monitor all processes executing ``qemu-kvm`` + as found on ``$PATH``, displaying all I/O related probes: + + :: + +- $ qemu-trace-stap run qemu-system-x86_64 'qio*' ++ $ qemu-trace-stap run qemu-kvm 'qio*' + + To monitor only the QEMU process with PID 1732 + + :: + +- $ qemu-trace-stap run --pid=1732 qemu-system-x86_64 'qio*' ++ $ qemu-trace-stap run --pid=1732 qemu-kvm 'qio*' + + To monitor QEMU processes running an alternative binary outside of + ``$PATH``, displaying verbose information about setup of the +@@ -108,7 +108,7 @@ The following commands are valid: + + :: + +- $ qemu-trace-stap -v run /opt/qemu/4.0.0/qemu-system-x86_64 'qio*' ++ $ qemu-trace-stap -v run /opt/qemu/4.0.0/qemu-kvm 'qio*' + + See also + -------- +diff --git a/docs/tools/virtiofsd.rst b/docs/tools/virtiofsd.rst +index 00554c75bd..6e0fc94005 100644 +--- a/docs/tools/virtiofsd.rst ++++ b/docs/tools/virtiofsd.rst +@@ -301,7 +301,7 @@ Export ``/var/lib/fs/vm001/`` on vhost-user UNIX domain socket + :: + + host# virtiofsd --socket-path=/var/run/vm001-vhost-fs.sock -o source=/var/lib/fs/vm001 +- host# qemu-system-x86_64 \ ++ host# qemu-kvm \ + -chardev socket,id=char0,path=/var/run/vm001-vhost-fs.sock \ + -device vhost-user-fs-pci,chardev=char0,tag=myfs \ + -object memory-backend-memfd,id=mem,size=4G,share=on \ +diff --git a/qemu-options.hx b/qemu-options.hx +index 0d4fb61bf7..79ca09feac 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -3011,11 +3011,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`` + Establish a vhost-vdpa netdev. +-- +2.27.0 + diff --git a/SOURCES/0016-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch b/SOURCES/0016-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch new file mode 100644 index 0000000..cd00b4f --- /dev/null +++ b/SOURCES/0016-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch @@ -0,0 +1,66 @@ +From 2ab1a61510036bd409532f24ea14fa693ec0362c Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Wed, 14 Jun 2017 15:37:01 +0200 +Subject: virtio-scsi: Reject scsi-cd if data plane enabled [RHEL only] + +RH-Author: Fam Zheng +Message-id: <20170614153701.14757-1-famz@redhat.com> +Patchwork-id: 75613 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH v3] virtio-scsi: Reject scsi-cd if data plane enabled [RHEL only] +Bugzilla: 1378816 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +We need a fix for RHEL 7.4 and 7.3.z, but unfortunately upstream isn't +ready. If it were, the changes will be too invasive. To have an idea: + +https://lists.gnu.org/archive/html/qemu-devel/2017-05/msg05400.html + +is an incomplete attempt to fix part of the issue, and the remaining +work unfortunately involve even more complex changes. + +As a band-aid, this partially reverts the effect of ef8875b +(virtio-scsi: Remove op blocker for dataplane, since v2.7). We cannot +simply revert that commit as a whole because we already shipped it in +qemu-kvm-rhev 7.3, since when, block jobs has been possible. We should +only block what has been broken. Also, faithfully reverting the above +commit means adding back the removed op blocker, but that is not enough, +because it still crashes when inserting media into an initially empty +scsi-cd. + +All in all, scsi-cd on virtio-scsi-dataplane has basically been unusable +unless the scsi-cd never enters an empty state, so, disable it +altogether. Otherwise it would be much more difficult to avoid +crashing. + +Signed-off-by: Fam Zheng +Signed-off-by: Miroslav Rezanina +Signed-off-by: Danilo C. L. de Paula +--- + hw/scsi/virtio-scsi.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c +index 6d80730287..bba3d75707 100644 +--- a/hw/scsi/virtio-scsi.c ++++ b/hw/scsi/virtio-scsi.c +@@ -896,6 +896,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, + AioContext *old_context; + int ret; + ++ /* XXX: Remove this check once block backend is capable of handling ++ * AioContext change upon eject/insert. ++ * s->ctx is NULL if ioeventfd is off, s->ctx is qemu_get_aio_context() if ++ * data plane is not used, both cases are safe for scsi-cd. */ ++ if (s->ctx && s->ctx != qemu_get_aio_context() && ++ object_dynamic_cast(OBJECT(dev), "scsi-cd")) { ++ error_setg(errp, "scsi-cd is not supported by data plane"); ++ return; ++ } + if (s->ctx && !s->dataplane_fenced) { + if (blk_op_is_blocked(sd->conf.blk, BLOCK_OP_TYPE_DATAPLANE, errp)) { + return; +-- +2.27.0 + diff --git a/SOURCES/0017-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch b/SOURCES/0017-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch new file mode 100644 index 0000000..2e670a2 --- /dev/null +++ b/SOURCES/0017-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch @@ -0,0 +1,60 @@ +From 7b3d9142f3b296b127dce35336765dc16265d155 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 6 Feb 2019 03:58:56 +0000 +Subject: BZ1653590: Require at least 64kiB pages for downstream guests & hosts + +RH-Author: David Gibson +Message-id: <20190206035856.19058-1-dgibson@redhat.com> +Patchwork-id: 84246 +O-Subject: [RHELAV-8.0/rhel qemu-kvm PATCH] BZ1653590: Require at least 64kiB pages for downstream guests & hosts +Bugzilla: 1653590 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Serhii Popovych +RH-Acked-by: Thomas Huth + +Most current POWER guests require 64kiB page support, so that's the default +for the cap-hpt-max-pagesize option in qemu which limits available guest +page sizes. We warn if the value is set smaller than that, but don't +outright fail upstream, because we need to allow for the possibility of +guest (and/or host) kernels configured for 4kiB page sizes. + +Downstream, however, we simply don't support 4kiB pagesize configured +kernels in guest or host, so we can have qemu simply error out in this +situation. + +Testing: Attempted to start a guest with cap-hpt-max-page-size=4k and verified + it failed immediately with a qemu error + +Signed-off-by: David Gibson +Signed-off-by: Danilo C. L. de Paula +--- + hw/ppc/spapr_caps.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c +index 9ea7ddd1e9..1338b677d2 100644 +--- a/hw/ppc/spapr_caps.c ++++ b/hw/ppc/spapr_caps.c +@@ -332,12 +332,19 @@ bool spapr_check_pagesize(SpaprMachineState *spapr, hwaddr pagesize, + static void cap_hpt_maxpagesize_apply(SpaprMachineState *spapr, + uint8_t val, Error **errp) + { ++#if 0 /* disabled for RHEL */ + if (val < 12) { + error_setg(errp, "Require at least 4kiB hpt-max-page-size"); + return; + } else if (val < 16) { + warn_report("Many guests require at least 64kiB hpt-max-page-size"); + } ++#else /* Only page sizes >=64kiB supported for RHEL */ ++ if (val < 16) { ++ error_setg(errp, "Require at least 64kiB hpt-max-page-size"); ++ return; ++ } ++#endif + + spapr_check_pagesize(spapr, qemu_minrampagesize(), errp); + } +-- +2.27.0 + diff --git a/SOURCES/0018-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch b/SOURCES/0018-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch new file mode 100644 index 0000000..b5e8f92 --- /dev/null +++ b/SOURCES/0018-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch @@ -0,0 +1,70 @@ +From acdc84c1077be7d347414f781014ea785ce41d7b Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 13 Mar 2020 12:34:32 +0000 +Subject: block: Versioned x-blockdev-reopen API with feature flag + +RH-Author: Kevin Wolf +Message-id: <20200313123439.10548-7-kwolf@redhat.com> +Patchwork-id: 94283 +O-Subject: [RHEL-AV-8.2.0 qemu-kvm PATCH v2 06/13] block: Versioned x-blockdev-reopen API with feature flag +Bugzilla: 1790482 1805143 +RH-Acked-by: Eric Blake +RH-Acked-by: John Snow +RH-Acked-by: Daniel P. Berrange +RH-Acked-by: Peter Krempa + +x-blockdev-reopen is still considered unstable upstream. libvirt needs +(a small subset of) it for incremental backups, though. + +Add a downstream-only feature flag that effectively makes this a +versioned interface. As long as the feature is present, we promise that +we won't change the interface incompatibly. Incompatible changes to the +command will require us to drop the feature flag (and possibly introduce +a new one if the new version is still not stable upstream). + +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +--- + qapi/block-core.json | 9 ++++++++- + scripts/qapi/expr.py | 2 +- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/qapi/block-core.json b/qapi/block-core.json +index 6d227924d0..15ad8cee05 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -4166,10 +4166,17 @@ + # image does not have a default backing file name as part of its + # metadata. + # ++# Features: ++# @__com.redhat_rhel-av-8_2_0-api: Versioning the downstream interface while ++# it's still unstable upstream. As long as ++# this flag is present, this command will not ++# change incompatibly. ++# + # Since: 4.0 + ## + { 'command': 'x-blockdev-reopen', +- 'data': 'BlockdevOptions', 'boxed': true } ++ 'data': 'BlockdevOptions', 'boxed': true, ++ 'features': [ '__com.redhat_rhel-av-8_2_0-api' ] } + + ## + # @blockdev-del: +diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py +index 540b3982b1..884874d205 100644 +--- a/scripts/qapi/expr.py ++++ b/scripts/qapi/expr.py +@@ -215,7 +215,7 @@ def check_features(features, info): + check_keys(f, info, source, ['name'], ['if']) + check_name_is_str(f['name'], info, source) + source = "%s '%s'" % (source, f['name']) +- check_name_lower(f['name'], info, source) ++ check_name_lower(f['name'], info, source, permit_underscore=True) + check_if(f, info, source) + + +-- +2.27.0 + diff --git a/SOURCES/95-kvm-memlock.conf b/SOURCES/95-kvm-memlock.conf new file mode 100644 index 0000000..fc59dbe --- /dev/null +++ b/SOURCES/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/SOURCES/99-qemu-guest-agent.rules b/SOURCES/99-qemu-guest-agent.rules new file mode 100644 index 0000000..8a290ab --- /dev/null +++ b/SOURCES/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/SOURCES/README.tests b/SOURCES/README.tests new file mode 100644 index 0000000..9932773 --- /dev/null +++ b/SOURCES/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/SOURCES/bridge.conf b/SOURCES/bridge.conf new file mode 100644 index 0000000..a573665 --- /dev/null +++ b/SOURCES/bridge.conf @@ -0,0 +1 @@ +allow virbr0 diff --git a/SOURCES/ksm.service b/SOURCES/ksm.service new file mode 100644 index 0000000..35c6f1d --- /dev/null +++ b/SOURCES/ksm.service @@ -0,0 +1,13 @@ +[Unit] +Description=Kernel Samepage Merging +ConditionPathExists=/sys/kernel/mm/ksm + +[Service] +Type=oneshot +RemainAfterExit=yes +EnvironmentFile=-/etc/sysconfig/ksm +ExecStart=/usr/libexec/ksmctl start +ExecStop=/usr/libexec/ksmctl stop + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/ksm.sysconfig b/SOURCES/ksm.sysconfig new file mode 100644 index 0000000..d99656d --- /dev/null +++ b/SOURCES/ksm.sysconfig @@ -0,0 +1,4 @@ +# The maximum number of unswappable kernel pages +# which may be allocated by ksm (0 for unlimited) +# If unset, defaults to half of total memory +# KSM_MAX_KERNEL_PAGES= diff --git a/SOURCES/ksmctl.c b/SOURCES/ksmctl.c new file mode 100644 index 0000000..af39591 --- /dev/null +++ b/SOURCES/ksmctl.c @@ -0,0 +1,77 @@ +/* Start/stop KSM, for systemd. + * Copyright (C) 2009, 2011 Red Hat, Inc. + * Written by Paolo Bonzini . + * Based on the original sysvinit script by Dan Kenigsberg + * This file is distributed under the GNU General Public License, version 2 + * or later. */ + +#include +#include +#include +#include +#include +#include + +#define KSM_MAX_KERNEL_PAGES_FILE "/sys/kernel/mm/ksm/max_kernel_pages" +#define KSM_RUN_FILE "/sys/kernel/mm/ksm/run" + +char *program_name; + +int usage(void) +{ + fprintf(stderr, "Usage: %s {start|stop}\n", program_name); + return 1; +} + +int write_value(uint64_t value, char *filename) +{ + FILE *fp; + if (!(fp = fopen(filename, "w")) || + fprintf(fp, "%llu\n", (unsigned long long) value) == EOF || + fflush(fp) == EOF || + fclose(fp) == EOF) + return 1; + + return 0; +} + +uint64_t ksm_max_kernel_pages() +{ + char *var = getenv("KSM_MAX_KERNEL_PAGES"); + char *endptr; + uint64_t value; + if (var && *var) { + value = strtoll(var, &endptr, 0); + if (value < LLONG_MAX && !*endptr) + return value; + } + /* Unless KSM_MAX_KERNEL_PAGES is set, let KSM munch up to half of + * total memory. */ + return sysconf(_SC_PHYS_PAGES) / 2; +} + +int start(void) +{ + if (access(KSM_MAX_KERNEL_PAGES_FILE, R_OK) >= 0) + write_value(ksm_max_kernel_pages(), KSM_MAX_KERNEL_PAGES_FILE); + return write_value(1, KSM_RUN_FILE); +} + +int stop(void) +{ + return write_value(0, KSM_RUN_FILE); +} + +int main(int argc, char **argv) +{ + program_name = argv[0]; + if (argc < 2) { + return usage(); + } else if (!strcmp(argv[1], "start")) { + return start(); + } else if (!strcmp(argv[1], "stop")) { + return stop(); + } else { + return usage(); + } +} diff --git a/SOURCES/ksmtuned b/SOURCES/ksmtuned new file mode 100644 index 0000000..7bc5743 --- /dev/null +++ b/SOURCES/ksmtuned @@ -0,0 +1,139 @@ +#!/bin/bash +# +# Copyright 2009 Red Hat, Inc. and/or its affiliates. +# Released under the GPL +# +# Author: Dan Kenigsberg +# +# ksmtuned - a simple script that controls whether (and with what vigor) ksm +# should search for duplicated pages. +# +# starts ksm when memory commited to qemu processes exceeds a threshold, and +# make ksm work harder and harder untill memory load falls below that +# threshold. +# +# send SIGUSR1 to this process right after a new qemu process is started, or +# following its death, to retune ksm accordingly +# +# needs testing and ironing. contact danken@redhat.com if something breaks. + +if [ -f /etc/ksmtuned.conf ]; then + . /etc/ksmtuned.conf +fi + +debug() { + if [ -n "$DEBUG" ]; then + s="`/bin/date`: $*" + [ -n "$LOGFILE" ] && echo "$s" >> "$LOGFILE" || echo "$s" + fi +} + + +KSM_MONITOR_INTERVAL=${KSM_MONITOR_INTERVAL:-60} +KSM_NPAGES_BOOST=${KSM_NPAGES_BOOST:-300} +KSM_NPAGES_DECAY=${KSM_NPAGES_DECAY:--50} + +KSM_NPAGES_MIN=${KSM_NPAGES_MIN:-64} +KSM_NPAGES_MAX=${KSM_NPAGES_MAX:-1250} +# millisecond sleep between ksm scans for 16Gb server. Smaller servers sleep +# more, bigger sleep less. +KSM_SLEEP_MSEC=${KSM_SLEEP_MSEC:-10} + +KSM_THRES_COEF=${KSM_THRES_COEF:-20} +KSM_THRES_CONST=${KSM_THRES_CONST:-2048} + +total=`awk '/^MemTotal:/ {print $2}' /proc/meminfo` +debug total $total + +npages=0 +sleep=$[KSM_SLEEP_MSEC * 16 * 1024 * 1024 / total] +[ $sleep -le 10 ] && sleep=10 +debug sleep $sleep +thres=$[total * KSM_THRES_COEF / 100] +if [ $KSM_THRES_CONST -gt $thres ]; then + thres=$KSM_THRES_CONST +fi +debug thres $thres + +KSMCTL () { + case x$1 in + xstop) + echo 0 > /sys/kernel/mm/ksm/run + ;; + xstart) + echo $2 > /sys/kernel/mm/ksm/pages_to_scan + echo $3 > /sys/kernel/mm/ksm/sleep_millisecs + echo 1 > /sys/kernel/mm/ksm/run + ;; + esac +} + +committed_memory () { + # calculate how much memory is committed to running qemu processes + local pidlist + pidlist=$(pgrep -d ' ' -- '^qemu(-(kvm|system-.+)|:.{1,11})$') + if [ -n "$pidlist" ]; then + ps -p "$pidlist" -o rsz= + fi | awk '{ sum += $1 }; END { print 0+sum }' +} + +free_memory () { + awk '/^(MemFree|Buffers|Cached):/ {free += $2}; END {print free}' \ + /proc/meminfo +} + +increase_npages() { + local delta + delta=${1:-0} + npages=$[npages + delta] + if [ $npages -lt $KSM_NPAGES_MIN ]; then + npages=$KSM_NPAGES_MIN + elif [ $npages -gt $KSM_NPAGES_MAX ]; then + npages=$KSM_NPAGES_MAX + fi + echo $npages +} + + +adjust () { + local free committed + free=`free_memory` + committed=`committed_memory` + debug committed $committed free $free + if [ $[committed + thres] -lt $total -a $free -gt $thres ]; then + KSMCTL stop + debug "$[committed + thres] < $total and free > $thres, stop ksm" + return 1 + fi + debug "$[committed + thres] > $total, start ksm" + if [ $free -lt $thres ]; then + npages=`increase_npages $KSM_NPAGES_BOOST` + debug "$free < $thres, boost" + else + npages=`increase_npages $KSM_NPAGES_DECAY` + debug "$free > $thres, decay" + fi + KSMCTL start $npages $sleep + debug "KSMCTL start $npages $sleep" + return 0 +} + +function nothing () { + : +} + +loop () { + trap nothing SIGUSR1 + while true + do + sleep $KSM_MONITOR_INTERVAL & + wait $! + adjust + done +} + +PIDFILE=${PIDFILE-/var/run/ksmtune.pid} +if touch "$PIDFILE"; then + loop & + echo $! > "$PIDFILE" +fi diff --git a/SOURCES/ksmtuned.conf b/SOURCES/ksmtuned.conf new file mode 100644 index 0000000..fc4518c --- /dev/null +++ b/SOURCES/ksmtuned.conf @@ -0,0 +1,21 @@ +# Configuration file for ksmtuned. + +# How long ksmtuned should sleep between tuning adjustments +# KSM_MONITOR_INTERVAL=60 + +# Millisecond sleep between ksm scans for 16Gb server. +# Smaller servers sleep more, bigger sleep less. +# KSM_SLEEP_MSEC=10 + +# KSM_NPAGES_BOOST=300 +# KSM_NPAGES_DECAY=-50 +# KSM_NPAGES_MIN=64 +# KSM_NPAGES_MAX=1250 + +# KSM_THRES_COEF=20 +# KSM_THRES_CONST=2048 + +# uncomment the following if you want ksmtuned debug info + +# LOGFILE=/var/log/ksmtuned +# DEBUG=1 diff --git a/SOURCES/ksmtuned.service b/SOURCES/ksmtuned.service new file mode 100644 index 0000000..39febcc --- /dev/null +++ b/SOURCES/ksmtuned.service @@ -0,0 +1,12 @@ +[Unit] +Description=Kernel Samepage Merging (KSM) Tuning Daemon +After=ksm.service +Requires=ksm.service + +[Service] +ExecStart=/usr/sbin/ksmtuned +ExecReload=/bin/kill -USR1 $MAINPID +Type=forking + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/kvm-Disable-TPM-passthrough.patch b/SOURCES/kvm-Disable-TPM-passthrough.patch new file mode 100644 index 0000000..b0cc0b7 --- /dev/null +++ b/SOURCES/kvm-Disable-TPM-passthrough.patch @@ -0,0 +1,44 @@ +From 651798d03827dda7eb8dc33fb3482f872ec81d16 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Mon, 5 Jul 2021 15:23:48 +0400 +Subject: [PATCH 1/2] Disable TPM passthrough +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Marc-André Lureau +RH-MergeRequest: 17: Disable TPM passthrough +RH-Commit: [1/1] 735b79065149b968350b3f14d763030d5ef66457 +RH-Bugzilla: 1978911 +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Eric Auger +RH-Acked-by: Daniel P. Berrangé + +Signed-off-by: Marc-André Lureau +Signed-off-by: Miroslav Rezanina +--- + default-configs/devices/ppc64-rh-devices.mak | 1 - + default-configs/devices/x86_64-rh-devices.mak | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/default-configs/devices/ppc64-rh-devices.mak b/default-configs/devices/ppc64-rh-devices.mak +index 3ec5603ace..d6e424540e 100644 +--- a/default-configs/devices/ppc64-rh-devices.mak ++++ b/default-configs/devices/ppc64-rh-devices.mak +@@ -32,4 +32,3 @@ CONFIG_XICS=y + CONFIG_XIVE=y + CONFIG_TPM_SPAPR=y + CONFIG_TPM_EMULATOR=y +-CONFIG_TPM_PASSTHROUGH=y +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index 81bda09f4c..c2dd112f81 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -98,4 +98,3 @@ CONFIG_XIO3130=y + CONFIG_TPM_CRB=y + CONFIG_TPM_TIS_ISA=y + CONFIG_TPM_EMULATOR=y +-CONFIG_TPM_PASSTHROUGH=y +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.0.0-machine-type.patch b/SOURCES/kvm-Remove-RHEL-7.0.0-machine-type.patch new file mode 100644 index 0000000..0e0ca56 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.0.0-machine-type.patch @@ -0,0 +1,197 @@ +From 4fa7a78aa900988816d07034943be384d57117f0 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 10:24:56 +0200 +Subject: [PATCH 03/39] Remove RHEL 7.0.0 machine type + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [1/6] f182af372d3c38c3c1960af0d5cd37aba7205848 (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +Everything is used elsewhere except for cve_2014_5263 fields. Remove those. + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc.c | 35 ----------------------------------- + hw/i386/pc_piix.c | 34 ---------------------------------- + hw/usb/hcd-xhci.c | 20 -------------------- + hw/usb/hcd-xhci.h | 2 -- + include/hw/i386/pc.h | 3 --- + include/hw/usb.h | 3 --- + 6 files changed, 97 deletions(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index cdbfa84d2e..516ca50353 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -598,41 +598,6 @@ const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_compat); + * PC_RHEL_7_*_COMPAT apply both to i440fx and q35 types. + */ + +-/* +- * RHEL-7 is based on QEMU 1.5.3, so this needs the PC_COMPAT_* +- * between our base and 1.5, less stuff backported to RHEL-7.0 +- * (usb-device.msos-desc), less stuff for devices we changed +- * (qemu64-x86_64-cpu) or don't support (hpet, pci-serial-2x, +- * pci-serial-4x) in 7.0. +- */ +-GlobalProperty pc_rhel_7_0_compat[] = { +- { "virtio-scsi-pci", "any_layout", "off" }, +- { "PIIX4_PM", "memory-hotplug-support", "off" }, +- { "apic", "version", stringify(0x11) }, +- { "nec-usb-xhci", "superspeed-ports-first", "off" }, +- { "nec-usb-xhci", "force-pcie-endcap", "on" }, +- { "pci-serial", "prog_if", stringify(0) }, +- { "virtio-net-pci", "guest_announce", "off" }, +- { "ICH9-LPC", "memory-hotplug-support", "off" }, +- { "xio3130-downstream", COMPAT_PROP_PCP, "off" }, +- { "ioh3420", COMPAT_PROP_PCP, "off" }, +- { "PIIX4_PM", "acpi-pci-hotplug-with-bridge-support", "off" }, +- { "e1000", "mitigation", "off" }, +- { "virtio-net-pci", "ctrl_guest_offloads", "off" }, +- { "Conroe" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Penryn" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Nehalem" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Nehalem-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Westmere" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Westmere-IBRS" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Opteron_G1" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Opteron_G2" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Opteron_G3" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Opteron_G4" "-" TYPE_X86_CPU, "x2apic", "on" }, +- { "Opteron_G5" "-" TYPE_X86_CPU, "x2apic", "on" }, +-}; +-const size_t pc_rhel_7_0_compat_len = G_N_ELEMENTS(pc_rhel_7_0_compat); +- + GSIState *pc_gsi_create(qemu_irq **irqs, bool pci_enabled) + { + GSIState *s; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 5d61c9b833..b4e8034671 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1116,37 +1116,3 @@ static void pc_machine_rhel710_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710, + pc_machine_rhel710_options); +- +-static void pc_compat_rhel700(MachineState *machine) +-{ +- PCMachineState *pcms = PC_MACHINE(machine); +- PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); +- +- pc_compat_rhel710(machine); +- +- /* Upstream enables it for everyone, we're a little more selective */ +- x86_cpu_change_kvm_default("x2apic", NULL); +- x86_cpu_change_kvm_default("svm", NULL); +- pcmc->legacy_acpi_table_size = 6418; /* see pc_compat_2_0() */ +- pcmc->smbios_legacy_mode = true; +- pcmc->has_reserved_memory = false; +- migrate_cve_2014_5263_xhci_fields = true; +-} +- +-static void pc_init_rhel700(MachineState *machine) +-{ +- pc_compat_rhel700(machine); +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel700_options(MachineClass *m) +-{ +- pc_machine_rhel710_options(m); +- m->family = "pc_piix_Y"; +- m->desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)"; +- compat_props_add(m->compat_props, pc_rhel_7_0_compat, pc_rhel_7_0_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700, +- pc_machine_rhel700_options); +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 6d1f278aad..46212b1e69 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -3490,27 +3490,9 @@ static const VMStateDescription vmstate_xhci_slot = { + } + }; + +-static int xhci_event_pre_save(void *opaque) +-{ +- XHCIEvent *s = opaque; +- +- s->cve_2014_5263_a = ((uint8_t *)&s->type)[0]; +- s->cve_2014_5263_b = ((uint8_t *)&s->type)[1]; +- +- return 0; +-} +- +-bool migrate_cve_2014_5263_xhci_fields; +- +-static bool xhci_event_cve_2014_5263(void *opaque, int version_id) +-{ +- return migrate_cve_2014_5263_xhci_fields; +-} +- + static const VMStateDescription vmstate_xhci_event = { + .name = "xhci-event", + .version_id = 1, +- .pre_save = xhci_event_pre_save, + .fields = (VMStateField[]) { + VMSTATE_UINT32(type, XHCIEvent), + VMSTATE_UINT32(ccode, XHCIEvent), +@@ -3519,8 +3501,6 @@ static const VMStateDescription vmstate_xhci_event = { + VMSTATE_UINT32(flags, XHCIEvent), + VMSTATE_UINT8(slotid, XHCIEvent), + VMSTATE_UINT8(epid, XHCIEvent), +- VMSTATE_UINT8_TEST(cve_2014_5263_a, XHCIEvent, xhci_event_cve_2014_5263), +- VMSTATE_UINT8_TEST(cve_2014_5263_b, XHCIEvent, xhci_event_cve_2014_5263), + VMSTATE_END_OF_LIST() + } + }; +diff --git a/hw/usb/hcd-xhci.h b/hw/usb/hcd-xhci.h +index f450ffd13b..7bba361f3b 100644 +--- a/hw/usb/hcd-xhci.h ++++ b/hw/usb/hcd-xhci.h +@@ -149,8 +149,6 @@ typedef struct XHCIEvent { + uint32_t flags; + uint8_t slotid; + uint8_t epid; +- uint8_t cve_2014_5263_a; +- uint8_t cve_2014_5263_b; + } XHCIEvent; + + typedef struct XHCIInterrupter { +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 1980c93f41..2d17daf71f 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -314,9 +314,6 @@ extern const size_t pc_rhel_7_2_compat_len; + extern GlobalProperty pc_rhel_7_1_compat[]; + extern const size_t pc_rhel_7_1_compat_len; + +-extern GlobalProperty pc_rhel_7_0_compat[]; +-extern const size_t pc_rhel_7_0_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +diff --git a/include/hw/usb.h b/include/hw/usb.h +index edb2cd94b6..436e07b304 100644 +--- a/include/hw/usb.h ++++ b/include/hw/usb.h +@@ -577,7 +577,4 @@ void usb_pcap_init(FILE *fp); + void usb_pcap_ctrl(USBPacket *p, bool setup); + void usb_pcap_data(USBPacket *p, bool setup); + +-/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */ +-extern bool migrate_cve_2014_5263_xhci_fields; +- + #endif +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.1.0-machine-type.patch b/SOURCES/kvm-Remove-RHEL-7.1.0-machine-type.patch new file mode 100644 index 0000000..d3552f5 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.1.0-machine-type.patch @@ -0,0 +1,292 @@ +From 224b28d337f36a937b34685519d7b657974a95d0 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 10:46:56 +0200 +Subject: [PATCH 04/39] Remove RHEL 7.1.0 machine type + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [2/6] af1d8896d63756d1acc5af8658465808c4a13ca3 (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +migrate_pre_2_2 was a redhat artifact, removed. +broken_reserved_end is already fixed, nothing to do. + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/char/serial.c | 12 ---------- + hw/core/machine.c | 23 ------------------- + hw/i386/pc.c | 51 ------------------------------------------- + hw/i386/pc_piix.c | 41 ---------------------------------- + hw/rtc/mc146818rtc.c | 4 ---- + include/hw/boards.h | 3 --- + include/hw/i386/pc.h | 3 --- + migration/migration.c | 2 -- + migration/migration.h | 5 ----- + 9 files changed, 144 deletions(-) + +diff --git a/hw/char/serial.c b/hw/char/serial.c +index cc378142a3..3e4344cb2a 100644 +--- a/hw/char/serial.c ++++ b/hw/char/serial.c +@@ -690,9 +690,6 @@ static int serial_post_load(void *opaque, int version_id) + static bool serial_thr_ipending_needed(void *opaque) + { + SerialState *s = opaque; +- if (migrate_pre_2_2) { +- return false; +- } + + if (s->ier & UART_IER_THRI) { + bool expected_value = ((s->iir & UART_IIR_ID) == UART_IIR_THRI); +@@ -774,9 +771,6 @@ static const VMStateDescription vmstate_serial_xmit_fifo = { + static bool serial_fifo_timeout_timer_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; +- if (migrate_pre_2_2) { +- return false; +- } + + return timer_pending(s->fifo_timeout_timer); + } +@@ -795,9 +789,6 @@ static const VMStateDescription vmstate_serial_fifo_timeout_timer = { + static bool serial_timeout_ipending_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; +- if (migrate_pre_2_2) { +- return false; +- } + + return s->timeout_ipending != 0; + } +@@ -816,9 +807,6 @@ static const VMStateDescription vmstate_serial_timeout_ipending = { + static bool serial_poll_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; +- if (migrate_pre_2_2) { +- return false; +- } + + return s->poll_msl >= 0; + } +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 6c534e14fa..cc7c826593 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -270,29 +270,6 @@ GlobalProperty hw_compat_rhel_7_2[] = { + }; + const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2); + +-/* Mostly like hw_compat_2_1 but: +- * we don't need virtio-scsi-pci since 7.0 already had that on +- * +- * RH: Note, qemu-extended-regs should have been enabled in the 7.1 +- * machine type, but was accidentally turned off in 7.2 onwards. +- */ +-GlobalProperty hw_compat_rhel_7_1[] = { +- { "intel-hda-generic", "old_msi_addr", "on" }, +- { "VGA", "qemu-extended-regs", "off" }, +- { "secondary-vga", "qemu-extended-regs", "off" }, +- { "usb-mouse", "usb_version", stringify(1) }, +- { "usb-kbd", "usb_version", stringify(1) }, +- { "virtio-pci", "virtio-pci-bus-master-bug-migration", "on" }, +- { "virtio-blk-pci", "any_layout", "off" }, +- { "virtio-balloon-pci", "any_layout", "off" }, +- { "virtio-serial-pci", "any_layout", "off" }, +- { "virtio-9p-pci", "any_layout", "off" }, +- { "virtio-rng-pci", "any_layout", "off" }, +- /* HW_COMPAT_RHEL7_1 - introduced with 2.10.0 */ +- { "migration", "send-configuration", "off" }, +-}; +-const size_t hw_compat_rhel_7_1_len = G_N_ELEMENTS(hw_compat_rhel_7_1); +- + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 516ca50353..3c1f5be4fa 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -541,57 +541,6 @@ GlobalProperty pc_rhel_7_2_compat[] = { + }; + const size_t pc_rhel_7_2_compat_len = G_N_ELEMENTS(pc_rhel_7_2_compat); + +-GlobalProperty pc_rhel_7_1_compat[] = { +- { "kvm64" "-" TYPE_X86_CPU, "vme", "off" }, +- { "kvm32" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Conroe" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Penryn" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Nehalem" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Nehalem-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Westmere" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Westmere-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, +- { "SandyBridge" "-" TYPE_X86_CPU, "vme", "off" }, +- { "SandyBridge-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Haswell" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Haswell-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Broadwell" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Broadwell-IBRS" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Opteron_G1" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Opteron_G2" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Opteron_G3" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Opteron_G4" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Opteron_G5" "-" TYPE_X86_CPU, "vme", "off" }, +- { "Haswell" "-" TYPE_X86_CPU, "f16c", "off" }, +- { "Haswell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" }, +- { "Haswell" "-" TYPE_X86_CPU, "rdrand", "off" }, +- { "Haswell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" }, +- { "Broadwell" "-" TYPE_X86_CPU, "f16c", "off" }, +- { "Broadwell-IBRS" "-" TYPE_X86_CPU, "f16c", "off" }, +- { "Broadwell" "-" TYPE_X86_CPU, "rdrand", "off" }, +- { "Broadwell-IBRS" "-" TYPE_X86_CPU, "rdrand", "off" }, +- { "coreduo" "-" TYPE_X86_CPU, "vmx", "on" }, +- { "core2duo" "-" TYPE_X86_CPU, "vmx", "on" }, +- { "qemu64" "-" TYPE_X86_CPU, "min-level", stringify(4) }, +- { "kvm64" "-" TYPE_X86_CPU, "min-level", stringify(5) }, +- { "pentium3" "-" TYPE_X86_CPU, "min-level", stringify(2) }, +- { "n270" "-" TYPE_X86_CPU, "min-level", stringify(5) }, +- { "Conroe" "-" TYPE_X86_CPU, "min-level", stringify(4) }, +- { "Penryn" "-" TYPE_X86_CPU, "min-level", stringify(4) }, +- { "Nehalem" "-" TYPE_X86_CPU, "min-level", stringify(4) }, +- { "n270" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Penryn" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Conroe" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Nehalem" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Westmere" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "SandyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "IvyBridge" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Haswell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Haswell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Broadwell" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +- { "Broadwell-noTSX" "-" TYPE_X86_CPU, "min-xlevel", stringify(0x8000000a) }, +-}; +-const size_t pc_rhel_7_1_compat_len = G_N_ELEMENTS(pc_rhel_7_1_compat); +- + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index b4e8034671..2a6a28f1e5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1075,44 +1075,3 @@ static void pc_machine_rhel720_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720, + pc_machine_rhel720_options); +- +-static void pc_compat_rhel710(MachineState *machine) +-{ +- PCMachineState *pcms = PC_MACHINE(machine); +- PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); +- +- /* From pc_compat_2_2 */ +- pcmc->rsdp_in_ram = false; +- machine->suppress_vmdesc = true; +- +- /* From pc_compat_2_1 */ +- pcmc->smbios_uuid_encoded = false; +- x86_cpu_change_kvm_default("svm", NULL); +- pcmc->enforce_aligned_dimm = false; +- +- /* Disable all the extra subsections that were added in 2.2 */ +- migrate_pre_2_2 = true; +- +- /* From pc_i440fx_2_4_machine_options */ +- pcmc->broken_reserved_end = true; +-} +- +-static void pc_init_rhel710(MachineState *machine) +-{ +- pc_compat_rhel710(machine); +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel710_options(MachineClass *m) +-{ +- pc_machine_rhel720_options(m); +- m->family = "pc_piix_Y"; +- m->desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)"; +- m->default_display = "cirrus"; +- compat_props_add(m->compat_props, hw_compat_rhel_7_1, hw_compat_rhel_7_1_len); +- compat_props_add(m->compat_props, pc_rhel_7_1_compat, pc_rhel_7_1_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel710, "pc-i440fx-rhel7.1.0", pc_init_rhel710, +- pc_machine_rhel710_options); +diff --git a/hw/rtc/mc146818rtc.c b/hw/rtc/mc146818rtc.c +index 4a2e52031b..3a70a988e1 100644 +--- a/hw/rtc/mc146818rtc.c ++++ b/hw/rtc/mc146818rtc.c +@@ -824,10 +824,6 @@ static bool rtc_irq_reinject_on_ack_count_needed(void *opaque) + { + RTCState *s = (RTCState *)opaque; + +- if (migrate_pre_2_2) { +- return false; +- } +- + return s->irq_reinject_on_ack_count != 0; + } + +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 90ae100bfc..070db0b9b1 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -445,7 +445,4 @@ extern const size_t hw_compat_rhel_7_3_len; + extern GlobalProperty hw_compat_rhel_7_2[]; + extern const size_t hw_compat_rhel_7_2_len; + +-extern GlobalProperty hw_compat_rhel_7_1[]; +-extern const size_t hw_compat_rhel_7_1_len; +- + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 2d17daf71f..84d985f57c 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -311,9 +311,6 @@ extern const size_t pc_rhel_7_3_compat_len; + extern GlobalProperty pc_rhel_7_2_compat[]; + extern const size_t pc_rhel_7_2_compat_len; + +-extern GlobalProperty pc_rhel_7_1_compat[]; +-extern const size_t pc_rhel_7_1_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +diff --git a/migration/migration.c b/migration/migration.c +index 9d185f0e28..9cf1cde39d 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -167,8 +167,6 @@ INITIALIZE_MIGRATE_CAPS_SET(check_caps_background_snapshot, + MIGRATION_CAPABILITY_X_COLO, + MIGRATION_CAPABILITY_VALIDATE_UUID); + +-bool migrate_pre_2_2; +- + /* When we add fault tolerance, we could have several + migrations at once. For now we don't need to add + dynamic creation of migration */ +diff --git a/migration/migration.h b/migration/migration.h +index 1b6c69751c..db6708326b 100644 +--- a/migration/migration.h ++++ b/migration/migration.h +@@ -368,11 +368,6 @@ bool check_dirty_bitmap_mig_alias_map(const BitmapMigrationNodeAliasList *bbm, + void migrate_add_address(SocketAddress *address); + + int foreach_not_ignored_block(RAMBlockIterFunc func, void *opaque); +-/* +- * Disables a load of subsections that were added in 2.2/rh7.2 for backwards +- * migration compatibility. +- */ +-extern bool migrate_pre_2_2; + + #define qemu_ram_foreach_block \ + #warning "Use foreach_not_ignored_block in migration code" +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.2.0-machine-type.patch b/SOURCES/kvm-Remove-RHEL-7.2.0-machine-type.patch new file mode 100644 index 0000000..d014be6 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.2.0-machine-type.patch @@ -0,0 +1,192 @@ +From 999b28683394c2939ca8bd6b692ed2169860ced9 Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 11:02:24 +0200 +Subject: [PATCH 05/39] Remove RHEL 7.2.0 machine type + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [3/6] 575f0fe16c1928a41628f1f704a4d5d370679a82 (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/core/machine.c | 24 ------------------------ + hw/i386/pc.c | 22 ---------------------- + hw/i386/pc_piix.c | 26 -------------------------- + hw/ppc/spapr.c | 26 -------------------------- + include/hw/boards.h | 3 --- + include/hw/i386/pc.h | 3 --- + 6 files changed, 104 deletions(-) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index cc7c826593..54eb8376a7 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -246,30 +246,6 @@ GlobalProperty hw_compat_rhel_7_3[] = { + }; + const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3); + +-/* Mostly like hw_compat_2_4 + 2_3 but: +- * we don't need "any_layout" as it has been backported to 7.2 +- */ +-GlobalProperty hw_compat_rhel_7_2[] = { +- { "virtio-blk-device", "scsi", "true" }, +- { "e1000-82540em", "extra_mac_registers", "off" }, +- { "virtio-pci", "x-disable-pcie", "on" }, +- { "virtio-pci", "migrate-extra", "off" }, +- { "fw_cfg_mem", "dma_enabled", "off" }, +- { "fw_cfg_io", "dma_enabled", "off" }, +- { "isa-fdc", "fallback", "144" }, +- /* Optional because not all virtio-pci devices support legacy mode */ +- { "virtio-pci", "disable-modern", "on", .optional = true }, +- { "virtio-pci", "disable-legacy", "off", .optional = true }, +- { TYPE_PCI_DEVICE, "x-pcie-lnksta-dllla", "off" }, +- { "virtio-pci", "page-per-vq", "on" }, +- /* hw_compat_rhel_7_2 - introduced with 2.10.0 */ +- { "migration", "send-section-footer", "off" }, +- /* hw_compat_rhel_7_2 - introduced with 2.10.0 */ +- { "migration", "store-global-state", "off", +- }, +-}; +-const size_t hw_compat_rhel_7_2_len = G_N_ELEMENTS(hw_compat_rhel_7_2); +- + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 3c1f5be4fa..938cb82818 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -519,28 +519,6 @@ GlobalProperty pc_rhel_7_3_compat[] = { + }; + const size_t pc_rhel_7_3_compat_len = G_N_ELEMENTS(pc_rhel_7_3_compat); + +-GlobalProperty pc_rhel_7_2_compat[] = { +- { "phenom" "-" TYPE_X86_CPU, "rdtscp", "off"}, +- { "qemu64" "-" TYPE_X86_CPU, "sse4a", "on" }, +- { "qemu64" "-" TYPE_X86_CPU, "abm", "on" }, +- { "Haswell-" TYPE_X86_CPU, "abm", "off" }, +- { "Haswell-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, +- { "Haswell-noTSX-" TYPE_X86_CPU, "abm", "off" }, +- { "Haswell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, +- { "Broadwell-" TYPE_X86_CPU, "abm", "off" }, +- { "Broadwell-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, +- { "Broadwell-noTSX-" TYPE_X86_CPU, "abm", "off" }, +- { "Broadwell-noTSX-IBRS" "-" TYPE_X86_CPU, "abm", "off" }, +- { "host" "-" TYPE_X86_CPU, "host-cache-info", "on" }, +- { TYPE_X86_CPU, "check", "off" }, +- { "qemu32" "-" TYPE_X86_CPU, "popcnt", "on" }, +- { TYPE_X86_CPU, "arat", "off" }, +- { "usb-redir", "streams", "off" }, +- { TYPE_X86_CPU, "fill-mtrr-mask", "off" }, +- { "apic-common", "legacy-instance-id", "on" }, +-}; +-const size_t pc_rhel_7_2_compat_len = G_N_ELEMENTS(pc_rhel_7_2_compat); +- + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 2a6a28f1e5..201cbbdb01 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1049,29 +1049,3 @@ static void pc_machine_rhel730_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730, + pc_machine_rhel730_options); +- +- +-static void pc_init_rhel720(MachineState *machine) +-{ +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel720_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- X86MachineClass *x86mc = X86_MACHINE_CLASS(m); +- pc_machine_rhel730_options(m); +- m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)"; +- /* From pc_i440fx_2_5_machine_options */ +- x86mc->save_tsc_khz = false; +- m->legacy_fw_cfg_order = 1; +- /* Note: broken_reserved_end was already in 7.2 */ +- /* From pc_i440fx_2_6_machine_options */ +- pcmc->legacy_cpu_hotplug = true; +- compat_props_add(m->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len); +- compat_props_add(m->compat_props, pc_rhel_7_2_compat, pc_rhel_7_2_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel720, "pc-i440fx-rhel7.2.0", pc_init_rhel720, +- pc_machine_rhel720_options); +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 11db32c537..0bc558e0b7 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -5397,32 +5397,6 @@ static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc) + + DEFINE_SPAPR_MACHINE(rhel730sxxm, "rhel7.3.0-sxxm", false); + +-/* +- * pseries-rhel7.2.0 +- */ +-/* Should be like spapr_compat_2_5 + 2_4 + 2_3, but "dynamic-reconfiguration" +- * has been backported to RHEL7_2 so we don't need it here. +- */ +- +-GlobalProperty spapr_compat_rhel7_2[] = { +- { "spapr-vlan", "use-rx-buffer-pools", "off" }, +- { TYPE_SPAPR_PCI_HOST_BRIDGE, "ddw", "off" }, +-}; +-const size_t spapr_compat_rhel7_2_len = G_N_ELEMENTS(spapr_compat_rhel7_2); +- +-static void spapr_machine_rhel720_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel730_class_options(mc); +- smc->use_ohci_by_default = true; +- mc->has_hotpluggable_cpus = NULL; +- compat_props_add(mc->compat_props, hw_compat_rhel_7_2, hw_compat_rhel_7_2_len); +- compat_props_add(mc->compat_props, spapr_compat_rhel7_2, spapr_compat_rhel7_2_len); +-} +- +-DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false); +- + static void spapr_machine_register_types(void) + { + type_register_static(&spapr_machine_info); +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 070db0b9b1..43eb868ceb 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -442,7 +442,4 @@ extern const size_t hw_compat_rhel_7_4_len; + extern GlobalProperty hw_compat_rhel_7_3[]; + extern const size_t hw_compat_rhel_7_3_len; + +-extern GlobalProperty hw_compat_rhel_7_2[]; +-extern const size_t hw_compat_rhel_7_2_len; +- + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 84d985f57c..c26c6dcc72 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -308,9 +308,6 @@ extern const size_t pc_rhel_7_4_compat_len; + extern GlobalProperty pc_rhel_7_3_compat[]; + extern const size_t pc_rhel_7_3_compat_len; + +-extern GlobalProperty pc_rhel_7_2_compat[]; +-extern const size_t pc_rhel_7_2_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.3.0-machine-types.patch b/SOURCES/kvm-Remove-RHEL-7.3.0-machine-types.patch new file mode 100644 index 0000000..dbf9b49 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.3.0-machine-types.patch @@ -0,0 +1,315 @@ +From 1610bd2ce98e3d93296fd3bc4d2c24e905428a4a Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 11:24:26 +0200 +Subject: [PATCH 06/39] Remove RHEL 7.3.0 machine types + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [4/6] 7a674496dd29a7a87843770fd0459b85831cc866 (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +Only thing to remove with care was __redhat_e1000e_7_3_intr_state. + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/core/machine.c | 22 --------------------- + hw/i386/pc.c | 28 --------------------------- + hw/i386/pc_piix.c | 19 ------------------ + hw/i386/pc_q35.c | 19 ------------------ + hw/net/e1000e.c | 22 --------------------- + hw/ppc/spapr.c | 46 -------------------------------------------- + include/hw/boards.h | 3 --- + include/hw/i386/pc.h | 3 --- + 8 files changed, 162 deletions(-) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 54eb8376a7..0bcaabd8a9 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -224,28 +224,6 @@ GlobalProperty hw_compat_rhel_7_4[] = { + }; + + const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4); +-/* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except +- * disable-modern, disable-legacy, page-per-vq have already been +- * backported to RHEL7.3 +- */ +-GlobalProperty hw_compat_rhel_7_3[] = { +- { "virtio-mmio", "format_transport_address", "off" }, +- { "virtio-serial-device", "emergency-write", "off" }, +- { "ioapic", "version", "0x11" }, +- { "intel-iommu", "x-buggy-eim", "true" }, +- { "virtio-pci", "x-ignore-backend-features", "on" }, +- { "fw_cfg_mem", "x-file-slots", stringify(0x10) }, +- { "fw_cfg_io", "x-file-slots", stringify(0x10) }, +- { "pflash_cfi01", "old-multiple-chip-handling", "on" }, +- { TYPE_PCI_DEVICE, "x-pcie-extcap-init", "off" }, +- { "virtio-pci", "x-pcie-deverr-init", "off" }, +- { "virtio-pci", "x-pcie-lnkctl-init", "off" }, +- { "virtio-pci", "x-pcie-pm-init", "off" }, +- { "virtio-net-device", "x-mtu-bypass-backend", "off" }, +- { "e1000e", "__redhat_e1000e_7_3_intr_state", "on" }, +-}; +-const size_t hw_compat_rhel_7_3_len = G_N_ELEMENTS(hw_compat_rhel_7_3); +- + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 938cb82818..75abe0acc2 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -491,34 +491,6 @@ GlobalProperty pc_rhel_7_4_compat[] = { + }; + const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat); + +-GlobalProperty pc_rhel_7_3_compat[] = { +- /* pc_rhel_7_3_compat from pc_compat_2_8 */ +- { "kvmclock", "x-mach-use-reliable-get-clock", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { TYPE_X86_CPU, "l3-cache", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { TYPE_X86_CPU, "full-cpuid-auto-level", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { "Opteron_G3" "-" TYPE_X86_CPU, "family", "15" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { "Opteron_G3" "-" TYPE_X86_CPU, "model", "6" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { "Opteron_G3" "-" TYPE_X86_CPU, "stepping", "1" }, +- /* pc_rhel_7_3_compat from pc_compat_2_7 */ +- { "isa-pcspk", "migrate", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_6 */ +- { TYPE_X86_CPU, "cpuid-0xb", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_8 */ +- { "ICH9-LPC", "x-smi-broadcast", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_8 */ +- { TYPE_X86_CPU, "vmware-cpuid-freq", "off" }, +- /* pc_rhel_7_3_compat from pc_compat_2_8 */ +- { "Haswell-" TYPE_X86_CPU, "stepping", "1" }, +- /* pc_rhel_7_3_compat from pc_compat_2_3 added in 2.9*/ +- { TYPE_X86_CPU, "kvm-no-smi-migration", "on" }, +-}; +-const size_t pc_rhel_7_3_compat_len = G_N_ELEMENTS(pc_rhel_7_3_compat); +- + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 201cbbdb01..64662cc3d5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1030,22 +1030,3 @@ static void pc_machine_rhel740_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740, + pc_machine_rhel740_options); +- +-static void pc_init_rhel730(MachineState *machine) +-{ +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel730_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_machine_rhel740_options(m); +- m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)"; +- pcmc->linuxboot_dma_enabled = false; +- compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); +- compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730, +- pc_machine_rhel730_options); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 01ff3e0544..bf49a943dc 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -792,22 +792,3 @@ static void pc_q35_machine_rhel740_options(MachineClass *m) + + DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740, + pc_q35_machine_rhel740_options); +- +-static void pc_q35_init_rhel730(MachineState *machine) +-{ +- pc_q35_init(machine); +-} +- +-static void pc_q35_machine_rhel730_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_machine_rhel740_options(m); +- m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; +- m->max_cpus = 255; +- pcmc->linuxboot_dma_enabled = false; +- compat_props_add(m->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); +- compat_props_add(m->compat_props, pc_rhel_7_3_compat, pc_rhel_7_3_compat_len); +-} +- +-DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730, +- pc_q35_machine_rhel730_options); +diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c +index 6d39c1f1c4..b22f232863 100644 +--- a/hw/net/e1000e.c ++++ b/hw/net/e1000e.c +@@ -79,12 +79,6 @@ struct E1000EState { + bool disable_vnet; + + E1000ECore core; +- +- /* 7.3 had the intr_state field that was in the original e1000e code +- * but that was removed prior to 2.7's release +- */ +- bool redhat_7_3_intr_state_enable; +- uint32_t redhat_7_3_intr_state; + }; + + #define E1000E_MMIO_IDX 0 +@@ -100,10 +94,6 @@ struct E1000EState { + #define E1000E_MSIX_TABLE (0x0000) + #define E1000E_MSIX_PBA (0x2000) + +-/* Values as in RHEL 7.3 build and original upstream */ +-#define RH_E1000E_USE_MSI BIT(0) +-#define RH_E1000E_USE_MSIX BIT(1) +- + static uint64_t + e1000e_mmio_read(void *opaque, hwaddr addr, unsigned size) + { +@@ -315,8 +305,6 @@ e1000e_init_msix(E1000EState *s) + } else { + if (!e1000e_use_msix_vectors(s, E1000E_MSIX_VEC_NUM)) { + msix_uninit(d, &s->msix, &s->msix); +- } else { +- s->redhat_7_3_intr_state |= RH_E1000E_USE_MSIX; + } + } + } +@@ -488,8 +476,6 @@ static void e1000e_pci_realize(PCIDevice *pci_dev, Error **errp) + ret = msi_init(PCI_DEVICE(s), 0xD0, 1, true, false, NULL); + if (ret) { + trace_e1000e_msi_init_fail(ret); +- } else { +- s->redhat_7_3_intr_state |= RH_E1000E_USE_MSI; + } + + if (e1000e_add_pm_capability(pci_dev, e1000e_pmrb_offset, +@@ -613,11 +599,6 @@ static const VMStateDescription e1000e_vmstate_intr_timer = { + VMSTATE_STRUCT_ARRAY(_f, _s, _num, 0, \ + e1000e_vmstate_intr_timer, E1000IntrDelayTimer) + +-static bool rhel_7_3_check(void *opaque, int version_id) +-{ +- return ((E1000EState *)opaque)->redhat_7_3_intr_state_enable; +-} +- + static const VMStateDescription e1000e_vmstate = { + .name = "e1000e", + .version_id = 1, +@@ -629,7 +610,6 @@ static const VMStateDescription e1000e_vmstate = { + VMSTATE_MSIX(parent_obj, E1000EState), + + VMSTATE_UINT32(ioaddr, E1000EState), +- VMSTATE_UINT32_TEST(redhat_7_3_intr_state, E1000EState, rhel_7_3_check), + VMSTATE_UINT32(core.rxbuf_min_shift, E1000EState), + VMSTATE_UINT8(core.rx_desc_len, E1000EState), + VMSTATE_UINT32_ARRAY(core.rxbuf_sizes, E1000EState, +@@ -678,8 +658,6 @@ static PropertyInfo e1000e_prop_disable_vnet, + + static Property e1000e_properties[] = { + DEFINE_NIC_PROPERTIES(E1000EState, conf), +- DEFINE_PROP_BOOL("__redhat_e1000e_7_3_intr_state", E1000EState, +- redhat_7_3_intr_state_enable, false), + DEFINE_PROP_SIGNED("disable_vnet_hdr", E1000EState, disable_vnet, false, + e1000e_prop_disable_vnet, bool), + DEFINE_PROP_SIGNED("subsys_ven", E1000EState, subsys_ven, +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 0bc558e0b7..ca0b99403e 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -5351,52 +5351,6 @@ static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc) + + DEFINE_SPAPR_MACHINE(rhel740sxxm, "rhel7.4.0-sxxm", false); + +-/* +- * pseries-rhel7.3.0 +- * like spapr_compat_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3 +- */ +-GlobalProperty spapr_compat_rhel7_3[] = { +- { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem_win_size", "0xf80000000" }, +- { TYPE_SPAPR_PCI_HOST_BRIDGE, "mem64_win_size", "0" }, +- { TYPE_POWERPC_CPU, "pre-2.8-migration", "on" }, +- { TYPE_SPAPR_PCI_HOST_BRIDGE, "pre-2.8-migration", "on" }, +- { TYPE_SPAPR_PCI_HOST_BRIDGE, "pcie-extended-configuration-space", "off" }, +-}; +-const size_t spapr_compat_rhel7_3_len = G_N_ELEMENTS(spapr_compat_rhel7_3); +- +-static void spapr_machine_rhel730_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel740_class_options(mc); +- mc->default_cpu_type = POWERPC_CPU_TYPE_NAME("power7_v2.3"); +- mc->default_machine_opts = "modern-hotplug-events=off"; +- compat_props_add(mc->compat_props, hw_compat_rhel_7_3, hw_compat_rhel_7_3_len); +- compat_props_add(mc->compat_props, spapr_compat_rhel7_3, spapr_compat_rhel7_3_len); +- +- smc->phb_placement = phb_placement_2_7; +-} +- +-DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false); +- +-/* +- * pseries-rhel7.3.0-sxxm +- * +- * pseries-rhel7.3.0 with speculative execution exploit mitigations enabled by default +- */ +- +-static void spapr_machine_rhel730sxxm_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel730_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(rhel730sxxm, "rhel7.3.0-sxxm", false); +- + static void spapr_machine_register_types(void) + { + type_register_static(&spapr_machine_info); +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 43eb868ceb..24d4d726d8 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -439,7 +439,4 @@ extern const size_t hw_compat_rhel_7_5_len; + extern GlobalProperty hw_compat_rhel_7_4[]; + extern const size_t hw_compat_rhel_7_4_len; + +-extern GlobalProperty hw_compat_rhel_7_3[]; +-extern const size_t hw_compat_rhel_7_3_len; +- + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index c26c6dcc72..820fb3f577 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -305,9 +305,6 @@ extern const size_t pc_rhel_7_5_compat_len; + extern GlobalProperty pc_rhel_7_4_compat[]; + extern const size_t pc_rhel_7_4_compat_len; + +-extern GlobalProperty pc_rhel_7_3_compat[]; +-extern const size_t pc_rhel_7_3_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.4.0-machine-types.patch b/SOURCES/kvm-Remove-RHEL-7.4.0-machine-types.patch new file mode 100644 index 0000000..9484fc1 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.4.0-machine-types.patch @@ -0,0 +1,301 @@ +From b64f8848efe610c52791587ec41301b73ec9165a Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 11:53:07 +0200 +Subject: [PATCH 07/39] Remove RHEL 7.4.0 machine types + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [5/6] a1940ac35591cebff52379f85656caf6a03328dd (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +Revert pc_rom_ro hack. +Remove force_rev1_fadt hack, it is not needed anymore. + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/acpi/ich9.c | 15 --------------- + hw/core/machine.c | 9 --------- + hw/i386/acpi-build.c | 3 --- + hw/i386/pc.c | 18 +----------------- + hw/i386/pc_piix.c | 19 ------------------- + hw/i386/pc_q35.c | 18 ------------------ + hw/ppc/spapr.c | 43 ------------------------------------------ + include/hw/acpi/ich9.h | 3 --- + include/hw/boards.h | 3 --- + include/hw/i386/pc.h | 6 ------ + 10 files changed, 1 insertion(+), 136 deletions(-) + +diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c +index 33b0c6e33c..7f01fad64c 100644 +--- a/hw/acpi/ich9.c ++++ b/hw/acpi/ich9.c +@@ -369,18 +369,6 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp) + s->pm.enable_tco = value; + } + +-static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp) +-{ +- ICH9LPCState *s = ICH9_LPC_DEVICE(obj); +- return s->pm.force_rev1_fadt; +-} +- +-static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp) +-{ +- ICH9LPCState *s = ICH9_LPC_DEVICE(obj); +- s->pm.force_rev1_fadt = value; +-} +- + void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) + { + static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN; +@@ -403,9 +391,6 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm) + object_property_add_bool(obj, "cpu-hotplug-legacy", + ich9_pm_get_cpu_hotplug_legacy, + ich9_pm_set_cpu_hotplug_legacy); +- object_property_add_bool(obj, "__com.redhat_force-rev1-fadt", +- ich9_pm_get_force_rev1_fadt, +- ich9_pm_set_force_rev1_fadt); + object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED, + &pm->disable_s3, OBJ_PROP_FLAG_READWRITE); + object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED, +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 0bcaabd8a9..6dc2651d73 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -215,15 +215,6 @@ GlobalProperty hw_compat_rhel_7_5[] = { + }; + const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5); + +-/* Mostly like hw_compat_2_9 except +- * x-mtu-bypass-backend, x-migrate-msix has already been +- * backported to RHEL7.4. shpc was already on in 7.4. +- */ +-GlobalProperty hw_compat_rhel_7_4[] = { +- { "intel-iommu", "pt", "off" }, +-}; +- +-const size_t hw_compat_rhel_7_4_len = G_N_ELEMENTS(hw_compat_rhel_7_4); + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index 7bd67f7877..de98750aef 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -231,9 +231,6 @@ static void acpi_get_pm_info(MachineState *machine, AcpiPmInfo *pm) + pm->fadt.reset_reg = r; + pm->fadt.reset_val = 0xf; + pm->fadt.flags |= 1 << ACPI_FADT_F_RESET_REG_SUP; +- if (object_property_get_bool(lpc, +- "__com.redhat_force-rev1-fadt", NULL)) +- pm->fadt.rev = 1; + pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE; + pm->smi_on_cpuhp = + !!(smi_features & BIT_ULL(ICH9_LPC_SMI_F_CPU_HOTPLUG_BIT)); +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 75abe0acc2..6b39abce02 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -477,20 +477,6 @@ GlobalProperty pc_rhel_7_5_compat[] = { + }; + const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat); + +-GlobalProperty pc_rhel_7_4_compat[] = { +- /* pc_rhel_7_4_compat from pc_compat_2_9 */ +- { "mch", "extended-tseg-mbytes", stringify(0) }, +- /* bz 1489800 */ +- { "ICH9-LPC", "__com.redhat_force-rev1-fadt", "on" }, +- /* pc_rhel_7_4_compat from pc_compat_2_10 */ +- { "i440FX-pcihost", "x-pci-hole64-fix", "off" }, +- /* pc_rhel_7_4_compat from pc_compat_2_10 */ +- { "q35-pcihost", "x-pci-hole64-fix", "off" }, +- /* pc_rhel_7_4_compat from pc_compat_2_10 */ +- { TYPE_X86_CPU, "x-hv-max-vps", "0x40" }, +-}; +-const size_t pc_rhel_7_4_compat_len = G_N_ELEMENTS(pc_rhel_7_4_compat); +- + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. +@@ -1094,8 +1080,7 @@ void pc_memory_init(PCMachineState *pcms, + option_rom_mr = g_malloc(sizeof(*option_rom_mr)); + memory_region_init_ram(option_rom_mr, NULL, "pc.rom", PC_ROM_SIZE, + &error_fatal); +- /* RH difference: See bz 1489800, explicitly make ROM ro */ +- if (pcmc->pc_rom_ro) { ++ if (pcmc->pci_enabled) { + memory_region_set_readonly(option_rom_mr, true); + } + memory_region_add_subregion_overlap(rom_memory, +@@ -1845,7 +1830,6 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + pcmc->pvh_enabled = true; + pcmc->kvmclock_create_always = true; + assert(!mc->get_hotplug_handler); +- pcmc->pc_rom_ro = true; + mc->async_pf_vmexit_disable = false; + mc->get_hotplug_handler = pc_get_hotplug_handler; + mc->hotplug_allowed = pc_hotplug_allowed; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 64662cc3d5..fe2ac7593a 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1011,22 +1011,3 @@ static void pc_machine_rhel750_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750, + pc_machine_rhel750_options); +- +-static void pc_init_rhel740(MachineState *machine) +-{ +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel740_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_machine_rhel750_options(m); +- m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)"; +- pcmc->pc_rom_ro = false; +- compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); +- compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel740, "pc-i440fx-rhel7.4.0", pc_init_rhel740, +- pc_machine_rhel740_options); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index bf49a943dc..9958ed9184 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -774,21 +774,3 @@ static void pc_q35_machine_rhel750_options(MachineClass *m) + + DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750, + pc_q35_machine_rhel750_options); +- +-static void pc_q35_init_rhel740(MachineState *machine) +-{ +- pc_q35_init(machine); +-} +- +-static void pc_q35_machine_rhel740_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_machine_rhel750_options(m); +- m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)"; +- pcmc->pc_rom_ro = false; +- compat_props_add(m->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); +- compat_props_add(m->compat_props, pc_rhel_7_4_compat, pc_rhel_7_4_compat_len); +-} +- +-DEFINE_PC_MACHINE(q35_rhel740, "pc-q35-rhel7.4.0", pc_q35_init_rhel740, +- pc_q35_machine_rhel740_options); +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index ca0b99403e..bdabbf8b81 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -5308,49 +5308,6 @@ static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc) + } + + DEFINE_SPAPR_MACHINE(rhel750sxxm, "rhel7.5.0-sxxm", false); +- +-/* +- * pseries-rhel7.4.0 +- * like spapr_compat_2_9 +- */ +-GlobalProperty spapr_compat_rhel7_4[] = { +- { TYPE_POWERPC_CPU, "pre-2.10-migration", "on" }, +-}; +-const size_t spapr_compat_rhel7_4_len = G_N_ELEMENTS(spapr_compat_rhel7_4); +- +-static void spapr_machine_rhel740_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel750_class_options(mc); +- compat_props_add(mc->compat_props, hw_compat_rhel_7_4, hw_compat_rhel_7_4_len); +- compat_props_add(mc->compat_props, spapr_compat_rhel7_4, spapr_compat_rhel7_4_len); +- smc->has_power9_support = false; +- smc->pre_2_10_has_unused_icps = true; +- smc->resize_hpt_default = SPAPR_RESIZE_HPT_DISABLED; +- smc->default_caps.caps[SPAPR_CAP_HTM] = SPAPR_CAP_ON; +-} +- +-DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false); +- +-/* +- * pseries-rhel7.4.0-sxxm +- * +- * pseries-rhel7.4.0 with speculative execution exploit mitigations enabled by default +- */ +- +-static void spapr_machine_rhel740sxxm_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel740_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(rhel740sxxm, "rhel7.4.0-sxxm", false); +- + static void spapr_machine_register_types(void) + { + type_register_static(&spapr_machine_info); +diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h +index e1ecfbaf1f..df519e40b5 100644 +--- a/include/hw/acpi/ich9.h ++++ b/include/hw/acpi/ich9.h +@@ -62,9 +62,6 @@ typedef struct ICH9LPCPMRegs { + bool smm_compat; + bool enable_tco; + TCOIORegs tco_regs; +- +- /* RH addition, see bz 1489800 */ +- bool force_rev1_fadt; + } ICH9LPCPMRegs; + + #define ACPI_PM_PROP_TCO_ENABLED "enable_tco" +diff --git a/include/hw/boards.h b/include/hw/boards.h +index 24d4d726d8..f27170b6fb 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -436,7 +436,4 @@ extern const size_t hw_compat_rhel_7_6_len; + extern GlobalProperty hw_compat_rhel_7_5[]; + extern const size_t hw_compat_rhel_7_5_len; + +-extern GlobalProperty hw_compat_rhel_7_4[]; +-extern const size_t hw_compat_rhel_7_4_len; +- + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 820fb3f577..ff93dfb372 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -128,9 +128,6 @@ struct PCMachineClass { + + /* create kvmclock device even when KVM PV features are not exposed */ + bool kvmclock_create_always; +- +- /* RH only, see bz 1489800 */ +- bool pc_rom_ro; + }; + + #define TYPE_PC_MACHINE "generic-pc-machine" +@@ -302,9 +299,6 @@ extern const size_t pc_rhel_7_6_compat_len; + extern GlobalProperty pc_rhel_7_5_compat[]; + extern const size_t pc_rhel_7_5_compat_len; + +-extern GlobalProperty pc_rhel_7_4_compat[]; +-extern const size_t pc_rhel_7_4_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-RHEL-7.5.0-machine-types.patch b/SOURCES/kvm-Remove-RHEL-7.5.0-machine-types.patch new file mode 100644 index 0000000..ed51c11 --- /dev/null +++ b/SOURCES/kvm-Remove-RHEL-7.5.0-machine-types.patch @@ -0,0 +1,210 @@ +From 6de2502ef6f2ee68842bed7d09b0a2c7ac57b11b Mon Sep 17 00:00:00 2001 +From: Juan Quintela +Date: Tue, 3 Aug 2021 12:24:36 +0200 +Subject: [PATCH 08/39] Remove RHEL 7.5.0 machine types + +RH-Author: quintela1 +RH-MergeRequest: 30: Remove RHEL 7.x.0 machine types +RH-Commit: [6/6] a4a72853fda905fe5036520f6095032e308cb51f (juan.quintela/qemu-kvm) +RH-Bugzilla: 1968519 +RH-Acked-by: Cornelia Huck +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +Signed-off-by: Juan Quintela +Signed-off-by: Miroslav Rezanina +--- + hw/core/machine.c | 20 -------------------- + hw/i386/pc.c | 18 ------------------ + hw/i386/pc_piix.c | 20 -------------------- + hw/i386/pc_q35.c | 20 -------------------- + hw/ppc/spapr.c | 31 ------------------------------- + include/hw/boards.h | 3 --- + include/hw/i386/pc.h | 3 --- + 7 files changed, 115 deletions(-) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 6dc2651d73..b271389681 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -195,26 +195,6 @@ GlobalProperty hw_compat_rhel_7_6[] = { + }; + const size_t hw_compat_rhel_7_6_len = G_N_ELEMENTS(hw_compat_rhel_7_6); + +-/* The same as hw_compat_2_11 + hw_compat_2_10 */ +-GlobalProperty hw_compat_rhel_7_5[] = { +- /* hw_compat_rhel_7_5 from hw_compat_2_11 */ +- { "hpet", "hpet-offset-saved", "false" }, +- /* hw_compat_rhel_7_5 from hw_compat_2_11 */ +- { "virtio-blk-pci", "vectors", "2" }, +- /* hw_compat_rhel_7_5 from hw_compat_2_11 */ +- { "vhost-user-blk-pci", "vectors", "2" }, +- /* hw_compat_rhel_7_5 from hw_compat_2_11 +- bz 1608778 modified for our naming */ +- { "e1000-82540em", "migrate_tso_props", "off" }, +- /* hw_compat_rhel_7_5 from hw_compat_2_10 */ +- { "virtio-mouse-device", "wheel-axis", "false" }, +- /* hw_compat_rhel_7_5 from hw_compat_2_10 */ +- { "virtio-tablet-device", "wheel-axis", "false" }, +- { "cirrus-vga", "vgamem_mb", "16" }, +- { "migration", "decompress-error-check", "off" }, +-}; +-const size_t hw_compat_rhel_7_5_len = G_N_ELEMENTS(hw_compat_rhel_7_5); +- + GlobalProperty hw_compat_5_2[] = { + { "ICH9-LPC", "smm-compat", "on"}, + { "PIIX4_PM", "smm-compat", "on"}, +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 6b39abce02..88972dc3e6 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -459,24 +459,6 @@ GlobalProperty pc_rhel_7_6_compat[] = { + }; + const size_t pc_rhel_7_6_compat_len = G_N_ELEMENTS(pc_rhel_7_6_compat); + +-/* Similar to PC_COMPAT_2_11 + PC_COMPAT_2_10, but: +- * - x-hv-max-vps was backported to 7.5 +- * - x-pci-hole64-fix was backported to 7.5 +- */ +-GlobalProperty pc_rhel_7_5_compat[] = { +- /* pc_rhel_7_5_compat from pc_compat_2_11 */ +- { "Skylake-Server" "-" TYPE_X86_CPU, "clflushopt", "off" }, +- /* pc_rhel_7_5_compat from pc_compat_2_12 */ +- { TYPE_X86_CPU, "legacy-cache", "on" }, +- /* pc_rhel_7_5_compat from pc_compat_2_12 */ +- { TYPE_X86_CPU, "topoext", "off" }, +- /* pc_rhel_7_5_compat from pc_compat_2_12 */ +- { "EPYC-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) }, +- /* pc_rhel_7_5_compat from pc_compat_2_12 */ +- { "EPYC-IBPB-" TYPE_X86_CPU, "xlevel", stringify(0x8000000a) }, +-}; +-const size_t pc_rhel_7_5_compat_len = G_N_ELEMENTS(pc_rhel_7_5_compat); +- + /* + * The PC_RHEL_*_COMPAT serve the same purpose for RHEL-7 machine + * types as the PC_COMPAT_* do for upstream types. +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index fe2ac7593a..ba7926cfae 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -991,23 +991,3 @@ static void pc_machine_rhel760_options(MachineClass *m) + + DEFINE_PC_MACHINE(rhel760, "pc-i440fx-rhel7.6.0", pc_init_rhel760, + pc_machine_rhel760_options); +- +-static void pc_init_rhel750(MachineState *machine) +-{ +- pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ +- TYPE_I440FX_PCI_DEVICE); +-} +- +-static void pc_machine_rhel750_options(MachineClass *m) +-{ +- pc_machine_rhel760_options(m); +- m->alias = NULL; +- m->is_default = 0; +- m->desc = "RHEL 7.5.0 PC (i440FX + PIIX, 1996)"; +- m->auto_enable_numa_with_memhp = false; +- compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); +- compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len); +-} +- +-DEFINE_PC_MACHINE(rhel750, "pc-i440fx-rhel7.5.0", pc_init_rhel750, +- pc_machine_rhel750_options); +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 9958ed9184..f93825d603 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -754,23 +754,3 @@ static void pc_q35_machine_rhel760_options(MachineClass *m) + + DEFINE_PC_MACHINE(q35_rhel760, "pc-q35-rhel7.6.0", pc_q35_init_rhel760, + pc_q35_machine_rhel760_options); +- +-static void pc_q35_init_rhel750(MachineState *machine) +-{ +- pc_q35_init(machine); +-} +- +-static void pc_q35_machine_rhel750_options(MachineClass *m) +-{ +- PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_machine_rhel760_options(m); +- m->alias = NULL; +- m->desc = "RHEL-7.5.0 PC (Q35 + ICH9, 2009)"; +- m->auto_enable_numa_with_memhp = false; +- pcmc->default_nic_model = "e1000"; +- compat_props_add(m->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); +- compat_props_add(m->compat_props, pc_rhel_7_5_compat, pc_rhel_7_5_compat_len); +-} +- +-DEFINE_PC_MACHINE(q35_rhel750, "pc-q35-rhel7.5.0", pc_q35_init_rhel750, +- pc_q35_machine_rhel750_options); +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index bdabbf8b81..cda75a8cfe 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -5282,35 +5282,4 @@ static void spapr_machine_rhel760sxxm_class_options(MachineClass *mc) + + DEFINE_SPAPR_MACHINE(rhel760sxxm, "rhel7.6.0-sxxm", false); + +-static void spapr_machine_rhel750_class_options(MachineClass *mc) +-{ +- spapr_machine_rhel760_class_options(mc); +- compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); +- +-} +- +-DEFINE_SPAPR_MACHINE(rhel750, "rhel7.5.0", false); +- +-/* +- * pseries-rhel7.5.0-sxxm +- * +- * pseries-rhel7.5.0 with speculative execution exploit mitigations enabled by default +- */ +- +-static void spapr_machine_rhel750sxxm_class_options(MachineClass *mc) +-{ +- SpaprMachineClass *smc = SPAPR_MACHINE_CLASS(mc); +- +- spapr_machine_rhel750_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(rhel750sxxm, "rhel7.5.0-sxxm", false); +-static void spapr_machine_register_types(void) +-{ +- type_register_static(&spapr_machine_info); +-} +- + type_init(spapr_machine_register_types) +diff --git a/include/hw/boards.h b/include/hw/boards.h +index f27170b6fb..73f7dcdb35 100644 +--- a/include/hw/boards.h ++++ b/include/hw/boards.h +@@ -433,7 +433,4 @@ 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 GlobalProperty hw_compat_rhel_7_5[]; +-extern const size_t hw_compat_rhel_7_5_len; +- + #endif +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index ff93dfb372..549e581a98 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -296,9 +296,6 @@ 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; + +-extern GlobalProperty pc_rhel_7_5_compat[]; +-extern const size_t pc_rhel_7_5_compat_len; +- + /* Helper for setting model-id for CPU models that changed model-id + * depending on QEMU versions up to QEMU 2.4. + */ +-- +2.27.0 + diff --git a/SOURCES/kvm-Remove-SPICE-and-QXL-from-x86_64-rh-devices.mak.patch b/SOURCES/kvm-Remove-SPICE-and-QXL-from-x86_64-rh-devices.mak.patch new file mode 100644 index 0000000..7fdb392 --- /dev/null +++ b/SOURCES/kvm-Remove-SPICE-and-QXL-from-x86_64-rh-devices.mak.patch @@ -0,0 +1,43 @@ +From c51bf45304812b4da010bdd3db1b1d59c44af4ee Mon Sep 17 00:00:00 2001 +From: Uri Lublin +Date: Tue, 27 Apr 2021 18:37:09 +0300 +Subject: [PATCH 2/4] Remove SPICE and QXL from x86_64-rh-devices.mak +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Uri Lublin (uril) +RH-MergeRequest: 3: Build qemu-kvm without SPICE and QXL +RH-Commit: [1/3] 8f6186049d22c3a6e1bfb1cf2bfe88a8fc8c2271 +RH-Bugzilla: 1906168 +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Danilo de Paula +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Daniel P. Berrangé +--- + default-configs/devices/x86_64-rh-devices.mak | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index 9f41400530..d09c138fc6 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -60,7 +60,6 @@ CONFIG_PFLASH_CFI01=y + CONFIG_PVPANIC_ISA=y + CONFIG_PXB=y + CONFIG_Q35=y +-CONFIG_QXL=y + CONFIG_RTL8139_PCI=y + CONFIG_SCSI=y + CONFIG_SERIAL=y +@@ -70,7 +69,6 @@ CONFIG_SEV=y + CONFIG_SGA=y + CONFIG_SMBIOS=y + CONFIG_SMBUS_EEPROM=y +-CONFIG_SPICE=y + CONFIG_TEST_DEVICES=y + CONFIG_USB=y + CONFIG_USB_EHCI=y +-- +2.27.0 + diff --git a/SOURCES/kvm-Revert-disable-sga-device.patch b/SOURCES/kvm-Revert-disable-sga-device.patch new file mode 100644 index 0000000..96b4ead --- /dev/null +++ b/SOURCES/kvm-Revert-disable-sga-device.patch @@ -0,0 +1,42 @@ +From d9a64fbf2de6b0ffdc96b2818495b211fd21411b Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 17 Sep 2021 09:34:21 +0200 +Subject: [PATCH 1/2] Revert "disable sga device" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 38: Revert "disable sga device" +RH-Commit: [1/2] f69f0fb209301e73b3ddbe59c5a7f407beeb368f +RH-Bugzilla: 2002993 +RH-Acked-by: Michal Prívozník +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Richard W.M. Jones + +This reverts commit 86338b2497c47ec6e7175197f6a2ed6af0fcfe73. + +Do it later (for GA) as it depends on libvirt changes. + +RH-Bugzilla: 2002993 + +Signed-off-by: Gerd Hoffmann +--- + default-configs/devices/x86_64-rh-devices.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index 31c290d02d..8ae2747bf6 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -65,6 +65,7 @@ CONFIG_SERIAL=y + CONFIG_SERIAL_ISA=y + CONFIG_SERIAL_PCI=y + CONFIG_SEV=y ++CONFIG_SGA=y + CONFIG_SMBIOS=y + CONFIG_SMBUS_EEPROM=y + CONFIG_TEST_DEVICES=y +-- +2.27.0 + diff --git a/SOURCES/kvm-Update-Linux-headers-to-5.13-rc4.patch b/SOURCES/kvm-Update-Linux-headers-to-5.13-rc4.patch new file mode 100644 index 0000000..a06d102 --- /dev/null +++ b/SOURCES/kvm-Update-Linux-headers-to-5.13-rc4.patch @@ -0,0 +1,5465 @@ +From 5df5b2094167f0bc6c728933b990982fe012e33d Mon Sep 17 00:00:00 2001 +From: "plai@redhat.com" +Date: Thu, 29 Jul 2021 07:42:25 -0400 +Subject: [PATCH 15/39] Update Linux headers to 5.13-rc4 + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [7/15] 2e8a71b8e0d02d2a16cd6dd2234895a9db59fa0d (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Signed-off-by: Eduardo Habkost +Message-Id: <20210603191541.2862286-1-ehabkost@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 278f064e452468d66ee15c3f453826e697ec6832) +Signed-off-by: Paul Lai +Signed-off-by: Miroslav Rezanina +--- + .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h | 35 - + include/standard-headers/drm/drm_fourcc.h | 23 +- + include/standard-headers/linux/ethtool.h | 109 ++- + include/standard-headers/linux/fuse.h | 17 +- + include/standard-headers/linux/input.h | 2 +- + include/standard-headers/linux/virtio_bt.h | 31 + + include/standard-headers/linux/virtio_ids.h | 2 + + include/standard-headers/linux/virtio_snd.h | 334 +++++++ + .../standard-headers/rdma/vmw_pvrdma-abi.h | 7 + + linux-headers/asm-generic/unistd.h | 13 +- + linux-headers/asm-mips/unistd_n32.h | 751 +++++++-------- + linux-headers/asm-mips/unistd_n64.h | 703 +++++++------- + linux-headers/asm-mips/unistd_o32.h | 843 ++++++++--------- + linux-headers/asm-powerpc/kvm.h | 2 + + linux-headers/asm-powerpc/unistd_32.h | 856 +++++++++--------- + linux-headers/asm-powerpc/unistd_64.h | 800 ++++++++-------- + linux-headers/asm-s390/unistd_32.h | 4 + + linux-headers/asm-s390/unistd_64.h | 4 + + linux-headers/asm-x86/kvm.h | 3 + + linux-headers/asm-x86/unistd_32.h | 4 + + linux-headers/asm-x86/unistd_64.h | 4 + + linux-headers/asm-x86/unistd_x32.h | 4 + + linux-headers/linux/kvm.h | 131 ++- + linux-headers/linux/userfaultfd.h | 36 +- + linux-headers/linux/vfio.h | 35 + + 25 files changed, 2707 insertions(+), 2046 deletions(-) + create mode 100644 include/standard-headers/linux/virtio_bt.h + create mode 100644 include/standard-headers/linux/virtio_snd.h + +diff --git a/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h b/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h +index 1677208a41..94d41b202c 100644 +--- a/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h ++++ b/include/standard-headers/drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h +@@ -70,30 +70,6 @@ enum pvrdma_mtu { + PVRDMA_MTU_4096 = 5, + }; + +-static inline int pvrdma_mtu_enum_to_int(enum pvrdma_mtu mtu) +-{ +- switch (mtu) { +- case PVRDMA_MTU_256: return 256; +- case PVRDMA_MTU_512: return 512; +- case PVRDMA_MTU_1024: return 1024; +- case PVRDMA_MTU_2048: return 2048; +- case PVRDMA_MTU_4096: return 4096; +- default: return -1; +- } +-} +- +-static inline enum pvrdma_mtu pvrdma_mtu_int_to_enum(int mtu) +-{ +- switch (mtu) { +- case 256: return PVRDMA_MTU_256; +- case 512: return PVRDMA_MTU_512; +- case 1024: return PVRDMA_MTU_1024; +- case 2048: return PVRDMA_MTU_2048; +- case 4096: +- default: return PVRDMA_MTU_4096; +- } +-} +- + enum pvrdma_port_state { + PVRDMA_PORT_NOP = 0, + PVRDMA_PORT_DOWN = 1, +@@ -138,17 +114,6 @@ enum pvrdma_port_width { + PVRDMA_WIDTH_12X = 8, + }; + +-static inline int pvrdma_width_enum_to_int(enum pvrdma_port_width width) +-{ +- switch (width) { +- case PVRDMA_WIDTH_1X: return 1; +- case PVRDMA_WIDTH_4X: return 4; +- case PVRDMA_WIDTH_8X: return 8; +- case PVRDMA_WIDTH_12X: return 12; +- default: return -1; +- } +-} +- + enum pvrdma_port_speed { + PVRDMA_SPEED_SDR = 1, + PVRDMA_SPEED_DDR = 2, +diff --git a/include/standard-headers/drm/drm_fourcc.h b/include/standard-headers/drm/drm_fourcc.h +index c47e19810c..a61ae520c2 100644 +--- a/include/standard-headers/drm/drm_fourcc.h ++++ b/include/standard-headers/drm/drm_fourcc.h +@@ -526,6 +526,25 @@ extern "C" { + */ + #define I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS fourcc_mod_code(INTEL, 7) + ++/* ++ * Intel Color Control Surface with Clear Color (CCS) for Gen-12 render ++ * compression. ++ * ++ * The main surface is Y-tiled and is at plane index 0 whereas CCS is linear ++ * and at index 1. The clear color is stored at index 2, and the pitch should ++ * be ignored. The clear color structure is 256 bits. The first 128 bits ++ * represents Raw Clear Color Red, Green, Blue and Alpha color each represented ++ * by 32 bits. The raw clear color is consumed by the 3d engine and generates ++ * the converted clear color of size 64 bits. The first 32 bits store the Lower ++ * Converted Clear Color value and the next 32 bits store the Higher Converted ++ * Clear Color value when applicable. The Converted Clear Color values are ++ * consumed by the DE. The last 64 bits are used to store Color Discard Enable ++ * and Depth Clear Value Valid which are ignored by the DE. A CCS cache line ++ * corresponds to an area of 4x1 tiles in the main surface. The main surface ++ * pitch is required to be a multiple of 4 tile widths. ++ */ ++#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8) ++ + /* + * Tiled, NV12MT, grouped in 64 (pixels) x 32 (lines) -sized macroblocks + * +@@ -1035,9 +1054,9 @@ drm_fourcc_canonicalize_nvidia_format_mod(uint64_t modifier) + * Not all combinations are valid, and different SoCs may support different + * combinations of layout and options. + */ +-#define __fourcc_mod_amlogic_layout_mask 0xf ++#define __fourcc_mod_amlogic_layout_mask 0xff + #define __fourcc_mod_amlogic_options_shift 8 +-#define __fourcc_mod_amlogic_options_mask 0xf ++#define __fourcc_mod_amlogic_options_mask 0xff + + #define DRM_FORMAT_MOD_AMLOGIC_FBC(__layout, __options) \ + fourcc_mod_code(AMLOGIC, \ +diff --git a/include/standard-headers/linux/ethtool.h b/include/standard-headers/linux/ethtool.h +index 8bfd01d230..218d944a17 100644 +--- a/include/standard-headers/linux/ethtool.h ++++ b/include/standard-headers/linux/ethtool.h +@@ -26,6 +26,14 @@ + * have the same layout for 32-bit and 64-bit userland. + */ + ++/* Note on reserved space. ++ * Reserved fields must not be accessed directly by user space because ++ * they may be replaced by a different field in the future. They must ++ * be initialized to zero before making the request, e.g. via memset ++ * of the entire structure or implicitly by not being set in a structure ++ * initializer. ++ */ ++ + /** + * struct ethtool_cmd - DEPRECATED, link control and status + * This structure is DEPRECATED, please use struct ethtool_link_settings. +@@ -67,6 +75,7 @@ + * and other link features that the link partner advertised + * through autonegotiation; 0 if unknown or not applicable. + * Read-only. ++ * @reserved: Reserved for future use; see the note on reserved space. + * + * The link speed in Mbps is split between @speed and @speed_hi. Use + * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to +@@ -155,6 +164,7 @@ static inline uint32_t ethtool_cmd_speed(const struct ethtool_cmd *ep) + * @bus_info: Device bus address. This should match the dev_name() + * string for the underlying bus device, if there is one. May be + * an empty string. ++ * @reserved2: Reserved for future use; see the note on reserved space. + * @n_priv_flags: Number of flags valid for %ETHTOOL_GPFLAGS and + * %ETHTOOL_SPFLAGS commands; also the number of strings in the + * %ETH_SS_PRIV_FLAGS set +@@ -356,6 +366,7 @@ struct ethtool_eeprom { + * @tx_lpi_timer: Time in microseconds the interface delays prior to asserting + * its tx lpi (after reaching 'idle' state). Effective only when eee + * was negotiated and tx_lpi_enabled was set. ++ * @reserved: Reserved for future use; see the note on reserved space. + */ + struct ethtool_eee { + uint32_t cmd; +@@ -374,6 +385,7 @@ struct ethtool_eee { + * @cmd: %ETHTOOL_GMODULEINFO + * @type: Standard the module information conforms to %ETH_MODULE_SFF_xxxx + * @eeprom_len: Length of the eeprom ++ * @reserved: Reserved for future use; see the note on reserved space. + * + * This structure is used to return the information to + * properly size memory for a subsequent call to %ETHTOOL_GMODULEEEPROM. +@@ -579,9 +591,7 @@ struct ethtool_pauseparam { + uint32_t tx_pause; + }; + +-/** +- * enum ethtool_link_ext_state - link extended state +- */ ++/* Link extended state */ + enum ethtool_link_ext_state { + ETHTOOL_LINK_EXT_STATE_AUTONEG, + ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE, +@@ -595,10 +605,7 @@ enum ethtool_link_ext_state { + ETHTOOL_LINK_EXT_STATE_OVERHEAT, + }; + +-/** +- * enum ethtool_link_ext_substate_autoneg - more information in addition to +- * ETHTOOL_LINK_EXT_STATE_AUTONEG. +- */ ++/* More information in addition to ETHTOOL_LINK_EXT_STATE_AUTONEG. */ + enum ethtool_link_ext_substate_autoneg { + ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_PARTNER_DETECTED = 1, + ETHTOOL_LINK_EXT_SUBSTATE_AN_ACK_NOT_RECEIVED, +@@ -608,9 +615,7 @@ enum ethtool_link_ext_substate_autoneg { + ETHTOOL_LINK_EXT_SUBSTATE_AN_NO_HCD, + }; + +-/** +- * enum ethtool_link_ext_substate_link_training - more information in addition to +- * ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE. ++/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_TRAINING_FAILURE. + */ + enum ethtool_link_ext_substate_link_training { + ETHTOOL_LINK_EXT_SUBSTATE_LT_KR_FRAME_LOCK_NOT_ACQUIRED = 1, +@@ -619,9 +624,7 @@ enum ethtool_link_ext_substate_link_training { + ETHTOOL_LINK_EXT_SUBSTATE_LT_REMOTE_FAULT, + }; + +-/** +- * enum ethtool_link_ext_substate_logical_mismatch - more information in addition +- * to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH. ++/* More information in addition to ETHTOOL_LINK_EXT_STATE_LINK_LOGICAL_MISMATCH. + */ + enum ethtool_link_ext_substate_link_logical_mismatch { + ETHTOOL_LINK_EXT_SUBSTATE_LLM_PCS_DID_NOT_ACQUIRE_BLOCK_LOCK = 1, +@@ -631,19 +634,14 @@ enum ethtool_link_ext_substate_link_logical_mismatch { + ETHTOOL_LINK_EXT_SUBSTATE_LLM_RS_FEC_IS_NOT_LOCKED, + }; + +-/** +- * enum ethtool_link_ext_substate_bad_signal_integrity - more information in +- * addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY. ++/* More information in addition to ETHTOOL_LINK_EXT_STATE_BAD_SIGNAL_INTEGRITY. + */ + enum ethtool_link_ext_substate_bad_signal_integrity { + ETHTOOL_LINK_EXT_SUBSTATE_BSI_LARGE_NUMBER_OF_PHYSICAL_ERRORS = 1, + ETHTOOL_LINK_EXT_SUBSTATE_BSI_UNSUPPORTED_RATE, + }; + +-/** +- * enum ethtool_link_ext_substate_cable_issue - more information in +- * addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE. +- */ ++/* More information in addition to ETHTOOL_LINK_EXT_STATE_CABLE_ISSUE. */ + enum ethtool_link_ext_substate_cable_issue { + ETHTOOL_LINK_EXT_SUBSTATE_CI_UNSUPPORTED_CABLE = 1, + ETHTOOL_LINK_EXT_SUBSTATE_CI_CABLE_TEST_FAILURE, +@@ -661,6 +659,7 @@ enum ethtool_link_ext_substate_cable_issue { + * now deprecated + * @ETH_SS_FEATURES: Device feature names + * @ETH_SS_RSS_HASH_FUNCS: RSS hush function names ++ * @ETH_SS_TUNABLES: tunable names + * @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS + * @ETH_SS_PHY_TUNABLES: PHY tunable names + * @ETH_SS_LINK_MODES: link mode names +@@ -670,6 +669,13 @@ enum ethtool_link_ext_substate_cable_issue { + * @ETH_SS_TS_TX_TYPES: timestamping Tx types + * @ETH_SS_TS_RX_FILTERS: timestamping Rx filters + * @ETH_SS_UDP_TUNNEL_TYPES: UDP tunnel types ++ * @ETH_SS_STATS_STD: standardized stats ++ * @ETH_SS_STATS_ETH_PHY: names of IEEE 802.3 PHY statistics ++ * @ETH_SS_STATS_ETH_MAC: names of IEEE 802.3 MAC statistics ++ * @ETH_SS_STATS_ETH_CTRL: names of IEEE 802.3 MAC Control statistics ++ * @ETH_SS_STATS_RMON: names of RMON statistics ++ * ++ * @ETH_SS_COUNT: number of defined string sets + */ + enum ethtool_stringset { + ETH_SS_TEST = 0, +@@ -688,6 +694,11 @@ enum ethtool_stringset { + ETH_SS_TS_TX_TYPES, + ETH_SS_TS_RX_FILTERS, + ETH_SS_UDP_TUNNEL_TYPES, ++ ETH_SS_STATS_STD, ++ ETH_SS_STATS_ETH_PHY, ++ ETH_SS_STATS_ETH_MAC, ++ ETH_SS_STATS_ETH_CTRL, ++ ETH_SS_STATS_RMON, + + /* add new constants above here */ + ETH_SS_COUNT +@@ -715,6 +726,7 @@ struct ethtool_gstrings { + /** + * struct ethtool_sset_info - string set information + * @cmd: Command number = %ETHTOOL_GSSET_INFO ++ * @reserved: Reserved for future use; see the note on reserved space. + * @sset_mask: On entry, a bitmask of string sets to query, with bits + * numbered according to &enum ethtool_stringset. On return, a + * bitmask of those string sets queried that are supported. +@@ -759,6 +771,7 @@ enum ethtool_test_flags { + * @flags: A bitmask of flags from &enum ethtool_test_flags. Some + * flags may be set by the user on entry; others may be set by + * the driver on return. ++ * @reserved: Reserved for future use; see the note on reserved space. + * @len: On return, the number of test results + * @data: Array of test results + * +@@ -959,6 +972,7 @@ union ethtool_flow_union { + * @vlan_etype: VLAN EtherType + * @vlan_tci: VLAN tag control information + * @data: user defined data ++ * @padding: Reserved for future use; see the note on reserved space. + * + * Note, @vlan_etype, @vlan_tci, and @data are only valid if %FLOW_EXT + * is set in &struct ethtool_rx_flow_spec @flow_type. +@@ -1134,7 +1148,8 @@ struct ethtool_rxfh_indir { + * hardware hash key. + * @hfunc: Defines the current RSS hash function used by HW (or to be set to). + * Valid values are one of the %ETH_RSS_HASH_*. +- * @rsvd: Reserved for future extensions. ++ * @rsvd8: Reserved for future use; see the note on reserved space. ++ * @rsvd32: Reserved for future use; see the note on reserved space. + * @rss_config: RX ring/queue index for each hash value i.e., indirection table + * of @indir_size uint32_t elements, followed by hash key of @key_size + * bytes. +@@ -1302,7 +1317,9 @@ struct ethtool_sfeatures { + * @so_timestamping: bit mask of the sum of the supported SO_TIMESTAMPING flags + * @phc_index: device index of the associated PHC, or -1 if there is none + * @tx_types: bit mask of the supported hwtstamp_tx_types enumeration values ++ * @tx_reserved: Reserved for future use; see the note on reserved space. + * @rx_filters: bit mask of the supported hwtstamp_rx_filters enumeration values ++ * @rx_reserved: Reserved for future use; see the note on reserved space. + * + * The bits in the 'tx_types' and 'rx_filters' fields correspond to + * the 'hwtstamp_tx_types' and 'hwtstamp_rx_filters' enumeration values, +@@ -1376,15 +1393,33 @@ struct ethtool_per_queue_op { + }; + + /** +- * struct ethtool_fecparam - Ethernet forward error correction(fec) parameters ++ * struct ethtool_fecparam - Ethernet Forward Error Correction parameters + * @cmd: Command number = %ETHTOOL_GFECPARAM or %ETHTOOL_SFECPARAM +- * @active_fec: FEC mode which is active on porte +- * @fec: Bitmask of supported/configured FEC modes +- * @rsvd: Reserved for future extensions. i.e FEC bypass feature. ++ * @active_fec: FEC mode which is active on the port, single bit set, GET only. ++ * @fec: Bitmask of configured FEC modes. ++ * @reserved: Reserved for future extensions, ignore on GET, write 0 for SET. + * +- * Drivers should reject a non-zero setting of @autoneg when +- * autoneogotiation is disabled (or not supported) for the link. ++ * Note that @reserved was never validated on input and ethtool user space ++ * left it uninitialized when calling SET. Hence going forward it can only be ++ * used to return a value to userspace with GET. ++ * ++ * FEC modes supported by the device can be read via %ETHTOOL_GLINKSETTINGS. ++ * FEC settings are configured by link autonegotiation whenever it's enabled. ++ * With autoneg on %ETHTOOL_GFECPARAM can be used to read the current mode. ++ * ++ * When autoneg is disabled %ETHTOOL_SFECPARAM controls the FEC settings. ++ * It is recommended that drivers only accept a single bit set in @fec. ++ * When multiple bits are set in @fec drivers may pick mode in an implementation ++ * dependent way. Drivers should reject mixing %ETHTOOL_FEC_AUTO_BIT with other ++ * FEC modes, because it's unclear whether in this case other modes constrain ++ * AUTO or are independent choices. ++ * Drivers must reject SET requests if they support none of the requested modes. ++ * ++ * If device does not support FEC drivers may use %ETHTOOL_FEC_NONE instead ++ * of returning %EOPNOTSUPP from %ETHTOOL_GFECPARAM. + * ++ * See enum ethtool_fec_config_bits for definition of valid bits for both ++ * @fec and @active_fec. + */ + struct ethtool_fecparam { + uint32_t cmd; +@@ -1396,11 +1431,16 @@ struct ethtool_fecparam { + + /** + * enum ethtool_fec_config_bits - flags definition of ethtool_fec_configuration +- * @ETHTOOL_FEC_NONE: FEC mode configuration is not supported +- * @ETHTOOL_FEC_AUTO: Default/Best FEC mode provided by driver +- * @ETHTOOL_FEC_OFF: No FEC Mode +- * @ETHTOOL_FEC_RS: Reed-Solomon Forward Error Detection mode +- * @ETHTOOL_FEC_BASER: Base-R/Reed-Solomon Forward Error Detection mode ++ * @ETHTOOL_FEC_NONE_BIT: FEC mode configuration is not supported. Should not ++ * be used together with other bits. GET only. ++ * @ETHTOOL_FEC_AUTO_BIT: Select default/best FEC mode automatically, usually ++ * based link mode and SFP parameters read from module's ++ * EEPROM. This bit does _not_ mean autonegotiation. ++ * @ETHTOOL_FEC_OFF_BIT: No FEC Mode ++ * @ETHTOOL_FEC_RS_BIT: Reed-Solomon FEC Mode ++ * @ETHTOOL_FEC_BASER_BIT: Base-R/Reed-Solomon FEC Mode ++ * @ETHTOOL_FEC_LLRS_BIT: Low Latency Reed Solomon FEC Mode (25G/50G Ethernet ++ * Consortium) + */ + enum ethtool_fec_config_bits { + ETHTOOL_FEC_NONE_BIT, +@@ -1958,6 +1998,11 @@ enum ethtool_reset_flags { + * autonegotiation; 0 if unknown or not applicable. Read-only. + * @transceiver: Used to distinguish different possible PHY types, + * reported consistently by PHYLIB. Read-only. ++ * @master_slave_cfg: Master/slave port mode. ++ * @master_slave_state: Master/slave port state. ++ * @reserved: Reserved for future use; see the note on reserved space. ++ * @reserved1: Reserved for future use; see the note on reserved space. ++ * @link_mode_masks: Variable length bitmaps. + * + * If autonegotiation is disabled, the speed and @duplex represent the + * fixed link mode and are writable if the driver supports multiple +diff --git a/include/standard-headers/linux/fuse.h b/include/standard-headers/linux/fuse.h +index 950d7edb7e..cce105bfba 100644 +--- a/include/standard-headers/linux/fuse.h ++++ b/include/standard-headers/linux/fuse.h +@@ -179,6 +179,8 @@ + * 7.33 + * - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID + * - add FUSE_OPEN_KILL_SUIDGID ++ * - extend fuse_setxattr_in, add FUSE_SETXATTR_EXT ++ * - add FUSE_SETXATTR_ACL_KILL_SGID + */ + + #ifndef _LINUX_FUSE_H +@@ -326,6 +328,7 @@ struct fuse_file_lock { + * does not have CAP_FSETID. Additionally upon + * write/truncate sgid is killed only if file has group + * execute permission. (Same as Linux VFS behavior). ++ * FUSE_SETXATTR_EXT: Server supports extended struct fuse_setxattr_in + */ + #define FUSE_ASYNC_READ (1 << 0) + #define FUSE_POSIX_LOCKS (1 << 1) +@@ -356,6 +359,7 @@ struct fuse_file_lock { + #define FUSE_MAP_ALIGNMENT (1 << 26) + #define FUSE_SUBMOUNTS (1 << 27) + #define FUSE_HANDLE_KILLPRIV_V2 (1 << 28) ++#define FUSE_SETXATTR_EXT (1 << 29) + + /** + * CUSE INIT request/reply flags +@@ -447,6 +451,12 @@ struct fuse_file_lock { + */ + #define FUSE_OPEN_KILL_SUIDGID (1 << 0) + ++/** ++ * setxattr flags ++ * FUSE_SETXATTR_ACL_KILL_SGID: Clear SGID when system.posix_acl_access is set ++ */ ++#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0) ++ + enum fuse_opcode { + FUSE_LOOKUP = 1, + FUSE_FORGET = 2, /* no reply */ +@@ -677,9 +687,13 @@ struct fuse_fsync_in { + uint32_t padding; + }; + ++#define FUSE_COMPAT_SETXATTR_IN_SIZE 8 ++ + struct fuse_setxattr_in { + uint32_t size; + uint32_t flags; ++ uint32_t setxattr_flags; ++ uint32_t padding; + }; + + struct fuse_getxattr_in { +@@ -899,7 +913,8 @@ struct fuse_notify_retrieve_in { + }; + + /* Device ioctls: */ +-#define FUSE_DEV_IOC_CLONE _IOR(229, 0, uint32_t) ++#define FUSE_DEV_IOC_MAGIC 229 ++#define FUSE_DEV_IOC_CLONE _IOR(FUSE_DEV_IOC_MAGIC, 0, uint32_t) + + struct fuse_lseek_in { + uint64_t fh; +diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h +index f89c986190..7822c24178 100644 +--- a/include/standard-headers/linux/input.h ++++ b/include/standard-headers/linux/input.h +@@ -81,7 +81,7 @@ struct input_id { + * in units per radian. + * When INPUT_PROP_ACCELEROMETER is set the resolution changes. + * The main axes (ABS_X, ABS_Y, ABS_Z) are then reported in +- * in units per g (units/g) and in units per degree per second ++ * units per g (units/g) and in units per degree per second + * (units/deg/s) for rotational axes (ABS_RX, ABS_RY, ABS_RZ). + */ + struct input_absinfo { +diff --git a/include/standard-headers/linux/virtio_bt.h b/include/standard-headers/linux/virtio_bt.h +new file mode 100644 +index 0000000000..245e1eff4b +--- /dev/null ++++ b/include/standard-headers/linux/virtio_bt.h +@@ -0,0 +1,31 @@ ++/* SPDX-License-Identifier: BSD-3-Clause */ ++ ++#ifndef _LINUX_VIRTIO_BT_H ++#define _LINUX_VIRTIO_BT_H ++ ++#include "standard-headers/linux/virtio_types.h" ++ ++/* Feature bits */ ++#define VIRTIO_BT_F_VND_HCI 0 /* Indicates vendor command support */ ++#define VIRTIO_BT_F_MSFT_EXT 1 /* Indicates MSFT vendor support */ ++#define VIRTIO_BT_F_AOSP_EXT 2 /* Indicates AOSP vendor support */ ++ ++enum virtio_bt_config_type { ++ VIRTIO_BT_CONFIG_TYPE_PRIMARY = 0, ++ VIRTIO_BT_CONFIG_TYPE_AMP = 1, ++}; ++ ++enum virtio_bt_config_vendor { ++ VIRTIO_BT_CONFIG_VENDOR_NONE = 0, ++ VIRTIO_BT_CONFIG_VENDOR_ZEPHYR = 1, ++ VIRTIO_BT_CONFIG_VENDOR_INTEL = 2, ++ VIRTIO_BT_CONFIG_VENDOR_REALTEK = 3, ++}; ++ ++struct virtio_bt_config { ++ uint8_t type; ++ uint16_t vendor; ++ uint16_t msft_opcode; ++} QEMU_PACKED; ++ ++#endif /* _LINUX_VIRTIO_BT_H */ +diff --git a/include/standard-headers/linux/virtio_ids.h b/include/standard-headers/linux/virtio_ids.h +index bc1c0621f5..f0c35ce862 100644 +--- a/include/standard-headers/linux/virtio_ids.h ++++ b/include/standard-headers/linux/virtio_ids.h +@@ -51,8 +51,10 @@ + #define VIRTIO_ID_PSTORE 22 /* virtio pstore device */ + #define VIRTIO_ID_IOMMU 23 /* virtio IOMMU */ + #define VIRTIO_ID_MEM 24 /* virtio mem */ ++#define VIRTIO_ID_SOUND 25 /* virtio sound */ + #define VIRTIO_ID_FS 26 /* virtio filesystem */ + #define VIRTIO_ID_PMEM 27 /* virtio pmem */ ++#define VIRTIO_ID_BT 28 /* virtio bluetooth */ + #define VIRTIO_ID_MAC80211_HWSIM 29 /* virtio mac80211-hwsim */ + + #endif /* _LINUX_VIRTIO_IDS_H */ +diff --git a/include/standard-headers/linux/virtio_snd.h b/include/standard-headers/linux/virtio_snd.h +new file mode 100644 +index 0000000000..1af96b9fc6 +--- /dev/null ++++ b/include/standard-headers/linux/virtio_snd.h +@@ -0,0 +1,334 @@ ++/* SPDX-License-Identifier: BSD-3-Clause */ ++/* ++ * Copyright (C) 2021 OpenSynergy GmbH ++ */ ++#ifndef VIRTIO_SND_IF_H ++#define VIRTIO_SND_IF_H ++ ++#include "standard-headers/linux/virtio_types.h" ++ ++/******************************************************************************* ++ * CONFIGURATION SPACE ++ */ ++struct virtio_snd_config { ++ /* # of available physical jacks */ ++ uint32_t jacks; ++ /* # of available PCM streams */ ++ uint32_t streams; ++ /* # of available channel maps */ ++ uint32_t chmaps; ++}; ++ ++enum { ++ /* device virtqueue indexes */ ++ VIRTIO_SND_VQ_CONTROL = 0, ++ VIRTIO_SND_VQ_EVENT, ++ VIRTIO_SND_VQ_TX, ++ VIRTIO_SND_VQ_RX, ++ /* # of device virtqueues */ ++ VIRTIO_SND_VQ_MAX ++}; ++ ++/******************************************************************************* ++ * COMMON DEFINITIONS ++ */ ++ ++/* supported dataflow directions */ ++enum { ++ VIRTIO_SND_D_OUTPUT = 0, ++ VIRTIO_SND_D_INPUT ++}; ++ ++enum { ++ /* jack control request types */ ++ VIRTIO_SND_R_JACK_INFO = 1, ++ VIRTIO_SND_R_JACK_REMAP, ++ ++ /* PCM control request types */ ++ VIRTIO_SND_R_PCM_INFO = 0x0100, ++ VIRTIO_SND_R_PCM_SET_PARAMS, ++ VIRTIO_SND_R_PCM_PREPARE, ++ VIRTIO_SND_R_PCM_RELEASE, ++ VIRTIO_SND_R_PCM_START, ++ VIRTIO_SND_R_PCM_STOP, ++ ++ /* channel map control request types */ ++ VIRTIO_SND_R_CHMAP_INFO = 0x0200, ++ ++ /* jack event types */ ++ VIRTIO_SND_EVT_JACK_CONNECTED = 0x1000, ++ VIRTIO_SND_EVT_JACK_DISCONNECTED, ++ ++ /* PCM event types */ ++ VIRTIO_SND_EVT_PCM_PERIOD_ELAPSED = 0x1100, ++ VIRTIO_SND_EVT_PCM_XRUN, ++ ++ /* common status codes */ ++ VIRTIO_SND_S_OK = 0x8000, ++ VIRTIO_SND_S_BAD_MSG, ++ VIRTIO_SND_S_NOT_SUPP, ++ VIRTIO_SND_S_IO_ERR ++}; ++ ++/* common header */ ++struct virtio_snd_hdr { ++ uint32_t code; ++}; ++ ++/* event notification */ ++struct virtio_snd_event { ++ /* VIRTIO_SND_EVT_XXX */ ++ struct virtio_snd_hdr hdr; ++ /* optional event data */ ++ uint32_t data; ++}; ++ ++/* common control request to query an item information */ ++struct virtio_snd_query_info { ++ /* VIRTIO_SND_R_XXX_INFO */ ++ struct virtio_snd_hdr hdr; ++ /* item start identifier */ ++ uint32_t start_id; ++ /* item count to query */ ++ uint32_t count; ++ /* item information size in bytes */ ++ uint32_t size; ++}; ++ ++/* common item information header */ ++struct virtio_snd_info { ++ /* function group node id (High Definition Audio Specification 7.1.2) */ ++ uint32_t hda_fn_nid; ++}; ++ ++/******************************************************************************* ++ * JACK CONTROL MESSAGES ++ */ ++struct virtio_snd_jack_hdr { ++ /* VIRTIO_SND_R_JACK_XXX */ ++ struct virtio_snd_hdr hdr; ++ /* 0 ... virtio_snd_config::jacks - 1 */ ++ uint32_t jack_id; ++}; ++ ++/* supported jack features */ ++enum { ++ VIRTIO_SND_JACK_F_REMAP = 0 ++}; ++ ++struct virtio_snd_jack_info { ++ /* common header */ ++ struct virtio_snd_info hdr; ++ /* supported feature bit map (1 << VIRTIO_SND_JACK_F_XXX) */ ++ uint32_t features; ++ /* pin configuration (High Definition Audio Specification 7.3.3.31) */ ++ uint32_t hda_reg_defconf; ++ /* pin capabilities (High Definition Audio Specification 7.3.4.9) */ ++ uint32_t hda_reg_caps; ++ /* current jack connection status (0: disconnected, 1: connected) */ ++ uint8_t connected; ++ ++ uint8_t padding[7]; ++}; ++ ++/* jack remapping control request */ ++struct virtio_snd_jack_remap { ++ /* .code = VIRTIO_SND_R_JACK_REMAP */ ++ struct virtio_snd_jack_hdr hdr; ++ /* selected association number */ ++ uint32_t association; ++ /* selected sequence number */ ++ uint32_t sequence; ++}; ++ ++/******************************************************************************* ++ * PCM CONTROL MESSAGES ++ */ ++struct virtio_snd_pcm_hdr { ++ /* VIRTIO_SND_R_PCM_XXX */ ++ struct virtio_snd_hdr hdr; ++ /* 0 ... virtio_snd_config::streams - 1 */ ++ uint32_t stream_id; ++}; ++ ++/* supported PCM stream features */ ++enum { ++ VIRTIO_SND_PCM_F_SHMEM_HOST = 0, ++ VIRTIO_SND_PCM_F_SHMEM_GUEST, ++ VIRTIO_SND_PCM_F_MSG_POLLING, ++ VIRTIO_SND_PCM_F_EVT_SHMEM_PERIODS, ++ VIRTIO_SND_PCM_F_EVT_XRUNS ++}; ++ ++/* supported PCM sample formats */ ++enum { ++ /* analog formats (width / physical width) */ ++ VIRTIO_SND_PCM_FMT_IMA_ADPCM = 0, /* 4 / 4 bits */ ++ VIRTIO_SND_PCM_FMT_MU_LAW, /* 8 / 8 bits */ ++ VIRTIO_SND_PCM_FMT_A_LAW, /* 8 / 8 bits */ ++ VIRTIO_SND_PCM_FMT_S8, /* 8 / 8 bits */ ++ VIRTIO_SND_PCM_FMT_U8, /* 8 / 8 bits */ ++ VIRTIO_SND_PCM_FMT_S16, /* 16 / 16 bits */ ++ VIRTIO_SND_PCM_FMT_U16, /* 16 / 16 bits */ ++ VIRTIO_SND_PCM_FMT_S18_3, /* 18 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_U18_3, /* 18 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_S20_3, /* 20 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_U20_3, /* 20 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_S24_3, /* 24 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_U24_3, /* 24 / 24 bits */ ++ VIRTIO_SND_PCM_FMT_S20, /* 20 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_U20, /* 20 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_S24, /* 24 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_U24, /* 24 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_S32, /* 32 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_U32, /* 32 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_FLOAT, /* 32 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_FLOAT64, /* 64 / 64 bits */ ++ /* digital formats (width / physical width) */ ++ VIRTIO_SND_PCM_FMT_DSD_U8, /* 8 / 8 bits */ ++ VIRTIO_SND_PCM_FMT_DSD_U16, /* 16 / 16 bits */ ++ VIRTIO_SND_PCM_FMT_DSD_U32, /* 32 / 32 bits */ ++ VIRTIO_SND_PCM_FMT_IEC958_SUBFRAME /* 32 / 32 bits */ ++}; ++ ++/* supported PCM frame rates */ ++enum { ++ VIRTIO_SND_PCM_RATE_5512 = 0, ++ VIRTIO_SND_PCM_RATE_8000, ++ VIRTIO_SND_PCM_RATE_11025, ++ VIRTIO_SND_PCM_RATE_16000, ++ VIRTIO_SND_PCM_RATE_22050, ++ VIRTIO_SND_PCM_RATE_32000, ++ VIRTIO_SND_PCM_RATE_44100, ++ VIRTIO_SND_PCM_RATE_48000, ++ VIRTIO_SND_PCM_RATE_64000, ++ VIRTIO_SND_PCM_RATE_88200, ++ VIRTIO_SND_PCM_RATE_96000, ++ VIRTIO_SND_PCM_RATE_176400, ++ VIRTIO_SND_PCM_RATE_192000, ++ VIRTIO_SND_PCM_RATE_384000 ++}; ++ ++struct virtio_snd_pcm_info { ++ /* common header */ ++ struct virtio_snd_info hdr; ++ /* supported feature bit map (1 << VIRTIO_SND_PCM_F_XXX) */ ++ uint32_t features; ++ /* supported sample format bit map (1 << VIRTIO_SND_PCM_FMT_XXX) */ ++ uint64_t formats; ++ /* supported frame rate bit map (1 << VIRTIO_SND_PCM_RATE_XXX) */ ++ uint64_t rates; ++ /* dataflow direction (VIRTIO_SND_D_XXX) */ ++ uint8_t direction; ++ /* minimum # of supported channels */ ++ uint8_t channels_min; ++ /* maximum # of supported channels */ ++ uint8_t channels_max; ++ ++ uint8_t padding[5]; ++}; ++ ++/* set PCM stream format */ ++struct virtio_snd_pcm_set_params { ++ /* .code = VIRTIO_SND_R_PCM_SET_PARAMS */ ++ struct virtio_snd_pcm_hdr hdr; ++ /* size of the hardware buffer */ ++ uint32_t buffer_bytes; ++ /* size of the hardware period */ ++ uint32_t period_bytes; ++ /* selected feature bit map (1 << VIRTIO_SND_PCM_F_XXX) */ ++ uint32_t features; ++ /* selected # of channels */ ++ uint8_t channels; ++ /* selected sample format (VIRTIO_SND_PCM_FMT_XXX) */ ++ uint8_t format; ++ /* selected frame rate (VIRTIO_SND_PCM_RATE_XXX) */ ++ uint8_t rate; ++ ++ uint8_t padding; ++}; ++ ++/******************************************************************************* ++ * PCM I/O MESSAGES ++ */ ++ ++/* I/O request header */ ++struct virtio_snd_pcm_xfer { ++ /* 0 ... virtio_snd_config::streams - 1 */ ++ uint32_t stream_id; ++}; ++ ++/* I/O request status */ ++struct virtio_snd_pcm_status { ++ /* VIRTIO_SND_S_XXX */ ++ uint32_t status; ++ /* current device latency */ ++ uint32_t latency_bytes; ++}; ++ ++/******************************************************************************* ++ * CHANNEL MAP CONTROL MESSAGES ++ */ ++struct virtio_snd_chmap_hdr { ++ /* VIRTIO_SND_R_CHMAP_XXX */ ++ struct virtio_snd_hdr hdr; ++ /* 0 ... virtio_snd_config::chmaps - 1 */ ++ uint32_t chmap_id; ++}; ++ ++/* standard channel position definition */ ++enum { ++ VIRTIO_SND_CHMAP_NONE = 0, /* undefined */ ++ VIRTIO_SND_CHMAP_NA, /* silent */ ++ VIRTIO_SND_CHMAP_MONO, /* mono stream */ ++ VIRTIO_SND_CHMAP_FL, /* front left */ ++ VIRTIO_SND_CHMAP_FR, /* front right */ ++ VIRTIO_SND_CHMAP_RL, /* rear left */ ++ VIRTIO_SND_CHMAP_RR, /* rear right */ ++ VIRTIO_SND_CHMAP_FC, /* front center */ ++ VIRTIO_SND_CHMAP_LFE, /* low frequency (LFE) */ ++ VIRTIO_SND_CHMAP_SL, /* side left */ ++ VIRTIO_SND_CHMAP_SR, /* side right */ ++ VIRTIO_SND_CHMAP_RC, /* rear center */ ++ VIRTIO_SND_CHMAP_FLC, /* front left center */ ++ VIRTIO_SND_CHMAP_FRC, /* front right center */ ++ VIRTIO_SND_CHMAP_RLC, /* rear left center */ ++ VIRTIO_SND_CHMAP_RRC, /* rear right center */ ++ VIRTIO_SND_CHMAP_FLW, /* front left wide */ ++ VIRTIO_SND_CHMAP_FRW, /* front right wide */ ++ VIRTIO_SND_CHMAP_FLH, /* front left high */ ++ VIRTIO_SND_CHMAP_FCH, /* front center high */ ++ VIRTIO_SND_CHMAP_FRH, /* front right high */ ++ VIRTIO_SND_CHMAP_TC, /* top center */ ++ VIRTIO_SND_CHMAP_TFL, /* top front left */ ++ VIRTIO_SND_CHMAP_TFR, /* top front right */ ++ VIRTIO_SND_CHMAP_TFC, /* top front center */ ++ VIRTIO_SND_CHMAP_TRL, /* top rear left */ ++ VIRTIO_SND_CHMAP_TRR, /* top rear right */ ++ VIRTIO_SND_CHMAP_TRC, /* top rear center */ ++ VIRTIO_SND_CHMAP_TFLC, /* top front left center */ ++ VIRTIO_SND_CHMAP_TFRC, /* top front right center */ ++ VIRTIO_SND_CHMAP_TSL, /* top side left */ ++ VIRTIO_SND_CHMAP_TSR, /* top side right */ ++ VIRTIO_SND_CHMAP_LLFE, /* left LFE */ ++ VIRTIO_SND_CHMAP_RLFE, /* right LFE */ ++ VIRTIO_SND_CHMAP_BC, /* bottom center */ ++ VIRTIO_SND_CHMAP_BLC, /* bottom left center */ ++ VIRTIO_SND_CHMAP_BRC /* bottom right center */ ++}; ++ ++/* maximum possible number of channels */ ++#define VIRTIO_SND_CHMAP_MAX_SIZE 18 ++ ++struct virtio_snd_chmap_info { ++ /* common header */ ++ struct virtio_snd_info hdr; ++ /* dataflow direction (VIRTIO_SND_D_XXX) */ ++ uint8_t direction; ++ /* # of valid channel position values */ ++ uint8_t channels; ++ /* channel position values (VIRTIO_SND_CHMAP_XXX) */ ++ uint8_t positions[VIRTIO_SND_CHMAP_MAX_SIZE]; ++}; ++ ++#endif /* VIRTIO_SND_IF_H */ +diff --git a/include/standard-headers/rdma/vmw_pvrdma-abi.h b/include/standard-headers/rdma/vmw_pvrdma-abi.h +index 0989426a3f..c30182a7ae 100644 +--- a/include/standard-headers/rdma/vmw_pvrdma-abi.h ++++ b/include/standard-headers/rdma/vmw_pvrdma-abi.h +@@ -133,6 +133,13 @@ enum pvrdma_wc_flags { + PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE, + }; + ++enum pvrdma_network_type { ++ PVRDMA_NETWORK_IB, ++ PVRDMA_NETWORK_ROCE_V1 = PVRDMA_NETWORK_IB, ++ PVRDMA_NETWORK_IPV4, ++ PVRDMA_NETWORK_IPV6 ++}; ++ + struct pvrdma_alloc_ucontext_resp { + uint32_t qp_tab_size; + uint32_t reserved; +diff --git a/linux-headers/asm-generic/unistd.h b/linux-headers/asm-generic/unistd.h +index 7287529177..6de5a7fc06 100644 +--- a/linux-headers/asm-generic/unistd.h ++++ b/linux-headers/asm-generic/unistd.h +@@ -861,9 +861,20 @@ __SYSCALL(__NR_faccessat2, sys_faccessat2) + __SYSCALL(__NR_process_madvise, sys_process_madvise) + #define __NR_epoll_pwait2 441 + __SC_COMP(__NR_epoll_pwait2, sys_epoll_pwait2, compat_sys_epoll_pwait2) ++#define __NR_mount_setattr 442 ++__SYSCALL(__NR_mount_setattr, sys_mount_setattr) ++#define __NR_quotactl_path 443 ++__SYSCALL(__NR_quotactl_path, sys_quotactl_path) ++ ++#define __NR_landlock_create_ruleset 444 ++__SYSCALL(__NR_landlock_create_ruleset, sys_landlock_create_ruleset) ++#define __NR_landlock_add_rule 445 ++__SYSCALL(__NR_landlock_add_rule, sys_landlock_add_rule) ++#define __NR_landlock_restrict_self 446 ++__SYSCALL(__NR_landlock_restrict_self, sys_landlock_restrict_self) + + #undef __NR_syscalls +-#define __NR_syscalls 442 ++#define __NR_syscalls 447 + + /* + * 32 bit systems traditionally used different +diff --git a/linux-headers/asm-mips/unistd_n32.h b/linux-headers/asm-mips/unistd_n32.h +index 59e53b6e07..fce51fee09 100644 +--- a/linux-headers/asm-mips/unistd_n32.h ++++ b/linux-headers/asm-mips/unistd_n32.h +@@ -1,376 +1,379 @@ +-#ifndef _ASM_MIPS_UNISTD_N32_H +-#define _ASM_MIPS_UNISTD_N32_H ++#ifndef _ASM_UNISTD_N32_H ++#define _ASM_UNISTD_N32_H + +-#define __NR_read (__NR_Linux + 0) +-#define __NR_write (__NR_Linux + 1) +-#define __NR_open (__NR_Linux + 2) +-#define __NR_close (__NR_Linux + 3) +-#define __NR_stat (__NR_Linux + 4) +-#define __NR_fstat (__NR_Linux + 5) +-#define __NR_lstat (__NR_Linux + 6) +-#define __NR_poll (__NR_Linux + 7) +-#define __NR_lseek (__NR_Linux + 8) +-#define __NR_mmap (__NR_Linux + 9) +-#define __NR_mprotect (__NR_Linux + 10) +-#define __NR_munmap (__NR_Linux + 11) +-#define __NR_brk (__NR_Linux + 12) +-#define __NR_rt_sigaction (__NR_Linux + 13) +-#define __NR_rt_sigprocmask (__NR_Linux + 14) +-#define __NR_ioctl (__NR_Linux + 15) +-#define __NR_pread64 (__NR_Linux + 16) +-#define __NR_pwrite64 (__NR_Linux + 17) +-#define __NR_readv (__NR_Linux + 18) +-#define __NR_writev (__NR_Linux + 19) +-#define __NR_access (__NR_Linux + 20) +-#define __NR_pipe (__NR_Linux + 21) +-#define __NR__newselect (__NR_Linux + 22) +-#define __NR_sched_yield (__NR_Linux + 23) +-#define __NR_mremap (__NR_Linux + 24) +-#define __NR_msync (__NR_Linux + 25) +-#define __NR_mincore (__NR_Linux + 26) +-#define __NR_madvise (__NR_Linux + 27) +-#define __NR_shmget (__NR_Linux + 28) +-#define __NR_shmat (__NR_Linux + 29) +-#define __NR_shmctl (__NR_Linux + 30) +-#define __NR_dup (__NR_Linux + 31) +-#define __NR_dup2 (__NR_Linux + 32) +-#define __NR_pause (__NR_Linux + 33) +-#define __NR_nanosleep (__NR_Linux + 34) +-#define __NR_getitimer (__NR_Linux + 35) +-#define __NR_setitimer (__NR_Linux + 36) +-#define __NR_alarm (__NR_Linux + 37) +-#define __NR_getpid (__NR_Linux + 38) +-#define __NR_sendfile (__NR_Linux + 39) +-#define __NR_socket (__NR_Linux + 40) +-#define __NR_connect (__NR_Linux + 41) +-#define __NR_accept (__NR_Linux + 42) +-#define __NR_sendto (__NR_Linux + 43) +-#define __NR_recvfrom (__NR_Linux + 44) +-#define __NR_sendmsg (__NR_Linux + 45) +-#define __NR_recvmsg (__NR_Linux + 46) +-#define __NR_shutdown (__NR_Linux + 47) +-#define __NR_bind (__NR_Linux + 48) +-#define __NR_listen (__NR_Linux + 49) +-#define __NR_getsockname (__NR_Linux + 50) +-#define __NR_getpeername (__NR_Linux + 51) +-#define __NR_socketpair (__NR_Linux + 52) +-#define __NR_setsockopt (__NR_Linux + 53) +-#define __NR_getsockopt (__NR_Linux + 54) +-#define __NR_clone (__NR_Linux + 55) +-#define __NR_fork (__NR_Linux + 56) +-#define __NR_execve (__NR_Linux + 57) +-#define __NR_exit (__NR_Linux + 58) +-#define __NR_wait4 (__NR_Linux + 59) +-#define __NR_kill (__NR_Linux + 60) +-#define __NR_uname (__NR_Linux + 61) +-#define __NR_semget (__NR_Linux + 62) +-#define __NR_semop (__NR_Linux + 63) +-#define __NR_semctl (__NR_Linux + 64) +-#define __NR_shmdt (__NR_Linux + 65) +-#define __NR_msgget (__NR_Linux + 66) +-#define __NR_msgsnd (__NR_Linux + 67) +-#define __NR_msgrcv (__NR_Linux + 68) +-#define __NR_msgctl (__NR_Linux + 69) +-#define __NR_fcntl (__NR_Linux + 70) +-#define __NR_flock (__NR_Linux + 71) +-#define __NR_fsync (__NR_Linux + 72) +-#define __NR_fdatasync (__NR_Linux + 73) +-#define __NR_truncate (__NR_Linux + 74) +-#define __NR_ftruncate (__NR_Linux + 75) +-#define __NR_getdents (__NR_Linux + 76) +-#define __NR_getcwd (__NR_Linux + 77) +-#define __NR_chdir (__NR_Linux + 78) +-#define __NR_fchdir (__NR_Linux + 79) +-#define __NR_rename (__NR_Linux + 80) +-#define __NR_mkdir (__NR_Linux + 81) +-#define __NR_rmdir (__NR_Linux + 82) +-#define __NR_creat (__NR_Linux + 83) +-#define __NR_link (__NR_Linux + 84) +-#define __NR_unlink (__NR_Linux + 85) +-#define __NR_symlink (__NR_Linux + 86) +-#define __NR_readlink (__NR_Linux + 87) +-#define __NR_chmod (__NR_Linux + 88) +-#define __NR_fchmod (__NR_Linux + 89) +-#define __NR_chown (__NR_Linux + 90) +-#define __NR_fchown (__NR_Linux + 91) +-#define __NR_lchown (__NR_Linux + 92) +-#define __NR_umask (__NR_Linux + 93) +-#define __NR_gettimeofday (__NR_Linux + 94) +-#define __NR_getrlimit (__NR_Linux + 95) +-#define __NR_getrusage (__NR_Linux + 96) +-#define __NR_sysinfo (__NR_Linux + 97) +-#define __NR_times (__NR_Linux + 98) +-#define __NR_ptrace (__NR_Linux + 99) +-#define __NR_getuid (__NR_Linux + 100) +-#define __NR_syslog (__NR_Linux + 101) +-#define __NR_getgid (__NR_Linux + 102) +-#define __NR_setuid (__NR_Linux + 103) +-#define __NR_setgid (__NR_Linux + 104) +-#define __NR_geteuid (__NR_Linux + 105) +-#define __NR_getegid (__NR_Linux + 106) +-#define __NR_setpgid (__NR_Linux + 107) +-#define __NR_getppid (__NR_Linux + 108) +-#define __NR_getpgrp (__NR_Linux + 109) +-#define __NR_setsid (__NR_Linux + 110) +-#define __NR_setreuid (__NR_Linux + 111) +-#define __NR_setregid (__NR_Linux + 112) +-#define __NR_getgroups (__NR_Linux + 113) +-#define __NR_setgroups (__NR_Linux + 114) +-#define __NR_setresuid (__NR_Linux + 115) +-#define __NR_getresuid (__NR_Linux + 116) +-#define __NR_setresgid (__NR_Linux + 117) +-#define __NR_getresgid (__NR_Linux + 118) +-#define __NR_getpgid (__NR_Linux + 119) +-#define __NR_setfsuid (__NR_Linux + 120) +-#define __NR_setfsgid (__NR_Linux + 121) +-#define __NR_getsid (__NR_Linux + 122) +-#define __NR_capget (__NR_Linux + 123) +-#define __NR_capset (__NR_Linux + 124) +-#define __NR_rt_sigpending (__NR_Linux + 125) +-#define __NR_rt_sigtimedwait (__NR_Linux + 126) +-#define __NR_rt_sigqueueinfo (__NR_Linux + 127) +-#define __NR_rt_sigsuspend (__NR_Linux + 128) +-#define __NR_sigaltstack (__NR_Linux + 129) +-#define __NR_utime (__NR_Linux + 130) +-#define __NR_mknod (__NR_Linux + 131) +-#define __NR_personality (__NR_Linux + 132) +-#define __NR_ustat (__NR_Linux + 133) +-#define __NR_statfs (__NR_Linux + 134) +-#define __NR_fstatfs (__NR_Linux + 135) +-#define __NR_sysfs (__NR_Linux + 136) +-#define __NR_getpriority (__NR_Linux + 137) +-#define __NR_setpriority (__NR_Linux + 138) +-#define __NR_sched_setparam (__NR_Linux + 139) +-#define __NR_sched_getparam (__NR_Linux + 140) +-#define __NR_sched_setscheduler (__NR_Linux + 141) +-#define __NR_sched_getscheduler (__NR_Linux + 142) +-#define __NR_sched_get_priority_max (__NR_Linux + 143) +-#define __NR_sched_get_priority_min (__NR_Linux + 144) +-#define __NR_sched_rr_get_interval (__NR_Linux + 145) +-#define __NR_mlock (__NR_Linux + 146) +-#define __NR_munlock (__NR_Linux + 147) +-#define __NR_mlockall (__NR_Linux + 148) +-#define __NR_munlockall (__NR_Linux + 149) +-#define __NR_vhangup (__NR_Linux + 150) +-#define __NR_pivot_root (__NR_Linux + 151) +-#define __NR__sysctl (__NR_Linux + 152) +-#define __NR_prctl (__NR_Linux + 153) +-#define __NR_adjtimex (__NR_Linux + 154) +-#define __NR_setrlimit (__NR_Linux + 155) +-#define __NR_chroot (__NR_Linux + 156) +-#define __NR_sync (__NR_Linux + 157) +-#define __NR_acct (__NR_Linux + 158) +-#define __NR_settimeofday (__NR_Linux + 159) +-#define __NR_mount (__NR_Linux + 160) +-#define __NR_umount2 (__NR_Linux + 161) +-#define __NR_swapon (__NR_Linux + 162) +-#define __NR_swapoff (__NR_Linux + 163) +-#define __NR_reboot (__NR_Linux + 164) +-#define __NR_sethostname (__NR_Linux + 165) +-#define __NR_setdomainname (__NR_Linux + 166) +-#define __NR_create_module (__NR_Linux + 167) +-#define __NR_init_module (__NR_Linux + 168) +-#define __NR_delete_module (__NR_Linux + 169) +-#define __NR_get_kernel_syms (__NR_Linux + 170) +-#define __NR_query_module (__NR_Linux + 171) +-#define __NR_quotactl (__NR_Linux + 172) +-#define __NR_nfsservctl (__NR_Linux + 173) +-#define __NR_getpmsg (__NR_Linux + 174) +-#define __NR_putpmsg (__NR_Linux + 175) +-#define __NR_afs_syscall (__NR_Linux + 176) +-#define __NR_reserved177 (__NR_Linux + 177) +-#define __NR_gettid (__NR_Linux + 178) +-#define __NR_readahead (__NR_Linux + 179) +-#define __NR_setxattr (__NR_Linux + 180) +-#define __NR_lsetxattr (__NR_Linux + 181) +-#define __NR_fsetxattr (__NR_Linux + 182) +-#define __NR_getxattr (__NR_Linux + 183) +-#define __NR_lgetxattr (__NR_Linux + 184) +-#define __NR_fgetxattr (__NR_Linux + 185) +-#define __NR_listxattr (__NR_Linux + 186) +-#define __NR_llistxattr (__NR_Linux + 187) +-#define __NR_flistxattr (__NR_Linux + 188) +-#define __NR_removexattr (__NR_Linux + 189) +-#define __NR_lremovexattr (__NR_Linux + 190) +-#define __NR_fremovexattr (__NR_Linux + 191) +-#define __NR_tkill (__NR_Linux + 192) +-#define __NR_reserved193 (__NR_Linux + 193) +-#define __NR_futex (__NR_Linux + 194) +-#define __NR_sched_setaffinity (__NR_Linux + 195) +-#define __NR_sched_getaffinity (__NR_Linux + 196) +-#define __NR_cacheflush (__NR_Linux + 197) +-#define __NR_cachectl (__NR_Linux + 198) +-#define __NR_sysmips (__NR_Linux + 199) +-#define __NR_io_setup (__NR_Linux + 200) +-#define __NR_io_destroy (__NR_Linux + 201) +-#define __NR_io_getevents (__NR_Linux + 202) +-#define __NR_io_submit (__NR_Linux + 203) +-#define __NR_io_cancel (__NR_Linux + 204) +-#define __NR_exit_group (__NR_Linux + 205) +-#define __NR_lookup_dcookie (__NR_Linux + 206) +-#define __NR_epoll_create (__NR_Linux + 207) +-#define __NR_epoll_ctl (__NR_Linux + 208) +-#define __NR_epoll_wait (__NR_Linux + 209) +-#define __NR_remap_file_pages (__NR_Linux + 210) +-#define __NR_rt_sigreturn (__NR_Linux + 211) +-#define __NR_fcntl64 (__NR_Linux + 212) +-#define __NR_set_tid_address (__NR_Linux + 213) +-#define __NR_restart_syscall (__NR_Linux + 214) +-#define __NR_semtimedop (__NR_Linux + 215) +-#define __NR_fadvise64 (__NR_Linux + 216) +-#define __NR_statfs64 (__NR_Linux + 217) +-#define __NR_fstatfs64 (__NR_Linux + 218) +-#define __NR_sendfile64 (__NR_Linux + 219) +-#define __NR_timer_create (__NR_Linux + 220) +-#define __NR_timer_settime (__NR_Linux + 221) +-#define __NR_timer_gettime (__NR_Linux + 222) +-#define __NR_timer_getoverrun (__NR_Linux + 223) +-#define __NR_timer_delete (__NR_Linux + 224) +-#define __NR_clock_settime (__NR_Linux + 225) +-#define __NR_clock_gettime (__NR_Linux + 226) +-#define __NR_clock_getres (__NR_Linux + 227) +-#define __NR_clock_nanosleep (__NR_Linux + 228) +-#define __NR_tgkill (__NR_Linux + 229) +-#define __NR_utimes (__NR_Linux + 230) +-#define __NR_mbind (__NR_Linux + 231) +-#define __NR_get_mempolicy (__NR_Linux + 232) +-#define __NR_set_mempolicy (__NR_Linux + 233) +-#define __NR_mq_open (__NR_Linux + 234) +-#define __NR_mq_unlink (__NR_Linux + 235) +-#define __NR_mq_timedsend (__NR_Linux + 236) +-#define __NR_mq_timedreceive (__NR_Linux + 237) +-#define __NR_mq_notify (__NR_Linux + 238) +-#define __NR_mq_getsetattr (__NR_Linux + 239) +-#define __NR_vserver (__NR_Linux + 240) +-#define __NR_waitid (__NR_Linux + 241) +-#define __NR_add_key (__NR_Linux + 243) +-#define __NR_request_key (__NR_Linux + 244) +-#define __NR_keyctl (__NR_Linux + 245) +-#define __NR_set_thread_area (__NR_Linux + 246) +-#define __NR_inotify_init (__NR_Linux + 247) +-#define __NR_inotify_add_watch (__NR_Linux + 248) +-#define __NR_inotify_rm_watch (__NR_Linux + 249) +-#define __NR_migrate_pages (__NR_Linux + 250) +-#define __NR_openat (__NR_Linux + 251) +-#define __NR_mkdirat (__NR_Linux + 252) +-#define __NR_mknodat (__NR_Linux + 253) +-#define __NR_fchownat (__NR_Linux + 254) +-#define __NR_futimesat (__NR_Linux + 255) +-#define __NR_newfstatat (__NR_Linux + 256) +-#define __NR_unlinkat (__NR_Linux + 257) +-#define __NR_renameat (__NR_Linux + 258) +-#define __NR_linkat (__NR_Linux + 259) +-#define __NR_symlinkat (__NR_Linux + 260) +-#define __NR_readlinkat (__NR_Linux + 261) +-#define __NR_fchmodat (__NR_Linux + 262) +-#define __NR_faccessat (__NR_Linux + 263) +-#define __NR_pselect6 (__NR_Linux + 264) +-#define __NR_ppoll (__NR_Linux + 265) +-#define __NR_unshare (__NR_Linux + 266) +-#define __NR_splice (__NR_Linux + 267) +-#define __NR_sync_file_range (__NR_Linux + 268) +-#define __NR_tee (__NR_Linux + 269) +-#define __NR_vmsplice (__NR_Linux + 270) +-#define __NR_move_pages (__NR_Linux + 271) +-#define __NR_set_robust_list (__NR_Linux + 272) +-#define __NR_get_robust_list (__NR_Linux + 273) +-#define __NR_kexec_load (__NR_Linux + 274) +-#define __NR_getcpu (__NR_Linux + 275) +-#define __NR_epoll_pwait (__NR_Linux + 276) +-#define __NR_ioprio_set (__NR_Linux + 277) +-#define __NR_ioprio_get (__NR_Linux + 278) +-#define __NR_utimensat (__NR_Linux + 279) +-#define __NR_signalfd (__NR_Linux + 280) +-#define __NR_timerfd (__NR_Linux + 281) +-#define __NR_eventfd (__NR_Linux + 282) +-#define __NR_fallocate (__NR_Linux + 283) +-#define __NR_timerfd_create (__NR_Linux + 284) +-#define __NR_timerfd_gettime (__NR_Linux + 285) +-#define __NR_timerfd_settime (__NR_Linux + 286) +-#define __NR_signalfd4 (__NR_Linux + 287) +-#define __NR_eventfd2 (__NR_Linux + 288) +-#define __NR_epoll_create1 (__NR_Linux + 289) +-#define __NR_dup3 (__NR_Linux + 290) +-#define __NR_pipe2 (__NR_Linux + 291) +-#define __NR_inotify_init1 (__NR_Linux + 292) +-#define __NR_preadv (__NR_Linux + 293) +-#define __NR_pwritev (__NR_Linux + 294) +-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295) +-#define __NR_perf_event_open (__NR_Linux + 296) +-#define __NR_accept4 (__NR_Linux + 297) +-#define __NR_recvmmsg (__NR_Linux + 298) +-#define __NR_getdents64 (__NR_Linux + 299) +-#define __NR_fanotify_init (__NR_Linux + 300) +-#define __NR_fanotify_mark (__NR_Linux + 301) +-#define __NR_prlimit64 (__NR_Linux + 302) +-#define __NR_name_to_handle_at (__NR_Linux + 303) +-#define __NR_open_by_handle_at (__NR_Linux + 304) +-#define __NR_clock_adjtime (__NR_Linux + 305) +-#define __NR_syncfs (__NR_Linux + 306) +-#define __NR_sendmmsg (__NR_Linux + 307) +-#define __NR_setns (__NR_Linux + 308) +-#define __NR_process_vm_readv (__NR_Linux + 309) +-#define __NR_process_vm_writev (__NR_Linux + 310) +-#define __NR_kcmp (__NR_Linux + 311) +-#define __NR_finit_module (__NR_Linux + 312) +-#define __NR_sched_setattr (__NR_Linux + 313) +-#define __NR_sched_getattr (__NR_Linux + 314) +-#define __NR_renameat2 (__NR_Linux + 315) +-#define __NR_seccomp (__NR_Linux + 316) +-#define __NR_getrandom (__NR_Linux + 317) +-#define __NR_memfd_create (__NR_Linux + 318) +-#define __NR_bpf (__NR_Linux + 319) +-#define __NR_execveat (__NR_Linux + 320) +-#define __NR_userfaultfd (__NR_Linux + 321) +-#define __NR_membarrier (__NR_Linux + 322) +-#define __NR_mlock2 (__NR_Linux + 323) +-#define __NR_copy_file_range (__NR_Linux + 324) +-#define __NR_preadv2 (__NR_Linux + 325) +-#define __NR_pwritev2 (__NR_Linux + 326) +-#define __NR_pkey_mprotect (__NR_Linux + 327) +-#define __NR_pkey_alloc (__NR_Linux + 328) +-#define __NR_pkey_free (__NR_Linux + 329) +-#define __NR_statx (__NR_Linux + 330) +-#define __NR_rseq (__NR_Linux + 331) +-#define __NR_io_pgetevents (__NR_Linux + 332) +-#define __NR_clock_gettime64 (__NR_Linux + 403) +-#define __NR_clock_settime64 (__NR_Linux + 404) +-#define __NR_clock_adjtime64 (__NR_Linux + 405) +-#define __NR_clock_getres_time64 (__NR_Linux + 406) +-#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +-#define __NR_timer_gettime64 (__NR_Linux + 408) +-#define __NR_timer_settime64 (__NR_Linux + 409) +-#define __NR_timerfd_gettime64 (__NR_Linux + 410) +-#define __NR_timerfd_settime64 (__NR_Linux + 411) +-#define __NR_utimensat_time64 (__NR_Linux + 412) +-#define __NR_pselect6_time64 (__NR_Linux + 413) +-#define __NR_ppoll_time64 (__NR_Linux + 414) +-#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +-#define __NR_recvmmsg_time64 (__NR_Linux + 417) +-#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +-#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +-#define __NR_semtimedop_time64 (__NR_Linux + 420) +-#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +-#define __NR_futex_time64 (__NR_Linux + 422) +-#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +-#define __NR_pidfd_send_signal (__NR_Linux + 424) +-#define __NR_io_uring_setup (__NR_Linux + 425) +-#define __NR_io_uring_enter (__NR_Linux + 426) +-#define __NR_io_uring_register (__NR_Linux + 427) +-#define __NR_open_tree (__NR_Linux + 428) +-#define __NR_move_mount (__NR_Linux + 429) +-#define __NR_fsopen (__NR_Linux + 430) +-#define __NR_fsconfig (__NR_Linux + 431) +-#define __NR_fsmount (__NR_Linux + 432) +-#define __NR_fspick (__NR_Linux + 433) +-#define __NR_pidfd_open (__NR_Linux + 434) +-#define __NR_clone3 (__NR_Linux + 435) +-#define __NR_close_range (__NR_Linux + 436) +-#define __NR_openat2 (__NR_Linux + 437) +-#define __NR_pidfd_getfd (__NR_Linux + 438) +-#define __NR_faccessat2 (__NR_Linux + 439) +-#define __NR_process_madvise (__NR_Linux + 440) +-#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_read (__NR_Linux + 0) ++#define __NR_write (__NR_Linux + 1) ++#define __NR_open (__NR_Linux + 2) ++#define __NR_close (__NR_Linux + 3) ++#define __NR_stat (__NR_Linux + 4) ++#define __NR_fstat (__NR_Linux + 5) ++#define __NR_lstat (__NR_Linux + 6) ++#define __NR_poll (__NR_Linux + 7) ++#define __NR_lseek (__NR_Linux + 8) ++#define __NR_mmap (__NR_Linux + 9) ++#define __NR_mprotect (__NR_Linux + 10) ++#define __NR_munmap (__NR_Linux + 11) ++#define __NR_brk (__NR_Linux + 12) ++#define __NR_rt_sigaction (__NR_Linux + 13) ++#define __NR_rt_sigprocmask (__NR_Linux + 14) ++#define __NR_ioctl (__NR_Linux + 15) ++#define __NR_pread64 (__NR_Linux + 16) ++#define __NR_pwrite64 (__NR_Linux + 17) ++#define __NR_readv (__NR_Linux + 18) ++#define __NR_writev (__NR_Linux + 19) ++#define __NR_access (__NR_Linux + 20) ++#define __NR_pipe (__NR_Linux + 21) ++#define __NR__newselect (__NR_Linux + 22) ++#define __NR_sched_yield (__NR_Linux + 23) ++#define __NR_mremap (__NR_Linux + 24) ++#define __NR_msync (__NR_Linux + 25) ++#define __NR_mincore (__NR_Linux + 26) ++#define __NR_madvise (__NR_Linux + 27) ++#define __NR_shmget (__NR_Linux + 28) ++#define __NR_shmat (__NR_Linux + 29) ++#define __NR_shmctl (__NR_Linux + 30) ++#define __NR_dup (__NR_Linux + 31) ++#define __NR_dup2 (__NR_Linux + 32) ++#define __NR_pause (__NR_Linux + 33) ++#define __NR_nanosleep (__NR_Linux + 34) ++#define __NR_getitimer (__NR_Linux + 35) ++#define __NR_setitimer (__NR_Linux + 36) ++#define __NR_alarm (__NR_Linux + 37) ++#define __NR_getpid (__NR_Linux + 38) ++#define __NR_sendfile (__NR_Linux + 39) ++#define __NR_socket (__NR_Linux + 40) ++#define __NR_connect (__NR_Linux + 41) ++#define __NR_accept (__NR_Linux + 42) ++#define __NR_sendto (__NR_Linux + 43) ++#define __NR_recvfrom (__NR_Linux + 44) ++#define __NR_sendmsg (__NR_Linux + 45) ++#define __NR_recvmsg (__NR_Linux + 46) ++#define __NR_shutdown (__NR_Linux + 47) ++#define __NR_bind (__NR_Linux + 48) ++#define __NR_listen (__NR_Linux + 49) ++#define __NR_getsockname (__NR_Linux + 50) ++#define __NR_getpeername (__NR_Linux + 51) ++#define __NR_socketpair (__NR_Linux + 52) ++#define __NR_setsockopt (__NR_Linux + 53) ++#define __NR_getsockopt (__NR_Linux + 54) ++#define __NR_clone (__NR_Linux + 55) ++#define __NR_fork (__NR_Linux + 56) ++#define __NR_execve (__NR_Linux + 57) ++#define __NR_exit (__NR_Linux + 58) ++#define __NR_wait4 (__NR_Linux + 59) ++#define __NR_kill (__NR_Linux + 60) ++#define __NR_uname (__NR_Linux + 61) ++#define __NR_semget (__NR_Linux + 62) ++#define __NR_semop (__NR_Linux + 63) ++#define __NR_semctl (__NR_Linux + 64) ++#define __NR_shmdt (__NR_Linux + 65) ++#define __NR_msgget (__NR_Linux + 66) ++#define __NR_msgsnd (__NR_Linux + 67) ++#define __NR_msgrcv (__NR_Linux + 68) ++#define __NR_msgctl (__NR_Linux + 69) ++#define __NR_fcntl (__NR_Linux + 70) ++#define __NR_flock (__NR_Linux + 71) ++#define __NR_fsync (__NR_Linux + 72) ++#define __NR_fdatasync (__NR_Linux + 73) ++#define __NR_truncate (__NR_Linux + 74) ++#define __NR_ftruncate (__NR_Linux + 75) ++#define __NR_getdents (__NR_Linux + 76) ++#define __NR_getcwd (__NR_Linux + 77) ++#define __NR_chdir (__NR_Linux + 78) ++#define __NR_fchdir (__NR_Linux + 79) ++#define __NR_rename (__NR_Linux + 80) ++#define __NR_mkdir (__NR_Linux + 81) ++#define __NR_rmdir (__NR_Linux + 82) ++#define __NR_creat (__NR_Linux + 83) ++#define __NR_link (__NR_Linux + 84) ++#define __NR_unlink (__NR_Linux + 85) ++#define __NR_symlink (__NR_Linux + 86) ++#define __NR_readlink (__NR_Linux + 87) ++#define __NR_chmod (__NR_Linux + 88) ++#define __NR_fchmod (__NR_Linux + 89) ++#define __NR_chown (__NR_Linux + 90) ++#define __NR_fchown (__NR_Linux + 91) ++#define __NR_lchown (__NR_Linux + 92) ++#define __NR_umask (__NR_Linux + 93) ++#define __NR_gettimeofday (__NR_Linux + 94) ++#define __NR_getrlimit (__NR_Linux + 95) ++#define __NR_getrusage (__NR_Linux + 96) ++#define __NR_sysinfo (__NR_Linux + 97) ++#define __NR_times (__NR_Linux + 98) ++#define __NR_ptrace (__NR_Linux + 99) ++#define __NR_getuid (__NR_Linux + 100) ++#define __NR_syslog (__NR_Linux + 101) ++#define __NR_getgid (__NR_Linux + 102) ++#define __NR_setuid (__NR_Linux + 103) ++#define __NR_setgid (__NR_Linux + 104) ++#define __NR_geteuid (__NR_Linux + 105) ++#define __NR_getegid (__NR_Linux + 106) ++#define __NR_setpgid (__NR_Linux + 107) ++#define __NR_getppid (__NR_Linux + 108) ++#define __NR_getpgrp (__NR_Linux + 109) ++#define __NR_setsid (__NR_Linux + 110) ++#define __NR_setreuid (__NR_Linux + 111) ++#define __NR_setregid (__NR_Linux + 112) ++#define __NR_getgroups (__NR_Linux + 113) ++#define __NR_setgroups (__NR_Linux + 114) ++#define __NR_setresuid (__NR_Linux + 115) ++#define __NR_getresuid (__NR_Linux + 116) ++#define __NR_setresgid (__NR_Linux + 117) ++#define __NR_getresgid (__NR_Linux + 118) ++#define __NR_getpgid (__NR_Linux + 119) ++#define __NR_setfsuid (__NR_Linux + 120) ++#define __NR_setfsgid (__NR_Linux + 121) ++#define __NR_getsid (__NR_Linux + 122) ++#define __NR_capget (__NR_Linux + 123) ++#define __NR_capset (__NR_Linux + 124) ++#define __NR_rt_sigpending (__NR_Linux + 125) ++#define __NR_rt_sigtimedwait (__NR_Linux + 126) ++#define __NR_rt_sigqueueinfo (__NR_Linux + 127) ++#define __NR_rt_sigsuspend (__NR_Linux + 128) ++#define __NR_sigaltstack (__NR_Linux + 129) ++#define __NR_utime (__NR_Linux + 130) ++#define __NR_mknod (__NR_Linux + 131) ++#define __NR_personality (__NR_Linux + 132) ++#define __NR_ustat (__NR_Linux + 133) ++#define __NR_statfs (__NR_Linux + 134) ++#define __NR_fstatfs (__NR_Linux + 135) ++#define __NR_sysfs (__NR_Linux + 136) ++#define __NR_getpriority (__NR_Linux + 137) ++#define __NR_setpriority (__NR_Linux + 138) ++#define __NR_sched_setparam (__NR_Linux + 139) ++#define __NR_sched_getparam (__NR_Linux + 140) ++#define __NR_sched_setscheduler (__NR_Linux + 141) ++#define __NR_sched_getscheduler (__NR_Linux + 142) ++#define __NR_sched_get_priority_max (__NR_Linux + 143) ++#define __NR_sched_get_priority_min (__NR_Linux + 144) ++#define __NR_sched_rr_get_interval (__NR_Linux + 145) ++#define __NR_mlock (__NR_Linux + 146) ++#define __NR_munlock (__NR_Linux + 147) ++#define __NR_mlockall (__NR_Linux + 148) ++#define __NR_munlockall (__NR_Linux + 149) ++#define __NR_vhangup (__NR_Linux + 150) ++#define __NR_pivot_root (__NR_Linux + 151) ++#define __NR__sysctl (__NR_Linux + 152) ++#define __NR_prctl (__NR_Linux + 153) ++#define __NR_adjtimex (__NR_Linux + 154) ++#define __NR_setrlimit (__NR_Linux + 155) ++#define __NR_chroot (__NR_Linux + 156) ++#define __NR_sync (__NR_Linux + 157) ++#define __NR_acct (__NR_Linux + 158) ++#define __NR_settimeofday (__NR_Linux + 159) ++#define __NR_mount (__NR_Linux + 160) ++#define __NR_umount2 (__NR_Linux + 161) ++#define __NR_swapon (__NR_Linux + 162) ++#define __NR_swapoff (__NR_Linux + 163) ++#define __NR_reboot (__NR_Linux + 164) ++#define __NR_sethostname (__NR_Linux + 165) ++#define __NR_setdomainname (__NR_Linux + 166) ++#define __NR_create_module (__NR_Linux + 167) ++#define __NR_init_module (__NR_Linux + 168) ++#define __NR_delete_module (__NR_Linux + 169) ++#define __NR_get_kernel_syms (__NR_Linux + 170) ++#define __NR_query_module (__NR_Linux + 171) ++#define __NR_quotactl (__NR_Linux + 172) ++#define __NR_nfsservctl (__NR_Linux + 173) ++#define __NR_getpmsg (__NR_Linux + 174) ++#define __NR_putpmsg (__NR_Linux + 175) ++#define __NR_afs_syscall (__NR_Linux + 176) ++#define __NR_reserved177 (__NR_Linux + 177) ++#define __NR_gettid (__NR_Linux + 178) ++#define __NR_readahead (__NR_Linux + 179) ++#define __NR_setxattr (__NR_Linux + 180) ++#define __NR_lsetxattr (__NR_Linux + 181) ++#define __NR_fsetxattr (__NR_Linux + 182) ++#define __NR_getxattr (__NR_Linux + 183) ++#define __NR_lgetxattr (__NR_Linux + 184) ++#define __NR_fgetxattr (__NR_Linux + 185) ++#define __NR_listxattr (__NR_Linux + 186) ++#define __NR_llistxattr (__NR_Linux + 187) ++#define __NR_flistxattr (__NR_Linux + 188) ++#define __NR_removexattr (__NR_Linux + 189) ++#define __NR_lremovexattr (__NR_Linux + 190) ++#define __NR_fremovexattr (__NR_Linux + 191) ++#define __NR_tkill (__NR_Linux + 192) ++#define __NR_reserved193 (__NR_Linux + 193) ++#define __NR_futex (__NR_Linux + 194) ++#define __NR_sched_setaffinity (__NR_Linux + 195) ++#define __NR_sched_getaffinity (__NR_Linux + 196) ++#define __NR_cacheflush (__NR_Linux + 197) ++#define __NR_cachectl (__NR_Linux + 198) ++#define __NR_sysmips (__NR_Linux + 199) ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#define __NR_exit_group (__NR_Linux + 205) ++#define __NR_lookup_dcookie (__NR_Linux + 206) ++#define __NR_epoll_create (__NR_Linux + 207) ++#define __NR_epoll_ctl (__NR_Linux + 208) ++#define __NR_epoll_wait (__NR_Linux + 209) ++#define __NR_remap_file_pages (__NR_Linux + 210) ++#define __NR_rt_sigreturn (__NR_Linux + 211) ++#define __NR_fcntl64 (__NR_Linux + 212) ++#define __NR_set_tid_address (__NR_Linux + 213) ++#define __NR_restart_syscall (__NR_Linux + 214) ++#define __NR_semtimedop (__NR_Linux + 215) ++#define __NR_fadvise64 (__NR_Linux + 216) ++#define __NR_statfs64 (__NR_Linux + 217) ++#define __NR_fstatfs64 (__NR_Linux + 218) ++#define __NR_sendfile64 (__NR_Linux + 219) ++#define __NR_timer_create (__NR_Linux + 220) ++#define __NR_timer_settime (__NR_Linux + 221) ++#define __NR_timer_gettime (__NR_Linux + 222) ++#define __NR_timer_getoverrun (__NR_Linux + 223) ++#define __NR_timer_delete (__NR_Linux + 224) ++#define __NR_clock_settime (__NR_Linux + 225) ++#define __NR_clock_gettime (__NR_Linux + 226) ++#define __NR_clock_getres (__NR_Linux + 227) ++#define __NR_clock_nanosleep (__NR_Linux + 228) ++#define __NR_tgkill (__NR_Linux + 229) ++#define __NR_utimes (__NR_Linux + 230) ++#define __NR_mbind (__NR_Linux + 231) ++#define __NR_get_mempolicy (__NR_Linux + 232) ++#define __NR_set_mempolicy (__NR_Linux + 233) ++#define __NR_mq_open (__NR_Linux + 234) ++#define __NR_mq_unlink (__NR_Linux + 235) ++#define __NR_mq_timedsend (__NR_Linux + 236) ++#define __NR_mq_timedreceive (__NR_Linux + 237) ++#define __NR_mq_notify (__NR_Linux + 238) ++#define __NR_mq_getsetattr (__NR_Linux + 239) ++#define __NR_vserver (__NR_Linux + 240) ++#define __NR_waitid (__NR_Linux + 241) ++#define __NR_add_key (__NR_Linux + 243) ++#define __NR_request_key (__NR_Linux + 244) ++#define __NR_keyctl (__NR_Linux + 245) ++#define __NR_set_thread_area (__NR_Linux + 246) ++#define __NR_inotify_init (__NR_Linux + 247) ++#define __NR_inotify_add_watch (__NR_Linux + 248) ++#define __NR_inotify_rm_watch (__NR_Linux + 249) ++#define __NR_migrate_pages (__NR_Linux + 250) ++#define __NR_openat (__NR_Linux + 251) ++#define __NR_mkdirat (__NR_Linux + 252) ++#define __NR_mknodat (__NR_Linux + 253) ++#define __NR_fchownat (__NR_Linux + 254) ++#define __NR_futimesat (__NR_Linux + 255) ++#define __NR_newfstatat (__NR_Linux + 256) ++#define __NR_unlinkat (__NR_Linux + 257) ++#define __NR_renameat (__NR_Linux + 258) ++#define __NR_linkat (__NR_Linux + 259) ++#define __NR_symlinkat (__NR_Linux + 260) ++#define __NR_readlinkat (__NR_Linux + 261) ++#define __NR_fchmodat (__NR_Linux + 262) ++#define __NR_faccessat (__NR_Linux + 263) ++#define __NR_pselect6 (__NR_Linux + 264) ++#define __NR_ppoll (__NR_Linux + 265) ++#define __NR_unshare (__NR_Linux + 266) ++#define __NR_splice (__NR_Linux + 267) ++#define __NR_sync_file_range (__NR_Linux + 268) ++#define __NR_tee (__NR_Linux + 269) ++#define __NR_vmsplice (__NR_Linux + 270) ++#define __NR_move_pages (__NR_Linux + 271) ++#define __NR_set_robust_list (__NR_Linux + 272) ++#define __NR_get_robust_list (__NR_Linux + 273) ++#define __NR_kexec_load (__NR_Linux + 274) ++#define __NR_getcpu (__NR_Linux + 275) ++#define __NR_epoll_pwait (__NR_Linux + 276) ++#define __NR_ioprio_set (__NR_Linux + 277) ++#define __NR_ioprio_get (__NR_Linux + 278) ++#define __NR_utimensat (__NR_Linux + 279) ++#define __NR_signalfd (__NR_Linux + 280) ++#define __NR_timerfd (__NR_Linux + 281) ++#define __NR_eventfd (__NR_Linux + 282) ++#define __NR_fallocate (__NR_Linux + 283) ++#define __NR_timerfd_create (__NR_Linux + 284) ++#define __NR_timerfd_gettime (__NR_Linux + 285) ++#define __NR_timerfd_settime (__NR_Linux + 286) ++#define __NR_signalfd4 (__NR_Linux + 287) ++#define __NR_eventfd2 (__NR_Linux + 288) ++#define __NR_epoll_create1 (__NR_Linux + 289) ++#define __NR_dup3 (__NR_Linux + 290) ++#define __NR_pipe2 (__NR_Linux + 291) ++#define __NR_inotify_init1 (__NR_Linux + 292) ++#define __NR_preadv (__NR_Linux + 293) ++#define __NR_pwritev (__NR_Linux + 294) ++#define __NR_rt_tgsigqueueinfo (__NR_Linux + 295) ++#define __NR_perf_event_open (__NR_Linux + 296) ++#define __NR_accept4 (__NR_Linux + 297) ++#define __NR_recvmmsg (__NR_Linux + 298) ++#define __NR_getdents64 (__NR_Linux + 299) ++#define __NR_fanotify_init (__NR_Linux + 300) ++#define __NR_fanotify_mark (__NR_Linux + 301) ++#define __NR_prlimit64 (__NR_Linux + 302) ++#define __NR_name_to_handle_at (__NR_Linux + 303) ++#define __NR_open_by_handle_at (__NR_Linux + 304) ++#define __NR_clock_adjtime (__NR_Linux + 305) ++#define __NR_syncfs (__NR_Linux + 306) ++#define __NR_sendmmsg (__NR_Linux + 307) ++#define __NR_setns (__NR_Linux + 308) ++#define __NR_process_vm_readv (__NR_Linux + 309) ++#define __NR_process_vm_writev (__NR_Linux + 310) ++#define __NR_kcmp (__NR_Linux + 311) ++#define __NR_finit_module (__NR_Linux + 312) ++#define __NR_sched_setattr (__NR_Linux + 313) ++#define __NR_sched_getattr (__NR_Linux + 314) ++#define __NR_renameat2 (__NR_Linux + 315) ++#define __NR_seccomp (__NR_Linux + 316) ++#define __NR_getrandom (__NR_Linux + 317) ++#define __NR_memfd_create (__NR_Linux + 318) ++#define __NR_bpf (__NR_Linux + 319) ++#define __NR_execveat (__NR_Linux + 320) ++#define __NR_userfaultfd (__NR_Linux + 321) ++#define __NR_membarrier (__NR_Linux + 322) ++#define __NR_mlock2 (__NR_Linux + 323) ++#define __NR_copy_file_range (__NR_Linux + 324) ++#define __NR_preadv2 (__NR_Linux + 325) ++#define __NR_pwritev2 (__NR_Linux + 326) ++#define __NR_pkey_mprotect (__NR_Linux + 327) ++#define __NR_pkey_alloc (__NR_Linux + 328) ++#define __NR_pkey_free (__NR_Linux + 329) ++#define __NR_statx (__NR_Linux + 330) ++#define __NR_rseq (__NR_Linux + 331) ++#define __NR_io_pgetevents (__NR_Linux + 332) ++#define __NR_clock_gettime64 (__NR_Linux + 403) ++#define __NR_clock_settime64 (__NR_Linux + 404) ++#define __NR_clock_adjtime64 (__NR_Linux + 405) ++#define __NR_clock_getres_time64 (__NR_Linux + 406) ++#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) ++#define __NR_timer_gettime64 (__NR_Linux + 408) ++#define __NR_timer_settime64 (__NR_Linux + 409) ++#define __NR_timerfd_gettime64 (__NR_Linux + 410) ++#define __NR_timerfd_settime64 (__NR_Linux + 411) ++#define __NR_utimensat_time64 (__NR_Linux + 412) ++#define __NR_pselect6_time64 (__NR_Linux + 413) ++#define __NR_ppoll_time64 (__NR_Linux + 414) ++#define __NR_io_pgetevents_time64 (__NR_Linux + 416) ++#define __NR_recvmmsg_time64 (__NR_Linux + 417) ++#define __NR_mq_timedsend_time64 (__NR_Linux + 418) ++#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) ++#define __NR_semtimedop_time64 (__NR_Linux + 420) ++#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) ++#define __NR_futex_time64 (__NR_Linux + 422) ++#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) ++#define __NR_pidfd_send_signal (__NR_Linux + 424) ++#define __NR_io_uring_setup (__NR_Linux + 425) ++#define __NR_io_uring_enter (__NR_Linux + 426) ++#define __NR_io_uring_register (__NR_Linux + 427) ++#define __NR_open_tree (__NR_Linux + 428) ++#define __NR_move_mount (__NR_Linux + 429) ++#define __NR_fsopen (__NR_Linux + 430) ++#define __NR_fsconfig (__NR_Linux + 431) ++#define __NR_fsmount (__NR_Linux + 432) ++#define __NR_fspick (__NR_Linux + 433) ++#define __NR_pidfd_open (__NR_Linux + 434) ++#define __NR_clone3 (__NR_Linux + 435) ++#define __NR_close_range (__NR_Linux + 436) ++#define __NR_openat2 (__NR_Linux + 437) ++#define __NR_pidfd_getfd (__NR_Linux + 438) ++#define __NR_faccessat2 (__NR_Linux + 439) ++#define __NR_process_madvise (__NR_Linux + 440) ++#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_mount_setattr (__NR_Linux + 442) ++#define __NR_landlock_create_ruleset (__NR_Linux + 444) ++#define __NR_landlock_add_rule (__NR_Linux + 445) ++#define __NR_landlock_restrict_self (__NR_Linux + 446) + +- +-#endif /* _ASM_MIPS_UNISTD_N32_H */ ++#endif /* _ASM_UNISTD_N32_H */ +diff --git a/linux-headers/asm-mips/unistd_n64.h b/linux-headers/asm-mips/unistd_n64.h +index 683558a7f8..0996001802 100644 +--- a/linux-headers/asm-mips/unistd_n64.h ++++ b/linux-headers/asm-mips/unistd_n64.h +@@ -1,352 +1,355 @@ +-#ifndef _ASM_MIPS_UNISTD_N64_H +-#define _ASM_MIPS_UNISTD_N64_H ++#ifndef _ASM_UNISTD_N64_H ++#define _ASM_UNISTD_N64_H + +-#define __NR_read (__NR_Linux + 0) +-#define __NR_write (__NR_Linux + 1) +-#define __NR_open (__NR_Linux + 2) +-#define __NR_close (__NR_Linux + 3) +-#define __NR_stat (__NR_Linux + 4) +-#define __NR_fstat (__NR_Linux + 5) +-#define __NR_lstat (__NR_Linux + 6) +-#define __NR_poll (__NR_Linux + 7) +-#define __NR_lseek (__NR_Linux + 8) +-#define __NR_mmap (__NR_Linux + 9) +-#define __NR_mprotect (__NR_Linux + 10) +-#define __NR_munmap (__NR_Linux + 11) +-#define __NR_brk (__NR_Linux + 12) +-#define __NR_rt_sigaction (__NR_Linux + 13) +-#define __NR_rt_sigprocmask (__NR_Linux + 14) +-#define __NR_ioctl (__NR_Linux + 15) +-#define __NR_pread64 (__NR_Linux + 16) +-#define __NR_pwrite64 (__NR_Linux + 17) +-#define __NR_readv (__NR_Linux + 18) +-#define __NR_writev (__NR_Linux + 19) +-#define __NR_access (__NR_Linux + 20) +-#define __NR_pipe (__NR_Linux + 21) +-#define __NR__newselect (__NR_Linux + 22) +-#define __NR_sched_yield (__NR_Linux + 23) +-#define __NR_mremap (__NR_Linux + 24) +-#define __NR_msync (__NR_Linux + 25) +-#define __NR_mincore (__NR_Linux + 26) +-#define __NR_madvise (__NR_Linux + 27) +-#define __NR_shmget (__NR_Linux + 28) +-#define __NR_shmat (__NR_Linux + 29) +-#define __NR_shmctl (__NR_Linux + 30) +-#define __NR_dup (__NR_Linux + 31) +-#define __NR_dup2 (__NR_Linux + 32) +-#define __NR_pause (__NR_Linux + 33) +-#define __NR_nanosleep (__NR_Linux + 34) +-#define __NR_getitimer (__NR_Linux + 35) +-#define __NR_setitimer (__NR_Linux + 36) +-#define __NR_alarm (__NR_Linux + 37) +-#define __NR_getpid (__NR_Linux + 38) +-#define __NR_sendfile (__NR_Linux + 39) +-#define __NR_socket (__NR_Linux + 40) +-#define __NR_connect (__NR_Linux + 41) +-#define __NR_accept (__NR_Linux + 42) +-#define __NR_sendto (__NR_Linux + 43) +-#define __NR_recvfrom (__NR_Linux + 44) +-#define __NR_sendmsg (__NR_Linux + 45) +-#define __NR_recvmsg (__NR_Linux + 46) +-#define __NR_shutdown (__NR_Linux + 47) +-#define __NR_bind (__NR_Linux + 48) +-#define __NR_listen (__NR_Linux + 49) +-#define __NR_getsockname (__NR_Linux + 50) +-#define __NR_getpeername (__NR_Linux + 51) +-#define __NR_socketpair (__NR_Linux + 52) +-#define __NR_setsockopt (__NR_Linux + 53) +-#define __NR_getsockopt (__NR_Linux + 54) +-#define __NR_clone (__NR_Linux + 55) +-#define __NR_fork (__NR_Linux + 56) +-#define __NR_execve (__NR_Linux + 57) +-#define __NR_exit (__NR_Linux + 58) +-#define __NR_wait4 (__NR_Linux + 59) +-#define __NR_kill (__NR_Linux + 60) +-#define __NR_uname (__NR_Linux + 61) +-#define __NR_semget (__NR_Linux + 62) +-#define __NR_semop (__NR_Linux + 63) +-#define __NR_semctl (__NR_Linux + 64) +-#define __NR_shmdt (__NR_Linux + 65) +-#define __NR_msgget (__NR_Linux + 66) +-#define __NR_msgsnd (__NR_Linux + 67) +-#define __NR_msgrcv (__NR_Linux + 68) +-#define __NR_msgctl (__NR_Linux + 69) +-#define __NR_fcntl (__NR_Linux + 70) +-#define __NR_flock (__NR_Linux + 71) +-#define __NR_fsync (__NR_Linux + 72) +-#define __NR_fdatasync (__NR_Linux + 73) +-#define __NR_truncate (__NR_Linux + 74) +-#define __NR_ftruncate (__NR_Linux + 75) +-#define __NR_getdents (__NR_Linux + 76) +-#define __NR_getcwd (__NR_Linux + 77) +-#define __NR_chdir (__NR_Linux + 78) +-#define __NR_fchdir (__NR_Linux + 79) +-#define __NR_rename (__NR_Linux + 80) +-#define __NR_mkdir (__NR_Linux + 81) +-#define __NR_rmdir (__NR_Linux + 82) +-#define __NR_creat (__NR_Linux + 83) +-#define __NR_link (__NR_Linux + 84) +-#define __NR_unlink (__NR_Linux + 85) +-#define __NR_symlink (__NR_Linux + 86) +-#define __NR_readlink (__NR_Linux + 87) +-#define __NR_chmod (__NR_Linux + 88) +-#define __NR_fchmod (__NR_Linux + 89) +-#define __NR_chown (__NR_Linux + 90) +-#define __NR_fchown (__NR_Linux + 91) +-#define __NR_lchown (__NR_Linux + 92) +-#define __NR_umask (__NR_Linux + 93) +-#define __NR_gettimeofday (__NR_Linux + 94) +-#define __NR_getrlimit (__NR_Linux + 95) +-#define __NR_getrusage (__NR_Linux + 96) +-#define __NR_sysinfo (__NR_Linux + 97) +-#define __NR_times (__NR_Linux + 98) +-#define __NR_ptrace (__NR_Linux + 99) +-#define __NR_getuid (__NR_Linux + 100) +-#define __NR_syslog (__NR_Linux + 101) +-#define __NR_getgid (__NR_Linux + 102) +-#define __NR_setuid (__NR_Linux + 103) +-#define __NR_setgid (__NR_Linux + 104) +-#define __NR_geteuid (__NR_Linux + 105) +-#define __NR_getegid (__NR_Linux + 106) +-#define __NR_setpgid (__NR_Linux + 107) +-#define __NR_getppid (__NR_Linux + 108) +-#define __NR_getpgrp (__NR_Linux + 109) +-#define __NR_setsid (__NR_Linux + 110) +-#define __NR_setreuid (__NR_Linux + 111) +-#define __NR_setregid (__NR_Linux + 112) +-#define __NR_getgroups (__NR_Linux + 113) +-#define __NR_setgroups (__NR_Linux + 114) +-#define __NR_setresuid (__NR_Linux + 115) +-#define __NR_getresuid (__NR_Linux + 116) +-#define __NR_setresgid (__NR_Linux + 117) +-#define __NR_getresgid (__NR_Linux + 118) +-#define __NR_getpgid (__NR_Linux + 119) +-#define __NR_setfsuid (__NR_Linux + 120) +-#define __NR_setfsgid (__NR_Linux + 121) +-#define __NR_getsid (__NR_Linux + 122) +-#define __NR_capget (__NR_Linux + 123) +-#define __NR_capset (__NR_Linux + 124) +-#define __NR_rt_sigpending (__NR_Linux + 125) +-#define __NR_rt_sigtimedwait (__NR_Linux + 126) +-#define __NR_rt_sigqueueinfo (__NR_Linux + 127) +-#define __NR_rt_sigsuspend (__NR_Linux + 128) +-#define __NR_sigaltstack (__NR_Linux + 129) +-#define __NR_utime (__NR_Linux + 130) +-#define __NR_mknod (__NR_Linux + 131) +-#define __NR_personality (__NR_Linux + 132) +-#define __NR_ustat (__NR_Linux + 133) +-#define __NR_statfs (__NR_Linux + 134) +-#define __NR_fstatfs (__NR_Linux + 135) +-#define __NR_sysfs (__NR_Linux + 136) +-#define __NR_getpriority (__NR_Linux + 137) +-#define __NR_setpriority (__NR_Linux + 138) +-#define __NR_sched_setparam (__NR_Linux + 139) +-#define __NR_sched_getparam (__NR_Linux + 140) +-#define __NR_sched_setscheduler (__NR_Linux + 141) +-#define __NR_sched_getscheduler (__NR_Linux + 142) +-#define __NR_sched_get_priority_max (__NR_Linux + 143) +-#define __NR_sched_get_priority_min (__NR_Linux + 144) +-#define __NR_sched_rr_get_interval (__NR_Linux + 145) +-#define __NR_mlock (__NR_Linux + 146) +-#define __NR_munlock (__NR_Linux + 147) +-#define __NR_mlockall (__NR_Linux + 148) +-#define __NR_munlockall (__NR_Linux + 149) +-#define __NR_vhangup (__NR_Linux + 150) +-#define __NR_pivot_root (__NR_Linux + 151) +-#define __NR__sysctl (__NR_Linux + 152) +-#define __NR_prctl (__NR_Linux + 153) +-#define __NR_adjtimex (__NR_Linux + 154) +-#define __NR_setrlimit (__NR_Linux + 155) +-#define __NR_chroot (__NR_Linux + 156) +-#define __NR_sync (__NR_Linux + 157) +-#define __NR_acct (__NR_Linux + 158) +-#define __NR_settimeofday (__NR_Linux + 159) +-#define __NR_mount (__NR_Linux + 160) +-#define __NR_umount2 (__NR_Linux + 161) +-#define __NR_swapon (__NR_Linux + 162) +-#define __NR_swapoff (__NR_Linux + 163) +-#define __NR_reboot (__NR_Linux + 164) +-#define __NR_sethostname (__NR_Linux + 165) +-#define __NR_setdomainname (__NR_Linux + 166) +-#define __NR_create_module (__NR_Linux + 167) +-#define __NR_init_module (__NR_Linux + 168) +-#define __NR_delete_module (__NR_Linux + 169) +-#define __NR_get_kernel_syms (__NR_Linux + 170) +-#define __NR_query_module (__NR_Linux + 171) +-#define __NR_quotactl (__NR_Linux + 172) +-#define __NR_nfsservctl (__NR_Linux + 173) +-#define __NR_getpmsg (__NR_Linux + 174) +-#define __NR_putpmsg (__NR_Linux + 175) +-#define __NR_afs_syscall (__NR_Linux + 176) +-#define __NR_reserved177 (__NR_Linux + 177) +-#define __NR_gettid (__NR_Linux + 178) +-#define __NR_readahead (__NR_Linux + 179) +-#define __NR_setxattr (__NR_Linux + 180) +-#define __NR_lsetxattr (__NR_Linux + 181) +-#define __NR_fsetxattr (__NR_Linux + 182) +-#define __NR_getxattr (__NR_Linux + 183) +-#define __NR_lgetxattr (__NR_Linux + 184) +-#define __NR_fgetxattr (__NR_Linux + 185) +-#define __NR_listxattr (__NR_Linux + 186) +-#define __NR_llistxattr (__NR_Linux + 187) +-#define __NR_flistxattr (__NR_Linux + 188) +-#define __NR_removexattr (__NR_Linux + 189) +-#define __NR_lremovexattr (__NR_Linux + 190) +-#define __NR_fremovexattr (__NR_Linux + 191) +-#define __NR_tkill (__NR_Linux + 192) +-#define __NR_reserved193 (__NR_Linux + 193) +-#define __NR_futex (__NR_Linux + 194) +-#define __NR_sched_setaffinity (__NR_Linux + 195) +-#define __NR_sched_getaffinity (__NR_Linux + 196) +-#define __NR_cacheflush (__NR_Linux + 197) +-#define __NR_cachectl (__NR_Linux + 198) +-#define __NR_sysmips (__NR_Linux + 199) +-#define __NR_io_setup (__NR_Linux + 200) +-#define __NR_io_destroy (__NR_Linux + 201) +-#define __NR_io_getevents (__NR_Linux + 202) +-#define __NR_io_submit (__NR_Linux + 203) +-#define __NR_io_cancel (__NR_Linux + 204) +-#define __NR_exit_group (__NR_Linux + 205) +-#define __NR_lookup_dcookie (__NR_Linux + 206) +-#define __NR_epoll_create (__NR_Linux + 207) +-#define __NR_epoll_ctl (__NR_Linux + 208) +-#define __NR_epoll_wait (__NR_Linux + 209) +-#define __NR_remap_file_pages (__NR_Linux + 210) +-#define __NR_rt_sigreturn (__NR_Linux + 211) +-#define __NR_set_tid_address (__NR_Linux + 212) +-#define __NR_restart_syscall (__NR_Linux + 213) +-#define __NR_semtimedop (__NR_Linux + 214) +-#define __NR_fadvise64 (__NR_Linux + 215) +-#define __NR_timer_create (__NR_Linux + 216) +-#define __NR_timer_settime (__NR_Linux + 217) +-#define __NR_timer_gettime (__NR_Linux + 218) +-#define __NR_timer_getoverrun (__NR_Linux + 219) +-#define __NR_timer_delete (__NR_Linux + 220) +-#define __NR_clock_settime (__NR_Linux + 221) +-#define __NR_clock_gettime (__NR_Linux + 222) +-#define __NR_clock_getres (__NR_Linux + 223) +-#define __NR_clock_nanosleep (__NR_Linux + 224) +-#define __NR_tgkill (__NR_Linux + 225) +-#define __NR_utimes (__NR_Linux + 226) +-#define __NR_mbind (__NR_Linux + 227) +-#define __NR_get_mempolicy (__NR_Linux + 228) +-#define __NR_set_mempolicy (__NR_Linux + 229) +-#define __NR_mq_open (__NR_Linux + 230) +-#define __NR_mq_unlink (__NR_Linux + 231) +-#define __NR_mq_timedsend (__NR_Linux + 232) +-#define __NR_mq_timedreceive (__NR_Linux + 233) +-#define __NR_mq_notify (__NR_Linux + 234) +-#define __NR_mq_getsetattr (__NR_Linux + 235) +-#define __NR_vserver (__NR_Linux + 236) +-#define __NR_waitid (__NR_Linux + 237) +-#define __NR_add_key (__NR_Linux + 239) +-#define __NR_request_key (__NR_Linux + 240) +-#define __NR_keyctl (__NR_Linux + 241) +-#define __NR_set_thread_area (__NR_Linux + 242) +-#define __NR_inotify_init (__NR_Linux + 243) +-#define __NR_inotify_add_watch (__NR_Linux + 244) +-#define __NR_inotify_rm_watch (__NR_Linux + 245) +-#define __NR_migrate_pages (__NR_Linux + 246) +-#define __NR_openat (__NR_Linux + 247) +-#define __NR_mkdirat (__NR_Linux + 248) +-#define __NR_mknodat (__NR_Linux + 249) +-#define __NR_fchownat (__NR_Linux + 250) +-#define __NR_futimesat (__NR_Linux + 251) +-#define __NR_newfstatat (__NR_Linux + 252) +-#define __NR_unlinkat (__NR_Linux + 253) +-#define __NR_renameat (__NR_Linux + 254) +-#define __NR_linkat (__NR_Linux + 255) +-#define __NR_symlinkat (__NR_Linux + 256) +-#define __NR_readlinkat (__NR_Linux + 257) +-#define __NR_fchmodat (__NR_Linux + 258) +-#define __NR_faccessat (__NR_Linux + 259) +-#define __NR_pselect6 (__NR_Linux + 260) +-#define __NR_ppoll (__NR_Linux + 261) +-#define __NR_unshare (__NR_Linux + 262) +-#define __NR_splice (__NR_Linux + 263) +-#define __NR_sync_file_range (__NR_Linux + 264) +-#define __NR_tee (__NR_Linux + 265) +-#define __NR_vmsplice (__NR_Linux + 266) +-#define __NR_move_pages (__NR_Linux + 267) +-#define __NR_set_robust_list (__NR_Linux + 268) +-#define __NR_get_robust_list (__NR_Linux + 269) +-#define __NR_kexec_load (__NR_Linux + 270) +-#define __NR_getcpu (__NR_Linux + 271) +-#define __NR_epoll_pwait (__NR_Linux + 272) +-#define __NR_ioprio_set (__NR_Linux + 273) +-#define __NR_ioprio_get (__NR_Linux + 274) +-#define __NR_utimensat (__NR_Linux + 275) +-#define __NR_signalfd (__NR_Linux + 276) +-#define __NR_timerfd (__NR_Linux + 277) +-#define __NR_eventfd (__NR_Linux + 278) +-#define __NR_fallocate (__NR_Linux + 279) +-#define __NR_timerfd_create (__NR_Linux + 280) +-#define __NR_timerfd_gettime (__NR_Linux + 281) +-#define __NR_timerfd_settime (__NR_Linux + 282) +-#define __NR_signalfd4 (__NR_Linux + 283) +-#define __NR_eventfd2 (__NR_Linux + 284) +-#define __NR_epoll_create1 (__NR_Linux + 285) +-#define __NR_dup3 (__NR_Linux + 286) +-#define __NR_pipe2 (__NR_Linux + 287) +-#define __NR_inotify_init1 (__NR_Linux + 288) +-#define __NR_preadv (__NR_Linux + 289) +-#define __NR_pwritev (__NR_Linux + 290) +-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291) +-#define __NR_perf_event_open (__NR_Linux + 292) +-#define __NR_accept4 (__NR_Linux + 293) +-#define __NR_recvmmsg (__NR_Linux + 294) +-#define __NR_fanotify_init (__NR_Linux + 295) +-#define __NR_fanotify_mark (__NR_Linux + 296) +-#define __NR_prlimit64 (__NR_Linux + 297) +-#define __NR_name_to_handle_at (__NR_Linux + 298) +-#define __NR_open_by_handle_at (__NR_Linux + 299) +-#define __NR_clock_adjtime (__NR_Linux + 300) +-#define __NR_syncfs (__NR_Linux + 301) +-#define __NR_sendmmsg (__NR_Linux + 302) +-#define __NR_setns (__NR_Linux + 303) +-#define __NR_process_vm_readv (__NR_Linux + 304) +-#define __NR_process_vm_writev (__NR_Linux + 305) +-#define __NR_kcmp (__NR_Linux + 306) +-#define __NR_finit_module (__NR_Linux + 307) +-#define __NR_getdents64 (__NR_Linux + 308) +-#define __NR_sched_setattr (__NR_Linux + 309) +-#define __NR_sched_getattr (__NR_Linux + 310) +-#define __NR_renameat2 (__NR_Linux + 311) +-#define __NR_seccomp (__NR_Linux + 312) +-#define __NR_getrandom (__NR_Linux + 313) +-#define __NR_memfd_create (__NR_Linux + 314) +-#define __NR_bpf (__NR_Linux + 315) +-#define __NR_execveat (__NR_Linux + 316) +-#define __NR_userfaultfd (__NR_Linux + 317) +-#define __NR_membarrier (__NR_Linux + 318) +-#define __NR_mlock2 (__NR_Linux + 319) +-#define __NR_copy_file_range (__NR_Linux + 320) +-#define __NR_preadv2 (__NR_Linux + 321) +-#define __NR_pwritev2 (__NR_Linux + 322) +-#define __NR_pkey_mprotect (__NR_Linux + 323) +-#define __NR_pkey_alloc (__NR_Linux + 324) +-#define __NR_pkey_free (__NR_Linux + 325) +-#define __NR_statx (__NR_Linux + 326) +-#define __NR_rseq (__NR_Linux + 327) +-#define __NR_io_pgetevents (__NR_Linux + 328) +-#define __NR_pidfd_send_signal (__NR_Linux + 424) +-#define __NR_io_uring_setup (__NR_Linux + 425) +-#define __NR_io_uring_enter (__NR_Linux + 426) +-#define __NR_io_uring_register (__NR_Linux + 427) +-#define __NR_open_tree (__NR_Linux + 428) +-#define __NR_move_mount (__NR_Linux + 429) +-#define __NR_fsopen (__NR_Linux + 430) +-#define __NR_fsconfig (__NR_Linux + 431) +-#define __NR_fsmount (__NR_Linux + 432) +-#define __NR_fspick (__NR_Linux + 433) +-#define __NR_pidfd_open (__NR_Linux + 434) +-#define __NR_clone3 (__NR_Linux + 435) +-#define __NR_close_range (__NR_Linux + 436) +-#define __NR_openat2 (__NR_Linux + 437) +-#define __NR_pidfd_getfd (__NR_Linux + 438) +-#define __NR_faccessat2 (__NR_Linux + 439) +-#define __NR_process_madvise (__NR_Linux + 440) +-#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_read (__NR_Linux + 0) ++#define __NR_write (__NR_Linux + 1) ++#define __NR_open (__NR_Linux + 2) ++#define __NR_close (__NR_Linux + 3) ++#define __NR_stat (__NR_Linux + 4) ++#define __NR_fstat (__NR_Linux + 5) ++#define __NR_lstat (__NR_Linux + 6) ++#define __NR_poll (__NR_Linux + 7) ++#define __NR_lseek (__NR_Linux + 8) ++#define __NR_mmap (__NR_Linux + 9) ++#define __NR_mprotect (__NR_Linux + 10) ++#define __NR_munmap (__NR_Linux + 11) ++#define __NR_brk (__NR_Linux + 12) ++#define __NR_rt_sigaction (__NR_Linux + 13) ++#define __NR_rt_sigprocmask (__NR_Linux + 14) ++#define __NR_ioctl (__NR_Linux + 15) ++#define __NR_pread64 (__NR_Linux + 16) ++#define __NR_pwrite64 (__NR_Linux + 17) ++#define __NR_readv (__NR_Linux + 18) ++#define __NR_writev (__NR_Linux + 19) ++#define __NR_access (__NR_Linux + 20) ++#define __NR_pipe (__NR_Linux + 21) ++#define __NR__newselect (__NR_Linux + 22) ++#define __NR_sched_yield (__NR_Linux + 23) ++#define __NR_mremap (__NR_Linux + 24) ++#define __NR_msync (__NR_Linux + 25) ++#define __NR_mincore (__NR_Linux + 26) ++#define __NR_madvise (__NR_Linux + 27) ++#define __NR_shmget (__NR_Linux + 28) ++#define __NR_shmat (__NR_Linux + 29) ++#define __NR_shmctl (__NR_Linux + 30) ++#define __NR_dup (__NR_Linux + 31) ++#define __NR_dup2 (__NR_Linux + 32) ++#define __NR_pause (__NR_Linux + 33) ++#define __NR_nanosleep (__NR_Linux + 34) ++#define __NR_getitimer (__NR_Linux + 35) ++#define __NR_setitimer (__NR_Linux + 36) ++#define __NR_alarm (__NR_Linux + 37) ++#define __NR_getpid (__NR_Linux + 38) ++#define __NR_sendfile (__NR_Linux + 39) ++#define __NR_socket (__NR_Linux + 40) ++#define __NR_connect (__NR_Linux + 41) ++#define __NR_accept (__NR_Linux + 42) ++#define __NR_sendto (__NR_Linux + 43) ++#define __NR_recvfrom (__NR_Linux + 44) ++#define __NR_sendmsg (__NR_Linux + 45) ++#define __NR_recvmsg (__NR_Linux + 46) ++#define __NR_shutdown (__NR_Linux + 47) ++#define __NR_bind (__NR_Linux + 48) ++#define __NR_listen (__NR_Linux + 49) ++#define __NR_getsockname (__NR_Linux + 50) ++#define __NR_getpeername (__NR_Linux + 51) ++#define __NR_socketpair (__NR_Linux + 52) ++#define __NR_setsockopt (__NR_Linux + 53) ++#define __NR_getsockopt (__NR_Linux + 54) ++#define __NR_clone (__NR_Linux + 55) ++#define __NR_fork (__NR_Linux + 56) ++#define __NR_execve (__NR_Linux + 57) ++#define __NR_exit (__NR_Linux + 58) ++#define __NR_wait4 (__NR_Linux + 59) ++#define __NR_kill (__NR_Linux + 60) ++#define __NR_uname (__NR_Linux + 61) ++#define __NR_semget (__NR_Linux + 62) ++#define __NR_semop (__NR_Linux + 63) ++#define __NR_semctl (__NR_Linux + 64) ++#define __NR_shmdt (__NR_Linux + 65) ++#define __NR_msgget (__NR_Linux + 66) ++#define __NR_msgsnd (__NR_Linux + 67) ++#define __NR_msgrcv (__NR_Linux + 68) ++#define __NR_msgctl (__NR_Linux + 69) ++#define __NR_fcntl (__NR_Linux + 70) ++#define __NR_flock (__NR_Linux + 71) ++#define __NR_fsync (__NR_Linux + 72) ++#define __NR_fdatasync (__NR_Linux + 73) ++#define __NR_truncate (__NR_Linux + 74) ++#define __NR_ftruncate (__NR_Linux + 75) ++#define __NR_getdents (__NR_Linux + 76) ++#define __NR_getcwd (__NR_Linux + 77) ++#define __NR_chdir (__NR_Linux + 78) ++#define __NR_fchdir (__NR_Linux + 79) ++#define __NR_rename (__NR_Linux + 80) ++#define __NR_mkdir (__NR_Linux + 81) ++#define __NR_rmdir (__NR_Linux + 82) ++#define __NR_creat (__NR_Linux + 83) ++#define __NR_link (__NR_Linux + 84) ++#define __NR_unlink (__NR_Linux + 85) ++#define __NR_symlink (__NR_Linux + 86) ++#define __NR_readlink (__NR_Linux + 87) ++#define __NR_chmod (__NR_Linux + 88) ++#define __NR_fchmod (__NR_Linux + 89) ++#define __NR_chown (__NR_Linux + 90) ++#define __NR_fchown (__NR_Linux + 91) ++#define __NR_lchown (__NR_Linux + 92) ++#define __NR_umask (__NR_Linux + 93) ++#define __NR_gettimeofday (__NR_Linux + 94) ++#define __NR_getrlimit (__NR_Linux + 95) ++#define __NR_getrusage (__NR_Linux + 96) ++#define __NR_sysinfo (__NR_Linux + 97) ++#define __NR_times (__NR_Linux + 98) ++#define __NR_ptrace (__NR_Linux + 99) ++#define __NR_getuid (__NR_Linux + 100) ++#define __NR_syslog (__NR_Linux + 101) ++#define __NR_getgid (__NR_Linux + 102) ++#define __NR_setuid (__NR_Linux + 103) ++#define __NR_setgid (__NR_Linux + 104) ++#define __NR_geteuid (__NR_Linux + 105) ++#define __NR_getegid (__NR_Linux + 106) ++#define __NR_setpgid (__NR_Linux + 107) ++#define __NR_getppid (__NR_Linux + 108) ++#define __NR_getpgrp (__NR_Linux + 109) ++#define __NR_setsid (__NR_Linux + 110) ++#define __NR_setreuid (__NR_Linux + 111) ++#define __NR_setregid (__NR_Linux + 112) ++#define __NR_getgroups (__NR_Linux + 113) ++#define __NR_setgroups (__NR_Linux + 114) ++#define __NR_setresuid (__NR_Linux + 115) ++#define __NR_getresuid (__NR_Linux + 116) ++#define __NR_setresgid (__NR_Linux + 117) ++#define __NR_getresgid (__NR_Linux + 118) ++#define __NR_getpgid (__NR_Linux + 119) ++#define __NR_setfsuid (__NR_Linux + 120) ++#define __NR_setfsgid (__NR_Linux + 121) ++#define __NR_getsid (__NR_Linux + 122) ++#define __NR_capget (__NR_Linux + 123) ++#define __NR_capset (__NR_Linux + 124) ++#define __NR_rt_sigpending (__NR_Linux + 125) ++#define __NR_rt_sigtimedwait (__NR_Linux + 126) ++#define __NR_rt_sigqueueinfo (__NR_Linux + 127) ++#define __NR_rt_sigsuspend (__NR_Linux + 128) ++#define __NR_sigaltstack (__NR_Linux + 129) ++#define __NR_utime (__NR_Linux + 130) ++#define __NR_mknod (__NR_Linux + 131) ++#define __NR_personality (__NR_Linux + 132) ++#define __NR_ustat (__NR_Linux + 133) ++#define __NR_statfs (__NR_Linux + 134) ++#define __NR_fstatfs (__NR_Linux + 135) ++#define __NR_sysfs (__NR_Linux + 136) ++#define __NR_getpriority (__NR_Linux + 137) ++#define __NR_setpriority (__NR_Linux + 138) ++#define __NR_sched_setparam (__NR_Linux + 139) ++#define __NR_sched_getparam (__NR_Linux + 140) ++#define __NR_sched_setscheduler (__NR_Linux + 141) ++#define __NR_sched_getscheduler (__NR_Linux + 142) ++#define __NR_sched_get_priority_max (__NR_Linux + 143) ++#define __NR_sched_get_priority_min (__NR_Linux + 144) ++#define __NR_sched_rr_get_interval (__NR_Linux + 145) ++#define __NR_mlock (__NR_Linux + 146) ++#define __NR_munlock (__NR_Linux + 147) ++#define __NR_mlockall (__NR_Linux + 148) ++#define __NR_munlockall (__NR_Linux + 149) ++#define __NR_vhangup (__NR_Linux + 150) ++#define __NR_pivot_root (__NR_Linux + 151) ++#define __NR__sysctl (__NR_Linux + 152) ++#define __NR_prctl (__NR_Linux + 153) ++#define __NR_adjtimex (__NR_Linux + 154) ++#define __NR_setrlimit (__NR_Linux + 155) ++#define __NR_chroot (__NR_Linux + 156) ++#define __NR_sync (__NR_Linux + 157) ++#define __NR_acct (__NR_Linux + 158) ++#define __NR_settimeofday (__NR_Linux + 159) ++#define __NR_mount (__NR_Linux + 160) ++#define __NR_umount2 (__NR_Linux + 161) ++#define __NR_swapon (__NR_Linux + 162) ++#define __NR_swapoff (__NR_Linux + 163) ++#define __NR_reboot (__NR_Linux + 164) ++#define __NR_sethostname (__NR_Linux + 165) ++#define __NR_setdomainname (__NR_Linux + 166) ++#define __NR_create_module (__NR_Linux + 167) ++#define __NR_init_module (__NR_Linux + 168) ++#define __NR_delete_module (__NR_Linux + 169) ++#define __NR_get_kernel_syms (__NR_Linux + 170) ++#define __NR_query_module (__NR_Linux + 171) ++#define __NR_quotactl (__NR_Linux + 172) ++#define __NR_nfsservctl (__NR_Linux + 173) ++#define __NR_getpmsg (__NR_Linux + 174) ++#define __NR_putpmsg (__NR_Linux + 175) ++#define __NR_afs_syscall (__NR_Linux + 176) ++#define __NR_reserved177 (__NR_Linux + 177) ++#define __NR_gettid (__NR_Linux + 178) ++#define __NR_readahead (__NR_Linux + 179) ++#define __NR_setxattr (__NR_Linux + 180) ++#define __NR_lsetxattr (__NR_Linux + 181) ++#define __NR_fsetxattr (__NR_Linux + 182) ++#define __NR_getxattr (__NR_Linux + 183) ++#define __NR_lgetxattr (__NR_Linux + 184) ++#define __NR_fgetxattr (__NR_Linux + 185) ++#define __NR_listxattr (__NR_Linux + 186) ++#define __NR_llistxattr (__NR_Linux + 187) ++#define __NR_flistxattr (__NR_Linux + 188) ++#define __NR_removexattr (__NR_Linux + 189) ++#define __NR_lremovexattr (__NR_Linux + 190) ++#define __NR_fremovexattr (__NR_Linux + 191) ++#define __NR_tkill (__NR_Linux + 192) ++#define __NR_reserved193 (__NR_Linux + 193) ++#define __NR_futex (__NR_Linux + 194) ++#define __NR_sched_setaffinity (__NR_Linux + 195) ++#define __NR_sched_getaffinity (__NR_Linux + 196) ++#define __NR_cacheflush (__NR_Linux + 197) ++#define __NR_cachectl (__NR_Linux + 198) ++#define __NR_sysmips (__NR_Linux + 199) ++#define __NR_io_setup (__NR_Linux + 200) ++#define __NR_io_destroy (__NR_Linux + 201) ++#define __NR_io_getevents (__NR_Linux + 202) ++#define __NR_io_submit (__NR_Linux + 203) ++#define __NR_io_cancel (__NR_Linux + 204) ++#define __NR_exit_group (__NR_Linux + 205) ++#define __NR_lookup_dcookie (__NR_Linux + 206) ++#define __NR_epoll_create (__NR_Linux + 207) ++#define __NR_epoll_ctl (__NR_Linux + 208) ++#define __NR_epoll_wait (__NR_Linux + 209) ++#define __NR_remap_file_pages (__NR_Linux + 210) ++#define __NR_rt_sigreturn (__NR_Linux + 211) ++#define __NR_set_tid_address (__NR_Linux + 212) ++#define __NR_restart_syscall (__NR_Linux + 213) ++#define __NR_semtimedop (__NR_Linux + 214) ++#define __NR_fadvise64 (__NR_Linux + 215) ++#define __NR_timer_create (__NR_Linux + 216) ++#define __NR_timer_settime (__NR_Linux + 217) ++#define __NR_timer_gettime (__NR_Linux + 218) ++#define __NR_timer_getoverrun (__NR_Linux + 219) ++#define __NR_timer_delete (__NR_Linux + 220) ++#define __NR_clock_settime (__NR_Linux + 221) ++#define __NR_clock_gettime (__NR_Linux + 222) ++#define __NR_clock_getres (__NR_Linux + 223) ++#define __NR_clock_nanosleep (__NR_Linux + 224) ++#define __NR_tgkill (__NR_Linux + 225) ++#define __NR_utimes (__NR_Linux + 226) ++#define __NR_mbind (__NR_Linux + 227) ++#define __NR_get_mempolicy (__NR_Linux + 228) ++#define __NR_set_mempolicy (__NR_Linux + 229) ++#define __NR_mq_open (__NR_Linux + 230) ++#define __NR_mq_unlink (__NR_Linux + 231) ++#define __NR_mq_timedsend (__NR_Linux + 232) ++#define __NR_mq_timedreceive (__NR_Linux + 233) ++#define __NR_mq_notify (__NR_Linux + 234) ++#define __NR_mq_getsetattr (__NR_Linux + 235) ++#define __NR_vserver (__NR_Linux + 236) ++#define __NR_waitid (__NR_Linux + 237) ++#define __NR_add_key (__NR_Linux + 239) ++#define __NR_request_key (__NR_Linux + 240) ++#define __NR_keyctl (__NR_Linux + 241) ++#define __NR_set_thread_area (__NR_Linux + 242) ++#define __NR_inotify_init (__NR_Linux + 243) ++#define __NR_inotify_add_watch (__NR_Linux + 244) ++#define __NR_inotify_rm_watch (__NR_Linux + 245) ++#define __NR_migrate_pages (__NR_Linux + 246) ++#define __NR_openat (__NR_Linux + 247) ++#define __NR_mkdirat (__NR_Linux + 248) ++#define __NR_mknodat (__NR_Linux + 249) ++#define __NR_fchownat (__NR_Linux + 250) ++#define __NR_futimesat (__NR_Linux + 251) ++#define __NR_newfstatat (__NR_Linux + 252) ++#define __NR_unlinkat (__NR_Linux + 253) ++#define __NR_renameat (__NR_Linux + 254) ++#define __NR_linkat (__NR_Linux + 255) ++#define __NR_symlinkat (__NR_Linux + 256) ++#define __NR_readlinkat (__NR_Linux + 257) ++#define __NR_fchmodat (__NR_Linux + 258) ++#define __NR_faccessat (__NR_Linux + 259) ++#define __NR_pselect6 (__NR_Linux + 260) ++#define __NR_ppoll (__NR_Linux + 261) ++#define __NR_unshare (__NR_Linux + 262) ++#define __NR_splice (__NR_Linux + 263) ++#define __NR_sync_file_range (__NR_Linux + 264) ++#define __NR_tee (__NR_Linux + 265) ++#define __NR_vmsplice (__NR_Linux + 266) ++#define __NR_move_pages (__NR_Linux + 267) ++#define __NR_set_robust_list (__NR_Linux + 268) ++#define __NR_get_robust_list (__NR_Linux + 269) ++#define __NR_kexec_load (__NR_Linux + 270) ++#define __NR_getcpu (__NR_Linux + 271) ++#define __NR_epoll_pwait (__NR_Linux + 272) ++#define __NR_ioprio_set (__NR_Linux + 273) ++#define __NR_ioprio_get (__NR_Linux + 274) ++#define __NR_utimensat (__NR_Linux + 275) ++#define __NR_signalfd (__NR_Linux + 276) ++#define __NR_timerfd (__NR_Linux + 277) ++#define __NR_eventfd (__NR_Linux + 278) ++#define __NR_fallocate (__NR_Linux + 279) ++#define __NR_timerfd_create (__NR_Linux + 280) ++#define __NR_timerfd_gettime (__NR_Linux + 281) ++#define __NR_timerfd_settime (__NR_Linux + 282) ++#define __NR_signalfd4 (__NR_Linux + 283) ++#define __NR_eventfd2 (__NR_Linux + 284) ++#define __NR_epoll_create1 (__NR_Linux + 285) ++#define __NR_dup3 (__NR_Linux + 286) ++#define __NR_pipe2 (__NR_Linux + 287) ++#define __NR_inotify_init1 (__NR_Linux + 288) ++#define __NR_preadv (__NR_Linux + 289) ++#define __NR_pwritev (__NR_Linux + 290) ++#define __NR_rt_tgsigqueueinfo (__NR_Linux + 291) ++#define __NR_perf_event_open (__NR_Linux + 292) ++#define __NR_accept4 (__NR_Linux + 293) ++#define __NR_recvmmsg (__NR_Linux + 294) ++#define __NR_fanotify_init (__NR_Linux + 295) ++#define __NR_fanotify_mark (__NR_Linux + 296) ++#define __NR_prlimit64 (__NR_Linux + 297) ++#define __NR_name_to_handle_at (__NR_Linux + 298) ++#define __NR_open_by_handle_at (__NR_Linux + 299) ++#define __NR_clock_adjtime (__NR_Linux + 300) ++#define __NR_syncfs (__NR_Linux + 301) ++#define __NR_sendmmsg (__NR_Linux + 302) ++#define __NR_setns (__NR_Linux + 303) ++#define __NR_process_vm_readv (__NR_Linux + 304) ++#define __NR_process_vm_writev (__NR_Linux + 305) ++#define __NR_kcmp (__NR_Linux + 306) ++#define __NR_finit_module (__NR_Linux + 307) ++#define __NR_getdents64 (__NR_Linux + 308) ++#define __NR_sched_setattr (__NR_Linux + 309) ++#define __NR_sched_getattr (__NR_Linux + 310) ++#define __NR_renameat2 (__NR_Linux + 311) ++#define __NR_seccomp (__NR_Linux + 312) ++#define __NR_getrandom (__NR_Linux + 313) ++#define __NR_memfd_create (__NR_Linux + 314) ++#define __NR_bpf (__NR_Linux + 315) ++#define __NR_execveat (__NR_Linux + 316) ++#define __NR_userfaultfd (__NR_Linux + 317) ++#define __NR_membarrier (__NR_Linux + 318) ++#define __NR_mlock2 (__NR_Linux + 319) ++#define __NR_copy_file_range (__NR_Linux + 320) ++#define __NR_preadv2 (__NR_Linux + 321) ++#define __NR_pwritev2 (__NR_Linux + 322) ++#define __NR_pkey_mprotect (__NR_Linux + 323) ++#define __NR_pkey_alloc (__NR_Linux + 324) ++#define __NR_pkey_free (__NR_Linux + 325) ++#define __NR_statx (__NR_Linux + 326) ++#define __NR_rseq (__NR_Linux + 327) ++#define __NR_io_pgetevents (__NR_Linux + 328) ++#define __NR_pidfd_send_signal (__NR_Linux + 424) ++#define __NR_io_uring_setup (__NR_Linux + 425) ++#define __NR_io_uring_enter (__NR_Linux + 426) ++#define __NR_io_uring_register (__NR_Linux + 427) ++#define __NR_open_tree (__NR_Linux + 428) ++#define __NR_move_mount (__NR_Linux + 429) ++#define __NR_fsopen (__NR_Linux + 430) ++#define __NR_fsconfig (__NR_Linux + 431) ++#define __NR_fsmount (__NR_Linux + 432) ++#define __NR_fspick (__NR_Linux + 433) ++#define __NR_pidfd_open (__NR_Linux + 434) ++#define __NR_clone3 (__NR_Linux + 435) ++#define __NR_close_range (__NR_Linux + 436) ++#define __NR_openat2 (__NR_Linux + 437) ++#define __NR_pidfd_getfd (__NR_Linux + 438) ++#define __NR_faccessat2 (__NR_Linux + 439) ++#define __NR_process_madvise (__NR_Linux + 440) ++#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_mount_setattr (__NR_Linux + 442) ++#define __NR_landlock_create_ruleset (__NR_Linux + 444) ++#define __NR_landlock_add_rule (__NR_Linux + 445) ++#define __NR_landlock_restrict_self (__NR_Linux + 446) + +- +-#endif /* _ASM_MIPS_UNISTD_N64_H */ ++#endif /* _ASM_UNISTD_N64_H */ +diff --git a/linux-headers/asm-mips/unistd_o32.h b/linux-headers/asm-mips/unistd_o32.h +index ca6a7e5c0b..954303ad69 100644 +--- a/linux-headers/asm-mips/unistd_o32.h ++++ b/linux-headers/asm-mips/unistd_o32.h +@@ -1,422 +1,425 @@ +-#ifndef _ASM_MIPS_UNISTD_O32_H +-#define _ASM_MIPS_UNISTD_O32_H ++#ifndef _ASM_UNISTD_O32_H ++#define _ASM_UNISTD_O32_H + +-#define __NR_syscall (__NR_Linux + 0) +-#define __NR_exit (__NR_Linux + 1) +-#define __NR_fork (__NR_Linux + 2) +-#define __NR_read (__NR_Linux + 3) +-#define __NR_write (__NR_Linux + 4) +-#define __NR_open (__NR_Linux + 5) +-#define __NR_close (__NR_Linux + 6) +-#define __NR_waitpid (__NR_Linux + 7) +-#define __NR_creat (__NR_Linux + 8) +-#define __NR_link (__NR_Linux + 9) +-#define __NR_unlink (__NR_Linux + 10) +-#define __NR_execve (__NR_Linux + 11) +-#define __NR_chdir (__NR_Linux + 12) +-#define __NR_time (__NR_Linux + 13) +-#define __NR_mknod (__NR_Linux + 14) +-#define __NR_chmod (__NR_Linux + 15) +-#define __NR_lchown (__NR_Linux + 16) +-#define __NR_break (__NR_Linux + 17) +-#define __NR_unused18 (__NR_Linux + 18) +-#define __NR_lseek (__NR_Linux + 19) +-#define __NR_getpid (__NR_Linux + 20) +-#define __NR_mount (__NR_Linux + 21) +-#define __NR_umount (__NR_Linux + 22) +-#define __NR_setuid (__NR_Linux + 23) +-#define __NR_getuid (__NR_Linux + 24) +-#define __NR_stime (__NR_Linux + 25) +-#define __NR_ptrace (__NR_Linux + 26) +-#define __NR_alarm (__NR_Linux + 27) +-#define __NR_unused28 (__NR_Linux + 28) +-#define __NR_pause (__NR_Linux + 29) +-#define __NR_utime (__NR_Linux + 30) +-#define __NR_stty (__NR_Linux + 31) +-#define __NR_gtty (__NR_Linux + 32) +-#define __NR_access (__NR_Linux + 33) +-#define __NR_nice (__NR_Linux + 34) +-#define __NR_ftime (__NR_Linux + 35) +-#define __NR_sync (__NR_Linux + 36) +-#define __NR_kill (__NR_Linux + 37) +-#define __NR_rename (__NR_Linux + 38) +-#define __NR_mkdir (__NR_Linux + 39) +-#define __NR_rmdir (__NR_Linux + 40) +-#define __NR_dup (__NR_Linux + 41) +-#define __NR_pipe (__NR_Linux + 42) +-#define __NR_times (__NR_Linux + 43) +-#define __NR_prof (__NR_Linux + 44) +-#define __NR_brk (__NR_Linux + 45) +-#define __NR_setgid (__NR_Linux + 46) +-#define __NR_getgid (__NR_Linux + 47) +-#define __NR_signal (__NR_Linux + 48) +-#define __NR_geteuid (__NR_Linux + 49) +-#define __NR_getegid (__NR_Linux + 50) +-#define __NR_acct (__NR_Linux + 51) +-#define __NR_umount2 (__NR_Linux + 52) +-#define __NR_lock (__NR_Linux + 53) +-#define __NR_ioctl (__NR_Linux + 54) +-#define __NR_fcntl (__NR_Linux + 55) +-#define __NR_mpx (__NR_Linux + 56) +-#define __NR_setpgid (__NR_Linux + 57) +-#define __NR_ulimit (__NR_Linux + 58) +-#define __NR_unused59 (__NR_Linux + 59) +-#define __NR_umask (__NR_Linux + 60) +-#define __NR_chroot (__NR_Linux + 61) +-#define __NR_ustat (__NR_Linux + 62) +-#define __NR_dup2 (__NR_Linux + 63) +-#define __NR_getppid (__NR_Linux + 64) +-#define __NR_getpgrp (__NR_Linux + 65) +-#define __NR_setsid (__NR_Linux + 66) +-#define __NR_sigaction (__NR_Linux + 67) +-#define __NR_sgetmask (__NR_Linux + 68) +-#define __NR_ssetmask (__NR_Linux + 69) +-#define __NR_setreuid (__NR_Linux + 70) +-#define __NR_setregid (__NR_Linux + 71) +-#define __NR_sigsuspend (__NR_Linux + 72) +-#define __NR_sigpending (__NR_Linux + 73) +-#define __NR_sethostname (__NR_Linux + 74) +-#define __NR_setrlimit (__NR_Linux + 75) +-#define __NR_getrlimit (__NR_Linux + 76) +-#define __NR_getrusage (__NR_Linux + 77) +-#define __NR_gettimeofday (__NR_Linux + 78) +-#define __NR_settimeofday (__NR_Linux + 79) +-#define __NR_getgroups (__NR_Linux + 80) +-#define __NR_setgroups (__NR_Linux + 81) +-#define __NR_reserved82 (__NR_Linux + 82) +-#define __NR_symlink (__NR_Linux + 83) +-#define __NR_unused84 (__NR_Linux + 84) +-#define __NR_readlink (__NR_Linux + 85) +-#define __NR_uselib (__NR_Linux + 86) +-#define __NR_swapon (__NR_Linux + 87) +-#define __NR_reboot (__NR_Linux + 88) +-#define __NR_readdir (__NR_Linux + 89) +-#define __NR_mmap (__NR_Linux + 90) +-#define __NR_munmap (__NR_Linux + 91) +-#define __NR_truncate (__NR_Linux + 92) +-#define __NR_ftruncate (__NR_Linux + 93) +-#define __NR_fchmod (__NR_Linux + 94) +-#define __NR_fchown (__NR_Linux + 95) +-#define __NR_getpriority (__NR_Linux + 96) +-#define __NR_setpriority (__NR_Linux + 97) +-#define __NR_profil (__NR_Linux + 98) +-#define __NR_statfs (__NR_Linux + 99) +-#define __NR_fstatfs (__NR_Linux + 100) +-#define __NR_ioperm (__NR_Linux + 101) +-#define __NR_socketcall (__NR_Linux + 102) +-#define __NR_syslog (__NR_Linux + 103) +-#define __NR_setitimer (__NR_Linux + 104) +-#define __NR_getitimer (__NR_Linux + 105) +-#define __NR_stat (__NR_Linux + 106) +-#define __NR_lstat (__NR_Linux + 107) +-#define __NR_fstat (__NR_Linux + 108) +-#define __NR_unused109 (__NR_Linux + 109) +-#define __NR_iopl (__NR_Linux + 110) +-#define __NR_vhangup (__NR_Linux + 111) +-#define __NR_idle (__NR_Linux + 112) +-#define __NR_vm86 (__NR_Linux + 113) +-#define __NR_wait4 (__NR_Linux + 114) +-#define __NR_swapoff (__NR_Linux + 115) +-#define __NR_sysinfo (__NR_Linux + 116) +-#define __NR_ipc (__NR_Linux + 117) +-#define __NR_fsync (__NR_Linux + 118) +-#define __NR_sigreturn (__NR_Linux + 119) +-#define __NR_clone (__NR_Linux + 120) +-#define __NR_setdomainname (__NR_Linux + 121) +-#define __NR_uname (__NR_Linux + 122) +-#define __NR_modify_ldt (__NR_Linux + 123) +-#define __NR_adjtimex (__NR_Linux + 124) +-#define __NR_mprotect (__NR_Linux + 125) +-#define __NR_sigprocmask (__NR_Linux + 126) +-#define __NR_create_module (__NR_Linux + 127) +-#define __NR_init_module (__NR_Linux + 128) +-#define __NR_delete_module (__NR_Linux + 129) +-#define __NR_get_kernel_syms (__NR_Linux + 130) +-#define __NR_quotactl (__NR_Linux + 131) +-#define __NR_getpgid (__NR_Linux + 132) +-#define __NR_fchdir (__NR_Linux + 133) +-#define __NR_bdflush (__NR_Linux + 134) +-#define __NR_sysfs (__NR_Linux + 135) +-#define __NR_personality (__NR_Linux + 136) +-#define __NR_afs_syscall (__NR_Linux + 137) +-#define __NR_setfsuid (__NR_Linux + 138) +-#define __NR_setfsgid (__NR_Linux + 139) +-#define __NR__llseek (__NR_Linux + 140) +-#define __NR_getdents (__NR_Linux + 141) +-#define __NR__newselect (__NR_Linux + 142) +-#define __NR_flock (__NR_Linux + 143) +-#define __NR_msync (__NR_Linux + 144) +-#define __NR_readv (__NR_Linux + 145) +-#define __NR_writev (__NR_Linux + 146) +-#define __NR_cacheflush (__NR_Linux + 147) +-#define __NR_cachectl (__NR_Linux + 148) +-#define __NR_sysmips (__NR_Linux + 149) +-#define __NR_unused150 (__NR_Linux + 150) +-#define __NR_getsid (__NR_Linux + 151) +-#define __NR_fdatasync (__NR_Linux + 152) +-#define __NR__sysctl (__NR_Linux + 153) +-#define __NR_mlock (__NR_Linux + 154) +-#define __NR_munlock (__NR_Linux + 155) +-#define __NR_mlockall (__NR_Linux + 156) +-#define __NR_munlockall (__NR_Linux + 157) +-#define __NR_sched_setparam (__NR_Linux + 158) +-#define __NR_sched_getparam (__NR_Linux + 159) +-#define __NR_sched_setscheduler (__NR_Linux + 160) +-#define __NR_sched_getscheduler (__NR_Linux + 161) +-#define __NR_sched_yield (__NR_Linux + 162) +-#define __NR_sched_get_priority_max (__NR_Linux + 163) +-#define __NR_sched_get_priority_min (__NR_Linux + 164) +-#define __NR_sched_rr_get_interval (__NR_Linux + 165) +-#define __NR_nanosleep (__NR_Linux + 166) +-#define __NR_mremap (__NR_Linux + 167) +-#define __NR_accept (__NR_Linux + 168) +-#define __NR_bind (__NR_Linux + 169) +-#define __NR_connect (__NR_Linux + 170) +-#define __NR_getpeername (__NR_Linux + 171) +-#define __NR_getsockname (__NR_Linux + 172) +-#define __NR_getsockopt (__NR_Linux + 173) +-#define __NR_listen (__NR_Linux + 174) +-#define __NR_recv (__NR_Linux + 175) +-#define __NR_recvfrom (__NR_Linux + 176) +-#define __NR_recvmsg (__NR_Linux + 177) +-#define __NR_send (__NR_Linux + 178) +-#define __NR_sendmsg (__NR_Linux + 179) +-#define __NR_sendto (__NR_Linux + 180) +-#define __NR_setsockopt (__NR_Linux + 181) +-#define __NR_shutdown (__NR_Linux + 182) +-#define __NR_socket (__NR_Linux + 183) +-#define __NR_socketpair (__NR_Linux + 184) +-#define __NR_setresuid (__NR_Linux + 185) +-#define __NR_getresuid (__NR_Linux + 186) +-#define __NR_query_module (__NR_Linux + 187) +-#define __NR_poll (__NR_Linux + 188) +-#define __NR_nfsservctl (__NR_Linux + 189) +-#define __NR_setresgid (__NR_Linux + 190) +-#define __NR_getresgid (__NR_Linux + 191) +-#define __NR_prctl (__NR_Linux + 192) +-#define __NR_rt_sigreturn (__NR_Linux + 193) +-#define __NR_rt_sigaction (__NR_Linux + 194) +-#define __NR_rt_sigprocmask (__NR_Linux + 195) +-#define __NR_rt_sigpending (__NR_Linux + 196) +-#define __NR_rt_sigtimedwait (__NR_Linux + 197) +-#define __NR_rt_sigqueueinfo (__NR_Linux + 198) +-#define __NR_rt_sigsuspend (__NR_Linux + 199) +-#define __NR_pread64 (__NR_Linux + 200) +-#define __NR_pwrite64 (__NR_Linux + 201) +-#define __NR_chown (__NR_Linux + 202) +-#define __NR_getcwd (__NR_Linux + 203) +-#define __NR_capget (__NR_Linux + 204) +-#define __NR_capset (__NR_Linux + 205) +-#define __NR_sigaltstack (__NR_Linux + 206) +-#define __NR_sendfile (__NR_Linux + 207) +-#define __NR_getpmsg (__NR_Linux + 208) +-#define __NR_putpmsg (__NR_Linux + 209) +-#define __NR_mmap2 (__NR_Linux + 210) +-#define __NR_truncate64 (__NR_Linux + 211) +-#define __NR_ftruncate64 (__NR_Linux + 212) +-#define __NR_stat64 (__NR_Linux + 213) +-#define __NR_lstat64 (__NR_Linux + 214) +-#define __NR_fstat64 (__NR_Linux + 215) +-#define __NR_pivot_root (__NR_Linux + 216) +-#define __NR_mincore (__NR_Linux + 217) +-#define __NR_madvise (__NR_Linux + 218) +-#define __NR_getdents64 (__NR_Linux + 219) +-#define __NR_fcntl64 (__NR_Linux + 220) +-#define __NR_reserved221 (__NR_Linux + 221) +-#define __NR_gettid (__NR_Linux + 222) +-#define __NR_readahead (__NR_Linux + 223) +-#define __NR_setxattr (__NR_Linux + 224) +-#define __NR_lsetxattr (__NR_Linux + 225) +-#define __NR_fsetxattr (__NR_Linux + 226) +-#define __NR_getxattr (__NR_Linux + 227) +-#define __NR_lgetxattr (__NR_Linux + 228) +-#define __NR_fgetxattr (__NR_Linux + 229) +-#define __NR_listxattr (__NR_Linux + 230) +-#define __NR_llistxattr (__NR_Linux + 231) +-#define __NR_flistxattr (__NR_Linux + 232) +-#define __NR_removexattr (__NR_Linux + 233) +-#define __NR_lremovexattr (__NR_Linux + 234) +-#define __NR_fremovexattr (__NR_Linux + 235) +-#define __NR_tkill (__NR_Linux + 236) +-#define __NR_sendfile64 (__NR_Linux + 237) +-#define __NR_futex (__NR_Linux + 238) +-#define __NR_sched_setaffinity (__NR_Linux + 239) +-#define __NR_sched_getaffinity (__NR_Linux + 240) +-#define __NR_io_setup (__NR_Linux + 241) +-#define __NR_io_destroy (__NR_Linux + 242) +-#define __NR_io_getevents (__NR_Linux + 243) +-#define __NR_io_submit (__NR_Linux + 244) +-#define __NR_io_cancel (__NR_Linux + 245) +-#define __NR_exit_group (__NR_Linux + 246) +-#define __NR_lookup_dcookie (__NR_Linux + 247) +-#define __NR_epoll_create (__NR_Linux + 248) +-#define __NR_epoll_ctl (__NR_Linux + 249) +-#define __NR_epoll_wait (__NR_Linux + 250) +-#define __NR_remap_file_pages (__NR_Linux + 251) +-#define __NR_set_tid_address (__NR_Linux + 252) +-#define __NR_restart_syscall (__NR_Linux + 253) +-#define __NR_fadvise64 (__NR_Linux + 254) +-#define __NR_statfs64 (__NR_Linux + 255) +-#define __NR_fstatfs64 (__NR_Linux + 256) +-#define __NR_timer_create (__NR_Linux + 257) +-#define __NR_timer_settime (__NR_Linux + 258) +-#define __NR_timer_gettime (__NR_Linux + 259) +-#define __NR_timer_getoverrun (__NR_Linux + 260) +-#define __NR_timer_delete (__NR_Linux + 261) +-#define __NR_clock_settime (__NR_Linux + 262) +-#define __NR_clock_gettime (__NR_Linux + 263) +-#define __NR_clock_getres (__NR_Linux + 264) +-#define __NR_clock_nanosleep (__NR_Linux + 265) +-#define __NR_tgkill (__NR_Linux + 266) +-#define __NR_utimes (__NR_Linux + 267) +-#define __NR_mbind (__NR_Linux + 268) +-#define __NR_get_mempolicy (__NR_Linux + 269) +-#define __NR_set_mempolicy (__NR_Linux + 270) +-#define __NR_mq_open (__NR_Linux + 271) +-#define __NR_mq_unlink (__NR_Linux + 272) +-#define __NR_mq_timedsend (__NR_Linux + 273) +-#define __NR_mq_timedreceive (__NR_Linux + 274) +-#define __NR_mq_notify (__NR_Linux + 275) +-#define __NR_mq_getsetattr (__NR_Linux + 276) +-#define __NR_vserver (__NR_Linux + 277) +-#define __NR_waitid (__NR_Linux + 278) +-#define __NR_add_key (__NR_Linux + 280) +-#define __NR_request_key (__NR_Linux + 281) +-#define __NR_keyctl (__NR_Linux + 282) +-#define __NR_set_thread_area (__NR_Linux + 283) +-#define __NR_inotify_init (__NR_Linux + 284) +-#define __NR_inotify_add_watch (__NR_Linux + 285) +-#define __NR_inotify_rm_watch (__NR_Linux + 286) +-#define __NR_migrate_pages (__NR_Linux + 287) +-#define __NR_openat (__NR_Linux + 288) +-#define __NR_mkdirat (__NR_Linux + 289) +-#define __NR_mknodat (__NR_Linux + 290) +-#define __NR_fchownat (__NR_Linux + 291) +-#define __NR_futimesat (__NR_Linux + 292) +-#define __NR_fstatat64 (__NR_Linux + 293) +-#define __NR_unlinkat (__NR_Linux + 294) +-#define __NR_renameat (__NR_Linux + 295) +-#define __NR_linkat (__NR_Linux + 296) +-#define __NR_symlinkat (__NR_Linux + 297) +-#define __NR_readlinkat (__NR_Linux + 298) +-#define __NR_fchmodat (__NR_Linux + 299) +-#define __NR_faccessat (__NR_Linux + 300) +-#define __NR_pselect6 (__NR_Linux + 301) +-#define __NR_ppoll (__NR_Linux + 302) +-#define __NR_unshare (__NR_Linux + 303) +-#define __NR_splice (__NR_Linux + 304) +-#define __NR_sync_file_range (__NR_Linux + 305) +-#define __NR_tee (__NR_Linux + 306) +-#define __NR_vmsplice (__NR_Linux + 307) +-#define __NR_move_pages (__NR_Linux + 308) +-#define __NR_set_robust_list (__NR_Linux + 309) +-#define __NR_get_robust_list (__NR_Linux + 310) +-#define __NR_kexec_load (__NR_Linux + 311) +-#define __NR_getcpu (__NR_Linux + 312) +-#define __NR_epoll_pwait (__NR_Linux + 313) +-#define __NR_ioprio_set (__NR_Linux + 314) +-#define __NR_ioprio_get (__NR_Linux + 315) +-#define __NR_utimensat (__NR_Linux + 316) +-#define __NR_signalfd (__NR_Linux + 317) +-#define __NR_timerfd (__NR_Linux + 318) +-#define __NR_eventfd (__NR_Linux + 319) +-#define __NR_fallocate (__NR_Linux + 320) +-#define __NR_timerfd_create (__NR_Linux + 321) +-#define __NR_timerfd_gettime (__NR_Linux + 322) +-#define __NR_timerfd_settime (__NR_Linux + 323) +-#define __NR_signalfd4 (__NR_Linux + 324) +-#define __NR_eventfd2 (__NR_Linux + 325) +-#define __NR_epoll_create1 (__NR_Linux + 326) +-#define __NR_dup3 (__NR_Linux + 327) +-#define __NR_pipe2 (__NR_Linux + 328) +-#define __NR_inotify_init1 (__NR_Linux + 329) +-#define __NR_preadv (__NR_Linux + 330) +-#define __NR_pwritev (__NR_Linux + 331) +-#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332) +-#define __NR_perf_event_open (__NR_Linux + 333) +-#define __NR_accept4 (__NR_Linux + 334) +-#define __NR_recvmmsg (__NR_Linux + 335) +-#define __NR_fanotify_init (__NR_Linux + 336) +-#define __NR_fanotify_mark (__NR_Linux + 337) +-#define __NR_prlimit64 (__NR_Linux + 338) +-#define __NR_name_to_handle_at (__NR_Linux + 339) +-#define __NR_open_by_handle_at (__NR_Linux + 340) +-#define __NR_clock_adjtime (__NR_Linux + 341) +-#define __NR_syncfs (__NR_Linux + 342) +-#define __NR_sendmmsg (__NR_Linux + 343) +-#define __NR_setns (__NR_Linux + 344) +-#define __NR_process_vm_readv (__NR_Linux + 345) +-#define __NR_process_vm_writev (__NR_Linux + 346) +-#define __NR_kcmp (__NR_Linux + 347) +-#define __NR_finit_module (__NR_Linux + 348) +-#define __NR_sched_setattr (__NR_Linux + 349) +-#define __NR_sched_getattr (__NR_Linux + 350) +-#define __NR_renameat2 (__NR_Linux + 351) +-#define __NR_seccomp (__NR_Linux + 352) +-#define __NR_getrandom (__NR_Linux + 353) +-#define __NR_memfd_create (__NR_Linux + 354) +-#define __NR_bpf (__NR_Linux + 355) +-#define __NR_execveat (__NR_Linux + 356) +-#define __NR_userfaultfd (__NR_Linux + 357) +-#define __NR_membarrier (__NR_Linux + 358) +-#define __NR_mlock2 (__NR_Linux + 359) +-#define __NR_copy_file_range (__NR_Linux + 360) +-#define __NR_preadv2 (__NR_Linux + 361) +-#define __NR_pwritev2 (__NR_Linux + 362) +-#define __NR_pkey_mprotect (__NR_Linux + 363) +-#define __NR_pkey_alloc (__NR_Linux + 364) +-#define __NR_pkey_free (__NR_Linux + 365) +-#define __NR_statx (__NR_Linux + 366) +-#define __NR_rseq (__NR_Linux + 367) +-#define __NR_io_pgetevents (__NR_Linux + 368) +-#define __NR_semget (__NR_Linux + 393) +-#define __NR_semctl (__NR_Linux + 394) +-#define __NR_shmget (__NR_Linux + 395) +-#define __NR_shmctl (__NR_Linux + 396) +-#define __NR_shmat (__NR_Linux + 397) +-#define __NR_shmdt (__NR_Linux + 398) +-#define __NR_msgget (__NR_Linux + 399) +-#define __NR_msgsnd (__NR_Linux + 400) +-#define __NR_msgrcv (__NR_Linux + 401) +-#define __NR_msgctl (__NR_Linux + 402) +-#define __NR_clock_gettime64 (__NR_Linux + 403) +-#define __NR_clock_settime64 (__NR_Linux + 404) +-#define __NR_clock_adjtime64 (__NR_Linux + 405) +-#define __NR_clock_getres_time64 (__NR_Linux + 406) +-#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +-#define __NR_timer_gettime64 (__NR_Linux + 408) +-#define __NR_timer_settime64 (__NR_Linux + 409) +-#define __NR_timerfd_gettime64 (__NR_Linux + 410) +-#define __NR_timerfd_settime64 (__NR_Linux + 411) +-#define __NR_utimensat_time64 (__NR_Linux + 412) +-#define __NR_pselect6_time64 (__NR_Linux + 413) +-#define __NR_ppoll_time64 (__NR_Linux + 414) +-#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +-#define __NR_recvmmsg_time64 (__NR_Linux + 417) +-#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +-#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +-#define __NR_semtimedop_time64 (__NR_Linux + 420) +-#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +-#define __NR_futex_time64 (__NR_Linux + 422) +-#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +-#define __NR_pidfd_send_signal (__NR_Linux + 424) +-#define __NR_io_uring_setup (__NR_Linux + 425) +-#define __NR_io_uring_enter (__NR_Linux + 426) +-#define __NR_io_uring_register (__NR_Linux + 427) +-#define __NR_open_tree (__NR_Linux + 428) +-#define __NR_move_mount (__NR_Linux + 429) +-#define __NR_fsopen (__NR_Linux + 430) +-#define __NR_fsconfig (__NR_Linux + 431) +-#define __NR_fsmount (__NR_Linux + 432) +-#define __NR_fspick (__NR_Linux + 433) +-#define __NR_pidfd_open (__NR_Linux + 434) +-#define __NR_clone3 (__NR_Linux + 435) +-#define __NR_close_range (__NR_Linux + 436) +-#define __NR_openat2 (__NR_Linux + 437) +-#define __NR_pidfd_getfd (__NR_Linux + 438) +-#define __NR_faccessat2 (__NR_Linux + 439) +-#define __NR_process_madvise (__NR_Linux + 440) +-#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_syscall (__NR_Linux + 0) ++#define __NR_exit (__NR_Linux + 1) ++#define __NR_fork (__NR_Linux + 2) ++#define __NR_read (__NR_Linux + 3) ++#define __NR_write (__NR_Linux + 4) ++#define __NR_open (__NR_Linux + 5) ++#define __NR_close (__NR_Linux + 6) ++#define __NR_waitpid (__NR_Linux + 7) ++#define __NR_creat (__NR_Linux + 8) ++#define __NR_link (__NR_Linux + 9) ++#define __NR_unlink (__NR_Linux + 10) ++#define __NR_execve (__NR_Linux + 11) ++#define __NR_chdir (__NR_Linux + 12) ++#define __NR_time (__NR_Linux + 13) ++#define __NR_mknod (__NR_Linux + 14) ++#define __NR_chmod (__NR_Linux + 15) ++#define __NR_lchown (__NR_Linux + 16) ++#define __NR_break (__NR_Linux + 17) ++#define __NR_unused18 (__NR_Linux + 18) ++#define __NR_lseek (__NR_Linux + 19) ++#define __NR_getpid (__NR_Linux + 20) ++#define __NR_mount (__NR_Linux + 21) ++#define __NR_umount (__NR_Linux + 22) ++#define __NR_setuid (__NR_Linux + 23) ++#define __NR_getuid (__NR_Linux + 24) ++#define __NR_stime (__NR_Linux + 25) ++#define __NR_ptrace (__NR_Linux + 26) ++#define __NR_alarm (__NR_Linux + 27) ++#define __NR_unused28 (__NR_Linux + 28) ++#define __NR_pause (__NR_Linux + 29) ++#define __NR_utime (__NR_Linux + 30) ++#define __NR_stty (__NR_Linux + 31) ++#define __NR_gtty (__NR_Linux + 32) ++#define __NR_access (__NR_Linux + 33) ++#define __NR_nice (__NR_Linux + 34) ++#define __NR_ftime (__NR_Linux + 35) ++#define __NR_sync (__NR_Linux + 36) ++#define __NR_kill (__NR_Linux + 37) ++#define __NR_rename (__NR_Linux + 38) ++#define __NR_mkdir (__NR_Linux + 39) ++#define __NR_rmdir (__NR_Linux + 40) ++#define __NR_dup (__NR_Linux + 41) ++#define __NR_pipe (__NR_Linux + 42) ++#define __NR_times (__NR_Linux + 43) ++#define __NR_prof (__NR_Linux + 44) ++#define __NR_brk (__NR_Linux + 45) ++#define __NR_setgid (__NR_Linux + 46) ++#define __NR_getgid (__NR_Linux + 47) ++#define __NR_signal (__NR_Linux + 48) ++#define __NR_geteuid (__NR_Linux + 49) ++#define __NR_getegid (__NR_Linux + 50) ++#define __NR_acct (__NR_Linux + 51) ++#define __NR_umount2 (__NR_Linux + 52) ++#define __NR_lock (__NR_Linux + 53) ++#define __NR_ioctl (__NR_Linux + 54) ++#define __NR_fcntl (__NR_Linux + 55) ++#define __NR_mpx (__NR_Linux + 56) ++#define __NR_setpgid (__NR_Linux + 57) ++#define __NR_ulimit (__NR_Linux + 58) ++#define __NR_unused59 (__NR_Linux + 59) ++#define __NR_umask (__NR_Linux + 60) ++#define __NR_chroot (__NR_Linux + 61) ++#define __NR_ustat (__NR_Linux + 62) ++#define __NR_dup2 (__NR_Linux + 63) ++#define __NR_getppid (__NR_Linux + 64) ++#define __NR_getpgrp (__NR_Linux + 65) ++#define __NR_setsid (__NR_Linux + 66) ++#define __NR_sigaction (__NR_Linux + 67) ++#define __NR_sgetmask (__NR_Linux + 68) ++#define __NR_ssetmask (__NR_Linux + 69) ++#define __NR_setreuid (__NR_Linux + 70) ++#define __NR_setregid (__NR_Linux + 71) ++#define __NR_sigsuspend (__NR_Linux + 72) ++#define __NR_sigpending (__NR_Linux + 73) ++#define __NR_sethostname (__NR_Linux + 74) ++#define __NR_setrlimit (__NR_Linux + 75) ++#define __NR_getrlimit (__NR_Linux + 76) ++#define __NR_getrusage (__NR_Linux + 77) ++#define __NR_gettimeofday (__NR_Linux + 78) ++#define __NR_settimeofday (__NR_Linux + 79) ++#define __NR_getgroups (__NR_Linux + 80) ++#define __NR_setgroups (__NR_Linux + 81) ++#define __NR_reserved82 (__NR_Linux + 82) ++#define __NR_symlink (__NR_Linux + 83) ++#define __NR_unused84 (__NR_Linux + 84) ++#define __NR_readlink (__NR_Linux + 85) ++#define __NR_uselib (__NR_Linux + 86) ++#define __NR_swapon (__NR_Linux + 87) ++#define __NR_reboot (__NR_Linux + 88) ++#define __NR_readdir (__NR_Linux + 89) ++#define __NR_mmap (__NR_Linux + 90) ++#define __NR_munmap (__NR_Linux + 91) ++#define __NR_truncate (__NR_Linux + 92) ++#define __NR_ftruncate (__NR_Linux + 93) ++#define __NR_fchmod (__NR_Linux + 94) ++#define __NR_fchown (__NR_Linux + 95) ++#define __NR_getpriority (__NR_Linux + 96) ++#define __NR_setpriority (__NR_Linux + 97) ++#define __NR_profil (__NR_Linux + 98) ++#define __NR_statfs (__NR_Linux + 99) ++#define __NR_fstatfs (__NR_Linux + 100) ++#define __NR_ioperm (__NR_Linux + 101) ++#define __NR_socketcall (__NR_Linux + 102) ++#define __NR_syslog (__NR_Linux + 103) ++#define __NR_setitimer (__NR_Linux + 104) ++#define __NR_getitimer (__NR_Linux + 105) ++#define __NR_stat (__NR_Linux + 106) ++#define __NR_lstat (__NR_Linux + 107) ++#define __NR_fstat (__NR_Linux + 108) ++#define __NR_unused109 (__NR_Linux + 109) ++#define __NR_iopl (__NR_Linux + 110) ++#define __NR_vhangup (__NR_Linux + 111) ++#define __NR_idle (__NR_Linux + 112) ++#define __NR_vm86 (__NR_Linux + 113) ++#define __NR_wait4 (__NR_Linux + 114) ++#define __NR_swapoff (__NR_Linux + 115) ++#define __NR_sysinfo (__NR_Linux + 116) ++#define __NR_ipc (__NR_Linux + 117) ++#define __NR_fsync (__NR_Linux + 118) ++#define __NR_sigreturn (__NR_Linux + 119) ++#define __NR_clone (__NR_Linux + 120) ++#define __NR_setdomainname (__NR_Linux + 121) ++#define __NR_uname (__NR_Linux + 122) ++#define __NR_modify_ldt (__NR_Linux + 123) ++#define __NR_adjtimex (__NR_Linux + 124) ++#define __NR_mprotect (__NR_Linux + 125) ++#define __NR_sigprocmask (__NR_Linux + 126) ++#define __NR_create_module (__NR_Linux + 127) ++#define __NR_init_module (__NR_Linux + 128) ++#define __NR_delete_module (__NR_Linux + 129) ++#define __NR_get_kernel_syms (__NR_Linux + 130) ++#define __NR_quotactl (__NR_Linux + 131) ++#define __NR_getpgid (__NR_Linux + 132) ++#define __NR_fchdir (__NR_Linux + 133) ++#define __NR_bdflush (__NR_Linux + 134) ++#define __NR_sysfs (__NR_Linux + 135) ++#define __NR_personality (__NR_Linux + 136) ++#define __NR_afs_syscall (__NR_Linux + 137) ++#define __NR_setfsuid (__NR_Linux + 138) ++#define __NR_setfsgid (__NR_Linux + 139) ++#define __NR__llseek (__NR_Linux + 140) ++#define __NR_getdents (__NR_Linux + 141) ++#define __NR__newselect (__NR_Linux + 142) ++#define __NR_flock (__NR_Linux + 143) ++#define __NR_msync (__NR_Linux + 144) ++#define __NR_readv (__NR_Linux + 145) ++#define __NR_writev (__NR_Linux + 146) ++#define __NR_cacheflush (__NR_Linux + 147) ++#define __NR_cachectl (__NR_Linux + 148) ++#define __NR_sysmips (__NR_Linux + 149) ++#define __NR_unused150 (__NR_Linux + 150) ++#define __NR_getsid (__NR_Linux + 151) ++#define __NR_fdatasync (__NR_Linux + 152) ++#define __NR__sysctl (__NR_Linux + 153) ++#define __NR_mlock (__NR_Linux + 154) ++#define __NR_munlock (__NR_Linux + 155) ++#define __NR_mlockall (__NR_Linux + 156) ++#define __NR_munlockall (__NR_Linux + 157) ++#define __NR_sched_setparam (__NR_Linux + 158) ++#define __NR_sched_getparam (__NR_Linux + 159) ++#define __NR_sched_setscheduler (__NR_Linux + 160) ++#define __NR_sched_getscheduler (__NR_Linux + 161) ++#define __NR_sched_yield (__NR_Linux + 162) ++#define __NR_sched_get_priority_max (__NR_Linux + 163) ++#define __NR_sched_get_priority_min (__NR_Linux + 164) ++#define __NR_sched_rr_get_interval (__NR_Linux + 165) ++#define __NR_nanosleep (__NR_Linux + 166) ++#define __NR_mremap (__NR_Linux + 167) ++#define __NR_accept (__NR_Linux + 168) ++#define __NR_bind (__NR_Linux + 169) ++#define __NR_connect (__NR_Linux + 170) ++#define __NR_getpeername (__NR_Linux + 171) ++#define __NR_getsockname (__NR_Linux + 172) ++#define __NR_getsockopt (__NR_Linux + 173) ++#define __NR_listen (__NR_Linux + 174) ++#define __NR_recv (__NR_Linux + 175) ++#define __NR_recvfrom (__NR_Linux + 176) ++#define __NR_recvmsg (__NR_Linux + 177) ++#define __NR_send (__NR_Linux + 178) ++#define __NR_sendmsg (__NR_Linux + 179) ++#define __NR_sendto (__NR_Linux + 180) ++#define __NR_setsockopt (__NR_Linux + 181) ++#define __NR_shutdown (__NR_Linux + 182) ++#define __NR_socket (__NR_Linux + 183) ++#define __NR_socketpair (__NR_Linux + 184) ++#define __NR_setresuid (__NR_Linux + 185) ++#define __NR_getresuid (__NR_Linux + 186) ++#define __NR_query_module (__NR_Linux + 187) ++#define __NR_poll (__NR_Linux + 188) ++#define __NR_nfsservctl (__NR_Linux + 189) ++#define __NR_setresgid (__NR_Linux + 190) ++#define __NR_getresgid (__NR_Linux + 191) ++#define __NR_prctl (__NR_Linux + 192) ++#define __NR_rt_sigreturn (__NR_Linux + 193) ++#define __NR_rt_sigaction (__NR_Linux + 194) ++#define __NR_rt_sigprocmask (__NR_Linux + 195) ++#define __NR_rt_sigpending (__NR_Linux + 196) ++#define __NR_rt_sigtimedwait (__NR_Linux + 197) ++#define __NR_rt_sigqueueinfo (__NR_Linux + 198) ++#define __NR_rt_sigsuspend (__NR_Linux + 199) ++#define __NR_pread64 (__NR_Linux + 200) ++#define __NR_pwrite64 (__NR_Linux + 201) ++#define __NR_chown (__NR_Linux + 202) ++#define __NR_getcwd (__NR_Linux + 203) ++#define __NR_capget (__NR_Linux + 204) ++#define __NR_capset (__NR_Linux + 205) ++#define __NR_sigaltstack (__NR_Linux + 206) ++#define __NR_sendfile (__NR_Linux + 207) ++#define __NR_getpmsg (__NR_Linux + 208) ++#define __NR_putpmsg (__NR_Linux + 209) ++#define __NR_mmap2 (__NR_Linux + 210) ++#define __NR_truncate64 (__NR_Linux + 211) ++#define __NR_ftruncate64 (__NR_Linux + 212) ++#define __NR_stat64 (__NR_Linux + 213) ++#define __NR_lstat64 (__NR_Linux + 214) ++#define __NR_fstat64 (__NR_Linux + 215) ++#define __NR_pivot_root (__NR_Linux + 216) ++#define __NR_mincore (__NR_Linux + 217) ++#define __NR_madvise (__NR_Linux + 218) ++#define __NR_getdents64 (__NR_Linux + 219) ++#define __NR_fcntl64 (__NR_Linux + 220) ++#define __NR_reserved221 (__NR_Linux + 221) ++#define __NR_gettid (__NR_Linux + 222) ++#define __NR_readahead (__NR_Linux + 223) ++#define __NR_setxattr (__NR_Linux + 224) ++#define __NR_lsetxattr (__NR_Linux + 225) ++#define __NR_fsetxattr (__NR_Linux + 226) ++#define __NR_getxattr (__NR_Linux + 227) ++#define __NR_lgetxattr (__NR_Linux + 228) ++#define __NR_fgetxattr (__NR_Linux + 229) ++#define __NR_listxattr (__NR_Linux + 230) ++#define __NR_llistxattr (__NR_Linux + 231) ++#define __NR_flistxattr (__NR_Linux + 232) ++#define __NR_removexattr (__NR_Linux + 233) ++#define __NR_lremovexattr (__NR_Linux + 234) ++#define __NR_fremovexattr (__NR_Linux + 235) ++#define __NR_tkill (__NR_Linux + 236) ++#define __NR_sendfile64 (__NR_Linux + 237) ++#define __NR_futex (__NR_Linux + 238) ++#define __NR_sched_setaffinity (__NR_Linux + 239) ++#define __NR_sched_getaffinity (__NR_Linux + 240) ++#define __NR_io_setup (__NR_Linux + 241) ++#define __NR_io_destroy (__NR_Linux + 242) ++#define __NR_io_getevents (__NR_Linux + 243) ++#define __NR_io_submit (__NR_Linux + 244) ++#define __NR_io_cancel (__NR_Linux + 245) ++#define __NR_exit_group (__NR_Linux + 246) ++#define __NR_lookup_dcookie (__NR_Linux + 247) ++#define __NR_epoll_create (__NR_Linux + 248) ++#define __NR_epoll_ctl (__NR_Linux + 249) ++#define __NR_epoll_wait (__NR_Linux + 250) ++#define __NR_remap_file_pages (__NR_Linux + 251) ++#define __NR_set_tid_address (__NR_Linux + 252) ++#define __NR_restart_syscall (__NR_Linux + 253) ++#define __NR_fadvise64 (__NR_Linux + 254) ++#define __NR_statfs64 (__NR_Linux + 255) ++#define __NR_fstatfs64 (__NR_Linux + 256) ++#define __NR_timer_create (__NR_Linux + 257) ++#define __NR_timer_settime (__NR_Linux + 258) ++#define __NR_timer_gettime (__NR_Linux + 259) ++#define __NR_timer_getoverrun (__NR_Linux + 260) ++#define __NR_timer_delete (__NR_Linux + 261) ++#define __NR_clock_settime (__NR_Linux + 262) ++#define __NR_clock_gettime (__NR_Linux + 263) ++#define __NR_clock_getres (__NR_Linux + 264) ++#define __NR_clock_nanosleep (__NR_Linux + 265) ++#define __NR_tgkill (__NR_Linux + 266) ++#define __NR_utimes (__NR_Linux + 267) ++#define __NR_mbind (__NR_Linux + 268) ++#define __NR_get_mempolicy (__NR_Linux + 269) ++#define __NR_set_mempolicy (__NR_Linux + 270) ++#define __NR_mq_open (__NR_Linux + 271) ++#define __NR_mq_unlink (__NR_Linux + 272) ++#define __NR_mq_timedsend (__NR_Linux + 273) ++#define __NR_mq_timedreceive (__NR_Linux + 274) ++#define __NR_mq_notify (__NR_Linux + 275) ++#define __NR_mq_getsetattr (__NR_Linux + 276) ++#define __NR_vserver (__NR_Linux + 277) ++#define __NR_waitid (__NR_Linux + 278) ++#define __NR_add_key (__NR_Linux + 280) ++#define __NR_request_key (__NR_Linux + 281) ++#define __NR_keyctl (__NR_Linux + 282) ++#define __NR_set_thread_area (__NR_Linux + 283) ++#define __NR_inotify_init (__NR_Linux + 284) ++#define __NR_inotify_add_watch (__NR_Linux + 285) ++#define __NR_inotify_rm_watch (__NR_Linux + 286) ++#define __NR_migrate_pages (__NR_Linux + 287) ++#define __NR_openat (__NR_Linux + 288) ++#define __NR_mkdirat (__NR_Linux + 289) ++#define __NR_mknodat (__NR_Linux + 290) ++#define __NR_fchownat (__NR_Linux + 291) ++#define __NR_futimesat (__NR_Linux + 292) ++#define __NR_fstatat64 (__NR_Linux + 293) ++#define __NR_unlinkat (__NR_Linux + 294) ++#define __NR_renameat (__NR_Linux + 295) ++#define __NR_linkat (__NR_Linux + 296) ++#define __NR_symlinkat (__NR_Linux + 297) ++#define __NR_readlinkat (__NR_Linux + 298) ++#define __NR_fchmodat (__NR_Linux + 299) ++#define __NR_faccessat (__NR_Linux + 300) ++#define __NR_pselect6 (__NR_Linux + 301) ++#define __NR_ppoll (__NR_Linux + 302) ++#define __NR_unshare (__NR_Linux + 303) ++#define __NR_splice (__NR_Linux + 304) ++#define __NR_sync_file_range (__NR_Linux + 305) ++#define __NR_tee (__NR_Linux + 306) ++#define __NR_vmsplice (__NR_Linux + 307) ++#define __NR_move_pages (__NR_Linux + 308) ++#define __NR_set_robust_list (__NR_Linux + 309) ++#define __NR_get_robust_list (__NR_Linux + 310) ++#define __NR_kexec_load (__NR_Linux + 311) ++#define __NR_getcpu (__NR_Linux + 312) ++#define __NR_epoll_pwait (__NR_Linux + 313) ++#define __NR_ioprio_set (__NR_Linux + 314) ++#define __NR_ioprio_get (__NR_Linux + 315) ++#define __NR_utimensat (__NR_Linux + 316) ++#define __NR_signalfd (__NR_Linux + 317) ++#define __NR_timerfd (__NR_Linux + 318) ++#define __NR_eventfd (__NR_Linux + 319) ++#define __NR_fallocate (__NR_Linux + 320) ++#define __NR_timerfd_create (__NR_Linux + 321) ++#define __NR_timerfd_gettime (__NR_Linux + 322) ++#define __NR_timerfd_settime (__NR_Linux + 323) ++#define __NR_signalfd4 (__NR_Linux + 324) ++#define __NR_eventfd2 (__NR_Linux + 325) ++#define __NR_epoll_create1 (__NR_Linux + 326) ++#define __NR_dup3 (__NR_Linux + 327) ++#define __NR_pipe2 (__NR_Linux + 328) ++#define __NR_inotify_init1 (__NR_Linux + 329) ++#define __NR_preadv (__NR_Linux + 330) ++#define __NR_pwritev (__NR_Linux + 331) ++#define __NR_rt_tgsigqueueinfo (__NR_Linux + 332) ++#define __NR_perf_event_open (__NR_Linux + 333) ++#define __NR_accept4 (__NR_Linux + 334) ++#define __NR_recvmmsg (__NR_Linux + 335) ++#define __NR_fanotify_init (__NR_Linux + 336) ++#define __NR_fanotify_mark (__NR_Linux + 337) ++#define __NR_prlimit64 (__NR_Linux + 338) ++#define __NR_name_to_handle_at (__NR_Linux + 339) ++#define __NR_open_by_handle_at (__NR_Linux + 340) ++#define __NR_clock_adjtime (__NR_Linux + 341) ++#define __NR_syncfs (__NR_Linux + 342) ++#define __NR_sendmmsg (__NR_Linux + 343) ++#define __NR_setns (__NR_Linux + 344) ++#define __NR_process_vm_readv (__NR_Linux + 345) ++#define __NR_process_vm_writev (__NR_Linux + 346) ++#define __NR_kcmp (__NR_Linux + 347) ++#define __NR_finit_module (__NR_Linux + 348) ++#define __NR_sched_setattr (__NR_Linux + 349) ++#define __NR_sched_getattr (__NR_Linux + 350) ++#define __NR_renameat2 (__NR_Linux + 351) ++#define __NR_seccomp (__NR_Linux + 352) ++#define __NR_getrandom (__NR_Linux + 353) ++#define __NR_memfd_create (__NR_Linux + 354) ++#define __NR_bpf (__NR_Linux + 355) ++#define __NR_execveat (__NR_Linux + 356) ++#define __NR_userfaultfd (__NR_Linux + 357) ++#define __NR_membarrier (__NR_Linux + 358) ++#define __NR_mlock2 (__NR_Linux + 359) ++#define __NR_copy_file_range (__NR_Linux + 360) ++#define __NR_preadv2 (__NR_Linux + 361) ++#define __NR_pwritev2 (__NR_Linux + 362) ++#define __NR_pkey_mprotect (__NR_Linux + 363) ++#define __NR_pkey_alloc (__NR_Linux + 364) ++#define __NR_pkey_free (__NR_Linux + 365) ++#define __NR_statx (__NR_Linux + 366) ++#define __NR_rseq (__NR_Linux + 367) ++#define __NR_io_pgetevents (__NR_Linux + 368) ++#define __NR_semget (__NR_Linux + 393) ++#define __NR_semctl (__NR_Linux + 394) ++#define __NR_shmget (__NR_Linux + 395) ++#define __NR_shmctl (__NR_Linux + 396) ++#define __NR_shmat (__NR_Linux + 397) ++#define __NR_shmdt (__NR_Linux + 398) ++#define __NR_msgget (__NR_Linux + 399) ++#define __NR_msgsnd (__NR_Linux + 400) ++#define __NR_msgrcv (__NR_Linux + 401) ++#define __NR_msgctl (__NR_Linux + 402) ++#define __NR_clock_gettime64 (__NR_Linux + 403) ++#define __NR_clock_settime64 (__NR_Linux + 404) ++#define __NR_clock_adjtime64 (__NR_Linux + 405) ++#define __NR_clock_getres_time64 (__NR_Linux + 406) ++#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) ++#define __NR_timer_gettime64 (__NR_Linux + 408) ++#define __NR_timer_settime64 (__NR_Linux + 409) ++#define __NR_timerfd_gettime64 (__NR_Linux + 410) ++#define __NR_timerfd_settime64 (__NR_Linux + 411) ++#define __NR_utimensat_time64 (__NR_Linux + 412) ++#define __NR_pselect6_time64 (__NR_Linux + 413) ++#define __NR_ppoll_time64 (__NR_Linux + 414) ++#define __NR_io_pgetevents_time64 (__NR_Linux + 416) ++#define __NR_recvmmsg_time64 (__NR_Linux + 417) ++#define __NR_mq_timedsend_time64 (__NR_Linux + 418) ++#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) ++#define __NR_semtimedop_time64 (__NR_Linux + 420) ++#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) ++#define __NR_futex_time64 (__NR_Linux + 422) ++#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) ++#define __NR_pidfd_send_signal (__NR_Linux + 424) ++#define __NR_io_uring_setup (__NR_Linux + 425) ++#define __NR_io_uring_enter (__NR_Linux + 426) ++#define __NR_io_uring_register (__NR_Linux + 427) ++#define __NR_open_tree (__NR_Linux + 428) ++#define __NR_move_mount (__NR_Linux + 429) ++#define __NR_fsopen (__NR_Linux + 430) ++#define __NR_fsconfig (__NR_Linux + 431) ++#define __NR_fsmount (__NR_Linux + 432) ++#define __NR_fspick (__NR_Linux + 433) ++#define __NR_pidfd_open (__NR_Linux + 434) ++#define __NR_clone3 (__NR_Linux + 435) ++#define __NR_close_range (__NR_Linux + 436) ++#define __NR_openat2 (__NR_Linux + 437) ++#define __NR_pidfd_getfd (__NR_Linux + 438) ++#define __NR_faccessat2 (__NR_Linux + 439) ++#define __NR_process_madvise (__NR_Linux + 440) ++#define __NR_epoll_pwait2 (__NR_Linux + 441) ++#define __NR_mount_setattr (__NR_Linux + 442) ++#define __NR_landlock_create_ruleset (__NR_Linux + 444) ++#define __NR_landlock_add_rule (__NR_Linux + 445) ++#define __NR_landlock_restrict_self (__NR_Linux + 446) + +- +-#endif /* _ASM_MIPS_UNISTD_O32_H */ ++#endif /* _ASM_UNISTD_O32_H */ +diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h +index c3af3f324c..9f18fa090f 100644 +--- a/linux-headers/asm-powerpc/kvm.h ++++ b/linux-headers/asm-powerpc/kvm.h +@@ -644,6 +644,8 @@ struct kvm_ppc_cpu_char { + #define KVM_REG_PPC_MMCR3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc1) + #define KVM_REG_PPC_SIER2 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc2) + #define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3) ++#define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4) ++#define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5) + + /* Transactional Memory checkpointed state: + * This is all GPRs, all VSX regs and a subset of SPRs +diff --git a/linux-headers/asm-powerpc/unistd_32.h b/linux-headers/asm-powerpc/unistd_32.h +index 4624c90043..9155778c19 100644 +--- a/linux-headers/asm-powerpc/unistd_32.h ++++ b/linux-headers/asm-powerpc/unistd_32.h +@@ -1,429 +1,433 @@ +-#ifndef _ASM_POWERPC_UNISTD_32_H +-#define _ASM_POWERPC_UNISTD_32_H ++#ifndef _ASM_UNISTD_32_H ++#define _ASM_UNISTD_32_H + +-#define __NR_restart_syscall 0 +-#define __NR_exit 1 +-#define __NR_fork 2 +-#define __NR_read 3 +-#define __NR_write 4 +-#define __NR_open 5 +-#define __NR_close 6 +-#define __NR_waitpid 7 +-#define __NR_creat 8 +-#define __NR_link 9 +-#define __NR_unlink 10 +-#define __NR_execve 11 +-#define __NR_chdir 12 +-#define __NR_time 13 +-#define __NR_mknod 14 +-#define __NR_chmod 15 +-#define __NR_lchown 16 +-#define __NR_break 17 +-#define __NR_oldstat 18 +-#define __NR_lseek 19 +-#define __NR_getpid 20 +-#define __NR_mount 21 +-#define __NR_umount 22 +-#define __NR_setuid 23 +-#define __NR_getuid 24 +-#define __NR_stime 25 +-#define __NR_ptrace 26 +-#define __NR_alarm 27 +-#define __NR_oldfstat 28 +-#define __NR_pause 29 +-#define __NR_utime 30 +-#define __NR_stty 31 +-#define __NR_gtty 32 +-#define __NR_access 33 +-#define __NR_nice 34 +-#define __NR_ftime 35 +-#define __NR_sync 36 +-#define __NR_kill 37 +-#define __NR_rename 38 +-#define __NR_mkdir 39 +-#define __NR_rmdir 40 +-#define __NR_dup 41 +-#define __NR_pipe 42 +-#define __NR_times 43 +-#define __NR_prof 44 +-#define __NR_brk 45 +-#define __NR_setgid 46 +-#define __NR_getgid 47 +-#define __NR_signal 48 +-#define __NR_geteuid 49 +-#define __NR_getegid 50 +-#define __NR_acct 51 +-#define __NR_umount2 52 +-#define __NR_lock 53 +-#define __NR_ioctl 54 +-#define __NR_fcntl 55 +-#define __NR_mpx 56 +-#define __NR_setpgid 57 +-#define __NR_ulimit 58 +-#define __NR_oldolduname 59 +-#define __NR_umask 60 +-#define __NR_chroot 61 +-#define __NR_ustat 62 +-#define __NR_dup2 63 +-#define __NR_getppid 64 +-#define __NR_getpgrp 65 +-#define __NR_setsid 66 +-#define __NR_sigaction 67 +-#define __NR_sgetmask 68 +-#define __NR_ssetmask 69 +-#define __NR_setreuid 70 +-#define __NR_setregid 71 +-#define __NR_sigsuspend 72 +-#define __NR_sigpending 73 +-#define __NR_sethostname 74 +-#define __NR_setrlimit 75 +-#define __NR_getrlimit 76 +-#define __NR_getrusage 77 +-#define __NR_gettimeofday 78 +-#define __NR_settimeofday 79 +-#define __NR_getgroups 80 +-#define __NR_setgroups 81 +-#define __NR_select 82 +-#define __NR_symlink 83 +-#define __NR_oldlstat 84 +-#define __NR_readlink 85 +-#define __NR_uselib 86 +-#define __NR_swapon 87 +-#define __NR_reboot 88 +-#define __NR_readdir 89 +-#define __NR_mmap 90 +-#define __NR_munmap 91 +-#define __NR_truncate 92 +-#define __NR_ftruncate 93 +-#define __NR_fchmod 94 +-#define __NR_fchown 95 +-#define __NR_getpriority 96 +-#define __NR_setpriority 97 +-#define __NR_profil 98 +-#define __NR_statfs 99 +-#define __NR_fstatfs 100 +-#define __NR_ioperm 101 +-#define __NR_socketcall 102 +-#define __NR_syslog 103 +-#define __NR_setitimer 104 +-#define __NR_getitimer 105 +-#define __NR_stat 106 +-#define __NR_lstat 107 +-#define __NR_fstat 108 +-#define __NR_olduname 109 +-#define __NR_iopl 110 +-#define __NR_vhangup 111 +-#define __NR_idle 112 +-#define __NR_vm86 113 +-#define __NR_wait4 114 +-#define __NR_swapoff 115 +-#define __NR_sysinfo 116 +-#define __NR_ipc 117 +-#define __NR_fsync 118 +-#define __NR_sigreturn 119 +-#define __NR_clone 120 +-#define __NR_setdomainname 121 +-#define __NR_uname 122 +-#define __NR_modify_ldt 123 +-#define __NR_adjtimex 124 +-#define __NR_mprotect 125 +-#define __NR_sigprocmask 126 +-#define __NR_create_module 127 +-#define __NR_init_module 128 +-#define __NR_delete_module 129 +-#define __NR_get_kernel_syms 130 +-#define __NR_quotactl 131 +-#define __NR_getpgid 132 +-#define __NR_fchdir 133 +-#define __NR_bdflush 134 +-#define __NR_sysfs 135 +-#define __NR_personality 136 +-#define __NR_afs_syscall 137 +-#define __NR_setfsuid 138 +-#define __NR_setfsgid 139 +-#define __NR__llseek 140 +-#define __NR_getdents 141 +-#define __NR__newselect 142 +-#define __NR_flock 143 +-#define __NR_msync 144 +-#define __NR_readv 145 +-#define __NR_writev 146 +-#define __NR_getsid 147 +-#define __NR_fdatasync 148 +-#define __NR__sysctl 149 +-#define __NR_mlock 150 +-#define __NR_munlock 151 +-#define __NR_mlockall 152 +-#define __NR_munlockall 153 +-#define __NR_sched_setparam 154 +-#define __NR_sched_getparam 155 +-#define __NR_sched_setscheduler 156 +-#define __NR_sched_getscheduler 157 +-#define __NR_sched_yield 158 +-#define __NR_sched_get_priority_max 159 +-#define __NR_sched_get_priority_min 160 +-#define __NR_sched_rr_get_interval 161 +-#define __NR_nanosleep 162 +-#define __NR_mremap 163 +-#define __NR_setresuid 164 +-#define __NR_getresuid 165 +-#define __NR_query_module 166 +-#define __NR_poll 167 +-#define __NR_nfsservctl 168 +-#define __NR_setresgid 169 +-#define __NR_getresgid 170 +-#define __NR_prctl 171 +-#define __NR_rt_sigreturn 172 +-#define __NR_rt_sigaction 173 +-#define __NR_rt_sigprocmask 174 +-#define __NR_rt_sigpending 175 +-#define __NR_rt_sigtimedwait 176 +-#define __NR_rt_sigqueueinfo 177 +-#define __NR_rt_sigsuspend 178 +-#define __NR_pread64 179 +-#define __NR_pwrite64 180 +-#define __NR_chown 181 +-#define __NR_getcwd 182 +-#define __NR_capget 183 +-#define __NR_capset 184 +-#define __NR_sigaltstack 185 +-#define __NR_sendfile 186 +-#define __NR_getpmsg 187 +-#define __NR_putpmsg 188 +-#define __NR_vfork 189 +-#define __NR_ugetrlimit 190 +-#define __NR_readahead 191 +-#define __NR_mmap2 192 +-#define __NR_truncate64 193 +-#define __NR_ftruncate64 194 +-#define __NR_stat64 195 +-#define __NR_lstat64 196 +-#define __NR_fstat64 197 +-#define __NR_pciconfig_read 198 +-#define __NR_pciconfig_write 199 +-#define __NR_pciconfig_iobase 200 +-#define __NR_multiplexer 201 +-#define __NR_getdents64 202 +-#define __NR_pivot_root 203 +-#define __NR_fcntl64 204 +-#define __NR_madvise 205 +-#define __NR_mincore 206 +-#define __NR_gettid 207 +-#define __NR_tkill 208 +-#define __NR_setxattr 209 +-#define __NR_lsetxattr 210 +-#define __NR_fsetxattr 211 +-#define __NR_getxattr 212 +-#define __NR_lgetxattr 213 +-#define __NR_fgetxattr 214 +-#define __NR_listxattr 215 +-#define __NR_llistxattr 216 +-#define __NR_flistxattr 217 +-#define __NR_removexattr 218 +-#define __NR_lremovexattr 219 +-#define __NR_fremovexattr 220 +-#define __NR_futex 221 +-#define __NR_sched_setaffinity 222 +-#define __NR_sched_getaffinity 223 +-#define __NR_tuxcall 225 +-#define __NR_sendfile64 226 +-#define __NR_io_setup 227 +-#define __NR_io_destroy 228 +-#define __NR_io_getevents 229 +-#define __NR_io_submit 230 +-#define __NR_io_cancel 231 +-#define __NR_set_tid_address 232 +-#define __NR_fadvise64 233 +-#define __NR_exit_group 234 +-#define __NR_lookup_dcookie 235 +-#define __NR_epoll_create 236 +-#define __NR_epoll_ctl 237 +-#define __NR_epoll_wait 238 +-#define __NR_remap_file_pages 239 +-#define __NR_timer_create 240 +-#define __NR_timer_settime 241 +-#define __NR_timer_gettime 242 +-#define __NR_timer_getoverrun 243 +-#define __NR_timer_delete 244 +-#define __NR_clock_settime 245 +-#define __NR_clock_gettime 246 +-#define __NR_clock_getres 247 +-#define __NR_clock_nanosleep 248 +-#define __NR_swapcontext 249 +-#define __NR_tgkill 250 +-#define __NR_utimes 251 +-#define __NR_statfs64 252 +-#define __NR_fstatfs64 253 +-#define __NR_fadvise64_64 254 +-#define __NR_rtas 255 +-#define __NR_sys_debug_setcontext 256 +-#define __NR_migrate_pages 258 +-#define __NR_mbind 259 +-#define __NR_get_mempolicy 260 +-#define __NR_set_mempolicy 261 +-#define __NR_mq_open 262 +-#define __NR_mq_unlink 263 +-#define __NR_mq_timedsend 264 +-#define __NR_mq_timedreceive 265 +-#define __NR_mq_notify 266 +-#define __NR_mq_getsetattr 267 +-#define __NR_kexec_load 268 +-#define __NR_add_key 269 +-#define __NR_request_key 270 +-#define __NR_keyctl 271 +-#define __NR_waitid 272 +-#define __NR_ioprio_set 273 +-#define __NR_ioprio_get 274 +-#define __NR_inotify_init 275 +-#define __NR_inotify_add_watch 276 +-#define __NR_inotify_rm_watch 277 +-#define __NR_spu_run 278 +-#define __NR_spu_create 279 +-#define __NR_pselect6 280 +-#define __NR_ppoll 281 +-#define __NR_unshare 282 +-#define __NR_splice 283 +-#define __NR_tee 284 +-#define __NR_vmsplice 285 +-#define __NR_openat 286 +-#define __NR_mkdirat 287 +-#define __NR_mknodat 288 +-#define __NR_fchownat 289 +-#define __NR_futimesat 290 +-#define __NR_fstatat64 291 +-#define __NR_unlinkat 292 +-#define __NR_renameat 293 +-#define __NR_linkat 294 +-#define __NR_symlinkat 295 +-#define __NR_readlinkat 296 +-#define __NR_fchmodat 297 +-#define __NR_faccessat 298 +-#define __NR_get_robust_list 299 +-#define __NR_set_robust_list 300 +-#define __NR_move_pages 301 +-#define __NR_getcpu 302 +-#define __NR_epoll_pwait 303 +-#define __NR_utimensat 304 +-#define __NR_signalfd 305 +-#define __NR_timerfd_create 306 +-#define __NR_eventfd 307 +-#define __NR_sync_file_range2 308 +-#define __NR_fallocate 309 +-#define __NR_subpage_prot 310 +-#define __NR_timerfd_settime 311 +-#define __NR_timerfd_gettime 312 +-#define __NR_signalfd4 313 +-#define __NR_eventfd2 314 +-#define __NR_epoll_create1 315 +-#define __NR_dup3 316 +-#define __NR_pipe2 317 +-#define __NR_inotify_init1 318 +-#define __NR_perf_event_open 319 +-#define __NR_preadv 320 +-#define __NR_pwritev 321 +-#define __NR_rt_tgsigqueueinfo 322 +-#define __NR_fanotify_init 323 +-#define __NR_fanotify_mark 324 +-#define __NR_prlimit64 325 +-#define __NR_socket 326 +-#define __NR_bind 327 +-#define __NR_connect 328 +-#define __NR_listen 329 +-#define __NR_accept 330 +-#define __NR_getsockname 331 +-#define __NR_getpeername 332 +-#define __NR_socketpair 333 +-#define __NR_send 334 +-#define __NR_sendto 335 +-#define __NR_recv 336 +-#define __NR_recvfrom 337 +-#define __NR_shutdown 338 +-#define __NR_setsockopt 339 +-#define __NR_getsockopt 340 +-#define __NR_sendmsg 341 +-#define __NR_recvmsg 342 +-#define __NR_recvmmsg 343 +-#define __NR_accept4 344 +-#define __NR_name_to_handle_at 345 +-#define __NR_open_by_handle_at 346 +-#define __NR_clock_adjtime 347 +-#define __NR_syncfs 348 +-#define __NR_sendmmsg 349 +-#define __NR_setns 350 +-#define __NR_process_vm_readv 351 +-#define __NR_process_vm_writev 352 +-#define __NR_finit_module 353 +-#define __NR_kcmp 354 +-#define __NR_sched_setattr 355 +-#define __NR_sched_getattr 356 +-#define __NR_renameat2 357 +-#define __NR_seccomp 358 +-#define __NR_getrandom 359 +-#define __NR_memfd_create 360 +-#define __NR_bpf 361 +-#define __NR_execveat 362 +-#define __NR_switch_endian 363 +-#define __NR_userfaultfd 364 +-#define __NR_membarrier 365 +-#define __NR_mlock2 378 +-#define __NR_copy_file_range 379 +-#define __NR_preadv2 380 +-#define __NR_pwritev2 381 +-#define __NR_kexec_file_load 382 +-#define __NR_statx 383 +-#define __NR_pkey_alloc 384 +-#define __NR_pkey_free 385 +-#define __NR_pkey_mprotect 386 +-#define __NR_rseq 387 +-#define __NR_io_pgetevents 388 +-#define __NR_semget 393 +-#define __NR_semctl 394 +-#define __NR_shmget 395 +-#define __NR_shmctl 396 +-#define __NR_shmat 397 +-#define __NR_shmdt 398 +-#define __NR_msgget 399 +-#define __NR_msgsnd 400 +-#define __NR_msgrcv 401 +-#define __NR_msgctl 402 +-#define __NR_clock_gettime64 403 +-#define __NR_clock_settime64 404 +-#define __NR_clock_adjtime64 405 +-#define __NR_clock_getres_time64 406 +-#define __NR_clock_nanosleep_time64 407 +-#define __NR_timer_gettime64 408 +-#define __NR_timer_settime64 409 +-#define __NR_timerfd_gettime64 410 +-#define __NR_timerfd_settime64 411 +-#define __NR_utimensat_time64 412 +-#define __NR_pselect6_time64 413 +-#define __NR_ppoll_time64 414 +-#define __NR_io_pgetevents_time64 416 +-#define __NR_recvmmsg_time64 417 +-#define __NR_mq_timedsend_time64 418 +-#define __NR_mq_timedreceive_time64 419 +-#define __NR_semtimedop_time64 420 +-#define __NR_rt_sigtimedwait_time64 421 +-#define __NR_futex_time64 422 +-#define __NR_sched_rr_get_interval_time64 423 +-#define __NR_pidfd_send_signal 424 +-#define __NR_io_uring_setup 425 +-#define __NR_io_uring_enter 426 +-#define __NR_io_uring_register 427 +-#define __NR_open_tree 428 +-#define __NR_move_mount 429 +-#define __NR_fsopen 430 +-#define __NR_fsconfig 431 +-#define __NR_fsmount 432 +-#define __NR_fspick 433 +-#define __NR_pidfd_open 434 +-#define __NR_clone3 435 +-#define __NR_close_range 436 +-#define __NR_openat2 437 +-#define __NR_pidfd_getfd 438 +-#define __NR_faccessat2 439 +-#define __NR_process_madvise 440 +-#define __NR_epoll_pwait2 441 ++#define __NR_restart_syscall 0 ++#define __NR_exit 1 ++#define __NR_fork 2 ++#define __NR_read 3 ++#define __NR_write 4 ++#define __NR_open 5 ++#define __NR_close 6 ++#define __NR_waitpid 7 ++#define __NR_creat 8 ++#define __NR_link 9 ++#define __NR_unlink 10 ++#define __NR_execve 11 ++#define __NR_chdir 12 ++#define __NR_time 13 ++#define __NR_mknod 14 ++#define __NR_chmod 15 ++#define __NR_lchown 16 ++#define __NR_break 17 ++#define __NR_oldstat 18 ++#define __NR_lseek 19 ++#define __NR_getpid 20 ++#define __NR_mount 21 ++#define __NR_umount 22 ++#define __NR_setuid 23 ++#define __NR_getuid 24 ++#define __NR_stime 25 ++#define __NR_ptrace 26 ++#define __NR_alarm 27 ++#define __NR_oldfstat 28 ++#define __NR_pause 29 ++#define __NR_utime 30 ++#define __NR_stty 31 ++#define __NR_gtty 32 ++#define __NR_access 33 ++#define __NR_nice 34 ++#define __NR_ftime 35 ++#define __NR_sync 36 ++#define __NR_kill 37 ++#define __NR_rename 38 ++#define __NR_mkdir 39 ++#define __NR_rmdir 40 ++#define __NR_dup 41 ++#define __NR_pipe 42 ++#define __NR_times 43 ++#define __NR_prof 44 ++#define __NR_brk 45 ++#define __NR_setgid 46 ++#define __NR_getgid 47 ++#define __NR_signal 48 ++#define __NR_geteuid 49 ++#define __NR_getegid 50 ++#define __NR_acct 51 ++#define __NR_umount2 52 ++#define __NR_lock 53 ++#define __NR_ioctl 54 ++#define __NR_fcntl 55 ++#define __NR_mpx 56 ++#define __NR_setpgid 57 ++#define __NR_ulimit 58 ++#define __NR_oldolduname 59 ++#define __NR_umask 60 ++#define __NR_chroot 61 ++#define __NR_ustat 62 ++#define __NR_dup2 63 ++#define __NR_getppid 64 ++#define __NR_getpgrp 65 ++#define __NR_setsid 66 ++#define __NR_sigaction 67 ++#define __NR_sgetmask 68 ++#define __NR_ssetmask 69 ++#define __NR_setreuid 70 ++#define __NR_setregid 71 ++#define __NR_sigsuspend 72 ++#define __NR_sigpending 73 ++#define __NR_sethostname 74 ++#define __NR_setrlimit 75 ++#define __NR_getrlimit 76 ++#define __NR_getrusage 77 ++#define __NR_gettimeofday 78 ++#define __NR_settimeofday 79 ++#define __NR_getgroups 80 ++#define __NR_setgroups 81 ++#define __NR_select 82 ++#define __NR_symlink 83 ++#define __NR_oldlstat 84 ++#define __NR_readlink 85 ++#define __NR_uselib 86 ++#define __NR_swapon 87 ++#define __NR_reboot 88 ++#define __NR_readdir 89 ++#define __NR_mmap 90 ++#define __NR_munmap 91 ++#define __NR_truncate 92 ++#define __NR_ftruncate 93 ++#define __NR_fchmod 94 ++#define __NR_fchown 95 ++#define __NR_getpriority 96 ++#define __NR_setpriority 97 ++#define __NR_profil 98 ++#define __NR_statfs 99 ++#define __NR_fstatfs 100 ++#define __NR_ioperm 101 ++#define __NR_socketcall 102 ++#define __NR_syslog 103 ++#define __NR_setitimer 104 ++#define __NR_getitimer 105 ++#define __NR_stat 106 ++#define __NR_lstat 107 ++#define __NR_fstat 108 ++#define __NR_olduname 109 ++#define __NR_iopl 110 ++#define __NR_vhangup 111 ++#define __NR_idle 112 ++#define __NR_vm86 113 ++#define __NR_wait4 114 ++#define __NR_swapoff 115 ++#define __NR_sysinfo 116 ++#define __NR_ipc 117 ++#define __NR_fsync 118 ++#define __NR_sigreturn 119 ++#define __NR_clone 120 ++#define __NR_setdomainname 121 ++#define __NR_uname 122 ++#define __NR_modify_ldt 123 ++#define __NR_adjtimex 124 ++#define __NR_mprotect 125 ++#define __NR_sigprocmask 126 ++#define __NR_create_module 127 ++#define __NR_init_module 128 ++#define __NR_delete_module 129 ++#define __NR_get_kernel_syms 130 ++#define __NR_quotactl 131 ++#define __NR_getpgid 132 ++#define __NR_fchdir 133 ++#define __NR_bdflush 134 ++#define __NR_sysfs 135 ++#define __NR_personality 136 ++#define __NR_afs_syscall 137 ++#define __NR_setfsuid 138 ++#define __NR_setfsgid 139 ++#define __NR__llseek 140 ++#define __NR_getdents 141 ++#define __NR__newselect 142 ++#define __NR_flock 143 ++#define __NR_msync 144 ++#define __NR_readv 145 ++#define __NR_writev 146 ++#define __NR_getsid 147 ++#define __NR_fdatasync 148 ++#define __NR__sysctl 149 ++#define __NR_mlock 150 ++#define __NR_munlock 151 ++#define __NR_mlockall 152 ++#define __NR_munlockall 153 ++#define __NR_sched_setparam 154 ++#define __NR_sched_getparam 155 ++#define __NR_sched_setscheduler 156 ++#define __NR_sched_getscheduler 157 ++#define __NR_sched_yield 158 ++#define __NR_sched_get_priority_max 159 ++#define __NR_sched_get_priority_min 160 ++#define __NR_sched_rr_get_interval 161 ++#define __NR_nanosleep 162 ++#define __NR_mremap 163 ++#define __NR_setresuid 164 ++#define __NR_getresuid 165 ++#define __NR_query_module 166 ++#define __NR_poll 167 ++#define __NR_nfsservctl 168 ++#define __NR_setresgid 169 ++#define __NR_getresgid 170 ++#define __NR_prctl 171 ++#define __NR_rt_sigreturn 172 ++#define __NR_rt_sigaction 173 ++#define __NR_rt_sigprocmask 174 ++#define __NR_rt_sigpending 175 ++#define __NR_rt_sigtimedwait 176 ++#define __NR_rt_sigqueueinfo 177 ++#define __NR_rt_sigsuspend 178 ++#define __NR_pread64 179 ++#define __NR_pwrite64 180 ++#define __NR_chown 181 ++#define __NR_getcwd 182 ++#define __NR_capget 183 ++#define __NR_capset 184 ++#define __NR_sigaltstack 185 ++#define __NR_sendfile 186 ++#define __NR_getpmsg 187 ++#define __NR_putpmsg 188 ++#define __NR_vfork 189 ++#define __NR_ugetrlimit 190 ++#define __NR_readahead 191 ++#define __NR_mmap2 192 ++#define __NR_truncate64 193 ++#define __NR_ftruncate64 194 ++#define __NR_stat64 195 ++#define __NR_lstat64 196 ++#define __NR_fstat64 197 ++#define __NR_pciconfig_read 198 ++#define __NR_pciconfig_write 199 ++#define __NR_pciconfig_iobase 200 ++#define __NR_multiplexer 201 ++#define __NR_getdents64 202 ++#define __NR_pivot_root 203 ++#define __NR_fcntl64 204 ++#define __NR_madvise 205 ++#define __NR_mincore 206 ++#define __NR_gettid 207 ++#define __NR_tkill 208 ++#define __NR_setxattr 209 ++#define __NR_lsetxattr 210 ++#define __NR_fsetxattr 211 ++#define __NR_getxattr 212 ++#define __NR_lgetxattr 213 ++#define __NR_fgetxattr 214 ++#define __NR_listxattr 215 ++#define __NR_llistxattr 216 ++#define __NR_flistxattr 217 ++#define __NR_removexattr 218 ++#define __NR_lremovexattr 219 ++#define __NR_fremovexattr 220 ++#define __NR_futex 221 ++#define __NR_sched_setaffinity 222 ++#define __NR_sched_getaffinity 223 ++#define __NR_tuxcall 225 ++#define __NR_sendfile64 226 ++#define __NR_io_setup 227 ++#define __NR_io_destroy 228 ++#define __NR_io_getevents 229 ++#define __NR_io_submit 230 ++#define __NR_io_cancel 231 ++#define __NR_set_tid_address 232 ++#define __NR_fadvise64 233 ++#define __NR_exit_group 234 ++#define __NR_lookup_dcookie 235 ++#define __NR_epoll_create 236 ++#define __NR_epoll_ctl 237 ++#define __NR_epoll_wait 238 ++#define __NR_remap_file_pages 239 ++#define __NR_timer_create 240 ++#define __NR_timer_settime 241 ++#define __NR_timer_gettime 242 ++#define __NR_timer_getoverrun 243 ++#define __NR_timer_delete 244 ++#define __NR_clock_settime 245 ++#define __NR_clock_gettime 246 ++#define __NR_clock_getres 247 ++#define __NR_clock_nanosleep 248 ++#define __NR_swapcontext 249 ++#define __NR_tgkill 250 ++#define __NR_utimes 251 ++#define __NR_statfs64 252 ++#define __NR_fstatfs64 253 ++#define __NR_fadvise64_64 254 ++#define __NR_rtas 255 ++#define __NR_sys_debug_setcontext 256 ++#define __NR_migrate_pages 258 ++#define __NR_mbind 259 ++#define __NR_get_mempolicy 260 ++#define __NR_set_mempolicy 261 ++#define __NR_mq_open 262 ++#define __NR_mq_unlink 263 ++#define __NR_mq_timedsend 264 ++#define __NR_mq_timedreceive 265 ++#define __NR_mq_notify 266 ++#define __NR_mq_getsetattr 267 ++#define __NR_kexec_load 268 ++#define __NR_add_key 269 ++#define __NR_request_key 270 ++#define __NR_keyctl 271 ++#define __NR_waitid 272 ++#define __NR_ioprio_set 273 ++#define __NR_ioprio_get 274 ++#define __NR_inotify_init 275 ++#define __NR_inotify_add_watch 276 ++#define __NR_inotify_rm_watch 277 ++#define __NR_spu_run 278 ++#define __NR_spu_create 279 ++#define __NR_pselect6 280 ++#define __NR_ppoll 281 ++#define __NR_unshare 282 ++#define __NR_splice 283 ++#define __NR_tee 284 ++#define __NR_vmsplice 285 ++#define __NR_openat 286 ++#define __NR_mkdirat 287 ++#define __NR_mknodat 288 ++#define __NR_fchownat 289 ++#define __NR_futimesat 290 ++#define __NR_fstatat64 291 ++#define __NR_unlinkat 292 ++#define __NR_renameat 293 ++#define __NR_linkat 294 ++#define __NR_symlinkat 295 ++#define __NR_readlinkat 296 ++#define __NR_fchmodat 297 ++#define __NR_faccessat 298 ++#define __NR_get_robust_list 299 ++#define __NR_set_robust_list 300 ++#define __NR_move_pages 301 ++#define __NR_getcpu 302 ++#define __NR_epoll_pwait 303 ++#define __NR_utimensat 304 ++#define __NR_signalfd 305 ++#define __NR_timerfd_create 306 ++#define __NR_eventfd 307 ++#define __NR_sync_file_range2 308 ++#define __NR_fallocate 309 ++#define __NR_subpage_prot 310 ++#define __NR_timerfd_settime 311 ++#define __NR_timerfd_gettime 312 ++#define __NR_signalfd4 313 ++#define __NR_eventfd2 314 ++#define __NR_epoll_create1 315 ++#define __NR_dup3 316 ++#define __NR_pipe2 317 ++#define __NR_inotify_init1 318 ++#define __NR_perf_event_open 319 ++#define __NR_preadv 320 ++#define __NR_pwritev 321 ++#define __NR_rt_tgsigqueueinfo 322 ++#define __NR_fanotify_init 323 ++#define __NR_fanotify_mark 324 ++#define __NR_prlimit64 325 ++#define __NR_socket 326 ++#define __NR_bind 327 ++#define __NR_connect 328 ++#define __NR_listen 329 ++#define __NR_accept 330 ++#define __NR_getsockname 331 ++#define __NR_getpeername 332 ++#define __NR_socketpair 333 ++#define __NR_send 334 ++#define __NR_sendto 335 ++#define __NR_recv 336 ++#define __NR_recvfrom 337 ++#define __NR_shutdown 338 ++#define __NR_setsockopt 339 ++#define __NR_getsockopt 340 ++#define __NR_sendmsg 341 ++#define __NR_recvmsg 342 ++#define __NR_recvmmsg 343 ++#define __NR_accept4 344 ++#define __NR_name_to_handle_at 345 ++#define __NR_open_by_handle_at 346 ++#define __NR_clock_adjtime 347 ++#define __NR_syncfs 348 ++#define __NR_sendmmsg 349 ++#define __NR_setns 350 ++#define __NR_process_vm_readv 351 ++#define __NR_process_vm_writev 352 ++#define __NR_finit_module 353 ++#define __NR_kcmp 354 ++#define __NR_sched_setattr 355 ++#define __NR_sched_getattr 356 ++#define __NR_renameat2 357 ++#define __NR_seccomp 358 ++#define __NR_getrandom 359 ++#define __NR_memfd_create 360 ++#define __NR_bpf 361 ++#define __NR_execveat 362 ++#define __NR_switch_endian 363 ++#define __NR_userfaultfd 364 ++#define __NR_membarrier 365 ++#define __NR_mlock2 378 ++#define __NR_copy_file_range 379 ++#define __NR_preadv2 380 ++#define __NR_pwritev2 381 ++#define __NR_kexec_file_load 382 ++#define __NR_statx 383 ++#define __NR_pkey_alloc 384 ++#define __NR_pkey_free 385 ++#define __NR_pkey_mprotect 386 ++#define __NR_rseq 387 ++#define __NR_io_pgetevents 388 ++#define __NR_semget 393 ++#define __NR_semctl 394 ++#define __NR_shmget 395 ++#define __NR_shmctl 396 ++#define __NR_shmat 397 ++#define __NR_shmdt 398 ++#define __NR_msgget 399 ++#define __NR_msgsnd 400 ++#define __NR_msgrcv 401 ++#define __NR_msgctl 402 ++#define __NR_clock_gettime64 403 ++#define __NR_clock_settime64 404 ++#define __NR_clock_adjtime64 405 ++#define __NR_clock_getres_time64 406 ++#define __NR_clock_nanosleep_time64 407 ++#define __NR_timer_gettime64 408 ++#define __NR_timer_settime64 409 ++#define __NR_timerfd_gettime64 410 ++#define __NR_timerfd_settime64 411 ++#define __NR_utimensat_time64 412 ++#define __NR_pselect6_time64 413 ++#define __NR_ppoll_time64 414 ++#define __NR_io_pgetevents_time64 416 ++#define __NR_recvmmsg_time64 417 ++#define __NR_mq_timedsend_time64 418 ++#define __NR_mq_timedreceive_time64 419 ++#define __NR_semtimedop_time64 420 ++#define __NR_rt_sigtimedwait_time64 421 ++#define __NR_futex_time64 422 ++#define __NR_sched_rr_get_interval_time64 423 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + +-#endif /* _ASM_POWERPC_UNISTD_32_H */ ++#endif /* _ASM_UNISTD_32_H */ +diff --git a/linux-headers/asm-powerpc/unistd_64.h b/linux-headers/asm-powerpc/unistd_64.h +index 7e851b30bb..3cefa88932 100644 +--- a/linux-headers/asm-powerpc/unistd_64.h ++++ b/linux-headers/asm-powerpc/unistd_64.h +@@ -1,401 +1,405 @@ +-#ifndef _ASM_POWERPC_UNISTD_64_H +-#define _ASM_POWERPC_UNISTD_64_H ++#ifndef _ASM_UNISTD_64_H ++#define _ASM_UNISTD_64_H + +-#define __NR_restart_syscall 0 +-#define __NR_exit 1 +-#define __NR_fork 2 +-#define __NR_read 3 +-#define __NR_write 4 +-#define __NR_open 5 +-#define __NR_close 6 +-#define __NR_waitpid 7 +-#define __NR_creat 8 +-#define __NR_link 9 +-#define __NR_unlink 10 +-#define __NR_execve 11 +-#define __NR_chdir 12 +-#define __NR_time 13 +-#define __NR_mknod 14 +-#define __NR_chmod 15 +-#define __NR_lchown 16 +-#define __NR_break 17 +-#define __NR_oldstat 18 +-#define __NR_lseek 19 +-#define __NR_getpid 20 +-#define __NR_mount 21 +-#define __NR_umount 22 +-#define __NR_setuid 23 +-#define __NR_getuid 24 +-#define __NR_stime 25 +-#define __NR_ptrace 26 +-#define __NR_alarm 27 +-#define __NR_oldfstat 28 +-#define __NR_pause 29 +-#define __NR_utime 30 +-#define __NR_stty 31 +-#define __NR_gtty 32 +-#define __NR_access 33 +-#define __NR_nice 34 +-#define __NR_ftime 35 +-#define __NR_sync 36 +-#define __NR_kill 37 +-#define __NR_rename 38 +-#define __NR_mkdir 39 +-#define __NR_rmdir 40 +-#define __NR_dup 41 +-#define __NR_pipe 42 +-#define __NR_times 43 +-#define __NR_prof 44 +-#define __NR_brk 45 +-#define __NR_setgid 46 +-#define __NR_getgid 47 +-#define __NR_signal 48 +-#define __NR_geteuid 49 +-#define __NR_getegid 50 +-#define __NR_acct 51 +-#define __NR_umount2 52 +-#define __NR_lock 53 +-#define __NR_ioctl 54 +-#define __NR_fcntl 55 +-#define __NR_mpx 56 +-#define __NR_setpgid 57 +-#define __NR_ulimit 58 +-#define __NR_oldolduname 59 +-#define __NR_umask 60 +-#define __NR_chroot 61 +-#define __NR_ustat 62 +-#define __NR_dup2 63 +-#define __NR_getppid 64 +-#define __NR_getpgrp 65 +-#define __NR_setsid 66 +-#define __NR_sigaction 67 +-#define __NR_sgetmask 68 +-#define __NR_ssetmask 69 +-#define __NR_setreuid 70 +-#define __NR_setregid 71 +-#define __NR_sigsuspend 72 +-#define __NR_sigpending 73 +-#define __NR_sethostname 74 +-#define __NR_setrlimit 75 +-#define __NR_getrlimit 76 +-#define __NR_getrusage 77 +-#define __NR_gettimeofday 78 +-#define __NR_settimeofday 79 +-#define __NR_getgroups 80 +-#define __NR_setgroups 81 +-#define __NR_select 82 +-#define __NR_symlink 83 +-#define __NR_oldlstat 84 +-#define __NR_readlink 85 +-#define __NR_uselib 86 +-#define __NR_swapon 87 +-#define __NR_reboot 88 +-#define __NR_readdir 89 +-#define __NR_mmap 90 +-#define __NR_munmap 91 +-#define __NR_truncate 92 +-#define __NR_ftruncate 93 +-#define __NR_fchmod 94 +-#define __NR_fchown 95 +-#define __NR_getpriority 96 +-#define __NR_setpriority 97 +-#define __NR_profil 98 +-#define __NR_statfs 99 +-#define __NR_fstatfs 100 +-#define __NR_ioperm 101 +-#define __NR_socketcall 102 +-#define __NR_syslog 103 +-#define __NR_setitimer 104 +-#define __NR_getitimer 105 +-#define __NR_stat 106 +-#define __NR_lstat 107 +-#define __NR_fstat 108 +-#define __NR_olduname 109 +-#define __NR_iopl 110 +-#define __NR_vhangup 111 +-#define __NR_idle 112 +-#define __NR_vm86 113 +-#define __NR_wait4 114 +-#define __NR_swapoff 115 +-#define __NR_sysinfo 116 +-#define __NR_ipc 117 +-#define __NR_fsync 118 +-#define __NR_sigreturn 119 +-#define __NR_clone 120 +-#define __NR_setdomainname 121 +-#define __NR_uname 122 +-#define __NR_modify_ldt 123 +-#define __NR_adjtimex 124 +-#define __NR_mprotect 125 +-#define __NR_sigprocmask 126 +-#define __NR_create_module 127 +-#define __NR_init_module 128 +-#define __NR_delete_module 129 +-#define __NR_get_kernel_syms 130 +-#define __NR_quotactl 131 +-#define __NR_getpgid 132 +-#define __NR_fchdir 133 +-#define __NR_bdflush 134 +-#define __NR_sysfs 135 +-#define __NR_personality 136 +-#define __NR_afs_syscall 137 +-#define __NR_setfsuid 138 +-#define __NR_setfsgid 139 +-#define __NR__llseek 140 +-#define __NR_getdents 141 +-#define __NR__newselect 142 +-#define __NR_flock 143 +-#define __NR_msync 144 +-#define __NR_readv 145 +-#define __NR_writev 146 +-#define __NR_getsid 147 +-#define __NR_fdatasync 148 +-#define __NR__sysctl 149 +-#define __NR_mlock 150 +-#define __NR_munlock 151 +-#define __NR_mlockall 152 +-#define __NR_munlockall 153 +-#define __NR_sched_setparam 154 +-#define __NR_sched_getparam 155 +-#define __NR_sched_setscheduler 156 +-#define __NR_sched_getscheduler 157 +-#define __NR_sched_yield 158 +-#define __NR_sched_get_priority_max 159 +-#define __NR_sched_get_priority_min 160 +-#define __NR_sched_rr_get_interval 161 +-#define __NR_nanosleep 162 +-#define __NR_mremap 163 +-#define __NR_setresuid 164 +-#define __NR_getresuid 165 +-#define __NR_query_module 166 +-#define __NR_poll 167 +-#define __NR_nfsservctl 168 +-#define __NR_setresgid 169 +-#define __NR_getresgid 170 +-#define __NR_prctl 171 +-#define __NR_rt_sigreturn 172 +-#define __NR_rt_sigaction 173 +-#define __NR_rt_sigprocmask 174 +-#define __NR_rt_sigpending 175 +-#define __NR_rt_sigtimedwait 176 +-#define __NR_rt_sigqueueinfo 177 +-#define __NR_rt_sigsuspend 178 +-#define __NR_pread64 179 +-#define __NR_pwrite64 180 +-#define __NR_chown 181 +-#define __NR_getcwd 182 +-#define __NR_capget 183 +-#define __NR_capset 184 +-#define __NR_sigaltstack 185 +-#define __NR_sendfile 186 +-#define __NR_getpmsg 187 +-#define __NR_putpmsg 188 +-#define __NR_vfork 189 +-#define __NR_ugetrlimit 190 +-#define __NR_readahead 191 +-#define __NR_pciconfig_read 198 +-#define __NR_pciconfig_write 199 +-#define __NR_pciconfig_iobase 200 +-#define __NR_multiplexer 201 +-#define __NR_getdents64 202 +-#define __NR_pivot_root 203 +-#define __NR_madvise 205 +-#define __NR_mincore 206 +-#define __NR_gettid 207 +-#define __NR_tkill 208 +-#define __NR_setxattr 209 +-#define __NR_lsetxattr 210 +-#define __NR_fsetxattr 211 +-#define __NR_getxattr 212 +-#define __NR_lgetxattr 213 +-#define __NR_fgetxattr 214 +-#define __NR_listxattr 215 +-#define __NR_llistxattr 216 +-#define __NR_flistxattr 217 +-#define __NR_removexattr 218 +-#define __NR_lremovexattr 219 +-#define __NR_fremovexattr 220 +-#define __NR_futex 221 +-#define __NR_sched_setaffinity 222 +-#define __NR_sched_getaffinity 223 +-#define __NR_tuxcall 225 +-#define __NR_io_setup 227 +-#define __NR_io_destroy 228 +-#define __NR_io_getevents 229 +-#define __NR_io_submit 230 +-#define __NR_io_cancel 231 +-#define __NR_set_tid_address 232 +-#define __NR_fadvise64 233 +-#define __NR_exit_group 234 +-#define __NR_lookup_dcookie 235 +-#define __NR_epoll_create 236 +-#define __NR_epoll_ctl 237 +-#define __NR_epoll_wait 238 +-#define __NR_remap_file_pages 239 +-#define __NR_timer_create 240 +-#define __NR_timer_settime 241 +-#define __NR_timer_gettime 242 +-#define __NR_timer_getoverrun 243 +-#define __NR_timer_delete 244 +-#define __NR_clock_settime 245 +-#define __NR_clock_gettime 246 +-#define __NR_clock_getres 247 +-#define __NR_clock_nanosleep 248 +-#define __NR_swapcontext 249 +-#define __NR_tgkill 250 +-#define __NR_utimes 251 +-#define __NR_statfs64 252 +-#define __NR_fstatfs64 253 +-#define __NR_rtas 255 +-#define __NR_sys_debug_setcontext 256 +-#define __NR_migrate_pages 258 +-#define __NR_mbind 259 +-#define __NR_get_mempolicy 260 +-#define __NR_set_mempolicy 261 +-#define __NR_mq_open 262 +-#define __NR_mq_unlink 263 +-#define __NR_mq_timedsend 264 +-#define __NR_mq_timedreceive 265 +-#define __NR_mq_notify 266 +-#define __NR_mq_getsetattr 267 +-#define __NR_kexec_load 268 +-#define __NR_add_key 269 +-#define __NR_request_key 270 +-#define __NR_keyctl 271 +-#define __NR_waitid 272 +-#define __NR_ioprio_set 273 +-#define __NR_ioprio_get 274 +-#define __NR_inotify_init 275 +-#define __NR_inotify_add_watch 276 +-#define __NR_inotify_rm_watch 277 +-#define __NR_spu_run 278 +-#define __NR_spu_create 279 +-#define __NR_pselect6 280 +-#define __NR_ppoll 281 +-#define __NR_unshare 282 +-#define __NR_splice 283 +-#define __NR_tee 284 +-#define __NR_vmsplice 285 +-#define __NR_openat 286 +-#define __NR_mkdirat 287 +-#define __NR_mknodat 288 +-#define __NR_fchownat 289 +-#define __NR_futimesat 290 +-#define __NR_newfstatat 291 +-#define __NR_unlinkat 292 +-#define __NR_renameat 293 +-#define __NR_linkat 294 +-#define __NR_symlinkat 295 +-#define __NR_readlinkat 296 +-#define __NR_fchmodat 297 +-#define __NR_faccessat 298 +-#define __NR_get_robust_list 299 +-#define __NR_set_robust_list 300 +-#define __NR_move_pages 301 +-#define __NR_getcpu 302 +-#define __NR_epoll_pwait 303 +-#define __NR_utimensat 304 +-#define __NR_signalfd 305 +-#define __NR_timerfd_create 306 +-#define __NR_eventfd 307 +-#define __NR_sync_file_range2 308 +-#define __NR_fallocate 309 +-#define __NR_subpage_prot 310 +-#define __NR_timerfd_settime 311 +-#define __NR_timerfd_gettime 312 +-#define __NR_signalfd4 313 +-#define __NR_eventfd2 314 +-#define __NR_epoll_create1 315 +-#define __NR_dup3 316 +-#define __NR_pipe2 317 +-#define __NR_inotify_init1 318 +-#define __NR_perf_event_open 319 +-#define __NR_preadv 320 +-#define __NR_pwritev 321 +-#define __NR_rt_tgsigqueueinfo 322 +-#define __NR_fanotify_init 323 +-#define __NR_fanotify_mark 324 +-#define __NR_prlimit64 325 +-#define __NR_socket 326 +-#define __NR_bind 327 +-#define __NR_connect 328 +-#define __NR_listen 329 +-#define __NR_accept 330 +-#define __NR_getsockname 331 +-#define __NR_getpeername 332 +-#define __NR_socketpair 333 +-#define __NR_send 334 +-#define __NR_sendto 335 +-#define __NR_recv 336 +-#define __NR_recvfrom 337 +-#define __NR_shutdown 338 +-#define __NR_setsockopt 339 +-#define __NR_getsockopt 340 +-#define __NR_sendmsg 341 +-#define __NR_recvmsg 342 +-#define __NR_recvmmsg 343 +-#define __NR_accept4 344 +-#define __NR_name_to_handle_at 345 +-#define __NR_open_by_handle_at 346 +-#define __NR_clock_adjtime 347 +-#define __NR_syncfs 348 +-#define __NR_sendmmsg 349 +-#define __NR_setns 350 +-#define __NR_process_vm_readv 351 +-#define __NR_process_vm_writev 352 +-#define __NR_finit_module 353 +-#define __NR_kcmp 354 +-#define __NR_sched_setattr 355 +-#define __NR_sched_getattr 356 +-#define __NR_renameat2 357 +-#define __NR_seccomp 358 +-#define __NR_getrandom 359 +-#define __NR_memfd_create 360 +-#define __NR_bpf 361 +-#define __NR_execveat 362 +-#define __NR_switch_endian 363 +-#define __NR_userfaultfd 364 +-#define __NR_membarrier 365 +-#define __NR_mlock2 378 +-#define __NR_copy_file_range 379 +-#define __NR_preadv2 380 +-#define __NR_pwritev2 381 +-#define __NR_kexec_file_load 382 +-#define __NR_statx 383 +-#define __NR_pkey_alloc 384 +-#define __NR_pkey_free 385 +-#define __NR_pkey_mprotect 386 +-#define __NR_rseq 387 +-#define __NR_io_pgetevents 388 +-#define __NR_semtimedop 392 +-#define __NR_semget 393 +-#define __NR_semctl 394 +-#define __NR_shmget 395 +-#define __NR_shmctl 396 +-#define __NR_shmat 397 +-#define __NR_shmdt 398 +-#define __NR_msgget 399 +-#define __NR_msgsnd 400 +-#define __NR_msgrcv 401 +-#define __NR_msgctl 402 +-#define __NR_pidfd_send_signal 424 +-#define __NR_io_uring_setup 425 +-#define __NR_io_uring_enter 426 +-#define __NR_io_uring_register 427 +-#define __NR_open_tree 428 +-#define __NR_move_mount 429 +-#define __NR_fsopen 430 +-#define __NR_fsconfig 431 +-#define __NR_fsmount 432 +-#define __NR_fspick 433 +-#define __NR_pidfd_open 434 +-#define __NR_clone3 435 +-#define __NR_close_range 436 +-#define __NR_openat2 437 +-#define __NR_pidfd_getfd 438 +-#define __NR_faccessat2 439 +-#define __NR_process_madvise 440 +-#define __NR_epoll_pwait2 441 ++#define __NR_restart_syscall 0 ++#define __NR_exit 1 ++#define __NR_fork 2 ++#define __NR_read 3 ++#define __NR_write 4 ++#define __NR_open 5 ++#define __NR_close 6 ++#define __NR_waitpid 7 ++#define __NR_creat 8 ++#define __NR_link 9 ++#define __NR_unlink 10 ++#define __NR_execve 11 ++#define __NR_chdir 12 ++#define __NR_time 13 ++#define __NR_mknod 14 ++#define __NR_chmod 15 ++#define __NR_lchown 16 ++#define __NR_break 17 ++#define __NR_oldstat 18 ++#define __NR_lseek 19 ++#define __NR_getpid 20 ++#define __NR_mount 21 ++#define __NR_umount 22 ++#define __NR_setuid 23 ++#define __NR_getuid 24 ++#define __NR_stime 25 ++#define __NR_ptrace 26 ++#define __NR_alarm 27 ++#define __NR_oldfstat 28 ++#define __NR_pause 29 ++#define __NR_utime 30 ++#define __NR_stty 31 ++#define __NR_gtty 32 ++#define __NR_access 33 ++#define __NR_nice 34 ++#define __NR_ftime 35 ++#define __NR_sync 36 ++#define __NR_kill 37 ++#define __NR_rename 38 ++#define __NR_mkdir 39 ++#define __NR_rmdir 40 ++#define __NR_dup 41 ++#define __NR_pipe 42 ++#define __NR_times 43 ++#define __NR_prof 44 ++#define __NR_brk 45 ++#define __NR_setgid 46 ++#define __NR_getgid 47 ++#define __NR_signal 48 ++#define __NR_geteuid 49 ++#define __NR_getegid 50 ++#define __NR_acct 51 ++#define __NR_umount2 52 ++#define __NR_lock 53 ++#define __NR_ioctl 54 ++#define __NR_fcntl 55 ++#define __NR_mpx 56 ++#define __NR_setpgid 57 ++#define __NR_ulimit 58 ++#define __NR_oldolduname 59 ++#define __NR_umask 60 ++#define __NR_chroot 61 ++#define __NR_ustat 62 ++#define __NR_dup2 63 ++#define __NR_getppid 64 ++#define __NR_getpgrp 65 ++#define __NR_setsid 66 ++#define __NR_sigaction 67 ++#define __NR_sgetmask 68 ++#define __NR_ssetmask 69 ++#define __NR_setreuid 70 ++#define __NR_setregid 71 ++#define __NR_sigsuspend 72 ++#define __NR_sigpending 73 ++#define __NR_sethostname 74 ++#define __NR_setrlimit 75 ++#define __NR_getrlimit 76 ++#define __NR_getrusage 77 ++#define __NR_gettimeofday 78 ++#define __NR_settimeofday 79 ++#define __NR_getgroups 80 ++#define __NR_setgroups 81 ++#define __NR_select 82 ++#define __NR_symlink 83 ++#define __NR_oldlstat 84 ++#define __NR_readlink 85 ++#define __NR_uselib 86 ++#define __NR_swapon 87 ++#define __NR_reboot 88 ++#define __NR_readdir 89 ++#define __NR_mmap 90 ++#define __NR_munmap 91 ++#define __NR_truncate 92 ++#define __NR_ftruncate 93 ++#define __NR_fchmod 94 ++#define __NR_fchown 95 ++#define __NR_getpriority 96 ++#define __NR_setpriority 97 ++#define __NR_profil 98 ++#define __NR_statfs 99 ++#define __NR_fstatfs 100 ++#define __NR_ioperm 101 ++#define __NR_socketcall 102 ++#define __NR_syslog 103 ++#define __NR_setitimer 104 ++#define __NR_getitimer 105 ++#define __NR_stat 106 ++#define __NR_lstat 107 ++#define __NR_fstat 108 ++#define __NR_olduname 109 ++#define __NR_iopl 110 ++#define __NR_vhangup 111 ++#define __NR_idle 112 ++#define __NR_vm86 113 ++#define __NR_wait4 114 ++#define __NR_swapoff 115 ++#define __NR_sysinfo 116 ++#define __NR_ipc 117 ++#define __NR_fsync 118 ++#define __NR_sigreturn 119 ++#define __NR_clone 120 ++#define __NR_setdomainname 121 ++#define __NR_uname 122 ++#define __NR_modify_ldt 123 ++#define __NR_adjtimex 124 ++#define __NR_mprotect 125 ++#define __NR_sigprocmask 126 ++#define __NR_create_module 127 ++#define __NR_init_module 128 ++#define __NR_delete_module 129 ++#define __NR_get_kernel_syms 130 ++#define __NR_quotactl 131 ++#define __NR_getpgid 132 ++#define __NR_fchdir 133 ++#define __NR_bdflush 134 ++#define __NR_sysfs 135 ++#define __NR_personality 136 ++#define __NR_afs_syscall 137 ++#define __NR_setfsuid 138 ++#define __NR_setfsgid 139 ++#define __NR__llseek 140 ++#define __NR_getdents 141 ++#define __NR__newselect 142 ++#define __NR_flock 143 ++#define __NR_msync 144 ++#define __NR_readv 145 ++#define __NR_writev 146 ++#define __NR_getsid 147 ++#define __NR_fdatasync 148 ++#define __NR__sysctl 149 ++#define __NR_mlock 150 ++#define __NR_munlock 151 ++#define __NR_mlockall 152 ++#define __NR_munlockall 153 ++#define __NR_sched_setparam 154 ++#define __NR_sched_getparam 155 ++#define __NR_sched_setscheduler 156 ++#define __NR_sched_getscheduler 157 ++#define __NR_sched_yield 158 ++#define __NR_sched_get_priority_max 159 ++#define __NR_sched_get_priority_min 160 ++#define __NR_sched_rr_get_interval 161 ++#define __NR_nanosleep 162 ++#define __NR_mremap 163 ++#define __NR_setresuid 164 ++#define __NR_getresuid 165 ++#define __NR_query_module 166 ++#define __NR_poll 167 ++#define __NR_nfsservctl 168 ++#define __NR_setresgid 169 ++#define __NR_getresgid 170 ++#define __NR_prctl 171 ++#define __NR_rt_sigreturn 172 ++#define __NR_rt_sigaction 173 ++#define __NR_rt_sigprocmask 174 ++#define __NR_rt_sigpending 175 ++#define __NR_rt_sigtimedwait 176 ++#define __NR_rt_sigqueueinfo 177 ++#define __NR_rt_sigsuspend 178 ++#define __NR_pread64 179 ++#define __NR_pwrite64 180 ++#define __NR_chown 181 ++#define __NR_getcwd 182 ++#define __NR_capget 183 ++#define __NR_capset 184 ++#define __NR_sigaltstack 185 ++#define __NR_sendfile 186 ++#define __NR_getpmsg 187 ++#define __NR_putpmsg 188 ++#define __NR_vfork 189 ++#define __NR_ugetrlimit 190 ++#define __NR_readahead 191 ++#define __NR_pciconfig_read 198 ++#define __NR_pciconfig_write 199 ++#define __NR_pciconfig_iobase 200 ++#define __NR_multiplexer 201 ++#define __NR_getdents64 202 ++#define __NR_pivot_root 203 ++#define __NR_madvise 205 ++#define __NR_mincore 206 ++#define __NR_gettid 207 ++#define __NR_tkill 208 ++#define __NR_setxattr 209 ++#define __NR_lsetxattr 210 ++#define __NR_fsetxattr 211 ++#define __NR_getxattr 212 ++#define __NR_lgetxattr 213 ++#define __NR_fgetxattr 214 ++#define __NR_listxattr 215 ++#define __NR_llistxattr 216 ++#define __NR_flistxattr 217 ++#define __NR_removexattr 218 ++#define __NR_lremovexattr 219 ++#define __NR_fremovexattr 220 ++#define __NR_futex 221 ++#define __NR_sched_setaffinity 222 ++#define __NR_sched_getaffinity 223 ++#define __NR_tuxcall 225 ++#define __NR_io_setup 227 ++#define __NR_io_destroy 228 ++#define __NR_io_getevents 229 ++#define __NR_io_submit 230 ++#define __NR_io_cancel 231 ++#define __NR_set_tid_address 232 ++#define __NR_fadvise64 233 ++#define __NR_exit_group 234 ++#define __NR_lookup_dcookie 235 ++#define __NR_epoll_create 236 ++#define __NR_epoll_ctl 237 ++#define __NR_epoll_wait 238 ++#define __NR_remap_file_pages 239 ++#define __NR_timer_create 240 ++#define __NR_timer_settime 241 ++#define __NR_timer_gettime 242 ++#define __NR_timer_getoverrun 243 ++#define __NR_timer_delete 244 ++#define __NR_clock_settime 245 ++#define __NR_clock_gettime 246 ++#define __NR_clock_getres 247 ++#define __NR_clock_nanosleep 248 ++#define __NR_swapcontext 249 ++#define __NR_tgkill 250 ++#define __NR_utimes 251 ++#define __NR_statfs64 252 ++#define __NR_fstatfs64 253 ++#define __NR_rtas 255 ++#define __NR_sys_debug_setcontext 256 ++#define __NR_migrate_pages 258 ++#define __NR_mbind 259 ++#define __NR_get_mempolicy 260 ++#define __NR_set_mempolicy 261 ++#define __NR_mq_open 262 ++#define __NR_mq_unlink 263 ++#define __NR_mq_timedsend 264 ++#define __NR_mq_timedreceive 265 ++#define __NR_mq_notify 266 ++#define __NR_mq_getsetattr 267 ++#define __NR_kexec_load 268 ++#define __NR_add_key 269 ++#define __NR_request_key 270 ++#define __NR_keyctl 271 ++#define __NR_waitid 272 ++#define __NR_ioprio_set 273 ++#define __NR_ioprio_get 274 ++#define __NR_inotify_init 275 ++#define __NR_inotify_add_watch 276 ++#define __NR_inotify_rm_watch 277 ++#define __NR_spu_run 278 ++#define __NR_spu_create 279 ++#define __NR_pselect6 280 ++#define __NR_ppoll 281 ++#define __NR_unshare 282 ++#define __NR_splice 283 ++#define __NR_tee 284 ++#define __NR_vmsplice 285 ++#define __NR_openat 286 ++#define __NR_mkdirat 287 ++#define __NR_mknodat 288 ++#define __NR_fchownat 289 ++#define __NR_futimesat 290 ++#define __NR_newfstatat 291 ++#define __NR_unlinkat 292 ++#define __NR_renameat 293 ++#define __NR_linkat 294 ++#define __NR_symlinkat 295 ++#define __NR_readlinkat 296 ++#define __NR_fchmodat 297 ++#define __NR_faccessat 298 ++#define __NR_get_robust_list 299 ++#define __NR_set_robust_list 300 ++#define __NR_move_pages 301 ++#define __NR_getcpu 302 ++#define __NR_epoll_pwait 303 ++#define __NR_utimensat 304 ++#define __NR_signalfd 305 ++#define __NR_timerfd_create 306 ++#define __NR_eventfd 307 ++#define __NR_sync_file_range2 308 ++#define __NR_fallocate 309 ++#define __NR_subpage_prot 310 ++#define __NR_timerfd_settime 311 ++#define __NR_timerfd_gettime 312 ++#define __NR_signalfd4 313 ++#define __NR_eventfd2 314 ++#define __NR_epoll_create1 315 ++#define __NR_dup3 316 ++#define __NR_pipe2 317 ++#define __NR_inotify_init1 318 ++#define __NR_perf_event_open 319 ++#define __NR_preadv 320 ++#define __NR_pwritev 321 ++#define __NR_rt_tgsigqueueinfo 322 ++#define __NR_fanotify_init 323 ++#define __NR_fanotify_mark 324 ++#define __NR_prlimit64 325 ++#define __NR_socket 326 ++#define __NR_bind 327 ++#define __NR_connect 328 ++#define __NR_listen 329 ++#define __NR_accept 330 ++#define __NR_getsockname 331 ++#define __NR_getpeername 332 ++#define __NR_socketpair 333 ++#define __NR_send 334 ++#define __NR_sendto 335 ++#define __NR_recv 336 ++#define __NR_recvfrom 337 ++#define __NR_shutdown 338 ++#define __NR_setsockopt 339 ++#define __NR_getsockopt 340 ++#define __NR_sendmsg 341 ++#define __NR_recvmsg 342 ++#define __NR_recvmmsg 343 ++#define __NR_accept4 344 ++#define __NR_name_to_handle_at 345 ++#define __NR_open_by_handle_at 346 ++#define __NR_clock_adjtime 347 ++#define __NR_syncfs 348 ++#define __NR_sendmmsg 349 ++#define __NR_setns 350 ++#define __NR_process_vm_readv 351 ++#define __NR_process_vm_writev 352 ++#define __NR_finit_module 353 ++#define __NR_kcmp 354 ++#define __NR_sched_setattr 355 ++#define __NR_sched_getattr 356 ++#define __NR_renameat2 357 ++#define __NR_seccomp 358 ++#define __NR_getrandom 359 ++#define __NR_memfd_create 360 ++#define __NR_bpf 361 ++#define __NR_execveat 362 ++#define __NR_switch_endian 363 ++#define __NR_userfaultfd 364 ++#define __NR_membarrier 365 ++#define __NR_mlock2 378 ++#define __NR_copy_file_range 379 ++#define __NR_preadv2 380 ++#define __NR_pwritev2 381 ++#define __NR_kexec_file_load 382 ++#define __NR_statx 383 ++#define __NR_pkey_alloc 384 ++#define __NR_pkey_free 385 ++#define __NR_pkey_mprotect 386 ++#define __NR_rseq 387 ++#define __NR_io_pgetevents 388 ++#define __NR_semtimedop 392 ++#define __NR_semget 393 ++#define __NR_semctl 394 ++#define __NR_shmget 395 ++#define __NR_shmctl 396 ++#define __NR_shmat 397 ++#define __NR_shmdt 398 ++#define __NR_msgget 399 ++#define __NR_msgsnd 400 ++#define __NR_msgrcv 401 ++#define __NR_msgctl 402 ++#define __NR_pidfd_send_signal 424 ++#define __NR_io_uring_setup 425 ++#define __NR_io_uring_enter 426 ++#define __NR_io_uring_register 427 ++#define __NR_open_tree 428 ++#define __NR_move_mount 429 ++#define __NR_fsopen 430 ++#define __NR_fsconfig 431 ++#define __NR_fsmount 432 ++#define __NR_fspick 433 ++#define __NR_pidfd_open 434 ++#define __NR_clone3 435 ++#define __NR_close_range 436 ++#define __NR_openat2 437 ++#define __NR_pidfd_getfd 438 ++#define __NR_faccessat2 439 ++#define __NR_process_madvise 440 ++#define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + +-#endif /* _ASM_POWERPC_UNISTD_64_H */ ++#endif /* _ASM_UNISTD_64_H */ +diff --git a/linux-headers/asm-s390/unistd_32.h b/linux-headers/asm-s390/unistd_32.h +index c94d2c3a22..e8cd34334f 100644 +--- a/linux-headers/asm-s390/unistd_32.h ++++ b/linux-headers/asm-s390/unistd_32.h +@@ -414,5 +414,9 @@ + #define __NR_faccessat2 439 + #define __NR_process_madvise 440 + #define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + #endif /* _ASM_S390_UNISTD_32_H */ +diff --git a/linux-headers/asm-s390/unistd_64.h b/linux-headers/asm-s390/unistd_64.h +index 984a06b7eb..86830e1e83 100644 +--- a/linux-headers/asm-s390/unistd_64.h ++++ b/linux-headers/asm-s390/unistd_64.h +@@ -362,5 +362,9 @@ + #define __NR_faccessat2 439 + #define __NR_process_madvise 440 + #define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + #endif /* _ASM_S390_UNISTD_64_H */ +diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h +index 8e76d3701d..0662f644aa 100644 +--- a/linux-headers/asm-x86/kvm.h ++++ b/linux-headers/asm-x86/kvm.h +@@ -112,6 +112,7 @@ struct kvm_ioapic_state { + #define KVM_NR_IRQCHIPS 3 + + #define KVM_RUN_X86_SMM (1 << 0) ++#define KVM_RUN_X86_BUS_LOCK (1 << 1) + + /* for KVM_GET_REGS and KVM_SET_REGS */ + struct kvm_regs { +@@ -436,6 +437,8 @@ struct kvm_vmx_nested_state_hdr { + __u16 flags; + } smm; + ++ __u16 pad; ++ + __u32 flags; + __u64 preemption_timer_deadline; + }; +diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h +index 18fb99dfa2..8f6ac8c19f 100644 +--- a/linux-headers/asm-x86/unistd_32.h ++++ b/linux-headers/asm-x86/unistd_32.h +@@ -432,6 +432,10 @@ + #define __NR_faccessat2 439 + #define __NR_process_madvise 440 + #define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + + #endif /* _ASM_X86_UNISTD_32_H */ +diff --git a/linux-headers/asm-x86/unistd_64.h b/linux-headers/asm-x86/unistd_64.h +index bde959328d..bb187a9268 100644 +--- a/linux-headers/asm-x86/unistd_64.h ++++ b/linux-headers/asm-x86/unistd_64.h +@@ -354,6 +354,10 @@ + #define __NR_faccessat2 439 + #define __NR_process_madvise 440 + #define __NR_epoll_pwait2 441 ++#define __NR_mount_setattr 442 ++#define __NR_landlock_create_ruleset 444 ++#define __NR_landlock_add_rule 445 ++#define __NR_landlock_restrict_self 446 + + + #endif /* _ASM_X86_UNISTD_64_H */ +diff --git a/linux-headers/asm-x86/unistd_x32.h b/linux-headers/asm-x86/unistd_x32.h +index 4ff6b17d3b..4edd0103ac 100644 +--- a/linux-headers/asm-x86/unistd_x32.h ++++ b/linux-headers/asm-x86/unistd_x32.h +@@ -307,6 +307,10 @@ + #define __NR_faccessat2 (__X32_SYSCALL_BIT + 439) + #define __NR_process_madvise (__X32_SYSCALL_BIT + 440) + #define __NR_epoll_pwait2 (__X32_SYSCALL_BIT + 441) ++#define __NR_mount_setattr (__X32_SYSCALL_BIT + 442) ++#define __NR_landlock_create_ruleset (__X32_SYSCALL_BIT + 444) ++#define __NR_landlock_add_rule (__X32_SYSCALL_BIT + 445) ++#define __NR_landlock_restrict_self (__X32_SYSCALL_BIT + 446) + #define __NR_rt_sigaction (__X32_SYSCALL_BIT + 512) + #define __NR_rt_sigreturn (__X32_SYSCALL_BIT + 513) + #define __NR_ioctl (__X32_SYSCALL_BIT + 514) +diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h +index 897f831374..20d6a263bb 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -8,6 +8,7 @@ + * Note: you must update KVM_API_VERSION if you change this interface. + */ + ++#include + #include + + #include +@@ -216,6 +217,20 @@ struct kvm_hyperv_exit { + } u; + }; + ++struct kvm_xen_exit { ++#define KVM_EXIT_XEN_HCALL 1 ++ __u32 type; ++ union { ++ struct { ++ __u32 longmode; ++ __u32 cpl; ++ __u64 input; ++ __u64 result; ++ __u64 params[6]; ++ } hcall; ++ } u; ++}; ++ + #define KVM_S390_GET_SKEYS_NONE 1 + #define KVM_S390_SKEYS_MAX 1048576 + +@@ -251,6 +266,9 @@ struct kvm_hyperv_exit { + #define KVM_EXIT_X86_RDMSR 29 + #define KVM_EXIT_X86_WRMSR 30 + #define KVM_EXIT_DIRTY_RING_FULL 31 ++#define KVM_EXIT_AP_RESET_HOLD 32 ++#define KVM_EXIT_X86_BUS_LOCK 33 ++#define KVM_EXIT_XEN 34 + + /* For KVM_EXIT_INTERNAL_ERROR */ + /* Emulate instruction failed. */ +@@ -427,6 +445,8 @@ struct kvm_run { + __u32 index; /* kernel -> user */ + __u64 data; /* kernel <-> user */ + } msr; ++ /* KVM_EXIT_XEN */ ++ struct kvm_xen_exit xen; + /* Fix the size of the union. */ + char padding[256]; + }; +@@ -573,6 +593,7 @@ struct kvm_vapic_addr { + #define KVM_MP_STATE_CHECK_STOP 6 + #define KVM_MP_STATE_OPERATING 7 + #define KVM_MP_STATE_LOAD 8 ++#define KVM_MP_STATE_AP_RESET_HOLD 9 + + struct kvm_mp_state { + __u32 mp_state; +@@ -1056,6 +1077,12 @@ struct kvm_ppc_resize_hpt { + #define KVM_CAP_ENFORCE_PV_FEATURE_CPUID 190 + #define KVM_CAP_SYS_HYPERV_CPUID 191 + #define KVM_CAP_DIRTY_LOG_RING 192 ++#define KVM_CAP_X86_BUS_LOCK_EXIT 193 ++#define KVM_CAP_PPC_DAWR1 194 ++#define KVM_CAP_SET_GUEST_DEBUG2 195 ++#define KVM_CAP_SGX_ATTRIBUTE 196 ++#define KVM_CAP_VM_COPY_ENC_CONTEXT_FROM 197 ++#define KVM_CAP_PTP_KVM 198 + + #ifdef KVM_CAP_IRQ_ROUTING + +@@ -1129,6 +1156,11 @@ struct kvm_x86_mce { + #endif + + #ifdef KVM_CAP_XEN_HVM ++#define KVM_XEN_HVM_CONFIG_HYPERCALL_MSR (1 << 0) ++#define KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL (1 << 1) ++#define KVM_XEN_HVM_CONFIG_SHARED_INFO (1 << 2) ++#define KVM_XEN_HVM_CONFIG_RUNSTATE (1 << 3) ++ + struct kvm_xen_hvm_config { + __u32 flags; + __u32 msr; +@@ -1563,6 +1595,57 @@ struct kvm_pv_cmd { + /* Available with KVM_CAP_DIRTY_LOG_RING */ + #define KVM_RESET_DIRTY_RINGS _IO(KVMIO, 0xc7) + ++/* Per-VM Xen attributes */ ++#define KVM_XEN_HVM_GET_ATTR _IOWR(KVMIO, 0xc8, struct kvm_xen_hvm_attr) ++#define KVM_XEN_HVM_SET_ATTR _IOW(KVMIO, 0xc9, struct kvm_xen_hvm_attr) ++ ++struct kvm_xen_hvm_attr { ++ __u16 type; ++ __u16 pad[3]; ++ union { ++ __u8 long_mode; ++ __u8 vector; ++ struct { ++ __u64 gfn; ++ } shared_info; ++ __u64 pad[8]; ++ } u; ++}; ++ ++/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */ ++#define KVM_XEN_ATTR_TYPE_LONG_MODE 0x0 ++#define KVM_XEN_ATTR_TYPE_SHARED_INFO 0x1 ++#define KVM_XEN_ATTR_TYPE_UPCALL_VECTOR 0x2 ++ ++/* Per-vCPU Xen attributes */ ++#define KVM_XEN_VCPU_GET_ATTR _IOWR(KVMIO, 0xca, struct kvm_xen_vcpu_attr) ++#define KVM_XEN_VCPU_SET_ATTR _IOW(KVMIO, 0xcb, struct kvm_xen_vcpu_attr) ++ ++struct kvm_xen_vcpu_attr { ++ __u16 type; ++ __u16 pad[3]; ++ union { ++ __u64 gpa; ++ __u64 pad[8]; ++ struct { ++ __u64 state; ++ __u64 state_entry_time; ++ __u64 time_running; ++ __u64 time_runnable; ++ __u64 time_blocked; ++ __u64 time_offline; ++ } runstate; ++ } u; ++}; ++ ++/* Available with KVM_CAP_XEN_HVM / KVM_XEN_HVM_CONFIG_SHARED_INFO */ ++#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_INFO 0x0 ++#define KVM_XEN_VCPU_ATTR_TYPE_VCPU_TIME_INFO 0x1 ++#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADDR 0x2 ++#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_CURRENT 0x3 ++#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_DATA 0x4 ++#define KVM_XEN_VCPU_ATTR_TYPE_RUNSTATE_ADJUST 0x5 ++ + /* Secure Encrypted Virtualization command */ + enum sev_cmd_id { + /* Guest initialization commands */ +@@ -1593,6 +1676,8 @@ enum sev_cmd_id { + KVM_SEV_CERT_EXPORT, + /* Attestation report */ + KVM_SEV_GET_ATTESTATION_REPORT, ++ /* Guest Migration Extension */ ++ KVM_SEV_SEND_CANCEL, + + KVM_SEV_NR_MAX, + }; +@@ -1651,6 +1736,45 @@ struct kvm_sev_attestation_report { + __u32 len; + }; + ++struct kvm_sev_send_start { ++ __u32 policy; ++ __u64 pdh_cert_uaddr; ++ __u32 pdh_cert_len; ++ __u64 plat_certs_uaddr; ++ __u32 plat_certs_len; ++ __u64 amd_certs_uaddr; ++ __u32 amd_certs_len; ++ __u64 session_uaddr; ++ __u32 session_len; ++}; ++ ++struct kvm_sev_send_update_data { ++ __u64 hdr_uaddr; ++ __u32 hdr_len; ++ __u64 guest_uaddr; ++ __u32 guest_len; ++ __u64 trans_uaddr; ++ __u32 trans_len; ++}; ++ ++struct kvm_sev_receive_start { ++ __u32 handle; ++ __u32 policy; ++ __u64 pdh_uaddr; ++ __u32 pdh_len; ++ __u64 session_uaddr; ++ __u32 session_len; ++}; ++ ++struct kvm_sev_receive_update_data { ++ __u64 hdr_uaddr; ++ __u32 hdr_len; ++ __u64 guest_uaddr; ++ __u32 guest_len; ++ __u64 trans_uaddr; ++ __u32 trans_len; ++}; ++ + #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) + #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) + #define KVM_DEV_ASSIGN_MASK_INTX (1 << 2) +@@ -1756,8 +1880,8 @@ struct kvm_hyperv_eventfd { + * conversion after harvesting an entry. Also, it must not skip any + * dirty bits, so that dirty bits are always harvested in sequence. + */ +-#define KVM_DIRTY_GFN_F_DIRTY BIT(0) +-#define KVM_DIRTY_GFN_F_RESET BIT(1) ++#define KVM_DIRTY_GFN_F_DIRTY _BITUL(0) ++#define KVM_DIRTY_GFN_F_RESET _BITUL(1) + #define KVM_DIRTY_GFN_F_MASK 0x3 + + /* +@@ -1772,4 +1896,7 @@ struct kvm_dirty_gfn { + __u64 offset; + }; + ++#define KVM_BUS_LOCK_DETECTION_OFF (1 << 0) ++#define KVM_BUS_LOCK_DETECTION_EXIT (1 << 1) ++ + #endif /* __LINUX_KVM_H */ +diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h +index 1ba9a9feeb..b9ac97b70f 100644 +--- a/linux-headers/linux/userfaultfd.h ++++ b/linux-headers/linux/userfaultfd.h +@@ -19,15 +19,19 @@ + * means the userland is reading). + */ + #define UFFD_API ((__u64)0xAA) ++#define UFFD_API_REGISTER_MODES (UFFDIO_REGISTER_MODE_MISSING | \ ++ UFFDIO_REGISTER_MODE_WP | \ ++ UFFDIO_REGISTER_MODE_MINOR) + #define UFFD_API_FEATURES (UFFD_FEATURE_PAGEFAULT_FLAG_WP | \ + UFFD_FEATURE_EVENT_FORK | \ + UFFD_FEATURE_EVENT_REMAP | \ +- UFFD_FEATURE_EVENT_REMOVE | \ ++ UFFD_FEATURE_EVENT_REMOVE | \ + UFFD_FEATURE_EVENT_UNMAP | \ + UFFD_FEATURE_MISSING_HUGETLBFS | \ + UFFD_FEATURE_MISSING_SHMEM | \ + UFFD_FEATURE_SIGBUS | \ +- UFFD_FEATURE_THREAD_ID) ++ UFFD_FEATURE_THREAD_ID | \ ++ UFFD_FEATURE_MINOR_HUGETLBFS) + #define UFFD_API_IOCTLS \ + ((__u64)1 << _UFFDIO_REGISTER | \ + (__u64)1 << _UFFDIO_UNREGISTER | \ +@@ -36,10 +40,12 @@ + ((__u64)1 << _UFFDIO_WAKE | \ + (__u64)1 << _UFFDIO_COPY | \ + (__u64)1 << _UFFDIO_ZEROPAGE | \ +- (__u64)1 << _UFFDIO_WRITEPROTECT) ++ (__u64)1 << _UFFDIO_WRITEPROTECT | \ ++ (__u64)1 << _UFFDIO_CONTINUE) + #define UFFD_API_RANGE_IOCTLS_BASIC \ + ((__u64)1 << _UFFDIO_WAKE | \ +- (__u64)1 << _UFFDIO_COPY) ++ (__u64)1 << _UFFDIO_COPY | \ ++ (__u64)1 << _UFFDIO_CONTINUE) + + /* + * Valid ioctl command number range with this API is from 0x00 to +@@ -55,6 +61,7 @@ + #define _UFFDIO_COPY (0x03) + #define _UFFDIO_ZEROPAGE (0x04) + #define _UFFDIO_WRITEPROTECT (0x06) ++#define _UFFDIO_CONTINUE (0x07) + #define _UFFDIO_API (0x3F) + + /* userfaultfd ioctl ids */ +@@ -73,6 +80,8 @@ + struct uffdio_zeropage) + #define UFFDIO_WRITEPROTECT _IOWR(UFFDIO, _UFFDIO_WRITEPROTECT, \ + struct uffdio_writeprotect) ++#define UFFDIO_CONTINUE _IOR(UFFDIO, _UFFDIO_CONTINUE, \ ++ struct uffdio_continue) + + /* read() structure */ + struct uffd_msg { +@@ -127,6 +136,7 @@ struct uffd_msg { + /* flags for UFFD_EVENT_PAGEFAULT */ + #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ + #define UFFD_PAGEFAULT_FLAG_WP (1<<1) /* If reason is VM_UFFD_WP */ ++#define UFFD_PAGEFAULT_FLAG_MINOR (1<<2) /* If reason is VM_UFFD_MINOR */ + + struct uffdio_api { + /* userland asks for an API number and the features to enable */ +@@ -171,6 +181,10 @@ struct uffdio_api { + * + * UFFD_FEATURE_THREAD_ID pid of the page faulted task_struct will + * be returned, if feature is not requested 0 will be returned. ++ * ++ * UFFD_FEATURE_MINOR_HUGETLBFS indicates that minor faults ++ * can be intercepted (via REGISTER_MODE_MINOR) for ++ * hugetlbfs-backed pages. + */ + #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) + #define UFFD_FEATURE_EVENT_FORK (1<<1) +@@ -181,6 +195,7 @@ struct uffdio_api { + #define UFFD_FEATURE_EVENT_UNMAP (1<<6) + #define UFFD_FEATURE_SIGBUS (1<<7) + #define UFFD_FEATURE_THREAD_ID (1<<8) ++#define UFFD_FEATURE_MINOR_HUGETLBFS (1<<9) + __u64 features; + + __u64 ioctls; +@@ -195,6 +210,7 @@ struct uffdio_register { + struct uffdio_range range; + #define UFFDIO_REGISTER_MODE_MISSING ((__u64)1<<0) + #define UFFDIO_REGISTER_MODE_WP ((__u64)1<<1) ++#define UFFDIO_REGISTER_MODE_MINOR ((__u64)1<<2) + __u64 mode; + + /* +@@ -257,6 +273,18 @@ struct uffdio_writeprotect { + __u64 mode; + }; + ++struct uffdio_continue { ++ struct uffdio_range range; ++#define UFFDIO_CONTINUE_MODE_DONTWAKE ((__u64)1<<0) ++ __u64 mode; ++ ++ /* ++ * Fields below here are written by the ioctl and must be at the end: ++ * the copy_from_user will not read past here. ++ */ ++ __s64 mapped; ++}; ++ + /* + * Flags for the userfaultfd(2) system call itself. + */ +diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h +index 609099e455..e680594f27 100644 +--- a/linux-headers/linux/vfio.h ++++ b/linux-headers/linux/vfio.h +@@ -46,6 +46,12 @@ + */ + #define VFIO_NOIOMMU_IOMMU 8 + ++/* Supports VFIO_DMA_UNMAP_FLAG_ALL */ ++#define VFIO_UNMAP_ALL 9 ++ ++/* Supports the vaddr flag for DMA map and unmap */ ++#define VFIO_UPDATE_VADDR 10 ++ + /* + * The IOCTL interface is designed for extensibility by embedding the + * structure length (argsz) and flags into structures passed between +@@ -329,6 +335,8 @@ struct vfio_region_info_cap_type { + /* 10de vendor PCI sub-types */ + /* + * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space. ++ * ++ * Deprecated, region no longer provided + */ + #define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1) + +@@ -336,6 +344,8 @@ struct vfio_region_info_cap_type { + /* + * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU + * to do TLB invalidation on a GPU. ++ * ++ * Deprecated, region no longer provided + */ + #define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1) + +@@ -635,6 +645,8 @@ struct vfio_device_migration_info { + * Capability with compressed real address (aka SSA - small system address) + * where GPU RAM is mapped on a system bus. Used by a GPU for DMA routing + * and by the userspace to associate a NVLink bridge with a GPU. ++ * ++ * Deprecated, capability no longer provided + */ + #define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4 + +@@ -649,6 +661,8 @@ struct vfio_region_info_cap_nvlink2_ssatgt { + * property in the device tree. The value is fixed in the hardware + * and failing to provide the correct value results in the link + * not working with no indication from the driver why. ++ * ++ * Deprecated, capability no longer provided + */ + #define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5 + +@@ -1074,12 +1088,22 @@ struct vfio_iommu_type1_info_dma_avail { + * + * Map process virtual addresses to IO virtual addresses using the + * provided struct vfio_dma_map. Caller sets argsz. READ &/ WRITE required. ++ * ++ * If flags & VFIO_DMA_MAP_FLAG_VADDR, update the base vaddr for iova, and ++ * unblock translation of host virtual addresses in the iova range. The vaddr ++ * must have previously been invalidated with VFIO_DMA_UNMAP_FLAG_VADDR. To ++ * maintain memory consistency within the user application, the updated vaddr ++ * must address the same memory object as originally mapped. Failure to do so ++ * will result in user memory corruption and/or device misbehavior. iova and ++ * size must match those in the original MAP_DMA call. Protection is not ++ * changed, and the READ & WRITE flags must be 0. + */ + struct vfio_iommu_type1_dma_map { + __u32 argsz; + __u32 flags; + #define VFIO_DMA_MAP_FLAG_READ (1 << 0) /* readable from device */ + #define VFIO_DMA_MAP_FLAG_WRITE (1 << 1) /* writable from device */ ++#define VFIO_DMA_MAP_FLAG_VADDR (1 << 2) + __u64 vaddr; /* Process virtual address */ + __u64 iova; /* IO virtual address */ + __u64 size; /* Size of mapping (bytes) */ +@@ -1102,6 +1126,7 @@ struct vfio_bitmap { + * field. No guarantee is made to the user that arbitrary unmaps of iova + * or size different from those used in the original mapping call will + * succeed. ++ * + * VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP should be set to get the dirty bitmap + * before unmapping IO virtual addresses. When this flag is set, the user must + * provide a struct vfio_bitmap in data[]. User must provide zero-allocated +@@ -1111,11 +1136,21 @@ struct vfio_bitmap { + * indicates that the page at that offset from iova is dirty. A Bitmap of the + * pages in the range of unmapped size is returned in the user-provided + * vfio_bitmap.data. ++ * ++ * If flags & VFIO_DMA_UNMAP_FLAG_ALL, unmap all addresses. iova and size ++ * must be 0. This cannot be combined with the get-dirty-bitmap flag. ++ * ++ * If flags & VFIO_DMA_UNMAP_FLAG_VADDR, do not unmap, but invalidate host ++ * virtual addresses in the iova range. Tasks that attempt to translate an ++ * iova's vaddr will block. DMA to already-mapped pages continues. This ++ * cannot be combined with the get-dirty-bitmap flag. + */ + struct vfio_iommu_type1_dma_unmap { + __u32 argsz; + __u32 flags; + #define VFIO_DMA_UNMAP_FLAG_GET_DIRTY_BITMAP (1 << 0) ++#define VFIO_DMA_UNMAP_FLAG_ALL (1 << 1) ++#define VFIO_DMA_UNMAP_FLAG_VADDR (1 << 2) + __u64 iova; /* IO virtual address */ + __u64 size; /* Size of mapping (bytes) */ + __u8 data[]; +-- +2.27.0 + diff --git a/SOURCES/kvm-aarch64-Add-USB-storage-devices.patch b/SOURCES/kvm-aarch64-Add-USB-storage-devices.patch new file mode 100644 index 0000000..4059db2 --- /dev/null +++ b/SOURCES/kvm-aarch64-Add-USB-storage-devices.patch @@ -0,0 +1,41 @@ +From 7fd7892a21cf930f3d44dc3205bed9fb9128c11c Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Wed, 4 Aug 2021 07:10:15 -0400 +Subject: [PATCH 23/39] aarch64: Add USB storage devices + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [15/15] 7706801381d8dfc97231fa87f6a7c8de7e3c8e84 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +There's no reason not to support these devices and doing so allows us +to match x86 and ppc. Also to match the other architectures we do not +enable CONFIG_USB_STORAGE_BOT, as that was disabled for the other +architectures for BZ1866133. + +Signed-off-by: Andrew Jones +Signed-off-by: Miroslav Rezanina +--- + default-configs/devices/aarch64-rh-devices.mak | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak +index d8ce902720..a5bab23925 100644 +--- a/default-configs/devices/aarch64-rh-devices.mak ++++ b/default-configs/devices/aarch64-rh-devices.mak +@@ -15,6 +15,8 @@ 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 +-- +2.27.0 + diff --git a/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PVPANIC_PCI.patch b/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PVPANIC_PCI.patch new file mode 100644 index 0000000..800b567 --- /dev/null +++ b/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PVPANIC_PCI.patch @@ -0,0 +1,38 @@ +From 5cc3aacc241c0d26f63d51efd1b6fa35490d37c9 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Wed, 26 May 2021 10:33:20 -0400 +Subject: [PATCH 03/15] aarch64-rh-devices: add CONFIG_PVPANIC_PCI +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Eric Auger +RH-MergeRequest: 2: aarch64-rh-devices: add CONFIG_PVPANIC_PCI +RH-Commit: [1/1] f3d0a94a91ea1b3fff925f32affce1b77469e206 (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1747467 +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones + +We want to enable the PVPANIC facility on ARM. On aarch64, +the PVPANIC PCI device is used (on x86_64 the ISA device is used). +so let's set the PVPANIC_PCI config. + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + default-configs/devices/aarch64-rh-devices.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak +index a4d67274c0..4220469178 100644 +--- a/default-configs/devices/aarch64-rh-devices.mak ++++ b/default-configs/devices/aarch64-rh-devices.mak +@@ -26,3 +26,4 @@ CONFIG_TPM_EMULATOR=y + CONFIG_TPM_TIS_SYSBUS=y + CONFIG_PTIMER=y + CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y ++CONFIG_PVPANIC_PCI=y +-- +2.27.0 + diff --git a/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PXB.patch b/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PXB.patch new file mode 100644 index 0000000..37b85fb --- /dev/null +++ b/SOURCES/kvm-aarch64-rh-devices-add-CONFIG_PXB.patch @@ -0,0 +1,37 @@ +From d05ba1e2208cb17b8cf7dac050d95137a67dd988 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Thu, 24 Jun 2021 10:32:08 +0200 +Subject: [PATCH 01/12] aarch64-rh-devices: add CONFIG_PXB +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Eric Auger +RH-MergeRequest: 14: aarch64-rh-devices: add CONFIG_PXB +RH-Commit: [1/1] 6a9e6a96ea6ba1bee220a60e5a691a174a0a044b (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1967502 +RH-Acked-by: Gavin Shan +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Andrew Jones + +We want to enable the PCIe expander bridge on aarch64. So let's +set CONFIG_PXB. + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + default-configs/devices/aarch64-rh-devices.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/devices/aarch64-rh-devices.mak b/default-configs/devices/aarch64-rh-devices.mak +index 4220469178..d8ce902720 100644 +--- a/default-configs/devices/aarch64-rh-devices.mak ++++ b/default-configs/devices/aarch64-rh-devices.mak +@@ -27,3 +27,4 @@ CONFIG_TPM_TIS_SYSBUS=y + CONFIG_PTIMER=y + CONFIG_ARM_COMPATIBLE_SEMIHOSTING=y + CONFIG_PVPANIC_PCI=y ++CONFIG_PXB=y +-- +2.27.0 + diff --git a/SOURCES/kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch b/SOURCES/kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch new file mode 100644 index 0000000..bff1686 --- /dev/null +++ b/SOURCES/kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch @@ -0,0 +1,111 @@ +From 456bb6cb658b9d332fa0b5b91946916b48ed449e Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Thu, 29 Jul 2021 07:42:10 -0400 +Subject: [PATCH 09/39] acpi: pc: revert back to v5.2 PCI slot enumeration + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [1/15] 57222343ccae17b99b4e166798d4d0eecca2e22b (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Commit [1] moved _SUN variable from only hot-pluggable to +all devices. This made linux kernel enumerate extra slots +that weren't present before. If extra slot happens to be +be enumerated first and there is a device in th same slot +but on other bridge, linux kernel will add -N suffix to +slot name of the later, thus changing NIC name compared to +QEMU 5.2. This in some case confuses systemd, if it is +using SLOT NIC naming scheme and interface name becomes +not the same as it was under QEMU-5.2. + +Reproducer QEMU CLI: + -M pc-i440fx-5.2 -nodefaults \ + -device pci-bridge,chassis_nr=1,id=pci.1,bus=pci.0,addr=0x3 \ + -device virtio-net-pci,id=nic1,bus=pci.1,addr=0x1 \ + -device virtio-net-pci,id=nic2,bus=pci.1,addr=0x2 \ + -device virtio-net-pci,id=nic3,bus=pci.1,addr=0x3 + +with RHEL8 guest produces following results: + v5.2: + kernel: virtio_net virtio0 ens1: renamed from eth0 + kernel: virtio_net virtio2 ens3: renamed from eth2 + kernel: virtio_net virtio1 enp1s2: renamed from eth1 + (slot 2 is assigned to empty bus 0 slot and virtio1 + is assigned to 2-2 slot, and renaming falls back, + for some reason, to path based naming scheme) + + v6.0: + kernel: virtio_net virtio0 ens1: renamed from eth0 + kernel: virtio_net virtio2 ens3: renamed from eth2 + systemd-udevd[299]: Error changing net interface name 'eth1' to 'ens3': File exists + systemd-udevd[299]: could not rename interface '3' from 'eth1' to 'ens3': File exists + (with commit [1] kernel assigns virtio2 to 3-2 slot + since bridge advertises _SUN=0x3 and kernel assigns + slot 3 to bridge. Still it manages to rename virtio2 + correctly to ens3, however systemd gets confused with virtio1 + where slot allocation exactly the same (2-2) as in 5.2 case + and tries to rename it to ens3 which is rightfully taken by + virtio2) + +I'm not sure what breaks in systemd interface renaming (it probably +should be investigated), but on QEMU side we can safely revert +_SUN to 5.2 behavior (i.e. avoid cold-plugged bridges and non +hot-pluggable device classes), without breaking acpi-index, which uses +slot numbers but it doesn't have to use _SUN, it could use an arbitrary +variable name that has the same slot value). +It will help existing VMs to keep networking with non trivial +configs in working order since systemd will do its interface +renaming magic as it used to do. + +1) +Fixes: b7f23f62e40 (pci: acpi: add _DSM method to PCI devices) +Signed-off-by: Igor Mammedov +Message-Id: <20210624204229.998824-3-imammedo@redhat.com> +Reviewed-by: Stefan Hajnoczi +Tested-by: John Sucaet +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 7193d7cdd93e50f0e5f09803b98d27d3f9b147ac) +Signed-off-by: Igor Mammedov +Signed-off-by: Miroslav Rezanina +--- + hw/i386/acpi-build.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index de98750aef..dbee0cd3bc 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -432,11 +432,15 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, + aml_append(dev, aml_name_decl("_ADR", aml_int(slot << 16))); + + if (bsel) { +- aml_append(dev, aml_name_decl("_SUN", aml_int(slot))); ++ /* ++ * Can't declare _SUN here for every device as it changes 'slot' ++ * enumeration order in linux kernel, so use another variable for it ++ */ ++ aml_append(dev, aml_name_decl("ASUN", aml_int(slot))); + method = aml_method("_DSM", 4, AML_SERIALIZED); + aml_append(method, aml_return( + aml_call6("PDSM", aml_arg(0), aml_arg(1), aml_arg(2), +- aml_arg(3), aml_name("BSEL"), aml_name("_SUN")) ++ aml_arg(3), aml_name("BSEL"), aml_name("ASUN")) + )); + aml_append(dev, method); + } +@@ -463,6 +467,7 @@ static void build_append_pci_bus_devices(Aml *parent_scope, PCIBus *bus, + aml_append(method, aml_return(aml_int(s3d))); + aml_append(dev, method); + } else if (hotplug_enabled_dev) { ++ aml_append(dev, aml_name_decl("_SUN", aml_int(slot))); + /* add _EJ0 to make slot hotpluggable */ + method = aml_method("_EJ0", 1, AML_NOTSERIALIZED); + aml_append(method, +-- +2.27.0 + diff --git a/SOURCES/kvm-arm-virt-Enable-ARM-RAS-support.patch b/SOURCES/kvm-arm-virt-Enable-ARM-RAS-support.patch new file mode 100644 index 0000000..a3881b8 --- /dev/null +++ b/SOURCES/kvm-arm-virt-Enable-ARM-RAS-support.patch @@ -0,0 +1,68 @@ +From 170a9c7dc044a0094b48c658e0d57c97c4b854e0 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Wed, 30 Jun 2021 13:38:03 +0200 +Subject: [PATCH 03/13] arm/virt: Enable ARM RAS support + +RH-Author: Eric Auger +RH-MergeRequest: 19: arm/virt: Support RAS +RH-Commit: [3/3] 1572368bb0f47463a1f6ffa3f5baa97242440c98 (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1838608 +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones +RH-Acked-by: Igor Mammedov + +We want to support ARM RAS (Reliability, Availability & Serviceability). +So let's register the RAS property as a class property. It is +unset by default. + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index fe1111d527..0084935ec8 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -2281,7 +2281,6 @@ static void virt_set_acpi(Object *obj, Visitor *v, const char *name, + visit_type_OnOffAuto(v, name, &vms->acpi, errp); + } + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + static bool virt_get_ras(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -2296,6 +2295,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); +@@ -3013,6 +3013,12 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + "Set the IOMMU type. " + "Valid values are none and smmuv3"); + ++ 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", +@@ -3063,7 +3069,7 @@ static void rhel_virt_instance_init(Object *obj) + /* Default disallows iommu instantiation */ + vms->iommu = VIRT_IOMMU_NONE; + +- /* Default disallows RAS instantiation and is non-configurable for RHEL */ ++ /* Default disallows RAS instantiation */ + vms->ras = false; + + /* MTE is disabled by default and non-configurable for RHEL */ +-- +2.27.0 + diff --git a/SOURCES/kvm-arm-virt-Register-highmem-and-gic-version-as-class-p.patch b/SOURCES/kvm-arm-virt-Register-highmem-and-gic-version-as-class-p.patch new file mode 100644 index 0000000..52641bd --- /dev/null +++ b/SOURCES/kvm-arm-virt-Register-highmem-and-gic-version-as-class-p.patch @@ -0,0 +1,77 @@ +From e808acaa50effe471c56a48b80d5e0d2d196b495 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Tue, 25 May 2021 09:22:23 +0200 +Subject: [PATCH 01/15] arm/virt: Register highmem and gic-version as class + properties + +RH-Author: Eric Auger +RH-MergeRequest: 1: Add 9.0.0 and 8.5.0 arm-virt machine types +RH-Commit: [1/2] 1ff3970773e09f2efb194430511928ae852c02ba (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1952449 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones + +This mirrors changes made in commit +b91def7b8382 ("rm/virt: Register most properties as class properties") +for the highmem and gic-version properties. This makes the +code easier to diff against upstream. + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 23 ++++++++++++----------- + 1 file changed, 12 insertions(+), 11 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 080cf54ef1..51a415570c 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -2996,6 +2996,18 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + 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, "x-oem-id", + virt_get_oem_id, + virt_set_oem_id); +@@ -3004,7 +3016,6 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + "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); +@@ -3027,17 +3038,7 @@ static void rhel_virt_instance_init(Object *obj) + + /* High memory is enabled by default */ + vms->highmem = true; +- object_property_add_bool(obj, "highmem", virt_get_highmem, +- virt_set_highmem); +- object_property_set_description(obj, "highmem", +- "Set on/off to enable/disable using " +- "physical address space above 32 bits"); + vms->gic_version = VIRT_GIC_VERSION_NOSEL; +- object_property_add_str(obj, "gic-version", virt_get_gic_version, +- virt_set_gic_version); +- object_property_set_description(obj, "gic-version", +- "Set GIC version. " +- "Valid values are 2, 3, host and max"); + + vms->highmem_ecam = !vmc->no_highmem_ecam; + +-- +2.27.0 + diff --git a/SOURCES/kvm-arm-virt-Register-iommu-as-a-class-property.patch b/SOURCES/kvm-arm-virt-Register-iommu-as-a-class-property.patch new file mode 100644 index 0000000..5235851 --- /dev/null +++ b/SOURCES/kvm-arm-virt-Register-iommu-as-a-class-property.patch @@ -0,0 +1,54 @@ +From 42e530c513914b83273ec8c6a29100eb3c737604 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Wed, 30 Jun 2021 07:28:38 -0400 +Subject: [PATCH 01/13] arm/virt: Register iommu as a class property + +RH-Author: Eric Auger +RH-MergeRequest: 19: arm/virt: Support RAS +RH-Commit: [1/3] 48428de4deb5af94891aa5552fb9f4ea6d69acef (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1838608 +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones +RH-Acked-by: Igor Mammedov + +As done for highmem and gic-version, let's register the iommu property +as a class property. This is closer to the upstream code. This +change was originally made by upstream commit: +b91def7b8382 ("arm/virt: Register most properties as class properties") + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index e4aa794f83..bdae24a753 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3008,6 +3008,11 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + "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_str(oc, "x-oem-id", + virt_get_oem_id, + virt_set_oem_id); +@@ -3056,10 +3061,6 @@ static void rhel_virt_instance_init(Object *obj) + + /* Default disallows iommu instantiation */ + vms->iommu = VIRT_IOMMU_NONE; +- object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu); +- object_property_set_description(obj, "iommu", +- "Set the IOMMU type. " +- "Valid values are none and smmuv3"); + + /* Default disallows RAS instantiation and is non-configurable for RHEL */ + vms->ras = false; +-- +2.27.0 + diff --git a/SOURCES/kvm-arm-virt-Register-its-as-a-class-property.patch b/SOURCES/kvm-arm-virt-Register-its-as-a-class-property.patch new file mode 100644 index 0000000..a0f9ff7 --- /dev/null +++ b/SOURCES/kvm-arm-virt-Register-its-as-a-class-property.patch @@ -0,0 +1,56 @@ +From 29d18bdaf3dad52a052b2b058cd8f74652a72f76 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Thu, 8 Jul 2021 05:14:47 -0400 +Subject: [PATCH 02/13] arm/virt: Register its as a class property + +RH-Author: Eric Auger +RH-MergeRequest: 19: arm/virt: Support RAS +RH-Commit: [2/3] 95debacfd59d06ed2dcaeb120b20a280ff515434 (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1838608 +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones +RH-Acked-by: Igor Mammedov + +As done for highmem, gic-version, iommu, let's register the its property +as a class property. This is closer to the upstream code. This +change was originally made by upstream commit: +b91def7b8382 ("arm/virt: Register most properties as class properties") + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index bdae24a753..fe1111d527 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3013,6 +3013,12 @@ static void rhel_machine_class_init(ObjectClass *oc, void *data) + "Set the IOMMU type. " + "Valid values are none and smmuv3"); + ++ 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); +@@ -3052,11 +3058,6 @@ static void rhel_virt_instance_init(Object *obj) + } else { + /* Default allows ITS instantiation */ + vms->its = true; +- object_property_add_bool(obj, "its", virt_get_its, +- virt_set_its); +- object_property_set_description(obj, "its", +- "Set on/off to enable/disable " +- "ITS instantiation"); + } + + /* Default disallows iommu instantiation */ +-- +2.27.0 + diff --git a/SOURCES/kvm-audio-Never-send-migration-section.patch b/SOURCES/kvm-audio-Never-send-migration-section.patch new file mode 100644 index 0000000..474612d --- /dev/null +++ b/SOURCES/kvm-audio-Never-send-migration-section.patch @@ -0,0 +1,63 @@ +From 1e69dbe01e1cad1680723e1bc086cc52a1772c17 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 11 Aug 2021 08:40:38 -0400 +Subject: [PATCH 27/39] audio: Never send migration section +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 35: Synchronize with RHEL-AV 8.5 release 28 to RHEL 9 +RH-Commit: [4/4] 0b6ec114a3573ac7efcbe5ab3094d8020899c82d (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Philippe Mathieu-Daudé + +The audio migration vmstate is empty, and always has been; we can't +just remove it though because an old qemu might send it us. +Changes with -audiodev now mean it's sometimes created when it didn't +used to be, and can confuse migration to old qemu. + +Change it so that vmstate_audio is never sent; if it's received it +should still be accepted, and old qemu's shouldn't be too upset if it's +missing. + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Daniel P. Berrangé +Tested-by: Daniel P. Berrangé +Message-Id: <20210809170956.78536-1-dgilbert@redhat.com> +Signed-off-by: Gerd Hoffmann +(cherry picked from commit da77adbaf619c4d170cb42d769145ad1803fbad9) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + audio/audio.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/audio/audio.c b/audio/audio.c +index 534278edfe..fa724ea8e0 100644 +--- a/audio/audio.c ++++ b/audio/audio.c +@@ -1621,10 +1621,20 @@ void audio_cleanup(void) + } + } + ++static bool vmstate_audio_needed(void *opaque) ++{ ++ /* ++ * Never needed, this vmstate only exists in case ++ * an old qemu sends it to us. ++ */ ++ return false; ++} ++ + static const VMStateDescription vmstate_audio = { + .name = "audio", + .version_id = 1, + .minimum_version_id = 1, ++ .needed = vmstate_audio_needed, + .fields = (VMStateField[]) { + VMSTATE_END_OF_LIST() + } +-- +2.27.0 + diff --git a/SOURCES/kvm-block-Add-option-to-use-driver-whitelist-even-in-too.patch b/SOURCES/kvm-block-Add-option-to-use-driver-whitelist-even-in-too.patch new file mode 100644 index 0000000..4934ffe --- /dev/null +++ b/SOURCES/kvm-block-Add-option-to-use-driver-whitelist-even-in-too.patch @@ -0,0 +1,121 @@ +From 0739f735f99a6f1760a422023c262c1aa542a2e5 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 9 Jul 2021 18:41:41 +0200 +Subject: [PATCH 19/43] block: Add option to use driver whitelist even in tools +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Kevin Wolf +RH-MergeRequest: 26: block: Disable unsupported/read-only block drivers even in tools +RH-Commit: [1/2] 6755d5ff4ef43f275ae530de2b2a568ffd2d3497 (kmwolf/centos-qemu-kvm) +RH-Bugzilla: 1957782 +RH-Acked-by: Max Reitz +RH-Acked-by: Richard W.M. Jones +RH-Acked-by: Philippe Mathieu-Daudé + +Currently, the block driver whitelists are only applied for the system +emulator. All other binaries still give unrestricted access to all block +drivers. There are use cases where this made sense because the main +concern was avoiding customers running VMs on less optimised block +drivers and getting bad performance. Allowing the same image format e.g. +as a target for 'qemu-img convert' is not a problem then. + +However, if the concern is the supportability of the driver in general, +either in full or when used read-write, not applying the list driver +whitelist in tools doesn't help - especially since qemu-nbd and +qemu-storage-daemon now give access to more or less the same operations +in block drivers as running a system emulator. + +In order to address this, introduce a new configure option that enforces +the driver whitelist in all binaries. + +Signed-off-by: Kevin Wolf +Message-Id: <20210709164141.254097-1-kwolf@redhat.com> +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit e5f05f8c375157211c7da625a0d3f3ccdb4957d5) +Signed-off-by: Kevin Wolf +--- + block.c | 3 +++ + configure | 14 ++++++++++++-- + meson.build | 1 + + 3 files changed, 16 insertions(+), 2 deletions(-) + +diff --git a/block.c b/block.c +index c5b887cec1..76ecede5af 100644 +--- a/block.c ++++ b/block.c +@@ -5817,6 +5817,9 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, + + void bdrv_init(void) + { ++#ifdef CONFIG_BDRV_WHITELIST_TOOLS ++ use_bdrv_whitelist = 1; ++#endif + module_call_init(MODULE_INIT_BLOCK); + } + +diff --git a/configure b/configure +index 53b2fa583a..7edc08afb3 100755 +--- a/configure ++++ b/configure +@@ -243,6 +243,7 @@ cross_prefix="" + audio_drv_list="" + block_drv_rw_whitelist="" + block_drv_ro_whitelist="" ++block_drv_whitelist_tools="no" + host_cc="cc" + audio_win_int="" + libs_qga="" +@@ -1029,6 +1030,10 @@ for opt do + ;; + --block-drv-ro-whitelist=*) block_drv_ro_whitelist=$(echo "$optarg" | sed -e 's/,/ /g') + ;; ++ --enable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="yes" ++ ;; ++ --disable-block-drv-whitelist-in-tools) block_drv_whitelist_tools="no" ++ ;; + --enable-debug-tcg) debug_tcg="yes" + ;; + --disable-debug-tcg) debug_tcg="no" +@@ -1764,10 +1769,12 @@ Advanced options (experts only): + --block-drv-whitelist=L Same as --block-drv-rw-whitelist=L + --block-drv-rw-whitelist=L + set block driver read-write whitelist +- (affects only QEMU, not qemu-img) ++ (by default affects only QEMU, not tools like qemu-img) + --block-drv-ro-whitelist=L + set block driver read-only whitelist +- (affects only QEMU, not qemu-img) ++ (by default affects only QEMU, not tools like qemu-img) ++ --enable-block-drv-whitelist-in-tools ++ use block whitelist also in tools instead of only QEMU + --enable-trace-backends=B Set trace backend + Available backends: $trace_backend_list + --with-trace-file=NAME Full PATH,NAME of file to store traces +@@ -5571,6 +5578,9 @@ if test "$audio_win_int" = "yes" ; then + fi + echo "CONFIG_BDRV_RW_WHITELIST=$block_drv_rw_whitelist" >> $config_host_mak + echo "CONFIG_BDRV_RO_WHITELIST=$block_drv_ro_whitelist" >> $config_host_mak ++if test "$block_drv_whitelist_tools" = "yes" ; then ++ echo "CONFIG_BDRV_WHITELIST_TOOLS=y" >> $config_host_mak ++fi + if test "$xfs" = "yes" ; then + echo "CONFIG_XFS=y" >> $config_host_mak + fi +diff --git a/meson.build b/meson.build +index 06c15bd6d2..49b8164ade 100644 +--- a/meson.build ++++ b/meson.build +@@ -2606,6 +2606,7 @@ summary_info += {'coroutine pool': config_host['CONFIG_COROUTINE_POOL'] == '1 + if have_block + summary_info += {'Block whitelist (rw)': config_host['CONFIG_BDRV_RW_WHITELIST']} + summary_info += {'Block whitelist (ro)': config_host['CONFIG_BDRV_RO_WHITELIST']} ++ summary_info += {'Use block whitelist in tools': config_host.has_key('CONFIG_BDRV_WHITELIST_TOOLS')} + summary_info += {'VirtFS support': have_virtfs} + summary_info += {'build virtiofs daemon': have_virtiofsd} + summary_info += {'Live block migration': config_host.has_key('CONFIG_LIVE_BLOCK_MIGRATION')} +-- +2.27.0 + diff --git a/SOURCES/kvm-block-Fix-in_flight-leak-in-request-padding-error-pa.patch b/SOURCES/kvm-block-Fix-in_flight-leak-in-request-padding-error-pa.patch new file mode 100644 index 0000000..6545209 --- /dev/null +++ b/SOURCES/kvm-block-Fix-in_flight-leak-in-request-padding-error-pa.patch @@ -0,0 +1,71 @@ +From 872e82621b1341e8b96bda47f7f43dfffd356249 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Tue, 27 Jul 2021 17:49:23 +0200 +Subject: [PATCH 04/13] block: Fix in_flight leak in request padding error path + +RH-Author: Kevin Wolf +RH-MergeRequest: 31: block: Fix in_flight leak in request padding error path +RH-Commit: [1/1] a0d1bf38d9a69818cd6cefc3779f2988b484605a (kmwolf/centos-qemu-kvm) +RH-Bugzilla: 1972079 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Eric Blake +RH-Acked-by: Max Reitz + +When bdrv_pad_request() fails in bdrv_co_preadv_part(), bs->in_flight +has been increased, but is never decreased again. This leads to a hang +when trying to drain the block node. + +This bug was observed with Windows guests which issue a request that +fully uses IOV_MAX during installation, so that when padding is +necessary (O_DIRECT with a 4k sector size block device on the host), +adding another entry causes failure. + +Call bdrv_dec_in_flight() to fix this. There is a larger problem to +solve here because this request shouldn't even fail, but Windows doesn't +seem to care and with this minimal fix the installation succeeds. So +given that we're already in freeze, let's take this minimal fix for 6.1. + +Fixes: 98ca45494fcd6bf0336ecd559e440b6de6ea4cd3 +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1972079 +Reported-by: Qing Wang +Signed-off-by: Kevin Wolf +Message-Id: <20210727154923.91067-1-kwolf@redhat.com> +Reviewed-by: Max Reitz +Signed-off-by: Kevin Wolf +(cherry picked from commit 87ab88025247b893aad5071fd38301b67be76d1a) +Signed-off-by: Kevin Wolf +Signed-off-by: Miroslav Rezanina +--- + block/io.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/block/io.c b/block/io.c +index a4b2e3adf1..5033d51334 100644 +--- a/block/io.c ++++ b/block/io.c +@@ -1811,7 +1811,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, + ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad, + NULL); + if (ret < 0) { +- return ret; ++ goto fail; + } + + tracked_request_begin(&req, bs, offset, bytes, BDRV_TRACKED_READ); +@@ -1819,10 +1819,11 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child, + bs->bl.request_alignment, + qiov, qiov_offset, flags); + tracked_request_end(&req); +- bdrv_dec_in_flight(bs); +- + bdrv_padding_destroy(&pad); + ++fail: ++ bdrv_dec_in_flight(bs); ++ + return ret; + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-block-add-max_hw_transfer-to-BlockLimits.patch b/SOURCES/kvm-block-add-max_hw_transfer-to-BlockLimits.patch new file mode 100644 index 0000000..75f1b5d --- /dev/null +++ b/SOURCES/kvm-block-add-max_hw_transfer-to-BlockLimits.patch @@ -0,0 +1,131 @@ +From 6773549977d94c504ec76aed67506ae85adff973 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:33 -0400 +Subject: [PATCH 17/43] block: add max_hw_transfer to BlockLimits + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +For block host devices, I/O can happen through either the kernel file +descriptor I/O system calls (preadv/pwritev, io_submit, io_uring) +or the SCSI passthrough ioctl SG_IO. + +In the latter case, the size of each transfer can be limited by the +HBA, while for file descriptor I/O the kernel is able to split and +merge I/O in smaller pieces as needed. Applying the HBA limits to +file descriptor I/O results in more system calls and suboptimal +performance, so this patch splits the max_transfer limit in two: +max_transfer remains valid and is used in general, while max_hw_transfer +is limited to the maximum hardware size. max_hw_transfer can then be +included by the scsi-generic driver in the block limits page, to ensure +that the stricter hardware limit is used. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 24b36e9813ec15da7db62e3b3621730710c5f020) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/block-backend.c | 13 +++++++++++++ + block/file-posix.c | 2 +- + block/io.c | 2 ++ + hw/scsi/scsi-generic.c | 2 +- + include/block/block_int.h | 7 +++++++ + include/sysemu/block-backend.h | 1 + + 6 files changed, 25 insertions(+), 2 deletions(-) + +diff --git a/block/block-backend.c b/block/block-backend.c +index 136cc602c5..b5f5b4b048 100644 +--- a/block/block-backend.c ++++ b/block/block-backend.c +@@ -1939,6 +1939,19 @@ uint32_t blk_get_request_alignment(BlockBackend *blk) + return bs ? bs->bl.request_alignment : BDRV_SECTOR_SIZE; + } + ++/* Returns the maximum hardware transfer length, in bytes; guaranteed nonzero */ ++uint64_t blk_get_max_hw_transfer(BlockBackend *blk) ++{ ++ BlockDriverState *bs = blk_bs(blk); ++ uint64_t max = INT_MAX; ++ ++ if (bs) { ++ max = MIN_NON_ZERO(max, bs->bl.max_hw_transfer); ++ max = MIN_NON_ZERO(max, bs->bl.max_transfer); ++ } ++ return ROUND_DOWN(max, blk_get_request_alignment(blk)); ++} ++ + /* Returns the maximum transfer length, in bytes; guaranteed nonzero */ + uint32_t blk_get_max_transfer(BlockBackend *blk) + { +diff --git a/block/file-posix.c b/block/file-posix.c +index 1a6c799e19..44325a635d 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -1258,7 +1258,7 @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp) + int ret = sg_get_max_transfer_length(s->fd); + + if (ret > 0 && ret <= BDRV_REQUEST_MAX_BYTES) { +- bs->bl.max_transfer = pow2floor(ret); ++ bs->bl.max_hw_transfer = pow2floor(ret); + } + + ret = sg_get_max_segments(s->fd); +diff --git a/block/io.c b/block/io.c +index ca2dca3007..a4b2e3adf1 100644 +--- a/block/io.c ++++ b/block/io.c +@@ -126,6 +126,8 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src) + { + dst->opt_transfer = MAX(dst->opt_transfer, src->opt_transfer); + dst->max_transfer = MIN_NON_ZERO(dst->max_transfer, src->max_transfer); ++ dst->max_hw_transfer = MIN_NON_ZERO(dst->max_hw_transfer, ++ src->max_hw_transfer); + dst->opt_mem_alignment = MAX(dst->opt_mem_alignment, + src->opt_mem_alignment); + dst->min_mem_alignment = MAX(dst->min_mem_alignment, +diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c +index 82e1e2ee79..3762dce749 100644 +--- a/hw/scsi/scsi-generic.c ++++ b/hw/scsi/scsi-generic.c +@@ -179,7 +179,7 @@ static void scsi_handle_inquiry_reply(SCSIGenericReq *r, SCSIDevice *s) + (r->req.cmd.buf[1] & 0x01)) { + page = r->req.cmd.buf[2]; + if (page == 0xb0) { +- uint32_t max_transfer = blk_get_max_transfer(s->conf.blk); ++ uint64_t max_transfer = blk_get_max_hw_transfer(s->conf.blk); + uint32_t max_iov = blk_get_max_iov(s->conf.blk); + + assert(max_transfer); +diff --git a/include/block/block_int.h b/include/block/block_int.h +index 88e4111939..09d8630ec4 100644 +--- a/include/block/block_int.h ++++ b/include/block/block_int.h +@@ -695,6 +695,13 @@ typedef struct BlockLimits { + * clamped down. */ + uint32_t max_transfer; + ++ /* Maximal hardware transfer length in bytes. Applies whenever ++ * transfers to the device bypass the kernel I/O scheduler, for ++ * example with SG_IO. If larger than max_transfer or if zero, ++ * blk_get_max_hw_transfer will fall back to max_transfer. ++ */ ++ uint64_t max_hw_transfer; ++ + /* memory alignment, in bytes so that no bounce buffer is needed */ + size_t min_mem_alignment; + +diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h +index 5423e3d9c6..9ac5f7bbd3 100644 +--- a/include/sysemu/block-backend.h ++++ b/include/sysemu/block-backend.h +@@ -208,6 +208,7 @@ void blk_eject(BlockBackend *blk, bool eject_flag); + int blk_get_flags(BlockBackend *blk); + uint32_t blk_get_request_alignment(BlockBackend *blk); + uint32_t blk_get_max_transfer(BlockBackend *blk); ++uint64_t blk_get_max_hw_transfer(BlockBackend *blk); + int blk_get_max_iov(BlockBackend *blk); + void blk_set_guest_block_size(BlockBackend *blk, int align); + void *blk_try_blockalign(BlockBackend *blk, size_t size); +-- +2.27.0 + diff --git a/SOURCES/kvm-block-backend-add-drained_poll.patch b/SOURCES/kvm-block-backend-add-drained_poll.patch new file mode 100644 index 0000000..b3cbc54 --- /dev/null +++ b/SOURCES/kvm-block-backend-add-drained_poll.patch @@ -0,0 +1,74 @@ +From e23a2be8c57666e091d9192e113a30ea06cd83ef Mon Sep 17 00:00:00 2001 +From: Sergio Lopez Pascual +Date: Thu, 17 Jun 2021 09:13:20 -0400 +Subject: [PATCH 05/12] block-backend: add drained_poll +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [3/8] 4ad1f536b00a762a1b094d76383b74826228892a (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +Allow block backends to poll their devices/users to check if they have +been quiesced when entering a drained section. + +This will be used in the next patch to wait for the NBD server to be +completely quiesced. + +Suggested-by: Kevin Wolf +Reviewed-by: Kevin Wolf +Reviewed-by: Eric Blake +Signed-off-by: Sergio Lopez +Message-Id: <20210602060552.17433-2-slp@redhat.com> +Reviewed-by: Vladimir Sementsov-Ogievskiy +Signed-off-by: Kevin Wolf +(cherry picked from commit 095cc4d0f62513d75e9bc1da37f08d9e97f267c4) +Signed-off-by: Sergio Lopez +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/block-backend.c | 7 ++++++- + include/sysemu/block-backend.h | 4 ++++ + 2 files changed, 10 insertions(+), 1 deletion(-) + +diff --git a/block/block-backend.c b/block/block-backend.c +index 413af51f3b..05d8e5fb5d 100644 +--- a/block/block-backend.c ++++ b/block/block-backend.c +@@ -2378,8 +2378,13 @@ static void blk_root_drained_begin(BdrvChild *child) + static bool blk_root_drained_poll(BdrvChild *child) + { + BlockBackend *blk = child->opaque; ++ bool busy = false; + assert(blk->quiesce_counter); +- return !!blk->in_flight; ++ ++ if (blk->dev_ops && blk->dev_ops->drained_poll) { ++ busy = blk->dev_ops->drained_poll(blk->dev_opaque); ++ } ++ return busy || !!blk->in_flight; + } + + static void blk_root_drained_end(BdrvChild *child, int *drained_end_counter) +diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h +index 880e903293..5423e3d9c6 100644 +--- a/include/sysemu/block-backend.h ++++ b/include/sysemu/block-backend.h +@@ -66,6 +66,10 @@ typedef struct BlockDevOps { + * Runs when the backend's last drain request ends. + */ + void (*drained_end)(void *opaque); ++ /* ++ * Is the device still busy? ++ */ ++ bool (*drained_poll)(void *opaque); + } BlockDevOps; + + /* This struct is embedded in (the private) BlockBackend struct and contains +-- +2.27.0 + diff --git a/SOURCES/kvm-block-backend-align-max_transfer-to-request-alignmen.patch b/SOURCES/kvm-block-backend-align-max_transfer-to-request-alignmen.patch new file mode 100644 index 0000000..c788c86 --- /dev/null +++ b/SOURCES/kvm-block-backend-align-max_transfer-to-request-alignmen.patch @@ -0,0 +1,47 @@ +From 643c979c2bfa0fc3c45ec8ec5f05a77e0b075356 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:32 -0400 +Subject: [PATCH 16/43] block-backend: align max_transfer to request alignment + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Block device requests must be aligned to bs->bl.request_alignment. +It makes sense for drivers to align bs->bl.max_transfer the same +way; however when there is no specified limit, blk_get_max_transfer +just returns INT_MAX. Since the contract of the function does not +specify that INT_MAX means "no maximum", just align the outcome +of the function (whether INT_MAX or bs->bl.max_transfer) before +returning it. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit b99f7fa08a3df8b8a6a907642e5851cdcf43fa9f) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/block-backend.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/block/block-backend.c b/block/block-backend.c +index 05d8e5fb5d..136cc602c5 100644 +--- a/block/block-backend.c ++++ b/block/block-backend.c +@@ -1943,12 +1943,12 @@ uint32_t blk_get_request_alignment(BlockBackend *blk) + uint32_t blk_get_max_transfer(BlockBackend *blk) + { + BlockDriverState *bs = blk_bs(blk); +- uint32_t max = 0; ++ uint32_t max = INT_MAX; + + if (bs) { +- max = bs->bl.max_transfer; ++ max = MIN_NON_ZERO(max, bs->bl.max_transfer); + } +- return MIN_NON_ZERO(max, INT_MAX); ++ return ROUND_DOWN(max, blk_get_request_alignment(blk)); + } + + int blk_get_max_iov(BlockBackend *blk) +-- +2.27.0 + diff --git a/SOURCES/kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch b/SOURCES/kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch new file mode 100644 index 0000000..df36313 --- /dev/null +++ b/SOURCES/kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch @@ -0,0 +1,106 @@ +From 1d85424fe5208986fc07fe9baa1e9b33d77b185a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= +Date: Thu, 29 Jul 2021 07:42:35 -0400 +Subject: [PATCH 20/39] block/nvme: Fix VFIO_MAP_DMA failed: No space left on + device +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [12/15] f4b3456e4ce1a876a64f9fb92c56f8f981076953 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +When the NVMe block driver was introduced (see commit bdd6a90a9e5, +January 2018), Linux VFIO_IOMMU_MAP_DMA ioctl was only returning +-ENOMEM in case of error. The driver was correctly handling the +error path to recycle its volatile IOVA mappings. + +To fix CVE-2019-3882, Linux commit 492855939bdb ("vfio/type1: Limit +DMA mappings per container", April 2019) added the -ENOSPC error to +signal the user exhausted the DMA mappings available for a container. + +The block driver started to mis-behave: + + qemu-system-x86_64: VFIO_MAP_DMA failed: No space left on device + (qemu) + (qemu) info status + VM status: paused (io-error) + (qemu) c + VFIO_MAP_DMA failed: No space left on device + (qemu) c + VFIO_MAP_DMA failed: No space left on device + +(The VM is not resumable from here, hence stuck.) + +Fix by handling the new -ENOSPC error (when DMA mappings are +exhausted) without any distinction to the current -ENOMEM error, +so we don't change the behavior on old kernels where the CVE-2019-3882 +fix is not present. + +An easy way to reproduce this bug is to restrict the DMA mapping +limit (65535 by default) when loading the VFIO IOMMU module: + + # modprobe vfio_iommu_type1 dma_entry_limit=666 + +Cc: qemu-stable@nongnu.org +Cc: Fam Zheng +Cc: Maxim Levitsky +Cc: Alex Williamson +Reported-by: Michal Prívozník +Signed-off-by: Philippe Mathieu-Daudé +Message-id: 20210723195843.1032825-1-philmd@redhat.com +Fixes: bdd6a90a9e5 ("block: Add VFIO based NVMe driver") +Buglink: https://bugs.launchpad.net/qemu/+bug/1863333 +Resolves: https://gitlab.com/qemu-project/qemu/-/issues/65 +Signed-off-by: Philippe Mathieu-Daudé +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 15a730e7a3aaac180df72cd5730e0617bcf44a5a) +Signed-off-by: Philippe Mathieu-Daudé +Signed-off-by: Miroslav Rezanina +--- + block/nvme.c | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/block/nvme.c b/block/nvme.c +index 2b5421e7aa..e8dbbc2317 100644 +--- a/block/nvme.c ++++ b/block/nvme.c +@@ -1030,7 +1030,29 @@ try_map: + r = qemu_vfio_dma_map(s->vfio, + qiov->iov[i].iov_base, + len, true, &iova); ++ if (r == -ENOSPC) { ++ /* ++ * In addition to the -ENOMEM error, the VFIO_IOMMU_MAP_DMA ++ * ioctl returns -ENOSPC to signal the user exhausted the DMA ++ * mappings available for a container since Linux kernel commit ++ * 492855939bdb ("vfio/type1: Limit DMA mappings per container", ++ * April 2019, see CVE-2019-3882). ++ * ++ * This block driver already handles this error path by checking ++ * for the -ENOMEM error, so we directly replace -ENOSPC by ++ * -ENOMEM. Beside, -ENOSPC has a specific meaning for blockdev ++ * coroutines: it triggers BLOCKDEV_ON_ERROR_ENOSPC and ++ * BLOCK_ERROR_ACTION_STOP which stops the VM, asking the operator ++ * to add more storage to the blockdev. Not something we can do ++ * easily with an IOMMU :) ++ */ ++ r = -ENOMEM; ++ } + if (r == -ENOMEM && retry) { ++ /* ++ * We exhausted the DMA mappings available for our container: ++ * recycle the volatile IOVA mappings. ++ */ + retry = false; + trace_nvme_dma_flush_queue_wait(s); + if (s->dma_map_count) { +-- +2.27.0 + diff --git a/SOURCES/kvm-configure-Fix-endianess-test-with-LTO.patch b/SOURCES/kvm-configure-Fix-endianess-test-with-LTO.patch new file mode 100644 index 0000000..9dd8745 --- /dev/null +++ b/SOURCES/kvm-configure-Fix-endianess-test-with-LTO.patch @@ -0,0 +1,82 @@ +From 40e5138fb1e615c927a21d0b3f2e24eca885ede4 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Thu, 15 Jul 2021 10:39:28 +0200 +Subject: [PATCH 36/39] configure: Fix endianess test with LTO + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [9/11] c4be415076356fe74efab6f74d7b347064bbdb40 (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +If a user is trying to compile QEMU with link-time optimization +enabled by running the configure script like this: + + .../configure --extra-cflags="-flto" + +then the endianess test is failing since the magic values do not +show up in the intermediate object files there. If the host is +a big endian machine (like s390x), the QEMU binary is then unusable +since the corresponding variable "bigendian" is pre-initialized +with "no". + +To fix this issue, we should rather create a full binary and look +for the magic strings there instead. +And we really should not continue the build if the endianess check +failed, to make it clear right from the start that something went +wrong here, thus let's also add some "exit 1" statements here +after emitting the error message. + +Message-Id: <20210715083928.933806-1-thuth@redhat.com> +Reviewed-by: Richard Henderson +Signed-off-by: Thomas Huth +(cherry picked from commit 659eb157a55666bf379f5362238a86d855e262e2) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + configure | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/configure b/configure +index 83d8af7fe4..dcd9520bed 100755 +--- a/configure ++++ b/configure +@@ -2323,24 +2323,27 @@ feature_not_found() { + # --- + # big/little endian test + cat > $TMPC << EOF ++#include + short big_endian[] = { 0x4269, 0x4765, 0x4e64, 0x4961, 0x4e00, 0, }; + short little_endian[] = { 0x694c, 0x7454, 0x654c, 0x6e45, 0x6944, 0x6e41, 0, }; +-extern int foo(short *, short *); +-int main(int argc, char *argv[]) { +- return foo(big_endian, little_endian); ++int main(int argc, char *argv[]) ++{ ++ return printf("%s %s\n", (char *)big_endian, (char *)little_endian); + } + EOF + +-if compile_object ; then +- if strings -a $TMPO | grep -q BiGeNdIaN ; then ++if compile_prog ; then ++ if strings -a $TMPE | grep -q BiGeNdIaN ; then + bigendian="yes" +- elif strings -a $TMPO | grep -q LiTtLeEnDiAn ; then ++ elif strings -a $TMPE | grep -q LiTtLeEnDiAn ; then + bigendian="no" + else + echo big/little test failed ++ exit 1 + fi + else + echo big/little test failed ++ exit 1 + fi + + ########################################## +-- +2.27.0 + diff --git a/SOURCES/kvm-disable-CONFIG_USB_STORAGE_BOT.patch b/SOURCES/kvm-disable-CONFIG_USB_STORAGE_BOT.patch new file mode 100644 index 0000000..017b5ae --- /dev/null +++ b/SOURCES/kvm-disable-CONFIG_USB_STORAGE_BOT.patch @@ -0,0 +1,49 @@ +From 64ec0505fccf6f277430f3be1829a9e44cd00dbb Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 18 Jun 2021 12:04:24 -0400 +Subject: [PATCH 07/12] disable CONFIG_USB_STORAGE_BOT +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [5/8] 73d3ee0a17590c8cddf6bd812e6a758951c36ea4 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + default-configs/devices/ppc64-rh-devices.mak | 1 - + default-configs/devices/x86_64-rh-devices.mak | 1 - + 2 files changed, 2 deletions(-) + +diff --git a/default-configs/devices/ppc64-rh-devices.mak b/default-configs/devices/ppc64-rh-devices.mak +index 5b01b7fac0..3ec5603ace 100644 +--- a/default-configs/devices/ppc64-rh-devices.mak ++++ b/default-configs/devices/ppc64-rh-devices.mak +@@ -15,7 +15,6 @@ CONFIG_USB=y + CONFIG_USB_OHCI=y + CONFIG_USB_OHCI_PCI=y + CONFIG_USB_SMARTCARD=y +-CONFIG_USB_STORAGE_BOT=y + CONFIG_USB_STORAGE_CORE=y + CONFIG_USB_STORAGE_CLASSIC=y + CONFIG_USB_XHCI=y +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index d09c138fc6..81bda09f4c 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -74,7 +74,6 @@ CONFIG_USB=y + CONFIG_USB_EHCI=y + CONFIG_USB_EHCI_PCI=y + CONFIG_USB_SMARTCARD=y +-CONFIG_USB_STORAGE_BOT=y + CONFIG_USB_STORAGE_CORE=y + CONFIG_USB_STORAGE_CLASSIC=y + CONFIG_USB_UHCI=y +-- +2.27.0 + diff --git a/SOURCES/kvm-disable-ac97-audio.patch b/SOURCES/kvm-disable-ac97-audio.patch new file mode 100644 index 0000000..469c6c4 --- /dev/null +++ b/SOURCES/kvm-disable-ac97-audio.patch @@ -0,0 +1,37 @@ +From e2bb4b752d68856c4c307640ae310f47f680aed6 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 20 Aug 2021 10:21:07 +0200 +Subject: [PATCH 2/4] disable ac97 audio +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 39: disable ac97 audio +RH-Commit: [1/1] 5d1bd969d20f960cb0a023f0d6cd1ae5adda22e6 (kraxel/centos-qemu-kvm) +RH-Bugzilla: 1995819 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Thomas Huth + +RH-Bugzilla: 1995819 + +Signed-off-by: Gerd Hoffmann +--- + default-configs/devices/x86_64-rh-devices.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index c2dd112f81..8ae2747bf6 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -1,6 +1,5 @@ + include rh-virtio.mak + +-CONFIG_AC97=y + CONFIG_ACPI=y + CONFIG_ACPI_PCI=y + CONFIG_ACPI_CPU_HOTPLUG=y +-- +2.27.0 + diff --git a/SOURCES/kvm-disable-sga-device.patch b/SOURCES/kvm-disable-sga-device.patch new file mode 100644 index 0000000..611e72b --- /dev/null +++ b/SOURCES/kvm-disable-sga-device.patch @@ -0,0 +1,38 @@ +From 86338b2497c47ec6e7175197f6a2ed6af0fcfe73 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Fri, 20 Aug 2021 10:47:28 +0200 +Subject: [PATCH 1/2] disable sga device +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gerd Hoffmann +RH-MergeRequest: 27: disable sga device +RH-Commit: [1/2] 103299f3596b49bb03fd2a80fa30983b3d5c8951 +RH-Bugzilla: 1995807 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Philippe Mathieu-Daudé + +RH-Bugzilla: 1995807 + +Signed-off-by: Gerd Hoffmann +--- + default-configs/devices/x86_64-rh-devices.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/devices/x86_64-rh-devices.mak b/default-configs/devices/x86_64-rh-devices.mak +index 8ae2747bf6..31c290d02d 100644 +--- a/default-configs/devices/x86_64-rh-devices.mak ++++ b/default-configs/devices/x86_64-rh-devices.mak +@@ -65,7 +65,6 @@ CONFIG_SERIAL=y + CONFIG_SERIAL_ISA=y + CONFIG_SERIAL_PCI=y + CONFIG_SEV=y +-CONFIG_SGA=y + CONFIG_SMBIOS=y + CONFIG_SMBUS_EEPROM=y + CONFIG_TEST_DEVICES=y +-- +2.27.0 + diff --git a/SOURCES/kvm-doc-Fix-some-mistakes-in-the-SEV-documentation.patch b/SOURCES/kvm-doc-Fix-some-mistakes-in-the-SEV-documentation.patch new file mode 100644 index 0000000..7439afd --- /dev/null +++ b/SOURCES/kvm-doc-Fix-some-mistakes-in-the-SEV-documentation.patch @@ -0,0 +1,151 @@ +From 17c1559139d6a58794944901f84dd4e8cd1f5335 Mon Sep 17 00:00:00 2001 +From: Connor Kuehl +Date: Tue, 22 Jun 2021 20:00:20 -0400 +Subject: [PATCH 08/12] doc: Fix some mistakes in the SEV documentation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [6/8] ce828f81de1320a1833241700cb13dfdcf7d82e7 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +From: Tom Lendacky + +Fix some spelling and grammar mistakes in the amd-memory-encryption.txt +file. No new information added. + +Signed-off-by: Tom Lendacky +Reviewed-by: Laszlo Ersek +Reviewed-by: Connor Kuehl +Message-Id: +Signed-off-by: Eduardo Habkost +(cherry picked from commit f538adeccf4554e6402fe661a0a51bcc8d6bd227) +Signed-off-by: Connor Kuehl +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + docs/amd-memory-encryption.txt | 59 +++++++++++++++++----------------- + 1 file changed, 29 insertions(+), 30 deletions(-) + +diff --git a/docs/amd-memory-encryption.txt b/docs/amd-memory-encryption.txt +index 145896aec7..ed85159ea7 100644 +--- a/docs/amd-memory-encryption.txt ++++ b/docs/amd-memory-encryption.txt +@@ -1,38 +1,38 @@ + Secure Encrypted Virtualization (SEV) is a feature found on AMD processors. + + SEV is an extension to the AMD-V architecture which supports running encrypted +-virtual machine (VMs) under the control of KVM. Encrypted VMs have their pages ++virtual machines (VMs) under the control of KVM. Encrypted VMs have their pages + (code and data) secured such that only the guest itself has access to the + unencrypted version. Each encrypted VM is associated with a unique encryption +-key; if its data is accessed to a different entity using a different key the ++key; if its data is accessed by a different entity using a different key the + encrypted guests data will be incorrectly decrypted, leading to unintelligible + data. + +-The key management of this feature is handled by separate processor known as +-AMD secure processor (AMD-SP) which is present in AMD SOCs. Firmware running +-inside the AMD-SP provide commands to support common VM lifecycle. This ++Key management for this feature is handled by a separate processor known as the ++AMD secure processor (AMD-SP), which is present in AMD SOCs. Firmware running ++inside the AMD-SP provides commands to support a common VM lifecycle. This + includes commands for launching, snapshotting, migrating and debugging the +-encrypted guest. Those SEV command can be issued via KVM_MEMORY_ENCRYPT_OP ++encrypted guest. These SEV commands can be issued via KVM_MEMORY_ENCRYPT_OP + ioctls. + + Launching + --------- +-Boot images (such as bios) must be encrypted before guest can be booted. +-MEMORY_ENCRYPT_OP ioctl provides commands to encrypt the images :LAUNCH_START, ++Boot images (such as bios) must be encrypted before a guest can be booted. The ++MEMORY_ENCRYPT_OP ioctl provides commands to encrypt the images: LAUNCH_START, + LAUNCH_UPDATE_DATA, LAUNCH_MEASURE and LAUNCH_FINISH. These four commands + together generate a fresh memory encryption key for the VM, encrypt the boot +-images and provide a measurement than can be used as an attestation of the ++images and provide a measurement than can be used as an attestation of a + successful launch. + + LAUNCH_START is called first to create a cryptographic launch context within +-the firmware. To create this context, guest owner must provides guest policy, ++the firmware. To create this context, guest owner must provide a guest policy, + its public Diffie-Hellman key (PDH) and session parameters. These inputs +-should be treated as binary blob and must be passed as-is to the SEV firmware. ++should be treated as a binary blob and must be passed as-is to the SEV firmware. + +-The guest policy is passed as plaintext and hypervisor may able to read it ++The guest policy is passed as plaintext. A hypervisor may choose to read it, + but should not modify it (any modification of the policy bits will result + in bad measurement). The guest policy is a 4-byte data structure containing +-several flags that restricts what can be done on running SEV guest. ++several flags that restricts what can be done on a running SEV guest. + See KM Spec section 3 and 6.2 for more details. + + The guest policy can be provided via the 'policy' property (see below) +@@ -40,31 +40,30 @@ The guest policy can be provided via the 'policy' property (see below) + # ${QEMU} \ + sev-guest,id=sev0,policy=0x1...\ + +-Guest owners provided DH certificate and session parameters will be used to ++The guest owner provided DH certificate and session parameters will be used to + establish a cryptographic session with the guest owner to negotiate keys used + for the attestation. + +-The DH certificate and session blob can be provided via 'dh-cert-file' and +-'session-file' property (see below ++The DH certificate and session blob can be provided via the 'dh-cert-file' and ++'session-file' properties (see below) + + # ${QEMU} \ + sev-guest,id=sev0,dh-cert-file=,session-file= + + LAUNCH_UPDATE_DATA encrypts the memory region using the cryptographic context +-created via LAUNCH_START command. If required, this command can be called ++created via the LAUNCH_START command. If required, this command can be called + multiple times to encrypt different memory regions. The command also calculates + the measurement of the memory contents as it encrypts. + +-LAUNCH_MEASURE command can be used to retrieve the measurement of encrypted +-memory. This measurement is a signature of the memory contents that can be +-sent to the guest owner as an attestation that the memory was encrypted +-correctly by the firmware. The guest owner may wait to provide the guest +-confidential information until it can verify the attestation measurement. +-Since the guest owner knows the initial contents of the guest at boot, the +-attestation measurement can be verified by comparing it to what the guest owner +-expects. ++LAUNCH_MEASURE can be used to retrieve the measurement of encrypted memory. ++This measurement is a signature of the memory contents that can be sent to the ++guest owner as an attestation that the memory was encrypted correctly by the ++firmware. The guest owner may wait to provide the guest confidential information ++until it can verify the attestation measurement. Since the guest owner knows the ++initial contents of the guest at boot, the attestation measurement can be ++verified by comparing it to what the guest owner expects. + +-LAUNCH_FINISH command finalizes the guest launch and destroy's the cryptographic ++LAUNCH_FINISH finalizes the guest launch and destroys the cryptographic + context. + + See SEV KM API Spec [1] 'Launching a guest' usage flow (Appendix A) for the +@@ -78,10 +77,10 @@ To launch a SEV guest + + Debugging + ----------- +-Since memory contents of SEV guest is encrypted hence hypervisor access to the +-guest memory will get a cipher text. If guest policy allows debugging, then +-hypervisor can use DEBUG_DECRYPT and DEBUG_ENCRYPT commands access the guest +-memory region for debug purposes. This is not supported in QEMU yet. ++Since the memory contents of a SEV guest are encrypted, hypervisor access to ++the guest memory will return cipher text. If the guest policy allows debugging, ++then a hypervisor can use the DEBUG_DECRYPT and DEBUG_ENCRYPT commands to access ++the guest memory region for debug purposes. This is not supported in QEMU yet. + + Snapshot/Restore + ----------------- +-- +2.27.0 + diff --git a/SOURCES/kvm-docs-Add-SEV-ES-documentation-to-amd-memory-encrypti.patch b/SOURCES/kvm-docs-Add-SEV-ES-documentation-to-amd-memory-encrypti.patch new file mode 100644 index 0000000..2aabcbd --- /dev/null +++ b/SOURCES/kvm-docs-Add-SEV-ES-documentation-to-amd-memory-encrypti.patch @@ -0,0 +1,141 @@ +From 1bd5660666d2a1f704ebabeed8a2bbfa02410f41 Mon Sep 17 00:00:00 2001 +From: Connor Kuehl +Date: Tue, 22 Jun 2021 20:00:21 -0400 +Subject: [PATCH 09/12] docs: Add SEV-ES documentation to + amd-memory-encryption.txt +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [7/8] 36e49577484813866132b90c64cf99779326db74 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +From: Tom Lendacky + +Update the amd-memory-encryption.txt file with information about SEV-ES, +including how to launch an SEV-ES guest and some of the differences +between SEV and SEV-ES guests in regards to launching and measuring the +guest. + +Signed-off-by: Tom Lendacky +Acked-by: Laszlo Ersek +Reviewed-by: Connor Kuehl +Message-Id: +Signed-off-by: Eduardo Habkost +(cherry picked from commit 61b7d7098cd53dd386939610d534f8bd79240881) +Signed-off-by: Connor Kuehl +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + docs/amd-memory-encryption.txt | 54 +++++++++++++++++++++++++++++----- + 1 file changed, 47 insertions(+), 7 deletions(-) + +diff --git a/docs/amd-memory-encryption.txt b/docs/amd-memory-encryption.txt +index ed85159ea7..ffca382b5f 100644 +--- a/docs/amd-memory-encryption.txt ++++ b/docs/amd-memory-encryption.txt +@@ -15,6 +15,13 @@ includes commands for launching, snapshotting, migrating and debugging the + encrypted guest. These SEV commands can be issued via KVM_MEMORY_ENCRYPT_OP + ioctls. + ++Secure Encrypted Virtualization - Encrypted State (SEV-ES) builds on the SEV ++support to additionally protect the guest register state. In order to allow a ++hypervisor to perform functions on behalf of a guest, there is architectural ++support for notifying a guest's operating system when certain types of VMEXITs ++are about to occur. This allows the guest to selectively share information with ++the hypervisor to satisfy the requested function. ++ + Launching + --------- + Boot images (such as bios) must be encrypted before a guest can be booted. The +@@ -24,6 +31,9 @@ together generate a fresh memory encryption key for the VM, encrypt the boot + images and provide a measurement than can be used as an attestation of a + successful launch. + ++For a SEV-ES guest, the LAUNCH_UPDATE_VMSA command is also used to encrypt the ++guest register state, or VM save area (VMSA), for all of the guest vCPUs. ++ + LAUNCH_START is called first to create a cryptographic launch context within + the firmware. To create this context, guest owner must provide a guest policy, + its public Diffie-Hellman key (PDH) and session parameters. These inputs +@@ -40,6 +50,12 @@ The guest policy can be provided via the 'policy' property (see below) + # ${QEMU} \ + sev-guest,id=sev0,policy=0x1...\ + ++Setting the "SEV-ES required" policy bit (bit 2) will launch the guest as a ++SEV-ES guest (see below) ++ ++# ${QEMU} \ ++ sev-guest,id=sev0,policy=0x5...\ ++ + The guest owner provided DH certificate and session parameters will be used to + establish a cryptographic session with the guest owner to negotiate keys used + for the attestation. +@@ -55,13 +71,19 @@ created via the LAUNCH_START command. If required, this command can be called + multiple times to encrypt different memory regions. The command also calculates + the measurement of the memory contents as it encrypts. + +-LAUNCH_MEASURE can be used to retrieve the measurement of encrypted memory. +-This measurement is a signature of the memory contents that can be sent to the +-guest owner as an attestation that the memory was encrypted correctly by the +-firmware. The guest owner may wait to provide the guest confidential information +-until it can verify the attestation measurement. Since the guest owner knows the +-initial contents of the guest at boot, the attestation measurement can be +-verified by comparing it to what the guest owner expects. ++LAUNCH_UPDATE_VMSA encrypts all the vCPU VMSAs for a SEV-ES guest using the ++cryptographic context created via the LAUNCH_START command. The command also ++calculates the measurement of the VMSAs as it encrypts them. ++ ++LAUNCH_MEASURE can be used to retrieve the measurement of encrypted memory and, ++for a SEV-ES guest, encrypted VMSAs. This measurement is a signature of the ++memory contents and, for a SEV-ES guest, the VMSA contents, that can be sent ++to the guest owner as an attestation that the memory and VMSAs were encrypted ++correctly by the firmware. The guest owner may wait to provide the guest ++confidential information until it can verify the attestation measurement. ++Since the guest owner knows the initial contents of the guest at boot, the ++attestation measurement can be verified by comparing it to what the guest owner ++expects. + + LAUNCH_FINISH finalizes the guest launch and destroys the cryptographic + context. +@@ -75,6 +97,22 @@ To launch a SEV guest + -machine ...,confidential-guest-support=sev0 \ + -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1 + ++To launch a SEV-ES guest ++ ++# ${QEMU} \ ++ -machine ...,confidential-guest-support=sev0 \ ++ -object sev-guest,id=sev0,cbitpos=47,reduced-phys-bits=1,policy=0x5 ++ ++An SEV-ES guest has some restrictions as compared to a SEV guest. Because the ++guest register state is encrypted and cannot be updated by the VMM/hypervisor, ++a SEV-ES guest: ++ - Does not support SMM - SMM support requires updating the guest register ++ state. ++ - Does not support reboot - a system reset requires updating the guest register ++ state. ++ - Requires in-kernel irqchip - the burden is placed on the hypervisor to ++ manage booting APs. ++ + Debugging + ----------- + Since the memory contents of a SEV guest are encrypted, hypervisor access to +@@ -101,8 +139,10 @@ Secure Encrypted Virtualization Key Management: + + KVM Forum slides: + http://www.linux-kvm.org/images/7/74/02x08A-Thomas_Lendacky-AMDs_Virtualizatoin_Memory_Encryption_Technology.pdf ++https://www.linux-kvm.org/images/9/94/Extending-Secure-Encrypted-Virtualization-with-SEV-ES-Thomas-Lendacky-AMD.pdf + + AMD64 Architecture Programmer's Manual: + http://support.amd.com/TechDocs/24593.pdf + SME is section 7.10 + SEV is section 15.34 ++ SEV-ES is section 15.35 +-- +2.27.0 + diff --git a/SOURCES/kvm-docs-interop-firmware.json-Add-SEV-ES-support.patch b/SOURCES/kvm-docs-interop-firmware.json-Add-SEV-ES-support.patch new file mode 100644 index 0000000..e900ba7 --- /dev/null +++ b/SOURCES/kvm-docs-interop-firmware.json-Add-SEV-ES-support.patch @@ -0,0 +1,110 @@ +From e408203bab17e32f8d42ae9ad61e94a73bfaec67 Mon Sep 17 00:00:00 2001 +From: Connor Kuehl +Date: Tue, 22 Jun 2021 20:00:22 -0400 +Subject: [PATCH 10/12] docs/interop/firmware.json: Add SEV-ES support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [8/8] b49ebbaf40b56d95c67475a0373d6906a3e4f0e3 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +From: Tom Lendacky + +Create an enum definition, '@amd-sev-es', for SEV-ES and add documention +for the new enum. Add an example that shows some of the requirements for +SEV-ES, including not having SMM support and the requirement for an +X64-only build. + +Signed-off-by: Tom Lendacky +Reviewed-by: Laszlo Ersek +Reviewed-by: Connor Kuehl +Message-Id: +Signed-off-by: Eduardo Habkost +(cherry picked from commit d44df1d73ce04d7f4b8f94cba5f715e2dadc998b) +Signed-off-by: Connor Kuehl +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + docs/interop/firmware.json | 47 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 46 insertions(+), 1 deletion(-) + +diff --git a/docs/interop/firmware.json b/docs/interop/firmware.json +index 9d94ccafa9..8d8b0be030 100644 +--- a/docs/interop/firmware.json ++++ b/docs/interop/firmware.json +@@ -115,6 +115,12 @@ + # this feature are documented in + # "docs/amd-memory-encryption.txt". + # ++# @amd-sev-es: The firmware supports running under AMD Secure Encrypted ++# Virtualization - Encrypted State, as specified in the AMD64 ++# Architecture Programmer's Manual. QEMU command line options ++# related to this feature are documented in ++# "docs/amd-memory-encryption.txt". ++# + # @enrolled-keys: The variable store (NVRAM) template associated with + # the firmware binary has the UEFI Secure Boot + # operational mode turned on, with certificates +@@ -179,7 +185,7 @@ + # Since: 3.0 + ## + { 'enum' : 'FirmwareFeature', +- 'data' : [ 'acpi-s3', 'acpi-s4', 'amd-sev', 'enrolled-keys', ++ 'data' : [ 'acpi-s3', 'acpi-s4', 'amd-sev', 'amd-sev-es', 'enrolled-keys', + 'requires-smm', 'secure-boot', 'verbose-dynamic', + 'verbose-static' ] } + +@@ -504,6 +510,45 @@ + # } + # + # { ++# "description": "OVMF with SEV-ES support", ++# "interface-types": [ ++# "uefi" ++# ], ++# "mapping": { ++# "device": "flash", ++# "executable": { ++# "filename": "/usr/share/OVMF/OVMF_CODE.fd", ++# "format": "raw" ++# }, ++# "nvram-template": { ++# "filename": "/usr/share/OVMF/OVMF_VARS.fd", ++# "format": "raw" ++# } ++# }, ++# "targets": [ ++# { ++# "architecture": "x86_64", ++# "machines": [ ++# "pc-q35-*" ++# ] ++# } ++# ], ++# "features": [ ++# "acpi-s3", ++# "amd-sev", ++# "amd-sev-es", ++# "verbose-dynamic" ++# ], ++# "tags": [ ++# "-a X64", ++# "-p OvmfPkg/OvmfPkgX64.dsc", ++# "-t GCC48", ++# "-b DEBUG", ++# "-D FD_SIZE_4MB" ++# ] ++# } ++# ++# { + # "description": "UEFI firmware for ARM64 virtual machines", + # "interface-types": [ + # "uefi" +-- +2.27.0 + diff --git a/SOURCES/kvm-file-posix-fix-max_iov-for-dev-sg-devices.patch b/SOURCES/kvm-file-posix-fix-max_iov-for-dev-sg-devices.patch new file mode 100644 index 0000000..3027bec --- /dev/null +++ b/SOURCES/kvm-file-posix-fix-max_iov-for-dev-sg-devices.patch @@ -0,0 +1,50 @@ +From 0111d01afe82c46656a40269bf21eb7702c02a09 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:29 -0400 +Subject: [PATCH 13/43] file-posix: fix max_iov for /dev/sg devices + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Even though it was only called for devices that have bs->sg set (which +must be character devices), sg_get_max_segments looked at /sys/dev/block +which only works for block devices. + +On Linux the sg driver has its own way to provide the maximum number of +iovecs in a scatter/gather list, so add support for it. The block device +path is kept because it will be reinstated in the next patches. + +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +(cherry picked from commit 8ad5ab6148dca8aad297c134c09c84b0b92d45ed) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/file-posix.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/block/file-posix.c b/block/file-posix.c +index 20e14f8e96..74d4903dc1 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -1204,6 +1204,17 @@ static int sg_get_max_segments(int fd) + goto out; + } + ++ if (S_ISCHR(st.st_mode)) { ++ if (ioctl(fd, SG_GET_SG_TABLESIZE, &ret) == 0) { ++ return ret; ++ } ++ return -ENOTSUP; ++ } ++ ++ if (!S_ISBLK(st.st_mode)) { ++ return -ENOTSUP; ++ } ++ + sysfspath = g_strdup_printf("/sys/dev/block/%u:%u/queue/max_segments", + major(st.st_rdev), minor(st.st_rdev)); + sysfd = open(sysfspath, O_RDONLY); +-- +2.27.0 + diff --git a/SOURCES/kvm-file-posix-try-BLKSECTGET-on-block-devices-too-do-no.patch b/SOURCES/kvm-file-posix-try-BLKSECTGET-on-block-devices-too-do-no.patch new file mode 100644 index 0000000..c80576b --- /dev/null +++ b/SOURCES/kvm-file-posix-try-BLKSECTGET-on-block-devices-too-do-no.patch @@ -0,0 +1,140 @@ +From 9c8493d3a6d2e4d879d1ef67ff1abebd532c87a0 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:34 -0400 +Subject: [PATCH 18/43] file-posix: try BLKSECTGET on block devices too, do not + round to power of 2 + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +bs->sg is only true for character devices, but block devices can also +be used with scsi-block and scsi-generic. Unfortunately BLKSECTGET +returns bytes in an int for /dev/sgN devices, and sectors in a short +for block devices, so account for that in the code. + +The maximum transfer also need not be a power of 2 (for example I have +seen disks with 1280 KiB maximum transfer) so there's no need to pass +the result through pow2floor. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 18473467d55a20d643b6c9b3a52de42f705b4d35) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/file-posix.c | 57 +++++++++++++++++++++++++++------------------- + 1 file changed, 33 insertions(+), 24 deletions(-) + +diff --git a/block/file-posix.c b/block/file-posix.c +index 44325a635d..7b4ebf65d5 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -1173,22 +1173,27 @@ static void raw_reopen_abort(BDRVReopenState *state) + s->reopen_state = NULL; + } + +-static int sg_get_max_transfer_length(int fd) ++static int hdev_get_max_hw_transfer(int fd, struct stat *st) + { + #ifdef BLKSECTGET +- int max_bytes = 0; +- +- if (ioctl(fd, BLKSECTGET, &max_bytes) == 0) { +- return max_bytes; ++ if (S_ISBLK(st->st_mode)) { ++ unsigned short max_sectors = 0; ++ if (ioctl(fd, BLKSECTGET, &max_sectors) == 0) { ++ return max_sectors * 512; ++ } + } else { +- return -errno; ++ int max_bytes = 0; ++ if (ioctl(fd, BLKSECTGET, &max_bytes) == 0) { ++ return max_bytes; ++ } + } ++ return -errno; + #else + return -ENOSYS; + #endif + } + +-static int sg_get_max_segments(int fd) ++static int hdev_get_max_segments(int fd, struct stat *st) + { + #ifdef CONFIG_LINUX + char buf[32]; +@@ -1197,26 +1202,20 @@ static int sg_get_max_segments(int fd) + int ret; + int sysfd = -1; + long max_segments; +- struct stat st; +- +- if (fstat(fd, &st)) { +- ret = -errno; +- goto out; +- } + +- if (S_ISCHR(st.st_mode)) { ++ if (S_ISCHR(st->st_mode)) { + if (ioctl(fd, SG_GET_SG_TABLESIZE, &ret) == 0) { + return ret; + } + return -ENOTSUP; + } + +- if (!S_ISBLK(st.st_mode)) { ++ if (!S_ISBLK(st->st_mode)) { + return -ENOTSUP; + } + + sysfspath = g_strdup_printf("/sys/dev/block/%u:%u/queue/max_segments", +- major(st.st_rdev), minor(st.st_rdev)); ++ major(st->st_rdev), minor(st->st_rdev)); + sysfd = open(sysfspath, O_RDONLY); + if (sysfd == -1) { + ret = -errno; +@@ -1253,23 +1252,33 @@ out: + static void raw_refresh_limits(BlockDriverState *bs, Error **errp) + { + BDRVRawState *s = bs->opaque; ++ struct stat st; + +- if (bs->sg) { +- int ret = sg_get_max_transfer_length(s->fd); ++ raw_probe_alignment(bs, s->fd, errp); ++ bs->bl.min_mem_alignment = s->buf_align; ++ bs->bl.opt_mem_alignment = MAX(s->buf_align, qemu_real_host_page_size); ++ ++ /* ++ * Maximum transfers are best effort, so it is okay to ignore any ++ * errors. That said, based on the man page errors in fstat would be ++ * very much unexpected; the only possible case seems to be ENOMEM. ++ */ ++ if (fstat(s->fd, &st)) { ++ return; ++ } ++ ++ if (bs->sg || S_ISBLK(st.st_mode)) { ++ int ret = hdev_get_max_hw_transfer(s->fd, &st); + + if (ret > 0 && ret <= BDRV_REQUEST_MAX_BYTES) { +- bs->bl.max_hw_transfer = pow2floor(ret); ++ bs->bl.max_hw_transfer = ret; + } + +- ret = sg_get_max_segments(s->fd); ++ ret = hdev_get_max_segments(s->fd, &st); + if (ret > 0) { + bs->bl.max_iov = ret; + } + } +- +- raw_probe_alignment(bs, s->fd, errp); +- bs->bl.min_mem_alignment = s->buf_align; +- bs->bl.opt_mem_alignment = MAX(s->buf_align, qemu_real_host_page_size); + } + + static int check_for_dasd(int fd) +-- +2.27.0 + diff --git a/SOURCES/kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch b/SOURCES/kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch new file mode 100644 index 0000000..6ed6a6b --- /dev/null +++ b/SOURCES/kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch @@ -0,0 +1,51 @@ +From 3347d61ff783d05f41f03097551460dc5825b301 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Thu, 29 Jul 2021 07:42:14 -0400 +Subject: [PATCH 11/39] hmp: Fix loadvm to resume the VM on success instead of + failure + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [3/15] 492cfb8ef252805b988a256abe73628605f630e9 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Commit f61fe11aa6f broke hmp_loadvm() by adding an incorrect negation +when converting from 0/-errno return values to a bool value. The result +is that loadvm resumes the VM now if it failed and keeps it stopped if +it failed. Fix it to restore the old behaviour and do it the other way +around. + +Fixes: f61fe11aa6f7f8f0ffe4ddaa56a8108f3ab57854 +Cc: qemu-stable@nongnu.org +Reported-by: Yanhui Ma +Signed-off-by: Kevin Wolf +Message-Id: <20210511163151.45167-1-kwolf@redhat.com> +Reviewed-by: Dr. David Alan Gilbert +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit c53cd04e70641fdf9410aac40c617d074047b3e1) +Signed-off-by: Kevin Wolf +Signed-off-by: Miroslav Rezanina +--- + monitor/hmp-cmds.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c +index 0ad5b77477..cc15d9b6ee 100644 +--- a/monitor/hmp-cmds.c ++++ b/monitor/hmp-cmds.c +@@ -1133,7 +1133,7 @@ void hmp_loadvm(Monitor *mon, const QDict *qdict) + + vm_stop(RUN_STATE_RESTORE_VM); + +- if (!load_snapshot(name, NULL, false, NULL, &err) && saved_vm_running) { ++ if (load_snapshot(name, NULL, false, NULL, &err) && saved_vm_running) { + vm_start(); + } + hmp_handle_error(mon, err); +-- +2.27.0 + diff --git a/SOURCES/kvm-hw-arm-smmuv3-Another-range-invalidation-fix.patch b/SOURCES/kvm-hw-arm-smmuv3-Another-range-invalidation-fix.patch new file mode 100644 index 0000000..7fb1c3a --- /dev/null +++ b/SOURCES/kvm-hw-arm-smmuv3-Another-range-invalidation-fix.patch @@ -0,0 +1,111 @@ +From e9abef24fae799febf81cd4ac02efe8987a698e8 Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Wed, 26 May 2021 16:07:40 -0400 +Subject: [PATCH 15/15] hw/arm/smmuv3: Another range invalidation fix + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [12/12] dc064684e5f3f11d955565b05d37b0f2d9f79b91 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") +failed to completely fix misalignment issues with range +invalidation. For instance invalidations patterns like "invalidate 32 +4kB pages starting from 0xff395000 are not correctly handled" due +to the fact the previous fix only made sure the number of invalidated +pages were a power of 2 but did not properly handle the start +address was not aligned with the range. This can be noticed when +boothing a fedora 33 with protected virtio-blk-pci. + +Signed-off-by: Eric Auger +Fixes: 6d9cd115b9 ("hw/arm/smmuv3: Enforce invalidation on a power of two range") +Reviewed-by: Peter Maydell +Signed-off-by: Peter Maydell +(cherry picked from commit 219729cfbf9e979020bffedac6a790144173ec62) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/smmuv3.c | 50 +++++++++++++++++++++++++------------------------ + 1 file changed, 26 insertions(+), 24 deletions(-) + +diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c +index 8705612535..e1979282e4 100644 +--- a/hw/arm/smmuv3.c ++++ b/hw/arm/smmuv3.c +@@ -856,43 +856,45 @@ static void smmuv3_inv_notifiers_iova(SMMUState *s, int asid, dma_addr_t iova, + + static void smmuv3_s1_range_inval(SMMUState *s, Cmd *cmd) + { +- uint8_t scale = 0, num = 0, ttl = 0; +- dma_addr_t addr = CMD_ADDR(cmd); ++ dma_addr_t end, addr = CMD_ADDR(cmd); + uint8_t type = CMD_TYPE(cmd); + uint16_t vmid = CMD_VMID(cmd); ++ uint8_t scale = CMD_SCALE(cmd); ++ uint8_t num = CMD_NUM(cmd); ++ uint8_t ttl = CMD_TTL(cmd); + bool leaf = CMD_LEAF(cmd); + uint8_t tg = CMD_TG(cmd); +- uint64_t first_page = 0, last_page; +- uint64_t num_pages = 1; ++ uint64_t num_pages; ++ uint8_t granule; + int asid = -1; + +- if (tg) { +- scale = CMD_SCALE(cmd); +- num = CMD_NUM(cmd); +- ttl = CMD_TTL(cmd); +- num_pages = (num + 1) * BIT_ULL(scale); +- } +- + if (type == SMMU_CMD_TLBI_NH_VA) { + asid = CMD_ASID(cmd); + } + +- /* Split invalidations into ^2 range invalidations */ +- last_page = num_pages - 1; +- while (num_pages) { +- uint8_t granule = tg * 2 + 10; +- uint64_t mask, count; ++ if (!tg) { ++ trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, 1, ttl, leaf); ++ smmuv3_inv_notifiers_iova(s, asid, addr, tg, 1); ++ smmu_iotlb_inv_iova(s, asid, addr, tg, 1, ttl); ++ return; ++ } ++ ++ /* RIL in use */ + +- mask = dma_aligned_pow2_mask(first_page, last_page, 64 - granule); +- count = mask + 1; ++ num_pages = (num + 1) * BIT_ULL(scale); ++ granule = tg * 2 + 10; ++ ++ /* Split invalidations into ^2 range invalidations */ ++ end = addr + (num_pages << granule) - 1; + +- trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, count, ttl, leaf); +- smmuv3_inv_notifiers_iova(s, asid, addr, tg, count); +- smmu_iotlb_inv_iova(s, asid, addr, tg, count, ttl); ++ while (addr != end + 1) { ++ uint64_t mask = dma_aligned_pow2_mask(addr, end, 64); + +- num_pages -= count; +- first_page += count; +- addr += count * BIT_ULL(granule); ++ num_pages = (mask + 1) >> granule; ++ trace_smmuv3_s1_range_inval(vmid, asid, addr, tg, num_pages, ttl, leaf); ++ smmuv3_inv_notifiers_iova(s, asid, addr, tg, num_pages); ++ smmu_iotlb_inv_iova(s, asid, addr, tg, num_pages, ttl); ++ addr += mask + 1; + } + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-hw-arm-virt-Add-8.5-and-9.0-machine-types-and-remove.patch b/SOURCES/kvm-hw-arm-virt-Add-8.5-and-9.0-machine-types-and-remove.patch new file mode 100644 index 0000000..6415284 --- /dev/null +++ b/SOURCES/kvm-hw-arm-virt-Add-8.5-and-9.0-machine-types-and-remove.patch @@ -0,0 +1,63 @@ +From ee0be09f3598596e41b3fc2dbefef3382c5b0541 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Tue, 25 May 2021 09:22:24 +0200 +Subject: [PATCH 02/15] hw/arm/virt: Add 8.5 and 9.0 machine types and remove + older ones + +RH-Author: Eric Auger +RH-MergeRequest: 1: Add 9.0.0 and 8.5.0 arm-virt machine types +RH-Commit: [2/2] ace4619a1d505a3b552a236260b259bd6ddabc00 (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1952449 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones + +Add 8.5 and 9.0 machine types and remove older ones. + +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 24 +++++------------------- + 1 file changed, 5 insertions(+), 19 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 51a415570c..e4aa794f83 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3095,28 +3095,14 @@ static void rhel_machine_init(void) + } + type_init(rhel_machine_init); + +-static void rhel840_virt_options(MachineClass *mc) ++static void rhel900_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_8_4, hw_compat_rhel_8_4_len); + } +-DEFINE_RHEL_MACHINE_AS_LATEST(8, 4, 0) ++DEFINE_RHEL_MACHINE_AS_LATEST(9, 0, 0) + +-static void rhel830_virt_options(MachineClass *mc) ++static void rhel850_virt_options(MachineClass *mc) + { +- VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); +- +- rhel840_virt_options(mc); +- compat_props_add(mc->compat_props, hw_compat_rhel_8_3, hw_compat_rhel_8_3_len); +- vmc->no_kvm_steal_time = true; +-} +-DEFINE_RHEL_MACHINE(8, 3, 0) +- +-static void rhel820_virt_options(MachineClass *mc) +-{ +- rhel830_virt_options(mc); +- compat_props_add(mc->compat_props, hw_compat_rhel_8_2, hw_compat_rhel_8_2_len); +- mc->numa_mem_supported = true; +- mc->auto_enable_numa_with_memdev = false; ++ rhel900_virt_options(mc); + } +-DEFINE_RHEL_MACHINE(8, 2, 0) ++DEFINE_RHEL_MACHINE(8, 5, 0) +-- +2.27.0 + diff --git a/SOURCES/kvm-hw-arm-virt-Disable-PL011-clock-migration-through-hw.patch b/SOURCES/kvm-hw-arm-virt-Disable-PL011-clock-migration-through-hw.patch new file mode 100644 index 0000000..6ce6dd0 --- /dev/null +++ b/SOURCES/kvm-hw-arm-virt-Disable-PL011-clock-migration-through-hw.patch @@ -0,0 +1,51 @@ +From 7f76c347f17c5fc60f3bcb99ad65e26f9da4ed9f Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Thu, 20 May 2021 19:23:26 -0400 +Subject: [PATCH 10/15] hw/arm/virt: Disable PL011 clock migration through + hw_compat_rhel_8_3 + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [6/12] 5f52975350b2497ee82cc5c9b8ba930e3a9b8c3d (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +Disable PL011 clock migration for machine types before +virt-rhel8.4.0. + +The regression was introduced by aac63e0e6ea3 +("hw/char/pl011: add a clock input"), in 8.4, +causing failure of migration between qemu 8.4 towards +older ones. + +The fix was taken in 8.5 as part of the rebase, +e6fa978d8343 ("hw/arm/virt: Disable pl011 clock migration +if needed"). But the compat needs to be applied in +hw_compat_rhel_8_3[]. + +Signed-off-by: Eric Auger +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/core/machine.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index c665e869de..6c534e14fa 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -69,6 +69,8 @@ GlobalProperty hw_compat_rhel_8_3[] = { + { "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 */ +-- +2.27.0 + diff --git a/SOURCES/kvm-hw-arm-virt-Remove-9.0-machine-type.patch b/SOURCES/kvm-hw-arm-virt-Remove-9.0-machine-type.patch new file mode 100644 index 0000000..2df1426 --- /dev/null +++ b/SOURCES/kvm-hw-arm-virt-Remove-9.0-machine-type.patch @@ -0,0 +1,53 @@ +From 29af345b5879e73a45d6ea549037835d3db80726 Mon Sep 17 00:00:00 2001 +From: Eric Auger +Date: Tue, 17 Aug 2021 07:21:13 -0400 +Subject: [PATCH] hw/arm/virt: Remove 9.0 machine type +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Eric Auger +RH-MergeRequest: 23: hw/arm/virt: Remove 9.0 machine type +RH-Commit: [1/1] 07dd3c160593867473bc4be6cad707426a75bd81 +RH-Bugzilla: 1981462 +RH-Acked-by: Gavin Shan +RH-Acked-by: Philippe Mathieu-Daudé +RH-Acked-by: Andrew Jones + +branch: rhel-9.0.0-beta +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=39020228 +Upstream: no +Test: QMP query-machines and sample VM run + +To Align with other architectures, we remove the 9.0 machine type +for now and just keep the 8.5 one. + +Signed-off-by: Eric Auger +--- + hw/arm/virt.c | 10 ++-------- + 1 file changed, 2 insertions(+), 8 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 0084935ec8..ddd9a33e98 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -3103,14 +3103,8 @@ static void rhel_machine_init(void) + } + type_init(rhel_machine_init); + +-static void rhel900_virt_options(MachineClass *mc) +-{ +- compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len); +-} +-DEFINE_RHEL_MACHINE_AS_LATEST(9, 0, 0) +- + static void rhel850_virt_options(MachineClass *mc) + { +- rhel900_virt_options(mc); ++ compat_props_add(mc->compat_props, arm_rhel_compat, arm_rhel_compat_len); + } +-DEFINE_RHEL_MACHINE(8, 5, 0) ++DEFINE_RHEL_MACHINE_AS_LATEST(8, 5, 0) +-- +2.27.0 + diff --git a/SOURCES/kvm-hw-s390x-Remove-the-RHEL7-only-machine-type.patch b/SOURCES/kvm-hw-s390x-Remove-the-RHEL7-only-machine-type.patch new file mode 100644 index 0000000..cf4e6bb --- /dev/null +++ b/SOURCES/kvm-hw-s390x-Remove-the-RHEL7-only-machine-type.patch @@ -0,0 +1,67 @@ +From 64a9a5c971c424ff2d8074f52d48dd6233dc97ac Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Tue, 18 May 2021 18:27:54 +0200 +Subject: [PATCH] hw/s390x: Remove the RHEL7-only machine type + +RH-Author: Thomas Huth +RH-MergeRequest: 7: hw/s390x: Remove the RHEL7-only machine type +RH-Commit: [1/1] 8c53d4ae81 (thuth/qemu-kvm) +RH-Bugzilla: 1944730 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Cornelia Huck +RH-Acked-by: David Hildenbrand + +We only support live migration from RHEL8 in RHEL9, so we can remove +the RHEL7 machine type "s390-ccw-virtio-rhel7.5.0". + +Signed-off-by: Thomas Huth +--- + hw/s390x/s390-virtio-ccw.c | 32 -------------------------------- + 1 file changed, 32 deletions(-) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 8df6dd1c71..432f36bce5 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1125,38 +1125,6 @@ static void ccw_machine_rhel760_class_options(MachineClass *mc) + } + DEFINE_CCW_MACHINE(rhel760, "rhel7.6.0", false); + +-static void ccw_machine_rhel750_instance_options(MachineState *machine) +-{ +- static const S390FeatInit qemu_cpu_feat = { S390_FEAT_LIST_QEMU_V2_11 }; +- ccw_machine_rhel760_instance_options(machine); +- +- /* before 2.12 we emulated the very first z900, and RHEL 7.5 is +- based on 2.10 */ +- s390_set_qemu_cpu_model(0x2064, 7, 1, qemu_cpu_feat); +- +- /* bpb and ppa15 were only in the full model in RHEL 7.5 */ +- s390_cpudef_featoff_greater(11, 1, S390_FEAT_PPA15); +- s390_cpudef_featoff_greater(11, 1, S390_FEAT_BPB); +-} +- +-GlobalProperty ccw_compat_rhel_7_5[] = { +- { +- .driver = TYPE_SCLP_EVENT_FACILITY, +- .property = "allow_all_mask_sizes", +- .value = "off", +- }, +-}; +-const size_t ccw_compat_rhel_7_5_len = G_N_ELEMENTS(ccw_compat_rhel_7_5); +- +-static void ccw_machine_rhel750_class_options(MachineClass *mc) +-{ +- ccw_machine_rhel760_class_options(mc); +- compat_props_add(mc->compat_props, hw_compat_rhel_7_5, hw_compat_rhel_7_5_len); +- compat_props_add(mc->compat_props, ccw_compat_rhel_7_5, ccw_compat_rhel_7_5_len); +- S390_CCW_MACHINE_CLASS(mc)->hpage_1m_allowed = false; +-} +-DEFINE_CCW_MACHINE(rhel750, "rhel7.5.0", false); +- + static void ccw_machine_register_types(void) + { + type_register_static(&ccw_machine_info); +-- +2.27.0 + diff --git a/SOURCES/kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch b/SOURCES/kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch new file mode 100644 index 0000000..71f143a --- /dev/null +++ b/SOURCES/kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch @@ -0,0 +1,219 @@ +From e92a6c64cb4b1437c5b75f25a638dbb6eb041383 Mon Sep 17 00:00:00 2001 +From: "plai@redhat.com" +Date: Thu, 29 Jul 2021 07:42:27 -0400 +Subject: [PATCH 16/39] i386: Add ratelimit for bus locks acquired in guest + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [8/15] 2b8f01e05e44388c2f90d5281a9fe5537ab2433d (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +A bus lock is acquired through either split locked access to writeback +(WB) memory or any locked access to non-WB memory. It is typically >1000 +cycles slower than an atomic operation within a cache and can also +disrupts performance on other cores. + +Virtual Machines can exploit bus locks to degrade the performance of +system. To address this kind of performance DOS attack coming from the +VMs, bus lock VM exit is introduced in KVM and it can report the bus +locks detected in guest. If enabled in KVM, it would exit to the +userspace to let the user enforce throttling policies once bus locks +acquired in VMs. + +The availability of bus lock VM exit can be detected through the +KVM_CAP_X86_BUS_LOCK_EXIT. The returned bitmap contains the potential +policies supported by KVM. The field KVM_BUS_LOCK_DETECTION_EXIT in +bitmap is the only supported strategy at present. It indicates that KVM +will exit to userspace to handle the bus locks. + +This patch adds a ratelimit on the bus locks acquired in guest as a +mitigation policy. + +Introduce a new field "bus_lock_ratelimit" to record the limited speed +of bus locks in the target VM. The user can specify it through the +"bus-lock-ratelimit" as a machine property. In current implementation, +the default value of the speed is 0 per second, which means no +restrictions on the bus locks. + +As for ratelimit on detected bus locks, simply set the ratelimit +interval to 1s and restrict the quota of bus lock occurence to the value +of "bus_lock_ratelimit". A potential alternative is to introduce the +time slice as a property which can help the user achieve more precise +control. + +The detail of bus lock VM exit can be found in spec: +https://software.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html + +Signed-off-by: Chenyi Qiang +Message-Id: <20210521043820.29678-1-chenyi.qiang@intel.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 035d1ef26565f8f8eae058c37f5731a9ae304b96) +Signed-off-by: Paul Lai +Signed-off-by: Miroslav Rezanina +--- + hw/i386/x86.c | 24 ++++++++++++++++++++++++ + include/hw/i386/x86.h | 8 ++++++++ + target/i386/kvm/kvm.c | 41 +++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 73 insertions(+) + +diff --git a/hw/i386/x86.c b/hw/i386/x86.c +index ed796fe6ba..d30cf27e29 100644 +--- a/hw/i386/x86.c ++++ b/hw/i386/x86.c +@@ -1246,6 +1246,23 @@ static void x86_machine_set_oem_table_id(Object *obj, const char *value, + strncpy(x86ms->oem_table_id, value, 8); + } + ++static void x86_machine_get_bus_lock_ratelimit(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ X86MachineState *x86ms = X86_MACHINE(obj); ++ uint64_t bus_lock_ratelimit = x86ms->bus_lock_ratelimit; ++ ++ visit_type_uint64(v, name, &bus_lock_ratelimit, errp); ++} ++ ++static void x86_machine_set_bus_lock_ratelimit(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ X86MachineState *x86ms = X86_MACHINE(obj); ++ ++ visit_type_uint64(v, name, &x86ms->bus_lock_ratelimit, errp); ++} ++ + static void x86_machine_initfn(Object *obj) + { + X86MachineState *x86ms = X86_MACHINE(obj); +@@ -1256,6 +1273,7 @@ static void x86_machine_initfn(Object *obj) + x86ms->pci_irq_mask = ACPI_BUILD_PCI_IRQS; + x86ms->oem_id = g_strndup(ACPI_BUILD_APPNAME6, 6); + x86ms->oem_table_id = g_strndup(ACPI_BUILD_APPNAME8, 8); ++ x86ms->bus_lock_ratelimit = 0; + } + + static void x86_machine_class_init(ObjectClass *oc, void *data) +@@ -1299,6 +1317,12 @@ static void x86_machine_class_init(ObjectClass *oc, void *data) + "Override the default value of field OEM Table ID " + "in ACPI table header." + "The string may be up to 8 bytes in size"); ++ ++ object_class_property_add(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, "uint64_t", ++ x86_machine_get_bus_lock_ratelimit, ++ x86_machine_set_bus_lock_ratelimit, NULL, NULL); ++ object_class_property_set_description(oc, X86_MACHINE_BUS_LOCK_RATELIMIT, ++ "Set the ratelimit for the bus locks acquired in VMs"); + } + + static const TypeInfo x86_machine_info = { +diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h +index c09b648dff..25a1f16f01 100644 +--- a/include/hw/i386/x86.h ++++ b/include/hw/i386/x86.h +@@ -74,12 +74,20 @@ struct X86MachineState { + * will be translated to MSI messages in the address space. + */ + AddressSpace *ioapic_as; ++ ++ /* ++ * Ratelimit enforced on detected bus locks in guest. ++ * The default value of the bus_lock_ratelimit is 0 per second, ++ * which means no limitation on the guest's bus locks. ++ */ ++ uint64_t bus_lock_ratelimit; + }; + + #define X86_MACHINE_SMM "smm" + #define X86_MACHINE_ACPI "acpi" + #define X86_MACHINE_OEM_ID "x-oem-id" + #define X86_MACHINE_OEM_TABLE_ID "x-oem-table-id" ++#define X86_MACHINE_BUS_LOCK_RATELIMIT "bus-lock-ratelimit" + + #define TYPE_X86_MACHINE MACHINE_TYPE_NAME("x86") + OBJECT_DECLARE_TYPE(X86MachineState, X86MachineClass, X86_MACHINE) +diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c +index 4c69c2cb4b..af030af116 100644 +--- a/target/i386/kvm/kvm.c ++++ b/target/i386/kvm/kvm.c +@@ -130,6 +130,9 @@ static bool has_msr_mcg_ext_ctl; + static struct kvm_cpuid2 *cpuid_cache; + static struct kvm_msr_list *kvm_feature_msrs; + ++#define BUS_LOCK_SLICE_TIME 1000000000ULL /* ns */ ++static RateLimit bus_lock_ratelimit_ctrl; ++ + int kvm_has_pit_state2(void) + { + return has_pit_state2; +@@ -2267,6 +2270,28 @@ int kvm_arch_init(MachineState *ms, KVMState *s) + } + } + ++ if (object_dynamic_cast(OBJECT(ms), TYPE_X86_MACHINE)) { ++ X86MachineState *x86ms = X86_MACHINE(ms); ++ ++ if (x86ms->bus_lock_ratelimit > 0) { ++ ret = kvm_check_extension(s, KVM_CAP_X86_BUS_LOCK_EXIT); ++ if (!(ret & KVM_BUS_LOCK_DETECTION_EXIT)) { ++ error_report("kvm: bus lock detection unsupported"); ++ return -ENOTSUP; ++ } ++ ret = kvm_vm_enable_cap(s, KVM_CAP_X86_BUS_LOCK_EXIT, 0, ++ KVM_BUS_LOCK_DETECTION_EXIT); ++ if (ret < 0) { ++ error_report("kvm: Failed to enable bus lock detection cap: %s", ++ strerror(-ret)); ++ return ret; ++ } ++ ratelimit_init(&bus_lock_ratelimit_ctrl); ++ ratelimit_set_speed(&bus_lock_ratelimit_ctrl, ++ x86ms->bus_lock_ratelimit, BUS_LOCK_SLICE_TIME); ++ } ++ } ++ + return 0; + } + +@@ -4225,6 +4250,15 @@ void kvm_arch_pre_run(CPUState *cpu, struct kvm_run *run) + } + } + ++static void kvm_rate_limit_on_bus_lock(void) ++{ ++ uint64_t delay_ns = ratelimit_calculate_delay(&bus_lock_ratelimit_ctrl, 1); ++ ++ if (delay_ns) { ++ g_usleep(delay_ns / SCALE_US); ++ } ++} ++ + MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kvm_run *run) + { + X86CPU *x86_cpu = X86_CPU(cpu); +@@ -4240,6 +4274,9 @@ MemTxAttrs kvm_arch_post_run(CPUState *cpu, struct kvm_run *run) + } else { + env->eflags &= ~IF_MASK; + } ++ if (run->flags & KVM_RUN_X86_BUS_LOCK) { ++ kvm_rate_limit_on_bus_lock(); ++ } + + /* We need to protect the apic state against concurrent accesses from + * different threads in case the userspace irqchip is used. */ +@@ -4598,6 +4635,10 @@ int kvm_arch_handle_exit(CPUState *cs, struct kvm_run *run) + ioapic_eoi_broadcast(run->eoi.vector); + ret = 0; + break; ++ case KVM_EXIT_X86_BUS_LOCK: ++ /* already handled in kvm_arch_post_run */ ++ ret = 0; ++ break; + default: + fprintf(stderr, "KVM: unknown exit reason %d\n", run->exit_reason); + ret = -1; +-- +2.27.0 + diff --git a/SOURCES/kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch b/SOURCES/kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch new file mode 100644 index 0000000..9f007d8 --- /dev/null +++ b/SOURCES/kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch @@ -0,0 +1,82 @@ +From c24fcdf0712ef81ec25ca3a4a1144cca18303fbe Mon Sep 17 00:00:00 2001 +From: "plai@redhat.com" +Date: Thu, 29 Jul 2021 07:42:19 -0400 +Subject: [PATCH 13/39] i386/cpu: Expose AVX_VNNI instruction to guest + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [5/15] 56381e35a1dc06af7d457d1fe61b1c108dd25d06 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Expose AVX (VEX-encoded) versions of the Vector Neural Network +Instructions to guest. + +The bit definition: +CPUID.(EAX=7,ECX=1):EAX[bit 4] AVX_VNNI + +The following instructions are available when this feature is +present in the guest. + 1. VPDPBUS: Multiply and Add Unsigned and Signed Bytes + 2. VPDPBUSDS: Multiply and Add Unsigned and Signed Bytes with Saturation + 3. VPDPWSSD: Multiply and Add Signed Word Integers + 4. VPDPWSSDS: Multiply and Add Signed Integers with Saturation + +As for the kvm related code, please reference Linux commit id 1085a6b585d7. + +The release document ref below link: +https://software.intel.com/content/www/us/en/develop/download/\ +intel-architecture-instruction-set-extensions-programming-reference.html + +Signed-off-by: Yang Zhong +Message-Id: <20210407015609.22936-1-yang.zhong@intel.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit c1826ea6a052084f2e6a0bae9dd5932a727df039) +Signed-off-by: Paul Lai +Signed-off-by: Miroslav Rezanina +--- + target/i386/cpu.c | 4 ++-- + target/i386/cpu.h | 2 ++ + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index da47c3e50e..0de2932c79 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -996,7 +996,7 @@ static FeatureWordInfo feature_word_info[FEATURE_WORDS] = { + .type = CPUID_FEATURE_WORD, + .feat_names = { + NULL, NULL, NULL, NULL, +- NULL, "avx512-bf16", NULL, NULL, ++ "avx-vnni", "avx512-bf16", NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, +@@ -3284,7 +3284,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + MSR_ARCH_CAP_SKIP_L1DFL_VMENTRY | MSR_ARCH_CAP_MDS_NO | + MSR_ARCH_CAP_PSCHANGE_MC_NO | MSR_ARCH_CAP_TAA_NO, + .features[FEAT_7_1_EAX] = +- CPUID_7_1_EAX_AVX512_BF16, ++ CPUID_7_1_EAX_AVX_VNNI | CPUID_7_1_EAX_AVX512_BF16, + /* XSAVES is added in version 2 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | +diff --git a/target/i386/cpu.h b/target/i386/cpu.h +index 570f916878..edc8984448 100644 +--- a/target/i386/cpu.h ++++ b/target/i386/cpu.h +@@ -804,6 +804,8 @@ typedef uint64_t FeatureWordArray[FEATURE_WORDS]; + /* Speculative Store Bypass Disable */ + #define CPUID_7_0_EDX_SPEC_CTRL_SSBD (1U << 31) + ++/* AVX VNNI Instruction */ ++#define CPUID_7_1_EAX_AVX_VNNI (1U << 4) + /* AVX512 BFloat16 Instruction */ + #define CPUID_7_1_EAX_AVX512_BF16 (1U << 5) + +-- +2.27.0 + diff --git a/SOURCES/kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch b/SOURCES/kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch new file mode 100644 index 0000000..1d1ebf0 --- /dev/null +++ b/SOURCES/kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch @@ -0,0 +1,178 @@ +From a6ab9f3d290c2ff3c2fc0187c69cf8cf69feff40 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 6 Aug 2021 15:07:47 -0400 +Subject: [PATCH 24/39] iotests: Improve and rename test 291 to qemu-img-bitmap +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 35: Synchronize with RHEL-AV 8.5 release 28 to RHEL 9 +RH-Commit: [1/4] bf400ceb9ef48b81c5f7cade97bc1cbf7bc4842c (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Philippe Mathieu-Daudé + +Enhance the test to demonstrate existing less-than-stellar behavior of +qemu-img with a qcow2 image containing an inconsistent bitmap: we +don't diagnose the problem until after copying the entire image (a +potentially long time), and when we do diagnose the failure, we still +end up leaving an empty bitmap in the destination. This mess will be +cleaned up in the next patch. + +While at it, rename the test now that we support useful iotest names, +and fix a missing newline in the error message thus exposed. + +Signed-off-by: Eric Blake +Message-Id: <20210709153951.2801666-2-eblake@redhat.com> +Reviewed-by: Vladimir Sementsov-Ogievskiy +Reviewed-by: Nir Soffer + +(cherry picked from commit 94075c28eea0755173939dfaf1eae688b224a74e) +Conflicts: + tests/qemu-iotests/tests/qemu-img-bitmaps.out - commit 8417e1378c not backported +Signed-off-by: Eric Blake +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/dirty-bitmap.c | 2 +- + .../{291 => tests/qemu-img-bitmaps} | 21 +++++++- + .../{291.out => tests/qemu-img-bitmaps.out} | 49 ++++++++++++++++++- + 3 files changed, 69 insertions(+), 3 deletions(-) + rename tests/qemu-iotests/{291 => tests/qemu-img-bitmaps} (87%) + rename tests/qemu-iotests/{291.out => tests/qemu-img-bitmaps.out} (75%) + +diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c +index 68d295d6e3..0ef46163e3 100644 +--- a/block/dirty-bitmap.c ++++ b/block/dirty-bitmap.c +@@ -193,7 +193,7 @@ int bdrv_dirty_bitmap_check(const BdrvDirtyBitmap *bitmap, uint32_t flags, + error_setg(errp, "Bitmap '%s' is inconsistent and cannot be used", + bitmap->name); + error_append_hint(errp, "Try block-dirty-bitmap-remove to delete" +- " this bitmap from disk"); ++ " this bitmap from disk\n"); + return -1; + } + +diff --git a/tests/qemu-iotests/291 b/tests/qemu-iotests/tests/qemu-img-bitmaps +similarity index 87% +rename from tests/qemu-iotests/291 +rename to tests/qemu-iotests/tests/qemu-img-bitmaps +index 20efb080a6..409c4497a3 100755 +--- a/tests/qemu-iotests/291 ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps +@@ -3,7 +3,7 @@ + # + # Test qemu-img bitmap handling + # +-# Copyright (C) 2018-2020 Red Hat, Inc. ++# Copyright (C) 2018-2021 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 +@@ -27,11 +27,13 @@ status=1 # failure is the default! + _cleanup() + { + _cleanup_test_img ++ _rm_test_img "$TEST_IMG.copy" + nbd_server_stop + } + trap "_cleanup; exit \$status" 0 1 2 3 15 + + # get standard environment, filters and checks ++cd .. + . ./common.rc + . ./common.filter + . ./common.nbd +@@ -129,6 +131,23 @@ $QEMU_IMG map --output=json --image-opts \ + + nbd_server_stop + ++echo ++echo "=== Check handling of inconsistent bitmap ===" ++echo ++ ++# Prepare image with corrupted bitmap ++$QEMU_IO -c abort "$TEST_IMG" 2>/dev/null ++$QEMU_IMG bitmap --add "$TEST_IMG" b4 ++$QEMU_IMG bitmap --remove "$TEST_IMG" b1 ++_img_info --format-specific | _filter_irrelevant_img_info ++echo ++$QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG" "$TEST_IMG.copy" && ++ echo "unexpected success" ++# Bug - even though we failed at conversion, we left a file around with ++# a bitmap marked as not corrupt ++TEST_IMG=$TEST_IMG.copy _img_info --format-specific \ ++ | _filter_irrelevant_img_info ++ + # success, all done + echo '*** done' + rm -f $seq.full +diff --git a/tests/qemu-iotests/291.out b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +similarity index 75% +rename from tests/qemu-iotests/291.out +rename to tests/qemu-iotests/tests/qemu-img-bitmaps.out +index 23411c0ff4..543b028da6 100644 +--- a/tests/qemu-iotests/291.out ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +@@ -1,4 +1,4 @@ +-QA output created by 291 ++QA output created by qemu-img-bitmaps + + === Initial image setup === + +@@ -115,4 +115,51 @@ Format specific information: + [{ "start": 0, "length": 2097152, "depth": 0, "zero": false, "data": true, "offset": OFFSET}, + { "start": 2097152, "length": 1048576, "depth": 0, "zero": false, "data": false}, + { "start": 3145728, "length": 7340032, "depth": 0, "zero": false, "data": true, "offset": OFFSET}] ++ ++=== Check handling of inconsistent bitmap === ++ ++image: TEST_DIR/t.IMGFMT ++file format: IMGFMT ++virtual size: 10 MiB (10485760 bytes) ++cluster_size: 65536 ++backing file: TEST_DIR/t.IMGFMT.base ++backing file format: IMGFMT ++Format specific information: ++ bitmaps: ++ [0]: ++ flags: ++ [0]: in-use ++ [1]: auto ++ name: b2 ++ granularity: 65536 ++ [1]: ++ flags: ++ [0]: in-use ++ name: b0 ++ granularity: 65536 ++ [2]: ++ flags: ++ [0]: auto ++ name: b4 ++ granularity: 65536 ++ corrupt: false ++ ++qemu-img: Failed to populate bitmap b0: Bitmap 'b0' is inconsistent and cannot be used ++Try block-dirty-bitmap-remove to delete this bitmap from disk ++image: TEST_DIR/t.IMGFMT.copy ++file format: IMGFMT ++virtual size: 10 MiB (10485760 bytes) ++cluster_size: 65536 ++Format specific information: ++ bitmaps: ++ [0]: ++ flags: ++ name: b0 ++ granularity: 65536 ++ [1]: ++ flags: ++ [0]: auto ++ name: b4 ++ granularity: 65536 ++ corrupt: false + *** done +-- +2.27.0 + diff --git a/SOURCES/kvm-iothread-add-aio-max-batch-parameter.patch b/SOURCES/kvm-iothread-add-aio-max-batch-parameter.patch new file mode 100644 index 0000000..78a6c23 --- /dev/null +++ b/SOURCES/kvm-iothread-add-aio-max-batch-parameter.patch @@ -0,0 +1,324 @@ +From d8682ef60e3a658d776473fee2299015dd5105d7 Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Thu, 29 Jul 2021 07:42:31 -0400 +Subject: [PATCH 18/39] iothread: add aio-max-batch parameter + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [10/15] d033b3c8ddd71bae799103832039d6daa6dfad52 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +The `aio-max-batch` parameter will be propagated to AIO engines +and it will be used to control the maximum number of queued requests. + +When there are in queue a number of requests equal to `aio-max-batch`, +the engine invokes the system call to forward the requests to the kernel. + +This parameter allows us to control the maximum batch size to reduce +the latency that requests might accumulate while queued in the AIO +engine queue. + +If `aio-max-batch` is equal to 0 (default value), the AIO engine will +use its default maximum batch size value. + +Signed-off-by: Stefano Garzarella +Message-id: 20210721094211.69853-3-sgarzare@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 1793ad0247cad35db1ebbc04fbea0446c30a27ca) +Signed-off-by: Stefano Garzarella +Signed-off-by: Miroslav Rezanina +--- + include/block/aio.h | 12 +++++++++ + include/sysemu/iothread.h | 3 +++ + iothread.c | 55 +++++++++++++++++++++++++++++++++++---- + monitor/hmp-cmds.c | 2 ++ + qapi/misc.json | 6 ++++- + qapi/qom.json | 7 ++++- + qemu-options.hx | 8 ++++-- + util/aio-posix.c | 12 +++++++++ + util/aio-win32.c | 5 ++++ + util/async.c | 2 ++ + 10 files changed, 103 insertions(+), 9 deletions(-) + +diff --git a/include/block/aio.h b/include/block/aio.h +index 5f342267d5..ea68a139c8 100644 +--- a/include/block/aio.h ++++ b/include/block/aio.h +@@ -232,6 +232,9 @@ struct AioContext { + int64_t poll_grow; /* polling time growth factor */ + int64_t poll_shrink; /* polling time shrink factor */ + ++ /* AIO engine parameters */ ++ int64_t aio_max_batch; /* maximum number of requests in a batch */ ++ + /* + * List of handlers participating in userspace polling. Protected by + * ctx->list_lock. Iterated and modified mostly by the event loop thread +@@ -727,4 +730,13 @@ void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, + int64_t grow, int64_t shrink, + Error **errp); + ++/** ++ * aio_context_set_aio_params: ++ * @ctx: the aio context ++ * @max_batch: maximum number of requests in a batch, 0 means that the ++ * engine will use its default ++ */ ++void aio_context_set_aio_params(AioContext *ctx, int64_t max_batch, ++ Error **errp); ++ + #endif +diff --git a/include/sysemu/iothread.h b/include/sysemu/iothread.h +index f177142f16..7f714bd136 100644 +--- a/include/sysemu/iothread.h ++++ b/include/sysemu/iothread.h +@@ -37,6 +37,9 @@ struct IOThread { + int64_t poll_max_ns; + int64_t poll_grow; + int64_t poll_shrink; ++ ++ /* AioContext AIO engine parameters */ ++ int64_t aio_max_batch; + }; + typedef struct IOThread IOThread; + +diff --git a/iothread.c b/iothread.c +index a12de6e455..272be5e146 100644 +--- a/iothread.c ++++ b/iothread.c +@@ -159,6 +159,24 @@ static void iothread_init_gcontext(IOThread *iothread) + iothread->main_loop = g_main_loop_new(iothread->worker_context, TRUE); + } + ++static void iothread_set_aio_context_params(IOThread *iothread, Error **errp) ++{ ++ ERRP_GUARD(); ++ ++ aio_context_set_poll_params(iothread->ctx, ++ iothread->poll_max_ns, ++ iothread->poll_grow, ++ iothread->poll_shrink, ++ errp); ++ if (*errp) { ++ return; ++ } ++ ++ aio_context_set_aio_params(iothread->ctx, ++ iothread->aio_max_batch, ++ errp); ++} ++ + static void iothread_complete(UserCreatable *obj, Error **errp) + { + Error *local_error = NULL; +@@ -178,11 +196,7 @@ static void iothread_complete(UserCreatable *obj, Error **errp) + */ + iothread_init_gcontext(iothread); + +- aio_context_set_poll_params(iothread->ctx, +- iothread->poll_max_ns, +- iothread->poll_grow, +- iothread->poll_shrink, +- &local_error); ++ iothread_set_aio_context_params(iothread, &local_error); + if (local_error) { + error_propagate(errp, local_error); + aio_context_unref(iothread->ctx); +@@ -219,6 +233,9 @@ static PollParamInfo poll_grow_info = { + static PollParamInfo poll_shrink_info = { + "poll-shrink", offsetof(IOThread, poll_shrink), + }; ++static PollParamInfo aio_max_batch_info = { ++ "aio-max-batch", offsetof(IOThread, aio_max_batch), ++}; + + static void iothread_get_param(Object *obj, Visitor *v, + const char *name, void *opaque, Error **errp) +@@ -278,6 +295,29 @@ static void iothread_set_poll_param(Object *obj, Visitor *v, + } + } + ++static void iothread_get_aio_param(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ ++ iothread_get_param(obj, v, name, opaque, errp); ++} ++ ++static void iothread_set_aio_param(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ IOThread *iothread = IOTHREAD(obj); ++ ++ if (!iothread_set_param(obj, v, name, opaque, errp)) { ++ return; ++ } ++ ++ if (iothread->ctx) { ++ aio_context_set_aio_params(iothread->ctx, ++ iothread->aio_max_batch, ++ errp); ++ } ++} ++ + static void iothread_class_init(ObjectClass *klass, void *class_data) + { + UserCreatableClass *ucc = USER_CREATABLE_CLASS(klass); +@@ -295,6 +335,10 @@ static void iothread_class_init(ObjectClass *klass, void *class_data) + iothread_get_poll_param, + iothread_set_poll_param, + NULL, &poll_shrink_info); ++ object_class_property_add(klass, "aio-max-batch", "int", ++ iothread_get_aio_param, ++ iothread_set_aio_param, ++ NULL, &aio_max_batch_info); + } + + static const TypeInfo iothread_info = { +@@ -344,6 +388,7 @@ static int query_one_iothread(Object *object, void *opaque) + info->poll_max_ns = iothread->poll_max_ns; + info->poll_grow = iothread->poll_grow; + info->poll_shrink = iothread->poll_shrink; ++ info->aio_max_batch = iothread->aio_max_batch; + + QAPI_LIST_APPEND(*tail, info); + return 0; +diff --git a/monitor/hmp-cmds.c b/monitor/hmp-cmds.c +index cc15d9b6ee..2905bc1594 100644 +--- a/monitor/hmp-cmds.c ++++ b/monitor/hmp-cmds.c +@@ -1889,6 +1889,8 @@ void hmp_info_iothreads(Monitor *mon, const QDict *qdict) + monitor_printf(mon, " poll-max-ns=%" PRId64 "\n", value->poll_max_ns); + monitor_printf(mon, " poll-grow=%" PRId64 "\n", value->poll_grow); + monitor_printf(mon, " poll-shrink=%" PRId64 "\n", value->poll_shrink); ++ monitor_printf(mon, " aio-max-batch=%" PRId64 "\n", ++ value->aio_max_batch); + } + + qapi_free_IOThreadInfoList(info_list); +diff --git a/qapi/misc.json b/qapi/misc.json +index 156f98203e..5c2ca3b556 100644 +--- a/qapi/misc.json ++++ b/qapi/misc.json +@@ -86,6 +86,9 @@ + # @poll-shrink: how many ns will be removed from polling time, 0 means that + # it's not configured (since 2.9) + # ++# @aio-max-batch: maximum number of requests in a batch for the AIO engine, ++# 0 means that the engine will use its default (since 6.1) ++# + # Since: 2.0 + ## + { 'struct': 'IOThreadInfo', +@@ -93,7 +96,8 @@ + 'thread-id': 'int', + 'poll-max-ns': 'int', + 'poll-grow': 'int', +- 'poll-shrink': 'int' } } ++ 'poll-shrink': 'int', ++ 'aio-max-batch': 'int' } } + + ## + # @query-iothreads: +diff --git a/qapi/qom.json b/qapi/qom.json +index cd0e76d564..f361157903 100644 +--- a/qapi/qom.json ++++ b/qapi/qom.json +@@ -516,12 +516,17 @@ + # algorithm detects it is spending too long polling without + # encountering events. 0 selects a default behaviour (default: 0) + # ++# @aio-max-batch: maximum number of requests in a batch for the AIO engine, ++# 0 means that the engine will use its default ++# (default:0, since 6.1) ++# + # Since: 2.0 + ## + { 'struct': 'IothreadProperties', + 'data': { '*poll-max-ns': 'int', + '*poll-grow': 'int', +- '*poll-shrink': 'int' } } ++ '*poll-shrink': 'int', ++ '*aio-max-batch': 'int' } } + + ## + # @MemoryBackendProperties: +diff --git a/qemu-options.hx b/qemu-options.hx +index 79ca09feac..d5f1ec27c5 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -5185,7 +5185,7 @@ SRST + + CN=laptop.example.com,O=Example Home,L=London,ST=London,C=GB + +- ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink`` ++ ``-object iothread,id=id,poll-max-ns=poll-max-ns,poll-grow=poll-grow,poll-shrink=poll-shrink,aio-max-batch=aio-max-batch`` + Creates a dedicated event loop thread that devices can be + assigned to. This is known as an IOThread. By default device + emulation happens in vCPU threads or the main event loop thread. +@@ -5221,7 +5221,11 @@ SRST + the polling time when the algorithm detects it is spending too + long polling without encountering events. + +- The polling parameters can be modified at run-time using the ++ The ``aio-max-batch`` parameter is the maximum number of requests ++ in a batch for the AIO engine, 0 means that the engine will use ++ its default. ++ ++ The IOThread parameters can be modified at run-time using the + ``qom-set`` command (where ``iothread1`` is the IOThread's + ``id``): + +diff --git a/util/aio-posix.c b/util/aio-posix.c +index 30f5354b1e..2b86777e91 100644 +--- a/util/aio-posix.c ++++ b/util/aio-posix.c +@@ -716,3 +716,15 @@ void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, + + aio_notify(ctx); + } ++ ++void aio_context_set_aio_params(AioContext *ctx, int64_t max_batch, ++ Error **errp) ++{ ++ /* ++ * No thread synchronization here, it doesn't matter if an incorrect value ++ * is used once. ++ */ ++ ctx->aio_max_batch = max_batch; ++ ++ aio_notify(ctx); ++} +diff --git a/util/aio-win32.c b/util/aio-win32.c +index 168717b51b..d5b09a1193 100644 +--- a/util/aio-win32.c ++++ b/util/aio-win32.c +@@ -440,3 +440,8 @@ void aio_context_set_poll_params(AioContext *ctx, int64_t max_ns, + error_setg(errp, "AioContext polling is not implemented on Windows"); + } + } ++ ++void aio_context_set_aio_params(AioContext *ctx, int64_t max_batch, ++ Error **errp) ++{ ++} +diff --git a/util/async.c b/util/async.c +index 674dbefb7c..6a9588d86b 100644 +--- a/util/async.c ++++ b/util/async.c +@@ -537,6 +537,8 @@ AioContext *aio_context_new(Error **errp) + ctx->poll_grow = 0; + ctx->poll_shrink = 0; + ++ ctx->aio_max_batch = 0; ++ + return ctx; + fail: + g_source_destroy(&ctx->source); +-- +2.27.0 + diff --git a/SOURCES/kvm-iothread-generalize-iothread_set_param-iothread_get_.patch b/SOURCES/kvm-iothread-generalize-iothread_set_param-iothread_get_.patch new file mode 100644 index 0000000..8910da2 --- /dev/null +++ b/SOURCES/kvm-iothread-generalize-iothread_set_param-iothread_get_.patch @@ -0,0 +1,96 @@ +From 6f827f890e68c3b8bda80822edc09369e93da01f Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Thu, 29 Jul 2021 07:42:29 -0400 +Subject: [PATCH 17/39] iothread: generalize + iothread_set_param/iothread_get_param + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [9/15] 7c624847cfc636bdfa0d4f35062500a7f9e8437f (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Changes in preparation for next patches where we add a new +parameter not related to the poll mechanism. + +Let's add two new generic functions (iothread_set_param and +iothread_get_param) that we use to set and get IOThread +parameters. + +Signed-off-by: Stefano Garzarella +Message-id: 20210721094211.69853-2-sgarzare@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 0445409d7497bededa1047f0d8298b0d4bb3b1a3) +Signed-off-by: Stefano Garzarella +Signed-off-by: Miroslav Rezanina +--- + iothread.c | 27 +++++++++++++++++++++++---- + 1 file changed, 23 insertions(+), 4 deletions(-) + +diff --git a/iothread.c b/iothread.c +index 7f086387be..a12de6e455 100644 +--- a/iothread.c ++++ b/iothread.c +@@ -220,7 +220,7 @@ static PollParamInfo poll_shrink_info = { + "poll-shrink", offsetof(IOThread, poll_shrink), + }; + +-static void iothread_get_poll_param(Object *obj, Visitor *v, ++static void iothread_get_param(Object *obj, Visitor *v, + const char *name, void *opaque, Error **errp) + { + IOThread *iothread = IOTHREAD(obj); +@@ -230,7 +230,7 @@ static void iothread_get_poll_param(Object *obj, Visitor *v, + visit_type_int64(v, name, field, errp); + } + +-static void iothread_set_poll_param(Object *obj, Visitor *v, ++static bool iothread_set_param(Object *obj, Visitor *v, + const char *name, void *opaque, Error **errp) + { + IOThread *iothread = IOTHREAD(obj); +@@ -239,17 +239,36 @@ static void iothread_set_poll_param(Object *obj, Visitor *v, + int64_t value; + + if (!visit_type_int64(v, name, &value, errp)) { +- return; ++ return false; + } + + if (value < 0) { + error_setg(errp, "%s value must be in range [0, %" PRId64 "]", + info->name, INT64_MAX); +- return; ++ return false; + } + + *field = value; + ++ return true; ++} ++ ++static void iothread_get_poll_param(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ ++ iothread_get_param(obj, v, name, opaque, errp); ++} ++ ++static void iothread_set_poll_param(Object *obj, Visitor *v, ++ const char *name, void *opaque, Error **errp) ++{ ++ IOThread *iothread = IOTHREAD(obj); ++ ++ if (!iothread_set_param(obj, v, name, opaque, errp)) { ++ return; ++ } ++ + if (iothread->ctx) { + aio_context_set_poll_params(iothread->ctx, + iothread->poll_max_ns, +-- +2.27.0 + diff --git a/SOURCES/kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch b/SOURCES/kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch new file mode 100644 index 0000000..93fcc9b --- /dev/null +++ b/SOURCES/kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch @@ -0,0 +1,84 @@ +From 6f4cb3e1e5d718356f16645e806d47cb2159ae98 Mon Sep 17 00:00:00 2001 +From: Stefano Garzarella +Date: Thu, 29 Jul 2021 07:42:33 -0400 +Subject: [PATCH 19/39] linux-aio: limit the batch size using `aio-max-batch` + parameter + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [11/15] 44e2f2d294d8ed1d13fb29c5c1599543b86c67e5 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +When there are multiple queues attached to the same AIO context, +some requests may experience high latency, since in the worst case +the AIO engine queue is only flushed when it is full (MAX_EVENTS) or +there are no more queues plugged. + +Commit 2558cb8dd4 ("linux-aio: increasing MAX_EVENTS to a larger +hardcoded value") changed MAX_EVENTS from 128 to 1024, to increase +the number of in-flight requests. But this change also increased +the potential maximum batch to 1024 elements. + +When there is a single queue attached to the AIO context, the issue +is mitigated from laio_io_unplug() that will flush the queue every +time is invoked since there can't be others queue plugged. + +Let's use the new `aio-max-batch` IOThread parameter to mitigate +this issue, limiting the number of requests in a batch. + +We also define a default value (32): this value is obtained running +some benchmarks and it represents a good tradeoff between the latency +increase while a request is queued and the cost of the io_submit(2) +system call. + +Signed-off-by: Stefano Garzarella +Message-id: 20210721094211.69853-4-sgarzare@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit d7ddd0a1618a75b31dc308bb37365ce1da972154) +Signed-off-by: Stefano Garzarella +Signed-off-by: Miroslav Rezanina +--- + block/linux-aio.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/block/linux-aio.c b/block/linux-aio.c +index 3c0527c2bf..0dab507b71 100644 +--- a/block/linux-aio.c ++++ b/block/linux-aio.c +@@ -28,6 +28,9 @@ + */ + #define MAX_EVENTS 1024 + ++/* Maximum number of requests in a batch. (default value) */ ++#define DEFAULT_MAX_BATCH 32 ++ + struct qemu_laiocb { + Coroutine *co; + LinuxAioState *ctx; +@@ -351,6 +354,10 @@ static int laio_do_submit(int fd, struct qemu_laiocb *laiocb, off_t offset, + LinuxAioState *s = laiocb->ctx; + struct iocb *iocbs = &laiocb->iocb; + QEMUIOVector *qiov = laiocb->qiov; ++ int64_t max_batch = s->aio_context->aio_max_batch ?: DEFAULT_MAX_BATCH; ++ ++ /* limit the batch with the number of available events */ ++ max_batch = MIN_NON_ZERO(MAX_EVENTS - s->io_q.in_flight, max_batch); + + switch (type) { + case QEMU_AIO_WRITE: +@@ -371,7 +378,7 @@ static int laio_do_submit(int fd, struct qemu_laiocb *laiocb, off_t offset, + s->io_q.in_queue++; + if (!s->io_q.blocked && + (!s->io_q.plugged || +- s->io_q.in_flight + s->io_q.in_queue >= MAX_EVENTS)) { ++ s->io_q.in_queue >= max_batch)) { + ioq_submit(s); + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch b/SOURCES/kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch new file mode 100644 index 0000000..980466c --- /dev/null +++ b/SOURCES/kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch @@ -0,0 +1,66 @@ +From 5e1535771bba299aae4de2d810100fa7fedfeca8 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 29 Jun 2021 14:13:56 -0400 +Subject: [PATCH 02/39] migration: Allow reset of postcopy_recover_triggered + when failed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Leonardo Brás +RH-MergeRequest: 25: migration: Move yank outside qemu_start_incoming_migration() +RH-Commit: [2/2] b766a7f36df4f889d74a2e8d518e1100e52ab726 (LeoBras/centos-qemu-kvm) +RH-Bugzilla: 1974683 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Peter Xu > + +It's possible qemu_start_incoming_migration() failed at any point, when it +happens we should reset postcopy_recover_triggered to false so that the user +can still retry with a saner incoming port. + +Signed-off-by: Peter Xu +Message-Id: <20210629181356.217312-3-peterx@redhat.com> +Reviewed-by: Dr. David Alan Gilbert +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit b7f9afd48e7bc5c341e55348f2c2eed08314be7d) +Fixes: b5eea99e ("migration: Add yank feature", 2021-01-13) +Signed-off-by: Leonardo Bras +Signed-off-by: Miroslav Rezanina +--- + migration/migration.c | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/migration/migration.c b/migration/migration.c +index f077640df2..9d185f0e28 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -2109,6 +2109,13 @@ void qmp_migrate_recover(const char *uri, Error **errp) + { + MigrationIncomingState *mis = migration_incoming_get_current(); + ++ /* ++ * Don't even bother to use ERRP_GUARD() as it _must_ always be set by ++ * callers (no one should ignore a recover failure); if there is, it's a ++ * programming error. ++ */ ++ assert(errp); ++ + if (mis->state != MIGRATION_STATUS_POSTCOPY_PAUSED) { + error_setg(errp, "Migrate recover can only be run " + "when postcopy is paused."); +@@ -2127,6 +2134,12 @@ void qmp_migrate_recover(const char *uri, Error **errp) + * to continue using that newly established channel. + */ + qemu_start_incoming_migration(uri, errp); ++ ++ /* Safe to dereference with the assert above */ ++ if (*errp) { ++ /* Reset the flag so user could still retry */ ++ qatomic_set(&mis->postcopy_recover_triggered, false); ++ } + } + + void qmp_migrate_pause(Error **errp) +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch b/SOURCES/kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch new file mode 100644 index 0000000..d163571 --- /dev/null +++ b/SOURCES/kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch @@ -0,0 +1,111 @@ +From 7726f6461eebf2c4a4b129f1c98add25c0b1bee2 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Thu, 29 Jul 2021 07:42:16 -0400 +Subject: [PATCH 12/39] migration: Move bitmap_mutex out of + migration_bitmap_clear_dirty() + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [4/15] cc207372dab253a4db3b6d351fa2fb2f442437ad (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Taking the mutex every time for each dirty bit to clear is too slow, especially +we'll take/release even if the dirty bit is cleared. So far it's only used to +sync with special cases with qemu_guest_free_page_hint() against migration +thread, nothing really that serious yet. Let's move the lock to be upper. + +There're two callers of migration_bitmap_clear_dirty(). + +For migration, move it into ram_save_iterate(). With the help of MAX_WAIT +logic, we'll only run ram_save_iterate() for no more than 50ms-ish time, so +taking the lock once there at the entry. It also means any call sites to +qemu_guest_free_page_hint() can be delayed; but it should be very rare, only +during migration, and I don't see a problem with it. + +For COLO, move it up to colo_flush_ram_cache(). I think COLO forgot to take +that lock even when calling ramblock_sync_dirty_bitmap(), where another example +is migration_bitmap_sync() who took it right. So let the mutex cover both the +ramblock_sync_dirty_bitmap() and migration_bitmap_clear_dirty() calls. + +It's even possible to drop the lock so we use atomic operations upon rb->bmap +and the variable migration_dirty_pages. I didn't do it just to still be safe, +also not predictable whether the frequent atomic ops could bring overhead too +e.g. on huge vms when it happens very often. When that really comes, we can +keep a local counter and periodically call atomic ops. Keep it simple for now. + +Cc: Wei Wang +Cc: David Hildenbrand +Cc: Hailiang Zhang +Cc: Dr. David Alan Gilbert +Cc: Juan Quintela +Cc: Leonardo Bras Soares Passos +Signed-off-by: Peter Xu +Message-Id: <20210630200805.280905-1-peterx@redhat.com> +Reviewed-by: Wei Wang +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 63268c4970a5f126cc9af75f3ccb8057abef5ec0) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + migration/ram.c | 13 +++++++++++-- + 1 file changed, 11 insertions(+), 2 deletions(-) + +diff --git a/migration/ram.c b/migration/ram.c +index 4682f3625c..5d64917dce 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -819,8 +819,6 @@ static inline bool migration_bitmap_clear_dirty(RAMState *rs, + { + bool ret; + +- QEMU_LOCK_GUARD(&rs->bitmap_mutex); +- + /* + * Clear dirty bitmap if needed. This _must_ be called before we + * send any of the page in the chunk because we need to make sure +@@ -2869,6 +2867,14 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) + goto out; + } + ++ /* ++ * We'll take this lock a little bit long, but it's okay for two reasons. ++ * Firstly, the only possible other thread to take it is who calls ++ * qemu_guest_free_page_hint(), which should be rare; secondly, see ++ * MAX_WAIT (if curious, further see commit 4508bd9ed8053ce) below, which ++ * guarantees that we'll at least released it in a regular basis. ++ */ ++ qemu_mutex_lock(&rs->bitmap_mutex); + WITH_RCU_READ_LOCK_GUARD() { + if (ram_list.version != rs->last_version) { + ram_state_reset(rs); +@@ -2928,6 +2934,7 @@ static int ram_save_iterate(QEMUFile *f, void *opaque) + i++; + } + } ++ qemu_mutex_unlock(&rs->bitmap_mutex); + + /* + * Must occur before EOS (or any QEMUFile operation) +@@ -3710,6 +3717,7 @@ void colo_flush_ram_cache(void) + unsigned long offset = 0; + + memory_global_dirty_log_sync(); ++ qemu_mutex_lock(&ram_state->bitmap_mutex); + WITH_RCU_READ_LOCK_GUARD() { + RAMBLOCK_FOREACH_NOT_IGNORED(block) { + ramblock_sync_dirty_bitmap(ram_state, block); +@@ -3738,6 +3746,7 @@ void colo_flush_ram_cache(void) + } + } + trace_colo_flush_ram_cache_end(); ++ qemu_mutex_unlock(&ram_state->bitmap_mutex); + } + + /** +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch b/SOURCES/kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch new file mode 100644 index 0000000..9822ab6 --- /dev/null +++ b/SOURCES/kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch @@ -0,0 +1,94 @@ +From 4c11e06222ca5a88f48f2d47adc3a7da306bb345 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 29 Jun 2021 14:13:55 -0400 +Subject: [PATCH 01/39] migration: Move yank outside + qemu_start_incoming_migration() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Leonardo Brás +RH-MergeRequest: 25: migration: Move yank outside qemu_start_incoming_migration() +RH-Commit: [1/2] e5694b0ae9a55f6b147c336e86fce6f4f2163db6 (LeoBras/centos-qemu-kvm) +RH-Bugzilla: 1974683 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Peter Xu > + +Starting from commit b5eea99ec2f5c, qmp_migrate_recover() calls unregister +before calling qemu_start_incoming_migration(). I believe it wanted to mitigate +the next call to yank_register_instance(), but I think that's wrong. + +Firstly, if during recover, we should keep the yank instance there, not +"quickly removing and adding it back". + +Meanwhile, calling qmp_migrate_recover() twice with b5eea99ec2f5c will directly +crash the dest qemu (right now it can't; but it'll start to work right after +the next patch) because the 1st call of qmp_migrate_recover() will unregister +permanently when the channel failed to establish, then the 2nd call of +qmp_migrate_recover() crashes at yank_unregister_instance(). + +This patch fixes it by moving yank ops out of qemu_start_incoming_migration() +into qmp_migrate_incoming. For qmp_migrate_recover(), drop the unregister of +yank instance too since we keep it there during the recovery phase. + +Signed-off-by: Peter Xu +Reviewed-by: Dr. David Alan Gilbert +Message-Id: <20210629181356.217312-2-peterx@redhat.com> +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit cc48c587d25ff5dd7dddb4e5072de9ca8464c832) +Fixes: b5eea99e ("migration: Add yank feature", 2021-01-13) +Signed-off-by: Leonardo Bras +Signed-off-by: Miroslav Rezanina +--- + migration/migration.c | 11 +++++------ + 1 file changed, 5 insertions(+), 6 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 4afc6069b6..f077640df2 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -454,10 +454,6 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) + { + const char *p = NULL; + +- if (!yank_register_instance(MIGRATION_YANK_INSTANCE, errp)) { +- return; +- } +- + qapi_event_send_migration(MIGRATION_STATUS_SETUP); + if (strstart(uri, "tcp:", &p) || + strstart(uri, "unix:", NULL) || +@@ -472,7 +468,6 @@ static void qemu_start_incoming_migration(const char *uri, Error **errp) + } else if (strstart(uri, "fd:", &p)) { + fd_start_incoming_migration(p, errp); + } else { +- yank_unregister_instance(MIGRATION_YANK_INSTANCE); + error_setg(errp, "unknown migration protocol: %s", uri); + } + } +@@ -2095,9 +2090,14 @@ void qmp_migrate_incoming(const char *uri, Error **errp) + return; + } + ++ if (!yank_register_instance(MIGRATION_YANK_INSTANCE, errp)) { ++ return; ++ } ++ + qemu_start_incoming_migration(uri, &local_err); + + if (local_err) { ++ yank_unregister_instance(MIGRATION_YANK_INSTANCE); + error_propagate(errp, local_err); + return; + } +@@ -2126,7 +2126,6 @@ void qmp_migrate_recover(const char *uri, Error **errp) + * only re-setup the migration stream and poke existing migration + * to continue using that newly established channel. + */ +- yank_unregister_instance(MIGRATION_YANK_INSTANCE); + qemu_start_incoming_migration(uri, errp); + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch b/SOURCES/kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch new file mode 100644 index 0000000..c0cf7e6 --- /dev/null +++ b/SOURCES/kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch @@ -0,0 +1,59 @@ +From 0f41423f2bb57e77400cfec0683b7514c9798c55 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 4 Aug 2021 07:10:13 -0400 +Subject: [PATCH 22/39] migration: failover: continue to wait card unplug on + error + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [14/15] e3bfdeee808b2ecd5b141464193b6ee97a4bca3a (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +If the user cancels the migration in the unplug-wait state, +QEMU will try to plug back the card and this fails because the card +is partially unplugged. +To avoid the problem, continue to wait the card unplug, but to +allow the migration to be canceled if the card never finishes to unplug +use a timeout. + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1976852 +Signed-off-by: Laurent Vivier +Reviewed-by: Dr. David Alan Gilbert +Message-Id: <20210629155007.629086-3-lvivier@redhat.com> +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 944bc528421aa848ca218ee535ea923a4147a525) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + migration/migration.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/migration/migration.c b/migration/migration.c +index 58df1dac05..fc1d0db04a 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3696,6 +3696,17 @@ static void qemu_savevm_wait_unplug(MigrationState *s, int old_state, + qemu_savevm_state_guest_unplug_pending()) { + qemu_sem_timedwait(&s->wait_unplug_sem, 250); + } ++ if (s->state != MIGRATION_STATUS_WAIT_UNPLUG) { ++ int timeout = 120; /* 30 seconds */ ++ /* ++ * migration has been canceled ++ * but as we have started an unplug we must wait the end ++ * to be able to plug back the card ++ */ ++ while (timeout-- && qemu_savevm_state_guest_unplug_pending()) { ++ qemu_sem_timedwait(&s->wait_unplug_sem, 250); ++ } ++ } + + migrate_set_state(&s->state, MIGRATION_STATUS_WAIT_UNPLUG, new_state); + } else { +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-failover-reset-partially_hotplugged.patch b/SOURCES/kvm-migration-failover-reset-partially_hotplugged.patch new file mode 100644 index 0000000..97fb427 --- /dev/null +++ b/SOURCES/kvm-migration-failover-reset-partially_hotplugged.patch @@ -0,0 +1,44 @@ +From 2e07c4c66a1199ef33fb2e89164e03ca2acdcf10 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Thu, 29 Jul 2021 07:42:12 -0400 +Subject: [PATCH 10/39] migration: failover: reset partially_hotplugged + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [2/15] b01f5640ce93192b2239ad4ef15ff53d977f2341 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +When the card is plugged back, reset the partially_hotplugged flag to false + +Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1787194 +Signed-off-by: Laurent Vivier +Message-Id: <20210629152937.619193-1-lvivier@redhat.com> +Reviewed-by: Juan Quintela +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 109c20ea28cc0d82fa353e692345b172cb5721cc) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/net/virtio-net.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 914051feb7..c2e32fedbf 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -3134,6 +3134,7 @@ static bool failover_replug_primary(VirtIONet *n, DeviceState *dev, + } + hotplug_handler_plug(hotplug_ctrl, dev, &err); + } ++ pdev->partially_hotplugged = false; + + out: + error_propagate(errp, err); +-- +2.27.0 + diff --git a/SOURCES/kvm-migration-move-wait-unplug-loop-to-its-own-function.patch b/SOURCES/kvm-migration-move-wait-unplug-loop-to-its-own-function.patch new file mode 100644 index 0000000..524cda3 --- /dev/null +++ b/SOURCES/kvm-migration-move-wait-unplug-loop-to-its-own-function.patch @@ -0,0 +1,118 @@ +From e9848f4a4f45960bff1a2a7bc4a4670670de37a5 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 4 Aug 2021 07:10:12 -0400 +Subject: [PATCH 21/39] migration: move wait-unplug loop to its own function + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [13/15] ab3f26a86e4ea955678323608512e54af2a7c83b (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +The loop is used in migration_thread() and bg_migration_thread(), +so we can move it to its own function and call it from these both places. + +Moreover, in migration_thread() we have a wrong state transition from +SETUP to ACTIVE while state could be WAIT_UNPLUG. This is correctly +managed in bg_migration_thread() so use this code instead. + +Signed-off-by: Laurent Vivier +Message-Id: <20210629155007.629086-2-lvivier@redhat.com> +Reviewed-by: Dr. David Alan Gilbert +Reviewed-by: Juan Quintela +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit fde93d99d9c208c07e2dcc24cd04e824d2b65b35) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + migration/migration.c | 54 +++++++++++++++++++++---------------------- + 1 file changed, 26 insertions(+), 28 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index 9cf1cde39d..58df1dac05 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -3681,6 +3681,28 @@ bool migration_rate_limit(void) + return urgent; + } + ++/* ++ * if failover devices are present, wait they are completely ++ * unplugged ++ */ ++ ++static void qemu_savevm_wait_unplug(MigrationState *s, int old_state, ++ int new_state) ++{ ++ if (qemu_savevm_state_guest_unplug_pending()) { ++ migrate_set_state(&s->state, old_state, MIGRATION_STATUS_WAIT_UNPLUG); ++ ++ while (s->state == MIGRATION_STATUS_WAIT_UNPLUG && ++ qemu_savevm_state_guest_unplug_pending()) { ++ qemu_sem_timedwait(&s->wait_unplug_sem, 250); ++ } ++ ++ migrate_set_state(&s->state, MIGRATION_STATUS_WAIT_UNPLUG, new_state); ++ } else { ++ migrate_set_state(&s->state, old_state, new_state); ++ } ++} ++ + /* + * Master migration thread on the source VM. + * It drives the migration and pumps the data down the outgoing channel. +@@ -3727,22 +3749,10 @@ static void *migration_thread(void *opaque) + + qemu_savevm_state_setup(s->to_dst_file); + +- if (qemu_savevm_state_guest_unplug_pending()) { +- migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, +- MIGRATION_STATUS_WAIT_UNPLUG); +- +- while (s->state == MIGRATION_STATUS_WAIT_UNPLUG && +- qemu_savevm_state_guest_unplug_pending()) { +- qemu_sem_timedwait(&s->wait_unplug_sem, 250); +- } +- +- migrate_set_state(&s->state, MIGRATION_STATUS_WAIT_UNPLUG, +- MIGRATION_STATUS_ACTIVE); +- } ++ qemu_savevm_wait_unplug(s, MIGRATION_STATUS_SETUP, ++ MIGRATION_STATUS_ACTIVE); + + s->setup_time = qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; +- migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, +- MIGRATION_STATUS_ACTIVE); + + trace_migration_thread_setup_complete(); + +@@ -3850,21 +3860,9 @@ static void *bg_migration_thread(void *opaque) + qemu_savevm_state_header(s->to_dst_file); + qemu_savevm_state_setup(s->to_dst_file); + +- if (qemu_savevm_state_guest_unplug_pending()) { +- migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, +- MIGRATION_STATUS_WAIT_UNPLUG); +- +- while (s->state == MIGRATION_STATUS_WAIT_UNPLUG && +- qemu_savevm_state_guest_unplug_pending()) { +- qemu_sem_timedwait(&s->wait_unplug_sem, 250); +- } ++ qemu_savevm_wait_unplug(s, MIGRATION_STATUS_SETUP, ++ MIGRATION_STATUS_ACTIVE); + +- migrate_set_state(&s->state, MIGRATION_STATUS_WAIT_UNPLUG, +- MIGRATION_STATUS_ACTIVE); +- } else { +- migrate_set_state(&s->state, MIGRATION_STATUS_SETUP, +- MIGRATION_STATUS_ACTIVE); +- } + s->setup_time = qemu_clock_get_ms(QEMU_CLOCK_HOST) - setup_start; + + trace_migration_thread_setup_complete(); +-- +2.27.0 + diff --git a/SOURCES/kvm-nbd-server-Use-drained-block-ops-to-quiesce-the-serv.patch b/SOURCES/kvm-nbd-server-Use-drained-block-ops-to-quiesce-the-serv.patch new file mode 100644 index 0000000..af8a82c --- /dev/null +++ b/SOURCES/kvm-nbd-server-Use-drained-block-ops-to-quiesce-the-serv.patch @@ -0,0 +1,191 @@ +From 9182af6a819e60a079349fd6d8b28a28adea90b1 Mon Sep 17 00:00:00 2001 +From: Sergio Lopez Pascual +Date: Thu, 17 Jun 2021 09:13:21 -0400 +Subject: [PATCH 06/12] nbd/server: Use drained block ops to quiesce the server +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [4/8] ca32c99563254a8a31104948e41fa691453d0399 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +Before switching between AioContexts we need to make sure that we're +fully quiesced ("nb_requests == 0" for every client) when entering the +drained section. + +To do this, we set "quiescing = true" for every client on +".drained_begin" to prevent new coroutines from being created, and +check if "nb_requests == 0" on ".drained_poll". Finally, once we're +exiting the drained section, on ".drained_end" we set "quiescing = +false" and call "nbd_client_receive_next_request()" to resume the +processing of new requests. + +With these changes, "blk_aio_attach()" and "blk_aio_detach()" can be +reverted to be as simple as they were before f148ae7d36. + +RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1960137 +Suggested-by: Kevin Wolf +Signed-off-by: Sergio Lopez +Message-Id: <20210602060552.17433-3-slp@redhat.com> +Reviewed-by: Vladimir Sementsov-Ogievskiy +Signed-off-by: Kevin Wolf +(cherry picked from commit fd6afc501a019682d1b8468b562355a2887087bd) +Signed-off-by: Sergio Lopez +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + nbd/server.c | 82 ++++++++++++++++++++++++++++++++++++++-------------- + 1 file changed, 61 insertions(+), 21 deletions(-) + +diff --git a/nbd/server.c b/nbd/server.c +index 86a44a9b41..b60ebc3ab6 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -1513,6 +1513,11 @@ static void nbd_request_put(NBDRequestData *req) + g_free(req); + + client->nb_requests--; ++ ++ if (client->quiescing && client->nb_requests == 0) { ++ aio_wait_kick(); ++ } ++ + nbd_client_receive_next_request(client); + + nbd_client_put(client); +@@ -1530,49 +1535,68 @@ static void blk_aio_attached(AioContext *ctx, void *opaque) + QTAILQ_FOREACH(client, &exp->clients, next) { + qio_channel_attach_aio_context(client->ioc, ctx); + ++ assert(client->nb_requests == 0); + assert(client->recv_coroutine == NULL); + assert(client->send_coroutine == NULL); +- +- if (client->quiescing) { +- client->quiescing = false; +- nbd_client_receive_next_request(client); +- } + } + } + +-static void nbd_aio_detach_bh(void *opaque) ++static void blk_aio_detach(void *opaque) + { + NBDExport *exp = opaque; + NBDClient *client; + ++ trace_nbd_blk_aio_detach(exp->name, exp->common.ctx); ++ + QTAILQ_FOREACH(client, &exp->clients, next) { + qio_channel_detach_aio_context(client->ioc); ++ } ++ ++ exp->common.ctx = NULL; ++} ++ ++static void nbd_drained_begin(void *opaque) ++{ ++ NBDExport *exp = opaque; ++ NBDClient *client; ++ ++ QTAILQ_FOREACH(client, &exp->clients, next) { + client->quiescing = true; ++ } ++} + +- if (client->recv_coroutine) { +- if (client->read_yielding) { +- qemu_aio_coroutine_enter(exp->common.ctx, +- client->recv_coroutine); +- } else { +- AIO_WAIT_WHILE(exp->common.ctx, client->recv_coroutine != NULL); +- } +- } ++static void nbd_drained_end(void *opaque) ++{ ++ NBDExport *exp = opaque; ++ NBDClient *client; + +- if (client->send_coroutine) { +- AIO_WAIT_WHILE(exp->common.ctx, client->send_coroutine != NULL); +- } ++ QTAILQ_FOREACH(client, &exp->clients, next) { ++ client->quiescing = false; ++ nbd_client_receive_next_request(client); + } + } + +-static void blk_aio_detach(void *opaque) ++static bool nbd_drained_poll(void *opaque) + { + NBDExport *exp = opaque; ++ NBDClient *client; + +- trace_nbd_blk_aio_detach(exp->name, exp->common.ctx); ++ QTAILQ_FOREACH(client, &exp->clients, next) { ++ if (client->nb_requests != 0) { ++ /* ++ * If there's a coroutine waiting for a request on nbd_read_eof() ++ * 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); ++ } + +- aio_wait_bh_oneshot(exp->common.ctx, nbd_aio_detach_bh, exp); ++ return true; ++ } ++ } + +- exp->common.ctx = NULL; ++ return false; + } + + static void nbd_eject_notifier(Notifier *n, void *data) +@@ -1594,6 +1618,12 @@ void nbd_export_set_on_eject_blk(BlockExport *exp, BlockBackend *blk) + blk_add_remove_bs_notifier(blk, &nbd_exp->eject_notifier); + } + ++static const BlockDevOps nbd_block_ops = { ++ .drained_begin = nbd_drained_begin, ++ .drained_end = nbd_drained_end, ++ .drained_poll = nbd_drained_poll, ++}; ++ + static int nbd_export_create(BlockExport *blk_exp, BlockExportOptions *exp_args, + Error **errp) + { +@@ -1715,8 +1745,17 @@ static int nbd_export_create(BlockExport *blk_exp, BlockExportOptions *exp_args, + + exp->allocation_depth = arg->allocation_depth; + ++ /* ++ * We need to inhibit request queuing in the block layer to ensure we can ++ * be properly quiesced when entering a drained section, as our coroutines ++ * servicing pending requests might enter blk_pread(). ++ */ ++ blk_set_disable_request_queuing(blk, true); ++ + blk_add_aio_context_notifier(blk, blk_aio_attached, blk_aio_detach, exp); + ++ blk_set_dev_ops(blk, &nbd_block_ops, exp); ++ + QTAILQ_INSERT_TAIL(&exports, exp, next); + + return 0; +@@ -1788,6 +1827,7 @@ static void nbd_export_delete(BlockExport *blk_exp) + } + blk_remove_aio_context_notifier(exp->common.blk, blk_aio_attached, + blk_aio_detach, exp); ++ blk_set_disable_request_queuing(exp->common.blk, false); + } + + for (i = 0; i < exp->nr_export_bitmaps; i++) { +-- +2.27.0 + diff --git a/SOURCES/kvm-osdep-provide-ROUND_DOWN-macro.patch b/SOURCES/kvm-osdep-provide-ROUND_DOWN-macro.patch new file mode 100644 index 0000000..cf8a1a3 --- /dev/null +++ b/SOURCES/kvm-osdep-provide-ROUND_DOWN-macro.patch @@ -0,0 +1,75 @@ +From d9fa07a04ee19ad713b053f6a649178361d822a8 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:31 -0400 +Subject: [PATCH 15/43] osdep: provide ROUND_DOWN macro + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +osdep.h provides a ROUND_UP macro to hide bitwise operations for the +purpose of rounding a number up to a power of two; add a ROUND_DOWN +macro that does the same with truncation towards zero. + +While at it, change the formatting of some comments. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit c9797456f64ce72c03eb2969d97ac1dd4698d91e) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + include/qemu/osdep.h | 28 ++++++++++++++++++++++------ + 1 file changed, 22 insertions(+), 6 deletions(-) + +diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h +index cb2a07e472..e327220992 100644 +--- a/include/qemu/osdep.h ++++ b/include/qemu/osdep.h +@@ -316,11 +316,16 @@ extern "C" { + }) + #endif + +-/* Round number down to multiple */ ++/* ++ * Round number down to multiple. Safe when m is not a power of 2 (see ++ * ROUND_DOWN for a faster version when a power of 2 is guaranteed). ++ */ + #define QEMU_ALIGN_DOWN(n, m) ((n) / (m) * (m)) + +-/* Round number up to multiple. Safe when m is not a power of 2 (see +- * ROUND_UP for a faster version when a power of 2 is guaranteed) */ ++/* ++ * Round number up to multiple. Safe when m is not a power of 2 (see ++ * ROUND_UP for a faster version when a power of 2 is guaranteed). ++ */ + #define QEMU_ALIGN_UP(n, m) QEMU_ALIGN_DOWN((n) + (m) - 1, (m)) + + /* Check if n is a multiple of m */ +@@ -337,11 +342,22 @@ extern "C" { + /* Check if pointer p is n-bytes aligned */ + #define QEMU_PTR_IS_ALIGNED(p, n) QEMU_IS_ALIGNED((uintptr_t)(p), (n)) + +-/* Round number up to multiple. Requires that d be a power of 2 (see ++/* ++ * Round number down to multiple. Requires that d be a power of 2 (see + * QEMU_ALIGN_UP for a safer but slower version on arbitrary +- * numbers); works even if d is a smaller type than n. */ ++ * numbers); works even if d is a smaller type than n. ++ */ ++#ifndef ROUND_DOWN ++#define ROUND_DOWN(n, d) ((n) & -(0 ? (n) : (d))) ++#endif ++ ++/* ++ * Round number up to multiple. Requires that d be a power of 2 (see ++ * QEMU_ALIGN_UP for a safer but slower version on arbitrary ++ * numbers); works even if d is a smaller type than n. ++ */ + #ifndef ROUND_UP +-#define ROUND_UP(n, d) (((n) + (d) - 1) & -(0 ? (n) : (d))) ++#define ROUND_UP(n, d) ROUND_DOWN((n) + (d) - 1, (d)) + #endif + + #ifndef DIV_ROUND_UP +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch b/SOURCES/kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch new file mode 100644 index 0000000..e443376 --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch @@ -0,0 +1,77 @@ +From 9da71839fdc4e8b9d034998b0ed8a7ee9dfe7645 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Sun, 2 May 2021 13:22:21 +0200 +Subject: [PATCH 34/39] pc-bios/s390-ccw: Allow building with Clang, too +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [7/11] d7c510f1e5f6434f6b3e4bab5b5f75403cbc7e1b (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +Clang unfortunately does not support generating code for the z900 +architecture level and starts with the z10 instead. Thus to be able +to support compiling with Clang, we have to check for the supported +compiler flags. The disadvantage is of course that the bios image +will only run with z10 guest CPUs upwards (which is what most people +use anyway), so just in case let's also emit a warning in that case +(we will continue to ship firmware images that have been pre-built +with GCC in future releases, so this should not impact normal users, +too). + +Message-Id: <20210502174836.838816-5-thuth@redhat.com> +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Cornelia Huck +Signed-off-by: Thomas Huth +(cherry picked from commit a5b2afd522dde375c38cf94b7c696ffa3faba2fb) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + configure | 9 ++++++++- + pc-bios/s390-ccw/Makefile | 3 ++- + 2 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/configure b/configure +index 7edc08afb3..83d8af7fe4 100755 +--- a/configure ++++ b/configure +@@ -5424,9 +5424,16 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \ + fi + + # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900 ++# or -march=z10 (which is the lowest architecture level that Clang supports) + if test "$cpu" = "s390x" ; then + write_c_skeleton +- if compile_prog "-march=z900" ""; then ++ compile_prog "-march=z900" "" ++ has_z900=$? ++ if [ $has_z900 = 0 ] || compile_prog "-march=z10" ""; then ++ if [ $has_z900 != 0 ]; then ++ echo "WARNING: Your compiler does not support the z900!" ++ echo " The s390-ccw bios will only work with guest CPUs >= z10." ++ fi + roms="$roms s390-ccw" + # SLOF is required for building the s390-ccw firmware on s390x, + # since it is using the libnet code from SLOF for network booting. +diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile +index 83fb1afb73..cee9d2c63b 100644 +--- a/pc-bios/s390-ccw/Makefile ++++ b/pc-bios/s390-ccw/Makefile +@@ -34,7 +34,8 @@ QEMU_CFLAGS += $(call cc-option,-Werror $(QEMU_CFLAGS),-Wno-stringop-overflow) + QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE + QEMU_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables + QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) +-QEMU_CFLAGS += -msoft-float -march=z900 ++QEMU_CFLAGS += -msoft-float ++QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS),-march=z900,-march=z10) + QEMU_CFLAGS += -std=gnu99 + LDFLAGS += -Wl,-pie -nostdlib + +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch b/SOURCES/kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch new file mode 100644 index 0000000..aeca11f --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch @@ -0,0 +1,106 @@ +From c783eab8a3770703a39bbbd7edd23af7b9cb8f14 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Wed, 12 May 2021 19:15:48 +0200 +Subject: [PATCH 35/39] pc-bios/s390-ccw: Fix inline assembly for older + versions of Clang +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [8/11] 9a69c7705b8128b4098f818c6b672d484e459c83 (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +Clang versions before v11.0 insist on having the %rX or %cX register +names instead of just a number. Since our Travis-CI is currently +still using Clang v6.0, we have to fix this to avoid failing jobs. + +Message-Id: <20210512171550.476130-2-thuth@redhat.com> +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: Thomas Huth +(cherry picked from commit 052b66e7211af64964e005126eaa3c944b296b0e) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/helper.h | 2 +- + pc-bios/s390-ccw/jump2ipl.c | 4 ++-- + pc-bios/s390-ccw/menu.c | 8 ++++---- + pc-bios/s390-ccw/virtio.c | 2 +- + 4 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/pc-bios/s390-ccw/helper.h b/pc-bios/s390-ccw/helper.h +index dfcfea0ff0..3d0731c4c6 100644 +--- a/pc-bios/s390-ccw/helper.h ++++ b/pc-bios/s390-ccw/helper.h +@@ -31,7 +31,7 @@ static inline void *u32toptr(uint32_t n) + + static inline void yield(void) + { +- asm volatile ("diag 0,0,0x44" ++ asm volatile ("diag %%r0,%%r0,0x44" + : : + : "memory", "cc"); + } +diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c +index 73e4367e09..78f5f46533 100644 +--- a/pc-bios/s390-ccw/jump2ipl.c ++++ b/pc-bios/s390-ccw/jump2ipl.c +@@ -64,8 +64,8 @@ void jump_to_IPL_code(uint64_t address) + * We use the load normal reset to keep r15 unchanged. jump_to_IPL_2 + * can then use r15 as its stack pointer. + */ +- asm volatile("lghi 1,1\n\t" +- "diag 1,1,0x308\n\t" ++ asm volatile("lghi %%r1,1\n\t" ++ "diag %%r1,%%r1,0x308\n\t" + : : : "1", "memory"); + panic("\n! IPL returns !\n"); + } +diff --git a/pc-bios/s390-ccw/menu.c b/pc-bios/s390-ccw/menu.c +index de8260a5d6..d601952d3e 100644 +--- a/pc-bios/s390-ccw/menu.c ++++ b/pc-bios/s390-ccw/menu.c +@@ -36,9 +36,9 @@ static inline void enable_clock_int(void) + uint64_t tmp = 0; + + asm volatile( +- "stctg 0,0,%0\n" ++ "stctg %%c0,%%c0,%0\n" + "oi 6+%0, 0x8\n" +- "lctlg 0,0,%0" ++ "lctlg %%c0,%%c0,%0" + : : "Q" (tmp) : "memory" + ); + } +@@ -48,9 +48,9 @@ static inline void disable_clock_int(void) + uint64_t tmp = 0; + + asm volatile( +- "stctg 0,0,%0\n" ++ "stctg %%c0,%%c0,%0\n" + "ni 6+%0, 0xf7\n" +- "lctlg 0,0,%0" ++ "lctlg %%c0,%%c0,%0" + : : "Q" (tmp) : "memory" + ); + } +diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c +index ab49840db8..5d2c6e3381 100644 +--- a/pc-bios/s390-ccw/virtio.c ++++ b/pc-bios/s390-ccw/virtio.c +@@ -54,7 +54,7 @@ static long kvm_hypercall(unsigned long nr, unsigned long param1, + register ulong r_param3 asm("4") = param3; + register long retval asm("2"); + +- asm volatile ("diag 2,4,0x500" ++ asm volatile ("diag %%r2,%%r4,0x500" + : "=d" (retval) + : "d" (r_nr), "0" (r_param1), "r"(r_param2), "d"(r_param3) + : "memory", "cc"); +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch b/SOURCES/kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch new file mode 100644 index 0000000..06d0d4d --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch @@ -0,0 +1,48 @@ +From f2d40216872a40bc5f5089de760c7ba0e3a710bc Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Sun, 2 May 2021 13:07:46 +0200 +Subject: [PATCH 32/39] pc-bios/s390-ccw: Fix the cc-option macro in the + Makefile + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [5/11] 75379671567451e12ca32a3ea35d1ad2aa04bf5f (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +The cc-option macro is not doing what it should - compared with the +original from the rules.mak file that got removed with commit +660f793093 ("Makefile: inline the relevant parts of rules.mak"), +the arguments got changed and thus the macro is rather doubling +the QEMU_CFLAGS than adding the flag that should be tested. + +Message-Id: <20210502174836.838816-3-thuth@redhat.com> +Fixes: 22fb2ab096 ("pc-bios/s390-ccw: do not use rules.mak") +Signed-off-by: Thomas Huth +(cherry picked from commit 3462ff35512e925df5ee8c079ed46d4c93b633a7) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile +index 29fd9019b8..f0fe84c9eb 100644 +--- a/pc-bios/s390-ccw/Makefile ++++ b/pc-bios/s390-ccw/Makefile +@@ -6,8 +6,8 @@ include ../../config-host.mak + CFLAGS = -O2 -g + + quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1)) +-cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null \ +- 2>&1 && echo OK), $1, $2) ++cc-option = $(if $(shell $(CC) $1 $2 -S -o /dev/null -xc /dev/null \ ++ >/dev/null 2>&1 && echo OK),$2,$3) + + VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in + set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1))) +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch b/SOURCES/kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch new file mode 100644 index 0000000..ee9f702 --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch @@ -0,0 +1,75 @@ +From c5b348e6d0334333295332c55fc4be51ce2668b8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= +Date: Thu, 22 Apr 2021 16:59:11 +0200 +Subject: [PATCH 33/39] pc-bios/s390-ccw: Silence GCC 11 stringop-overflow + warning +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [6/11] 92851a154f2425363aa1f5ed2bb12740f589229e (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +When building on Fedora 34 (gcc version 11.0.0 20210210) we get: + + In file included from pc-bios/s390-ccw/main.c:11: + In function ‘memset’, + inlined from ‘boot_setup’ at pc-bios/s390-ccw/main.c:185:5, + inlined from ‘main’ at pc-bios/s390-ccw/main.c:288:5: + pc-bios/s390-ccw/libc.h:28:14: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] + 28 | p[i] = c; + | ~~~~~^~~ + +The offending code is: + + memset((char *)S390EP, 0, 6); + +where S390EP is a const address: + + #define S390EP 0x10008 + +The compiler doesn't know how big that pointed area is, so it assume that +its length is zero. This has been reported as BZ#99578 to GCC: +"gcc-11 -Warray-bounds or -Wstringop-overread warning when accessing a +pointer from integer literal" +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578 + +As this warning does us more harm than good in the BIOS code (where +lot of direct accesses to low memory are done), silence this warning +for all BIOS objects. + +Suggested-by: Thomas Huth +Signed-off-by: Philippe Mathieu-Daudé +Message-Id: <20210422145911.2513980-1-philmd@redhat.com> +Acked-by: Christian Borntraeger +Message-Id: <20210502174836.838816-4-thuth@redhat.com> +[thuth: Use the pre-existing cc-option macro instead of adding a new one] +Reviewed-by: Cornelia Huck +Signed-off-by: Thomas Huth +(cherry picked from commit da231910d33084ccf63f07de210b145e0fa31d98) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile +index f0fe84c9eb..83fb1afb73 100644 +--- a/pc-bios/s390-ccw/Makefile ++++ b/pc-bios/s390-ccw/Makefile +@@ -30,6 +30,7 @@ OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \ + virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o + + QEMU_CFLAGS := -Wall $(filter -W%, $(QEMU_CFLAGS)) ++QEMU_CFLAGS += $(call cc-option,-Werror $(QEMU_CFLAGS),-Wno-stringop-overflow) + QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -fno-common -fPIE + QEMU_CFLAGS += -fwrapv -fno-strict-aliasing -fno-asynchronous-unwind-tables + QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector) +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch b/SOURCES/kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch new file mode 100644 index 0000000..e361980 --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch @@ -0,0 +1,59 @@ +From 12acb42f2e6317a530fa01b5cf55a199231bfdce Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Sun, 2 May 2021 13:49:20 +0200 +Subject: [PATCH 31/39] pc-bios/s390-ccw: Silence warning from Clang by marking + panic() as noreturn +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [4/11] 806b776bf01b733e04664534641cf89d1cb48f1b (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +When compiling the s390-ccw bios with Clang, the compiler emits a warning: + + pc-bios/s390-ccw/main.c:210:5: warning: variable 'found' is used uninitialized + whenever switch default is taken [-Wsometimes-uninitialized] + default: + ^~~~~~~ + pc-bios/s390-ccw/main.c:214:16: note: uninitialized use occurs here + IPL_assert(found, "Boot device not found\n"); + ^~~~~ + +It's a false positive, it only happens because Clang is not smart enough +to see that the panic() function in the "default:" case can never return. + +Anyway, let's explicitely mark panic() with "noreturn" to shut up the +warning. + +Message-Id: <20210502174836.838816-2-thuth@redhat.com> +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Cornelia Huck +Signed-off-by: Thomas Huth +(cherry picked from commit 679196a646c91b8ce9a97b0aa81ffb3776cf8046) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/s390-ccw.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/pc-bios/s390-ccw/s390-ccw.h b/pc-bios/s390-ccw/s390-ccw.h +index 6cd92669e9..79db69ff54 100644 +--- a/pc-bios/s390-ccw/s390-ccw.h ++++ b/pc-bios/s390-ccw/s390-ccw.h +@@ -89,6 +89,7 @@ bool menu_is_enabled_enum(void); + + #define MAX_BOOT_ENTRIES 31 + ++__attribute__ ((__noreturn__)) + static inline void panic(const char *string) + { + sclp_print(string); +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch b/SOURCES/kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch new file mode 100644 index 0000000..c98c1c2 --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch @@ -0,0 +1,60 @@ +From 609d8661171760c7ead04f64359d47a77c31d474 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 23 Apr 2021 10:30:51 +0200 +Subject: [PATCH 29/39] pc-bios/s390-ccw: Use reset_psw pointer instead of + hard-coded null pointer +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [2/11] c65a986104a1830847e772879ca6eaf76c86b2f3 (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +When compiling the s390-ccw bios with clang, it emits a warning like this: + + pc-bios/s390-ccw/jump2ipl.c:86:9: warning: indirection of non-volatile null + pointer will be deleted, not trap [-Wnull-dereference] + if (*((uint64_t *)0) & RESET_PSW_MASK) { + ^~~~~~~~~~~~~~~~ + pc-bios/s390-ccw/jump2ipl.c:86:9: note: consider using __builtin_trap() or + qualifying pointer with 'volatile' + +We could add a "volatile" here to shut it up, but on the other hand, +we also have a pointer variable called "reset_psw" in this file already +that points to the PSW at address 0, so we can simply use that pointer +variable instead. + +Reviewed-by: Philippe Mathieu-Daudé +Message-Id: <20210423142440.582188-1-thuth@redhat.com> +Reviewed-by: Janosch Frank +Signed-off-by: Thomas Huth +(cherry picked from commit ff77712a8a2e15e5901fad35b9a6bb65974b2e4a) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/jump2ipl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/pc-bios/s390-ccw/jump2ipl.c b/pc-bios/s390-ccw/jump2ipl.c +index b9c70d64a5..73e4367e09 100644 +--- a/pc-bios/s390-ccw/jump2ipl.c ++++ b/pc-bios/s390-ccw/jump2ipl.c +@@ -82,8 +82,8 @@ void jump_to_low_kernel(void) + jump_to_IPL_code(KERN_IMAGE_START); + } + +- /* Trying to get PSW at zero address */ +- if (*((uint64_t *)0) & RESET_PSW_MASK) { ++ /* Trying to get PSW at zero address (pointed to by reset_psw) */ ++ if (*reset_psw & RESET_PSW_MASK) { + /* + * Surely nobody will try running directly from lowcore, so + * let's use 0 as an indication that we want to load the reset +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch b/SOURCES/kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch new file mode 100644 index 0000000..bace1cc --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch @@ -0,0 +1,56 @@ +From c00df86dd570d78767c5435f97bbe1d06407e470 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Wed, 21 Apr 2021 17:48:48 +0200 +Subject: [PATCH 28/39] pc-bios/s390-ccw/bootmap: Silence compiler warning from + Clang +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [1/11] 85e41a04a0f47afe23e62f70397a5f79b2703499 (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +When compiling the s390-ccw bios with Clang, the compiler complains: + + pc-bios/s390-ccw/bootmap.c:302:9: warning: logical not is only applied + to the left hand side of this comparison [-Wlogical-not-parentheses] + if (!mbr->dev_type == DEV_TYPE_ECKD) { + ^ ~~ + +The code works (more or less by accident), since dev_type can only be +0 or 1, but it's better of course to use the intended != operator here +instead. + +Fixes: 5dc739f343 ("Allow booting in case the first virtio-blk disk is bad") +Message-Id: <20210421163331.358178-1-thuth@redhat.com> +Reviewed-by: Philippe Mathieu-Daudé +Reviewed-by: Christian Borntraeger +Signed-off-by: Thomas Huth +(cherry picked from commit d08a64940452060ab7ad5eb49cd5801131c2b9ec) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/bootmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c +index b46997c0b7..56411ab3b6 100644 +--- a/pc-bios/s390-ccw/bootmap.c ++++ b/pc-bios/s390-ccw/bootmap.c +@@ -299,7 +299,7 @@ static void ipl_eckd_cdl(void) + sclp_print("Bad block size in zIPL section of IPL2 record.\n"); + return; + } +- if (!mbr->dev_type == DEV_TYPE_ECKD) { ++ if (mbr->dev_type != DEV_TYPE_ECKD) { + sclp_print("Non-ECKD device type in zIPL section of IPL2 record.\n"); + return; + } +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-don-t-try-to-read-the-next-block-if.patch b/SOURCES/kvm-pc-bios-s390-ccw-don-t-try-to-read-the-next-block-if.patch new file mode 100644 index 0000000..77db467 --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-don-t-try-to-read-the-next-block-if.patch @@ -0,0 +1,51 @@ +From bd1d37e3536136130df41ac8162ce5bb4f361f87 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Tue, 1 Jun 2021 08:52:10 -0400 +Subject: [PATCH 02/21] pc-bios/s390-ccw: don't try to read the next block if + end of chunk is reached +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [1/8] 69a43520a9e7f0ab92bdfdc47281c7606f5159e7 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +From: Marc Hartmayer + +Don't read the block if a null block number is reached, because this means that +the end of chunk is reached. + +Reviewed-by: Collin Walling +Signed-off-by: Marc Hartmayer +Message-Id: <20210416074736.17409-1-mhartmay@linux.ibm.com> +Signed-off-by: Thomas Huth +(cherry picked from commit a6625d38cce3901a7c1cba069f0abcf743a293f1) +Signed-off-by: Thomas Huth +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/bootmap.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pc-bios/s390-ccw/bootmap.c b/pc-bios/s390-ccw/bootmap.c +index 44df7d16af..b46997c0b7 100644 +--- a/pc-bios/s390-ccw/bootmap.c ++++ b/pc-bios/s390-ccw/bootmap.c +@@ -213,7 +213,7 @@ static int eckd_get_boot_menu_index(block_number_t s1b_block_nr) + next_block_nr = eckd_block_num(&s1b->seek[i + 1].chs); + } + +- if (next_block_nr) { ++ if (next_block_nr && !is_null_block_number(next_block_nr)) { + read_block(next_block_nr, s2_next_blk, + "Cannot read stage2 boot loader"); + } +-- +2.27.0 + diff --git a/SOURCES/kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch b/SOURCES/kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch new file mode 100644 index 0000000..95c276d --- /dev/null +++ b/SOURCES/kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch @@ -0,0 +1,44 @@ +From 354026a79551358a5be4ed561e080ff550738e92 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 23 Apr 2021 17:20:46 +0200 +Subject: [PATCH 30/39] pc-bios/s390-ccw/netboot: Use "-Wl," prefix to pass + parameter to the linker + +RH-Author: Jon Maloy +RH-MergeRequest: 24: v7: Add support for building qemu-kvm with clang and safe-stack +RH-Commit: [3/11] 6a22a1705fbeb5fb2eab6c0e149a433286f98e5f (jmaloy/qemu-kvm-centos-jon) +RH-Bugzilla: 1939509 1940132 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Thomas Huth +RH-Acked-by: Cornelia Huck + +We are using the compiler to do the linking of the bios files. GCC still +accepts the "-Ttext=..." linker flag directly and is smart enough to +pass it to the linker, but in case we are compiling with Clang, we have +to use the official way with the "-Wl," prefix instead. + +Message-Id: <20210423153646.593153-1-thuth@redhat.com> +Signed-off-by: Thomas Huth +(cherry picked from commit b460a220872c28a8da95cbc7e9369d26aa268848) +Signed-off-by: Jon Maloy +Signed-off-by: Miroslav Rezanina +--- + pc-bios/s390-ccw/netboot.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak +index 577c023afe..68b4d7edcb 100644 +--- a/pc-bios/s390-ccw/netboot.mak ++++ b/pc-bios/s390-ccw/netboot.mak +@@ -6,7 +6,7 @@ NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o + LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include + LIBNET_INC := -I$(SLOF_DIR)/lib/libnet + +-NETLDFLAGS := $(LDFLAGS) -Ttext=0x7800000 ++NETLDFLAGS := $(LDFLAGS) -Wl,-Ttext=0x7800000 + + $(NETOBJS): QEMU_CFLAGS += $(LIBC_INC) $(LIBNET_INC) + +-- +2.27.0 + diff --git a/SOURCES/kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch b/SOURCES/kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch new file mode 100644 index 0000000..dd982e3 --- /dev/null +++ b/SOURCES/kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch @@ -0,0 +1,69 @@ +From e496360f627cdc4202f185b63175ced08c8b1f07 Mon Sep 17 00:00:00 2001 +From: Daniel Henrique Barboza +Date: Wed, 23 Jun 2021 19:39:32 -0400 +Subject: [PATCH 3/6] ppc/pef.c: initialize cgs->ready in kvmppc_svm_init() + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 22: Synchronize with RHEL-AV 8.5 release 23 to RHEL 9 +RH-Commit: [2/5] b204f898d2333686e30b14c050ac7a9289670f23 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 + +QEMU is failing to launch a CGS pSeries guest in a host that has PEF +support: + +qemu-system-ppc64: ../softmmu/vl.c:2585: qemu_machine_creation_done: Assertion `machine->cgs->ready' failed. +Aborted + +This is happening because we're not setting the cgs->ready flag that is +asserted in qemu_machine_creation_done() during machine start. + +cgs->ready is set in s390_pv_kvm_init() and sev_kvm_init(). Let's set it +in kvmppc_svm_init() as well. + +Reported-by: Ram Pai +Signed-off-by: Daniel Henrique Barboza +Message-Id: <20210528201619.52363-1-danielhb413@gmail.com> +Acked-by: Ram Pai +Signed-off-by: David Gibson +(cherry picked from commit b873ed83311d96644b544b10f6869a430660585a) +Signed-off-by: Daniel Henrique Barboza +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/pef.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/hw/ppc/pef.c b/hw/ppc/pef.c +index 573be3ed79..cc44d5e339 100644 +--- a/hw/ppc/pef.c ++++ b/hw/ppc/pef.c +@@ -41,7 +41,7 @@ struct PefGuest { + ConfidentialGuestSupport parent_obj; + }; + +-static int kvmppc_svm_init(Error **errp) ++static int kvmppc_svm_init(ConfidentialGuestSupport *cgs, Error **errp) + { + #ifdef CONFIG_KVM + static Error *pef_mig_blocker; +@@ -65,6 +65,8 @@ static int kvmppc_svm_init(Error **errp) + /* NB: This can fail if --only-migratable is used */ + migrate_add_blocker(pef_mig_blocker, &error_fatal); + ++ cgs->ready = true; ++ + return 0; + #else + g_assert_not_reached(); +@@ -102,7 +104,7 @@ int pef_kvm_init(ConfidentialGuestSupport *cgs, Error **errp) + return -1; + } + +- return kvmppc_svm_init(errp); ++ return kvmppc_svm_init(cgs, errp); + } + + int pef_kvm_reset(ConfidentialGuestSupport *cgs, Error **errp) +-- +2.27.0 + diff --git a/SOURCES/kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch b/SOURCES/kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch new file mode 100644 index 0000000..8b618c0 --- /dev/null +++ b/SOURCES/kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch @@ -0,0 +1,70 @@ +From 9d2700ed836cdfabbd031da74cd5a3d01c9127dd Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 20 Aug 2021 18:25:12 +0200 +Subject: [PATCH 1/4] 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 +--- + 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 9727ae8fe3..7c061bf315 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -1336,6 +1336,12 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, + ret = -ENOTSUP; + goto fail; + } ++ if (header.version < 3 && !bs->read_only && 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 268b749e2f..1f243a8bc1 100644 +--- a/tests/qemu-iotests/common.filter ++++ b/tests/qemu-iotests/common.filter +@@ -82,6 +82,7 @@ _filter_qemu() + { + $SED -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.27.0 + diff --git a/SOURCES/kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch b/SOURCES/kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch new file mode 100644 index 0000000..aa106c9 --- /dev/null +++ b/SOURCES/kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch @@ -0,0 +1,265 @@ +From c5a2313ba173568087d78f76cc0258e7a353830b Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 6 Aug 2021 15:07:49 -0400 +Subject: [PATCH 26/39] qemu-img: Add --skip-broken-bitmaps for 'convert + --bitmaps' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 35: Synchronize with RHEL-AV 8.5 release 28 to RHEL 9 +RH-Commit: [3/4] 4b7203c66367c601f9710bbcd91bdbdd56f0f8bd (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Philippe Mathieu-Daudé + +The point of 'qemu-img convert --bitmaps' is to be a convenience for +actions that are already possible through a string of smaller +'qemu-img bitmap' sub-commands. One situation not accounted for +already is that if a source image contains an inconsistent bitmap (for +example, because a qemu process died abruptly before flushing bitmap +state), the user MUST delete those inconsistent bitmaps before +anything else useful can be done with the image. + +We don't want to delete inconsistent bitmaps by default: although a +corrupt bitmap is only a loss of optimization rather than a corruption +of user-visible data, it is still nice to require the user to opt in +to the fact that they are aware of the loss of the bitmap. Still, +requiring the user to check 'qemu-img info' to see whether bitmaps are +consistent, then use 'qemu-img bitmap --remove' to remove offenders, +all before using 'qemu-img convert', is a lot more work than just +adding a knob 'qemu-img convert --bitmaps --skip-broken-bitmaps' which +opts in to skipping the broken bitmaps. + +After testing the new option, also demonstrate the way to manually fix +things (either deleting bad bitmaps, or re-creating them as empty) so +that it is possible to convert without the option. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1946084 +Signed-off-by: Eric Blake +Message-Id: <20210709153951.2801666-4-eblake@redhat.com> +[eblake: warning message tweak, test enhancements] +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 955171e4417bf39edb5503e694501e082a757731) +Signed-off-by: Eric Blake +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + docs/tools/qemu-img.rst | 8 ++++- + qemu-img.c | 29 +++++++++++---- + tests/qemu-iotests/tests/qemu-img-bitmaps | 16 ++++++++- + tests/qemu-iotests/tests/qemu-img-bitmaps.out | 35 ++++++++++++++++++- + 4 files changed, 79 insertions(+), 9 deletions(-) + +diff --git a/docs/tools/qemu-img.rst b/docs/tools/qemu-img.rst +index c9efcfaefc..3df6277d6a 100644 +--- a/docs/tools/qemu-img.rst ++++ b/docs/tools/qemu-img.rst +@@ -414,7 +414,7 @@ Command description: + 4 + Error on reading data + +-.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME ++.. option:: convert [--object OBJECTDEF] [--image-opts] [--target-image-opts] [--target-is-zero] [--bitmaps [--skip-broken-bitmaps]] [-U] [-C] [-c] [-p] [-q] [-n] [-f FMT] [-t CACHE] [-T SRC_CACHE] [-O OUTPUT_FMT] [-B BACKING_FILE] [-o OPTIONS] [-l SNAPSHOT_PARAM] [-S SPARSE_SIZE] [-r RATE_LIMIT] [-m NUM_COROUTINES] [-W] FILENAME [FILENAME2 [...]] OUTPUT_FILENAME + + Convert the disk image *FILENAME* or a snapshot *SNAPSHOT_PARAM* + to disk image *OUTPUT_FILENAME* using format *OUTPUT_FMT*. It can +@@ -456,6 +456,12 @@ Command description: + *NUM_COROUTINES* specifies how many coroutines work in parallel during + the convert process (defaults to 8). + ++ Use of ``--bitmaps`` requests that any persistent bitmaps present in ++ the original are also copied to the destination. If any bitmap is ++ inconsistent in the source, the conversion will fail unless ++ ``--skip-broken-bitmaps`` is also specified to copy only the ++ consistent bitmaps. ++ + .. option:: create [--object OBJECTDEF] [-q] [-f FMT] [-b BACKING_FILE] [-F BACKING_FMT] [-u] [-o OPTIONS] FILENAME [SIZE] + + Create the new disk image *FILENAME* of size *SIZE* and format +diff --git a/qemu-img.c b/qemu-img.c +index 7684684bfa..75bab32416 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -82,6 +82,7 @@ enum { + OPTION_MERGE = 274, + OPTION_BITMAPS = 275, + OPTION_FORCE = 276, ++ OPTION_SKIP_BROKEN = 277, + }; + + typedef enum OutputFormat { +@@ -2099,7 +2100,7 @@ static int convert_do_copy(ImgConvertState *s) + } + + /* Check that bitmaps can be copied, or output an error */ +-static int convert_check_bitmaps(BlockDriverState *src) ++static int convert_check_bitmaps(BlockDriverState *src, bool skip_broken) + { + BdrvDirtyBitmap *bm; + +@@ -2111,17 +2112,19 @@ static int convert_check_bitmaps(BlockDriverState *src) + if (!bdrv_dirty_bitmap_get_persistence(bm)) { + continue; + } +- if (bdrv_dirty_bitmap_inconsistent(bm)) { ++ if (!skip_broken && bdrv_dirty_bitmap_inconsistent(bm)) { + error_report("Cannot copy inconsistent bitmap '%s'", + bdrv_dirty_bitmap_name(bm)); +- error_printf("Try 'qemu-img bitmap --remove' to delete it\n"); ++ error_printf("Try --skip-broken-bitmaps, or " ++ "use 'qemu-img bitmap --remove' to delete it\n"); + return -1; + } + } + return 0; + } + +-static int convert_copy_bitmaps(BlockDriverState *src, BlockDriverState *dst) ++static int convert_copy_bitmaps(BlockDriverState *src, BlockDriverState *dst, ++ bool skip_broken) + { + BdrvDirtyBitmap *bm; + Error *err = NULL; +@@ -2133,6 +2136,10 @@ static int convert_copy_bitmaps(BlockDriverState *src, BlockDriverState *dst) + continue; + } + name = bdrv_dirty_bitmap_name(bm); ++ if (skip_broken && bdrv_dirty_bitmap_inconsistent(bm)) { ++ warn_report("Skipping inconsistent bitmap '%s'", name); ++ continue; ++ } + qmp_block_dirty_bitmap_add(dst->node_name, name, + true, bdrv_dirty_bitmap_granularity(bm), + true, true, +@@ -2188,6 +2195,7 @@ static int img_convert(int argc, char **argv) + bool force_share = false; + bool explict_min_sparse = false; + bool bitmaps = false; ++ bool skip_broken = false; + int64_t rate_limit = 0; + + ImgConvertState s = (ImgConvertState) { +@@ -2209,6 +2217,7 @@ static int img_convert(int argc, char **argv) + {"salvage", no_argument, 0, OPTION_SALVAGE}, + {"target-is-zero", no_argument, 0, OPTION_TARGET_IS_ZERO}, + {"bitmaps", no_argument, 0, OPTION_BITMAPS}, ++ {"skip-broken-bitmaps", no_argument, 0, OPTION_SKIP_BROKEN}, + {0, 0, 0, 0} + }; + c = getopt_long(argc, argv, ":hf:O:B:Cco:l:S:pt:T:qnm:WUr:", +@@ -2337,6 +2346,9 @@ static int img_convert(int argc, char **argv) + case OPTION_BITMAPS: + bitmaps = true; + break; ++ case OPTION_SKIP_BROKEN: ++ skip_broken = true; ++ break; + } + } + +@@ -2344,6 +2356,11 @@ static int img_convert(int argc, char **argv) + out_fmt = "raw"; + } + ++ if (skip_broken && !bitmaps) { ++ error_report("Use of --skip-broken-bitmaps requires --bitmaps"); ++ goto fail_getopt; ++ } ++ + if (s.compressed && s.copy_range) { + error_report("Cannot enable copy offloading when -c is used"); + goto fail_getopt; +@@ -2573,7 +2590,7 @@ static int img_convert(int argc, char **argv) + ret = -1; + goto out; + } +- ret = convert_check_bitmaps(blk_bs(s.src[0])); ++ ret = convert_check_bitmaps(blk_bs(s.src[0]), skip_broken); + if (ret < 0) { + goto out; + } +@@ -2698,7 +2715,7 @@ static int img_convert(int argc, char **argv) + + /* Now copy the bitmaps */ + if (bitmaps && ret == 0) { +- ret = convert_copy_bitmaps(blk_bs(s.src[0]), out_bs); ++ ret = convert_copy_bitmaps(blk_bs(s.src[0]), out_bs, skip_broken); + } + + out: +diff --git a/tests/qemu-iotests/tests/qemu-img-bitmaps b/tests/qemu-iotests/tests/qemu-img-bitmaps +index 09c3d395d1..7a3fe8c3d3 100755 +--- a/tests/qemu-iotests/tests/qemu-img-bitmaps ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps +@@ -144,7 +144,21 @@ _img_info --format-specific | _filter_irrelevant_img_info + echo + $QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG" "$TEST_IMG.copy" && + echo "unexpected success" +-TEST_IMG=$TEST_IMG.copy _img_info --format-specific \ ++TEST_IMG="$TEST_IMG.copy" _img_info --format-specific \ ++ | _filter_irrelevant_img_info ++# Skipping the broken bitmaps works,... ++echo ++$QEMU_IMG convert --bitmaps --skip-broken-bitmaps \ ++ -O qcow2 "$TEST_IMG" "$TEST_IMG.copy" ++TEST_IMG="$TEST_IMG.copy" _img_info --format-specific \ ++ | _filter_irrelevant_img_info ++# ...as does removing them ++echo ++_rm_test_img "$TEST_IMG.copy" ++$QEMU_IMG bitmap --remove "$TEST_IMG" b0 ++$QEMU_IMG bitmap --remove --add "$TEST_IMG" b2 ++$QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG" "$TEST_IMG.copy" ++TEST_IMG="$TEST_IMG.copy" _img_info --format-specific \ + | _filter_irrelevant_img_info + + # success, all done +diff --git a/tests/qemu-iotests/tests/qemu-img-bitmaps.out b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +index 1e32833bf1..7a7429e320 100644 +--- a/tests/qemu-iotests/tests/qemu-img-bitmaps.out ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +@@ -145,6 +145,39 @@ Format specific information: + corrupt: false + + qemu-img: Cannot copy inconsistent bitmap 'b0' +-Try 'qemu-img bitmap --remove' to delete it ++Try --skip-broken-bitmaps, or use 'qemu-img bitmap --remove' to delete it + qemu-img: Could not open 'TEST_DIR/t.IMGFMT.copy': Could not open 'TEST_DIR/t.IMGFMT.copy': No such file or directory ++ ++qemu-img: warning: Skipping inconsistent bitmap 'b0' ++qemu-img: warning: Skipping inconsistent bitmap 'b2' ++image: TEST_DIR/t.IMGFMT.copy ++file format: IMGFMT ++virtual size: 10 MiB (10485760 bytes) ++cluster_size: 65536 ++Format specific information: ++ bitmaps: ++ [0]: ++ flags: ++ [0]: auto ++ name: b4 ++ granularity: 65536 ++ corrupt: false ++ ++image: TEST_DIR/t.IMGFMT.copy ++file format: IMGFMT ++virtual size: 10 MiB (10485760 bytes) ++cluster_size: 65536 ++Format specific information: ++ bitmaps: ++ [0]: ++ flags: ++ [0]: auto ++ name: b4 ++ granularity: 65536 ++ [1]: ++ flags: ++ [0]: auto ++ name: b2 ++ granularity: 65536 ++ corrupt: false + *** done +-- +2.27.0 + diff --git a/SOURCES/kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch b/SOURCES/kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch new file mode 100644 index 0000000..bdd40b9 --- /dev/null +++ b/SOURCES/kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch @@ -0,0 +1,145 @@ +From 5e8f99ea87409e1423c2e1c5e445003cf4a032a9 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 6 Aug 2021 15:07:48 -0400 +Subject: [PATCH 25/39] qemu-img: Fail fast on convert --bitmaps with + inconsistent bitmap +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 35: Synchronize with RHEL-AV 8.5 release 28 to RHEL 9 +RH-Commit: [2/4] 3fd8d357c3a365d4bc142b3d339745e5b15c5894 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Philippe Mathieu-Daudé + +Waiting until the end of the convert operation (a potentially +time-consuming task) to finally detect that we can't copy a bitmap is +bad, comparing to failing fast up front. Furthermore, this prevents +us from leaving a file behind with a bitmap that is not marked as +inconsistent even though it does not have sane contents. + +This fixes the problems exposed in the previous patch to the iotest: +it adds a fast failure up front, and even if we don't fail early, it +ensures that any bitmap we add but do not properly populate is removed +again rather than left behind incomplete. + +Signed-off-by: Eric Blake +Message-Id: <20210709153951.2801666-3-eblake@redhat.com> +[eblake: add a hint to the warning message, simplify name computation] +Reviewed-by: Nir Soffer +Reviewed-by: Vladimir Sementsov-Ogievskiy +(cherry picked from commit 74a4320f30632fa539507861b3835698282e462e) +Signed-off-by: Eric Blake +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + qemu-img.c | 29 +++++++++++++++++-- + tests/qemu-iotests/tests/qemu-img-bitmaps | 3 +- + tests/qemu-iotests/tests/qemu-img-bitmaps.out | 21 ++------------ + 3 files changed, 30 insertions(+), 23 deletions(-) + +diff --git a/qemu-img.c b/qemu-img.c +index babb5573ab..7684684bfa 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -2098,6 +2098,29 @@ static int convert_do_copy(ImgConvertState *s) + return s->ret; + } + ++/* Check that bitmaps can be copied, or output an error */ ++static int convert_check_bitmaps(BlockDriverState *src) ++{ ++ BdrvDirtyBitmap *bm; ++ ++ if (!bdrv_supports_persistent_dirty_bitmap(src)) { ++ error_report("Source lacks bitmap support"); ++ return -1; ++ } ++ FOR_EACH_DIRTY_BITMAP(src, bm) { ++ if (!bdrv_dirty_bitmap_get_persistence(bm)) { ++ continue; ++ } ++ if (bdrv_dirty_bitmap_inconsistent(bm)) { ++ error_report("Cannot copy inconsistent bitmap '%s'", ++ bdrv_dirty_bitmap_name(bm)); ++ error_printf("Try 'qemu-img bitmap --remove' to delete it\n"); ++ return -1; ++ } ++ } ++ return 0; ++} ++ + static int convert_copy_bitmaps(BlockDriverState *src, BlockDriverState *dst) + { + BdrvDirtyBitmap *bm; +@@ -2124,6 +2147,7 @@ static int convert_copy_bitmaps(BlockDriverState *src, BlockDriverState *dst) + &err); + if (err) { + error_reportf_err(err, "Failed to populate bitmap %s: ", name); ++ qmp_block_dirty_bitmap_remove(dst->node_name, name, NULL); + return -1; + } + } +@@ -2549,9 +2573,8 @@ static int img_convert(int argc, char **argv) + ret = -1; + goto out; + } +- if (!bdrv_supports_persistent_dirty_bitmap(blk_bs(s.src[0]))) { +- error_report("Source lacks bitmap support"); +- ret = -1; ++ ret = convert_check_bitmaps(blk_bs(s.src[0])); ++ if (ret < 0) { + goto out; + } + } +diff --git a/tests/qemu-iotests/tests/qemu-img-bitmaps b/tests/qemu-iotests/tests/qemu-img-bitmaps +index 409c4497a3..09c3d395d1 100755 +--- a/tests/qemu-iotests/tests/qemu-img-bitmaps ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps +@@ -140,11 +140,10 @@ $QEMU_IO -c abort "$TEST_IMG" 2>/dev/null + $QEMU_IMG bitmap --add "$TEST_IMG" b4 + $QEMU_IMG bitmap --remove "$TEST_IMG" b1 + _img_info --format-specific | _filter_irrelevant_img_info ++# Proof that we fail fast if bitmaps can't be copied + echo + $QEMU_IMG convert --bitmaps -O qcow2 "$TEST_IMG" "$TEST_IMG.copy" && + echo "unexpected success" +-# Bug - even though we failed at conversion, we left a file around with +-# a bitmap marked as not corrupt + TEST_IMG=$TEST_IMG.copy _img_info --format-specific \ + | _filter_irrelevant_img_info + +diff --git a/tests/qemu-iotests/tests/qemu-img-bitmaps.out b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +index 543b028da6..1e32833bf1 100644 +--- a/tests/qemu-iotests/tests/qemu-img-bitmaps.out ++++ b/tests/qemu-iotests/tests/qemu-img-bitmaps.out +@@ -144,22 +144,7 @@ Format specific information: + granularity: 65536 + corrupt: false + +-qemu-img: Failed to populate bitmap b0: Bitmap 'b0' is inconsistent and cannot be used +-Try block-dirty-bitmap-remove to delete this bitmap from disk +-image: TEST_DIR/t.IMGFMT.copy +-file format: IMGFMT +-virtual size: 10 MiB (10485760 bytes) +-cluster_size: 65536 +-Format specific information: +- bitmaps: +- [0]: +- flags: +- name: b0 +- granularity: 65536 +- [1]: +- flags: +- [0]: auto +- name: b4 +- granularity: 65536 +- corrupt: false ++qemu-img: Cannot copy inconsistent bitmap 'b0' ++Try 'qemu-img bitmap --remove' to delete it ++qemu-img: Could not open 'TEST_DIR/t.IMGFMT.copy': Could not open 'TEST_DIR/t.IMGFMT.copy': No such file or directory + *** done +-- +2.27.0 + diff --git a/SOURCES/kvm-ratelimit-protect-with-a-mutex.patch b/SOURCES/kvm-ratelimit-protect-with-a-mutex.patch new file mode 100644 index 0000000..6d18a15 --- /dev/null +++ b/SOURCES/kvm-ratelimit-protect-with-a-mutex.patch @@ -0,0 +1,133 @@ +From 05efd4675b1241f2cc68fd54c92a8a834699f212 Mon Sep 17 00:00:00 2001 +From: "plai@redhat.com" +Date: Thu, 29 Jul 2021 07:42:21 -0400 +Subject: [PATCH 14/39] ratelimit: protect with a mutex + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 32: Synchronize with RHEL-AV 8.5 release 27 to RHEL 9 +RH-Commit: [6/15] 48586bf5d422cb676a6f2d2cd0abb0822cfc17b2 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Stefano Garzarella +RH-Acked-by: Kevin Wolf +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Right now, rate limiting is protected by the AioContext mutex, which is +taken for example both by the block jobs and by qmp_block_job_set_speed +(via find_block_job). + +We would like to remove the dependency of block layer code on the +AioContext mutex, since most drivers and the core I/O code are already +not relying on it. However, there is no existing lock that can easily +be taken by both ratelimit_set_speed and ratelimit_calculate_delay, +especially because the latter might run in coroutine context (and +therefore under a CoMutex) but the former will not. + +Since concurrent calls to ratelimit_calculate_delay are not possible, +one idea could be to use a seqlock to get a snapshot of slice_ns and +slice_quota. But for now keep it simple, and just add a mutex to the +RateLimit struct; block jobs are generally not performance critical to +the point of optimizing the clock cycles spent in synchronization. + +This also requires the introduction of init/destroy functions, so +add them to the two users of ratelimit.h. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 4951967d84a0acbf47895add9158e2d4c6056ea0) +Signed-off-by: Paul Lai +Signed-off-by: Miroslav Rezanina +--- + block/block-copy.c | 2 ++ + blockjob.c | 3 +++ + include/qemu/ratelimit.h | 14 ++++++++++++++ + 3 files changed, 19 insertions(+) + +diff --git a/block/block-copy.c b/block/block-copy.c +index 39ae481c8b..9b4af00614 100644 +--- a/block/block-copy.c ++++ b/block/block-copy.c +@@ -230,6 +230,7 @@ void block_copy_state_free(BlockCopyState *s) + return; + } + ++ ratelimit_destroy(&s->rate_limit); + bdrv_release_dirty_bitmap(s->copy_bitmap); + shres_destroy(s->mem); + g_free(s); +@@ -289,6 +290,7 @@ BlockCopyState *block_copy_state_new(BdrvChild *source, BdrvChild *target, + s->copy_size = MAX(s->cluster_size, BLOCK_COPY_MAX_BUFFER); + } + ++ ratelimit_init(&s->rate_limit); + QLIST_INIT(&s->tasks); + QLIST_INIT(&s->calls); + +diff --git a/blockjob.c b/blockjob.c +index 207e8c7fd9..46f15befe8 100644 +--- a/blockjob.c ++++ b/blockjob.c +@@ -87,6 +87,7 @@ void block_job_free(Job *job) + + block_job_remove_all_bdrv(bjob); + blk_unref(bjob->blk); ++ ratelimit_destroy(&bjob->limit); + error_free(bjob->blocker); + } + +@@ -435,6 +436,8 @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver, + assert(job->job.driver->free == &block_job_free); + assert(job->job.driver->user_resume == &block_job_user_resume); + ++ ratelimit_init(&job->limit); ++ + job->blk = blk; + + job->finalize_cancelled_notifier.notify = block_job_event_cancelled; +diff --git a/include/qemu/ratelimit.h b/include/qemu/ratelimit.h +index 01da8d63f1..003ea6d5a3 100644 +--- a/include/qemu/ratelimit.h ++++ b/include/qemu/ratelimit.h +@@ -14,9 +14,11 @@ + #ifndef QEMU_RATELIMIT_H + #define QEMU_RATELIMIT_H + ++#include "qemu/lockable.h" + #include "qemu/timer.h" + + typedef struct { ++ QemuMutex lock; + int64_t slice_start_time; + int64_t slice_end_time; + uint64_t slice_quota; +@@ -40,6 +42,7 @@ static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) + int64_t now = qemu_clock_get_ns(QEMU_CLOCK_REALTIME); + double delay_slices; + ++ QEMU_LOCK_GUARD(&limit->lock); + assert(limit->slice_quota && limit->slice_ns); + + if (limit->slice_end_time < now) { +@@ -65,9 +68,20 @@ static inline int64_t ratelimit_calculate_delay(RateLimit *limit, uint64_t n) + return limit->slice_end_time - now; + } + ++static inline void ratelimit_init(RateLimit *limit) ++{ ++ qemu_mutex_init(&limit->lock); ++} ++ ++static inline void ratelimit_destroy(RateLimit *limit) ++{ ++ qemu_mutex_destroy(&limit->lock); ++} ++ + static inline void ratelimit_set_speed(RateLimit *limit, uint64_t speed, + uint64_t slice_ns) + { ++ QEMU_LOCK_GUARD(&limit->lock); + limit->slice_ns = slice_ns; + limit->slice_quota = MAX(((double)speed * slice_ns) / 1000000000ULL, 1); + } +-- +2.27.0 + diff --git a/SOURCES/kvm-redhat-Define-pseries-rhel8.5.0-machine-type.patch b/SOURCES/kvm-redhat-Define-pseries-rhel8.5.0-machine-type.patch new file mode 100644 index 0000000..eb9f32a --- /dev/null +++ b/SOURCES/kvm-redhat-Define-pseries-rhel8.5.0-machine-type.patch @@ -0,0 +1,67 @@ +From 1194549a01a472b9ce21819cd32fe253d6263cd6 Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Mon, 10 May 2021 15:37:40 -0400 +Subject: [PATCH 08/15] redhat: Define pseries-rhel8.5.0 machine type + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [3/12] accc2ed549b94360bc6ab180c4266466816f122e (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +Note that the compat entries for 8.4.0 were already wired up +in the rhel-8.4.0 machine type. + +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index f9e8dfdfc9..653574ba91 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -5083,6 +5083,19 @@ static void spapr_machine_rhel_default_class_options(MachineClass *mc) + mc->max_cpus = 384; + } + ++/* ++ * pseries-rhel8.5.0 ++ * like pseries-6.0 ++ */ ++ ++static void spapr_machine_rhel850_class_options(MachineClass *mc) ++{ ++ /* The default machine type must apply the RHEL specific defaults */ ++ spapr_machine_rhel_default_class_options(mc); ++} ++ ++DEFINE_SPAPR_MACHINE(rhel850, "rhel8.5.0", true); ++ + /* + * pseries-rhel8.4.0 + * like pseries-5.2 +@@ -5090,13 +5103,12 @@ static void spapr_machine_rhel_default_class_options(MachineClass *mc) + + static void spapr_machine_rhel840_class_options(MachineClass *mc) + { +- /* The default machine type must apply the RHEL specific defaults */ +- spapr_machine_rhel_default_class_options(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", true); ++DEFINE_SPAPR_MACHINE(rhel840, "rhel8.4.0", false); + + /* + * pseries-rhel8.3.0 +-- +2.27.0 + diff --git a/SOURCES/kvm-redhat-Enable-the-test-block-iothread-test-again.patch b/SOURCES/kvm-redhat-Enable-the-test-block-iothread-test-again.patch new file mode 100644 index 0000000..28dce0f --- /dev/null +++ b/SOURCES/kvm-redhat-Enable-the-test-block-iothread-test-again.patch @@ -0,0 +1,43 @@ +From 4231cac75289acd643c2daaa2dece485b958bef1 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Fri, 20 Aug 2021 10:27:12 +0200 +Subject: [PATCH 4/4] redhat: Enable the 'test-block-iothread' test again +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 36: Disable LTO on non-x86 architectures +RH-Commit: [2/2] e010396f3ee0f3f39ff8bcd4749f8ae2e8624980 (thuth/qemu-kvm-cs9) +RH-Bugzilla: 1950192 +RH-Acked-by: Andrew Jones +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Cornelia Huck +RH-Acked-by: Philippe Mathieu-Daudé + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1950192 + +Now that we disabled LTO to fix the coroutines/iothreads on s390x and +aarch64, we can also enable the 'test-block-iothread' test again. + +Signed-off-by: Thomas Huth +--- + tests/unit/meson.build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/unit/meson.build b/tests/unit/meson.build +index 244d35f5d4..b3bc2109da 100644 +--- a/tests/unit/meson.build ++++ b/tests/unit/meson.build +@@ -65,7 +65,7 @@ if have_block + 'test-blockjob': [testblock], + 'test-blockjob-txn': [testblock], + 'test-block-backend': [testblock], +-# 'test-block-iothread': [testblock], ++ 'test-block-iothread': [testblock], + 'test-write-threshold': [testblock], + 'test-crypto-hash': [crypto], + 'test-crypto-hmac': [crypto], +-- +2.27.0 + diff --git a/SOURCES/kvm-redhat-add-missing-entries-in-hw_compat_rhel_8_4.patch b/SOURCES/kvm-redhat-add-missing-entries-in-hw_compat_rhel_8_4.patch new file mode 100644 index 0000000..b70c6de --- /dev/null +++ b/SOURCES/kvm-redhat-add-missing-entries-in-hw_compat_rhel_8_4.patch @@ -0,0 +1,42 @@ +From 8be260b07df50891463e6efbd45f84b1b8323983 Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Mon, 10 May 2021 15:37:39 -0400 +Subject: [PATCH 07/15] redhat: add missing entries in hw_compat_rhel_8_4 + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [2/12] 69b6e4dff872478b6d0b09b2587f55967e1c9740 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +Some entries from hw_compat_5_2 were missing. + +Signed-off-by: Cornelia Huck +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/core/machine.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/hw/core/machine.c b/hw/core/machine.c +index 848e7fdff6..c665e869de 100644 +--- a/hw/core/machine.c ++++ b/hw/core/machine.c +@@ -44,6 +44,10 @@ GlobalProperty hw_compat_rhel_8_4[] = { + { "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 */ ++ { "virtio-net-pci", "vectors", "3"}, + }; + const size_t hw_compat_rhel_8_4_len = G_N_ELEMENTS(hw_compat_rhel_8_4); + +-- +2.27.0 + diff --git a/SOURCES/kvm-redhat-s390x-add-rhel-8.5.0-compat-machine.patch b/SOURCES/kvm-redhat-s390x-add-rhel-8.5.0-compat-machine.patch new file mode 100644 index 0000000..1be8506 --- /dev/null +++ b/SOURCES/kvm-redhat-s390x-add-rhel-8.5.0-compat-machine.patch @@ -0,0 +1,59 @@ +From a5e149c13279386c4fc3fae130289ac4ac53bd3e Mon Sep 17 00:00:00 2001 +From: Cornelia Huck +Date: Mon, 10 May 2021 14:41:31 -0400 +Subject: [PATCH 06/15] redhat: s390x: add rhel-8.5.0 compat machine + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [1/12] 3560ef3f773425f1479a131df7a351df2cbb502c (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +Note that the compat entries for 8.4.0 were already wired up +in the rhel-8.4.0 machine type. + +Signed-off-by: Cornelia Huck +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/s390x/s390-virtio-ccw.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c +index 432f36bce5..667a99f336 100644 +--- a/hw/s390x/s390-virtio-ccw.c ++++ b/hw/s390x/s390-virtio-ccw.c +@@ -1074,15 +1074,26 @@ static void ccw_machine_2_4_class_options(MachineClass *mc) + DEFINE_CCW_MACHINE(2_4, "2.4", false); + #endif + ++static void ccw_machine_rhel850_instance_options(MachineState *machine) ++{ ++} ++ ++static void ccw_machine_rhel850_class_options(MachineClass *mc) ++{ ++} ++DEFINE_CCW_MACHINE(rhel850, "rhel8.5.0", true); ++ + 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", true); ++DEFINE_CCW_MACHINE(rhel840, "rhel8.4.0", false); + + static void ccw_machine_rhel820_instance_options(MachineState *machine) + { +-- +2.27.0 + diff --git a/SOURCES/kvm-redhat-x86-Enable-kvm-asyncpf-int-by-default.patch b/SOURCES/kvm-redhat-x86-Enable-kvm-asyncpf-int-by-default.patch new file mode 100644 index 0000000..7fd2a56 --- /dev/null +++ b/SOURCES/kvm-redhat-x86-Enable-kvm-asyncpf-int-by-default.patch @@ -0,0 +1,49 @@ +From a9546384e1fe8b4dad9ab00c52f45dac3a8fbc00 Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Tue, 8 Jun 2021 10:29:07 -0400 +Subject: [PATCH 04/12] redhat: x86: Enable 'kvm-asyncpf-int' by default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [2/8] 2ea940445291df74dfed2d2f9f2b1f88a3eca31b (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +'kvm-asyncpf-int' feature is supported by KVM starting with RHEL-8.4 +kernel, enable the feature by default starting with RHEL-8.5 machine +type. + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 0a374dec39..cdbfa84d2e 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -366,12 +366,15 @@ GlobalProperty pc_rhel_compat[] = { + { 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_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); + +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-cpumodel-add-3931-and-3932.patch b/SOURCES/kvm-s390x-cpumodel-add-3931-and-3932.patch new file mode 100644 index 0000000..70ad80b --- /dev/null +++ b/SOURCES/kvm-s390x-cpumodel-add-3931-and-3932.patch @@ -0,0 +1,134 @@ +From 5536da8458b7825b084bfc94256bfdc1ca0127a3 Mon Sep 17 00:00:00 2001 +From: Christian Borntraeger +Date: Tue, 22 Jun 2021 22:19:23 +0200 +Subject: [PATCH 1/6] s390x/cpumodel: add 3931 and 3932 + +RH-Author: Cornelia Huck +RH-MergeRequest: 21: s390x/cpumodel: add 3931 and 3932 +RH-Commit: [1/1] b678fdf9364407c615678980330e496676e04f9e (cohuck/qemu-kvm-c9s) +RH-Bugzilla: 1932191 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: David Hildenbrand +RH-Acked-by: Thomas Huth + +This defines 5 new facilities and the new 3931 and 3932 machines. +As before the name is not yet known and we do use gen16a and gen16b. +The new features are part of the full model. + +The default model is still empty (same as z15) and will be added +in a separate patch at a later point in time. + +Also add the dependencies of new facilities and as a fix for z15 add +a dependency from S390_FEAT_VECTOR_PACKED_DECIMAL_ENH to +S390_VECTOR_PACKED_DECIMAL. + +[merged <20210701084348.26556-1-borntraeger@de.ibm.com>] +Signed-off-by: Christian Borntraeger +Message-Id: <20210622201923.150205-2-borntraeger@de.ibm.com> +Reviewed-by: David Hildenbrand +Signed-off-by: Cornelia Huck +(cherry picked from commit fb4a08121695a88acefcbcd86f1376df079eefee) +Signed-off-by: Cornelia Huck +Signed-off-by: Miroslav Rezanina +--- + target/s390x/cpu_features_def.h.inc | 5 +++++ + target/s390x/cpu_models.c | 6 ++++++ + target/s390x/gen-features.c | 14 ++++++++++++++ + 3 files changed, 25 insertions(+) + +diff --git a/target/s390x/cpu_features_def.h.inc b/target/s390x/cpu_features_def.h.inc +index 7db3449e04..e86662bb3b 100644 +--- a/target/s390x/cpu_features_def.h.inc ++++ b/target/s390x/cpu_features_def.h.inc +@@ -109,6 +109,11 @@ DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH, "vxpdeh", STFL, 152, "Vector-Packed-Decimal- + DEF_FEAT(MSA_EXT_9, "msa9-base", STFL, 155, "Message-security-assist-extension-9 facility (excluding subfunctions)") + DEF_FEAT(ETOKEN, "etoken", STFL, 156, "Etoken facility") + DEF_FEAT(UNPACK, "unpack", STFL, 161, "Unpack facility") ++DEF_FEAT(NNPA, "nnpa", STFL, 165, "NNPA facility") ++DEF_FEAT(VECTOR_PACKED_DECIMAL_ENH2, "vxpdeh2", STFL, 192, "Vector-Packed-Decimal-Enhancement facility 2") ++DEF_FEAT(BEAR_ENH, "beareh", STFL, 193, "BEAR-enhancement facility") ++DEF_FEAT(RDP, "rdp", STFL, 194, "Reset-DAT-protection facility") ++DEF_FEAT(PAI, "pai", STFL, 196, "Processor-Activity-Instrumentation facility") + + /* Features exposed via SCLP SCCB Byte 80 - 98 (bit numbers relative to byte-80) */ + DEF_FEAT(SIE_GSLS, "gsls", SCLP_CONF_CHAR, 40, "SIE: Guest-storage-limit-suppression facility") +diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c +index 9254ff46bf..3cb4d25a10 100644 +--- a/target/s390x/cpu_models.c ++++ b/target/s390x/cpu_models.c +@@ -88,6 +88,8 @@ static S390CPUDef s390_cpu_defs[] = { + CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model ZR1 GA1"), + CPUDEF_INIT(0x8561, 15, 1, 47, 0x08000000U, "gen15a", "IBM z15 T01 GA1"), + CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM z15 T02 GA1"), ++ CPUDEF_INIT(0x3931, 16, 1, 47, 0x08000000U, "gen16a", "IBM 3931 GA1"), ++ CPUDEF_INIT(0x3932, 16, 1, 47, 0x08000000U, "gen16b", "IBM 3932 GA1"), + }; + + #define QEMU_MAX_CPU_TYPE 0x2964 +@@ -815,6 +817,8 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_MSA_EXT_9, S390_FEAT_MSA_EXT_4 }, + { S390_FEAT_MULTIPLE_EPOCH, S390_FEAT_TOD_CLOCK_STEERING }, + { S390_FEAT_VECTOR_PACKED_DECIMAL, S390_FEAT_VECTOR }, ++ { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH, S390_FEAT_VECTOR_PACKED_DECIMAL }, ++ { S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, S390_FEAT_VECTOR_PACKED_DECIMAL_ENH }, + { S390_FEAT_VECTOR_ENH, S390_FEAT_VECTOR }, + { S390_FEAT_INSTRUCTION_EXEC_PROT, S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2 }, + { S390_FEAT_SIDE_EFFECT_ACCESS_ESOP2, S390_FEAT_ESOP }, +@@ -846,6 +850,8 @@ static void check_consistency(const S390CPUModel *model) + { S390_FEAT_PTFF_STOUE, S390_FEAT_MULTIPLE_EPOCH }, + { S390_FEAT_AP_QUEUE_INTERRUPT_CONTROL, S390_FEAT_AP }, + { S390_FEAT_DIAG_318, S390_FEAT_EXTENDED_LENGTH_SCCB }, ++ { S390_FEAT_NNPA, S390_FEAT_VECTOR }, ++ { S390_FEAT_RDP, S390_FEAT_LOCAL_TLB_CLEARING }, + }; + int i; + +diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c +index a6ec918e90..8f99cea665 100644 +--- a/target/s390x/gen-features.c ++++ b/target/s390x/gen-features.c +@@ -424,6 +424,8 @@ static uint16_t base_GEN15_GA1[] = { + S390_FEAT_MISC_INSTRUCTION_EXT3, + }; + ++#define base_GEN16_GA1 EmptyFeat ++ + /* Full features (in order of release) + * Automatically includes corresponding base features. + * Full features are all features this hardware supports even if kvm/QEMU do not +@@ -567,6 +569,15 @@ static uint16_t full_GEN15_GA1[] = { + S390_FEAT_UNPACK, + }; + ++static uint16_t full_GEN16_GA1[] = { ++ S390_FEAT_NNPA, ++ S390_FEAT_VECTOR_PACKED_DECIMAL_ENH2, ++ S390_FEAT_BEAR_ENH, ++ S390_FEAT_RDP, ++ S390_FEAT_PAI, ++}; ++ ++ + /* Default features (in order of release) + * Automatically includes corresponding base features. + * Default features are all features this version of QEMU supports for this +@@ -652,6 +663,8 @@ static uint16_t default_GEN15_GA1[] = { + S390_FEAT_ETOKEN, + }; + ++#define default_GEN16_GA1 EmptyFeat ++ + /* QEMU (CPU model) features */ + + static uint16_t qemu_V2_11[] = { +@@ -782,6 +795,7 @@ static CpuFeatDefSpec CpuFeatDef[] = { + CPU_FEAT_INITIALIZER(GEN14_GA1), + CPU_FEAT_INITIALIZER(GEN14_GA2), + CPU_FEAT_INITIALIZER(GEN15_GA1), ++ CPU_FEAT_INITIALIZER(GEN16_GA1), + }; + + #define FEAT_GROUP_INITIALIZER(_name) \ +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-css-Add-passthrough-IRB.patch b/SOURCES/kvm-s390x-css-Add-passthrough-IRB.patch new file mode 100644 index 0000000..339a45c --- /dev/null +++ b/SOURCES/kvm-s390x-css-Add-passthrough-IRB.patch @@ -0,0 +1,127 @@ +From 4eb1f0936bfc921cad9af37f1573075148843b1d Mon Sep 17 00:00:00 2001 +From: Eric Farman +Date: Thu, 24 Jun 2021 14:15:16 -0400 +Subject: [PATCH 04/43] s390x/css: Add passthrough IRB + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Wire in the subchannel callback for building the IRB +ESW and ECW space for passthrough devices, and copy +the hardware's ESW into the IRB we are building. + +If the hardware presented concurrent sense, then copy +that sense data into the IRB's ECW space. + +Signed-off-by: Eric Farman +Message-Id: <20210617232537.1337506-5-farman@linux.ibm.com> +Signed-off-by: Cornelia Huck +(cherry picked from commit c626710fc755628d0d6b88aab0514c9238a84522) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/s390x/css.c | 16 +++++++++++++++- + hw/s390x/s390-ccw.c | 1 + + hw/vfio/ccw.c | 4 ++++ + include/hw/s390x/css.h | 3 +++ + 4 files changed, 23 insertions(+), 1 deletion(-) + +diff --git a/hw/s390x/css.c b/hw/s390x/css.c +index e77a0e523d..c3150da4f7 100644 +--- a/hw/s390x/css.c ++++ b/hw/s390x/css.c +@@ -1336,7 +1336,7 @@ static void copy_schib_to_guest(SCHIB *dest, const SCHIB *src) + } + } + +-static void copy_esw_to_guest(ESW *dest, const ESW *src) ++void copy_esw_to_guest(ESW *dest, const ESW *src) + { + dest->word0 = cpu_to_be32(src->word0); + dest->erw = cpu_to_be32(src->erw); +@@ -1651,6 +1651,20 @@ static void build_irb_sense_data(SubchDev *sch, IRB *irb) + } + } + ++void build_irb_passthrough(SubchDev *sch, IRB *irb) ++{ ++ /* Copy ESW from hardware */ ++ irb->esw = sch->esw; ++ ++ /* ++ * If (irb->esw.erw & ESW_ERW_SENSE) is true, then the contents ++ * of the ECW is sense data. If false, then it is model-dependent ++ * information. Either way, copy it into the IRB for the guest to ++ * read/decide what to do with. ++ */ ++ build_irb_sense_data(sch, irb); ++} ++ + void build_irb_virtual(SubchDev *sch, IRB *irb) + { + SCHIB *schib = &sch->curr_status; +diff --git a/hw/s390x/s390-ccw.c b/hw/s390x/s390-ccw.c +index b497571863..39cbea615b 100644 +--- a/hw/s390x/s390-ccw.c ++++ b/hw/s390x/s390-ccw.c +@@ -125,6 +125,7 @@ static void s390_ccw_realize(S390CCWDevice *cdev, char *sysfsdev, Error **errp) + } + sch->driver_data = cdev; + sch->do_subchannel_work = do_subchannel_work_passthrough; ++ sch->irb_cb = build_irb_passthrough; + + ccw_dev->sch = sch; + ret = css_sch_build_schib(sch, &cdev->hostid); +diff --git a/hw/vfio/ccw.c b/hw/vfio/ccw.c +index b2df708e4b..5f141d44a4 100644 +--- a/hw/vfio/ccw.c ++++ b/hw/vfio/ccw.c +@@ -322,6 +322,7 @@ static void vfio_ccw_io_notifier_handler(void *opaque) + SCHIB *schib = &sch->curr_status; + SCSW s; + IRB irb; ++ ESW esw; + int size; + + if (!event_notifier_test_and_clear(&vcdev->io_notifier)) { +@@ -372,6 +373,9 @@ static void vfio_ccw_io_notifier_handler(void *opaque) + copy_scsw_to_guest(&s, &irb.scsw); + schib->scsw = s; + ++ copy_esw_to_guest(&esw, &irb.esw); ++ sch->esw = esw; ++ + /* If a uint check is pending, copy sense data. */ + if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) && + (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) { +diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h +index 7c23a13f3d..10ed1df1bb 100644 +--- a/include/hw/s390x/css.h ++++ b/include/hw/s390x/css.h +@@ -141,6 +141,7 @@ struct SubchDev { + void (*irb_cb)(SubchDev *, IRB *); + SenseId id; + void *driver_data; ++ ESW esw; + }; + + static inline void sch_gen_unit_exception(SubchDev *sch) +@@ -202,6 +203,7 @@ int css_sch_build_schib(SubchDev *sch, CssDevId *dev_id); + unsigned int css_find_free_chpid(uint8_t cssid); + uint16_t css_build_subchannel_id(SubchDev *sch); + void copy_scsw_to_guest(SCSW *dest, const SCSW *src); ++void copy_esw_to_guest(ESW *dest, const ESW *src); + void css_inject_io_interrupt(SubchDev *sch); + void css_reset(void); + void css_reset_sch(SubchDev *sch); +@@ -216,6 +218,7 @@ void css_clear_sei_pending(void); + IOInstEnding s390_ccw_cmd_request(SubchDev *sch); + IOInstEnding do_subchannel_work_virtual(SubchDev *sub); + IOInstEnding do_subchannel_work_passthrough(SubchDev *sub); ++void build_irb_passthrough(SubchDev *sch, IRB *irb); + void build_irb_virtual(SubchDev *sch, IRB *irb); + + int s390_ccw_halt(SubchDev *sch); +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-css-Introduce-an-ESW-struct.patch b/SOURCES/kvm-s390x-css-Introduce-an-ESW-struct.patch new file mode 100644 index 0000000..de99f03 --- /dev/null +++ b/SOURCES/kvm-s390x-css-Introduce-an-ESW-struct.patch @@ -0,0 +1,111 @@ +From 9a12329325d94ab56dbab976b4423fe7db0e8d0b Mon Sep 17 00:00:00 2001 +From: Eric Farman +Date: Thu, 24 Jun 2021 14:15:13 -0400 +Subject: [PATCH 01/43] s390x/css: Introduce an ESW struct + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +The Interrupt Response Block is comprised of several other +structures concatenated together, but only the 12-byte +Subchannel-Status Word (SCSW) is defined as a proper struct. +Everything else is a simple array of 32-bit words. + +Let's define a proper struct for the 20-byte Extended-Status +Word (ESW) so that we can make good decisions about the sense +data that would go into the ECW area for virtual vs +passthrough devices. + +[CH: adapted ESW definition to build with mingw, as discussed] +Signed-off-by: Eric Farman +Message-Id: <20210617232537.1337506-2-farman@linux.ibm.com> +Signed-off-by: Cornelia Huck +(cherry picked from commit 3fdc622ad79636f3d7f8bed50a53bc28af1850e1) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/s390x/css.c | 19 +++++++++++++------ + include/hw/s390x/ioinst.h | 12 +++++++++++- + 2 files changed, 24 insertions(+), 7 deletions(-) + +diff --git a/hw/s390x/css.c b/hw/s390x/css.c +index 4149b8e5a7..bd3172a688 100644 +--- a/hw/s390x/css.c ++++ b/hw/s390x/css.c +@@ -1336,6 +1336,14 @@ static void copy_schib_to_guest(SCHIB *dest, const SCHIB *src) + } + } + ++static void copy_esw_to_guest(ESW *dest, const ESW *src) ++{ ++ dest->word0 = cpu_to_be32(src->word0); ++ dest->erw = cpu_to_be32(src->erw); ++ dest->word2 = cpu_to_be64(src->word2); ++ dest->word4 = cpu_to_be32(src->word4); ++} ++ + IOInstEnding css_do_stsch(SubchDev *sch, SCHIB *schib) + { + int ret; +@@ -1605,9 +1613,8 @@ static void copy_irb_to_guest(IRB *dest, const IRB *src, const PMCW *pmcw, + + copy_scsw_to_guest(&dest->scsw, &src->scsw); + +- for (i = 0; i < ARRAY_SIZE(dest->esw); i++) { +- dest->esw[i] = cpu_to_be32(src->esw[i]); +- } ++ copy_esw_to_guest(&dest->esw, &src->esw); ++ + for (i = 0; i < ARRAY_SIZE(dest->ecw); i++) { + dest->ecw[i] = cpu_to_be32(src->ecw[i]); + } +@@ -1656,9 +1663,9 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + SCSW_CSTAT_CHN_CTRL_CHK | + SCSW_CSTAT_INTF_CTRL_CHK)) { + irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF; +- irb.esw[0] = 0x04804000; ++ irb.esw.word0 = 0x04804000; + } else { +- irb.esw[0] = 0x00800000; ++ irb.esw.word0 = 0x00800000; + } + /* If a unit check is pending, copy sense data. */ + if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) && +@@ -1671,7 +1678,7 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + for (i = 0; i < ARRAY_SIZE(irb.ecw); i++) { + irb.ecw[i] = be32_to_cpu(irb.ecw[i]); + } +- irb.esw[1] = 0x01000000 | (sizeof(sch->sense_data) << 8); ++ irb.esw.erw = ESW_ERW_SENSE | (sizeof(sch->sense_data) << 8); + } + } + /* Store the irb to the guest. */ +diff --git a/include/hw/s390x/ioinst.h b/include/hw/s390x/ioinst.h +index c6737a30d4..3771fff9d4 100644 +--- a/include/hw/s390x/ioinst.h ++++ b/include/hw/s390x/ioinst.h +@@ -123,10 +123,20 @@ typedef struct SCHIB { + uint8_t mda[4]; + } QEMU_PACKED SCHIB; + ++/* format-0 extended-status word */ ++typedef struct ESW { ++ uint32_t word0; /* subchannel logout for format 0 */ ++ uint32_t erw; ++ uint64_t word2; /* failing-storage address for format 0 */ ++ uint32_t word4; /* secondary-CCW address for format 0 */ ++} QEMU_PACKED ESW; ++ ++#define ESW_ERW_SENSE 0x01000000 ++ + /* interruption response block */ + typedef struct IRB { + SCSW scsw; +- uint32_t esw[5]; ++ ESW esw; + uint32_t ecw[8]; + uint32_t emw[8]; + } IRB; +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-css-Refactor-IRB-construction.patch b/SOURCES/kvm-s390x-css-Refactor-IRB-construction.patch new file mode 100644 index 0000000..f55bf79 --- /dev/null +++ b/SOURCES/kvm-s390x-css-Refactor-IRB-construction.patch @@ -0,0 +1,144 @@ +From 0f4d8c51b51a23a87f1e3e9e764151352f652f3b Mon Sep 17 00:00:00 2001 +From: Eric Farman +Date: Thu, 24 Jun 2021 14:15:15 -0400 +Subject: [PATCH 03/43] s390x/css: Refactor IRB construction + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Currently, all subchannel types have "sense data" copied into +the IRB.ECW space, and a couple flags enabled in the IRB.SCSW +and IRB.ESW. But for passthrough (vfio-ccw) subchannels, +this data isn't populated in the first place, so enabling +those flags leads to unexpected behavior if the guest tries to +process the sense data (zeros) in the IRB.ECW. + +Let's add a subchannel callback that builds these portions of +the IRB, and move the existing code into a routine for those +virtual subchannels. The passthrough subchannels will be able +to piggy-back onto this later. + +Signed-off-by: Eric Farman +Message-Id: <20210617232537.1337506-4-farman@linux.ibm.com> +Signed-off-by: Cornelia Huck +(cherry picked from commit 0599a046acf1b625e97cef0aa702b5d86528c642) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/s390x/3270-ccw.c | 1 + + hw/s390x/css.c | 45 +++++++++++++++++++++++++++--------------- + hw/s390x/virtio-ccw.c | 1 + + include/hw/s390x/css.h | 2 ++ + 4 files changed, 33 insertions(+), 16 deletions(-) + +diff --git a/hw/s390x/3270-ccw.c b/hw/s390x/3270-ccw.c +index f3e7342b1e..9efee591f9 100644 +--- a/hw/s390x/3270-ccw.c ++++ b/hw/s390x/3270-ccw.c +@@ -130,6 +130,7 @@ static void emulated_ccw_3270_realize(DeviceState *ds, Error **errp) + EMULATED_CCW_3270_CHPID_TYPE); + sch->do_subchannel_work = do_subchannel_work_virtual; + sch->ccw_cb = emulated_ccw_3270_cb; ++ sch->irb_cb = build_irb_virtual; + + ck->init(dev, &err); + if (err) { +diff --git a/hw/s390x/css.c b/hw/s390x/css.c +index fac7d5b39d..e77a0e523d 100644 +--- a/hw/s390x/css.c ++++ b/hw/s390x/css.c +@@ -1651,6 +1651,30 @@ static void build_irb_sense_data(SubchDev *sch, IRB *irb) + } + } + ++void build_irb_virtual(SubchDev *sch, IRB *irb) ++{ ++ SCHIB *schib = &sch->curr_status; ++ uint16_t stctl = schib->scsw.ctrl & SCSW_CTRL_MASK_STCTL; ++ ++ if (stctl & SCSW_STCTL_STATUS_PEND) { ++ if (schib->scsw.cstat & (SCSW_CSTAT_DATA_CHECK | ++ SCSW_CSTAT_CHN_CTRL_CHK | ++ SCSW_CSTAT_INTF_CTRL_CHK)) { ++ irb->scsw.flags |= SCSW_FLAGS_MASK_ESWF; ++ irb->esw.word0 = 0x04804000; ++ } else { ++ irb->esw.word0 = 0x00800000; ++ } ++ /* If a unit check is pending, copy sense data. */ ++ if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) && ++ (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) { ++ irb->scsw.flags |= SCSW_FLAGS_MASK_ESWF | SCSW_FLAGS_MASK_ECTL; ++ build_irb_sense_data(sch, irb); ++ irb->esw.erw = ESW_ERW_SENSE | (sizeof(sch->sense_data) << 8); ++ } ++ } ++} ++ + int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + { + SCHIB *schib = &sch->curr_status; +@@ -1669,23 +1693,12 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + + /* Copy scsw from current status. */ + irb.scsw = schib->scsw; +- if (stctl & SCSW_STCTL_STATUS_PEND) { +- if (schib->scsw.cstat & (SCSW_CSTAT_DATA_CHECK | +- SCSW_CSTAT_CHN_CTRL_CHK | +- SCSW_CSTAT_INTF_CTRL_CHK)) { +- irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF; +- irb.esw.word0 = 0x04804000; +- } else { +- irb.esw.word0 = 0x00800000; +- } +- /* If a unit check is pending, copy sense data. */ +- if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) && +- (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) { +- irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF | SCSW_FLAGS_MASK_ECTL; +- build_irb_sense_data(sch, &irb); +- irb.esw.erw = ESW_ERW_SENSE | (sizeof(sch->sense_data) << 8); +- } ++ ++ /* Build other IRB data, if necessary */ ++ if (sch->irb_cb) { ++ sch->irb_cb(sch, &irb); + } ++ + /* Store the irb to the guest. */ + p = schib->pmcw; + copy_irb_to_guest(target_irb, &irb, &p, irb_len); +diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c +index 8195f3546e..5a1eb39325 100644 +--- a/hw/s390x/virtio-ccw.c ++++ b/hw/s390x/virtio-ccw.c +@@ -754,6 +754,7 @@ static void virtio_ccw_device_realize(VirtioCcwDevice *dev, Error **errp) + sch->id.reserved = 0xff; + sch->id.cu_type = VIRTIO_CCW_CU_TYPE; + sch->do_subchannel_work = do_subchannel_work_virtual; ++ sch->irb_cb = build_irb_virtual; + ccw_dev->sch = sch; + dev->indicators = NULL; + dev->revision = -1; +diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h +index bba7593d2e..7c23a13f3d 100644 +--- a/include/hw/s390x/css.h ++++ b/include/hw/s390x/css.h +@@ -138,6 +138,7 @@ struct SubchDev { + int (*ccw_cb) (SubchDev *, CCW1); + void (*disable_cb)(SubchDev *); + IOInstEnding (*do_subchannel_work) (SubchDev *); ++ void (*irb_cb)(SubchDev *, IRB *); + SenseId id; + void *driver_data; + }; +@@ -215,6 +216,7 @@ void css_clear_sei_pending(void); + IOInstEnding s390_ccw_cmd_request(SubchDev *sch); + IOInstEnding do_subchannel_work_virtual(SubchDev *sub); + IOInstEnding do_subchannel_work_passthrough(SubchDev *sub); ++void build_irb_virtual(SubchDev *sch, IRB *irb); + + int s390_ccw_halt(SubchDev *sch); + int s390_ccw_clear(SubchDev *sch); +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-css-Split-out-the-IRB-sense-data.patch b/SOURCES/kvm-s390x-css-Split-out-the-IRB-sense-data.patch new file mode 100644 index 0000000..2c8a3f8 --- /dev/null +++ b/SOURCES/kvm-s390x-css-Split-out-the-IRB-sense-data.patch @@ -0,0 +1,63 @@ +From a987dfced200adf1e4c2d3c39f0b5da0fb7e6ead Mon Sep 17 00:00:00 2001 +From: Eric Farman +Date: Thu, 24 Jun 2021 14:15:14 -0400 +Subject: [PATCH 02/43] s390x/css: Split out the IRB sense data + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Let's move this logic into its own routine, +so it can be reused later. + +Signed-off-by: Eric Farman +Reviewed-by: Thomas Huth +Message-Id: <20210617232537.1337506-3-farman@linux.ibm.com> +Signed-off-by: Cornelia Huck +(cherry picked from commit 1b01dedaed41c2ca6129475c22b7b778b109fae8) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/s390x/css.c | 19 ++++++++++++------- + 1 file changed, 12 insertions(+), 7 deletions(-) + +diff --git a/hw/s390x/css.c b/hw/s390x/css.c +index bd3172a688..fac7d5b39d 100644 +--- a/hw/s390x/css.c ++++ b/hw/s390x/css.c +@@ -1640,6 +1640,17 @@ static void copy_irb_to_guest(IRB *dest, const IRB *src, const PMCW *pmcw, + *irb_len = sizeof(*dest); + } + ++static void build_irb_sense_data(SubchDev *sch, IRB *irb) ++{ ++ int i; ++ ++ /* Attention: sense_data is already BE! */ ++ memcpy(irb->ecw, sch->sense_data, sizeof(sch->sense_data)); ++ for (i = 0; i < ARRAY_SIZE(irb->ecw); i++) { ++ irb->ecw[i] = be32_to_cpu(irb->ecw[i]); ++ } ++} ++ + int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + { + SCHIB *schib = &sch->curr_status; +@@ -1670,14 +1681,8 @@ int css_do_tsch_get_irb(SubchDev *sch, IRB *target_irb, int *irb_len) + /* If a unit check is pending, copy sense data. */ + if ((schib->scsw.dstat & SCSW_DSTAT_UNIT_CHECK) && + (schib->pmcw.chars & PMCW_CHARS_MASK_CSENSE)) { +- int i; +- + irb.scsw.flags |= SCSW_FLAGS_MASK_ESWF | SCSW_FLAGS_MASK_ECTL; +- /* Attention: sense_data is already BE! */ +- memcpy(irb.ecw, sch->sense_data, sizeof(sch->sense_data)); +- for (i = 0; i < ARRAY_SIZE(irb.ecw); i++) { +- irb.ecw[i] = be32_to_cpu(irb.ecw[i]); +- } ++ build_irb_sense_data(sch, &irb); + irb.esw.erw = ESW_ERW_SENSE | (sizeof(sch->sense_data) << 8); + } + } +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x-redhat-disable-experimental-3270-device.patch b/SOURCES/kvm-s390x-redhat-disable-experimental-3270-device.patch new file mode 100644 index 0000000..232da25 --- /dev/null +++ b/SOURCES/kvm-s390x-redhat-disable-experimental-3270-device.patch @@ -0,0 +1,40 @@ +From 5101527fb425c2d17ef04b0ed87b3810cf6db7bc Mon Sep 17 00:00:00 2001 +From: Cornelia Huck +Date: Wed, 26 May 2021 11:01:00 +0200 +Subject: [PATCH] s390x/redhat: disable experimental 3270 device + +RH-Author: Cornelia Huck +RH-MergeRequest: 9: Disable the 'x-terminal3270' device in qemu-kvm on s390x +RH-Commit: [1/1] 1df70e856fba434d06587a05c44c4dc5a367f1f7 (cohuck/qemu-kvm) +RH-Bugzilla: 1962479 +RH-Acked-by: Thomas Huth +RH-Acked-by: David Hildenbrand +RH-Acked-by: Miroslav Rezanina + +The "x-terminal3270" device has been experimental for years, +has known limitations, has no known users anymore, and is not +supported by libvirt. + +Therefore, disable it in our downstream builds, as it is not +really supported. + +Signed-off-by: Cornelia Huck +--- + default-configs/devices/s390x-rh-devices.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/devices/s390x-rh-devices.mak b/default-configs/devices/s390x-rh-devices.mak +index 08a15f3e01..fe8613b8f6 100644 +--- a/default-configs/devices/s390x-rh-devices.mak ++++ b/default-configs/devices/s390x-rh-devices.mak +@@ -6,7 +6,6 @@ CONFIG_S390_FLIC=y + CONFIG_S390_FLIC_KVM=y + CONFIG_SCLPCONSOLE=y + CONFIG_SCSI=y +-CONFIG_TERMINAL3270=y + CONFIG_VFIO=y + CONFIG_VFIO_AP=y + CONFIG_VFIO_CCW=y +-- +2.27.0 + diff --git a/SOURCES/kvm-s390x.conf b/SOURCES/kvm-s390x.conf new file mode 100644 index 0000000..d82b818 --- /dev/null +++ b/SOURCES/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/SOURCES/kvm-scsi-generic-pass-max_segments-via-max_iov-field-in-.patch b/SOURCES/kvm-scsi-generic-pass-max_segments-via-max_iov-field-in-.patch new file mode 100644 index 0000000..612fb9a --- /dev/null +++ b/SOURCES/kvm-scsi-generic-pass-max_segments-via-max_iov-field-in-.patch @@ -0,0 +1,64 @@ +From 05038edf628c6bca7cef061b7b1fac2b0b2163af Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jul 2021 16:51:30 -0400 +Subject: [PATCH 14/43] scsi-generic: pass max_segments via max_iov field in + BlockLimits + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +I/O to a disk via read/write is not limited by the number of segments allowed +by the host adapter; the kernel can split requests if needed, and the limit +imposed by the host adapter can be very low (256k or so) to avoid that SG_IO +returns EINVAL if memory is heavily fragmented. + +Since this value is only interesting for SG_IO-based I/O, do not include +it in the max_transfer and only take it into account when patching the +block limits VPD page in the scsi-generic device. + +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +(cherry picked from commit 01ef8185b809af9d287e1a03a3f9d8ea8231118a) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + block/file-posix.c | 3 +-- + hw/scsi/scsi-generic.c | 6 ++++-- + 2 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/block/file-posix.c b/block/file-posix.c +index 74d4903dc1..1a6c799e19 100644 +--- a/block/file-posix.c ++++ b/block/file-posix.c +@@ -1263,8 +1263,7 @@ static void raw_refresh_limits(BlockDriverState *bs, Error **errp) + + ret = sg_get_max_segments(s->fd); + if (ret > 0) { +- bs->bl.max_transfer = MIN(bs->bl.max_transfer, +- ret * qemu_real_host_page_size); ++ bs->bl.max_iov = ret; + } + } + +diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c +index 98c30c5d5c..82e1e2ee79 100644 +--- a/hw/scsi/scsi-generic.c ++++ b/hw/scsi/scsi-generic.c +@@ -179,10 +179,12 @@ static void scsi_handle_inquiry_reply(SCSIGenericReq *r, SCSIDevice *s) + (r->req.cmd.buf[1] & 0x01)) { + page = r->req.cmd.buf[2]; + if (page == 0xb0) { +- uint32_t max_transfer = +- blk_get_max_transfer(s->conf.blk) / s->blocksize; ++ uint32_t max_transfer = blk_get_max_transfer(s->conf.blk); ++ uint32_t max_iov = blk_get_max_iov(s->conf.blk); + + assert(max_transfer); ++ max_transfer = MIN_NON_ZERO(max_transfer, max_iov * qemu_real_host_page_size) ++ / s->blocksize; + stl_be_p(&r->buf[8], max_transfer); + /* Also take care of the opt xfer len. */ + stl_be_p(&r->buf[12], +-- +2.27.0 + diff --git a/SOURCES/kvm-sockets-update-SOCKET_ADDRESS_TYPE_FD-listen-2-backl.patch b/SOURCES/kvm-sockets-update-SOCKET_ADDRESS_TYPE_FD-listen-2-backl.patch new file mode 100644 index 0000000..75d505c --- /dev/null +++ b/SOURCES/kvm-sockets-update-SOCKET_ADDRESS_TYPE_FD-listen-2-backl.patch @@ -0,0 +1,115 @@ +From 415a6a1ced90cc8b8691eb7ab027bba4611fc236 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Wed, 2 Jun 2021 15:51:02 -0400 +Subject: [PATCH 04/21] sockets: update SOCKET_ADDRESS_TYPE_FD listen(2) + backlog +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [3/8] a8fd97eb477ad51fca75c1cc344185e1de59caf1 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +socket_get_fd() fails with the error "socket_get_fd: too many +connections" if the given listen backlog value is not 1. + +Not all callers set the backlog to 1. For example, commit +582d4210eb2f2ab5baac328fe4b479cd86da1647 ("qemu-nbd: Use SOMAXCONN for +socket listen() backlog") uses SOMAXCONN. This will always fail with in +socket_get_fd(). + +This patch calls listen(2) on the fd to update the backlog value. The +socket may already be in the listen state. I have tested that this works +on Linux 5.10 and macOS Catalina. + +As a bonus this allows us to detect when the fd cannot listen. Now we'll +be able to catch unbound or connected fds in socket_listen(). + +Drop the num argument from socket_get_fd() since this function is also +called by socket_connect() where a listen backlog value does not make +sense. + +Fixes: e5b6353cf25c99c3f08bf51e29933352f7140e8f ("socket: Add backlog parameter to socket_listen") +Reported-by: Richard W.M. Jones +Cc: Juan Quintela +Cc: Eric Blake +Signed-off-by: Stefan Hajnoczi +Message-Id: <20210310173004.420190-1-stefanha@redhat.com> +Tested-by: Richard W.M. Jones +Reviewed-by: Eric Blake +Reviewed-by: Stefano Garzarella +Signed-off-by: Eric Blake +(cherry picked from commit 37179e9ea45d6428b29ae789209c119ac18c1d39) +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + util/qemu-sockets.c | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c +index 8af0278f15..2463c49773 100644 +--- a/util/qemu-sockets.c ++++ b/util/qemu-sockets.c +@@ -1116,14 +1116,10 @@ fail: + return NULL; + } + +-static int socket_get_fd(const char *fdstr, int num, Error **errp) ++static int socket_get_fd(const char *fdstr, Error **errp) + { + Monitor *cur_mon = monitor_cur(); + int fd; +- if (num != 1) { +- error_setg_errno(errp, EINVAL, "socket_get_fd: too many connections"); +- return -1; +- } + if (cur_mon) { + fd = monitor_get_fd(cur_mon, fdstr, errp); + if (fd < 0) { +@@ -1159,7 +1155,7 @@ int socket_connect(SocketAddress *addr, Error **errp) + break; + + case SOCKET_ADDRESS_TYPE_FD: +- fd = socket_get_fd(addr->u.fd.str, 1, errp); ++ fd = socket_get_fd(addr->u.fd.str, errp); + break; + + case SOCKET_ADDRESS_TYPE_VSOCK: +@@ -1187,7 +1183,26 @@ int socket_listen(SocketAddress *addr, int num, Error **errp) + break; + + case SOCKET_ADDRESS_TYPE_FD: +- fd = socket_get_fd(addr->u.fd.str, num, errp); ++ fd = socket_get_fd(addr->u.fd.str, errp); ++ if (fd < 0) { ++ return -1; ++ } ++ ++ /* ++ * If the socket is not yet in the listen state, then transition it to ++ * the listen state now. ++ * ++ * If it's already listening then this updates the backlog value as ++ * requested. ++ * ++ * If this socket cannot listen because it's already in another state ++ * (e.g. unbound or connected) then we'll catch the error here. ++ */ ++ if (listen(fd, num) != 0) { ++ error_setg_errno(errp, errno, "Failed to listen on fd socket"); ++ closesocket(fd); ++ return -1; ++ } + break; + + case SOCKET_ADDRESS_TYPE_VSOCK: +-- +2.27.0 + diff --git a/SOURCES/kvm-spapr-Don-t-hijack-current_machine-boot_order.patch b/SOURCES/kvm-spapr-Don-t-hijack-current_machine-boot_order.patch new file mode 100644 index 0000000..3cc304d --- /dev/null +++ b/SOURCES/kvm-spapr-Don-t-hijack-current_machine-boot_order.patch @@ -0,0 +1,115 @@ +From b859b919acc83ea12c5c5b2991afac47e9532660 Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Thu, 3 Jun 2021 13:29:40 -0400 +Subject: [PATCH 06/21] spapr: Don't hijack current_machine->boot_order +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [5/8] 04822ea86e438f013915cd46e09a33627a640a47 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +From: Greg Kurz + +QEMU 6.0 moved all the -boot variables to the machine. Especially, the +removal of the boot_order static changed the handling of '-boot once' +from: + + if (boot_once) { + qemu_boot_set(boot_once, &error_fatal); + qemu_register_reset(restore_boot_order, g_strdup(boot_order)); + } + +to + + if (current_machine->boot_once) { + qemu_boot_set(current_machine->boot_once, &error_fatal); + qemu_register_reset(restore_boot_order, + g_strdup(current_machine->boot_order)); + } + +This means that we now register as subsequent boot order a copy +of current_machine->boot_once that was just set with the previous +call to qemu_boot_set(), i.e. we never transition away from the +once boot order. + +It is certainly fragile^Wwrong for the spapr code to hijack a +field of the base machine type object like that. The boot order +rework simply turned this software boundary violation into an +actual bug. + +Have the spapr code to handle that with its own field in +SpaprMachineState. Also kfree() the initial boot device +string when "once" was used. + +Fixes: 4b7acd2ac821 ("vl: clean up -boot variables") +Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1960119 +Cc: pbonzini@redhat.com +Signed-off-by: Greg Kurz +Message-Id: <20210521160735.1901914-1-groug@kaod.org> +Signed-off-by: David Gibson +(cherry picked from commit 3bf0844f3be77b24cc8f56fc8df9ff199f8324cb) +Signed-off-by: Greg Kurz + +Conflicts: + include/hw/ppc/spapr.h + +Trivial context conflict because downstream has experimental support +for secure guests (f23e4b5090ba). + +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 8 +++++--- + include/hw/ppc/spapr.h | 3 +++ + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 653574ba91..11db32c537 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1006,7 +1006,7 @@ static void spapr_dt_chosen(SpaprMachineState *spapr, void *fdt, bool reset) + _FDT(chosen = fdt_add_subnode(fdt, 0, "chosen")); + + if (reset) { +- const char *boot_device = machine->boot_order; ++ const char *boot_device = spapr->boot_device; + char *stdout_path = spapr_vio_stdout_path(spapr->vio_bus); + size_t cb = 0; + char *bootlist = get_boot_devices_list(&cb); +@@ -2364,8 +2364,10 @@ static SaveVMHandlers savevm_htab_handlers = { + static void spapr_boot_set(void *opaque, const char *boot_device, + Error **errp) + { +- MachineState *machine = MACHINE(opaque); +- machine->boot_order = g_strdup(boot_device); ++ SpaprMachineState *spapr = SPAPR_MACHINE(opaque); ++ ++ g_free(spapr->boot_device); ++ spapr->boot_device = g_strdup(boot_device); + } + + static void spapr_create_lmb_dr_connectors(SpaprMachineState *spapr) +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index 54cdde8980..6d15066bc3 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -227,6 +227,9 @@ struct SpaprMachineState { + /* Secure Guest support via x-svm-allowed */ + bool svm_allowed; + ++ /* Set by -boot */ ++ char *boot_device; ++ + /*< public >*/ + char *kvm_type; + char *host_model; +-- +2.27.0 + diff --git a/SOURCES/kvm-spapr-Fix-EEH-capability-issue-on-KVM-guest-for-PCI-.patch b/SOURCES/kvm-spapr-Fix-EEH-capability-issue-on-KVM-guest-for-PCI-.patch new file mode 100644 index 0000000..e556d49 --- /dev/null +++ b/SOURCES/kvm-spapr-Fix-EEH-capability-issue-on-KVM-guest-for-PCI-.patch @@ -0,0 +1,160 @@ +From 389b2a01f9b75575996eaab195a9697840ae5f29 Mon Sep 17 00:00:00 2001 +From: Mahesh Salgaonkar +Date: Wed, 30 Jun 2021 13:27:47 -0400 +Subject: [PATCH 2/6] spapr: Fix EEH capability issue on KVM guest for PCI + passthru + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 22: Synchronize with RHEL-AV 8.5 release 23 to RHEL 9 +RH-Commit: [1/5] 86642761bad229c080e180ea9ebd0a4f67d2a4f7 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 + +With upstream kernel, especially after commit 98ba956f6a389 +("powerpc/pseries/eeh: Rework device EEH PE determination") we see that KVM +guest isn't able to enable EEH option for PCI pass-through devices anymore. + +[root@atest-guest ~]# dmesg | grep EEH +[ 0.032337] EEH: pSeries platform initialized +[ 0.298207] EEH: No capable adapters found: recovery disabled. +[root@atest-guest ~]# + +So far the linux kernel was assuming pe_config_addr equal to device's +config_addr and using it to enable EEH on the PE through ibm,set-eeh-option +RTAS call. Which wasn't the correct way as per PAPR. The linux kernel +commit 98ba956f6a389 fixed this flow. With that fixed, linux now uses PE +config address returned by ibm,get-config-addr-info2 RTAS call to enable +EEH option per-PE basis instead of per-device basis. However this has +uncovered a bug in qemu where ibm,set-eeh-option is treating PE config +address as per-device config address. + +Hence in qemu guest with recent kernel the ibm,set-eeh-option RTAS call +fails with -3 return value indicating that there is no PCI device exist for +the specified PE config address. The rtas_ibm_set_eeh_option call uses +pci_find_device() to get the PC device that matches specific bus and devfn +extracted from PE config address passed as argument. Thus it tries to map +the PE config address to a single specific PCI device 'bus->devices[devfn]' +which always results into checking device on slot 0 'bus->devices[0]'. +This succeeds when there is a pass-through device (vfio-pci) present on +slot 0. But in cases where there is no pass-through device present in slot +0, but present in non-zero slots, ibm,set-eeh-option call fails to enable +the EEH capability. + +hw/ppc/spapr_pci_vfio.c: spapr_phb_vfio_eeh_set_option() + case RTAS_EEH_ENABLE: { + PCIHostState *phb; + PCIDevice *pdev; + + /* + * The EEH functionality is enabled on basis of PCI device, + * instead of PE. We need check the validity of the PCI + * device address. + */ + phb = PCI_HOST_BRIDGE(sphb); + pdev = pci_find_device(phb->bus, + (addr >> 16) & 0xFF, (addr >> 8) & 0xFF); + if (!pdev || !object_dynamic_cast(OBJECT(pdev), "vfio-pci")) { + return RTAS_OUT_PARAM_ERROR; + } + +hw/pci/pci.c:pci_find_device() + +PCIDevice *pci_find_device(PCIBus *bus, int bus_num, uint8_t devfn) +{ + bus = pci_find_bus_nr(bus, bus_num); + + if (!bus) + return NULL; + + return bus->devices[devfn]; +} + +This patch fixes ibm,set-eeh-option to check for presence of any PCI device +(vfio-pci) under specified bus and enable the EEH if found. The current +code already makes sure that all the devices on that bus are from same +iommu group (within same PE) and fail very early if it does not. + +After this fix guest is able to find EEH capable devices and enable EEH +recovery on it. + +[root@atest-guest ~]# dmesg | grep EEH +[ 0.048139] EEH: pSeries platform initialized +[ 0.405115] EEH: Capable adapter found: recovery enabled. +[root@atest-guest ~]# + +Reviewed-by: Daniel Henrique Barboza +Signed-off-by: Mahesh Salgaonkar +Message-Id: <162158429107.145117.5843504911924013125.stgit@jupiter> +Signed-off-by: David Gibson +(cherry picked from commit ac9ef668321ebb6eb871a0c4dd380fa7d7891b4e) +Signed-off-by: Daniel Henrique Barboza +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_pci_vfio.c | 40 +++++++++++++++++++++++++++++++++------- + 1 file changed, 33 insertions(+), 7 deletions(-) + +diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c +index e0547b1740..6587c8cb5b 100644 +--- a/hw/ppc/spapr_pci_vfio.c ++++ b/hw/ppc/spapr_pci_vfio.c +@@ -47,6 +47,16 @@ void spapr_phb_vfio_reset(DeviceState *qdev) + spapr_phb_vfio_eeh_reenable(SPAPR_PCI_HOST_BRIDGE(qdev)); + } + ++static void spapr_eeh_pci_find_device(PCIBus *bus, PCIDevice *pdev, ++ void *opaque) ++{ ++ bool *found = opaque; ++ ++ if (object_dynamic_cast(OBJECT(pdev), "vfio-pci")) { ++ *found = true; ++ } ++} ++ + int spapr_phb_vfio_eeh_set_option(SpaprPhbState *sphb, + unsigned int addr, int option) + { +@@ -59,17 +69,33 @@ int spapr_phb_vfio_eeh_set_option(SpaprPhbState *sphb, + break; + case RTAS_EEH_ENABLE: { + PCIHostState *phb; +- PCIDevice *pdev; ++ bool found = false; + + /* +- * The EEH functionality is enabled on basis of PCI device, +- * instead of PE. We need check the validity of the PCI +- * device address. ++ * The EEH functionality is enabled per sphb level instead of ++ * per PCI device. We have already identified this specific sphb ++ * based on buid passed as argument to ibm,set-eeh-option rtas ++ * call. Now we just need to check the validity of the PCI ++ * pass-through devices (vfio-pci) under this sphb bus. ++ * We have already validated that all the devices under this sphb ++ * are from same iommu group (within same PE) before comming here. ++ * ++ * Prior to linux commit 98ba956f6a389 ("powerpc/pseries/eeh: ++ * Rework device EEH PE determination") kernel would call ++ * eeh-set-option for each device in the PE using the device's ++ * config_address as the argument rather than the PE address. ++ * Hence if we check validity of supplied config_addr whether ++ * it matches to this PHB will cause issues with older kernel ++ * versions v5.9 and older. If we return an error from ++ * eeh-set-option when the argument isn't a valid PE address ++ * then older kernels (v5.9 and older) will interpret that as ++ * EEH not being supported. + */ + phb = PCI_HOST_BRIDGE(sphb); +- pdev = pci_find_device(phb->bus, +- (addr >> 16) & 0xFF, (addr >> 8) & 0xFF); +- if (!pdev || !object_dynamic_cast(OBJECT(pdev), "vfio-pci")) { ++ pci_for_each_device(phb->bus, (addr >> 16) & 0xFF, ++ spapr_eeh_pci_find_device, &found); ++ ++ if (!found) { + return RTAS_OUT_PARAM_ERROR; + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-spapr-Remove-stale-comment-about-power-saving-LPCR-b.patch b/SOURCES/kvm-spapr-Remove-stale-comment-about-power-saving-LPCR-b.patch new file mode 100644 index 0000000..4c7c9a1 --- /dev/null +++ b/SOURCES/kvm-spapr-Remove-stale-comment-about-power-saving-LPCR-b.patch @@ -0,0 +1,52 @@ +From 63933b51e447d4acb08d3900ff64d150a3f2bdf8 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 9 Jun 2021 05:58:34 -0400 +Subject: [PATCH 08/21] spapr: Remove stale comment about power-saving LPCR + bits +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [7/8] 12872a0193d22915de5d71d8055094f9f15e63b0 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +From: Nicholas Piggin + +Commit 47a9b551547 ("spapr: Clean up handling of LPCR power-saving exit +bits") moved this logic but did not remove the comment from the +previous location. + +Signed-off-by: Nicholas Piggin +Message-Id: <20210526091626.3388262-2-npiggin@gmail.com> +Reviewed-by: Cédric Le Goater +Reviewed-by: Greg Kurz +Signed-off-by: David Gibson +Signed-off-by: Laurent Vivier +(cherry picked from commit 7be3bf6c8429969f97728bb712d9a99997835607) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_rtas.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c +index 8a79f9c628..91c71d1c94 100644 +--- a/hw/ppc/spapr_rtas.c ++++ b/hw/ppc/spapr_rtas.c +@@ -164,7 +164,6 @@ static void rtas_start_cpu(PowerPCCPU *callcpu, SpaprMachineState *spapr, + + env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME); + +- /* Enable Power-saving mode Exit Cause exceptions for the new CPU */ + lpcr = env->spr[SPR_LPCR]; + if (!pcc->interrupts_big_endian(callcpu)) { + lpcr |= LPCR_ILE; +-- +2.27.0 + diff --git a/SOURCES/kvm-spapr-Set-LPCR-to-current-AIL-mode-when-starting-a-n.patch b/SOURCES/kvm-spapr-Set-LPCR-to-current-AIL-mode-when-starting-a-n.patch new file mode 100644 index 0000000..c30b63e --- /dev/null +++ b/SOURCES/kvm-spapr-Set-LPCR-to-current-AIL-mode-when-starting-a-n.patch @@ -0,0 +1,90 @@ +From 8bb294ea3f26a8ce01ad76c19a6de359dce0c113 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 9 Jun 2021 05:58:35 -0400 +Subject: [PATCH 09/21] spapr: Set LPCR to current AIL mode when starting a new + CPU +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [8/8] 7a1cb27881f93c245ab9e8b8540cbd06d4f8c14f (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +From: Nicholas Piggin + +TCG does not keep track of AIL mode in a central place, it's based on +the current LPCR[AIL] bits. Synchronize the new CPU's LPCR to the +current LPCR in rtas_start_cpu(), similarly to the way the ILE bit is +synchronized. + +Open-code the ILE setting as well now that the caller's LPCR is +available directly, there is no need for the indirection. + +Without this, under both TCG and KVM, adding a POWER8/9/10 class CPU +with a new core ID after a modern Linux has booted results in the new +CPU's LPCR missing the LPCR[AIL]=0b11 setting that the other CPUs have. +This can cause crashes and unexpected behaviour. + +Signed-off-by: Nicholas Piggin +Message-Id: <20210526091626.3388262-3-npiggin@gmail.com> +Reviewed-by: Cédric Le Goater +Reviewed-by: Greg Kurz +Signed-off-by: David Gibson +Signed-off-by: Laurent Vivier +(cherry picked from commit ac559ecbea2649819e7b3fdd09f4e0243e0128db) +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_rtas.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c +index 91c71d1c94..27ab339b0c 100644 +--- a/hw/ppc/spapr_rtas.c ++++ b/hw/ppc/spapr_rtas.c +@@ -133,8 +133,8 @@ static void rtas_start_cpu(PowerPCCPU *callcpu, SpaprMachineState *spapr, + target_ulong id, start, r3; + PowerPCCPU *newcpu; + CPUPPCState *env; +- PowerPCCPUClass *pcc; + target_ulong lpcr; ++ target_ulong caller_lpcr; + + if (nargs != 3 || nret != 1) { + rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); +@@ -153,7 +153,6 @@ static void rtas_start_cpu(PowerPCCPU *callcpu, SpaprMachineState *spapr, + } + + env = &newcpu->env; +- pcc = POWERPC_CPU_GET_CLASS(newcpu); + + if (!CPU(newcpu)->halted) { + rtas_st(rets, 0, RTAS_OUT_HW_ERROR); +@@ -164,10 +163,15 @@ static void rtas_start_cpu(PowerPCCPU *callcpu, SpaprMachineState *spapr, + + env->msr = (1ULL << MSR_SF) | (1ULL << MSR_ME); + ++ caller_lpcr = callcpu->env.spr[SPR_LPCR]; + lpcr = env->spr[SPR_LPCR]; +- if (!pcc->interrupts_big_endian(callcpu)) { +- lpcr |= LPCR_ILE; +- } ++ ++ /* Set ILE the same way */ ++ lpcr = (lpcr & ~LPCR_ILE) | (caller_lpcr & LPCR_ILE); ++ ++ /* Set AIL the same way */ ++ lpcr = (lpcr & ~LPCR_AIL) | (caller_lpcr & LPCR_AIL); ++ + if (env->mmu_model == POWERPC_MMU_3_00) { + /* + * New cpus are expected to start in the same radix/hash mode +-- +2.27.0 + diff --git a/SOURCES/kvm-target-i386-Add-CPU-model-versions-supporting-xsaves.patch b/SOURCES/kvm-target-i386-Add-CPU-model-versions-supporting-xsaves.patch new file mode 100644 index 0000000..bdf810c --- /dev/null +++ b/SOURCES/kvm-target-i386-Add-CPU-model-versions-supporting-xsaves.patch @@ -0,0 +1,322 @@ +From a7752067b45bc05f1127a62e39c38a3361bb1840 Mon Sep 17 00:00:00 2001 +From: Vitaly Kuznetsov +Date: Thu, 3 Jun 2021 14:04:18 -0400 +Subject: [PATCH 07/21] target/i386: Add CPU model versions supporting 'xsaves' +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [6/8] 814973113f19a21d10a90fcbbcd881eef354933d (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +Hyper-V 2016 refuses to boot on Skylake+ CPU models because they lack +'xsaves'/'vmx-xsaves' features and this diverges from real hardware. The +same issue emerges with AMD "EPYC" CPU model prior to version 3 which got +'xsaves' added. EPYC-Rome/EPYC-Milan CPU models have 'xsaves' enabled from +the very beginning so the comment blaming KVM to explain why other CPUs +lack 'xsaves' is likely outdated. + +Signed-off-by: Vitaly Kuznetsov +Message-Id: <20210412073952.860944-1-vkuznets@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 7bde6b18575dd79c26ce1616e0c33151e83d9d7e) + +Conflicts: + target/i386/cpu.c (context, skipping c1826ea6a0520) + +Signed-off-by: Vitaly Kuznetsov +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + target/i386/cpu.c | 150 +++++++++++++++++++++++++++++----------------- + 1 file changed, 94 insertions(+), 56 deletions(-) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index c30bb2a6b0..da47c3e50e 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -2881,12 +2881,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_ERMS | CPUID_7_0_EBX_INVPCID | + CPUID_7_0_EBX_RTM | CPUID_7_0_EBX_RDSEED | CPUID_7_0_EBX_ADX | + CPUID_7_0_EBX_SMAP, +- /* Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 4 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -2962,6 +2957,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ } + } + }, ++ { ++ .version = 4, ++ .note = "IBRS, XSAVES, no TSX", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ } ++ }, + { /* end of list */ } + } + }, +@@ -3001,12 +3005,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_EBX_AVX512VL | CPUID_7_0_EBX_CLFLUSHOPT, + .features[FEAT_7_0_ECX] = + CPUID_7_0_ECX_PKU, +- /* Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 5 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3094,6 +3093,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ } + } + }, ++ { ++ .version = 5, ++ .note = "IBRS, XSAVES, EPT switching, no TSX", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ } ++ }, + { /* end of list */ } + } + }, +@@ -3136,12 +3144,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_ECX_AVX512VNNI, + .features[FEAT_7_0_EDX] = + CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD, +- /* Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 5 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3225,6 +3228,14 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ } + }, + }, ++ { .version = 5, ++ .note = "ARCH_CAPABILITIES, EPT switching, XSAVES, no TSX", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ }, ++ }, + { /* end of list */ } + } + }, +@@ -3274,13 +3285,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + MSR_ARCH_CAP_PSCHANGE_MC_NO | MSR_ARCH_CAP_TAA_NO, + .features[FEAT_7_1_EAX] = + CPUID_7_1_EAX_AVX512_BF16, +- /* +- * Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 2 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3336,6 +3341,18 @@ static X86CPUDefinition builtin_x86_defs[] = { + .features[FEAT_VMX_VMFUNC] = MSR_VMX_VMFUNC_EPT_SWITCHING, + .xlevel = 0x80000008, + .model_id = "Intel Xeon Processor (Cooperlake)", ++ .versions = (X86CPUVersionDefinition[]) { ++ { .version = 1 }, ++ { .version = 2, ++ .note = "XSAVES", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ }, ++ }, ++ { /* end of list */ } ++ } + }, + { + .name = "Icelake-Client", +@@ -3378,12 +3395,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_ECX_AVX512_VPOPCNTDQ, + .features[FEAT_7_0_EDX] = + CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD, +- /* Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 3 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3451,6 +3463,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ } + }, + }, ++ { ++ .version = 3, ++ .note = "no TSX, XSAVES, deprecated", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ }, ++ }, + { /* end of list */ } + }, + .deprecation_note = "use Icelake-Server instead" +@@ -3499,12 +3520,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_ECX_AVX512_VPOPCNTDQ | CPUID_7_0_ECX_LA57, + .features[FEAT_7_0_EDX] = + CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_SPEC_CTRL_SSBD, +- /* Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 5 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3597,6 +3613,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ } + }, + }, ++ { ++ .version = 5, ++ .note = "XSAVES", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ } ++ }, ++ }, + { /* end of list */ } + } + }, +@@ -3631,13 +3656,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + .features[FEAT_7_0_EDX] = + CPUID_7_0_EDX_SPEC_CTRL | CPUID_7_0_EDX_ARCH_CAPABILITIES | + CPUID_7_0_EDX_SPEC_CTRL_SSBD, +- /* +- * Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is added in version 3 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | CPUID_XSAVE_XGETBV1, + .features[FEAT_6_EAX] = +@@ -3704,6 +3723,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ }, + }, + }, ++ { ++ .version = 3, ++ .note = "XSAVES, no MPX, no MONITOR", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ }, ++ }, ++ }, + { /* end of list */ }, + }, + }, +@@ -3762,13 +3790,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_EDX_CORE_CAPABILITY, + .features[FEAT_CORE_CAPABILITY] = + MSR_CORE_CAP_SPLIT_LOCK_DETECT, +- /* +- * Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component, +- * and the only one defined in Skylake (processor tracing) +- * probably will block migration anyway. +- */ ++ /* XSAVES is is added in version 3 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -3833,6 +3855,15 @@ static X86CPUDefinition builtin_x86_defs[] = { + { /* end of list */ }, + }, + }, ++ { ++ .version = 3, ++ .note = "XSAVES, no MPX", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { "vmx-xsaves", "on" }, ++ { /* end of list */ }, ++ }, ++ }, + { /* end of list */ }, + }, + }, +@@ -4114,11 +4145,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 | + CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED | + CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT, +- /* +- * Missing: XSAVES (not supported by some Linux versions, +- * including v4.1 to v4.12). +- * KVM doesn't yet expose any XSAVES state save component. +- */ ++ /* XSAVES is added in version 2 */ + .features[FEAT_XSAVE] = + CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | + CPUID_XSAVE_XGETBV1, +@@ -4129,6 +4156,17 @@ static X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x8000001E, + .model_id = "Hygon Dhyana Processor", + .cache_info = &epyc_cache_info, ++ .versions = (X86CPUVersionDefinition[]) { ++ { .version = 1 }, ++ { .version = 2, ++ .note = "XSAVES", ++ .props = (PropValue[]) { ++ { "xsaves", "on" }, ++ { /* end of list */ } ++ }, ++ }, ++ { /* end of list */ } ++ } + }, + { + .name = "EPYC-Rome", +-- +2.27.0 + diff --git a/SOURCES/kvm-target-i386-sev-add-support-to-query-the-attestation.patch b/SOURCES/kvm-target-i386-sev-add-support-to-query-the-attestation.patch new file mode 100644 index 0000000..fd08786 --- /dev/null +++ b/SOURCES/kvm-target-i386-sev-add-support-to-query-the-attestation.patch @@ -0,0 +1,262 @@ +From ba750c8ed71bc73c79fecefa895192793ef6b7db Mon Sep 17 00:00:00 2001 +From: Connor Kuehl +Date: Wed, 2 Jun 2021 19:39:20 -0400 +Subject: [PATCH 05/21] target/i386/sev: add support to query the attestation + report +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 8: Synchronize with RHEL-AV 8.5 release 19 to RHEL 9 +RH-Commit: [4/8] de6088cb0cd1db779b85a50be87846e967f8c92c (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier +RH-Acked-by: Vitaly Kuznetsov + +From: Brijesh Singh + +The SEV FW >= 0.23 added a new command that can be used to query the +attestation report containing the SHA-256 digest of the guest memory +and VMSA encrypted with the LAUNCH_UPDATE and sign it with the PEK. + +Note, we already have a command (LAUNCH_MEASURE) that can be used to +query the SHA-256 digest of the guest memory encrypted through the +LAUNCH_UPDATE. The main difference between previous and this command +is that the report is signed with the PEK and unlike the LAUNCH_MEASURE +command the ATTESATION_REPORT command can be called while the guest +is running. + +Add a QMP interface "query-sev-attestation-report" that can be used +to get the report encoded in base64. + +Cc: James Bottomley +Cc: Tom Lendacky +Cc: Eric Blake +Cc: Paolo Bonzini +Cc: kvm@vger.kernel.org +Reviewed-by: James Bottomley +Tested-by: James Bottomley +Signed-off-by: Brijesh Singh +Reviewed-by: Connor Kuehl +Message-Id: <20210429170728.24322-1-brijesh.singh@amd.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 3ea1a80243d5b5ba23d8c2b7d3a86034ea0ade22) +Signed-off-by: Connor Kuehl +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + linux-headers/linux/kvm.h | 8 +++++ + qapi/misc-target.json | 38 ++++++++++++++++++++++ + target/i386/monitor.c | 6 ++++ + target/i386/sev-stub.c | 7 ++++ + target/i386/sev.c | 67 +++++++++++++++++++++++++++++++++++++++ + target/i386/sev_i386.h | 2 ++ + target/i386/trace-events | 1 + + 7 files changed, 129 insertions(+) + +diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h +index 020b62a619..897f831374 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -1591,6 +1591,8 @@ enum sev_cmd_id { + KVM_SEV_DBG_ENCRYPT, + /* Guest certificates commands */ + KVM_SEV_CERT_EXPORT, ++ /* Attestation report */ ++ KVM_SEV_GET_ATTESTATION_REPORT, + + KVM_SEV_NR_MAX, + }; +@@ -1643,6 +1645,12 @@ struct kvm_sev_dbg { + __u32 len; + }; + ++struct kvm_sev_attestation_report { ++ __u8 mnonce[16]; ++ __u64 uaddr; ++ __u32 len; ++}; ++ + #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) + #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) + #define KVM_DEV_ASSIGN_MASK_INTX (1 << 2) +diff --git a/qapi/misc-target.json b/qapi/misc-target.json +index 0c7491cd82..4b62f0ac05 100644 +--- a/qapi/misc-target.json ++++ b/qapi/misc-target.json +@@ -285,3 +285,41 @@ + ## + { 'command': 'query-gic-capabilities', 'returns': ['GICCapability'], + 'if': 'defined(TARGET_ARM)' } ++ ++ ++## ++# @SevAttestationReport: ++# ++# The struct describes attestation report for a Secure Encrypted Virtualization ++# feature. ++# ++# @data: guest attestation report (base64 encoded) ++# ++# ++# Since: 6.1 ++## ++{ 'struct': 'SevAttestationReport', ++ 'data': { 'data': 'str'}, ++ 'if': 'defined(TARGET_I386)' } ++ ++## ++# @query-sev-attestation-report: ++# ++# This command is used to get the SEV attestation report, and is supported on AMD ++# X86 platforms only. ++# ++# @mnonce: a random 16 bytes value encoded in base64 (it will be included in report) ++# ++# Returns: SevAttestationReport objects. ++# ++# Since: 6.1 ++# ++# Example: ++# ++# -> { "execute" : "query-sev-attestation-report", "arguments": { "mnonce": "aaaaaaa" } } ++# <- { "return" : { "data": "aaaaaaaabbbddddd"} } ++# ++## ++{ 'command': 'query-sev-attestation-report', 'data': { 'mnonce': 'str' }, ++ 'returns': 'SevAttestationReport', ++ 'if': 'defined(TARGET_I386)' } +diff --git a/target/i386/monitor.c b/target/i386/monitor.c +index 5994408bee..119211f0b0 100644 +--- a/target/i386/monitor.c ++++ b/target/i386/monitor.c +@@ -757,3 +757,9 @@ void qmp_sev_inject_launch_secret(const char *packet_hdr, + + sev_inject_launch_secret(packet_hdr, secret, gpa, errp); + } ++ ++SevAttestationReport * ++qmp_query_sev_attestation_report(const char *mnonce, Error **errp) ++{ ++ return sev_get_attestation_report(mnonce, errp); ++} +diff --git a/target/i386/sev-stub.c b/target/i386/sev-stub.c +index 0207f1c5aa..0227cb5177 100644 +--- a/target/i386/sev-stub.c ++++ b/target/i386/sev-stub.c +@@ -74,3 +74,10 @@ int sev_es_save_reset_vector(void *flash_ptr, uint64_t flash_size) + { + abort(); + } ++ ++SevAttestationReport * ++sev_get_attestation_report(const char *mnonce, Error **errp) ++{ ++ error_setg(errp, "SEV is not available in this QEMU"); ++ return NULL; ++} +diff --git a/target/i386/sev.c b/target/i386/sev.c +index 72b9e2ab40..740548f213 100644 +--- a/target/i386/sev.c ++++ b/target/i386/sev.c +@@ -491,6 +491,73 @@ out: + return cap; + } + ++SevAttestationReport * ++sev_get_attestation_report(const char *mnonce, Error **errp) ++{ ++ struct kvm_sev_attestation_report input = {}; ++ SevAttestationReport *report = NULL; ++ SevGuestState *sev = sev_guest; ++ guchar *data; ++ guchar *buf; ++ gsize len; ++ int err = 0, ret; ++ ++ if (!sev_enabled()) { ++ error_setg(errp, "SEV is not enabled"); ++ return NULL; ++ } ++ ++ /* lets decode the mnonce string */ ++ buf = g_base64_decode(mnonce, &len); ++ if (!buf) { ++ error_setg(errp, "SEV: failed to decode mnonce input"); ++ return NULL; ++ } ++ ++ /* verify the input mnonce length */ ++ if (len != sizeof(input.mnonce)) { ++ error_setg(errp, "SEV: mnonce must be %zu bytes (got %" G_GSIZE_FORMAT ")", ++ sizeof(input.mnonce), len); ++ g_free(buf); ++ return NULL; ++ } ++ ++ /* Query the report length */ ++ ret = sev_ioctl(sev->sev_fd, KVM_SEV_GET_ATTESTATION_REPORT, ++ &input, &err); ++ if (ret < 0) { ++ if (err != SEV_RET_INVALID_LEN) { ++ error_setg(errp, "failed to query the attestation report length " ++ "ret=%d fw_err=%d (%s)", ret, err, fw_error_to_str(err)); ++ g_free(buf); ++ return NULL; ++ } ++ } ++ ++ data = g_malloc(input.len); ++ input.uaddr = (unsigned long)data; ++ memcpy(input.mnonce, buf, sizeof(input.mnonce)); ++ ++ /* Query the report */ ++ ret = sev_ioctl(sev->sev_fd, KVM_SEV_GET_ATTESTATION_REPORT, ++ &input, &err); ++ if (ret) { ++ error_setg_errno(errp, errno, "Failed to get attestation report" ++ " ret=%d fw_err=%d (%s)", ret, err, fw_error_to_str(err)); ++ goto e_free_data; ++ } ++ ++ report = g_new0(SevAttestationReport, 1); ++ report->data = g_base64_encode(data, input.len); ++ ++ trace_kvm_sev_attestation_report(mnonce, report->data); ++ ++e_free_data: ++ g_free(data); ++ g_free(buf); ++ return report; ++} ++ + static int + sev_read_file_base64(const char *filename, guchar **data, gsize *len) + { +diff --git a/target/i386/sev_i386.h b/target/i386/sev_i386.h +index ae221d4c72..ae6d840478 100644 +--- a/target/i386/sev_i386.h ++++ b/target/i386/sev_i386.h +@@ -35,5 +35,7 @@ extern uint32_t sev_get_cbit_position(void); + extern uint32_t sev_get_reduced_phys_bits(void); + extern char *sev_get_launch_measurement(void); + extern SevCapability *sev_get_capabilities(Error **errp); ++extern SevAttestationReport * ++sev_get_attestation_report(const char *mnonce, Error **errp); + + #endif +diff --git a/target/i386/trace-events b/target/i386/trace-events +index a22ab24e21..8d6437404d 100644 +--- a/target/i386/trace-events ++++ b/target/i386/trace-events +@@ -10,3 +10,4 @@ kvm_sev_launch_update_data(void *addr, uint64_t len) "addr %p len 0x%" PRIx64 + kvm_sev_launch_measurement(const char *value) "data %s" + kvm_sev_launch_finish(void) "" + kvm_sev_launch_secret(uint64_t hpa, uint64_t hva, uint64_t secret, int len) "hpa 0x%" PRIx64 " hva 0x%" PRIx64 " data 0x%" PRIx64 " len %d" ++kvm_sev_attestation_report(const char *mnonce, const char *data) "mnonce %s data %s" +-- +2.27.0 + diff --git a/SOURCES/kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch b/SOURCES/kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch new file mode 100644 index 0000000..5295ff8 --- /dev/null +++ b/SOURCES/kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch @@ -0,0 +1,52 @@ +From 2f84739e8f2928b98190f76035e00db82ef6dc7e Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Tue, 14 Sep 2021 13:29:59 +0200 +Subject: [PATCH] tools/virtiofsd: Add fstatfs64 syscall to the seccomp + allowlist +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Thomas Huth +RH-MergeRequest: 37: tools/virtiofsd: Add fstatfs64 syscall to the seccomp allowlist +RH-Commit: [1/1] 464231b7cfa7159d9adfc4fc01b26bc3b3a66ecd +RH-Bugzilla: 2001728 +RH-Acked-by: Daniel P. Berrangé +RH-Acked-by: Cornelia Huck +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Philippe Mathieu-Daudé + +The virtiofsd currently crashes on s390x when doing something like +this in the guest: + + mkdir -p /mnt/myfs + mount -t virtiofs myfs /mnt/myfs + touch /mnt/myfs/foo.txt + stat -f /mnt/myfs/foo.txt + +The problem is that the fstatfs64 syscall is called in this case +from the virtiofsd. We have to put it on the seccomp allowlist to +avoid that the daemon gets killed in this case. + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2001728 +Suggested-by: Vivek Goyal +Signed-off-by: Thomas Huth +--- + tools/virtiofsd/passthrough_seccomp.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/tools/virtiofsd/passthrough_seccomp.c b/tools/virtiofsd/passthrough_seccomp.c +index 62441cfcdb..2edbd3af95 100644 +--- a/tools/virtiofsd/passthrough_seccomp.c ++++ b/tools/virtiofsd/passthrough_seccomp.c +@@ -51,6 +51,7 @@ static const int syscall_allowlist[] = { + SCMP_SYS(fsetxattr), + SCMP_SYS(fstat), + SCMP_SYS(fstatfs), ++ SCMP_SYS(fstatfs64), + SCMP_SYS(fsync), + SCMP_SYS(ftruncate), + SCMP_SYS(futex), +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-Fix-backends-without-multiqueue-support.patch b/SOURCES/kvm-vhost-user-Fix-backends-without-multiqueue-support.patch new file mode 100644 index 0000000..eb08089 --- /dev/null +++ b/SOURCES/kvm-vhost-user-Fix-backends-without-multiqueue-support.patch @@ -0,0 +1,46 @@ +From de25a5f05b76ca99299e09dabe04e7d59b9bed79 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:32 -0400 +Subject: [PATCH 12/43] vhost-user: Fix backends without multiqueue support + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +dev->max_queues was never initialised for backends that don't support +VHOST_USER_PROTOCOL_F_MQ, so it would use 0 as the maximum number of +queues to check against and consequently fail for any such backend. + +Set it to 1 if the backend doesn't have multiqueue support. + +Fixes: c90bd505a3e8210c23d69fecab9ee6f56ec4a161 +Signed-off-by: Kevin Wolf +Message-Id: <20210705171429.29286-1-kwolf@redhat.com> +Reviewed-by: Cornelia Huck +Reviewed-by: Raphael Norwitz +Signed-off-by: Kevin Wolf +(cherry picked from commit 84affad1fd4c5251d7cccf4df43b29e9157983a9) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost-user.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index ee57abe045..53f50adcba 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -1908,7 +1908,10 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque) + if (err < 0) { + return err; + } ++ } else { ++ dev->max_queues = 1; + } ++ + if (dev->num_queues && dev->max_queues < dev->num_queues) { + error_report("The maximum number of queues supported by the " + "backend is %" PRIu64, dev->max_queues); +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Check-that-num-queues-is-supported-by.patch b/SOURCES/kvm-vhost-user-blk-Check-that-num-queues-is-supported-by.patch new file mode 100644 index 0000000..8b466dd --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Check-that-num-queues-is-supported-by.patch @@ -0,0 +1,83 @@ +From f3cec652012b0b5ab1d881f6377719b0984bce63 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:31 -0400 +Subject: [PATCH 11/43] vhost-user-blk: Check that num-queues is supported by + backend + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Creating a device with a number of queues that isn't supported by the +backend is pointless, the device won't work properly and the error +messages are rather confusing. + +Just fail to create the device if num-queues is higher than what the +backend supports. + +Since the relationship between num-queues and the number of virtqueues +depends on the specific device, this is an additional value that needs +to be initialised by the device. For convenience, allow leaving it 0 if +the check should be skipped. This makes sense for vhost-user-net where +separate vhost devices are used for the queues and custom initialisation +code is needed to perform the check. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935031 +Signed-off-by: Kevin Wolf +Reviewed-by: Raphael Norwitz +Message-Id: <20210429171316.162022-7-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Kevin Wolf +(cherry picked from commit c90bd505a3e8210c23d69fecab9ee6f56ec4a161) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 1 + + hw/virtio/vhost-user.c | 5 +++++ + include/hw/virtio/vhost.h | 2 ++ + 3 files changed, 8 insertions(+) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index c7e502f4c7..c6210fad0c 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -324,6 +324,7 @@ static int vhost_user_blk_connect(DeviceState *dev, Error **errp) + } + s->connected = true; + ++ s->dev.num_queues = s->num_queues; + s->dev.nvqs = s->num_queues; + s->dev.vqs = s->vhost_vqs; + s->dev.vq_index = 0; +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index ded0c10453..ee57abe045 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -1909,6 +1909,11 @@ static int vhost_user_backend_init(struct vhost_dev *dev, void *opaque) + return err; + } + } ++ if (dev->num_queues && dev->max_queues < dev->num_queues) { ++ error_report("The maximum number of queues supported by the " ++ "backend is %" PRIu64, dev->max_queues); ++ return -EINVAL; ++ } + + if (virtio_has_feature(features, VIRTIO_F_IOMMU_PLATFORM) && + !(virtio_has_feature(dev->protocol_features, +diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h +index 4a8bc75415..21a9a52088 100644 +--- a/include/hw/virtio/vhost.h ++++ b/include/hw/virtio/vhost.h +@@ -74,6 +74,8 @@ struct vhost_dev { + int nvqs; + /* the first virtqueue which would be used by this vhost dev */ + int vq_index; ++ /* if non-zero, minimum required value for max_queues */ ++ int num_queues; + uint64_t features; + uint64_t acked_features; + uint64_t backend_features; +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Don-t-reconnect-during-initialisation.patch b/SOURCES/kvm-vhost-user-blk-Don-t-reconnect-during-initialisation.patch new file mode 100644 index 0000000..c1b98d8 --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Don-t-reconnect-during-initialisation.patch @@ -0,0 +1,179 @@ +From 5d39cb265db6ea2159662a2d071d340712940d33 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:27 -0400 +Subject: [PATCH 07/43] vhost-user-blk: Don't reconnect during initialisation + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +This is a partial revert of commits 77542d43149 and bc79c87bcde. + +Usually, an error during initialisation means that the configuration was +wrong. Reconnecting won't make the error go away, but just turn the +error condition into an endless loop. Avoid this and return errors +again. + +Additionally, calling vhost_user_blk_disconnect() from the chardev event +handler could result in use-after-free because none of the +initialisation code expects that the device could just go away in the +middle. So removing the call fixes crashes in several places. + +For example, using a num-queues setting that is incompatible with the +backend would result in a crash like this (dereferencing dev->opaque, +which is already NULL): + + #0 0x0000555555d0a4bd in vhost_user_read_cb (source=0x5555568f4690, condition=(G_IO_IN | G_IO_HUP), opaque=0x7fffffffcbf0) at ../hw/virtio/vhost-user.c:313 + #1 0x0000555555d950d3 in qio_channel_fd_source_dispatch (source=0x555557c3f750, callback=0x555555d0a478 , user_data=0x7fffffffcbf0) at ../io/channel-watch.c:84 + #2 0x00007ffff7b32a9f in g_main_context_dispatch () at /lib64/libglib-2.0.so.0 + #3 0x00007ffff7b84a98 in g_main_context_iterate.constprop () at /lib64/libglib-2.0.so.0 + #4 0x00007ffff7b32163 in g_main_loop_run () at /lib64/libglib-2.0.so.0 + #5 0x0000555555d0a724 in vhost_user_read (dev=0x555557bc62f8, msg=0x7fffffffcc50) at ../hw/virtio/vhost-user.c:402 + #6 0x0000555555d0ee6b in vhost_user_get_config (dev=0x555557bc62f8, config=0x555557bc62ac "", config_len=60) at ../hw/virtio/vhost-user.c:2133 + #7 0x0000555555d56d46 in vhost_dev_get_config (hdev=0x555557bc62f8, config=0x555557bc62ac "", config_len=60) at ../hw/virtio/vhost.c:1566 + #8 0x0000555555cdd150 in vhost_user_blk_device_realize (dev=0x555557bc60b0, errp=0x7fffffffcf90) at ../hw/block/vhost-user-blk.c:510 + #9 0x0000555555d08f6d in virtio_device_realize (dev=0x555557bc60b0, errp=0x7fffffffcff0) at ../hw/virtio/virtio.c:3660 + +Note that this removes the ability to reconnect during initialisation +(but not during operation) when there is no permanent error, but the +backend restarts, as the implementation was buggy. This feature can be +added back in a follow-up series after changing error paths to +distinguish cases where retrying could help from cases with permanent +errors. + +Signed-off-by: Kevin Wolf +Message-Id: <20210429171316.162022-3-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Kevin Wolf +(cherry picked from commit dabefdd6abcbc7d858e9413e4734aab2e0b5c8d9) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 59 +++++++++++---------------------------- + 1 file changed, 17 insertions(+), 42 deletions(-) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index 7c85248a7b..c0b9958da1 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -50,6 +50,8 @@ static const int user_feature_bits[] = { + VHOST_INVALID_FEATURE_BIT + }; + ++static void vhost_user_blk_event(void *opaque, QEMUChrEvent event); ++ + static void vhost_user_blk_update_config(VirtIODevice *vdev, uint8_t *config) + { + VHostUserBlk *s = VHOST_USER_BLK(vdev); +@@ -362,19 +364,6 @@ static void vhost_user_blk_disconnect(DeviceState *dev) + vhost_dev_cleanup(&s->dev); + } + +-static void vhost_user_blk_event(void *opaque, QEMUChrEvent event, +- bool realized); +- +-static void vhost_user_blk_event_realize(void *opaque, QEMUChrEvent event) +-{ +- vhost_user_blk_event(opaque, event, false); +-} +- +-static void vhost_user_blk_event_oper(void *opaque, QEMUChrEvent event) +-{ +- vhost_user_blk_event(opaque, event, true); +-} +- + static void vhost_user_blk_chr_closed_bh(void *opaque) + { + DeviceState *dev = opaque; +@@ -382,12 +371,11 @@ static void vhost_user_blk_chr_closed_bh(void *opaque) + VHostUserBlk *s = VHOST_USER_BLK(vdev); + + vhost_user_blk_disconnect(dev); +- qemu_chr_fe_set_handlers(&s->chardev, NULL, NULL, +- vhost_user_blk_event_oper, NULL, opaque, NULL, true); ++ qemu_chr_fe_set_handlers(&s->chardev, NULL, NULL, vhost_user_blk_event, ++ NULL, opaque, NULL, true); + } + +-static void vhost_user_blk_event(void *opaque, QEMUChrEvent event, +- bool realized) ++static void vhost_user_blk_event(void *opaque, QEMUChrEvent event) + { + DeviceState *dev = opaque; + VirtIODevice *vdev = VIRTIO_DEVICE(dev); +@@ -401,17 +389,7 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event, + } + break; + case CHR_EVENT_CLOSED: +- /* +- * Closing the connection should happen differently on device +- * initialization and operation stages. +- * On initalization, we want to re-start vhost_dev initialization +- * from the very beginning right away when the connection is closed, +- * so we clean up vhost_dev on each connection closing. +- * On operation, we want to postpone vhost_dev cleanup to let the +- * other code perform its own cleanup sequence using vhost_dev data +- * (e.g. vhost_dev_set_log). +- */ +- if (realized && !runstate_check(RUN_STATE_SHUTDOWN)) { ++ if (!runstate_check(RUN_STATE_SHUTDOWN)) { + /* + * A close event may happen during a read/write, but vhost + * code assumes the vhost_dev remains setup, so delay the +@@ -431,8 +409,6 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event, + * knowing its type (in this case vhost-user). + */ + s->dev.started = false; +- } else { +- vhost_user_blk_disconnect(dev); + } + break; + case CHR_EVENT_BREAK: +@@ -489,33 +465,32 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + s->vhost_vqs = g_new0(struct vhost_virtqueue, s->num_queues); + s->connected = false; + +- qemu_chr_fe_set_handlers(&s->chardev, NULL, NULL, +- vhost_user_blk_event_realize, NULL, (void *)dev, +- NULL, true); +- +-reconnect: + if (qemu_chr_fe_wait_connected(&s->chardev, errp) < 0) { + goto virtio_err; + } + +- /* check whether vhost_user_blk_connect() failed or not */ +- if (!s->connected) { +- goto reconnect; ++ if (vhost_user_blk_connect(dev) < 0) { ++ error_setg(errp, "vhost-user-blk: could not connect"); ++ qemu_chr_fe_disconnect(&s->chardev); ++ goto virtio_err; + } ++ assert(s->connected); + + ret = vhost_dev_get_config(&s->dev, (uint8_t *)&s->blkcfg, + sizeof(struct virtio_blk_config)); + if (ret < 0) { +- error_report("vhost-user-blk: get block config failed"); +- goto reconnect; ++ error_setg(errp, "vhost-user-blk: get block config failed"); ++ goto vhost_err; + } + +- /* we're fully initialized, now we can operate, so change the handler */ ++ /* we're fully initialized, now we can operate, so add the handler */ + qemu_chr_fe_set_handlers(&s->chardev, NULL, NULL, +- vhost_user_blk_event_oper, NULL, (void *)dev, ++ vhost_user_blk_event, NULL, (void *)dev, + NULL, true); + return; + ++vhost_err: ++ vhost_dev_cleanup(&s->dev); + virtio_err: + g_free(s->vhost_vqs); + s->vhost_vqs = NULL; +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Fail-gracefully-on-too-large-queue-si.patch b/SOURCES/kvm-vhost-user-blk-Fail-gracefully-on-too-large-queue-si.patch new file mode 100644 index 0000000..29d6bd7 --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Fail-gracefully-on-too-large-queue-si.patch @@ -0,0 +1,55 @@ +From bb551b71851c8d5a37b29aae373a99e97885a4df Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:25 -0400 +Subject: [PATCH 05/43] vhost-user-blk: Fail gracefully on too large queue size +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +virtio_add_queue() aborts when queue_size > VIRTQUEUE_MAX_SIZE, so +vhost_user_blk_device_realize() should check this before calling it. + +Simple reproducer: + +qemu-system-x86_64 \ + -chardev null,id=foo \ + -device vhost-user-blk-pci,queue-size=4096,chardev=foo + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935014 +Signed-off-by: Kevin Wolf +Message-Id: <20210413165654.50810-1-kwolf@redhat.com> +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Raphael Norwitz +Reviewed-by: Philippe Mathieu-Daudé +Tested-by: Philippe Mathieu-Daudé +Signed-off-by: Kevin Wolf +(cherry picked from commit 68bf7336533faa6aa90fdd4558edddbf5d8ef814) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index 0b5b9d44cd..f5e9682703 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -467,6 +467,11 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + error_setg(errp, "vhost-user-blk: queue size must be non-zero"); + return; + } ++ if (s->queue_size > VIRTQUEUE_MAX_SIZE) { ++ error_setg(errp, "vhost-user-blk: queue size must not exceed %d", ++ VIRTQUEUE_MAX_SIZE); ++ return; ++ } + + if (!vhost_user_init(&s->vhost_user, &s->chardev, errp)) { + return; +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Get-more-feature-flags-from-vhost-dev.patch b/SOURCES/kvm-vhost-user-blk-Get-more-feature-flags-from-vhost-dev.patch new file mode 100644 index 0000000..310985d --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Get-more-feature-flags-from-vhost-dev.patch @@ -0,0 +1,44 @@ +From 28ab6c187224be79fe02fb1b5037d1c0b300a778 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:29 -0400 +Subject: [PATCH 09/43] vhost-user-blk: Get more feature flags from vhost + device + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +VIRTIO_F_RING_PACKED and VIRTIO_F_IOMMU_PLATFORM need to be supported by +the vhost device, otherwise advertising it to the guest doesn't result +in a working configuration. They are currently not supported by the +vhost-user-blk export in QEMU. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935020 +Signed-off-by: Kevin Wolf +Acked-by: Raphael Norwitz +Message-Id: <20210429171316.162022-5-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Kevin Wolf +(cherry picked from commit 7556a320c98812ca6648b707393f4513387faf73) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index f3a45af97c..c7e502f4c7 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -47,6 +47,8 @@ static const int user_feature_bits[] = { + VIRTIO_RING_F_INDIRECT_DESC, + VIRTIO_RING_F_EVENT_IDX, + VIRTIO_F_NOTIFY_ON_EMPTY, ++ VIRTIO_F_RING_PACKED, ++ VIRTIO_F_IOMMU_PLATFORM, + VHOST_INVALID_FEATURE_BIT + }; + +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Improve-error-reporting-in-realize.patch b/SOURCES/kvm-vhost-user-blk-Improve-error-reporting-in-realize.patch new file mode 100644 index 0000000..e690e2c --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Improve-error-reporting-in-realize.patch @@ -0,0 +1,120 @@ +From a0fcc5faf35fb266dbe45259b79a57ba057e3144 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:28 -0400 +Subject: [PATCH 08/43] vhost-user-blk: Improve error reporting in realize + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Now that vhost_user_blk_connect() is not called from an event handler +any more, but directly from vhost_user_blk_device_realize(), we can +actually make use of Error again instead of calling error_report() in +the inner function and setting a more generic and therefore less useful +error message in realize() itself. + +With Error, the callers are responsible for adding context if necessary +(such as the "-device" option the error refers to). Additional prefixes +are redundant and better omitted. + +Signed-off-by: Kevin Wolf +Acked-by: Raphael Norwitz +Message-Id: <20210429171316.162022-4-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Kevin Wolf +(cherry picked from commit 5b9243d2654adc58ce472d0536a7a177b4fe0f90) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 23 +++++++++++------------ + 1 file changed, 11 insertions(+), 12 deletions(-) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index c0b9958da1..f3a45af97c 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -311,7 +311,7 @@ static void vhost_user_blk_reset(VirtIODevice *vdev) + vhost_dev_free_inflight(s->inflight); + } + +-static int vhost_user_blk_connect(DeviceState *dev) ++static int vhost_user_blk_connect(DeviceState *dev, Error **errp) + { + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VHostUserBlk *s = VHOST_USER_BLK(vdev); +@@ -331,8 +331,7 @@ static int vhost_user_blk_connect(DeviceState *dev) + + ret = vhost_dev_init(&s->dev, &s->vhost_user, VHOST_BACKEND_TYPE_USER, 0); + if (ret < 0) { +- error_report("vhost-user-blk: vhost initialization failed: %s", +- strerror(-ret)); ++ error_setg_errno(errp, -ret, "vhost initialization failed"); + return ret; + } + +@@ -340,8 +339,7 @@ static int vhost_user_blk_connect(DeviceState *dev) + if (virtio_device_started(vdev, vdev->status)) { + ret = vhost_user_blk_start(vdev); + if (ret < 0) { +- error_report("vhost-user-blk: vhost start failed: %s", +- strerror(-ret)); ++ error_setg_errno(errp, -ret, "vhost start failed"); + return ret; + } + } +@@ -380,10 +378,12 @@ static void vhost_user_blk_event(void *opaque, QEMUChrEvent event) + DeviceState *dev = opaque; + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VHostUserBlk *s = VHOST_USER_BLK(vdev); ++ Error *local_err = NULL; + + switch (event) { + case CHR_EVENT_OPENED: +- if (vhost_user_blk_connect(dev) < 0) { ++ if (vhost_user_blk_connect(dev, &local_err) < 0) { ++ error_report_err(local_err); + qemu_chr_fe_disconnect(&s->chardev); + return; + } +@@ -426,7 +426,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + int i, ret; + + if (!s->chardev.chr) { +- error_setg(errp, "vhost-user-blk: chardev is mandatory"); ++ error_setg(errp, "chardev is mandatory"); + return; + } + +@@ -434,16 +434,16 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + s->num_queues = 1; + } + if (!s->num_queues || s->num_queues > VIRTIO_QUEUE_MAX) { +- error_setg(errp, "vhost-user-blk: invalid number of IO queues"); ++ error_setg(errp, "invalid number of IO queues"); + return; + } + + if (!s->queue_size) { +- error_setg(errp, "vhost-user-blk: queue size must be non-zero"); ++ error_setg(errp, "queue size must be non-zero"); + return; + } + if (s->queue_size > VIRTQUEUE_MAX_SIZE) { +- error_setg(errp, "vhost-user-blk: queue size must not exceed %d", ++ error_setg(errp, "queue size must not exceed %d", + VIRTQUEUE_MAX_SIZE); + return; + } +@@ -469,8 +469,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + goto virtio_err; + } + +- if (vhost_user_blk_connect(dev) < 0) { +- error_setg(errp, "vhost-user-blk: could not connect"); ++ if (vhost_user_blk_connect(dev, errp) < 0) { + qemu_chr_fe_disconnect(&s->chardev); + goto virtio_err; + } +-- +2.27.0 + diff --git a/SOURCES/kvm-vhost-user-blk-Make-sure-to-set-Error-on-realize-fai.patch b/SOURCES/kvm-vhost-user-blk-Make-sure-to-set-Error-on-realize-fai.patch new file mode 100644 index 0000000..0bef5dc --- /dev/null +++ b/SOURCES/kvm-vhost-user-blk-Make-sure-to-set-Error-on-realize-fai.patch @@ -0,0 +1,53 @@ +From f90c21b271d88733e604b3645986f8362048b0f0 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:26 -0400 +Subject: [PATCH 06/43] vhost-user-blk: Make sure to set Error on realize + failure + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +We have to set errp before jumping to virtio_err, otherwise the caller +(virtio_device_realize()) will take this as success and crash when it +later tries to access things that we've already freed in the error path. + +Fixes: 77542d431491788d1e8e79d93ce10172ef207775 +Signed-off-by: Kevin Wolf +Message-Id: <20210429171316.162022-2-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Reviewed-by: Eric Blake +Acked-by: Raphael Norwitz +Signed-off-by: Kevin Wolf +(cherry picked from commit f26729715ef21325f972f693607580a829ad1cbb) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/vhost-user-blk.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/hw/block/vhost-user-blk.c b/hw/block/vhost-user-blk.c +index f5e9682703..7c85248a7b 100644 +--- a/hw/block/vhost-user-blk.c ++++ b/hw/block/vhost-user-blk.c +@@ -447,7 +447,6 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + { + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VHostUserBlk *s = VHOST_USER_BLK(vdev); +- Error *err = NULL; + int i, ret; + + if (!s->chardev.chr) { +@@ -495,8 +494,7 @@ static void vhost_user_blk_device_realize(DeviceState *dev, Error **errp) + NULL, true); + + reconnect: +- if (qemu_chr_fe_wait_connected(&s->chardev, &err) < 0) { +- error_report_err(err); ++ if (qemu_chr_fe_wait_connected(&s->chardev, errp) < 0) { + goto virtio_err; + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-Fail-if-iommu_platform-is-requested-but-unsup.patch b/SOURCES/kvm-virtio-Fail-if-iommu_platform-is-requested-but-unsup.patch new file mode 100644 index 0000000..475feb0 --- /dev/null +++ b/SOURCES/kvm-virtio-Fail-if-iommu_platform-is-requested-but-unsup.patch @@ -0,0 +1,53 @@ +From 0834f460b52a1a6b2bc5575ff2e05458d7036257 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jul 2021 10:22:30 -0400 +Subject: [PATCH 10/43] virtio: Fail if iommu_platform is requested, but + unsupported + +RH-Author: Miroslav Rezanina +RH-Bugzilla: 1957194 + +Commit 2943b53f6 (' virtio: force VIRTIO_F_IOMMU_PLATFORM') made sure +that vhost can't just reject VIRTIO_F_IOMMU_PLATFORM when it was +requested. However, just adding it back to the negotiated flags isn't +right either because it promises support to the guest that the device +actually doesn't support. One example of a vhost-user device that +doesn't have support for the flag is the vhost-user-blk export of QEMU. + +Instead of successfully creating a device that doesn't work, just fail +to plug the device when it doesn't support the feature, but it was +requested. This results in much clearer error messages. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935019 +Signed-off-by: Kevin Wolf +Reviewed-by: Raphael Norwitz +Message-Id: <20210429171316.162022-6-kwolf@redhat.com> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Kevin Wolf +(cherry picked from commit 04ceb61a4075fadbf374ef89662c41999da83489) +Signed-off-by: Kevin Wolf +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/virtio-bus.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/virtio/virtio-bus.c b/hw/virtio/virtio-bus.c +index d6332d45c3..859978d248 100644 +--- a/hw/virtio/virtio-bus.c ++++ b/hw/virtio/virtio-bus.c +@@ -69,6 +69,11 @@ void virtio_bus_device_plugged(VirtIODevice *vdev, Error **errp) + return; + } + ++ if (has_iommu && !virtio_host_has_feature(vdev, VIRTIO_F_IOMMU_PLATFORM)) { ++ error_setg(errp, "iommu_platform=true is not supported by the device"); ++ return; ++ } ++ + if (klass->device_plugged != NULL) { + klass->device_plugged(qbus->parent, &local_err); + } +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-blk-Configure-all-host-notifiers-in-a-single-.patch b/SOURCES/kvm-virtio-blk-Configure-all-host-notifiers-in-a-single-.patch new file mode 100644 index 0000000..e670a6c --- /dev/null +++ b/SOURCES/kvm-virtio-blk-Configure-all-host-notifiers-in-a-single-.patch @@ -0,0 +1,107 @@ +From f02134f067150d02d1a74ff5aea151096679492e Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Wed, 26 May 2021 09:03:52 -0400 +Subject: [PATCH 12/15] virtio-blk: Configure all host notifiers in a single MR + transaction + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [9/12] 609631835874ea62dad1ffbd469e83744299ee07 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +This allows the virtio-blk-pci device to batch the setup of all its +host notifiers. This significantly improves boot time of VMs with a +high number of vCPUs, e.g. from 3m26.186s down to 0m58.023s for a +pseries machine with 384 vCPUs. + +Note that memory_region_transaction_commit() must be called before +virtio_bus_cleanup_host_notifier() because the latter might close +ioeventfds that the transaction still assumes to be around when it +commits. + +Signed-off-by: Greg Kurz +Message-Id: <20210407143501.244343-3-groug@kaod.org> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit d0267da614890b8f817364ae25850cdbb580a569) +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/dataplane/virtio-blk.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c +index d7b5c95d26..cd81893d1d 100644 +--- a/hw/block/dataplane/virtio-blk.c ++++ b/hw/block/dataplane/virtio-blk.c +@@ -198,19 +198,30 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) + goto fail_guest_notifiers; + } + ++ memory_region_transaction_begin(); ++ + /* Set up virtqueue notify */ + for (i = 0; i < nvqs; i++) { + r = virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, true); + if (r != 0) { ++ int j = i; ++ + fprintf(stderr, "virtio-blk failed to set host notifier (%d)\n", r); + while (i--) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ } ++ ++ memory_region_transaction_commit(); ++ ++ while (j--) { + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } + goto fail_host_notifiers; + } + } + ++ memory_region_transaction_commit(); ++ + s->starting = false; + vblk->dataplane_started = true; + trace_virtio_blk_data_plane_start(s); +@@ -246,8 +257,15 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) + return 0; + + fail_aio_context: ++ memory_region_transaction_begin(); ++ + for (i = 0; i < nvqs; i++) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ } ++ ++ memory_region_transaction_commit(); ++ ++ for (i = 0; i < nvqs; i++) { + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } + fail_host_notifiers: +@@ -312,8 +330,15 @@ void virtio_blk_data_plane_stop(VirtIODevice *vdev) + + aio_context_release(s->ctx); + ++ memory_region_transaction_begin(); ++ + for (i = 0; i < nvqs; i++) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ } ++ ++ memory_region_transaction_commit(); ++ ++ for (i = 0; i < nvqs; i++) { + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-blk-Fix-rollback-path-in-virtio_blk_data_plan.patch b/SOURCES/kvm-virtio-blk-Fix-rollback-path-in-virtio_blk_data_plan.patch new file mode 100644 index 0000000..d08e1aa --- /dev/null +++ b/SOURCES/kvm-virtio-blk-Fix-rollback-path-in-virtio_blk_data_plan.patch @@ -0,0 +1,83 @@ +From b8febd2f080de1f12e68cc233c68c7a39835a3c4 Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Wed, 26 May 2021 09:03:51 -0400 +Subject: [PATCH 11/15] virtio-blk: Fix rollback path in + virtio_blk_data_plane_start() + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [8/12] 73d05400a537ce1847605dca58aff99e0a905919 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +When dataplane multiqueue support was added in QEMU 2.7, the path +that would rollback guest notifiers assignment in case of error +simply got dropped. + +Later on, when Error was added to blk_set_aio_context() in QEMU 4.1, +another error path was introduced, but it ommits to rollback both +host and guest notifiers. + +It seems cleaner to fix the rollback path in one go. The patch is +simple enough that it can be adjusted if backported to a pre-4.1 +QEMU. + +Fixes: 51b04ac5c6a6 ("virtio-blk: dataplane multiqueue support") +Cc: stefanha@redhat.com +Fixes: 97896a4887a0 ("block: Add Error to blk_set_aio_context()") +Cc: kwolf@redhat.com +Signed-off-by: Greg Kurz +Reviewed-by: Stefan Hajnoczi +Message-Id: <20210407143501.244343-2-groug@kaod.org> +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 570fe439e5d1b8626cf344c6bc97d90cfcaf0c79) +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/block/dataplane/virtio-blk.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c +index e9050c8987..d7b5c95d26 100644 +--- a/hw/block/dataplane/virtio-blk.c ++++ b/hw/block/dataplane/virtio-blk.c +@@ -207,7 +207,7 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } +- goto fail_guest_notifiers; ++ goto fail_host_notifiers; + } + } + +@@ -221,7 +221,7 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) + aio_context_release(old_context); + if (r < 0) { + error_report_err(local_err); +- goto fail_guest_notifiers; ++ goto fail_aio_context; + } + + /* Process queued requests before the ones in vring */ +@@ -245,6 +245,13 @@ int virtio_blk_data_plane_start(VirtIODevice *vdev) + aio_context_release(s->ctx); + return 0; + ++ fail_aio_context: ++ for (i = 0; i < nvqs; i++) { ++ virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); ++ } ++ fail_host_notifiers: ++ k->set_guest_notifiers(qbus->parent, nvqs, false); + fail_guest_notifiers: + /* + * If we failed to set up the guest notifiers queued requests will be +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-gpu-handle-partial-maps-properly.patch b/SOURCES/kvm-virtio-gpu-handle-partial-maps-properly.patch new file mode 100644 index 0000000..4028f08 --- /dev/null +++ b/SOURCES/kvm-virtio-gpu-handle-partial-maps-properly.patch @@ -0,0 +1,201 @@ +From cdc537ada9528e09f8c70219f5a9a1ce8a4efa7e Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Thu, 6 May 2021 11:10:01 +0200 +Subject: [PATCH 02/12] virtio-gpu: handle partial maps properly + +RH-Author: Eric Auger +RH-MergeRequest: 15: virtio-gpu: handle partial maps properly +RH-Commit: [1/1] f2b0fd9758251d1f3a5ff9563911c8bdb4b191f0 (eauger1/centos-qemu-kvm) +RH-Bugzilla: 1974795 +RH-Acked-by: Gavin Shan +RH-Acked-by: Andrew Jones +RH-Acked-by: Peter Xu + +dma_memory_map() may map only a part of the request. Happens if the +request can't be mapped in one go, for example due to a iommu creating +a linear dma mapping for scattered physical pages. Should that be the +case virtio-gpu must call dma_memory_map() again with the remaining +range instead of simply throwing an error. + +Note that this change implies the number of iov entries may differ from +the number of mapping entries sent by the guest. Therefore the iov_len +bookkeeping needs some updates too, we have to explicitly pass around +the iov length now. + +Reported-by: Auger Eric +Signed-off-by: Gerd Hoffmann +Message-id: 20210506091001.1301250-1-kraxel@redhat.com +Reviewed-by: Eric Auger +Tested-by: Eric Auger +Message-Id: <20210506091001.1301250-1-kraxel@redhat.com> +(cherry picked from commit 9049f8bc445d50c0b5fe5500c0ec51fcc821c2ef) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/display/virtio-gpu-3d.c | 7 ++-- + hw/display/virtio-gpu.c | 76 ++++++++++++++++++++-------------- + include/hw/virtio/virtio-gpu.h | 3 +- + 3 files changed, 52 insertions(+), 34 deletions(-) + +diff --git a/hw/display/virtio-gpu-3d.c b/hw/display/virtio-gpu-3d.c +index d98964858e..72c14d9132 100644 +--- a/hw/display/virtio-gpu-3d.c ++++ b/hw/display/virtio-gpu-3d.c +@@ -283,22 +283,23 @@ static void virgl_resource_attach_backing(VirtIOGPU *g, + { + struct virtio_gpu_resource_attach_backing att_rb; + struct iovec *res_iovs; ++ uint32_t res_niov; + int ret; + + VIRTIO_GPU_FILL_CMD(att_rb); + trace_virtio_gpu_cmd_res_back_attach(att_rb.resource_id); + +- ret = virtio_gpu_create_mapping_iov(g, &att_rb, cmd, NULL, &res_iovs); ++ ret = virtio_gpu_create_mapping_iov(g, &att_rb, cmd, NULL, &res_iovs, &res_niov); + if (ret != 0) { + cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; + return; + } + + ret = virgl_renderer_resource_attach_iov(att_rb.resource_id, +- res_iovs, att_rb.nr_entries); ++ res_iovs, res_niov); + + if (ret != 0) +- virtio_gpu_cleanup_mapping_iov(g, res_iovs, att_rb.nr_entries); ++ virtio_gpu_cleanup_mapping_iov(g, res_iovs, res_niov); + } + + static void virgl_resource_detach_backing(VirtIOGPU *g, +diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c +index c9f5e36fd0..6f3791deb3 100644 +--- a/hw/display/virtio-gpu.c ++++ b/hw/display/virtio-gpu.c +@@ -608,11 +608,12 @@ static void virtio_gpu_set_scanout(VirtIOGPU *g, + int virtio_gpu_create_mapping_iov(VirtIOGPU *g, + struct virtio_gpu_resource_attach_backing *ab, + struct virtio_gpu_ctrl_command *cmd, +- uint64_t **addr, struct iovec **iov) ++ uint64_t **addr, struct iovec **iov, ++ uint32_t *niov) + { + struct virtio_gpu_mem_entry *ents; + size_t esize, s; +- int i; ++ int e, v; + + if (ab->nr_entries > 16384) { + qemu_log_mask(LOG_GUEST_ERROR, +@@ -633,37 +634,53 @@ int virtio_gpu_create_mapping_iov(VirtIOGPU *g, + return -1; + } + +- *iov = g_malloc0(sizeof(struct iovec) * ab->nr_entries); ++ *iov = NULL; + if (addr) { +- *addr = g_malloc0(sizeof(uint64_t) * ab->nr_entries); ++ *addr = NULL; + } +- for (i = 0; i < ab->nr_entries; i++) { +- uint64_t a = le64_to_cpu(ents[i].addr); +- uint32_t l = le32_to_cpu(ents[i].length); +- hwaddr len = l; +- (*iov)[i].iov_base = dma_memory_map(VIRTIO_DEVICE(g)->dma_as, +- a, &len, DMA_DIRECTION_TO_DEVICE); +- (*iov)[i].iov_len = len; +- if (addr) { +- (*addr)[i] = a; +- } +- if (!(*iov)[i].iov_base || len != l) { +- qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to map MMIO memory for" +- " resource %d element %d\n", +- __func__, ab->resource_id, i); +- if ((*iov)[i].iov_base) { +- i++; /* cleanup the 'i'th map */ ++ for (e = 0, v = 0; e < ab->nr_entries; e++) { ++ uint64_t a = le64_to_cpu(ents[e].addr); ++ uint32_t l = le32_to_cpu(ents[e].length); ++ hwaddr len; ++ void *map; ++ ++ do { ++ len = l; ++ map = dma_memory_map(VIRTIO_DEVICE(g)->dma_as, ++ a, &len, DMA_DIRECTION_TO_DEVICE); ++ if (!map) { ++ qemu_log_mask(LOG_GUEST_ERROR, "%s: failed to map MMIO memory for" ++ " resource %d element %d\n", ++ __func__, ab->resource_id, e); ++ virtio_gpu_cleanup_mapping_iov(g, *iov, v); ++ g_free(ents); ++ *iov = NULL; ++ if (addr) { ++ g_free(*addr); ++ *addr = NULL; ++ } ++ return -1; ++ } ++ ++ if (!(v % 16)) { ++ *iov = g_realloc(*iov, sizeof(struct iovec) * (v + 16)); ++ if (addr) { ++ *addr = g_realloc(*addr, sizeof(uint64_t) * (v + 16)); ++ } + } +- virtio_gpu_cleanup_mapping_iov(g, *iov, i); +- g_free(ents); +- *iov = NULL; ++ (*iov)[v].iov_base = map; ++ (*iov)[v].iov_len = len; + if (addr) { +- g_free(*addr); +- *addr = NULL; ++ (*addr)[v] = a; + } +- return -1; +- } ++ ++ a += len; ++ l -= len; ++ v += 1; ++ } while (l > 0); + } ++ *niov = v; ++ + g_free(ents); + return 0; + } +@@ -717,13 +734,12 @@ virtio_gpu_resource_attach_backing(VirtIOGPU *g, + return; + } + +- ret = virtio_gpu_create_mapping_iov(g, &ab, cmd, &res->addrs, &res->iov); ++ ret = virtio_gpu_create_mapping_iov(g, &ab, cmd, &res->addrs, ++ &res->iov, &res->iov_cnt); + if (ret != 0) { + cmd->error = VIRTIO_GPU_RESP_ERR_UNSPEC; + return; + } +- +- res->iov_cnt = ab.nr_entries; + } + + static void +diff --git a/include/hw/virtio/virtio-gpu.h b/include/hw/virtio/virtio-gpu.h +index fae149235c..0d15af41d9 100644 +--- a/include/hw/virtio/virtio-gpu.h ++++ b/include/hw/virtio/virtio-gpu.h +@@ -209,7 +209,8 @@ void virtio_gpu_get_edid(VirtIOGPU *g, + int virtio_gpu_create_mapping_iov(VirtIOGPU *g, + struct virtio_gpu_resource_attach_backing *ab, + struct virtio_gpu_ctrl_command *cmd, +- uint64_t **addr, struct iovec **iov); ++ uint64_t **addr, struct iovec **iov, ++ uint32_t *niov); + void virtio_gpu_cleanup_mapping_iov(VirtIOGPU *g, + struct iovec *iov, uint32_t count); + void virtio_gpu_process_cmdq(VirtIOGPU *g); +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-net-failover-add-missing-remove_migration_sta.patch b/SOURCES/kvm-virtio-net-failover-add-missing-remove_migration_sta.patch new file mode 100644 index 0000000..acd5a66 --- /dev/null +++ b/SOURCES/kvm-virtio-net-failover-add-missing-remove_migration_sta.patch @@ -0,0 +1,77 @@ +From 21027e308bf410293a745d4358a848e9aa037df1 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Mon, 10 May 2021 13:08:20 -0400 +Subject: [PATCH 09/15] virtio-net: failover: add missing + remove_migration_state_change_notifier() + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [4/12] 884f0f99fbbba4312663ec6232b1d8c9576df84e (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +In the failover case configuration, virtio_net_device_realize() uses an +add_migration_state_change_notifier() to add a state notifier, but this +notifier is not removed by the unrealize function when the virtio-net +card is unplugged. + +If the card is unplugged and a migration is started, the notifier is +called and as it is not valid anymore QEMU crashes. + +This patch fixes the problem by adding the +remove_migration_state_change_notifier() in virtio_net_device_unrealize(). + +The problem can be reproduced with: + + $ qemu-system-x86_64 -enable-kvm -m 1g -M q35 \ + -device pcie-root-port,slot=4,id=root1 \ + -device pcie-root-port,slot=5,id=root2 \ + -device virtio-net-pci,id=net1,mac=52:54:00:6f:55:cc,failover=on,bus=root1 \ + -monitor stdio disk.qcow2 + (qemu) device_del net1 + (qemu) migrate "exec:gzip -c > STATEFILE.gz" + + Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. + 0x0000000000000000 in ?? () + (gdb) bt + #0 0x0000000000000000 in () + #1 0x0000555555d726d7 in notifier_list_notify (...) + at .../util/notify.c:39 + #2 0x0000555555842c1a in migrate_fd_connect (...) + at .../migration/migration.c:3975 + #3 0x0000555555950f7d in migration_channel_connect (...) + error@entry=0x0) at .../migration/channel.c:107 + #4 0x0000555555910922 in exec_start_outgoing_migration (...) + at .../migration/exec.c:42 + +Reported-by: Igor Mammedov +Reviewed-by: Dr. David Alan Gilbert +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Laurent Vivier +Signed-off-by: Jason Wang +(cherry picked from commit a7eca58380f9589bb1bb6333ccfb58869734edb6) +Signed-off-by: Laurent Vivier +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/net/virtio-net.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 66b9ff4511..914051feb7 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -3373,6 +3373,7 @@ static void virtio_net_device_unrealize(DeviceState *dev) + + if (n->failover) { + device_listener_unregister(&n->primary_listener); ++ remove_migration_state_change_notifier(&n->migration_state); + } + + max_queues = n->multiqueue ? n->max_queues : 1; +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-scsi-Configure-all-host-notifiers-in-a-single.patch b/SOURCES/kvm-virtio-scsi-Configure-all-host-notifiers-in-a-single.patch new file mode 100644 index 0000000..a58b251 --- /dev/null +++ b/SOURCES/kvm-virtio-scsi-Configure-all-host-notifiers-in-a-single.patch @@ -0,0 +1,91 @@ +From 5e7855d3c9d5a59d2c0ac05444428b058ca9abb8 Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Wed, 26 May 2021 09:03:54 -0400 +Subject: [PATCH 14/15] virtio-scsi: Configure all host notifiers in a single + MR transaction + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [11/12] f3c785c4b63aeb3a7b153f2fc17e86c983f98c23 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +This allows the virtio-scsi-pci device to batch the setup of all its +host notifiers. This significantly improves boot time of VMs with a +high number of vCPUs, e.g. from 6m5.563s down to 1m2.884s for a +pseries machine with 384 vCPUs. + +Note that memory_region_transaction_commit() must be called before +virtio_bus_cleanup_host_notifier() because the latter might close +ioeventfds that the transaction still assumes to be around when it +commits. + +Signed-off-by: Greg Kurz +Message-Id: <20210407143501.244343-5-groug@kaod.org> +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit c4f5dcc4360a02085a633fd7a90b7ac395ca1ba4) +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/virtio-scsi-dataplane.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c +index b2cb3d9dcc..28e003250a 100644 +--- a/hw/scsi/virtio-scsi-dataplane.c ++++ b/hw/scsi/virtio-scsi-dataplane.c +@@ -152,6 +152,8 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) + goto fail_guest_notifiers; + } + ++ memory_region_transaction_begin(); ++ + rc = virtio_scsi_set_host_notifier(s, vs->ctrl_vq, 0); + if (rc != 0) { + goto fail_host_notifiers; +@@ -173,6 +175,8 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) + vq_init_count++; + } + ++ memory_region_transaction_commit(); ++ + aio_context_acquire(s->ctx); + virtio_queue_aio_set_host_notifier_handler(vs->ctrl_vq, s->ctx, + virtio_scsi_data_plane_handle_ctrl); +@@ -192,6 +196,11 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) + fail_host_notifiers: + for (i = 0; i < vq_init_count; i++) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ } ++ ++ memory_region_transaction_commit(); ++ ++ for (i = 0; i < vq_init_count; i++) { + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } + k->set_guest_notifiers(qbus->parent, vs->conf.num_queues + 2, false); +@@ -229,8 +238,15 @@ void virtio_scsi_dataplane_stop(VirtIODevice *vdev) + + blk_drain_all(); /* ensure there are no in-flight requests */ + ++ memory_region_transaction_begin(); ++ + for (i = 0; i < vs->conf.num_queues + 2; i++) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); ++ } ++ ++ memory_region_transaction_commit(); ++ ++ for (i = 0; i < vs->conf.num_queues + 2; i++) { + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); + } + +-- +2.27.0 + diff --git a/SOURCES/kvm-virtio-scsi-Set-host-notifiers-and-callbacks-separat.patch b/SOURCES/kvm-virtio-scsi-Set-host-notifiers-and-callbacks-separat.patch new file mode 100644 index 0000000..ab10168 --- /dev/null +++ b/SOURCES/kvm-virtio-scsi-Set-host-notifiers-and-callbacks-separat.patch @@ -0,0 +1,125 @@ +From 0ca53acb7ee0a3b3b72685f47df1fb2466989d6c Mon Sep 17 00:00:00 2001 +From: Greg Kurz +Date: Wed, 26 May 2021 09:03:53 -0400 +Subject: [PATCH 13/15] virtio-scsi: Set host notifiers and callbacks + separately + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 5: Synchronize RHEL-AV 8.5 release 18 to RHEL 9 Beta +RH-Commit: [10/12] 61f873b494c52dc34eb60a705046bfead08532da (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Danilo Cesar Lemes de Paula +RH-Acked-by: Cornelia Huck +RH-Acked-by: Greg Kurz +RH-Acked-by: Laurent Vivier + +Host notifiers are guaranteed to be idle until the callbacks are +hooked up with virtio_queue_aio_set_host_notifier_handler(). They +thus don't need to be set or unset with the AioContext lock held. + +Do this outside the critical section, like virtio-blk already +does : basically downgrading virtio_scsi_vring_init() to only +setup the host notifier and set the callback in the caller. + +This will allow to batch addition/deletion of ioeventds in +a single memory transaction, which is expected to greatly +improve initialization time. + +Signed-off-by: Greg Kurz +Message-Id: <20210407143501.244343-4-groug@kaod.org> +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 61fc57bfc464c3584bd7ab810c86833661f0188c) +Signed-off-by: Greg Kurz +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/virtio-scsi-dataplane.c | 40 ++++++++++++++++++--------------- + 1 file changed, 22 insertions(+), 18 deletions(-) + +diff --git a/hw/scsi/virtio-scsi-dataplane.c b/hw/scsi/virtio-scsi-dataplane.c +index 4ad8793406..b2cb3d9dcc 100644 +--- a/hw/scsi/virtio-scsi-dataplane.c ++++ b/hw/scsi/virtio-scsi-dataplane.c +@@ -94,8 +94,7 @@ static bool virtio_scsi_data_plane_handle_event(VirtIODevice *vdev, + return progress; + } + +-static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n, +- VirtIOHandleAIOOutput fn) ++static int virtio_scsi_set_host_notifier(VirtIOSCSI *s, VirtQueue *vq, int n) + { + BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(s))); + int rc; +@@ -109,7 +108,6 @@ static int virtio_scsi_vring_init(VirtIOSCSI *s, VirtQueue *vq, int n, + return rc; + } + +- virtio_queue_aio_set_host_notifier_handler(vq, s->ctx, fn); + return 0; + } + +@@ -154,38 +152,44 @@ int virtio_scsi_dataplane_start(VirtIODevice *vdev) + goto fail_guest_notifiers; + } + +- aio_context_acquire(s->ctx); +- rc = virtio_scsi_vring_init(s, vs->ctrl_vq, 0, +- virtio_scsi_data_plane_handle_ctrl); +- if (rc) { +- goto fail_vrings; ++ rc = virtio_scsi_set_host_notifier(s, vs->ctrl_vq, 0); ++ if (rc != 0) { ++ goto fail_host_notifiers; + } + + vq_init_count++; +- rc = virtio_scsi_vring_init(s, vs->event_vq, 1, +- virtio_scsi_data_plane_handle_event); +- if (rc) { +- goto fail_vrings; ++ rc = virtio_scsi_set_host_notifier(s, vs->event_vq, 1); ++ if (rc != 0) { ++ goto fail_host_notifiers; + } + + vq_init_count++; ++ + for (i = 0; i < vs->conf.num_queues; i++) { +- rc = virtio_scsi_vring_init(s, vs->cmd_vqs[i], i + 2, +- virtio_scsi_data_plane_handle_cmd); ++ rc = virtio_scsi_set_host_notifier(s, vs->cmd_vqs[i], i + 2); + if (rc) { +- goto fail_vrings; ++ goto fail_host_notifiers; + } + vq_init_count++; + } + ++ aio_context_acquire(s->ctx); ++ virtio_queue_aio_set_host_notifier_handler(vs->ctrl_vq, s->ctx, ++ virtio_scsi_data_plane_handle_ctrl); ++ virtio_queue_aio_set_host_notifier_handler(vs->event_vq, s->ctx, ++ virtio_scsi_data_plane_handle_event); ++ ++ for (i = 0; i < vs->conf.num_queues; i++) { ++ virtio_queue_aio_set_host_notifier_handler(vs->cmd_vqs[i], s->ctx, ++ virtio_scsi_data_plane_handle_cmd); ++ } ++ + s->dataplane_starting = false; + s->dataplane_started = true; + aio_context_release(s->ctx); + return 0; + +-fail_vrings: +- aio_wait_bh_oneshot(s->ctx, virtio_scsi_dataplane_stop_bh, s); +- aio_context_release(s->ctx); ++fail_host_notifiers: + for (i = 0; i < vq_init_count; i++) { + virtio_bus_set_host_notifier(VIRTIO_BUS(qbus), i, false); + virtio_bus_cleanup_host_notifier(VIRTIO_BUS(qbus), i); +-- +2.27.0 + diff --git a/SOURCES/kvm-x86-Add-x86-rhel8.5-machine-types.patch b/SOURCES/kvm-x86-Add-x86-rhel8.5-machine-types.patch new file mode 100644 index 0000000..9100f47 --- /dev/null +++ b/SOURCES/kvm-x86-Add-x86-rhel8.5-machine-types.patch @@ -0,0 +1,130 @@ +From 1497b5d371a63dd20d3b14ca2f8cce99845a1c2c Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 19 May 2021 15:46:27 -0400 +Subject: [PATCH 03/12] x86: Add x86 rhel8.5 machine types +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Miroslav Rezanina +RH-MergeRequest: 16: Synchronize with RHEL-AV 8.5 release 21 to RHEL 9 +RH-Commit: [1/8] db81806d99b545abe4dcba576fb33c02ec283dd7 (mrezanin/centos-src-qemu-kvm) +RH-Bugzilla: 1957194 +RH-Acked-by: Vitaly Kuznetsov +RH-Acked-by: Daniel P. Berrangé + +From: "Dr. David Alan Gilbert" + +Add the 8.5 machine type and the compat entries. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Danilo C. L. de Paula +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc.c | 6 ++++++ + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 24 ++++++++++++++++++++++-- + include/hw/i386/pc.h | 3 +++ + 4 files changed, 33 insertions(+), 2 deletions(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index edc02a68ca..0a374dec39 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -369,6 +369,12 @@ GlobalProperty pc_rhel_compat[] = { + }; + const size_t pc_rhel_compat_len = G_N_ELEMENTS(pc_rhel_compat); + ++GlobalProperty pc_rhel_8_4_compat[] = { ++ /* pc_rhel_8_4_compat from pc_compat_5_2 */ ++ { "ICH9-LPC", "x-smi-cpu-hotunplug", "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" }, +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index d9c5df16d8..5d61c9b833 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -971,6 +971,8 @@ static void pc_machine_rhel760_options(MachineClass *m) + pcmc->pci_root_uid = 1; + 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, +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 44109e4876..01ff3e0544 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -607,6 +607,24 @@ static void pc_q35_machine_rhel_options(MachineClass *m) + compat_props_add(m->compat_props, pc_rhel_compat, pc_rhel_compat_len); + } + ++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_rhel_options(m); ++ m->desc = "RHEL-8.5.0 PC (Q35 + ICH9, 2009)"; ++ pcmc->smbios_stream_product = "RHEL-AV"; ++ pcmc->smbios_stream_version = "8.5.0"; ++} ++ ++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); +@@ -615,12 +633,15 @@ static void pc_q35_init_rhel840(MachineState *machine) + static void pc_q35_machine_rhel840_options(MachineClass *m) + { + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); +- pc_q35_machine_rhel_options(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, +@@ -637,7 +658,6 @@ 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, +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 79a7803a2f..1980c93f41 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -281,6 +281,9 @@ extern const size_t pc_compat_1_4_len; + extern GlobalProperty pc_rhel_compat[]; + extern const size_t pc_rhel_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; + +-- +2.27.0 + diff --git a/SOURCES/kvm-x86.conf b/SOURCES/kvm-x86.conf new file mode 100644 index 0000000..3f7842a --- /dev/null +++ b/SOURCES/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/SOURCES/kvm-yank-Unregister-function-when-using-TLS-migration.patch b/SOURCES/kvm-yank-Unregister-function-when-using-TLS-migration.patch new file mode 100644 index 0000000..1691c50 --- /dev/null +++ b/SOURCES/kvm-yank-Unregister-function-when-using-TLS-migration.patch @@ -0,0 +1,146 @@ +From a722ec5614bbaa36992653250add7dabd39b12ad Mon Sep 17 00:00:00 2001 +From: Leonardo Bras +Date: Tue, 1 Jun 2021 02:40:31 -0300 +Subject: [PATCH 01/21] yank: Unregister function when using TLS migration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Leonardo Brás +RH-MergeRequest: 10: yank: Unregister function when using TLS migration +RH-Commit: [1/1] b39e19a3a92dc7f881527198824ce7f402aa9289 (LeoBras/centos-qemu-kvm) +RH-Bugzilla: 1972462 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Peter Xu > +RH-Acked-by: Dr. David Alan Gilbert + +After yank feature was introduced in migration, whenever migration +is started using TLS, the following error happens in both source and +destination hosts: + +(qemu) qemu-kvm: ../util/yank.c:107: yank_unregister_instance: +Assertion `QLIST_EMPTY(&entry->yankfns)' failed. + +This happens because of a missing yank_unregister_function() when using +qio-channel-tls. + +Fix this by also allowing TYPE_QIO_CHANNEL_TLS object type to perform +yank_unregister_function() in channel_close() and multifd_load_cleanup(). + +Also, inside migration_channel_connect() and +migration_channel_process_incoming() move yank_register_function() so +it only runs once on a TLS migration. + +Fixes: b5eea99ec2f ("migration: Add yank feature", 2021-01-13) +Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1964326 +Signed-off-by: Leonardo Bras +Reviewed-by: Lukas Straub +Reviewed-by: Peter Xu +Message-Id: <20210601054030.1153249-1-leobras.c@gmail.com> + +Signed-off-by: Dr. David Alan Gilbert +(cherry picked from commit 7de2e8565335c13fb3516cddbe2e40e366cce273) +Signed-off-by: Leonardo Bras +Signed-off-by: Miroslav Rezanina +--- + migration/channel.c | 26 ++++++++++++++------------ + migration/multifd.c | 3 ++- + migration/qemu-file-channel.c | 4 +++- + 3 files changed, 19 insertions(+), 14 deletions(-) + +diff --git a/migration/channel.c b/migration/channel.c +index c9ee902021..01275a9162 100644 +--- a/migration/channel.c ++++ b/migration/channel.c +@@ -38,18 +38,19 @@ void migration_channel_process_incoming(QIOChannel *ioc) + trace_migration_set_incoming_channel( + ioc, object_get_typename(OBJECT(ioc))); + +- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) { +- yank_register_function(MIGRATION_YANK_INSTANCE, +- migration_yank_iochannel, +- QIO_CHANNEL(ioc)); +- } +- + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), + TYPE_QIO_CHANNEL_TLS)) { + migration_tls_channel_process_incoming(s, ioc, &local_err); + } else { ++ if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) || ++ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS)) { ++ yank_register_function(MIGRATION_YANK_INSTANCE, ++ migration_yank_iochannel, ++ QIO_CHANNEL(ioc)); ++ } ++ + migration_ioc_process_incoming(ioc, &local_err); + } + +@@ -76,12 +77,6 @@ void migration_channel_connect(MigrationState *s, + ioc, object_get_typename(OBJECT(ioc)), hostname, error); + + if (!error) { +- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET)) { +- yank_register_function(MIGRATION_YANK_INSTANCE, +- migration_yank_iochannel, +- QIO_CHANNEL(ioc)); +- } +- + if (s->parameters.tls_creds && + *s->parameters.tls_creds && + !object_dynamic_cast(OBJECT(ioc), +@@ -99,6 +94,13 @@ void migration_channel_connect(MigrationState *s, + } else { + QEMUFile *f = qemu_fopen_channel_output(ioc); + ++ if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) || ++ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS)) { ++ yank_register_function(MIGRATION_YANK_INSTANCE, ++ migration_yank_iochannel, ++ QIO_CHANNEL(ioc)); ++ } ++ + qemu_mutex_lock(&s->qemu_file_lock); + s->to_dst_file = f; + qemu_mutex_unlock(&s->qemu_file_lock); +diff --git a/migration/multifd.c b/migration/multifd.c +index a6677c45c8..a8dedcf822 100644 +--- a/migration/multifd.c ++++ b/migration/multifd.c +@@ -987,7 +987,8 @@ int multifd_load_cleanup(Error **errp) + for (i = 0; i < migrate_multifd_channels(); i++) { + MultiFDRecvParams *p = &multifd_recv_state->params[i]; + +- if (object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET) ++ if ((object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_SOCKET) || ++ object_dynamic_cast(OBJECT(p->c), TYPE_QIO_CHANNEL_TLS)) + && OBJECT(p->c)->ref == 1) { + yank_unregister_function(MIGRATION_YANK_INSTANCE, + migration_yank_iochannel, +diff --git a/migration/qemu-file-channel.c b/migration/qemu-file-channel.c +index 876d05a540..fad340ea7a 100644 +--- a/migration/qemu-file-channel.c ++++ b/migration/qemu-file-channel.c +@@ -26,6 +26,7 @@ + #include "qemu-file-channel.h" + #include "qemu-file.h" + #include "io/channel-socket.h" ++#include "io/channel-tls.h" + #include "qemu/iov.h" + #include "qemu/yank.h" + #include "yank_functions.h" +@@ -106,7 +107,8 @@ static int channel_close(void *opaque, Error **errp) + int ret; + QIOChannel *ioc = QIO_CHANNEL(opaque); + ret = qio_channel_close(ioc, errp); +- if (object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) ++ if ((object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_SOCKET) || ++ object_dynamic_cast(OBJECT(ioc), TYPE_QIO_CHANNEL_TLS)) + && OBJECT(ioc)->ref == 1) { + yank_unregister_function(MIGRATION_YANK_INSTANCE, + migration_yank_iochannel, +-- +2.27.0 + diff --git a/SOURCES/kvm.conf b/SOURCES/kvm.conf new file mode 100644 index 0000000..24e60e9 --- /dev/null +++ b/SOURCES/kvm.conf @@ -0,0 +1,3 @@ +# +# User changes in this file are preserved across upgrades. +# diff --git a/SOURCES/modules-load.conf b/SOURCES/modules-load.conf new file mode 100644 index 0000000..45b477d --- /dev/null +++ b/SOURCES/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/SOURCES/qemu-ga.sysconfig b/SOURCES/qemu-ga.sysconfig new file mode 100644 index 0000000..67bad0c --- /dev/null +++ b/SOURCES/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 blacklist of RPCs to disable, or empty list to enable all. +# +# You can get the list of RPC commands using "qemu-ga --blacklist='?'". +# There should be no spaces between commas and commands in the blacklist. +BLACKLIST_RPC=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/SOURCES/qemu-guest-agent.service b/SOURCES/qemu-guest-agent.service new file mode 100644 index 0000000..b3157d5 --- /dev/null +++ b/SOURCES/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 \ + --blacklist=${BLACKLIST_RPC} \ + -F${FSFREEZE_HOOK_PATHNAME} +Restart=always +RestartSec=0 + +[Install] +WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device diff --git a/SOURCES/vhost.conf b/SOURCES/vhost.conf new file mode 100644 index 0000000..68d6d7f --- /dev/null +++ b/SOURCES/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 diff --git a/SPECS/qemu-kvm.spec b/SPECS/qemu-kvm.spec new file mode 100644 index 0000000..b9047e9 --- /dev/null +++ b/SPECS/qemu-kvm.spec @@ -0,0 +1,4016 @@ +%global libfdt_version 1.6.0 +%global libseccomp_version 2.4.0 +%global libusbx_version 1.0.23 +%global meson_version 0.55.3-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 0 +%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 + +%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_fdt 1 + %global have_memlock_limits 1 +%endif +%ifarch s390x + %global kvm_target s390x + %global have_modules_load 1 +%endif +%ifarch ppc + %global kvm_target ppc + %global have_fdt 1 +%endif +%ifarch aarch64 + %global kvm_target aarch64 + %global have_fdt 1 +%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 +%global block_drivers_ro_list vmdk,vhdx,vpc,https,ssh +%define qemudocdir %{_docdir}/%{name} +%global firmwaredirs "%{_datadir}/qemu-firmware:%{_datadir}/ipxe/qemu:%{_datadir}/seavgabios:%{_datadir}/seabios:%{_datadir}/sgabios" + +#Versions of various parts: + +%global requires_all_modules \ +%if %{have_opengl} \ +Requires: %{name}-ui-opengl = %{epoch}:%{version}-%{release} \ +%endif \ +%if %{have_usbredir} \ +Requires: %{name}-hw-usbredir = %{epoch}:%{version}-%{release} \ +%endif \ +Requires: %{name}-block-rbd = %{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) +%global obsoletes_some_modules \ +Obsoletes: %{name}-ui-spice <= %{version} \ +Obsoletes: %{name}-block-gluster <= %{version} \ +Obsoletes: %{name}-block-iscsi <= %{version} \ + +# Release candidate version tracking +# global rcver rc4 +%if 0%{?rcver:1} +%global rcrel .%{rcver} +%global rcstr -%{rcver} +%endif + + +Summary: QEMU is a machine emulator and virtualizer +Name: qemu-kvm +Version: 6.0.0 +Release: 13%{?rcrel}%{?dist}%{?cc_suffix}.5 +# 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 + +# KSM control scripts +Source4: ksm.service +Source5: ksm.sysconfig +Source6: ksmctl.c +Source7: ksmtuned.service +Source8: ksmtuned +Source9: ksmtuned.conf +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-globally-limit-the-maximum-number-of-CPUs.patch +Patch0015: 0015-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch +Patch0016: 0016-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch +Patch0017: 0017-BZ1653590-Require-at-least-64kiB-pages-for-downstrea.patch +Patch0018: 0018-block-Versioned-x-blockdev-reopen-API-with-feature-f.patch +# For bz#1906168 - [RHEL-9] qemu-kvm spec-file: Do not BuildRequire spice +Patch19: kvm-Remove-SPICE-and-QXL-from-x86_64-rh-devices.mak.patch +# For bz#1944730 - Remove RHEL7 machine type (s390-ccw-virtio-rhel7.5.0) +Patch20: kvm-hw-s390x-Remove-the-RHEL7-only-machine-type.patch +# For bz#1962479 - Disable the 'x-terminal3270' device in qemu-kvm on s390x +Patch21: kvm-s390x-redhat-disable-experimental-3270-device.patch +# For bz#1952449 - [aarch64] define RHEL9 machine types +Patch22: kvm-arm-virt-Register-highmem-and-gic-version-as-class-p.patch +# For bz#1952449 - [aarch64] define RHEL9 machine types +Patch23: kvm-hw-arm-virt-Add-8.5-and-9.0-machine-types-and-remove.patch +# For bz#1747467 - [aarch64] [qemu] PVPANIC support +Patch24: kvm-aarch64-rh-devices-add-CONFIG_PVPANIC_PCI.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch25: kvm-redhat-s390x-add-rhel-8.5.0-compat-machine.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch26: kvm-redhat-add-missing-entries-in-hw_compat_rhel_8_4.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch27: kvm-redhat-Define-pseries-rhel8.5.0-machine-type.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch28: kvm-virtio-net-failover-add-missing-remove_migration_sta.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch29: kvm-hw-arm-virt-Disable-PL011-clock-migration-through-hw.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch30: kvm-virtio-blk-Fix-rollback-path-in-virtio_blk_data_plan.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch31: kvm-virtio-blk-Configure-all-host-notifiers-in-a-single-.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch32: kvm-virtio-scsi-Set-host-notifiers-and-callbacks-separat.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch33: kvm-virtio-scsi-Configure-all-host-notifiers-in-a-single.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch34: kvm-hw-arm-smmuv3-Another-range-invalidation-fix.patch +# For bz#1972462 - QEMU core dump when doing TLS migration via TCP +Patch35: kvm-yank-Unregister-function-when-using-TLS-migration.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch36: kvm-pc-bios-s390-ccw-don-t-try-to-read-the-next-block-if.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch37: kvm-sockets-update-SOCKET_ADDRESS_TYPE_FD-listen-2-backl.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch38: kvm-target-i386-sev-add-support-to-query-the-attestation.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch39: kvm-spapr-Don-t-hijack-current_machine-boot_order.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch40: kvm-target-i386-Add-CPU-model-versions-supporting-xsaves.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch41: kvm-spapr-Remove-stale-comment-about-power-saving-LPCR-b.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch42: kvm-spapr-Set-LPCR-to-current-AIL-mode-when-starting-a-n.patch +# For bz#1967502 - [aarch64] [qemu] Compile the PCIe expander bridge +Patch43: kvm-aarch64-rh-devices-add-CONFIG_PXB.patch +# For bz#1974795 - [RHEL9-beta] [aarch64] Launch guest with virtio-gpu-pci and virtual smmu causes "virtio_gpu_dequeue_ctrl_func" ERROR +Patch44: kvm-virtio-gpu-handle-partial-maps-properly.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch45: kvm-x86-Add-x86-rhel8.5-machine-types.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch46: kvm-redhat-x86-Enable-kvm-asyncpf-int-by-default.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch47: kvm-block-backend-add-drained_poll.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch48: kvm-nbd-server-Use-drained-block-ops-to-quiesce-the-serv.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch49: kvm-disable-CONFIG_USB_STORAGE_BOT.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch50: kvm-doc-Fix-some-mistakes-in-the-SEV-documentation.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch51: kvm-docs-Add-SEV-ES-documentation-to-amd-memory-encrypti.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch52: kvm-docs-interop-firmware.json-Add-SEV-ES-support.patch +# For bz#1978911 - Remove TPM Passthrough option from RHEL 9 +Patch53: kvm-Disable-TPM-passthrough.patch +# For bz#1932191 - [IBM 9.0 FEAT] CPU Model for new IBM Z Hardware - qemu part (kvm) +Patch54: kvm-s390x-cpumodel-add-3931-and-3932.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch55: kvm-spapr-Fix-EEH-capability-issue-on-KVM-guest-for-PCI-.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch56: kvm-ppc-pef.c-initialize-cgs-ready-in-kvmppc_svm_init.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch57: kvm-s390x-css-Introduce-an-ESW-struct.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch58: kvm-s390x-css-Split-out-the-IRB-sense-data.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch59: kvm-s390x-css-Refactor-IRB-construction.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch60: kvm-s390x-css-Add-passthrough-IRB.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch61: kvm-vhost-user-blk-Fail-gracefully-on-too-large-queue-si.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch62: kvm-vhost-user-blk-Make-sure-to-set-Error-on-realize-fai.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch63: kvm-vhost-user-blk-Don-t-reconnect-during-initialisation.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch64: kvm-vhost-user-blk-Improve-error-reporting-in-realize.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch65: kvm-vhost-user-blk-Get-more-feature-flags-from-vhost-dev.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch66: kvm-virtio-Fail-if-iommu_platform-is-requested-but-unsup.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch67: kvm-vhost-user-blk-Check-that-num-queues-is-supported-by.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch68: kvm-vhost-user-Fix-backends-without-multiqueue-support.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch69: kvm-file-posix-fix-max_iov-for-dev-sg-devices.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch70: kvm-scsi-generic-pass-max_segments-via-max_iov-field-in-.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch71: kvm-osdep-provide-ROUND_DOWN-macro.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch72: kvm-block-backend-align-max_transfer-to-request-alignmen.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch73: kvm-block-add-max_hw_transfer-to-BlockLimits.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch74: kvm-file-posix-try-BLKSECTGET-on-block-devices-too-do-no.patch +# For bz#1957782 - VMDK support should be read-only +Patch75: kvm-block-Add-option-to-use-driver-whitelist-even-in-too.patch +# For bz#1838608 - aarch64: Enable ARMv8 RAS virtualization support +Patch76: kvm-arm-virt-Register-iommu-as-a-class-property.patch +# For bz#1838608 - aarch64: Enable ARMv8 RAS virtualization support +Patch77: kvm-arm-virt-Register-its-as-a-class-property.patch +# For bz#1838608 - aarch64: Enable ARMv8 RAS virtualization support +Patch78: kvm-arm-virt-Enable-ARM-RAS-support.patch +# For bz#1972079 - Windows Installation blocked on 4k disk when using blk+raw+iothread +Patch79: kvm-block-Fix-in_flight-leak-in-request-padding-error-pa.patch +# For bz#1974683 - Fail to set migrate incoming for 2nd time after the first time failed +Patch80: kvm-migration-Move-yank-outside-qemu_start_incoming_migr.patch +# For bz#1974683 - Fail to set migrate incoming for 2nd time after the first time failed +Patch81: kvm-migration-Allow-reset-of-postcopy_recover_triggered-.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch82: kvm-Remove-RHEL-7.0.0-machine-type.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch83: kvm-Remove-RHEL-7.1.0-machine-type.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch84: kvm-Remove-RHEL-7.2.0-machine-type.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch85: kvm-Remove-RHEL-7.3.0-machine-types.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch86: kvm-Remove-RHEL-7.4.0-machine-types.patch +# For bz#1968519 - Remove all the old 7.0-7.5 machine types +Patch87: kvm-Remove-RHEL-7.5.0-machine-types.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch88: kvm-acpi-pc-revert-back-to-v5.2-PCI-slot-enumeration.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch89: kvm-migration-failover-reset-partially_hotplugged.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch90: kvm-hmp-Fix-loadvm-to-resume-the-VM-on-success-instead-o.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch91: kvm-migration-Move-bitmap_mutex-out-of-migration_bitmap_.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch92: kvm-i386-cpu-Expose-AVX_VNNI-instruction-to-guest.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch93: kvm-ratelimit-protect-with-a-mutex.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch94: kvm-Update-Linux-headers-to-5.13-rc4.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch95: kvm-i386-Add-ratelimit-for-bus-locks-acquired-in-guest.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch96: kvm-iothread-generalize-iothread_set_param-iothread_get_.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch97: kvm-iothread-add-aio-max-batch-parameter.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch98: kvm-linux-aio-limit-the-batch-size-using-aio-max-batch-p.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch99: kvm-block-nvme-Fix-VFIO_MAP_DMA-failed-No-space-left-on-.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch100: kvm-migration-move-wait-unplug-loop-to-its-own-function.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch101: kvm-migration-failover-continue-to-wait-card-unplug-on-e.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch102: kvm-aarch64-Add-USB-storage-devices.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch103: kvm-iotests-Improve-and-rename-test-291-to-qemu-img-bitm.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch104: kvm-qemu-img-Fail-fast-on-convert-bitmaps-with-inconsist.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch105: kvm-qemu-img-Add-skip-broken-bitmaps-for-convert-bitmaps.patch +# For bz#1957194 - Synchronize RHEL-AV 8.5.0 changes to RHEL 9.0.0 Beta +Patch106: kvm-audio-Never-send-migration-section.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch107: kvm-pc-bios-s390-ccw-bootmap-Silence-compiler-warning-fr.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch108: kvm-pc-bios-s390-ccw-Use-reset_psw-pointer-instead-of-ha.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch109: kvm-pc-bios-s390-ccw-netboot-Use-Wl-prefix-to-pass-param.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch110: kvm-pc-bios-s390-ccw-Silence-warning-from-Clang-by-marki.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch111: kvm-pc-bios-s390-ccw-Fix-the-cc-option-macro-in-the-Make.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch112: kvm-pc-bios-s390-ccw-Silence-GCC-11-stringop-overflow-wa.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch113: kvm-pc-bios-s390-ccw-Allow-building-with-Clang-too.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch114: kvm-pc-bios-s390-ccw-Fix-inline-assembly-for-older-versi.patch +# For bz#1939509 - QEMU: enable SafeStack +# For bz#1940132 - QEMU: switch build toolchain to Clang/LLVM +Patch115: kvm-configure-Fix-endianess-test-with-LTO.patch +# For bz#1951814 - RFE: Warning when using qcow2-v2 (compat=0.10) +Patch116: kvm-qcow2-Deprecation-warning-when-opening-v2-images-rw.patch +# For bz#1995819 - RFE: Remove ac97 audio support from QEMU +Patch117: kvm-disable-ac97-audio.patch +# For 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. +Patch118: kvm-redhat-Enable-the-test-block-iothread-test-again.patch +# For bz#1995807 - RFE: Remove SGA, deprecate cirrus, and set defaults for QEMU machine-types in RHEL9 +Patch119: kvm-disable-sga-device.patch +# For bz#1981462 - [qemu][aarch64] Remove 9.0 machine types in arm virt for 9-Beta +Patch120: kvm-hw-arm-virt-Remove-9.0-machine-type.patch +# For bz#2001728 - [s390][virtio-fs] Umount virtiofs shared folder failure from guest side +Patch121: kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch +# For bz#2002993 - [RHEL 9 Beta] Reenable SGA device +Patch122: kvm-Revert-disable-sga-device.patch + +# Source-git patches + +%if %{have_clang} +BuildRequires: clang +%if %{have_safe_stack} +BuildRequires: compiler-rt +%endif +%else +BuildRequires: gcc +%endif +BuildRequires: meson >= %{meson_version} +BuildRequires: zlib-devel +BuildRequires: glib2-devel +BuildRequires: gnutls-devel +BuildRequires: cyrus-sasl-devel +BuildRequires: libaio-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: libseccomp-devel >= %{libseccomp_version} +# For network block driver +BuildRequires: libcurl-devel +BuildRequires: libssh-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 +BuildRequires: libgcrypt-devel +# 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 + + +# 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 = %{epoch}:%{version}-%{release} +%{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} +%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. + + +%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 +Requires: sgabios-bin +%endif +%ifnarch aarch64 s390x +Requires: seavgabios-bin >= 1.12.0-3 +Requires: ipxe-roms-qemu >= %{ipxe_version} +%endif + +%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-virtiofsd +Summary: QEMU virtio-fs shared file system daemon +Provides: virtiofsd +%description -n qemu-virtiofsd +This package provides virtiofsd daemon. This program is a vhost-user backend +that implements the virtio-fs device that is used for sharing a host directory +tree with a guest. + + +%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-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 block-ssh +Summary: QEMU SSH block driver +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +%description block-ssh +This package provides the additional SSH block driver for QEMU. + +Install this package if you want to access remote disks using +the Secure Shell (SSH) protocol. + + +%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. +%endif + +%if %{have_usbredir} +%package hw-usbredir +Summary: QEMU usbredir support +Requires: %{name}-common%{?_isa} = %{epoch}:%{version}-%{release} +Requires: usbredir >= 0.7.1 + +%description hw-usbredir +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 +%define disable_everything \\\ + --audio-drv-list= \\\ + --disable-attr \\\ + --disable-auth-pam \\\ + --disable-avx2 \\\ + --disable-avx512f \\\ + --disable-block-drv-whitelist-in-tools \\\ + --disable-bochs \\\ + --disable-brlapi \\\ + --disable-bsd-user \\\ + --disable-bzip2 \\\ + --disable-cap-ng \\\ + --disable-capstone \\\ + --disable-cfi \\\ + --disable-cfi-debug \\\ + --disable-cloop \\\ + --disable-cocoa \\\ + --disable-coroutine-pool \\\ + --disable-crypto-afalg \\\ + --disable-curl \\\ + --disable-curses \\\ + --disable-debug-info \\\ + --disable-debug-mutex \\\ + --disable-debug-tcg \\\ + --disable-dmg \\\ + --disable-docs \\\ + --disable-fdt \\\ + --disable-fuse \\\ + --disable-fuse-lseek \\\ + --disable-gcrypt \\\ + --disable-gio \\\ + --disable-glusterfs \\\ + --disable-gnutls \\\ + --disable-gtk \\\ + --disable-guest-agent \\\ + --disable-guest-agent-msi \\\ + --disable-hax \\\ + --disable-hvf \\\ + --disable-iconv \\\ + --disable-jemalloc \\\ + --disable-kvm \\\ + --disable-libdaxctl \\\ + --disable-libiscsi \\\ + --disable-libnfs \\\ + --disable-libpmem \\\ + --disable-libssh \\\ + --disable-libudev \\\ + --disable-libusb \\\ + --disable-libxml2 \\\ + --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-opengl \\\ + --disable-parallels \\\ + --disable-pie \\\ + --disable-pvrdma \\\ + --disable-qcow1 \\\ + --disable-qed \\\ + --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-sheepdog \\\ + --disable-slirp \\\ + --disable-smartcard \\\ + --disable-snappy \\\ + --disable-sparse \\\ + --disable-spice \\\ + --disable-strip \\\ + --disable-system \\\ + --disable-tcg \\\ + --disable-tcmalloc \\\ + --disable-tools \\\ + --disable-tpm \\\ + --disable-u2f \\\ + --disable-usb-redir \\\ + --disable-user \\\ + --disable-vde \\\ + --disable-vdi \\\ + --disable-vhost-crypto \\\ + --disable-vhost-kernel \\\ + --disable-vhost-net \\\ + --disable-vhost-scsi \\\ + --disable-vhost-user \\\ + --disable-vhost-user-blk-server \\\ + --disable-vhost-vdpa \\\ + --disable-vhost-vsock \\\ + --disable-virglrenderer \\\ + --disable-virtfs \\\ + --disable-virtiofsd \\\ + --disable-vnc \\\ + --disable-vnc-jpeg \\\ + --disable-vnc-png \\\ + --disable-vnc-sasl \\\ + --disable-vte \\\ + --disable-vvfat \\\ + --disable-werror \\\ + --disable-whpx \\\ + --disable-xen \\\ + --disable-xen-pci-passthrough \\\ + --disable-xfsctl \\\ + --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}" \ + --with-pkgversion="%{name}-%{version}-%{release}" \ + --with-suffix="%{name}" \ + --firmwarepath=%{firmwaredirs} \ + --meson="%{__meson}" \ + --enable-trace-backend=dtrace \ + --with-coroutine=ucontext \ + --with-git=git \ + --tls-priority=@QEMU,SYSTEM \ + %{disable_everything} \ + "$@" + + 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 \ +%ifarch %{ix86} x86_64 + --enable-avx2 \ +%endif + --enable-cap-ng \ + --enable-capstone \ + --enable-coroutine-pool \ + --enable-curl \ + --enable-debug-info \ + --enable-docs \ +%if %{have_fdt} + --enable-fdt \ +%endif + --enable-gcrypt \ + --enable-gnutls \ + --enable-guest-agent \ + --enable-iconv \ + --enable-kvm \ +%if %{have_pmem} + --enable-libpmem \ +%endif + --enable-libssh \ + --enable-libusb \ + --enable-libudev \ + --enable-linux-aio \ + --enable-lzo \ + --enable-malloc-trim \ + --enable-modules \ + --enable-mpath \ +%if %{have_numactl} + --enable-numa \ +%endif +%if %{have_opengl} + --enable-opengl \ +%endif + --enable-pie \ +%if %{have_block_rbd} + --enable-rbd \ +%endif +%if %{have_librdma} + --enable-rdma \ +%endif + --enable-seccomp \ + --enable-slirp=system \ + --enable-snappy \ + --enable-system \ + --enable-tcg \ + --enable-tools \ + --enable-tpm \ +%if %{have_usbredir} + --enable-usb-redir \ +%endif + --enable-virtiofsd \ + --enable-vhost-kernel \ + --enable-vhost-net \ + --enable-vhost-user \ + --enable-vhost-user-blk-server \ + --enable-vhost-vdpa \ + --enable-vhost-vsock \ + --enable-vnc \ + --enable-vnc-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 + +%{__cc} %{_sourcedir}/ksmctl.c %{optflags} -pie %{?build_ldflags} -o ksmctl +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}/ksm.service %{buildroot}%{_unitdir}/ksm.service +install -D -p -m 0644 %{_sourcedir}/ksm.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/ksm +install -D -p -m 0755 %{qemu_kvm_build}/ksmctl %{buildroot}%{_libexecdir}/ksmctl + +install -D -p -m 0644 %{_sourcedir}/ksmtuned.service %{buildroot}%{_unitdir}/ksmtuned.service +install -D -p -m 0755 %{_sourcedir}/ksmtuned %{buildroot}%{_sbindir}/ksmtuned +install -D -p -m 0644 %{_sourcedir}/ksmtuned.conf %{buildroot}%{_sysconfdir}/ksmtuned.conf +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/acceptance +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/acceptance/* %{buildroot}%{testsdir}/tests/acceptance/ + +# 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 0755 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 + +# Move vhost-user JSON files to the standard "qemu" directory +mkdir -p %{buildroot}%{_datadir}/qemu +mv %{buildroot}%{_datadir}/%{name}/vhost-user %{buildroot}%{_datadir}/qemu/ + +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}/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 + +# Remove seabios rom +rm -rf %{buildroot}%{_datadir}/%{name}/sgabios.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 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 +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 + +%systemd_post ksm.service +%systemd_post ksmtuned.service + +%preun common +%systemd_preun ksm.service +%systemd_preun ksmtuned.service + +%postun common +%systemd_postun_with_restart ksm.service +%systemd_postun_with_restart ksmtuned.service +# 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 -n qemu-virtiofsd +%{_mandir}/man1/virtiofsd.1* +%{_libexecdir}/virtiofsd +# This is the standard location for vhost-user JSON files defined in the +# vhost-user specification for interoperability with other software. Unlike +# most other paths we use it's "qemu" instead of "qemu-kvm". +%{_datadir}/qemu/vhost-user/50-qemu-virtiofsd.json + +%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 +%{_unitdir}/ksm.service +%{_libexecdir}/ksmctl +%config(noreplace) %{_sysconfdir}/sysconfig/ksm +%{_unitdir}/ksmtuned.service +%{_sbindir}/ksmtuned +%ghost %{_sysconfdir}/kvm +%config(noreplace) %{_sysconfdir}/ksmtuned.conf +%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}/kvmvapic.bin + %{_datadir}/%{name}/pvh.bin +%endif +%ifarch s390x + %{_datadir}/%{name}/s390-ccw.img + %{_datadir}/%{name}/s390-netboot.img +%endif +%ifnarch aarch64 s390x + %{_libdir}/%{name}/hw-display-virtio-vga.so +%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 + +%{_libdir}/%{name}/hw-display-virtio-gpu.so +%ifarch s390x + %{_libdir}/%{name}/hw-s390x-virtio-gpu-ccw.so +%else + %{_libdir}/%{name}/hw-display-virtio-gpu-pci.so +%endif + +%files tests +%{testsdir} + +%files block-curl +%{_libdir}/%{name}/block-curl.so +%if %{have_block_rbd} +%files block-rbd +%{_libdir}/%{name}/block-rbd.so +%endif +%files block-ssh +%{_libdir}/%{name}/block-ssh.so + +%if %{have_opengl} +%files ui-opengl +%{_libdir}/%{name}/ui-egl-headless.so +%{_libdir}/%{name}/ui-opengl.so +%endif + +%if %{have_usbredir} +%files hw-usbredir + %{_libdir}/%{name}/hw-usb-redirect.so +%endif + +# endif !tools_only +%endif + +%changelog +* Wed Oct 06 2021 Miroslav Rezanina - 6.0.0-13.el9_b.5 +- kvm-spec-Remove-block-curl-and-block-ssh-dependency.patch [bz#2001100] +- Resolves: bz#2001100 + (Remove qemu-kvm's dependency on qemu-kvm-block-curl and qemu-kvm-block-ssh) + +* Fri Sep 24 2021 Miroslav Rezanina - 6.0.0-13.el9_b.4 +- kvm-Revert-disable-sga-device.patch [bz#2002993] +- kvm-Revert-remove-sgabios-dependency.patch [bz#2002993] +- Resolves: bz#2002993 + ([RHEL 9 Beta] Reenable SGA device) + +* Fri Sep 17 2021 Miroslav Rezanina - 6.0.0-13.el9_b.3 +- kvm-tools-virtiofsd-Add-fstatfs64-syscall-to-the-seccomp.patch [bz#2001728] +- Resolves: bz#2001728 + ([s390][virtio-fs] Umount virtiofs shared folder failure from guest side) + +* Fri Sep 10 2021 Miroslav Rezanina - 6.0.0-13.el9_b.2 +- kvm-hw-arm-virt-Remove-9.0-machine-type.patch [bz#1981462] +- Resolves: bz#1981462 + ([qemu][aarch64] Remove 9.0 machine types in arm virt for 9-Beta) + +* Fri Sep 03 2021 Miroslav Rezanina - 6.0.0-13.el9_b.1 +- kvm-disable-sga-device.patch [bz#1995807] +- kvm-remove-sgabios-dependency.patch [bz#1995807] +- Resolves: bz#1995807 + (RFE: Remove SGA, deprecate cirrus, and set defaults for QEMU machine-types in RHEL9) + +* 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