From 76daa3d38986a767f3cfaf0467544b2bea337967 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 09 2017 13:16:58 +0000 Subject: import qemu-kvm-2.9.0-23.el7a --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ab9b47 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +SOURCES/bios-256k.bin +SOURCES/kvm-unit-tests.git-4ea7633.tar.bz2 +SOURCES/pxe-e1000e.rom +SOURCES/qemu-2.9.0.tar.xz +SOURCES/rhel6-e1000.rom +SOURCES/rhel6-ne2k_pci.rom +SOURCES/rhel6-pcnet.rom +SOURCES/rhel6-rtl8139.rom +SOURCES/rhel6-virtio.rom diff --git a/.qemu-kvm.metadata b/.qemu-kvm.metadata new file mode 100644 index 0000000..1eae6f9 --- /dev/null +++ b/.qemu-kvm.metadata @@ -0,0 +1,9 @@ +5678cee702e664634abf28dce0688d01683611dd SOURCES/bios-256k.bin +8d79fca1e904b82272ebf96bbb65f858e1c491a9 SOURCES/kvm-unit-tests.git-4ea7633.tar.bz2 +e304721d2b96cdf9dfa89e07947f19ef3e26107e SOURCES/pxe-e1000e.rom +5cc63c6cababaaa7d0685e8b32bacf5022873ebc SOURCES/qemu-2.9.0.tar.xz +957fd6b653b4550c6be727385331d58f1381e082 SOURCES/rhel6-e1000.rom +3f183b9c65e959ab346a013828f1d7530bc4a14e SOURCES/rhel6-ne2k_pci.rom +5bf1eb9f40dc52fa2c9bfecd9330af03a49b35f9 SOURCES/rhel6-pcnet.rom +adffc84ebaf9faf982ecb707423395c1630186a4 SOURCES/rhel6-rtl8139.rom +29e633bcdb4ea9604b7bdaaaeaa0a1223774cb1d SOURCES/rhel6-virtio.rom diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-Initial-redhat-build.patch b/SOURCES/0001-Initial-redhat-build.patch new file mode 100644 index 0000000..a041c0b --- /dev/null +++ b/SOURCES/0001-Initial-redhat-build.patch @@ -0,0 +1,318 @@ +From a4e4a2f66d7a4efc873c5c1cafc502db480ff363 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 5 Nov 2015 10:38:15 +0100 +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 +- Added live-block-migration configuration option support + - Downstream differentiation support +- Use "/share/qemu-kvm" as SHARE_SUFFIX + - We reconfigured our share to qemu-kvm to be consistent with used name +- Added .gitpbulish configuration file + - Support for git publish has to be stored in repository root + +(cherry picked from commit 4a27bb33559ef5a702dc91dc02892ad255325c92) +-- +Rebase notes (2.9.0): +- documentation files handling changes (upstrem) +- removed --enable-colo option and --disable-archipelago (upstream) +- bump BuildRequires versions +- new mandatory argument for tracetool.py (upstream) +- updated RHEL 6 roms +- switch from sha1sum to sha256sum +- Moved adding rhel6-e1000.rom from machine types commit +- Moved adding pxe-e1000e.rom from device disable commit +- Use rdma-core instead of librdmacm +- Add upstream tarballs tar.xz to .gitignore +- Updated git-backport-diff script + +Rebase notes (2.8.0): +- removed vhdx option (upstream) +- qemu-tech.html merged to qemu-doc.html (upstream) +- removed skiboot.lid firmware +- Changed tracetool.py parameters +- Added support for easy z-stream switch + +Rebase notes (2.7.0): +- removed kvm_stat +- added efi-e1000e.rom +- added efi-vmxnet.rom +- added linuxboot_dma.bin +- trace-events renamed to trace-events-all +- reverted dependency to seccomp on aarch64 +- Add ipxe-qemu-roms ad build dependency to pass tests + +Rebase notes (2.6.0): +- removed q35-acpi-dsdt.aml +- add enable-gcrypt option + +Rebase notes (2.5.0): +- New seccomp hadling in configure +- New condition format in migration/migration.c +- libcacard extracted +- vnc fixes +- libsecomp for aarch64 requirements changed downstream + +Rebase notes (2.4.0): +- remove --enable-ws-vnc +- use error_setg instead of error_set in migration/migration.c +- remove target-x86_64.conf +- create /etc/qemu-kvm on copying of bridge.conf +- disabled opengl +- rebased to version 2.3.0-30.el7 + +Merged patches (rebase 2.9.0) +- 9c7ab94 Enable seccomp for ppc64/ppc64le architecture +- f6d7e9d Update qemu-kvm package Summary and Description +- a9e55b6 Disable usbredir and libcacard for unsupported architectures +- 0218220 Update configuration for 2.8.0 release + +Merged patches (rebase 2.7.0) +- 2be6077 Fix SLOF dependency +- dc58590 spec: Remove dependency to ipxe-roms-qemu for aarch64 +- 357ef43 spec: link sgabios.bin only for x86_64 +- 08d82cc spec: Update rules before triggering for kvm device +- 8980a76 spec: Do not package ivshmem-server and ivshmem-client +- 027067c spec: add a sample kvm.conf to enable Nested Virtualization +- ba2ba30 Adjust locked memory limits to allow unprivileged VMs on Power +- e9740b0 Increase locked memory limit for all users, not just kvm group +- 8c301be add vgabios-virtio.bin symlink +- 4d03723 usb: enable streams support +- 2a9363e Add install dependency required for usb streams +- 9a54442 Add dump-guest-memory.py to all archs +- 73fffc9 add e1000e ipxe rom symlink +- aaaa2a9 Add 'luks' to block driver whitelist +- c78c3a8 redhat: switch from gcrypt to nettle for crypto +- bb51a69 redhat: include username and date in RPM N-E-V-R for scratch builds + +Merged patches (rebase 2.4.0) +- 9201274 spec: Remove obsolete differentiation code +- a938a8c spec: Use external configuration script +- 5ca8d0e spec: Use configure options to prevent default resolution +- 5dca391 spec: Ship complete QMP documentation files +- 7899edd aarch64: allow --enable-seccomp +- a56fb9c aarch64: redhat spec: enable seccomp +- a9571e6 rhel: Update package version for SLOF dependency +- 25c70c4 configure: Add support for tcmalloc +- db72485 Change fsreeze-hook default location +- 14b8a9e redhat: add kvm-unit-tests tarball to environment +- 5ee4238 spec: Build tscdeadline_latency.flat from kvm-unit-tests +- 6ba800b Downstream-only: Start kvm-setup service before libvirtd service +- 59b43d6 Do not stop qemu-guest-agent service on target switch +- 4d851fa provide vhost module config file with max_mem_regions set to 509 +- 0b18027 spec: Require proper version of SLOF +- 3c436c7 Fix rh-brew-aarch64, rh-brew-ppc rh-brew-ga-ppc target + +(cherry picked from commit 7875d3bf6e3f2b0cf8b1a41cef685aac0ddfb42d) +--- + .gitpublish | 8 + + Makefile | 2 +- + configure | 11 + + migration/migration.c | 7 + + os-posix.c | 2 +- + redhat/.gitignore | 2 + + redhat/80-kvm.rules | 1 + + redhat/85-kvm.preset | 5 + + redhat/95-kvm-memlock.conf | 10 + + redhat/99-qemu-guest-agent.rules | 2 + + redhat/Makefile | 72 + + redhat/Makefile.common | 36 + + redhat/README.rhel6-gpxe-source | 9 + + redhat/bios-256k.bin | Bin 0 -> 262144 bytes + redhat/bridge.conf | 1 + + redhat/build_configure.sh | 138 + + redhat/ksm.service | 13 + + redhat/ksm.sysconfig | 4 + + redhat/ksmctl.c | 77 + + redhat/ksmtuned | 138 + + redhat/ksmtuned.conf | 21 + + redhat/ksmtuned.service | 12 + + redhat/kvm-setup | 31 + + redhat/kvm-setup.service | 14 + + redhat/kvm-unit-tests.git-4ea7633.tar.bz2 | Bin 0 -> 148090 bytes + redhat/kvm.conf | 12 + + redhat/kvm.modules | 21 + + redhat/pxe-e1000e.rom | Bin 0 -> 262144 bytes + redhat/qemu-ga.sysconfig | 19 + + redhat/qemu-guest-agent.service | 21 + + redhat/qemu-kvm.spec.template | 5654 +++++++++++++++++++++++++++++ + redhat/qemu.binfmt | 17 + + redhat/rhel6-e1000.rom | Bin 0 -> 69632 bytes + redhat/rhel6-ne2k_pci.rom | Bin 0 -> 54272 bytes + redhat/rhel6-pcnet.rom | Bin 0 -> 54784 bytes + redhat/rhel6-rtl8139.rom | Bin 0 -> 54272 bytes + redhat/rhel6-virtio.rom | Bin 0 -> 53760 bytes + redhat/rpmbuild/BUILD/.gitignore | 2 + + redhat/rpmbuild/RPMS/.gitignore | 2 + + redhat/rpmbuild/SOURCES/.gitignore | 2 + + redhat/rpmbuild/SPECS/.gitignore | 2 + + redhat/rpmbuild/SRPMS/.gitignore | 2 + + redhat/scripts/frh.py | 27 + + redhat/scripts/git-backport-diff | 327 ++ + redhat/scripts/git-compile-check | 215 ++ + redhat/scripts/process-patches.sh | 82 + + redhat/scripts/tarball_checksum.sh | 3 + + redhat/vhost.conf | 3 + + ui/vnc.c | 2 +- + 49 files changed, 7026 insertions(+), 3 deletions(-) + create mode 100644 .gitpublish + create mode 100644 redhat/.gitignore + create mode 100644 redhat/80-kvm.rules + create mode 100644 redhat/85-kvm.preset + create mode 100644 redhat/95-kvm-memlock.conf + create mode 100644 redhat/99-qemu-guest-agent.rules + create mode 100644 redhat/Makefile + create mode 100644 redhat/Makefile.common + create mode 100644 redhat/README.rhel6-gpxe-source + create mode 100644 redhat/bios-256k.bin + create mode 100644 redhat/bridge.conf + create mode 100755 redhat/build_configure.sh + create mode 100644 redhat/ksm.service + create mode 100644 redhat/ksm.sysconfig + create mode 100644 redhat/ksmctl.c + create mode 100644 redhat/ksmtuned + create mode 100644 redhat/ksmtuned.conf + create mode 100644 redhat/ksmtuned.service + create mode 100644 redhat/kvm-setup + create mode 100644 redhat/kvm-setup.service + create mode 100644 redhat/kvm-unit-tests.git-4ea7633.tar.bz2 + create mode 100644 redhat/kvm.conf + create mode 100755 redhat/kvm.modules + create mode 100644 redhat/pxe-e1000e.rom + create mode 100644 redhat/qemu-ga.sysconfig + create mode 100644 redhat/qemu-guest-agent.service + create mode 100644 redhat/qemu-kvm.spec.template + create mode 100644 redhat/qemu.binfmt + create mode 100644 redhat/rhel6-e1000.rom + create mode 100644 redhat/rhel6-ne2k_pci.rom + create mode 100644 redhat/rhel6-pcnet.rom + create mode 100644 redhat/rhel6-rtl8139.rom + create mode 100644 redhat/rhel6-virtio.rom + create mode 100644 redhat/rpmbuild/BUILD/.gitignore + create mode 100644 redhat/rpmbuild/RPMS/.gitignore + create mode 100644 redhat/rpmbuild/SOURCES/.gitignore + create mode 100644 redhat/rpmbuild/SPECS/.gitignore + create mode 100644 redhat/rpmbuild/SRPMS/.gitignore + create mode 100755 redhat/scripts/frh.py + create mode 100755 redhat/scripts/git-backport-diff + create mode 100755 redhat/scripts/git-compile-check + create mode 100755 redhat/scripts/process-patches.sh + create mode 100755 redhat/scripts/tarball_checksum.sh + create mode 100644 redhat/vhost.conf + +diff --git a/Makefile b/Makefile +index 6c359b2..4202ee5 100644 +--- a/Makefile ++++ b/Makefile +@@ -565,7 +565,7 @@ install-doc: $(DOCS) + $(INSTALL_DATA) docs/qemu-qmp-ref.txt "$(DESTDIR)$(qemu_docdir)" + ifdef CONFIG_POSIX + $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man1" +- $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1" ++ $(INSTALL_DATA) qemu.1 "$(DESTDIR)$(mandir)/man1/qemu-kvm.1" + $(INSTALL_DIR) "$(DESTDIR)$(mandir)/man7" + $(INSTALL_DATA) docs/qemu-qmp-ref.7 "$(DESTDIR)$(mandir)/man7" + ifneq ($(TOOLS),) +diff --git a/configure b/configure +index be4d326..a1842a8 100755 +--- a/configure ++++ b/configure +@@ -316,6 +316,7 @@ vte="" + virglrenderer="" + tpm="yes" + libssh2="" ++live_block_migration="no" + numa="" + tcmalloc="no" + jemalloc="no" +@@ -1183,6 +1184,10 @@ for opt do + ;; + --enable-replication) replication="yes" + ;; ++ --disable-live-block-migration) live_block_migration="no" ++ ;; ++ --enable-live-block-migration) live_block_migration="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1417,6 +1422,7 @@ disabled with --disable-FEATURE, default is enabled if available: + glusterfs GlusterFS backend + tpm TPM support + libssh2 ssh block device support ++ live-block-migration live block migration support + numa libnuma support + tcmalloc tcmalloc support + jemalloc jemalloc support +@@ -5138,6 +5144,7 @@ echo "TPM support $tpm" + echo "libssh2 support $libssh2" + echo "TPM passthrough $tpm_passthrough" + echo "QOM debugging $qom_cast_debug" ++echo "Live block migration $live_block_migration" + echo "lzo support $lzo" + echo "snappy support $snappy" + echo "bzip2 support $bzip2" +@@ -5703,6 +5710,10 @@ if test "$libssh2" = "yes" ; then + echo "LIBSSH2_LIBS=$libssh2_libs" >> $config_host_mak + fi + ++if test "$live_block_migration" = "yes" ; then ++ echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak ++fi ++ + # USB host support + if test "$libusb" = "yes"; then + echo "HOST_USB=libusb legacy" >> $config_host_mak +diff --git a/migration/migration.c b/migration/migration.c +index ad4036f..fb58f54 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -1227,6 +1227,13 @@ void qmp_migrate(const char *uri, bool has_blk, bool blk, + params.blk = has_blk && blk; + params.shared = has_inc && inc; + ++#ifndef CONFIG_LIVE_BLOCK_MIGRATION ++ if (params.blk || params.shared) { ++ error_setg(errp, QERR_UNSUPPORTED); ++ return; ++ } ++#endif ++ + if (migration_is_setup_or_active(s->state) || + s->state == MIGRATION_STATUS_CANCELLING || + s->state == MIGRATION_STATUS_COLO) { +diff --git a/os-posix.c b/os-posix.c +index c6ddb7d..84da202 100644 +--- a/os-posix.c ++++ b/os-posix.c +@@ -77,7 +77,7 @@ void os_setup_signal_handling(void) + /* Find a likely location for support files using the location of the binary. + For installed binaries this will be "$bindir/../share/qemu". When + running from the build tree this will be "$bindir/../pc-bios". */ +-#define SHARE_SUFFIX "/share/qemu" ++#define SHARE_SUFFIX "/share/qemu-kvm" + #define BUILD_SUFFIX "/pc-bios" + char *os_find_datadir(void) + { +diff --git a/ui/vnc.c b/ui/vnc.c +index 349cfc9..8cf99d8 100644 +--- a/ui/vnc.c ++++ b/ui/vnc.c +@@ -3944,7 +3944,7 @@ void vnc_display_open(const char *id, Error **errp) + } + + #ifdef CONFIG_VNC_SASL +- if ((saslErr = sasl_server_init(NULL, "qemu")) != SASL_OK) { ++ if ((saslErr = sasl_server_init(NULL, "qemu-kvm")) != SASL_OK) { + error_setg(errp, "Failed to initialize SASL auth: %s", + sasl_errstring(saslErr, NULL, NULL)); + goto fail; +-- +1.8.3.1 + diff --git a/SOURCES/0002-Add-RHEL-7-machine-types.patch b/SOURCES/0002-Add-RHEL-7-machine-types.patch new file mode 100644 index 0000000..c2fd4aa --- /dev/null +++ b/SOURCES/0002-Add-RHEL-7-machine-types.patch @@ -0,0 +1,2899 @@ +From d682dec685d0a342b990068b20dbef5aebc30a23 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Sun, 14 Dec 2014 18:32:18 +0100 +Subject: Add RHEL 7 machine types + +This commit adds all changes related to machine types applied in +qemu-kvm-rhev-2.1.2-16.el7. + +Signed-off-by: Miroslav Rezanina + +Conflicts (on 2.3 rebase): + default-configs/ppc64-softmmu.mak + hw/arm/Makefile.objs + hw/i386/pc_piix.c + hw/i386/pc_q35.c + hw/ppc/spapr.c + savevm.c - has to change shadow_bios tail to rcu list handling + target-i386/machine.c - use xmm instead of ymmh register + +(cherry picked from commit 61bf982cb6e977f0f77264f323b6d0bfd6129b5f) + +Rebase notes (2.9.0): +- new header file for arm (upstream) +- query_hotpluggable_cpus renamed to has_hotpluggable_cpus (upstream) +- replace MAX_CPUMASK_BITS with max_cpus +- Adding rhel6-e1000.rom moved to Initial redhat commit +- Fixed conflict on cirrus_vga.c + +Rebase notes (2.8.0): +- new "m->max_cpus = 288" in pc_q35_machine_options hw/i386/pc_q35.c + +Rebase notes (2.7.0): +- Additional fsl-imx6.o sabrelito.o files in arm hw dir + +Rebase notes (2.6.0): +- Changes in handling of some compat properties +- Fixes in x86_64 copmat models +- Added required devices for aarch64 +- Fixes for ppc machine types + +Rebase notes (2.5.0): +- changed cpu defaults structure +- chnaged cpu compat properties handling +- added fix for arm machine type + +Rebase notes (2.4.0) +- Moved needed attribute (due to 5cd8cadae8db905afcbf877cae568c27d1d55a8a) +- Fixes to machine types changes + +Merged patches (2.9.0) +- 8475d69 hw/arm/virt: Disable virtio-net-pci option ROM file loading +- 73fe1f6 Workaround rhel6 ctrl_guest_offloads machine type mismatch +- 21d32ca pc_piix: fix compat props typo for RHEL6 machine types +- 55a5002 compat: define HW_COMPAT_RHEL7_3 +- 1b8e927 spapr: define pseries-rhel7.4.0 machine type +- cdb76ec hw/arm/virt: remove aarch64 rhel machine type +- 7dfa88b hw/arm/virt: create virt-rhel7.3.0 machine type +- 6894f91 hw/arm/virt: create virt-rhel7.4.0 machine type +- a9d2d39 x86: Split out options for the head rhel7 machine types +- fdafbdc x86: Create PC_RHEL7_3_COMPAT definition +- 3427c72 x86: Define pc-i440fx-rhel7.4.0 +- aea20ab x86: Define pc-q35-rhel7.4.0 +- 0185c0f x86: Remove downstream opteron rdtscp override +- 6b51073 fix abort in acpi_setup() since 2.8 with rhel6 machine types +- 954fc0d intel-hda: fix rhel6 compat property +- 1b57274 kvmclock: reduce kvmclock difference on migration (rhel only part) + +Merged patches (2.8.0) +- a1da2f0 virtio-pci: reduce modern_mem_bar size (rhel only part) + +Merged patches (2.7.0): +- fe9d1cf pc: Use right HW_COMPAT_* macros at PC_RHEL7* compat macros +- 3938189 compat: Add missing "any_layout" in HW_COMPAT_RHEL7_1 +- 6dffc9d spapr: update RHEL-7.2 machine type +- c5d5910 migration: fix HW_COMPAT_RHEL7_2 +- 2da9bb8 pc: New (default) pc-i440fx-rhel7.3.0 machine-type +- 0520d7e 7.3 mismerge fix: Fix ich9-intel-hda compatibility +- 89528b3 PC migration compat: Section footers/global state +- 2231e35 fw_cfg for 7.2 compatibility +- b8a3ade pc: Create new pc-q35-rhel7.3.0 machine-type +- 340929b q35: Remove 7.0, 7.1, 7.2 machine types +- bb7fc95 machine types: fix pc_machine_*_options chain +- d9fa9aa Fix rhel6 rom file +- dc39363 fix vga type for older machines +- 255a2d1 7.2 machine type compatibility +- 16c3d25 target-i386: Remove SSE4a from qemu64 CPU model (rhel only part) +- 76a1796 target-i386: Remove ABM from qemu64 CPU model (rhel only part) +- a9f8773 pc: Recover PC_RHEL7_1_COMPAT from RHEL-7.2 code +- 7a6ed67 pc: Include missing PC_COMPAT_2_3 entries in PC_RHEL7_2_COMPAT +- 07428f6 Revert "static checker: e1000-82540em got aliased to e1000" +- 446cf1f Revert "e1000: use alias for default model" +- 615096e 7.x compat: e1000-82540em +- 0855905 hw/arm/virt: kill 7.2 machine type +- 18bbea2 usbredir: turn off streams for rhel7.2 & older +- 910cf4a target-i386: Fill high bits of mtrr mask (rhel only part) +- 0e8ab1b target-i386: Enable host-phys-bits on RHEL +- 8c5f8a5 pc: Fix rhel6.3.0 compat_props setting +- 8f869f1 pc: use new CPU hotplug interface since 2.7 machine type (rhel only part) +- d9d646f machine: add properties to compat_props incrementaly (rhel only part) +- acb18fd apic: Use apic_id as apic's migration instance_id (rhel only part) +- c7e37d4 apic: fix broken migration for kvm-apic (rhel only part) +- eca64aee hw/virtio-pci: fix virtio behaviour +- c56b8F6e pc-rhel-7.2: pcie: fix link active status bit migration +- 5522aa3 q35-rhel: allow dynamic sysbus + +Merged patches (2.6.0): +- f915d7f arm: virt: Add an abstract RHEL ARM virt machine type +- deffcc0 arm: virt: Add RHEL 7.3.0 virt machine type +- 04ca07d arm: virt: Consolidate the naming of RHEL virt machine types +- 2856ce2 Define HW_COMPAT_RHEL7_2 +- 1869242 spapr: move pseries-2.5 machine to RHEL disabled machine zone +- cc59ce7 spapr: add RHEL-7.3 machine type +- 98549c5 pc: Fix property names on CPU compat code +- caa47bb Fix ich9-intel-hda compatibility + +Merged patches (2.3.0): +- bb4e53c2 pc: add rhel6.6.0 machine type +- 129a2b3 Downstream-only: Restore "pseries" machine alias + +Merged patches (2.4.0): +- 8e8107c numa: Don't allow memdev= on RHEL-6 machine-types +- 8b220c0 pc_sysfw: prevent pflash and/or mis-sized firmware for rhel6.x.0 machtypes +- 9dba3a5 Add pc-i440fx-rhel7.2.0 machine type +- 1c88ffa Add pc-q35-rhel7.2.0 machine type +- 6f74d0c Downstream-only: Add rhel7.2.0 machine type +- a7d6105 Add flag for pre-2.2 migration compatibility +- 17f9a18 Serial: Migration compatibility pre 2.2/7.2 +- 3799a57 Migration compat for mc146818rtc/irq_reinject_on_ack_count subsection +- 5668cc1 Fix reported machine type +- 2417534 386: drop FDC in pc-q35-rhel7.2.0 if neither it nor fl. drives are anted +- f42eee5 global_state: Make section optional +- 8640f84 migration: Add configuration section +- 48c857b pc: memhotplug: fix incorrectly set reserved-memory-end +- f33f0b6 pc: memhotplug: keep reserved-memory-end broken on rhel71 and earlier machines + +(cherry picked from commit ea0ae2aa4e3eca96ee620d8516567566d186fb75) +--- + default-configs/aarch64-softmmu.mak | 2 + + default-configs/arm-softmmu.mak | 1 - + hw/acpi/piix4.c | 6 +- + hw/arm/Makefile.objs | 18 +- + hw/arm/virt.c | 142 ++++++- + hw/char/serial.c | 29 ++ + hw/display/cirrus_vga.c | 4 +- + hw/display/vga-isa.c | 2 +- + hw/i386/pc_piix.c | 783 +++++++++++++++++++++++++++++++++++- + hw/i386/pc_q35.c | 51 ++- + hw/i386/pc_sysfw.c | 16 + + hw/net/e1000.c | 20 +- + hw/net/ne2000.c | 2 +- + hw/net/pcnet-pci.c | 2 +- + hw/net/rtl8139.c | 2 +- + hw/ppc/Makefile.objs | 2 +- + hw/ppc/spapr.c | 105 +++++ + hw/smbios/smbios.c | 1 + + hw/timer/i8254_common.c | 2 +- + hw/timer/mc146818rtc.c | 6 + + hw/usb/hcd-uhci.c | 15 +- + hw/usb/hcd-xhci.c | 20 + + hw/virtio/virtio-pci.c | 2 +- + hw/virtio/virtio.c | 22 +- + include/hw/arm/virt.h | 27 ++ + include/hw/compat.h | 128 ++++++ + include/hw/i386/pc.h | 427 ++++++++++++++++++++ + include/hw/usb.h | 7 + + include/hw/virtio/virtio.h | 1 + + include/migration/migration.h | 5 + + include/sysemu/sysemu.h | 1 + + migration/migration.c | 1 + + migration/savevm.c | 69 ++++ + numa.c | 13 + + qdev-monitor.c | 1 - + redhat/qemu-kvm.spec.template | 11 +- + scripts/vmstate-static-checker.py | 1 - + target/i386/cpu.c | 51 ++- + target/i386/machine.c | 21 + + 39 files changed, 1961 insertions(+), 58 deletions(-) + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index 2449483..abd18c2 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -7,3 +7,5 @@ CONFIG_AUX=y + CONFIG_DDC=y + CONFIG_DPCD=y + CONFIG_XLNX_ZYNQMP=y ++CONFIG_PL061=y ++CONFIG_GPIO_KEY=y +diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak +index 1e3bd2b..3ae1bf4 100644 +--- a/default-configs/arm-softmmu.mak ++++ b/default-configs/arm-softmmu.mak +@@ -74,7 +74,6 @@ CONFIG_ARM11SCU=y + CONFIG_A9SCU=y + CONFIG_DIGIC=y + CONFIG_MARVELL_88W8618=y +-CONFIG_OMAP=y + CONFIG_TSC210X=y + CONFIG_BLIZZARD=y + CONFIG_ONENAND=y +diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c +index a553a7e..d4cd3fd 100644 +--- a/hw/acpi/piix4.c ++++ b/hw/acpi/piix4.c +@@ -311,7 +311,7 @@ static const VMStateDescription vmstate_cpuhp_state = { + static const VMStateDescription vmstate_acpi = { + .name = "piix4_pm", + .version_id = 3, +- .minimum_version_id = 3, ++ .minimum_version_id = 2, + .minimum_version_id_old = 1, + .load_state_old = acpi_load_old, + .post_load = vmstate_acpi_post_load, +@@ -670,8 +670,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_pci_hotplug, true), +diff --git a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs +index 4c5c4ee..906367c 100644 +--- a/hw/arm/Makefile.objs ++++ b/hw/arm/Makefile.objs +@@ -1,20 +1,4 @@ +-obj-y += boot.o collie.o exynos4_boards.o gumstix.o highbank.o +-obj-$(CONFIG_DIGIC) += digic_boards.o +-obj-y += integratorcp.o mainstone.o musicpal.o nseries.o +-obj-y += omap_sx1.o palm.o realview.o spitz.o stellaris.o +-obj-y += tosa.o versatilepb.o vexpress.o virt.o xilinx_zynq.o z2.o + obj-$(CONFIG_ACPI) += virt-acpi-build.o +-obj-y += netduino2.o + obj-y += sysbus-fdt.o + +-obj-y += armv7m.o exynos4210.o pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o +-obj-$(CONFIG_DIGIC) += digic.o +-obj-y += omap1.o omap2.o strongarm.o +-obj-$(CONFIG_ALLWINNER_A10) += allwinner-a10.o cubieboard.o +-obj-$(CONFIG_RASPI) += bcm2835_peripherals.o bcm2836.o raspi.o +-obj-$(CONFIG_STM32F205_SOC) += stm32f205_soc.o +-obj-$(CONFIG_XLNX_ZYNQMP) += xlnx-zynqmp.o xlnx-ep108.o +-obj-$(CONFIG_FSL_IMX25) += fsl-imx25.o imx25_pdk.o +-obj-$(CONFIG_FSL_IMX31) += fsl-imx31.o kzm.o +-obj-$(CONFIG_FSL_IMX6) += fsl-imx6.o sabrelite.o +-obj-$(CONFIG_ASPEED_SOC) += aspeed_soc.o aspeed.o ++obj-y += boot.o virt.o +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 5f62a03..82d2636 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -57,6 +57,7 @@ + #include "qapi/visitor.h" + #include "standard-headers/linux/input.h" + ++#if 0 /* disabled Red Hat Enterprise Linux */ + #define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ + static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ + void *data) \ +@@ -84,7 +85,36 @@ + 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, \ ++ .instance_init = rhel##m##n##s##_virt_instance_init, \ ++ .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) + + /* Number of external interrupt lines to configure the GIC with */ + #define NUM_IRQS 256 +@@ -1438,6 +1468,7 @@ static void machvirt_init(MachineState *machine) + create_platform_bus(vms, pic); + } + ++#if 0 /* disabled for RHEL */ + static bool virt_get_secure(Object *obj, Error **errp) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -1466,6 +1497,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) + { + VirtMachineState *vms = VIRT_MACHINE(obj); +@@ -1518,6 +1550,7 @@ static void virt_set_gic_version(Object *obj, const char *value, Error **errp) + } + } + ++#if 0 /* disabled for RHEL */ + static void virt_machine_class_init(ObjectClass *oc, void *data) + { + MachineClass *mc = MACHINE_CLASS(oc); +@@ -1677,3 +1710,110 @@ 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); ++ ++ mc->family = "virt-rhel-Z"; ++ mc->init = machvirt_init; ++ /* Start max_cpus at the maximum QEMU supports. We'll further restrict ++ * it later in machvirt_init, where we have more information about the ++ * configuration of the particular instance. ++ */ ++ mc->max_cpus = 255; ++ mc->has_dynamic_sysbus = false; ++ 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; ++} ++ ++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, ++}; ++ ++static void rhel_machine_init(void) ++{ ++ type_register_static(&rhel_machine_info); ++} ++type_init(rhel_machine_init); ++ ++static void rhel740_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 for RHEL */ ++ vms->highmem = true; ++ object_property_add_bool(obj, "highmem", virt_get_highmem, ++ virt_set_highmem, NULL); ++ object_property_set_description(obj, "highmem", ++ "Set on/off to enable/disable using " ++ "physical address space above 32 bits", ++ NULL); ++ /* Default GIC type is still v2, but became configurable for RHEL */ ++ vms->gic_version = 2; ++ object_property_add_str(obj, "gic-version", virt_get_gic_version, ++ virt_set_gic_version, NULL); ++ object_property_set_description(obj, "gic-version", ++ "Set GIC version. " ++ "Valid values are 2, 3 and host", NULL); ++ ++ 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, NULL); ++ object_property_set_description(obj, "its", ++ "Set on/off to enable/disable " ++ "ITS instantiation", ++ NULL); ++ } ++ ++ vms->memmap=a15memmap; ++ vms->irqmap=a15irqmap; ++} ++ ++static void rhel740_virt_options(MachineClass *mc) ++{ ++ SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT); ++} ++DEFINE_RHEL_MACHINE_AS_LATEST(7, 4, 0) ++ ++#define ARM_COMPAT_RHEL7_3 \ ++ HW_COMPAT_RHEL7_3 ++ ++static void rhel730_virt_instance_init(Object *obj) ++{ ++ rhel740_virt_instance_init(obj); ++} ++ ++static void rhel730_virt_options(MachineClass *mc) ++{ ++ VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); ++ ++ rhel740_virt_options(mc); ++ SET_MACHINE_COMPAT(mc, ARM_COMPAT_RHEL7_3); ++ /* the following options need to be re-configured because they weren't ++ * present in RHEL 7.3. ++ */ ++ vmc->disallow_affinity_adjustment = true; ++ vmc->no_its = true; ++ vmc->no_pmu = true; ++ mc->minimum_page_bits = 0; ++} ++DEFINE_RHEL_MACHINE(7, 3, 0) +diff --git a/hw/char/serial.c b/hw/char/serial.c +index 03d890c..771d399 100644 +--- a/hw/char/serial.c ++++ b/hw/char/serial.c +@@ -30,6 +30,7 @@ + #include "qemu/timer.h" + #include "exec/address-spaces.h" + #include "qemu/error-report.h" ++#include "migration/migration.h" + + //#define DEBUG_SERIAL + +@@ -683,6 +684,10 @@ 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); + return s->thr_ipending != expected_value; +@@ -709,6 +714,10 @@ static const VMStateDescription vmstate_serial_thr_ipending = { + static bool serial_tsr_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return s->tsr_retry != 0; + } + +@@ -728,6 +737,10 @@ static const VMStateDescription vmstate_serial_tsr = { + static bool serial_recv_fifo_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return !fifo8_is_empty(&s->recv_fifo); + + } +@@ -746,6 +759,10 @@ static const VMStateDescription vmstate_serial_recv_fifo = { + static bool serial_xmit_fifo_needed(void *opaque) + { + SerialState *s = (SerialState *)opaque; ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return !fifo8_is_empty(&s->xmit_fifo); + } + +@@ -763,6 +780,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); + } + +@@ -780,6 +801,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; + } + +@@ -797,6 +822,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/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index afc290a..14008aa 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -3063,7 +3063,7 @@ static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp) + + static Property isa_cirrus_vga_properties[] = { + DEFINE_PROP_UINT32("vgamem_mb", struct ISACirrusVGAState, +- cirrus_vga.vga.vram_size_mb, 4), ++ cirrus_vga.vga.vram_size_mb, 16), + DEFINE_PROP_BOOL("blitter", struct ISACirrusVGAState, + cirrus_vga.enable_blitter, true), + DEFINE_PROP_END_OF_LIST(), +@@ -3134,7 +3134,7 @@ static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp) + + static Property pci_vga_cirrus_properties[] = { + DEFINE_PROP_UINT32("vgamem_mb", struct PCICirrusVGAState, +- cirrus_vga.vga.vram_size_mb, 4), ++ cirrus_vga.vga.vram_size_mb, 16), + DEFINE_PROP_BOOL("blitter", struct PCICirrusVGAState, + cirrus_vga.enable_blitter, true), + DEFINE_PROP_END_OF_LIST(), +diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c +index 1af9556..91a675d 100644 +--- a/hw/display/vga-isa.c ++++ b/hw/display/vga-isa.c +@@ -80,7 +80,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 9f102aa..fa41189 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -48,6 +48,7 @@ + #include "hw/acpi/acpi.h" + #include "cpu.h" + #include "qemu/error-report.h" ++#include "migration/migration.h" + #ifdef CONFIG_XEN + #include + #include "hw/xen/xen_pt.h" +@@ -166,8 +167,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, + SMBIOS_ENTRY_POINT_21); + } +@@ -309,6 +310,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(MachineState *machine) + { + PCMachineState *pcms = PC_MACHINE(machine); +@@ -1112,3 +1114,780 @@ static void xenfv_machine_options(MachineClass *m) + DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init, + xenfv_machine_options); + #endif ++machine_init(pc_machine_init); ++ ++#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) ++{ ++ m->family = "pc_piix_Y"; ++ m->default_machine_opts = "firmware=bios-256k.bin"; ++ m->default_display = "std"; ++ SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); ++ m->alias = "pc"; ++ m->is_default = 1; ++} ++ ++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) ++{ ++ pc_machine_rhel7_options(m); ++ m->desc = "RHEL 7.4.0 PC (i440FX + PIIX, 1996)"; ++} ++ ++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) ++{ ++ pc_machine_rhel740_options(m); ++ m->alias = NULL; ++ m->is_default = 0; ++ m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)"; ++ SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel730, "pc-i440fx-rhel7.3.0", pc_init_rhel730, ++ pc_machine_rhel730_options); ++ ++ ++static void pc_compat_rhel720(MachineState *machine) ++{ ++ /* 7.2 was based on qemu 2.3 */ ++ savevm_skip_section_footers(); ++ global_state_set_optional(); ++} ++ ++static void pc_init_rhel720(MachineState *machine) ++{ ++ pc_compat_rhel720(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); ++ pc_machine_rhel730_options(m); ++ m->desc = "RHEL 7.2.0 PC (i440FX + PIIX, 1996)"; ++ /* From pc_i440fx_2_5_machine_options */ ++ pcmc->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; ++ SET_MACHINE_COMPAT(m, PC_RHEL7_2_COMPAT); ++} ++ ++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); ++ ++ /* 7.1.0 is based on 2.1.2, 7.2.0 is based on 2.3 */ ++ pc_compat_rhel720(machine); ++ ++ /* 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; ++ global_state_set_optional(); ++ savevm_skip_configuration(); ++ ++ /* 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"; ++ SET_MACHINE_COMPAT(m, PC_RHEL7_1_COMPAT); ++} ++ ++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)"; ++ SET_MACHINE_COMPAT(m, PC_RHEL7_0_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700, ++ pc_machine_rhel700_options); ++ ++#define PC_RHEL6_6_COMPAT \ ++ {\ ++ .driver = "scsi-hd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "scsi-cd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "scsi-disk",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-hd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-cd",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "ide-drive",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "discard_granularity",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "vectors",\ ++ /* DEV_NVECTORS_UNSPECIFIED as a uint32_t string */\ ++ .value = stringify(0xFFFFFFFF),\ ++ },{\ ++ .driver = "486-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "usb-tablet",\ ++ .property = "usb_version",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "mq",\ ++ .value = "off",\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "mmio",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "config-wce",\ ++ .value = "off",\ ++ },{\ ++ .driver = TYPE_ISA_FDC,\ ++ .property = "check_media_rate",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-balloon-pci",\ ++ .property = "class",\ ++ .value = stringify(PCI_CLASS_MEMORY_RAM),\ ++ },{\ ++ .driver = TYPE_PCI_DEVICE,\ ++ .property = "command_serr_enable",\ ++ .value = "off",\ ++ },{\ ++ .driver = "AC97",\ ++ .property = "use_broken_id",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "intel-hda",\ ++ .property = "msi",\ ++ .value = "off",\ ++ },{\ ++ .driver = "qemu32-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "486-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "qemu32-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "usb-ccid",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },{\ ++ .driver = "ne2k_pci",\ ++ .property = "romfile",\ ++ .value = "rhel6-ne2k_pci.rom",\ ++ },{\ ++ .driver = "pcnet",\ ++ .property = "romfile",\ ++ .value = "rhel6-pcnet.rom",\ ++ },{\ ++ .driver = "rtl8139",\ ++ .property = "romfile",\ ++ .value = "rhel6-rtl8139.rom",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "romfile",\ ++ .value = "rhel6-e1000.rom",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "romfile",\ ++ .value = "rhel6-virtio.rom",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "pentium" "-" TYPE_X86_CPU,\ ++ .property = "apic",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "pentium2" "-" TYPE_X86_CPU,\ ++ .property = "apic",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "pentium3" "-" TYPE_X86_CPU,\ ++ .property = "apic",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Conroe" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Penryn" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Nehalem" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "pclmulqdq",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "fxsr",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "mmx",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "pat",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "cmov",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "pge",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "cx8",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "mce",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "pae",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "msr",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "tsc",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "pse",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "de",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "fpu",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "rdtscp",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "smap",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "rdtscp",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G1" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G2" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G4" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G5" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "3dnow",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "3dnowext",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "virtio-net-pci",\ ++ .property = "__com.redhat_rhel6_ctrl_guest_workaround", \ ++ .value = "on",\ ++ }, ++ ++static void pc_compat_rhel660(MachineState *machine) ++{ ++ PCMachineState *pcms = PC_MACHINE(machine); ++ PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms); ++ ++ pc_compat_rhel700(machine); ++ if (!machine->cpu_model) { ++ machine->cpu_model = "cpu64-rhel6"; ++ } ++ ++ x86_cpu_change_kvm_default("kvm-pv-unhalt", NULL); ++ ++ pcmc->gigabyte_align = false; ++ shadow_bios_after_incoming = true; ++ ich9_uhci123_irqpin_override = true; ++} ++ ++static void pc_init_rhel660(MachineState *machine) ++{ ++ pc_compat_rhel660(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel660_options(MachineClass *m) ++{ ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); ++ pc_machine_rhel700_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.6.0 PC"; ++ m->rom_file_has_mr = false; ++ m->default_machine_opts = "firmware=bios.bin"; ++ pcmc->has_acpi_build = false; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_6_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel660, "rhel6.6.0", pc_init_rhel660, ++ pc_machine_rhel660_options); ++ ++#define PC_RHEL6_5_COMPAT \ ++ {\ ++ .driver = TYPE_USB_DEVICE,\ ++ .property = "msos-desc",\ ++ .value = "no",\ ++ }, ++ ++static void pc_compat_rhel650(MachineState *machine) ++{ ++ pc_compat_rhel660(machine); ++} ++ ++static void pc_init_rhel650(MachineState *machine) ++{ ++ pc_compat_rhel650(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel650_options(MachineClass *m) ++{ ++ pc_machine_rhel660_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.5.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_5_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel650, "rhel6.5.0", pc_init_rhel650, ++ pc_machine_rhel650_options); ++ ++#define PC_RHEL6_4_COMPAT \ ++ {\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "vectors",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "hda-micro",\ ++ .property = "mixer",\ ++ .value = "off",\ ++ },{\ ++ .driver = "hda-duplex",\ ++ .property = "mixer",\ ++ .value = "off",\ ++ },{\ ++ .driver = "hda-output",\ ++ .property = "mixer",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "ctrl_mac_addr",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "sep",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "virtio-net-pci",\ ++ .property = "__com.redhat_rhel6_ctrl_guest_workaround", \ ++ .value = "off",\ ++ }, ++ ++static void pc_compat_rhel640(MachineState *machine) ++{ ++ pc_compat_rhel650(machine); ++} ++ ++static void pc_init_rhel640(MachineState *machine) ++{ ++ pc_compat_rhel640(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel640_options(MachineClass *m) ++{ ++ pc_machine_rhel650_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.4.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_4_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640, ++ pc_machine_rhel640_options); ++ ++#define PC_RHEL6_3_COMPAT \ ++ {\ ++ .driver = "Conroe-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Penryn-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "Nehalem-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "autonegotiation",\ ++ .value = "off",\ ++ },{\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(3),\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "hotplug",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "param_change",\ ++ .value = "off",\ ++ },{\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "pmu",\ ++ .value = "on",\ ++ },{\ ++ .driver = "usb-hub",\ ++ .property = "serial",\ ++ .value = "314159",\ ++ },{\ ++ .driver = "usb-storage",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },\ ++ {\ ++ .driver = "SandyBridge" "-" TYPE_X86_CPU,\ ++ .property = "tsc-deadline",\ ++ .value = "off",\ ++ }, ++ ++static void pc_compat_rhel630(MachineState *machine) ++{ ++ pc_compat_rhel640(machine); ++ x86_cpu_change_kvm_default("kvm-pv-eoi",NULL); ++ enable_compat_apic_id_mode(); ++} ++ ++static void pc_init_rhel630(MachineState *machine) ++{ ++ pc_compat_rhel630(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel630_options(MachineClass *m) ++{ ++ pc_machine_rhel640_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.3.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_3_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel630, "rhel6.3.0", pc_init_rhel630, ++ pc_machine_rhel630_options); ++ ++ ++#define PC_RHEL6_2_COMPAT \ ++ {\ ++ .driver = TYPE_X86_CPU,\ ++ .property = "pmu",\ ++ .value = "off",\ ++ }, ++ ++static void pc_compat_rhel620(MachineState *machine) ++{ ++ pc_compat_rhel630(machine); ++} ++ ++static void pc_init_rhel620(MachineState *machine) ++{ ++ pc_compat_rhel620(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel620_options(MachineClass *m) ++{ ++ pc_machine_rhel630_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.2.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_2_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel620, "rhel6.2.0", pc_init_rhel620, ++ pc_machine_rhel620_options); ++ ++/* ++ * NOTE: We don't have the event_idx compat entry for the ++ * virtio-balloon-pci driver because RHEL6 doesn't disable ++ * it either due to a bug (see RHBZ 1029539 fo more info) ++ */ ++#define PC_RHEL6_1_COMPAT \ ++ {\ ++ .driver = "PIIX4_PM",\ ++ .property = "disable_s3",\ ++ .value = "0",\ ++ },{\ ++ .driver = "PIIX4_PM",\ ++ .property = "disable_s4",\ ++ .value = "0",\ ++ },{\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(2),\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "event_idx",\ ++ .value = "off",\ ++ },{\ ++ .driver = "usb-kbd",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },{\ ++ .driver = "usb-mouse",\ ++ .property = "serial",\ ++ .value = "1",\ ++ },{\ ++ .driver = "usb-tablet",\ ++ .property = "serial",\ ++ .value = "1",\ ++ }, ++ ++static void pc_compat_rhel610(MachineState *machine) ++{ ++ pc_compat_rhel620(machine); ++} ++ ++static void pc_init_rhel610(MachineState *machine) ++{ ++ pc_compat_rhel610(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel610_options(MachineClass *m) ++{ ++ pc_machine_rhel620_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.1.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_1_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel610, "rhel6.1.0", pc_init_rhel610, ++ pc_machine_rhel610_options); ++ ++#define PC_RHEL6_0_COMPAT \ ++ {\ ++ .driver = "qxl",\ ++ .property = "revision",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "qxl-vga",\ ++ .property = "revision",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "rombar",\ ++ .value = stringify(0),\ ++ }, ++ ++static void pc_compat_rhel600(MachineState *machine) ++{ ++ pc_compat_rhel610(machine); ++} ++ ++static void pc_init_rhel600(MachineState *machine) ++{ ++ pc_compat_rhel600(machine); ++ pc_init1(machine, TYPE_I440FX_PCI_HOST_BRIDGE, \ ++ TYPE_I440FX_PCI_DEVICE);} ++ ++static void pc_machine_rhel600_options(MachineClass *m) ++{ ++ pc_machine_rhel610_options(m); ++ m->family = "pc_piix_Z"; ++ m->desc = "RHEL 6.0.0 PC"; ++ SET_MACHINE_COMPAT(m, PC_RHEL6_0_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(rhel600, "rhel6.0.0", pc_init_rhel600, ++ pc_machine_rhel600_options); ++ +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index dd792a8..a8ab052 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -136,8 +136,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, + SMBIOS_ENTRY_POINT_21); + } +@@ -288,6 +288,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) + { + m->family = "pc_q35"; +@@ -299,6 +300,7 @@ static void pc_q35_machine_options(MachineClass *m) + m->no_floppy = 1; + m->has_dynamic_sysbus = true; + m->max_cpus = 288; ++ SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); + } + + static void pc_q35_2_9_machine_options(MachineClass *m) +@@ -364,3 +366,48 @@ 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 rhel7 q35 machine type */ ++static void pc_q35_machine_rhel7_options(MachineClass *m) ++{ ++ m->family = "pc_q35_Z"; ++ m->default_machine_opts = "firmware=bios-256k.bin"; ++ m->default_display = "std"; ++ m->no_floppy = 1; ++ m->has_dynamic_sysbus = true; ++ m->alias = "q35"; ++ SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); ++} ++ ++static void pc_q35_init_rhel740(MachineState *machine) ++{ ++ pc_q35_init(machine); ++} ++ ++static void pc_q35_machine_rhel740_options(MachineClass *m) ++{ ++ pc_q35_machine_rhel7_options(m); ++ m->desc = "RHEL-7.4.0 PC (Q35 + ICH9, 2009)"; ++} ++ ++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) ++{ ++ pc_q35_machine_rhel740_options(m); ++ m->alias = NULL; ++ m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; ++ SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); ++} ++ ++DEFINE_PC_MACHINE(q35_rhel730, "pc-q35-rhel7.3.0", pc_q35_init_rhel730, ++ pc_q35_machine_rhel730_options); +diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c +index f915ad0..7c0723f 100644 +--- a/hw/i386/pc_sysfw.c ++++ b/hw/i386/pc_sysfw.c +@@ -194,6 +194,13 @@ static void old_pc_system_rom_init(MemoryRegion *rom_memory, bool isapc_ram_fw) + (bios_size % 65536) != 0) { + goto bios_error; + } ++ if (shadow_bios_after_incoming && bios_size != 128 * 1024) { ++ MachineClass *mc; ++ ++ mc = MACHINE_GET_CLASS(current_machine); ++ error_report("machine %s only supports a 128KB BIOS image", mc->name); ++ exit(1); ++ } + bios = g_malloc(sizeof(*bios)); + memory_region_init_ram(bios, NULL, "pc.bios", bios_size, &error_fatal); + vmstate_register_ram_global(bios); +@@ -242,6 +249,15 @@ void pc_system_firmware_init(MemoryRegion *rom_memory, bool isapc_ram_fw) + return; + } + ++ if (shadow_bios_after_incoming) { ++ MachineClass *mc; ++ ++ mc = MACHINE_GET_CLASS(current_machine); ++ error_report("flash-based firmware is not supported by machine %s", ++ mc->name); ++ exit(1); ++ } ++ + if (kvm_enabled() && !kvm_readonly_mem_enabled()) { + /* Older KVM cannot execute from device memory. So, flash memory + * cannot be used unless the readonly memory kvm capability is present. */ +diff --git a/hw/net/e1000.c b/hw/net/e1000.c +index f2e5072..3d86146 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1595,6 +1595,16 @@ static void pci_e1000_realize(PCIDevice *pci_dev, Error **errp) + + pci_conf = pci_dev->config; + ++ if (!(d->compat_flags & E1000_FLAG_AUTONEG)) { ++ /* ++ * We have no capabilities, so capability list bit should normally be 0. ++ * Keep it on for compat machine types to avoid breaking migration. ++ * HACK: abuse E1000_FLAG_AUTONEG, which is off exactly for ++ * the machine types that need this. ++ */ ++ pci_set_word(pci_conf + PCI_STATUS, PCI_STATUS_CAP_LIST); ++ } ++ + /* TODO: RST# value should be 0, PCI spec 6.2.4 */ + pci_conf[PCI_CACHE_LINE_SIZE] = 0x10; + +@@ -1657,7 +1667,7 @@ static void e1000_class_init(ObjectClass *klass, void *data) + + k->realize = pci_e1000_realize; + k->exit = pci_e1000_uninit; +- k->romfile = "efi-e1000.rom"; ++ k->romfile = "pxe-e1000.rom"; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = info->device_id; + k->revision = info->revision; +@@ -1689,7 +1699,7 @@ static const TypeInfo e1000_base_info = { + + static const E1000Info e1000_devices[] = { + { +- .name = "e1000", ++ .name = "e1000-82540em", + .device_id = E1000_DEV_ID_82540EM, + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, +@@ -1708,6 +1718,11 @@ static const E1000Info e1000_devices[] = { + }, + }; + ++static const TypeInfo e1000_default_info = { ++ .name = "e1000", ++ .parent = "e1000-82540em", ++}; ++ + static void e1000_register_types(void) + { + int i; +@@ -1725,6 +1740,7 @@ static void e1000_register_types(void) + + type_register(&type_info); + } ++ type_register_static(&e1000_default_info); + } + + type_init(e1000_register_types) +diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c +index 798d681..8660955 100644 +--- a/hw/net/ne2000.c ++++ b/hw/net/ne2000.c +@@ -771,7 +771,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data) + + k->realize = pci_ne2000_realize; + k->exit = pci_ne2000_exit; +- k->romfile = "efi-ne2k_pci.rom", ++ k->romfile = "pxe-ne2k_pci.rom", + k->vendor_id = PCI_VENDOR_ID_REALTEK; + k->device_id = PCI_DEVICE_ID_REALTEK_8029; + k->class_id = PCI_CLASS_NETWORK_ETHERNET; +diff --git a/hw/net/pcnet-pci.c b/hw/net/pcnet-pci.c +index 0acf8a4..eeab4ca 100644 +--- a/hw/net/pcnet-pci.c ++++ b/hw/net/pcnet-pci.c +@@ -348,7 +348,7 @@ static void pcnet_class_init(ObjectClass *klass, void *data) + + k->realize = pci_pcnet_realize; + k->exit = pci_pcnet_uninit; +- k->romfile = "efi-pcnet.rom", ++ k->romfile = "pxe-pcnet.rom", + k->vendor_id = PCI_VENDOR_ID_AMD; + k->device_id = PCI_DEVICE_ID_AMD_LANCE; + k->revision = 0x10; +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 671c7e4..450658c 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3472,7 +3472,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) + + k->realize = pci_rtl8139_realize; + k->exit = pci_rtl8139_uninit; +- k->romfile = "efi-rtl8139.rom"; ++ k->romfile = "pxe-rtl8139.rom"; + k->vendor_id = PCI_VENDOR_ID_REALTEK; + k->device_id = PCI_DEVICE_ID_REALTEK_8139; + k->revision = RTL8139_PCI_REVID; /* >=0x20 is for 8139C+ */ +diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs +index 0012934..72edbf1 100644 +--- a/hw/ppc/Makefile.objs ++++ b/hw/ppc/Makefile.objs +@@ -12,7 +12,7 @@ obj-y += spapr_pci_vfio.o + endif + obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o + # PowerPC 4xx boards +-obj-y += ppc405_boards.o ppc4xx_devs.o ppc405_uc.o ppc440_bamboo.o ++obj-y += ppc4xx_devs.o ppc405_uc.o + obj-y += ppc4xx_pci.o + # PReP + obj-$(CONFIG_PREP) += prep.o +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 35db949..596cc11 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -3157,6 +3157,7 @@ static const TypeInfo spapr_machine_info = { + } \ + type_init(spapr_machine_register_##suffix) + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* + * pseries-2.9 + */ +@@ -3221,6 +3222,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false); + .property = "pre-2.8-migration", \ + .value = "on", \ + }, ++#endif + + static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, + uint64_t *buid, hwaddr *pio, +@@ -3271,6 +3273,7 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, + */ + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void spapr_machine_2_7_instance_options(MachineState *machine) + { + sPAPRMachineState *spapr = SPAPR_MACHINE(machine); +@@ -3422,6 +3425,7 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false); + #define SPAPR_COMPAT_2_1 \ + HW_COMPAT_2_1 + ++ + static void spapr_machine_2_1_instance_options(MachineState *machine) + { + spapr_machine_2_2_instance_options(machine); +@@ -3433,6 +3437,107 @@ static void spapr_machine_2_1_class_options(MachineClass *mc) + SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1); + } + DEFINE_SPAPR_MACHINE(2_1, "2.1", false); ++#endif ++ ++/* ++ * pseries-rhel7.4.0 ++ */ ++static void spapr_machine_rhel740_instance_options(MachineState *machine) ++{ ++} ++ ++static void spapr_machine_rhel740_class_options(MachineClass *mc) ++{ ++ /* Defaults for the latest behaviour inherited from the base class */ ++} ++ ++DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", true); ++ ++/* ++ * pseries-rhel7.3.0 ++ * like SPAPR_COMPAT_2_6 and _2_7 but "ddw" has been backported to RHEL7_3 ++ */ ++#define SPAPR_COMPAT_RHEL7_3 \ ++ HW_COMPAT_RHEL7_3 \ ++ { \ ++ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ ++ .property = "mem_win_size", \ ++ .value = stringify(SPAPR_PCI_2_7_MMIO_WIN_SIZE),\ ++ }, \ ++ { \ ++ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ ++ .property = "mem64_win_size", \ ++ .value = "0", \ ++ }, \ ++ { \ ++ .driver = TYPE_POWERPC_CPU, \ ++ .property = "pre-2.8-migration", \ ++ .value = "on", \ ++ }, \ ++ { \ ++ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ ++ .property = "pre-2.8-migration", \ ++ .value = "on", \ ++ }, ++ ++static void spapr_machine_rhel730_instance_options(MachineState *machine) ++{ ++ sPAPRMachineState *spapr = SPAPR_MACHINE(machine); ++ ++ spapr_machine_rhel740_instance_options(machine); ++ spapr->use_hotplug_event_source = false; ++} ++ ++static void spapr_machine_rhel730_class_options(MachineClass *mc) ++{ ++ sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc); ++ ++ spapr_machine_rhel740_class_options(mc); ++ smc->tcg_default_cpu = "POWER7"; ++ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_3); ++ smc->phb_placement = phb_placement_2_7; ++} ++ ++DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", 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. ++ */ ++ ++#define SPAPR_COMPAT_RHEL7_2 \ ++ HW_COMPAT_RHEL7_2 \ ++ { \ ++ .driver = "spapr-vlan", \ ++ .property = "use-rx-buffer-pools", \ ++ .value = "off", \ ++ },{ \ ++ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE,\ ++ .property = "ddw",\ ++ .value = stringify(off),\ ++ }, ++ ++ ++static void spapr_machine_rhel720_instance_options(MachineState *machine) ++{ ++ spapr_machine_rhel730_instance_options(machine); ++ savevm_skip_section_footers(); ++ global_state_set_optional(); ++} ++ ++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; ++ SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_RHEL7_2); ++} ++ ++DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false); + + static void spapr_machine_register_types(void) + { +diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c +index 1a5437a..cd9cdfa 100644 +--- a/hw/smbios/smbios.c ++++ b/hw/smbios/smbios.c +@@ -743,6 +743,7 @@ void smbios_set_defaults(const char *manufacturer, const char *product, + 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"); + SMBIOS_SET_DEFAULT(type2.manufacturer, manufacturer); + SMBIOS_SET_DEFAULT(type2.product, product); + SMBIOS_SET_DEFAULT(type2.version, version); +diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c +index e18299a..0817461 100644 +--- a/hw/timer/i8254_common.c ++++ b/hw/timer/i8254_common.c +@@ -267,7 +267,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/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c +index 4165450..bf693c0 100644 +--- a/hw/timer/mc146818rtc.c ++++ b/hw/timer/mc146818rtc.c +@@ -32,6 +32,7 @@ + #include "qapi/visitor.h" + #include "qapi-event.h" + #include "qmp-commands.h" ++#include "migration/migration.h" + + #ifdef TARGET_I386 + #include "hw/i386/apic.h" +@@ -760,6 +761,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/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c +index ca72a80..1d37b66 100644 +--- a/hw/usb/hcd-uhci.c ++++ b/hw/usb/hcd-uhci.c +@@ -152,6 +152,8 @@ typedef struct UHCI_QH { + uint32_t el_link; + } UHCI_QH; + ++bool ich9_uhci123_irqpin_override; ++ + static void uhci_async_cancel(UHCIAsync *async); + static void uhci_queue_fill(UHCIQueue *q, UHCI_TD *td); + static void uhci_resume(void *opaque); +@@ -1214,12 +1216,23 @@ static 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); ++ if (ich9_uhci123_irqpin_override && ++ u->info.vendor_id == PCI_VENDOR_ID_INTEL && ++ (u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI1 || ++ u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI2 || ++ u->info.device_id == PCI_DEVICE_ID_INTEL_82801I_UHCI3)) { ++ fprintf(stderr, "RHEL-6 compat: %s: irq_pin = 3\n", u->info.name); ++ irq_pin = 3; ++ } else { ++ 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.c b/hw/usb/hcd-xhci.c +index a2d3143..c38594c 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -418,6 +418,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 { +@@ -3760,9 +3762,25 @@ static const VMStateDescription vmstate_xhci_slot = { + } + }; + ++static void 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]; ++} ++ ++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), +@@ -3771,6 +3789,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/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c +index f9b7244..13fc414 100644 +--- a/hw/virtio/virtio-pci.c ++++ b/hw/virtio/virtio-pci.c +@@ -2339,7 +2339,7 @@ static void virtio_net_pci_class_init(ObjectClass *klass, void *data) + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + VirtioPCIClass *vpciklass = VIRTIO_PCI_CLASS(klass); + +- k->romfile = "efi-virtio.rom"; ++ k->romfile = "pxe-virtio.rom"; + k->vendor_id = PCI_VENDOR_ID_REDHAT_QUMRANET; + k->device_id = PCI_DEVICE_ID_VIRTIO_NET; + k->revision = VIRTIO_PCI_ABI_VERSION; +diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c +index 03592c5..3d6f05f 100644 +--- a/hw/virtio/virtio.c ++++ b/hw/virtio/virtio.c +@@ -25,6 +25,7 @@ + #include "hw/virtio/virtio-access.h" + #include "sysemu/dma.h" + ++#include "standard-headers/linux/virtio_net.h" + /* + * The alignment to use between consumer and producer parts of vring. + * x86 pagesize again. This is the default, used by transports like PCI +@@ -1984,7 +1985,24 @@ const VMStateInfo virtio_vmstate_info = { + static int virtio_set_features_nocheck(VirtIODevice *vdev, uint64_t val) + { + VirtioDeviceClass *k = VIRTIO_DEVICE_GET_CLASS(vdev); +- bool bad = (val & ~(vdev->host_features)) != 0; ++ bool bad; ++ uint64_t ctrl_guest_mask = 1ull << VIRTIO_NET_F_CTRL_GUEST_OFFLOADS; ++ ++ if (vdev->rhel6_ctrl_guest_workaround && (val & ctrl_guest_mask) && ++ !(vdev->host_features & ctrl_guest_mask)) { ++ /* ++ * This works around a mistake in the definition of the rhel6.[56].0 ++ * machinetypes, ctrl-guest-offload was not set in qemu-kvm-rhev for ++ * those machine types, but is set on the rhel6 qemu-kvm-rhev build. ++ * If an incoming rhel6 guest uses it then we need to allow it. ++ * Note: There's a small race where a guest read the flag but didn't ++ * declare it's useage yet. ++ */ ++ fprintf(stderr, "RHEL6 ctrl_guest_offload workaround\n"); ++ vdev->host_features |= ctrl_guest_mask; ++ } ++ ++ bad = (val & ~(vdev->host_features)) != 0; + + val &= vdev->host_features; + if (k->set_features) { +@@ -2548,6 +2566,8 @@ static void virtio_device_instance_finalize(Object *obj) + + static Property virtio_properties[] = { + DEFINE_VIRTIO_COMMON_FEATURES(VirtIODevice, host_features), ++ DEFINE_PROP_BOOL("__com.redhat_rhel6_ctrl_guest_workaround", VirtIODevice, ++ rhel6_ctrl_guest_workaround, false), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/include/hw/arm/virt.h b/include/hw/arm/virt.h +index 33b0ff3..565d743 100644 +--- a/include/hw/arm/virt.h ++++ b/include/hw/arm/virt.h +@@ -108,7 +108,10 @@ typedef struct { + int psci_conduit; + } VirtMachineState; + ++#if 0 /* disabled for Red Hat Enterprise Linux */ ++ + #define TYPE_VIRT_MACHINE MACHINE_TYPE_NAME("virt") ++ + #define VIRT_MACHINE(obj) \ + OBJECT_CHECK(VirtMachineState, (obj), TYPE_VIRT_MACHINE) + #define VIRT_MACHINE_GET_CLASS(obj) \ +@@ -116,6 +119,30 @@ typedef struct { + #define VIRT_MACHINE_CLASS(klass) \ + OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_VIRT_MACHINE) + ++#else ++ ++#define TYPE_RHEL_MACHINE MACHINE_TYPE_NAME("virt-rhel") ++#define VIRT_MACHINE(obj) \ ++ OBJECT_CHECK(VirtMachineState, (obj), TYPE_RHEL_MACHINE) ++#define VIRT_MACHINE_GET_CLASS(obj) \ ++ OBJECT_GET_CLASS(VirtMachineClass, obj, TYPE_RHEL_MACHINE) ++#define VIRT_MACHINE_CLASS(klass) \ ++ OBJECT_CLASS_CHECK(VirtMachineClass, klass, TYPE_RHEL_MACHINE) ++ ++#endif ++ ++/* 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. ++ */ ++#define ARM_RHEL_COMPAT \ ++ {\ ++ .driver = "virtio-net-pci",\ ++ .property = "romfile",\ ++ .value = "",\ ++ }, ++ ++ + void virt_acpi_setup(VirtMachineState *vms); + + #endif /* QEMU_ARM_VIRT_H */ +diff --git a/include/hw/compat.h b/include/hw/compat.h +index 5d5be91..6f64306 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -198,4 +198,132 @@ + .value = "on",\ + }, + ++/* Mostly like HW_COMPAT_2_1 but: ++ * we don't need virtio-scsi-pci since 7.0 already had that on ++ */ ++#define HW_COMPAT_RHEL7_1 \ ++ { /* COMPAT_RHEL7.1 */ \ ++ .driver = "intel-hda-generic",\ ++ .property = "old_msi_addr",\ ++ .value = "on",\ ++ },{\ ++ .driver = "VGA",\ ++ .property = "qemu-extended-regs",\ ++ .value = "off",\ ++ },{\ ++ .driver = "secondary-vga",\ ++ .property = "qemu-extended-regs",\ ++ .value = "off",\ ++ },{\ ++ .driver = "usb-mouse",\ ++ .property = "usb_version",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "usb-kbd",\ ++ .property = "usb_version",\ ++ .value = stringify(1),\ ++ },{\ ++ .driver = "virtio-pci",\ ++ .property = "virtio-pci-bus-master-bug-migration",\ ++ .value = "on",\ ++ },{\ ++ .driver = "virtio-blk-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-balloon-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-serial-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-9p-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-rng-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ }, ++ ++/* Mostly like HW_COMPAT_2_4 + 2_3 but: ++ * we don't need "any_layout" as it has been backported to 7.2 ++ */ ++ ++#define HW_COMPAT_RHEL7_2 \ ++ {\ ++ .driver = "virtio-blk-device",\ ++ .property = "scsi",\ ++ .value = "true",\ ++ },{\ ++ .driver = "e1000-82540em",\ ++ .property = "extra_mac_registers",\ ++ .value = "off",\ ++ },{\ ++ .driver = "virtio-pci",\ ++ .property = "x-disable-pcie",\ ++ .value = "on",\ ++ },{\ ++ .driver = "virtio-pci",\ ++ .property = "migrate-extra",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "fw_cfg_mem",\ ++ .property = "dma_enabled",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "fw_cfg_io",\ ++ .property = "dma_enabled",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "isa-fdc",\ ++ .property = "fallback",\ ++ .value = "144",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "virtio-pci",\ ++ .property = "disable-modern",\ ++ .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "virtio-pci",\ ++ .property = "disable-legacy",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = TYPE_PCI_DEVICE,\ ++ .property = "x-pcie-lnksta-dllla",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_2 */ \ ++ .driver = "virtio-pci",\ ++ .property = "page-per-vq",\ ++ .value = "on",\ ++ }, ++ ++/* 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 ++ */ ++#define HW_COMPAT_RHEL7_3 \ ++ { /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-mmio",\ ++ .property = "format_transport_address",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-serial-device",\ ++ .property = "emergency-write",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "ioapic",\ ++ .property = "version",\ ++ .value = "0x11",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "intel-iommu",\ ++ .property = "x-buggy-eim",\ ++ .value = "true",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-pci",\ ++ .property = "x-ignore-backend-features",\ ++ .value = "on",\ ++ }, ++ + #endif /* HW_COMPAT_H */ +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index f278b3a..c88c46a 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -982,4 +982,431 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + type_init(pc_machine_init_##suffix) + + extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); ++ ++/* See include/hw/compat.h for shared compatibility lists */ ++ ++/* 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. ++ */ ++#define PC_RHEL_COMPAT \ ++ { /* PC_RHEL_COMPAT */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "host-phys-bits",\ ++ .value = "on",\ ++ }, ++ ++#define PC_RHEL7_3_COMPAT \ ++ HW_COMPAT_RHEL7_3 \ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = "kvmclock",\ ++ .property = "x-mach-use-reliable-get-clock",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "l3-cache",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "full-cpuid-auto-level",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "family",\ ++ .value = "15",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "model",\ ++ .value = "6",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "stepping",\ ++ .value = "1",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ .driver = "isa-pcspk",\ ++ .property = "migrate",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \ ++ .driver = "fw_cfg_io",\ ++ .property = "dma_enabled",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "cpuid-0xb",\ ++ .value = "off",\ ++ }, ++ ++#define PC_RHEL7_2_COMPAT \ ++ HW_COMPAT_RHEL7_2 \ ++ {\ ++ .driver = "phenom" "-" TYPE_X86_CPU,\ ++ .property = "rdtscp",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "qemu64" "-" TYPE_X86_CPU,\ ++ .property = "sse4a",\ ++ .value = "on",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "qemu64" "-" TYPE_X86_CPU,\ ++ .property = "abm",\ ++ .value = "on",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "Haswell-" TYPE_X86_CPU,\ ++ .property = "abm",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "Haswell-noTSX-" TYPE_X86_CPU,\ ++ .property = "abm",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "Broadwell-" TYPE_X86_CPU,\ ++ .property = "abm",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "Broadwell-noTSX-" TYPE_X86_CPU,\ ++ .property = "abm",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "host" "-" TYPE_X86_CPU,\ ++ .property = "host-cache-info",\ ++ .value = "on",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "check",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "qemu32" "-" TYPE_X86_CPU,\ ++ .property = "popcnt",\ ++ .value = "on",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "arat",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "usb-redir",\ ++ .property = "streams",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "fill-mtrr-mask",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_2_COMPAT */ \ ++ .driver = "apic-common",\ ++ .property = "legacy-instance-id",\ ++ .value = "on",\ ++ }, ++ ++ ++ ++#define PC_RHEL7_1_COMPAT \ ++ HW_COMPAT_RHEL7_1 \ ++ {\ ++ .driver = "kvm64" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "kvm32" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Conroe" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Penryn" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Nehalem" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "SandyBridge" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Haswell" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G1" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G2" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G4" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Opteron_G5" "-" TYPE_X86_CPU,\ ++ .property = "vme",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Haswell" "-" TYPE_X86_CPU,\ ++ .property = "f16c",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Haswell" "-" TYPE_X86_CPU,\ ++ .property = "rdrand",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "f16c",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "rdrand",\ ++ .value = "off",\ ++ },\ ++ {\ ++ .driver = "coreduo" "-" TYPE_X86_CPU,\ ++ .property = "vmx",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "core2duo" "-" TYPE_X86_CPU,\ ++ .property = "vmx",\ ++ .value = "on",\ ++ },\ ++ { /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "qemu64" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(4),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "kvm64" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(5),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "pentium3" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(2),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "n270" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(5),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Conroe" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(4),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Penryn" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(4),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Nehalem" "-" TYPE_X86_CPU,\ ++ .property = "level",\ ++ .value = stringify(4),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "n270" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Penryn" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Conroe" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Nehalem" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "SandyBridge" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "IvyBridge" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Haswell" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Broadwell" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ },{ /* PC_RHEL7_1_COMPAT */ \ ++ .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\ ++ .property = "xlevel",\ ++ .value = stringify(0x8000000a),\ ++ }, ++ ++/* ++ * 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. ++ * PC_RHEL6_*_COMPAT apply to i440fx types only, and therefore live ++ * in pc_piix.c. ++ */ ++ ++/* ++ * 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. ++ */ ++#define PC_RHEL7_0_COMPAT \ ++ {\ ++ .driver = "virtio-scsi-pci",\ ++ .property = "any_layout",\ ++ .value = "off",\ ++ },{\ ++ .driver = "PIIX4_PM",\ ++ .property = "memory-hotplug-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "apic",\ ++ .property = "version",\ ++ .value = stringify(0x11),\ ++ },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "superspeed-ports-first",\ ++ .value = "off",\ ++ },{\ ++ .driver = "nec-usb-xhci",\ ++ .property = "force-pcie-endcap",\ ++ .value = "on",\ ++ },{\ ++ .driver = "pci-serial",\ ++ .property = "prog_if",\ ++ .value = stringify(0),\ ++ },{\ ++ .driver = "virtio-net-pci",\ ++ .property = "guest_announce",\ ++ .value = "off",\ ++ },{\ ++ .driver = "ICH9-LPC",\ ++ .property = "memory-hotplug-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "xio3130-downstream",\ ++ .property = COMPAT_PROP_PCP,\ ++ .value = "off",\ ++ },{\ ++ .driver = "ioh3420",\ ++ .property = COMPAT_PROP_PCP,\ ++ .value = "off",\ ++ },{\ ++ .driver = "PIIX4_PM",\ ++ .property = "acpi-pci-hotplug-with-bridge-support",\ ++ .value = "off",\ ++ },{\ ++ .driver = "e1000",\ ++ .property = "mitigation",\ ++ .value = "off",\ ++ },{ \ ++ .driver = "virtio-net-pci", \ ++ .property = "ctrl_guest_offloads", \ ++ .value = "off", \ ++ },\ ++ {\ ++ .driver = "Conroe" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Penryn" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Nehalem" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Westmere" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G1" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G2" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G3" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G4" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ },\ ++ {\ ++ .driver = "Opteron_G5" "-" TYPE_X86_CPU,\ ++ .property = "x2apic",\ ++ .value = "on",\ ++ }, + #endif +diff --git a/include/hw/usb.h b/include/hw/usb.h +index eb28655..e2d3d77 100644 +--- a/include/hw/usb.h ++++ b/include/hw/usb.h +@@ -608,4 +608,11 @@ int usb_get_quirks(uint16_t vendor_id, uint16_t product_id, + uint8_t interface_class, uint8_t interface_subclass, + uint8_t interface_protocol); + ++ ++/* hcd-uhci.c -- RHEL-6 machine type compatibility */ ++extern bool ich9_uhci123_irqpin_override; ++ ++/* hcd-xhci.c -- rhel7.0.0 machine type compatibility */ ++extern bool migrate_cve_2014_5263_xhci_fields; ++ + #endif +diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h +index 7b6edba..7dcb53a 100644 +--- a/include/hw/virtio/virtio.h ++++ b/include/hw/virtio/virtio.h +@@ -94,6 +94,7 @@ struct VirtIODevice + uint8_t device_endian; + bool use_guest_notifier_mask; + AddressSpace *dma_as; ++ bool rhel6_ctrl_guest_workaround; + QLIST_HEAD(, VirtQueue) *vector_queues; + }; + +diff --git a/include/migration/migration.h b/include/migration/migration.h +index 5720c88..eaa31c8 100644 +--- a/include/migration/migration.h ++++ b/include/migration/migration.h +@@ -385,4 +385,9 @@ uint64_t ram_pagesize_summary(void); + PostcopyState postcopy_state_get(void); + /* Set the state and return the old state */ + PostcopyState postcopy_state_set(PostcopyState new_state); ++/* ++ * Disables a load of subsections that were added in 2.2/rh7.2 for backwards ++ * migration compatibility. ++ */ ++extern bool migrate_pre_2_2; + #endif +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 576c7ce..53a2588 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -130,6 +130,7 @@ void qemu_savevm_send_postcopy_ram_discard(QEMUFile *f, const char *name, + uint64_t *length_list); + + int qemu_loadvm_state(QEMUFile *f); ++extern bool shadow_bios_after_incoming; + + extern int autostart; + +diff --git a/migration/migration.c b/migration/migration.c +index fb58f54..fdc17bc 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -83,6 +83,7 @@ static bool deferred_incoming; + * at the end as MIS is being freed. + */ + static PostcopyState incoming_postcopy_state; ++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 +diff --git a/migration/savevm.c b/migration/savevm.c +index 3b19a4a..8e05383 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -43,6 +43,7 @@ + #include "qemu/error-report.h" + #include "qemu/sockets.h" + #include "qemu/queue.h" ++#include "qemu/rcu_queue.h" + #include "sysemu/cpus.h" + #include "exec/memory.h" + #include "qmp-commands.h" +@@ -54,6 +55,7 @@ + #include "qemu/cutils.h" + #include "io/channel-buffer.h" + #include "io/channel-file.h" ++#include "exec/ram_addr.h" + + #ifndef ETH_P_RARP + #define ETH_P_RARP 0x8035 +@@ -65,6 +67,7 @@ + const unsigned int postcopy_ram_discard_version = 0; + + static bool skip_section_footers; ++bool shadow_bios_after_incoming; + + static struct mig_cmd_args { + ssize_t len; /* -1 = variable */ +@@ -1827,6 +1830,65 @@ static bool check_section_footer(QEMUFile *f, LoadStateEntry *le) + return true; + } + ++static void shadow_bios(void) ++{ ++ RAMBlock *block, *ram, *oprom, *bios; ++ size_t one_meg, oprom_size, bios_size; ++ uint8_t *cd_seg_host, *ef_seg_host; ++ ++ ram = NULL; ++ oprom = NULL; ++ bios = NULL; ++ rcu_read_lock(); ++ QLIST_FOREACH_RCU(block, &ram_list.blocks, next) { ++ if (strcmp("pc.ram", block->idstr) == 0) { ++ assert(ram == NULL); ++ ram = block; ++ } else if (strcmp("pc.rom", block->idstr) == 0) { ++ assert(oprom == NULL); ++ oprom = block; ++ } else if (strcmp("pc.bios", block->idstr) == 0) { ++ assert(bios == NULL); ++ bios = block; ++ } ++ } ++ assert(ram != NULL); ++ assert(oprom != NULL); ++ assert(bios != NULL); ++ assert(memory_region_is_ram(ram->mr)); ++ assert(memory_region_is_ram(oprom->mr)); ++ assert(memory_region_is_ram(bios->mr)); ++ assert(int128_eq(ram->mr->size, int128_make64(ram->used_length))); ++ assert(int128_eq(oprom->mr->size, int128_make64(oprom->used_length))); ++ assert(int128_eq(bios->mr->size, int128_make64(bios->used_length))); ++ ++ one_meg = 1024 * 1024; ++ oprom_size = 128 * 1024; ++ bios_size = 128 * 1024; ++ assert(ram->used_length >= one_meg); ++ assert(oprom->used_length == oprom_size); ++ assert(bios->used_length == bios_size); ++ ++ ef_seg_host = memory_region_get_ram_ptr(ram->mr) + (one_meg - bios_size); ++ cd_seg_host = ef_seg_host - oprom_size; ++ ++ /* This is a crude hack, but we must distinguish a rhel6.x.0 machtype guest ++ * coming in from a RHEL-6 emulator (where shadowing has had no effect on ++ * "pc.ram") from a similar guest coming in from a RHEL-7 emulator (where ++ * shadowing has worked). In the latter case we must not trample the live ++ * SeaBIOS variables in "pc.ram". ++ */ ++ if (buffer_is_zero(ef_seg_host, bios_size)) { ++ fprintf(stderr, "copying E and F segments from pc.bios to pc.ram\n"); ++ memcpy(ef_seg_host, memory_region_get_ram_ptr(bios->mr), bios_size); ++ } ++ if (buffer_is_zero(cd_seg_host, oprom_size)) { ++ fprintf(stderr, "copying C and D segments from pc.rom to pc.ram\n"); ++ memcpy(cd_seg_host, memory_region_get_ram_ptr(oprom->mr), oprom_size); ++ } ++ rcu_read_unlock(); ++} ++ + void loadvm_free_handlers(MigrationIncomingState *mis) + { + LoadStateEntry *le, *new_le; +@@ -2066,6 +2128,13 @@ int qemu_loadvm_state(QEMUFile *f) + } + } + ++ /* Supplement SeaBIOS's shadowing now, because it was useless when the ++ * incoming VM started on the RHEL-6 emulator. ++ */ ++ if (shadow_bios_after_incoming) { ++ shadow_bios(); ++ } ++ + cpu_synchronize_all_post_init(); + + return ret; +diff --git a/numa.c b/numa.c +index 6fc2393..80d9029 100644 +--- a/numa.c ++++ b/numa.c +@@ -452,6 +452,19 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner, + return; + } + ++ /* The shadow_bios_after_incoming hack at savevm.c:shadow_bios() is not ++ * able to handle the multiple memory blocks added when using NUMA ++ * memdevs. We can disallow -numa memdev= when using rhel6.* machine-types ++ * because RHEL-6 didn't support the NUMA memdev option. ++ */ ++ if (shadow_bios_after_incoming) { ++ MachineClass *mc; ++ mc = MACHINE_GET_CLASS(current_machine); ++ error_report("-numa memdev is not supported by machine %s", ++ mc->name); ++ exit(1); ++ } ++ + memory_region_init(mr, owner, name, ram_size); + for (i = 0; i < MAX_NODES; i++) { + uint64_t size = numa_info[i].node_mem; +diff --git a/qdev-monitor.c b/qdev-monitor.c +index 5f2fcdf..2cdc643 100644 +--- a/qdev-monitor.c ++++ b/qdev-monitor.c +@@ -43,7 +43,6 @@ typedef struct QDevAlias + + /* Please keep this table sorted by typename. */ + static const QDevAlias qdev_alias_table[] = { +- { "e1000", "e1000-82540em" }, + { "ich9-ahci", "ahci" }, + { "kvm-pci-assign", "pci-assign" }, + { "lsi53c895a", "lsi" }, +diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py +index bcef7ee..ffb13d1 100755 +--- a/scripts/vmstate-static-checker.py ++++ b/scripts/vmstate-static-checker.py +@@ -104,7 +104,6 @@ def get_changed_sec_name(sec): + # Section names can change -- see commit 292b1634 for an example. + changes = { + "ICH9 LPC": "ICH9-LPC", +- "e1000-82540em": "e1000", + } + + for item in changes: +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index 13c0985..c3b06d3 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -758,20 +758,29 @@ struct X86CPUDefinition { + + static X86CPUDefinition builtin_x86_defs[] = { + { ++ /* qemu64 is the default CPU model for all *-rhel7.* machine-types. ++ * The default on RHEL-6 was cpu64-rhel6. ++ * libvirt assumes that qemu64 is the default for _all_ machine-types, ++ * so we should try to keep qemu64 and cpu64-rhel6 as similar as ++ * possible. ++ */ + .name = "qemu64", + .level = 0xd, + .vendor = CPUID_VENDOR_AMD, + .family = 6, +- .model = 6, ++ .model = 13, + .stepping = 3, +- .features[FEAT_1_EDX] = +- PPRO_FEATURES | +- CPUID_MTRR | CPUID_CLFLUSH | CPUID_MCA | +- CPUID_PSE36, +- .features[FEAT_1_ECX] = +- CPUID_EXT_SSE3 | CPUID_EXT_CX16, +- .features[FEAT_8000_0001_EDX] = +- CPUID_EXT2_LM | CPUID_EXT2_SYSCALL | CPUID_EXT2_NX, ++ .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | ++ CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | ++ CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | ++ CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | ++ CPUID_PSE | CPUID_DE | CPUID_FP87, ++ .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | ++ CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | ++ CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | ++ CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | ++ CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, + .features[FEAT_8000_0001_ECX] = + CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM, + .xlevel = 0x8000000A, +@@ -997,6 +1006,29 @@ static X86CPUDefinition builtin_x86_defs[] = { + .model_id = "Intel(R) Atom(TM) CPU N270 @ 1.60GHz", + }, + { ++ .name = "cpu64-rhel6", ++ .level = 4, ++ .vendor = CPUID_VENDOR_AMD, ++ .family = 6, ++ .model = 13, ++ .stepping = 3, ++ .features[FEAT_1_EDX] = CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | ++ CPUID_MMX | CPUID_CLFLUSH | CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | ++ CPUID_MCA | CPUID_PGE | CPUID_MTRR | CPUID_SEP | CPUID_APIC | ++ CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | ++ CPUID_PSE | CPUID_DE | CPUID_FP87, ++ .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | ++ CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | ++ CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | ++ CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | ++ CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ .features[FEAT_8000_0001_ECX] = CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | ++ CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, ++ .xlevel = 0x8000000A, ++ .model_id = "QEMU Virtual CPU version (cpu64-rhel6)", ++ }, ++ { + .name = "Conroe", + .level = 10, + .vendor = CPUID_VENDOR_INTEL, +@@ -1498,6 +1530,7 @@ static PropValue kvm_default_props[] = { + { "acpi", "off" }, + { "monitor", "off" }, + { "svm", "off" }, ++ { "kvm-pv-unhalt", "on" }, + { NULL, NULL }, + }; + +diff --git a/target/i386/machine.c b/target/i386/machine.c +index 78ae2f9..6629e1b 100644 +--- a/target/i386/machine.c ++++ b/target/i386/machine.c +@@ -927,6 +927,26 @@ static const VMStateDescription vmstate_mcg_ext_ctl = { + } + }; + ++static bool vmstate_xsave_needed(void *opaque) ++{ ++ /* The xsave state is already on the main "cpu" section */ ++ return false; ++} ++ ++static const VMStateDescription vmstate_xsave ={ ++ .name = "cpu/xsave", ++ .version_id = 1, ++ .minimum_version_id = 1, ++ .minimum_version_id_old = 1, ++ .needed = vmstate_xsave_needed, ++ .fields = (VMStateField []) { ++ VMSTATE_UINT64_V(env.xcr0, X86CPU, 1), ++ VMSTATE_UINT64_V(env.xstate_bv, X86CPU, 1), ++ VMSTATE_YMMH_REGS_VARS(env.xmm_regs, X86CPU, CPU_NB_REGS, 1), ++ VMSTATE_END_OF_LIST() ++ } ++}; ++ + VMStateDescription vmstate_x86_cpu = { + .name = "cpu", + .version_id = 12, +@@ -1054,6 +1074,7 @@ VMStateDescription vmstate_x86_cpu = { + &vmstate_pkru, + #endif + &vmstate_mcg_ext_ctl, ++ &vmstate_xsave, + NULL + } + }; +-- +1.8.3.1 + diff --git a/SOURCES/0003-Enable-disable-devices-for-RHEL-7.patch b/SOURCES/0003-Enable-disable-devices-for-RHEL-7.patch new file mode 100644 index 0000000..ad0981d --- /dev/null +++ b/SOURCES/0003-Enable-disable-devices-for-RHEL-7.patch @@ -0,0 +1,1844 @@ +From a36a3ad800b282cef9d72e6d8026470035f8f21c Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Mon, 11 Jan 2016 11:53:33 +0100 +Subject: Enable/disable devices for RHEL 7 + +This commit adds all changes related to changes in supported devices +up to qemu-kvm-rhev-2.1.2-16.el7. + +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 7f8f6f97fbd36398d25207aa8aad39edc4f8de06) + +Rebase notes (2.9.0): +- enabled CONFIG_ARM_V7M for aarch64 +- need to fix cpu mask +- disabled some irrelevant ppc64 tests +- Adding pxe-e1000e.rom to Inital redhat commit +- Context changed in vfio_probe_igd_bar4_quirk (rc3) + +Rebase notes (2.8.0): +- Removed CONFIG_PIIX_PCI (upstream) +- Disabled POWERNV +- Disabled additional occurencies of prom-env-test +- Disabled additional occurencies of usb-hcd-ohci-test and usb-hcd-uhci-test +- Disabled unsupported machine types in boot-serieal-test +- Disabled 2.7 machine type compatibility test in test-x86-cpuid-compat +- Disabled pnv-xscom-test +- Disabled RHEl 6 machine types for qom-test (failing acpi setting) +- Added diffutils BuildRequires and diff usage for make check + +Rebase notes (2.6.0): +- disabled prom-env-test + +Rebase notes (2.4.0): +- fixed types +- include CONFIG_PLATFORM_BUS for aarch64 +- disable failing virtio-scsi-test + +Rebase notes (2.3.0): +- Added USB=y in 2.3-rc2 (used instead of downstream version fora aarch64) + +Merged patches (2.9.0): +- 9320fc1 Fix unuseds/Fedora build +- cb16934 config: Remove EHCI from ppc64 builds +- 626fe4d Disable qemu,register device +- 783a0b2 Disable vfio-pci-igd-lpc-bridge device +- bf7c127 Disable new virtio crypto devices +- a4d3c4e Disable amd iommu devices +- 5396ebc Disable loader device +- 1957779 Disable or-irq device +- 25ee621 Hide new floppy device +- 2bd29ed Disable devices for for AArch64 QEMU + +Merged patches (2.7.0): +- e2944a5 RHEL: Disable unsupported PowerPC CPU models + - have to add additional "if 0" sections to hw/ppc/spapr_cpu_core.c +- 81b2836 Remove unsupported VFIO devices from QEMU +- 1248029 Disable spapr-rng +- 351e1fb Disable Windows enlightnementas +- 5760290 Disable mptsas1068 device +- 0b74460 Disable sd-card +- 2eaf71c Disable rocker device +- e0ed699 Disable new ipmi devices + - disable ipmi tests in bios-tables-test +- 30e3bee Disable hyperv-testdev +- 8a9aadf Disable allwiner_ahci device +- a41119d Disable igd-passthrough-i440FX +- e305bb4 Disable vfio-platform device +- a127042 rhel: Revert unwanted inconsequential changes to ivshmem +- ce1419c rhel: Disable ivshmem-plain migration, ivshmem-doorbell, ivshmem +- 3f9349b q35: disable s3/s4 by default +- 2158ca1 i8257: Set no-user flag +- b2a3bb9 e1000e: add boot rom +- have to add pxe-e1000e.rom to source files + +Merged patches (2.6.0): +- ce3206a qemu-iotests: Fix broken test cases + - Reduced to disabling test 071 only +- bb34585 qemu-iotests: Disable 099 (requires blkverify) +- 81be408 build: reenable local builds to pass --enable-debug (downstream only) + +Merged patches (2.4.0): +- fa4fd10 AArch64: Enable ACPI +- 1219d52 ivshmem: RHEL-only: remove unsupported code +- 5f6d954 ivshmem: RHEL-only: explicitly remove dead code +- b88bbf0 Revert "rhel: Drop "ivshmem" device" +- 8f0aadf Split serial-isa into its own config option +- 01bff0f rhel: Disable "info irq" and "info pic" for Power +- b915077 RHEL: Disable remaining unsupported devices for ppc +- 64cbdc5 Mark onboard devices as cannot_instantiate_with_device_add_yet +- 4792566 Disable sdhci device +- bda8169 Disable Educational device +- a17a8fb rhel: Revert unwanted cannot_instantiate_with_device_add_yet changes +- 91c76c5 Remove intel-iommu device +- ec1615d Disable additional e1000 models + +(cherry picked from commit 0d74456ab7a1bf5c0ad53c5b3f6bab17f1798a61) +--- + default-configs/aarch64-softmmu.mak | 26 ++++++++++----- + default-configs/arm-softmmu.mak | 3 -- + default-configs/i386-softmmu.mak | 2 +- + default-configs/mips-softmmu-common.mak | 1 - + default-configs/pci.mak | 19 ----------- + default-configs/ppc-softmmu.mak | 1 - + default-configs/ppc64-softmmu.mak | 56 ++++++++------------------------- + default-configs/ppcemb-softmmu.mak | 13 ++++++++ + default-configs/sound.mak | 4 --- + default-configs/usb.mak | 7 ----- + default-configs/x86_64-softmmu.mak | 14 ++------- + hw/acpi/ich9.c | 4 +-- + hw/block/fdc.c | 3 ++ + hw/block/pflash_cfi01.c | 1 + + hw/char/serial-pci.c | 4 +++ + hw/core/Makefile.objs | 7 +++-- + hw/display/cirrus_vga.c | 2 ++ + hw/dma/i8257.c | 2 ++ + hw/i386/Makefile.objs | 3 +- + hw/i386/kvm/clock.c | 1 + + hw/i386/kvm/ioapic.c | 1 + + hw/i386/kvmvapic.c | 1 + + hw/i386/pc.c | 3 +- + hw/ide/ahci.c | 5 +++ + hw/ide/piix.c | 5 ++- + hw/ide/via.c | 2 ++ + hw/input/pckbd.c | 2 ++ + hw/intc/ioapic.c | 1 + + hw/isa/isa-bus.c | 1 + + hw/misc/ivshmem.c | 11 +++++++ + hw/net/e1000.c | 2 ++ + hw/net/e1000e.c | 2 +- + hw/nvram/fw_cfg.c | 3 ++ + hw/pci-host/piix.c | 4 +++ + hw/pci-host/q35.c | 1 + + hw/ppc/Makefile.objs | 3 +- + hw/ppc/spapr.c | 3 +- + hw/ppc/spapr_cpu_core.c | 6 +++- + hw/usb/ccid-card-emulated.c | 2 ++ + hw/vfio/Makefile.objs | 3 -- + hw/vfio/pci-quirks.c | 5 +++ + hw/virtio/Makefile.objs | 5 +-- + hw/virtio/virtio-mmio.c | 1 + + qemu-options.hx | 5 --- + redhat/Makefile.common | 1 + + redhat/qemu-kvm.spec.template | 6 ++-- + stubs/Makefile.objs | 1 + + stubs/ide-isa.c | 13 ++++++++ + target/arm/cpu.c | 3 +- + target/i386/cpu.c | 15 +++------ + target/ppc/cpu-models.c | 15 ++++++++- + tests/Makefile.include | 50 +++++------------------------ + tests/bios-tables-test.c | 4 +++ + tests/boot-order-test.c | 7 +++++ + tests/boot-serial-test.c | 8 ++--- + tests/e1000-test.c | 2 ++ + tests/endianness-test.c | 2 ++ + tests/ivshmem-test.c | 10 +++++- + tests/qemu-iotests/051 | 20 ++++++------ + tests/qemu-iotests/group | 4 +-- + tests/qom-test.c | 4 ++- + tests/test-x86-cpuid-compat.c | 3 +- + tests/usb-hcd-xhci-test.c | 5 ++- + tests/virtio-scsi-test.c | 9 ++++-- + vl.c | 2 +- + 65 files changed, 231 insertions(+), 203 deletions(-) + create mode 100644 stubs/ide-isa.c + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index abd18c2..38e9291 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -1,11 +1,23 @@ + # Default configuration for aarch64-softmmu + +-# We support all the 32 bit boards so need all their config +-include arm-softmmu.mak +- +-CONFIG_AUX=y +-CONFIG_DDC=y +-CONFIG_DPCD=y +-CONFIG_XLNX_ZYNQMP=y ++# Disabled in Red Hat Enterprise Linux ++# CONFIG_AUX=y ++# CONFIG_DDC=y ++# CONFIG_DPCD=y ++# CONFIG_XLNX_ZYNQMP=y ++CONFIG_PCI=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO=y ++CONFIG_STELLARIS=y ++CONFIG_ARM_GIC=y ++CONFIG_ARM_GIC_KVM=$(CONFIG_KVM) ++CONFIG_PL011=y ++CONFIG_PL031=y ++CONFIG_PFLASH_CFI01=y ++CONFIG_PCI_GENERIC=y ++CONFIG_ACPI=y ++CONFIG_PLATFORM_BUS=y ++CONFIG_SMBIOS=y + CONFIG_PL061=y + CONFIG_GPIO_KEY=y ++CONFIG_ARM_V7M=y +diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak +index 3ae1bf4..8f41817 100644 +--- a/default-configs/arm-softmmu.mak ++++ b/default-configs/arm-softmmu.mak +@@ -92,9 +92,6 @@ CONFIG_STM32F2XX_ADC=y + CONFIG_STM32F2XX_SPI=y + CONFIG_STM32F205_SOC=y + +-CONFIG_VERSATILE_PCI=y +-CONFIG_VERSATILE_I2C=y +- + CONFIG_PCI_GENERIC=y + CONFIG_VFIO_XGMAC=y + CONFIG_VFIO_AMD_XGBE=y +diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak +index 029e952..aa19ed5 100644 +--- a/default-configs/i386-softmmu.mak ++++ b/default-configs/i386-softmmu.mak +@@ -30,7 +30,6 @@ CONFIG_APM=y + CONFIG_I8257=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_HPET=y + CONFIG_APPLESMC=y + CONFIG_I8259=y +@@ -40,6 +39,7 @@ CONFIG_MC146818RTC=y + CONFIG_PCI_PIIX=y + CONFIG_WDT_IB700=y + CONFIG_XEN_I386=$(CONFIG_XEN) ++CONFIG_ISA_BUS=y + CONFIG_ISA_DEBUG=y + CONFIG_ISA_TESTDEV=y + CONFIG_VMPORT=y +diff --git a/default-configs/mips-softmmu-common.mak b/default-configs/mips-softmmu-common.mak +index 7d8f5db..9b4d047 100644 +--- a/default-configs/mips-softmmu-common.mak ++++ b/default-configs/mips-softmmu-common.mak +@@ -25,7 +25,6 @@ CONFIG_I8257=y + CONFIG_PIIX4=y + CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y + CONFIG_MIPSNET=y + CONFIG_PFLASH_CFI01=y + CONFIG_I8259=y +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index 60dc651..f943baa 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -4,41 +4,22 @@ CONFIG_ISA_BUS=y + CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO=y + CONFIG_USB_UHCI=y +-CONFIG_USB_OHCI=y + CONFIG_USB_EHCI=y + CONFIG_USB_XHCI=y +-CONFIG_NE2000_PCI=y +-CONFIG_EEPRO100_PCI=y +-CONFIG_PCNET_PCI=y +-CONFIG_PCNET_COMMON=y + CONFIG_AC97=y + CONFIG_HDA=y +-CONFIG_ES1370=y +-CONFIG_LSI_SCSI_PCI=y +-CONFIG_VMW_PVSCSI_SCSI_PCI=y +-CONFIG_MEGASAS_SCSI_PCI=y +-CONFIG_MPTSAS_SCSI_PCI=y + CONFIG_RTL8139_PCI=y + CONFIG_E1000_PCI=y + CONFIG_E1000E_PCI=y +-CONFIG_VMXNET3_PCI=y + CONFIG_IDE_CORE=y + CONFIG_IDE_QDEV=y + CONFIG_IDE_PCI=y + CONFIG_AHCI=y +-CONFIG_ESP=y +-CONFIG_ESP_PCI=y + CONFIG_SERIAL=y + CONFIG_SERIAL_ISA=y + CONFIG_SERIAL_PCI=y +-CONFIG_IPACK=y + CONFIG_WDT_IB6300ESB=y + CONFIG_PCI_TESTDEV=y +-CONFIG_NVME_PCI=y +-CONFIG_SD=y +-CONFIG_SDHCI=y +-CONFIG_EDU=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_IVSHMEM=$(CONFIG_EVENTFD) +-CONFIG_ROCKER=y +diff --git a/default-configs/ppc-softmmu.mak b/default-configs/ppc-softmmu.mak +index 09c1d45..b9c9f2f 100644 +--- a/default-configs/ppc-softmmu.mak ++++ b/default-configs/ppc-softmmu.mak +@@ -31,7 +31,6 @@ CONFIG_PPCE500_PCI=y + CONFIG_IDE_ISA=y + CONFIG_IDE_CMD646=y + CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index 05c8335..a1fbb8d 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -1,59 +1,29 @@ + # Default configuration for ppc64-softmmu + +-include pci.mak ++# PCI configuration - cut down from the defaults in pci.mak ++CONFIG_PCI=y ++CONFIG_VIRTIO_PCI=y ++CONFIG_VIRTIO=y ++CONFIG_USB_XHCI=y ++CONFIG_WDT_IB6300ESB=y ++CONFIG_PCI_TESTDEV=y ++CONFIG_ISA_BUS=y ++ + include sound.mak + include usb.mak + CONFIG_VIRTIO_VGA=y +-CONFIG_ESCC=y +-CONFIG_M48T59=y ++CONFIG_VGA=y ++CONFIG_VGA_PCI=y + CONFIG_SERIAL=y +-CONFIG_PARALLEL=y +-CONFIG_I8254=y +-CONFIG_PCKBD=y +-CONFIG_FDC=y +-CONFIG_I8257=y +-CONFIG_I82374=y +-CONFIG_OPENPIC=y +-CONFIG_PREP_PCI=y +-CONFIG_I82378=y +-CONFIG_PC87312=y +-CONFIG_MACIO=y +-CONFIG_PCSPK=y +-CONFIG_CUDA=y +-CONFIG_ADB=y +-CONFIG_MAC_NVRAM=y +-CONFIG_MAC_DBDMA=y +-CONFIG_HEATHROW_PIC=y +-CONFIG_GRACKLE_PCI=y +-CONFIG_UNIN_PCI=y +-CONFIG_DEC_PCI=y +-CONFIG_PPCE500_PCI=y +-CONFIG_IDE_ISA=y +-CONFIG_IDE_CMD646=y +-CONFIG_IDE_MACIO=y +-CONFIG_NE2000_ISA=y +-CONFIG_PFLASH_CFI01=y +-CONFIG_PFLASH_CFI02=y +-CONFIG_PTIMER=y +-CONFIG_I8259=y +-CONFIG_XILINX=y +-CONFIG_XILINX_ETHLITE=y + CONFIG_PSERIES=y +-CONFIG_POWERNV=y +-CONFIG_PREP=y +-CONFIG_MAC=y +-CONFIG_E500=y +-CONFIG_OPENPIC_KVM=$(and $(CONFIG_E500),$(CONFIG_KVM)) +-CONFIG_PLATFORM_BUS=y +-CONFIG_ETSEC=y ++#CONFIG_POWERNV=y + CONFIG_LIBDECNUMBER=y ++CONFIG_USB_OHCI=y + # For pSeries + CONFIG_XICS=$(CONFIG_PSERIES) + CONFIG_XICS_SPAPR=$(CONFIG_PSERIES) + CONFIG_XICS_KVM=$(and $(CONFIG_PSERIES),$(CONFIG_KVM)) + # For PReP + CONFIG_SERIAL_ISA=y +-CONFIG_MC146818RTC=y +-CONFIG_ISA_TESTDEV=y + CONFIG_MEM_HOTPLUG=y + CONFIG_RS6000_MC=y +diff --git a/default-configs/ppcemb-softmmu.mak b/default-configs/ppcemb-softmmu.mak +index 7f56004..b261e07 100644 +--- a/default-configs/ppcemb-softmmu.mak ++++ b/default-configs/ppcemb-softmmu.mak +@@ -8,6 +8,19 @@ CONFIG_SERIAL=y + CONFIG_SERIAL_ISA=y + CONFIG_I8257=y + CONFIG_OPENPIC=y ++CONFIG_MACIO=y ++CONFIG_CUDA=y ++CONFIG_ADB=y ++CONFIG_MAC_NVRAM=y ++CONFIG_MAC_DBDMA=y ++CONFIG_HEATHROW_PIC=y ++CONFIG_GRACKLE_PCI=y ++CONFIG_UNIN_PCI=y ++CONFIG_DEC_PCI=y ++CONFIG_PPCE500_PCI=y ++CONFIG_IDE_ISA=y ++CONFIG_IDE_CMD646=y ++CONFIG_IDE_MACIO=y + CONFIG_PFLASH_CFI01=y + CONFIG_PFLASH_CFI02=y + CONFIG_PTIMER=y +diff --git a/default-configs/sound.mak b/default-configs/sound.mak +index 4f22c34..e69de29 100644 +--- a/default-configs/sound.mak ++++ b/default-configs/sound.mak +@@ -1,4 +0,0 @@ +-CONFIG_SB16=y +-CONFIG_ADLIB=y +-CONFIG_GUS=y +-CONFIG_CS4231A=y +diff --git a/default-configs/usb.mak b/default-configs/usb.mak +index f4b8568..4726c3e 100644 +--- a/default-configs/usb.mak ++++ b/default-configs/usb.mak +@@ -1,10 +1,3 @@ + CONFIG_USB=y +-CONFIG_USB_TABLET_WACOM=y + CONFIG_USB_STORAGE_BOT=y +-CONFIG_USB_STORAGE_UAS=y +-CONFIG_USB_STORAGE_MTP=y + CONFIG_USB_SMARTCARD=y +-CONFIG_USB_AUDIO=y +-CONFIG_USB_SERIAL=y +-CONFIG_USB_NETWORK=y +-CONFIG_USB_BLUETOOTH=y +diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak +index d1d7432..3282539 100644 +--- a/default-configs/x86_64-softmmu.mak ++++ b/default-configs/x86_64-softmmu.mak +@@ -4,19 +4,13 @@ include pci.mak + include sound.mak + include usb.mak + CONFIG_QXL=$(CONFIG_SPICE) +-CONFIG_VGA_ISA=y ++CONFIG_VGA_PCI=y + CONFIG_VGA_CIRRUS=y +-CONFIG_VMWARE_VGA=y + CONFIG_VIRTIO_VGA=y + CONFIG_VMMOUSE=y + CONFIG_IPMI=y +-CONFIG_IPMI_LOCAL=y +-CONFIG_IPMI_EXTERN=y +-CONFIG_ISA_IPMI_KCS=y +-CONFIG_ISA_IPMI_BT=y + CONFIG_SERIAL=y + CONFIG_SERIAL_ISA=y +-CONFIG_PARALLEL=y + CONFIG_I8254=y + CONFIG_PCSPK=y + CONFIG_PCKBD=y +@@ -28,11 +22,7 @@ CONFIG_ACPI_MEMORY_HOTPLUG=y + CONFIG_ACPI_CPU_HOTPLUG=y + CONFIG_APM=y + CONFIG_I8257=y +-CONFIG_IDE_ISA=y + CONFIG_IDE_PIIX=y +-CONFIG_NE2000_ISA=y +-CONFIG_HPET=y +-CONFIG_APPLESMC=y + CONFIG_I8259=y + CONFIG_PFLASH_CFI01=y + CONFIG_TPM_TIS=$(CONFIG_TPM) +@@ -40,6 +30,7 @@ CONFIG_MC146818RTC=y + CONFIG_PCI_PIIX=y + CONFIG_WDT_IB700=y + CONFIG_XEN_I386=$(CONFIG_XEN) ++CONFIG_ISA_BUS=y + CONFIG_ISA_DEBUG=y + CONFIG_ISA_TESTDEV=y + CONFIG_VMPORT=y +@@ -57,6 +48,5 @@ CONFIG_XIO3130=y + CONFIG_IOH3420=y + CONFIG_I82801B11=y + CONFIG_SMBIOS=y +-CONFIG_HYPERV_TESTDEV=$(CONFIG_KVM) + CONFIG_PXB=y + CONFIG_ACPI_VMGENID=y +diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c +index 5c279bb..9428cbf 100644 +--- a/hw/acpi/ich9.c ++++ b/hw/acpi/ich9.c +@@ -447,8 +447,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp) + 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/block/fdc.c b/hw/block/fdc.c +index a328693..f4f038d 100644 +--- a/hw/block/fdc.c ++++ b/hw/block/fdc.c +@@ -611,6 +611,7 @@ static void floppy_drive_class_init(ObjectClass *klass, void *data) + k->bus_type = TYPE_FLOPPY_BUS; + k->props = floppy_drive_properties; + k->desc = "virtual floppy drive"; ++ k->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo floppy_drive_info = { +@@ -2879,6 +2880,7 @@ static void sysbus_fdc_class_init(ObjectClass *klass, void *data) + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->props = sysbus_fdc_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + } + +@@ -2905,6 +2907,7 @@ static void sun4m_fdc_class_init(ObjectClass *klass, void *data) + DeviceClass *dc = DEVICE_CLASS(klass); + + dc->props = sun4m_fdc_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + } + +diff --git a/hw/block/pflash_cfi01.c b/hw/block/pflash_cfi01.c +index 594d4cf..9707c7b 100644 +--- a/hw/block/pflash_cfi01.c ++++ b/hw/block/pflash_cfi01.c +@@ -926,6 +926,7 @@ static void pflash_cfi01_class_init(ObjectClass *klass, void *data) + dc->realize = pflash_cfi01_realize; + dc->props = pflash_cfi01_properties; + dc->vmsd = &vmstate_pflash; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + } + +diff --git a/hw/char/serial-pci.c b/hw/char/serial-pci.c +index 303104d..bfa90ac 100644 +--- a/hw/char/serial-pci.c ++++ b/hw/char/serial-pci.c +@@ -228,6 +228,8 @@ static void multi_2x_serial_pci_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_pci_multi_serial; + dc->props = multi_2x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) +@@ -243,6 +245,8 @@ static void multi_4x_serial_pci_class_initfn(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_pci_multi_serial; + dc->props = multi_4x_serial_pci_properties; + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo serial_pci_info = { +diff --git a/hw/core/Makefile.objs b/hw/core/Makefile.objs +index 91450b2..3170968 100644 +--- a/hw/core/Makefile.objs ++++ b/hw/core/Makefile.objs +@@ -15,9 +15,10 @@ common-obj-$(CONFIG_SOFTMMU) += machine.o + common-obj-$(CONFIG_SOFTMMU) += loader.o + common-obj-$(CONFIG_FITLOADER) += loader-fit.o + common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.o +-common-obj-$(CONFIG_SOFTMMU) += register.o +-common-obj-$(CONFIG_SOFTMMU) += or-irq.o + common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o ++# Disabled in Red Hat Enterprise Linux ++# common-obj-$(CONFIG_SOFTMMU) += register.o ++# obj-$(CONFIG_SOFTMMU) += generic-loader.o ++# common-obj-$(CONFIG_SOFTMMU) += or-irq.o + +-obj-$(CONFIG_SOFTMMU) += generic-loader.o + obj-$(CONFIG_SOFTMMU) += null-machine.o +diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c +index 14008aa..38fa725 100644 +--- a/hw/display/cirrus_vga.c ++++ b/hw/display/cirrus_vga.c +@@ -3077,6 +3077,8 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass, void *data) + dc->realize = isa_cirrus_vga_realizefn; + dc->props = isa_cirrus_vga_properties; + set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo isa_cirrus_vga_info = { +diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c +index 8bd82e8..6d1057c 100644 +--- a/hw/dma/i8257.c ++++ b/hw/dma/i8257.c +@@ -591,6 +591,8 @@ static void i8257_class_init(ObjectClass *klass, void *data) + dc->reset = i8257_reset; + dc->vmsd = &vmstate_i8257; + dc->props = i8257_properties; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + + idc->get_transfer_mode = i8257_dma_get_transfer_mode; + idc->has_autoinitialization = i8257_dma_has_autoinitialization; +diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs +index 909ead6..a15db94 100644 +--- a/hw/i386/Makefile.objs ++++ b/hw/i386/Makefile.objs +@@ -3,7 +3,8 @@ obj-y += multiboot.o + obj-y += pc.o pc_piix.o pc_q35.o + obj-y += pc_sysfw.o + obj-y += x86-iommu.o intel_iommu.o +-obj-y += amd_iommu.o ++# Disabled in Red Hat Enterprise Linux ++# obj-y += amd_iommu.o + obj-$(CONFIG_XEN) += ../xenpv/ xen/ + + obj-y += kvmvapic.o +diff --git a/hw/i386/kvm/clock.c b/hw/i386/kvm/clock.c +index 13eca37..e59106a 100644 +--- a/hw/i386/kvm/clock.c ++++ b/hw/i386/kvm/clock.c +@@ -286,6 +286,7 @@ static void kvmclock_class_init(ObjectClass *klass, void *data) + dc->realize = kvmclock_realize; + dc->vmsd = &kvmclock_vmsd; + dc->props = kvmclock_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo kvmclock_info = { +diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c +index 98ca480..9ec1c14 100644 +--- a/hw/i386/kvm/ioapic.c ++++ b/hw/i386/kvm/ioapic.c +@@ -167,6 +167,7 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data) + k->post_load = kvm_ioapic_put; + dc->reset = kvm_ioapic_reset; + dc->props = kvm_ioapic_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo kvm_ioapic_info = { +diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c +index 82a4955..6b1ee98 100644 +--- a/hw/i386/kvmvapic.c ++++ b/hw/i386/kvmvapic.c +@@ -856,6 +856,7 @@ static void vapic_class_init(ObjectClass *klass, void *data) + dc->reset = vapic_reset; + dc->vmsd = &vmstate_vapic; + dc->realize = vapic_realize; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo vapic_type = { +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index d24388e..815bd65 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -1596,8 +1596,9 @@ void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi, + } + + serial_hds_isa_init(isa_bus, 0, MAX_SERIAL_PORTS); ++#if 0 /* Disabled for Red Hat Enterprise Linux 7 */ + parallel_hds_isa_init(isa_bus, MAX_PARALLEL_PORTS); +- ++#endif + a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2); + i8042 = isa_create_simple(isa_bus, "i8042"); + i8042_setup_a20_line(i8042, a20_line[0]); +diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c +index f60826d..d18566f 100644 +--- a/hw/ide/ahci.c ++++ b/hw/ide/ahci.c +@@ -1720,6 +1720,7 @@ static void sysbus_ahci_class_init(ObjectClass *klass, void *data) + dc->vmsd = &vmstate_sysbus_ahci; + dc->props = sysbus_ahci_properties; + dc->reset = sysbus_ahci_reset; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); + } + +@@ -1731,6 +1732,7 @@ static const TypeInfo sysbus_ahci_info = { + .class_init = sysbus_ahci_class_init, + }; + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + #define ALLWINNER_AHCI_BISTAFR ((0xa0 - ALLWINNER_AHCI_MMIO_OFF) / 4) + #define ALLWINNER_AHCI_BISTCR ((0xa4 - ALLWINNER_AHCI_MMIO_OFF) / 4) + #define ALLWINNER_AHCI_BISTFCTR ((0xa8 - ALLWINNER_AHCI_MMIO_OFF) / 4) +@@ -1824,11 +1826,14 @@ static const TypeInfo allwinner_ahci_info = { + .instance_init = allwinner_ahci_init, + .class_init = allwinner_ahci_class_init, + }; ++#endif + + static void sysbus_ahci_register_types(void) + { + type_register_static(&sysbus_ahci_info); ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + type_register_static(&allwinner_ahci_info); ++#endif + } + + type_init(sysbus_ahci_register_types) +diff --git a/hw/ide/piix.c b/hw/ide/piix.c +index 7e2d767..808aa72 100644 +--- a/hw/ide/piix.c ++++ b/hw/ide/piix.c +@@ -254,7 +254,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->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo piix3_ide_info = { +@@ -281,6 +282,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->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo piix4_ide_info = { +diff --git a/hw/ide/via.c b/hw/ide/via.c +index 5b32ecb..434cc03 100644 +--- a/hw/ide/via.c ++++ b/hw/ide/via.c +@@ -220,6 +220,8 @@ static void via_ide_class_init(ObjectClass *klass, void *data) + k->revision = 0x06; + k->class_id = PCI_CLASS_STORAGE_IDE; + set_bit(DEVICE_CATEGORY_STORAGE, dc->categories); ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo via_ide_info = { +diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c +index d414288..78b6c01 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -570,6 +570,8 @@ static void i8042_class_initfn(ObjectClass *klass, void *data) + + dc->realize = i8042_realizefn; + dc->vmsd = &vmstate_kbd_isa; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo i8042_info = { +diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c +index 37c4386..7eb83fe 100644 +--- a/hw/intc/ioapic.c ++++ b/hw/intc/ioapic.c +@@ -448,6 +448,7 @@ static void ioapic_class_init(ObjectClass *klass, void *data) + k->post_load = ioapic_update_kvm_routes; + dc->reset = ioapic_reset_common; + dc->props = ioapic_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo ioapic_info = { +diff --git a/hw/isa/isa-bus.c b/hw/isa/isa-bus.c +index 348e0ea..9acc0cc 100644 +--- a/hw/isa/isa-bus.c ++++ b/hw/isa/isa-bus.c +@@ -221,6 +221,7 @@ static void isabus_bridge_class_init(ObjectClass *klass, void *data) + + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->fw_name = "isa"; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo isabus_bridge_info = { +diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c +index 82ce837..037c7b5 100644 +--- a/hw/misc/ivshmem.c ++++ b/hw/misc/ivshmem.c +@@ -849,6 +849,13 @@ static void ivshmem_common_realize(PCIDevice *dev, Error **errp) + return; + } + ++ /* Migration disabled for Red Hat Enterprise Linux: */ ++ if (s->master == ON_OFF_AUTO_ON) { ++ error_setg(errp, "master=on is not supported"); ++ return; ++ } ++ s->master = ON_OFF_AUTO_OFF; ++ + pci_conf = dev->config; + pci_conf[PCI_COMMAND] = PCI_COMMAND_IO | PCI_COMMAND_MEMORY; + +@@ -1146,6 +1153,8 @@ static void ivshmem_doorbell_class_init(ObjectClass *klass, void *data) + k->realize = ivshmem_doorbell_realize; + dc->props = ivshmem_doorbell_properties; + dc->vmsd = &ivshmem_doorbell_vmsd; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo ivshmem_doorbell_info = { +@@ -1315,6 +1324,8 @@ static void ivshmem_class_init(ObjectClass *klass, void *data) + dc->desc = "Inter-VM shared memory (legacy)"; + dc->props = ivshmem_properties; + dc->vmsd = &ivshmem_vmsd; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo ivshmem_info = { +diff --git a/hw/net/e1000.c b/hw/net/e1000.c +index 3d86146..d29e9ee 100644 +--- a/hw/net/e1000.c ++++ b/hw/net/e1000.c +@@ -1704,6 +1704,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, +@@ -1716,6 +1717,7 @@ static const E1000Info e1000_devices[] = { + .revision = 0x03, + .phy_id2 = E1000_PHY_ID2_8254xx_DEFAULT, + }, ++#endif + }; + + static const TypeInfo e1000_default_info = { +diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c +index 6e23493..e849f79 100644 +--- a/hw/net/e1000e.c ++++ b/hw/net/e1000e.c +@@ -665,7 +665,7 @@ static void e1000e_class_init(ObjectClass *class, void *data) + c->vendor_id = PCI_VENDOR_ID_INTEL; + c->device_id = E1000_DEV_ID_82574L; + c->revision = 0; +- c->romfile = "efi-e1000e.rom"; ++ c->romfile = "pxe-e1000e.rom"; + c->class_id = PCI_CLASS_NETWORK_ETHERNET; + c->is_express = 1; + +diff --git a/hw/nvram/fw_cfg.c b/hw/nvram/fw_cfg.c +index 316fca9..6fc63d2 100644 +--- a/hw/nvram/fw_cfg.c ++++ b/hw/nvram/fw_cfg.c +@@ -1023,6 +1023,7 @@ static void fw_cfg_class_init(ObjectClass *klass, void *data) + + dc->reset = fw_cfg_reset; + dc->vmsd = &vmstate_fw_cfg; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo fw_cfg_info = { +@@ -1101,6 +1102,7 @@ static void fw_cfg_io_class_init(ObjectClass *klass, void *data) + + dc->realize = fw_cfg_io_realize; + dc->props = fw_cfg_io_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo fw_cfg_io_info = { +@@ -1167,6 +1169,7 @@ static void fw_cfg_mem_class_init(ObjectClass *klass, void *data) + + dc->realize = fw_cfg_mem_realize; + dc->props = fw_cfg_mem_properties; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static const TypeInfo fw_cfg_mem_info = { +diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c +index f9218aa..7c3b7c1 100644 +--- a/hw/pci-host/piix.c ++++ b/hw/pci-host/piix.c +@@ -756,6 +756,7 @@ static const TypeInfo i440fx_info = { + .class_init = i440fx_class_init, + }; + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + /* IGD Passthrough Host Bridge. */ + typedef struct { + uint8_t offset; +@@ -844,6 +845,7 @@ static const TypeInfo igd_passthrough_i440fx_info = { + .instance_size = sizeof(PCII440FXState), + .class_init = igd_passthrough_i440fx_class_init, + }; ++#endif + + static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge, + PCIBus *rootbus) +@@ -888,7 +890,9 @@ static const TypeInfo i440fx_pcihost_info = { + static void i440fx_register_types(void) + { + type_register_static(&i440fx_info); ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + type_register_static(&igd_passthrough_i440fx_info); ++#endif + type_register_static(&piix3_pci_type_info); + type_register_static(&piix3_info); + type_register_static(&piix3_xen_info); +diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c +index 344f77b..8434f6f 100644 +--- a/hw/pci-host/q35.c ++++ b/hw/pci-host/q35.c +@@ -159,6 +159,7 @@ static void q35_host_class_init(ObjectClass *klass, void *data) + dc->cannot_instantiate_with_device_add_yet = true; + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->fw_name = "pci"; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + } + + static void q35_host_initfn(Object *obj) +diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs +index 72edbf1..82ccc78 100644 +--- a/hw/ppc/Makefile.objs ++++ b/hw/ppc/Makefile.objs +@@ -3,7 +3,7 @@ obj-y += ppc.o ppc_booke.o fdt.o + # IBM pSeries (sPAPR) + obj-$(CONFIG_PSERIES) += spapr.o spapr_vio.o spapr_events.o + obj-$(CONFIG_PSERIES) += spapr_hcall.o spapr_iommu.o spapr_rtas.o +-obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o spapr_rng.o ++obj-$(CONFIG_PSERIES) += spapr_pci.o spapr_rtc.o spapr_drc.o + obj-$(CONFIG_PSERIES) += spapr_cpu_core.o spapr_ovec.o + # IBM PowerNV + obj-$(CONFIG_POWERNV) += pnv.o pnv_xscom.o pnv_core.o pnv_lpc.o +@@ -13,7 +13,6 @@ endif + obj-$(CONFIG_PSERIES) += spapr_rtas_ddw.o + # PowerPC 4xx boards + obj-y += ppc4xx_devs.o ppc405_uc.o +-obj-y += ppc4xx_pci.o + # PReP + obj-$(CONFIG_PREP) += prep.o + obj-$(CONFIG_PREP) += prep_systemio.o +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 596cc11..9bcf6c3 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -983,6 +983,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr, + /* /vdevice */ + spapr_dt_vdevice(spapr->vio_bus, fdt); + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + if (object_resolve_path_type("", TYPE_SPAPR_RNG, NULL)) { + ret = spapr_rng_populate_dt(fdt); + if (ret < 0) { +@@ -990,7 +991,7 @@ static void *spapr_build_fdt(sPAPRMachineState *spapr, + exit(1); + } + } +- ++#endif + QLIST_FOREACH(phb, &spapr->phbs, list) { + ret = spapr_populate_pci_dt(phb, PHANDLE_XICP, fdt); + if (ret < 0) { +diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c +index 6883f09..0bc7c6d 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -219,6 +219,7 @@ err: + } + + static const char *spapr_core_models[] = { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* 970 */ + "970_v2.2", + +@@ -231,6 +232,8 @@ static const char *spapr_core_models[] = { + /* POWER5+ */ + "POWER5+_v2.1", + ++ { .name = "POWER5+_v2.1", .initfn = spapr_cpu_core_POWER5plus_initfn }, ++#endif + /* POWER7 */ + "POWER7_v2.3", + +@@ -245,9 +248,10 @@ static const char *spapr_core_models[] = { + + /* POWER8NVL */ + "POWER8NVL_v1.0", +- ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* POWER9 */ + "POWER9_v1.0", ++#endif + }; + + void spapr_cpu_core_class_init(ObjectClass *oc, void *data) +diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c +index 9962786..560b787 100644 +--- a/hw/usb/ccid-card-emulated.c ++++ b/hw/usb/ccid-card-emulated.c +@@ -588,6 +588,8 @@ static void emulated_class_initfn(ObjectClass *klass, void *data) + set_bit(DEVICE_CATEGORY_INPUT, dc->categories); + dc->desc = "emulated smartcard"; + dc->props = emulated_card_properties; ++ /* Disabled for Red Hat Enterprise Linux: */ ++ dc->cannot_instantiate_with_device_add_yet = true; + } + + static const TypeInfo emulated_card_info = { +diff --git a/hw/vfio/Makefile.objs b/hw/vfio/Makefile.objs +index 05e7fbb..e78d433 100644 +--- a/hw/vfio/Makefile.objs ++++ b/hw/vfio/Makefile.objs +@@ -1,8 +1,5 @@ + ifeq ($(CONFIG_LINUX), y) + obj-$(CONFIG_SOFTMMU) += common.o + obj-$(CONFIG_PCI) += pci.o pci-quirks.o +-obj-$(CONFIG_SOFTMMU) += platform.o +-obj-$(CONFIG_VFIO_XGMAC) += calxeda-xgmac.o +-obj-$(CONFIG_VFIO_AMD_XGBE) += amd-xgbe.o + obj-$(CONFIG_SOFTMMU) += spapr.o + endif +diff --git a/hw/vfio/pci-quirks.c b/hw/vfio/pci-quirks.c +index 349085e..d3c5291 100644 +--- a/hw/vfio/pci-quirks.c ++++ b/hw/vfio/pci-quirks.c +@@ -1189,6 +1189,8 @@ static void vfio_pci_igd_lpc_bridge_class_init(ObjectClass *klass, void *data) + set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->desc = "VFIO dummy ISA/LPC bridge for IGD assignment"; + dc->hotpluggable = false; ++ /* Disabled in Red Hat Enterprise Linux */ ++ dc->cannot_instantiate_with_device_add_yet = true; + k->realize = vfio_pci_igd_lpc_bridge_realize; + k->class_id = PCI_CLASS_BRIDGE_ISA; + } +@@ -1378,6 +1380,9 @@ static void vfio_probe_igd_bar4_quirk(VFIOPCIDevice *vdev, int nr) + 0, PCI_DEVFN(0x2, 0))) { + return; + } ++ ++ /* Disabled in Red Hat Enterprise Linux */ ++ return; + + /* + * We need to create an LPC/ISA bridge at PCI bus address 00:1f.0 that we +diff --git a/hw/virtio/Makefile.objs b/hw/virtio/Makefile.objs +index 765d363..a5a0936 100644 +--- a/hw/virtio/Makefile.objs ++++ b/hw/virtio/Makefile.objs +@@ -7,8 +7,9 @@ common-obj-y += virtio-mmio.o + obj-y += virtio.o virtio-balloon.o + obj-$(CONFIG_LINUX) += vhost.o vhost-backend.o vhost-user.o + obj-$(CONFIG_VHOST_VSOCK) += vhost-vsock.o +-obj-y += virtio-crypto.o +-obj-$(CONFIG_VIRTIO_PCI) += virtio-crypto-pci.o ++# Disabled in Red Hat Enterprise Linux ++#obj-y += virtio-crypto.o ++#obj-$(CONFIG_VIRTIO_PCI) += virtio-crypto-pci.o + endif + + common-obj-$(call lnot,$(CONFIG_LINUX)) += vhost-stub.o +diff --git a/hw/virtio/virtio-mmio.c b/hw/virtio/virtio-mmio.c +index 5807aa8..4d0ec31 100644 +--- a/hw/virtio/virtio-mmio.c ++++ b/hw/virtio/virtio-mmio.c +@@ -448,6 +448,7 @@ static void virtio_mmio_class_init(ObjectClass *klass, void *data) + + dc->realize = virtio_mmio_realizefn; + dc->reset = virtio_mmio_reset; ++ dc->cannot_instantiate_with_device_add_yet = true; /* RH state preserve */ + set_bit(DEVICE_CATEGORY_MISC, dc->categories); + dc->props = virtio_mmio_properties; + } +diff --git a/qemu-options.hx b/qemu-options.hx +index 99af8ed..d5a002d 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -1545,11 +1545,6 @@ ETEXI + + DEF("no-hpet", 0, QEMU_OPTION_no_hpet, + "-no-hpet disable HPET\n", QEMU_ARCH_I386) +-STEXI +-@item -no-hpet +-@findex -no-hpet +-Disable HPET support. +-ETEXI + + 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/stubs/Makefile.objs b/stubs/Makefile.objs +index 224f04b..17e759d 100644 +--- a/stubs/Makefile.objs ++++ b/stubs/Makefile.objs +@@ -37,3 +37,4 @@ stub-obj-y += target-monitor-defs.o + stub-obj-y += target-get-monitor-def.o + stub-obj-y += pc_madt_cpu_entry.o + stub-obj-y += vmgenid.o ++stub-obj-y += ide-isa.o +diff --git a/stubs/ide-isa.c b/stubs/ide-isa.c +new file mode 100644 +index 0000000..5dacaa5 +--- /dev/null ++++ b/stubs/ide-isa.c +@@ -0,0 +1,13 @@ ++#include ++#include ++#include ++ ++ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq, ++ DriveInfo *hd0, DriveInfo *hd1) ++{ ++ /* ++ * In theory the real isa_ide_init() function can return NULL, but no ++ * caller actually checks for that. Make sure we go out with a clear bang. ++ */ ++ abort(); ++} +diff --git a/target/arm/cpu.c b/target/arm/cpu.c +index 04b062c..9e2800d 100644 +--- a/target/arm/cpu.c ++++ b/target/arm/cpu.c +@@ -1716,7 +1716,8 @@ static void arm_cpu_register_types(void) + type_register_static(&arm_cpu_type_info); + + while (info->name) { +- cpu_register(info); ++ if (!strcmp(info->name, "cortex-a15")) ++ cpu_register(info); + info++; + } + } +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index c3b06d3..dec6c78 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -776,11 +776,8 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | + CPUID_PSE | CPUID_DE | CPUID_FP87, + .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, +- .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | +- CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | +- CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | +- CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | +- CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_NX | ++ CPUID_EXT2_SYSCALL, + .features[FEAT_8000_0001_ECX] = + CPUID_EXT3_LAHF_LM | CPUID_EXT3_SVM, + .xlevel = 0x8000000A, +@@ -1018,11 +1015,7 @@ static X86CPUDefinition builtin_x86_defs[] = { + CPUID_CX8 | CPUID_MCE | CPUID_PAE | CPUID_MSR | CPUID_TSC | + CPUID_PSE | CPUID_DE | CPUID_FP87, + .features[FEAT_1_ECX] = CPUID_EXT_CX16 | CPUID_EXT_SSE3, +- .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_FXSR | +- CPUID_EXT2_MMX | CPUID_EXT2_NX | CPUID_EXT2_PAT | CPUID_EXT2_CMOV | +- CPUID_EXT2_PGE | CPUID_EXT2_SYSCALL | CPUID_EXT2_APIC | +- CPUID_EXT2_CX8 | CPUID_EXT2_MCE | CPUID_EXT2_PAE | CPUID_EXT2_MSR | CPUID_EXT2_TSC | +- CPUID_EXT2_PSE | CPUID_EXT2_DE | CPUID_EXT2_FPU, ++ .features[FEAT_8000_0001_EDX] = CPUID_EXT2_LM | CPUID_EXT2_NX | CPUID_EXT2_SYSCALL, + .features[FEAT_8000_0001_ECX] = CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | + CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, + .xlevel = 0x8000000A, +@@ -4021,11 +4014,13 @@ static Property x86_cpu_properties[] = { + DEFINE_PROP_BOOL("hv-vapic", X86CPU, hyperv_vapic, false), + DEFINE_PROP_BOOL("hv-time", X86CPU, hyperv_time, false), + DEFINE_PROP_BOOL("hv-crash", X86CPU, hyperv_crash, false), ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + DEFINE_PROP_BOOL("hv-reset", X86CPU, hyperv_reset, false), + DEFINE_PROP_BOOL("hv-vpindex", X86CPU, hyperv_vpindex, false), + DEFINE_PROP_BOOL("hv-runtime", X86CPU, hyperv_runtime, false), + DEFINE_PROP_BOOL("hv-synic", X86CPU, hyperv_synic, false), + DEFINE_PROP_BOOL("hv-stimer", X86CPU, hyperv_stimer, false), ++#endif + DEFINE_PROP_BOOL("check", X86CPU, check_cpuid, true), + DEFINE_PROP_BOOL("enforce", X86CPU, enforce_cpuid, false), + DEFINE_PROP_BOOL("kvm", X86CPU, expose_kvm, true), +diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c +index 4d3e635..7861276 100644 +--- a/target/ppc/cpu-models.c ++++ b/target/ppc/cpu-models.c +@@ -70,6 +70,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, +@@ -1101,8 +1102,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 */ + #if defined(TODO) + POWERPC_DEF("620", CPU_POWERPC_620, 620, + "PowerPC 620") +@@ -1131,6 +1134,7 @@ + POWERPC_DEF("POWER6", CPU_POWERPC_POWER6, POWER6, + "POWER6") + #endif ++#endif + POWERPC_DEF("POWER7_v2.3", CPU_POWERPC_POWER7_v23, POWER7, + "POWER7 v2.3") + POWERPC_DEF("POWER7+_v2.1", CPU_POWERPC_POWER7P_v21, POWER7, +@@ -1141,6 +1145,7 @@ + "POWER8 v2.0") + POWERPC_DEF("POWER8NVL_v1.0",CPU_POWERPC_POWER8NVL_v10, POWER8, + "POWER8NVL v1.0") ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970, + "PowerPC 970 v2.2") + +@@ -1161,6 +1166,7 @@ + "PowerPC 970MP v1.0") + POWERPC_DEF("970mp_v1.1", CPU_POWERPC_970MP_v11, 970, + "PowerPC 970MP v1.1") ++#endif + #if defined(TODO) + POWERPC_DEF("Cell", CPU_POWERPC_CELL, 970, + "PowerPC Cell") +@@ -1226,6 +1232,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" }, +@@ -1381,22 +1388,27 @@ 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 */ + { "POWER3", "630" }, + { "POWER3+", "631" }, + { "POWER5+", "POWER5+_v2.1" }, + { "POWER5gs", "POWER5+_v2.1" }, ++#endif + { "POWER7", "POWER7_v2.3" }, + { "POWER7+", "POWER7+_v2.1" }, + { "POWER8E", "POWER8E_v2.1" }, + { "POWER8", "POWER8_v2.0" }, + { "POWER8NVL", "POWER8NVL_v1.0" }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "POWER9", "POWER9_v1.0" }, + { "970", "970_v2.2" }, + { "970fx", "970fx_v3.1" }, + { "970mp", "970mp_v1.1" }, + #endif +- ++#endif ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* Generic PowerPCs */ + #if defined(TARGET_PPC64) + { "ppc64", "970fx" }, +@@ -1404,5 +1416,6 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "ppc32", "604" }, + { "ppc", "ppc32" }, + { "default", "ppc" }, ++#endif + { NULL, NULL } + }; +diff --git a/tests/Makefile.include b/tests/Makefile.include +index f3de81f..0b94a20 100644 +--- a/tests/Makefile.include ++++ b/tests/Makefile.include +@@ -142,8 +142,6 @@ check-qtest-generic-y += tests/device-introspect-test$(EXESUF) + gcov-files-generic-y = qdev-monitor.c qmp.c + + gcov-files-ipack-y += hw/ipack/ipack.c +-check-qtest-ipack-y += tests/ipoctal232-test$(EXESUF) +-gcov-files-ipack-y += hw/char/ipoctal232.c + + check-qtest-virtioserial-y += tests/virtio-console-test$(EXESUF) + gcov-files-virtioserial-y += hw/char/virtio-console.c +@@ -175,23 +173,10 @@ check-qtest-pci-y += tests/e1000e-test$(EXESUF) + gcov-files-pci-y += hw/net/e1000e.c hw/net/e1000e_core.c + check-qtest-pci-y += tests/rtl8139-test$(EXESUF) + gcov-files-pci-y += hw/net/rtl8139.c +-check-qtest-pci-y += tests/pcnet-test$(EXESUF) +-gcov-files-pci-y += hw/net/pcnet.c +-gcov-files-pci-y += hw/net/pcnet-pci.c +-check-qtest-pci-y += tests/eepro100-test$(EXESUF) +-gcov-files-pci-y += hw/net/eepro100.c +-check-qtest-pci-y += tests/ne2000-test$(EXESUF) +-gcov-files-pci-y += hw/net/ne2000.c +-check-qtest-pci-y += tests/nvme-test$(EXESUF) +-gcov-files-pci-y += hw/block/nvme.c + check-qtest-pci-y += tests/ac97-test$(EXESUF) + gcov-files-pci-y += hw/audio/ac97.c +-check-qtest-pci-y += tests/es1370-test$(EXESUF) +-gcov-files-pci-y += hw/audio/es1370.c + check-qtest-pci-y += $(check-qtest-virtio-y) + gcov-files-pci-y += $(gcov-files-virtio-y) hw/virtio/virtio-pci.c +-check-qtest-pci-y += tests/tpci200-test$(EXESUF) +-gcov-files-pci-y += hw/ipack/tpci200.c + check-qtest-pci-y += $(check-qtest-ipack-y) + gcov-files-pci-y += $(gcov-files-ipack-y) + check-qtest-pci-y += tests/display-vga-test$(EXESUF) +@@ -218,8 +203,6 @@ check-qtest-i386-y += tests/bios-tables-test$(EXESUF) + check-qtest-i386-y += tests/boot-serial-test$(EXESUF) + check-qtest-i386-y += tests/pxe-test$(EXESUF) + check-qtest-i386-y += tests/rtc-test$(EXESUF) +-check-qtest-i386-y += tests/ipmi-kcs-test$(EXESUF) +-check-qtest-i386-y += tests/ipmi-bt-test$(EXESUF) + check-qtest-i386-y += tests/i440fx-test$(EXESUF) + check-qtest-i386-y += tests/fw_cfg-test$(EXESUF) + check-qtest-i386-y += tests/drive_del-test$(EXESUF) +@@ -228,8 +211,6 @@ check-qtest-i386-y += tests/tco-test$(EXESUF) + gcov-files-i386-y += hw/watchdog/watchdog.c hw/watchdog/wdt_ib700.c + check-qtest-i386-y += $(check-qtest-pci-y) + gcov-files-i386-y += $(gcov-files-pci-y) +-check-qtest-i386-y += tests/vmxnet3-test$(EXESUF) +-gcov-files-i386-y += hw/net/vmxnet3.c + gcov-files-i386-y += hw/net/net_rx_pkt.c + gcov-files-i386-y += hw/net/net_tx_pkt.c + check-qtest-i386-y += tests/pvpanic-test$(EXESUF) +@@ -238,8 +219,6 @@ check-qtest-i386-y += tests/i82801b11-test$(EXESUF) + gcov-files-i386-y += hw/pci-bridge/i82801b11.c + check-qtest-i386-y += tests/ioh3420-test$(EXESUF) + gcov-files-i386-y += hw/pci-bridge/ioh3420.c +-check-qtest-i386-y += tests/usb-hcd-ohci-test$(EXESUF) +-gcov-files-i386-y += hw/usb/hcd-ohci.c + check-qtest-i386-y += tests/usb-hcd-uhci-test$(EXESUF) + gcov-files-i386-y += hw/usb/hcd-uhci.c + check-qtest-i386-y += tests/usb-hcd-ehci-test$(EXESUF) +@@ -274,7 +253,7 @@ check-qtest-mips64el-y = tests/endianness-test$(EXESUF) + + check-qtest-ppc-y = tests/endianness-test$(EXESUF) + check-qtest-ppc-y += tests/boot-order-test$(EXESUF) +-check-qtest-ppc-y += tests/prom-env-test$(EXESUF) ++#check-qtest-ppc-y += tests/prom-env-test$(EXESUF) + check-qtest-ppc-y += tests/drive_del-test$(EXESUF) + check-qtest-ppc-y += tests/boot-serial-test$(EXESUF) + +@@ -282,31 +261,27 @@ check-qtest-ppc64-y = tests/spapr-phb-test$(EXESUF) + gcov-files-ppc64-y = ppc64-softmmu/hw/ppc/spapr_pci.c + check-qtest-ppc64-y += tests/endianness-test$(EXESUF) + check-qtest-ppc64-y += tests/boot-order-test$(EXESUF) +-check-qtest-ppc64-y += tests/prom-env-test$(EXESUF) +-check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) ++#check-qtest-ppc64-y += tests/prom-env-test$(EXESUF) ++#check-qtest-ppc64-y += tests/pnv-xscom-test$(EXESUF) + check-qtest-ppc64-y += tests/drive_del-test$(EXESUF) + check-qtest-ppc64-y += tests/postcopy-test$(EXESUF) + check-qtest-ppc64-y += tests/boot-serial-test$(EXESUF) + check-qtest-ppc64-y += tests/rtas-test$(EXESUF) + check-qtest-ppc64-y += tests/pxe-test$(EXESUF) +-check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF) ++#check-qtest-ppc64-y += tests/usb-hcd-ohci-test$(EXESUF) + gcov-files-ppc64-y += hw/usb/hcd-ohci.c +-check-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF) ++#check-qtest-ppc64-y += tests/usb-hcd-uhci-test$(EXESUF) + gcov-files-ppc64-y += hw/usb/hcd-uhci.c + check-qtest-ppc64-y += tests/usb-hcd-xhci-test$(EXESUF) + gcov-files-ppc64-y += hw/usb/hcd-xhci.c + check-qtest-ppc64-y += $(check-qtest-virtio-y) +-check-qtest-ppc64-y += tests/test-netfilter$(EXESUF) +-check-qtest-ppc64-y += tests/test-filter-mirror$(EXESUF) +-check-qtest-ppc64-y += tests/test-filter-redirector$(EXESUF) + check-qtest-ppc64-y += tests/display-vga-test$(EXESUF) +-check-qtest-ppc64-$(CONFIG_EVENTFD) += tests/ivshmem-test$(EXESUF) + + check-qtest-sh4-y = tests/endianness-test$(EXESUF) + + check-qtest-sh4eb-y = tests/endianness-test$(EXESUF) + +-check-qtest-sparc-y = tests/prom-env-test$(EXESUF) ++#check-qtest-sparc-y = tests/prom-env-test$(EXESUF) + #check-qtest-sparc-y += tests/m48t59-test$(EXESUF) + #gcov-files-sparc-y = hw/timer/m48t59.c + +@@ -679,13 +654,11 @@ tests/rtc-test$(EXESUF): tests/rtc-test.o + tests/m48t59-test$(EXESUF): tests/m48t59-test.o + tests/endianness-test$(EXESUF): tests/endianness-test.o + tests/spapr-phb-test$(EXESUF): tests/spapr-phb-test.o $(libqos-obj-y) +-tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y) ++#tests/prom-env-test$(EXESUF): tests/prom-env-test.o $(libqos-obj-y) + tests/rtas-test$(EXESUF): tests/rtas-test.o $(libqos-spapr-obj-y) + tests/fdc-test$(EXESUF): tests/fdc-test.o + tests/ide-test$(EXESUF): tests/ide-test.o $(libqos-pc-obj-y) + tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y) +-tests/ipmi-kcs-test$(EXESUF): tests/ipmi-kcs-test.o +-tests/ipmi-bt-test$(EXESUF): tests/ipmi-bt-test.o + tests/hd-geo-test$(EXESUF): tests/hd-geo-test.o + tests/boot-order-test$(EXESUF): tests/boot-order-test.o $(libqos-obj-y) + tests/boot-serial-test$(EXESUF): tests/boot-serial-test.o $(libqos-obj-y) +@@ -701,11 +674,8 @@ tests/fw_cfg-test$(EXESUF): tests/fw_cfg-test.o $(libqos-pc-obj-y) + tests/e1000-test$(EXESUF): tests/e1000-test.o + tests/e1000e-test$(EXESUF): tests/e1000e-test.o $(libqos-pc-obj-y) + tests/rtl8139-test$(EXESUF): tests/rtl8139-test.o $(libqos-pc-obj-y) +-tests/pcnet-test$(EXESUF): tests/pcnet-test.o +-tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o ++#tests/pnv-xscom-test$(EXESUF): tests/pnv-xscom-test.o + tests/eepro100-test$(EXESUF): tests/eepro100-test.o +-tests/vmxnet3-test$(EXESUF): tests/vmxnet3-test.o +-tests/ne2000-test$(EXESUF): tests/ne2000-test.o + tests/wdt_ib700-test$(EXESUF): tests/wdt_ib700-test.o + tests/tco-test$(EXESUF): tests/tco-test.o $(libqos-pc-obj-y) + tests/virtio-balloon-test$(EXESUF): tests/virtio-balloon-test.o +@@ -716,20 +686,16 @@ tests/virtio-scsi-test$(EXESUF): tests/virtio-scsi-test.o $(libqos-virtio-obj-y) + tests/virtio-9p-test$(EXESUF): tests/virtio-9p-test.o $(libqos-virtio-obj-y) + tests/virtio-serial-test$(EXESUF): tests/virtio-serial-test.o + tests/virtio-console-test$(EXESUF): tests/virtio-console-test.o +-tests/tpci200-test$(EXESUF): tests/tpci200-test.o + tests/display-vga-test$(EXESUF): tests/display-vga-test.o + tests/ipoctal232-test$(EXESUF): tests/ipoctal232-test.o + tests/qom-test$(EXESUF): tests/qom-test.o + tests/drive_del-test$(EXESUF): tests/drive_del-test.o $(libqos-pc-obj-y) + tests/qdev-monitor-test$(EXESUF): tests/qdev-monitor-test.o $(libqos-pc-obj-y) +-tests/nvme-test$(EXESUF): tests/nvme-test.o + tests/pvpanic-test$(EXESUF): tests/pvpanic-test.o + tests/i82801b11-test$(EXESUF): tests/i82801b11-test.o + tests/ac97-test$(EXESUF): tests/ac97-test.o +-tests/es1370-test$(EXESUF): tests/es1370-test.o + tests/intel-hda-test$(EXESUF): tests/intel-hda-test.o + tests/ioh3420-test$(EXESUF): tests/ioh3420-test.o +-tests/usb-hcd-ohci-test$(EXESUF): tests/usb-hcd-ohci-test.o $(libqos-usb-obj-y) + tests/usb-hcd-uhci-test$(EXESUF): tests/usb-hcd-uhci-test.o $(libqos-usb-obj-y) + tests/usb-hcd-ehci-test$(EXESUF): tests/usb-hcd-ehci-test.o $(libqos-usb-obj-y) + tests/usb-hcd-xhci-test$(EXESUF): tests/usb-hcd-xhci-test.o $(libqos-usb-obj-y) +diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c +index 88dbf97..d361b6f 100644 +--- a/tests/bios-tables-test.c ++++ b/tests/bios-tables-test.c +@@ -728,6 +728,7 @@ static void test_acpi_q35_tcg_cphp(void) + free_test_data(&data); + } + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + static uint8_t ipmi_required_struct_types[] = { + 0, 1, 3, 4, 16, 17, 19, 32, 38, 127 + }; +@@ -764,6 +765,7 @@ static void test_acpi_piix4_tcg_ipmi(void) + &data); + free_test_data(&data); + } ++#endif + + static void test_acpi_q35_tcg_memhp(void) + { +@@ -803,8 +805,10 @@ int main(int argc, char *argv[]) + qtest_add_func("acpi/piix4/bridge", test_acpi_piix4_tcg_bridge); + qtest_add_func("acpi/q35", test_acpi_q35_tcg); + qtest_add_func("acpi/q35/bridge", test_acpi_q35_tcg_bridge); ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + qtest_add_func("acpi/piix4/ipmi", test_acpi_piix4_tcg_ipmi); + qtest_add_func("acpi/q35/ipmi", test_acpi_q35_tcg_ipmi); ++#endif + qtest_add_func("acpi/piix4/cpuhp", test_acpi_piix4_tcg_cphp); + qtest_add_func("acpi/q35/cpuhp", test_acpi_q35_tcg_cphp); + qtest_add_func("acpi/piix4/memhp", test_acpi_piix4_tcg_memhp); +diff --git a/tests/boot-order-test.c b/tests/boot-order-test.c +index fc1e794..e29c528 100644 +--- a/tests/boot-order-test.c ++++ b/tests/boot-order-test.c +@@ -109,6 +109,7 @@ static void test_pc_boot_order(void) + test_boot_orders(NULL, read_boot_order_pc, test_cases_pc); + } + ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + static uint8_t read_m48t59(uint64_t addr, uint16_t reg) + { + writeb(addr, reg & 0xff); +@@ -139,6 +140,7 @@ static uint64_t read_boot_order_pmac(void) + + return qfw_cfg_get_u16(fw_cfg, FW_CFG_BOOT_DEVICE); + } ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + + static const boot_order_test test_cases_fw_cfg[] = { + { "", 'c', 'c' }, +@@ -148,6 +150,7 @@ static const boot_order_test test_cases_fw_cfg[] = { + {} + }; + ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + static void test_pmac_oldworld_boot_order(void) + { + test_boot_orders("g3beige", read_boot_order_pmac, test_cases_fw_cfg); +@@ -156,7 +159,9 @@ static void test_pmac_oldworld_boot_order(void) + static void test_pmac_newworld_boot_order(void) + { + test_boot_orders("mac99", read_boot_order_pmac, test_cases_fw_cfg); ++ + } ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + + static uint64_t read_boot_order_sun4m(void) + { +@@ -191,11 +196,13 @@ int main(int argc, char *argv[]) + if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) { + qtest_add_func("boot-order/pc", test_pc_boot_order); + } else if (strcmp(arch, "ppc") == 0 || strcmp(arch, "ppc64") == 0) { ++#if 0 /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + qtest_add_func("boot-order/prep", test_prep_boot_order); + qtest_add_func("boot-order/pmac_oldworld", + test_pmac_oldworld_boot_order); + qtest_add_func("boot-order/pmac_newworld", + test_pmac_newworld_boot_order); ++#endif /* Disabled for RHEL, since CONFIG_MAC and CONFIG_PREP are not enabled */ + } else if (strcmp(arch, "sparc") == 0) { + qtest_add_func("boot-order/sun4m", test_sun4m_boot_order); + } else if (strcmp(arch, "sparc64") == 0) { +diff --git a/tests/boot-serial-test.c b/tests/boot-serial-test.c +index 11f48b0..4557ce9 100644 +--- a/tests/boot-serial-test.c ++++ b/tests/boot-serial-test.c +@@ -26,14 +26,14 @@ static testdef_t tests[] = { + { "alpha", "clipper", "", "PCI:" }, + { "ppc", "ppce500", "", "U-Boot" }, + { "ppc", "prep", "", "Open Hack'Ware BIOS" }, +- { "ppc64", "ppce500", "", "U-Boot" }, +- { "ppc64", "prep", "", "Open Hack'Ware BIOS" }, ++/* { "ppc64", "ppce500", "", "U-Boot" }, ++ { "ppc64", "prep", "", "Open Hack'Ware BIOS" }, */ + { "ppc64", "pseries", "", "Open Firmware" }, +- { "ppc64", "powernv", "-cpu POWER8", "SkiBoot" }, ++/* { "ppc64", "powernv", "-cpu POWER8", "SkiBoot" }, */ + { "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" }, + { "s390x", "s390-ccw-virtio", + "-nodefaults -device sclpconsole,chardev=serial0", "virtio device" }, +diff --git a/tests/e1000-test.c b/tests/e1000-test.c +index 0c5fcdc..0504d33 100644 +--- a/tests/e1000-test.c ++++ b/tests/e1000-test.c +@@ -29,8 +29,10 @@ static void test_device(gconstpointer data) + static const char *models[] = { + "e1000", + "e1000-82540em", ++#if 0 /* Disabled in Red Hat Enterprise Linux 7 */ + "e1000-82544gc", + "e1000-82545em", ++#endif + }; + + int main(int argc, char **argv) +diff --git a/tests/endianness-test.c b/tests/endianness-test.c +index ed0bf52..58af690 100644 +--- a/tests/endianness-test.c ++++ b/tests/endianness-test.c +@@ -34,6 +34,7 @@ static const TestCase test_cases[] = { + { "mips64", "mips", 0x14000000, .bswap = true }, + { "mips64", "malta", 0x10000000, .bswap = true }, + { "mips64el", "fulong2e", 0x1fd00000 }, ++#if 0 /* Disabled for RHEL, since ISA is not enabled */ + { "ppc", "g3beige", 0xfe000000, .bswap = true, .superio = "i82378" }, + { "ppc", "prep", 0x80000000, .bswap = true }, + { "ppc", "bamboo", 0xe8000000, .bswap = true, .superio = "i82378" }, +@@ -41,6 +42,7 @@ static const TestCase test_cases[] = { + { "ppc64", "pseries", (1ULL << 45), .bswap = true, .superio = "i82378" }, + { "ppc64", "pseries-2.7", 0x10080000000ULL, + .bswap = true, .superio = "i82378" }, ++#endif /* Disabled for RHEL, since ISA is not enabled */ + { "sh4", "r2d", 0xfe240000, .superio = "i82378" }, + { "sh4eb", "r2d", 0xfe240000, .bswap = true, .superio = "i82378" }, + { "sparc64", "sun4u", 0x1fe02000000LL, .bswap = true }, +diff --git a/tests/ivshmem-test.c b/tests/ivshmem-test.c +index 3776342..6aae100 100644 +--- a/tests/ivshmem-test.c ++++ b/tests/ivshmem-test.c +@@ -256,6 +256,7 @@ static void test_ivshmem_pair(void) + g_free(data); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux: */ + typedef struct ServerThread { + GThread *thread; + IvshmemServer *server; +@@ -413,9 +414,11 @@ static void test_ivshmem_server_irq(void) + { + test_ivshmem_server(false); + } ++#endif + + #define PCI_SLOT_HP 0x06 + ++#if 0 /* Test uses legacy ivshmem, which is disabled for Red Hat Enterprise Linux: */ + static void test_ivshmem_hotplug(void) + { + const char *arch = qtest_get_arch(); +@@ -433,6 +436,7 @@ static void test_ivshmem_hotplug(void) + qtest_end(); + g_free(opts); + } ++#endif + + static void test_ivshmem_memdev(void) + { +@@ -500,7 +504,7 @@ static gchar *mktempshm(int size, int *fd) + int main(int argc, char **argv) + { + int ret, fd; +- const char *arch = qtest_get_arch(); ++/* const char *arch = qtest_get_arch(); */ + gchar dir[] = "/tmp/ivshmem-test.XXXXXX"; + + #if !GLIB_CHECK_VERSION(2, 31, 0) +@@ -527,14 +531,18 @@ int main(int argc, char **argv) + tmpserver = g_strconcat(tmpdir, "/server", NULL); + + qtest_add_func("/ivshmem/single", test_ivshmem_single); ++#if 0 /* Test uses legacy ivshmem, which is disabled for Red Hat Enterprise Linux: */ + qtest_add_func("/ivshmem/hotplug", test_ivshmem_hotplug); ++#endif + qtest_add_func("/ivshmem/memdev", test_ivshmem_memdev); + if (g_test_slow()) { + qtest_add_func("/ivshmem/pair", test_ivshmem_pair); ++#if 0 /* Disabled for Red Hat Enterprise Linux: */ + if (strcmp(arch, "ppc64") != 0) { + qtest_add_func("/ivshmem/server-msi", test_ivshmem_server_msi); + qtest_add_func("/ivshmem/server-irq", test_ivshmem_server_irq); + } ++#endif + } + + ret = g_test_run(); +diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 +index 630cb7a..4377199 100755 +--- a/tests/qemu-iotests/051 ++++ b/tests/qemu-iotests/051 +@@ -144,9 +144,9 @@ case "$QEMU_DEFAULT_MACHINE" in + pc) + run_qemu -drive if=floppy + run_qemu -drive if=ide,media=cdrom +- run_qemu -drive if=scsi,media=cdrom ++# run_qemu -drive if=scsi,media=cdrom + run_qemu -drive if=ide +- run_qemu -drive if=scsi ++# run_qemu -drive if=scsi + ;; + *) + ;; +@@ -157,11 +157,11 @@ 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-drive,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-disk,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-disk,drive=disk ++# run_qemu -drive if=none,id=disk -device lsi53c895a -device scsi-hd,drive=disk + ;; + *) + ;; +@@ -175,9 +175,9 @@ case "$QEMU_DEFAULT_MACHINE" in + pc) + run_qemu -drive file="$TEST_IMG",if=floppy,readonly=on + run_qemu -drive file="$TEST_IMG",if=ide,media=cdrom,readonly=on +- run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on ++# run_qemu -drive file="$TEST_IMG",if=scsi,media=cdrom,readonly=on + run_qemu -drive file="$TEST_IMG",if=ide,readonly=on +- run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on ++# run_qemu -drive file="$TEST_IMG",if=scsi,readonly=on + ;; + *) + ;; +@@ -188,11 +188,11 @@ 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-drive,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-disk,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-disk,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/qemu-iotests/group b/tests/qemu-iotests/group +index 43142dd..5618034 100644 +--- a/tests/qemu-iotests/group ++++ b/tests/qemu-iotests/group +@@ -77,7 +77,7 @@ + 068 rw auto quick + 069 rw auto quick + 070 rw auto quick +-071 rw auto quick ++# 071 rw auto quick -- requires whitelisted blkverify + 072 rw auto quick + 073 rw auto quick + 074 rw auto quick +@@ -105,7 +105,7 @@ + 096 rw auto quick + 097 rw auto backing + 098 rw auto backing quick +-099 rw auto quick ++# 099 rw auto quick -- requires whitelisted blkverify + # 100 was removed, do not reuse + 101 rw auto quick + 102 rw auto quick +diff --git a/tests/qom-test.c b/tests/qom-test.c +index d48f890..ba999cb 100644 +--- a/tests/qom-test.c ++++ b/tests/qom-test.c +@@ -15,7 +15,9 @@ + #include "qapi/qmp/types.h" + + static const char *blacklist_x86[] = { +- "xenfv", "xenpv", NULL ++ "xenfv", "xenpv", ++ "rhel6.6.0", "rhel6.5.0", "rhel6.4.0", "rhel6.3.0", ++ "rhel6.2.0", "rhel6.1.0", "rhel6.0.0", NULL + }; + + static const struct { +diff --git a/tests/test-x86-cpuid-compat.c b/tests/test-x86-cpuid-compat.c +index 79a2e69..06fa305 100644 +--- a/tests/test-x86-cpuid-compat.c ++++ b/tests/test-x86-cpuid-compat.c +@@ -216,6 +216,7 @@ int main(int argc, char **argv) + "-cpu 486,xlevel2=0xC0000002,+xstore", + "xlevel2", 0xC0000002); + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + /* Check compatibility of old machine-types that didn't + * auto-increase level/xlevel/xlevel2: */ + +@@ -228,6 +229,6 @@ int main(int argc, char **argv) + add_cpuid_test("x86/cpuid/auto-xlevel2/pc-2.7", + "-machine pc-i440fx-2.7 -cpu 486,+xstore", + "xlevel2", 0); +- ++#endif + return g_test_run(); + } +diff --git a/tests/usb-hcd-xhci-test.c b/tests/usb-hcd-xhci-test.c +index 22513e9..a017ba3 100644 +--- a/tests/usb-hcd-xhci-test.c ++++ b/tests/usb-hcd-xhci-test.c +@@ -21,6 +21,7 @@ static void test_xhci_hotplug(void) + usb_test_hotplug("xhci", 1, NULL); + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux 7 */ + static void test_usb_uas_hotplug(void) + { + QDict *response; +@@ -77,6 +78,7 @@ static void test_usb_uas_hotplug(void) + g_assert(!strcmp(qdict_get_str(response, "event"), "DEVICE_DELETED")); + QDECREF(response); + } ++#endif + + int main(int argc, char **argv) + { +@@ -86,8 +88,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 7 */ + qtest_add_func("/xhci/pci/hotplug/usb-uas", test_usb_uas_hotplug); +- ++#endif + qtest_start("-device nec-usb-xhci,id=xhci" + " -drive id=drive0,if=none,file=/dev/null,format=raw"); + ret = g_test_run(); +diff --git a/tests/virtio-scsi-test.c b/tests/virtio-scsi-test.c +index 0eabd56..c01fa49 100644 +--- a/tests/virtio-scsi-test.c ++++ b/tests/virtio-scsi-test.c +@@ -54,6 +54,7 @@ static void qvirtio_scsi_stop(QOSState *qs) + { + qtest_shutdown(qs); + } ++#if 0 + + static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs) + { +@@ -67,7 +68,6 @@ static void qvirtio_scsi_pci_free(QVirtIOSCSI *vs) + qvirtio_scsi_stop(vs->qs); + g_free(vs); + } +- + static uint64_t qvirtio_scsi_alloc(QVirtIOSCSI *vs, size_t alloc_size, + const void *data) + { +@@ -80,7 +80,6 @@ static uint64_t qvirtio_scsi_alloc(QVirtIOSCSI *vs, size_t alloc_size, + + return addr; + } +- + static uint8_t virtio_scsi_do_command(QVirtIOSCSI *vs, const uint8_t *cdb, + const uint8_t *data_in, + size_t data_in_len, +@@ -181,6 +180,7 @@ static QVirtIOSCSI *qvirtio_scsi_pci_init(int slot) + return vs; + } + ++#endif + /* Tests only initialization so far. TODO: Replace with functional tests */ + static void pci_nop(void) + { +@@ -220,6 +220,7 @@ static void hotplug(void) + qvirtio_scsi_stop(qs); + } + ++#if 0 + /* Test WRITE SAME with the lba not aligned */ + static void test_unaligned_write_same(void) + { +@@ -243,14 +244,16 @@ static void test_unaligned_write_same(void) + + qvirtio_scsi_pci_free(vs); + } +- ++#endif + int main(int argc, char **argv) + { + g_test_init(&argc, &argv, NULL); + qtest_add_func("/virtio/scsi/pci/nop", pci_nop); + qtest_add_func("/virtio/scsi/pci/hotplug", hotplug); ++#if 0 + qtest_add_func("/virtio/scsi/pci/scsi-disk/unaligned-write-same", + test_unaligned_write_same); + ++#endif + return g_test_run(); + } +diff --git a/vl.c b/vl.c +index 0b4ed52..1f9a692 100644 +--- a/vl.c ++++ b/vl.c +@@ -166,7 +166,7 @@ int max_cpus = 1; + int smp_cores = 1; + int smp_threads = 1; + int acpi_enabled = 1; +-int no_hpet = 0; ++int no_hpet = 1; /* Always disabled for Red Hat Enterprise Linux */ + int fd_bootchk = 1; + static int no_reboot; + int no_shutdown = 0; +-- +1.8.3.1 + diff --git a/SOURCES/0004-Use-kvm-by-default.patch b/SOURCES/0004-Use-kvm-by-default.patch new file mode 100644 index 0000000..a028d02 --- /dev/null +++ b/SOURCES/0004-Use-kvm-by-default.patch @@ -0,0 +1,38 @@ +From abcd662eb8e516ebe4a6b401e83a62f749491a15 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 18 Dec 2014 06:27:49 +0100 +Subject: Use kvm by default + +Bugzilla: 906185 + +RHEL uses kvm accelerator by default, if available. + +Signed-off-by: Miroslav Rezanina + +Rebase notes (2.2.0): +- Move code from vl.c to accel.c + +(cherry picked from commit 11d2767107bf05736f3285b09401424a371cc847) +(cherry picked from commit 88e7e3cc1c3ff5ca0d452a1ce1310edb51065683) +--- + accel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/accel.c b/accel.c +index 664bb88..23fc7e8 100644 +--- a/accel.c ++++ b/accel.c +@@ -87,8 +87,8 @@ void configure_accelerator(MachineState *ms) + + p = qemu_opt_get(qemu_get_machine_opts(), "accel"); + if (p == NULL) { +- /* Use the default "accelerator", tcg */ +- p = "tcg"; ++ /* Use kvm accelerator by default, fail to tcg*/ ++ p = "kvm:tcg"; + } + + while (!accel_initialised && *p != '\0') { +-- +1.8.3.1 + diff --git a/SOURCES/0005-add-qxl_screendump-monitor-command.patch b/SOURCES/0005-add-qxl_screendump-monitor-command.patch new file mode 100644 index 0000000..48c9326 --- /dev/null +++ b/SOURCES/0005-add-qxl_screendump-monitor-command.patch @@ -0,0 +1,188 @@ +From 9ff701a5129653d6bd27c0b3cc249691cb6ce6a7 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 14 Mar 2017 13:21:06 +0100 +Subject: add qxl_screendump monitor command + +RH-Author: Gerd Hoffmann +Message-id: <1375866764-17766-2-git-send-email-kraxel@redhat.com> +Patchwork-id: 53033 +O-Subject: [RHEL-7 qemu-kvm PATCH 1/1] add qxl_screendump monitor command +Bugzilla: 903910 +RH-Acked-by: Hans de Goede +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Michal Novotny + +This patch ports the rhel-6 specific qxl_screendump command to rhel-7. +qxl_screendump takes the device id as additional argument and thus can +be used to take screenshots from non-primary displays. + +The plan to get that functionality upstream in time failed, so we go for +plan b and carry forward the rhel-6 specific qxl_screendump command. +Thanks to the major console subsystem cleanups which made it upstream +the implementation is (a) alot less hackier than the rhel-6 one and (b) +not qxl-specific any more. Given that qxl is the only graphic device +which can work as secondary vga card the later is only a theoretical +benefit though ;) + +RHEL-6 commit: 1c6074d107dff93c7c7b0edfb5da871504802946 + +bugzilla: #903910 - RHEL7 does not have equivalent functionality for +__com.redhat_qxl_screendump + +Signed-off-by: Gerd Hoffmann +(cherry picked from commit 211321c693f46d283205830c6c49b54d7250e98c) + +Rebase notes (2.9.0): +- documentation moved to qapi schema + +Rebase notes (2.8.0): +- qmp-commands.hx replaced by docs/qmp-commands.txt (commit bd6092e) +- mhandler.cmd attribute renamed to cmd (commit 2b9e357) + +Rebase notes (2.4.0): +- replace QERR_DEVICE_NOT_FOUND with ERROR_CLASS_DEVICE_NOT_FOUND + +Merged patches (2.9.0): +- a3b59c0 HMP: Fix user manual typo of __com.redhat_qxl_screendump + +Merged patches (2.6.0): +- f12846f __com.redhat_qxl_screendump: add docs + +(cherry picked from commit 4c87d4e33880c72d93d53dfae81dc7c4ff2e6a2d) +--- + hmp-commands.hx | 14 ++++++++++++++ + hmp.c | 10 ++++++++++ + hmp.h | 1 + + qapi-schema.json | 22 ++++++++++++++++++++++ + ui/console.c | 24 ++++++++++++++++++++++++ + 5 files changed, 71 insertions(+) + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 8819281..c3c2f33 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -266,6 +266,20 @@ Save screen into PPM image @var{filename}. + ETEXI + + { ++ .name = "__com.redhat_qxl_screendump", ++ .args_type = "id:s,filename:F", ++ .params = "id filename", ++ .help = "save screen from qxl device 'id' into PPM image 'filename'", ++ .cmd = hmp___com_redhat_qxl_screen_dump, ++ }, ++ ++STEXI ++@item __com.redhat_qxl_screendump @var{id} @var{filename} ++@findex __com.redhat_qxl_screendump ++Save screen from qxl device @var{id} into PPM image @var{filename}. ++ETEXI ++ ++ { + .name = "logfile", + .args_type = "filename:F", + .params = "filename", +diff --git a/hmp.c b/hmp.c +index edb8970..33ee308 100644 +--- a/hmp.c ++++ b/hmp.c +@@ -1928,6 +1928,16 @@ void hmp_screendump(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &err); + } + ++void hmp___com_redhat_qxl_screen_dump(Monitor *mon, const QDict *qdict) ++{ ++ const char *id = qdict_get_str(qdict, "id"); ++ const char *filename = qdict_get_str(qdict, "filename"); ++ Error *err = NULL; ++ ++ qmp___com_redhat_qxl_screendump(id, filename, &err); ++ hmp_handle_error(mon, &err); ++} ++ + void hmp_nbd_server_start(Monitor *mon, const QDict *qdict) + { + const char *uri = qdict_get_str(qdict, "uri"); +diff --git a/hmp.h b/hmp.h +index 799fd37..f7ca3b7 100644 +--- a/hmp.h ++++ b/hmp.h +@@ -94,6 +94,7 @@ void hmp_getfd(Monitor *mon, const QDict *qdict); + void hmp_closefd(Monitor *mon, const QDict *qdict); + void hmp_sendkey(Monitor *mon, const QDict *qdict); + void hmp_screendump(Monitor *mon, const QDict *qdict); ++void hmp___com_redhat_qxl_screen_dump(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_start(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_add(Monitor *mon, const QDict *qdict); + void hmp_nbd_server_stop(Monitor *mon, const QDict *qdict); +diff --git a/qapi-schema.json b/qapi-schema.json +index 250e4dc..cefbaf5 100644 +--- a/qapi-schema.json ++++ b/qapi-schema.json +@@ -4831,6 +4831,28 @@ + '*logappend': 'bool' } } + + ## ++# @__com.redhat_qxl_screendump: ++# ++# Write a PPM of secondary qxl devices to a file. ++# ++# @id: qxl device id ++# @filename: the path of a new PPM file to store the image ++# ++# Returns: Nothing on success ++# ++# Since: never (rhel-only, not upstream) ++# ++# Example: ++# ++# -> { "execute": "__com.redhat_qxl_screendump", ++# "arguments": { "id": video1", "filename": "v1.ppm" } } ++# <- { "return": {} } ++# ++## ++{ 'command': '__com.redhat_qxl_screendump', 'data': { 'id' : 'str', ++ 'filename': 'str' } } ++ ++## + # @ChardevFile: + # + # Configuration info for file chardevs. +diff --git a/ui/console.c b/ui/console.c +index 419b098..8736fe5 100644 +--- a/ui/console.c ++++ b/ui/console.c +@@ -357,6 +357,30 @@ void qmp_screendump(const char *filename, Error **errp) + ppm_save(filename, surface, errp); + } + ++void qmp___com_redhat_qxl_screendump(const char *id, const char *filename, Error **errp) ++{ ++ DeviceState *dev; ++ QemuConsole *con; ++ DisplaySurface *surface; ++ ++ dev = qdev_find_recursive(sysbus_get_default(), id); ++ if (NULL == dev) { ++ error_set(errp, ERROR_CLASS_DEVICE_NOT_FOUND, ++ "Device '%s' not found", id); ++ return; ++ } ++ ++ con = qemu_console_lookup_by_device(dev, 0); ++ if (con == NULL) { ++ error_setg(errp, "Device %s has no QemuConsole attached to it.", id); ++ return; ++ } ++ ++ graphic_hw_update(con); ++ surface = qemu_console_surface(con); ++ ppm_save(filename, surface, errp); ++} ++ + void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata) + { + if (!con) { +-- +1.8.3.1 + diff --git a/SOURCES/0006-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch b/SOURCES/0006-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch new file mode 100644 index 0000000..011bfce --- /dev/null +++ b/SOURCES/0006-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch @@ -0,0 +1,40 @@ +From 85123a6939a536f81470ad2e8afa5a7c72584dc0 Mon Sep 17 00:00:00 2001 +From: Andrea Arcangeli +Date: Tue, 8 Oct 2013 17:05:45 +0200 +Subject: seabios paravirt: allow more than 1TB in x86 guest + +RH-Author: Andrea Arcangeli +Message-id: <1381251945-13402-2-git-send-email-aarcange@redhat.com> +Patchwork-id: 54784 +O-Subject: [RHEL-7.0 qemu-kvm PATCH] seabios paravirt: allow more than 1TB in x86 guest +Bugzilla: 989677 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Gleb Natapov +RH-Acked-by: Laszlo Ersek + +This patch should be applied to the qemu-kvm rpm package at the same +time of the other one for seabios, so qemu will forward the ram_size +bits over 40 to seabios without losing them. + +Signed-off-by: Andrea Arcangeli +(cherry picked from commit 2f7b2ba70fb0136002ef6fc97ec58b3123f88603) +(cherry picked from commit e1981f594f63b19f174952fce5a743fb8c5703a7) +--- + hw/i386/pc.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 815bd65..2764b77 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -474,6 +474,7 @@ void pc_cmos_init(PCMachineState *pcms, + rtc_set_memory(s, 0x5b, val); + rtc_set_memory(s, 0x5c, val >> 8); + rtc_set_memory(s, 0x5d, val >> 16); ++ rtc_set_memory(s, 0x5e, val >> 24); + + object_property_add_link(OBJECT(pcms), "rtc_state", + TYPE_ISA_DEVICE, +-- +1.8.3.1 + diff --git a/SOURCES/0007-monitor-Remove-usb_add-del-commands-for-Red-Hat-Ente.patch b/SOURCES/0007-monitor-Remove-usb_add-del-commands-for-Red-Hat-Ente.patch new file mode 100644 index 0000000..a87baff --- /dev/null +++ b/SOURCES/0007-monitor-Remove-usb_add-del-commands-for-Red-Hat-Ente.patch @@ -0,0 +1,56 @@ +From 23698561a70052b5d3cd376d66ec5889605e0559 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:03 +0100 +Subject: monitor: Remove usb_add/del commands for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 55520 +O-Subject: [RHEL7 qemu-kvm PATCH v2 3/4] monitor: Remove usb_add/del commands for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit 754e6292b4ab41c8848171555af830ab7284f4d3: + + monitor: Remove usb_add/del commands for Red Hat Enterprise Linux + + The usb_add/del commands have been obsoleted by the device_add/del + commands. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 567d99ac6c3ce941ad5ec3e09b1698eaefffd4e2) +(cherry picked from commit d9922163a646af496445f923164d9efaeb3a7960) +--- + hmp-commands.hx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index c3c2f33..3e2da19 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -647,6 +647,7 @@ STEXI + Compute the checksum of a memory region. + ETEXI + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "usb_add", + .args_type = "devname:s", +@@ -677,6 +678,7 @@ Remove the USB device @var{devname} from the QEMU virtual USB + hub. @var{devname} has the syntax @code{bus.addr}. Use the monitor + command @code{info usb} to see the devices you can remove. + ETEXI ++#endif + + { + .name = "device_add", +-- +1.8.3.1 + diff --git a/SOURCES/0008-monitor-Remove-host_net_add-remove-for-Red-Hat-Enter.patch b/SOURCES/0008-monitor-Remove-host_net_add-remove-for-Red-Hat-Enter.patch new file mode 100644 index 0000000..f84f7c1 --- /dev/null +++ b/SOURCES/0008-monitor-Remove-host_net_add-remove-for-Red-Hat-Enter.patch @@ -0,0 +1,56 @@ +From c9963b7cbcc5a0148ce8c29dfa4c473b27f2fd71 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 6 Nov 2013 12:36:04 +0100 +Subject: monitor: Remove host_net_add/remove for Red Hat Enterprise Linux + +RH-Author: Miroslav Rezanina +Message-id: +Patchwork-id: 55519 +O-Subject: [RHEL7 qemu-kvm PATCH v2 4/4] monitor: Remove host_net_add/remove for Red Hat Enterprise Linux +Bugzilla: 1010858 +RH-Acked-by: Michal Novotny +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Orit Wasserman +RH-Acked-by: Eric Blake + +From: Miroslav Rezanina + +This is forwardport of RHEL-6 commit dd94505bd1b826db0c7e155ccee5c24f77987f16: + + monitor: Remove host_net_add/remove for Red Hat Enterprise Linux + + The host_net_add/remove commands are replaced by netdev_add/del. Remove + them. + + Signed-off-by: Amit Shah + +Signed-off-by: Miroslav Rezanina +(cherry picked from commit e013ccabc44970f3da6772c55b4627a2dfe66ba0) +(cherry picked from commit 087ffd4f147844530cd7a3b42a1dfcae441525c2) +--- + hmp-commands.hx | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 3e2da19..fbd02aa 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1276,6 +1276,7 @@ STEXI + Inject PCIe AER error + ETEXI + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { + .name = "host_net_add", + .args_type = "device:s,opts:s?", +@@ -1305,6 +1306,7 @@ STEXI + @findex host_net_remove + Remove host VLAN client. + ETEXI ++#endif + + { + .name = "netdev_add", +-- +1.8.3.1 + diff --git a/SOURCES/0009-vfio-cap-number-of-devices-that-can-be-assigned.patch b/SOURCES/0009-vfio-cap-number-of-devices-that-can-be-assigned.patch new file mode 100644 index 0000000..6e4d416 --- /dev/null +++ b/SOURCES/0009-vfio-cap-number-of-devices-that-can-be-assigned.patch @@ -0,0 +1,74 @@ +From 9fa3c9fc6dfcde76d80db1aa601b2d577f72ceec 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 +(cherry picked from commit 5c749a1960fbbf1924b8cf285bdb5a8f78d27ab7) + +Rebase notes (2.8.0): +- removed return value for vfio_realize (commit 1a22aca) + +Merged patches (2.9.0): +- 17eb774 vfio: Use error_setg when reporting max assigned device overshoot + +(cherry picked from commit a2f327758bac334f69c26977befbe3e4e499f758) +--- + hw/vfio/pci.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c +index 03a3d01..756cad4 100644 +--- a/hw/vfio/pci.c ++++ b/hw/vfio/pci.c +@@ -34,6 +34,7 @@ + #include "qapi/error.h" + + #define MSIX_CAP_LENGTH 12 ++#define MAX_DEV_ASSIGN_CMDLINE 32 + + static void vfio_disable_interrupts(VFIOPCIDevice *vdev); + static void vfio_mmap_set_enabled(VFIOPCIDevice *vdev, bool enabled); +@@ -2619,7 +2620,19 @@ static void vfio_realize(PCIDevice *pdev, Error **errp) + ssize_t len; + struct stat st; + int groupid; +- int i, ret; ++ int ret, i = 0; ++ ++ QLIST_FOREACH(group, &vfio_group_list, next) { ++ QLIST_FOREACH(vbasedev_iter, &group->device_list, next) { ++ i++; ++ } ++ } ++ ++ if (i >= MAX_DEV_ASSIGN_CMDLINE) { ++ error_setg(errp, "Maximum supported vfio devices (%d) " ++ "already attached", MAX_DEV_ASSIGN_CMDLINE); ++ return; ++ } + + if (!vdev->vbasedev.sysfsdev) { + if (!(~vdev->host.domain || ~vdev->host.bus || +-- +1.8.3.1 + diff --git a/SOURCES/0010-QMP-Forward-port-__com.redhat_drive_del-from-RHEL-6.patch b/SOURCES/0010-QMP-Forward-port-__com.redhat_drive_del-from-RHEL-6.patch new file mode 100644 index 0000000..8ac4b01 --- /dev/null +++ b/SOURCES/0010-QMP-Forward-port-__com.redhat_drive_del-from-RHEL-6.patch @@ -0,0 +1,165 @@ +From b7a0cafd6494cd3855fe10934314b6b1d2df5d2d Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 14 Mar 2017 14:03:39 +0100 +Subject: QMP: Forward-port __com.redhat_drive_del from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-3-git-send-email-armbru@redhat.com> +Patchwork-id: 56292 +O-Subject: [PATCH v2 2/6] QMP: Forward-port __com.redhat_drive_del from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Upstream has drive_del, but only in HMP. The backport to RHEL-6 added +it to QMP as well. Since the QMP command is a downstream extension, +it needs the __com.redhat_ prefix. Since RHEL-6 doesn't have separate +definition of QMP and HMP commands, both the QMP and the HMP command +got the prefix. + +RHEL-7 inherits HMP command drive_del from upstream. Add QMP command +__com.redhat_drive_del for RHEL-6 compatibility. + +If we needed similar compatibility for the HMP command, we'd have to +add __com.redhat_drive_del as alias for drive_del. But we don't. + +Code copied from RHEL-6's qemu-monitor.hx as of +qemu-kvm-0.12.1.2-2.418.el6. It has a "drive_del" without the prefix +in the documentation. Fixed here. Hardly worth fixing in RHEL-6 now. + +Signed-off-by: Markus Armbruster +(cherry picked from commit 9451fcdd05fc57f0d8304254f21bb581e9b65c88) + +Rebase notes (2.9.0): +- documentation moved from docs/qmp-commands.txt to qapi/block.json +- replace qmp_x_blockdev_del with qmp_blockdev_del (due to 79b7a77) + +Rebase notes (2.8.0): +- qmp-commands.hx replaced by docs/qmp-commands.txt (commit bd6092e) +- Changed qmp_x_blockdev_del arguments (upstream) + +Rebase notes (2.4.0): +- use traditional cmd for qmp +- remove user_print + +Merged patches (2.9.0): +- 4831182 QMP: Fix forward port of __com.redhat_drive_del + +Merged patches (2.7.0): +- 85786e0 Fix crash with __com.redhat_drive_del + +(cherry picked from commit 76b3fa08e83ffa59fcf5e7b3d98d5c71380aaa99) +--- + blockdev.c | 28 ++++++++++++++++------------ + qapi/block.json | 23 +++++++++++++++++++++++ + 2 files changed, 39 insertions(+), 12 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index 4927914..5a1b783 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -2825,32 +2825,27 @@ void qmp_block_dirty_bitmap_clear(const char *node, const char *name, + aio_context_release(aio_context); + } + +-void hmp_drive_del(Monitor *mon, const QDict *qdict) ++void qmp___com_redhat_drive_del(const char *id, Error **errp) + { +- const char *id = qdict_get_str(qdict, "id"); + BlockBackend *blk; + BlockDriverState *bs; + AioContext *aio_context; +- Error *local_err = NULL; + + bs = bdrv_find_node(id); + if (bs) { +- qmp_blockdev_del(id, &local_err); +- if (local_err) { +- error_report_err(local_err); +- } ++ qmp_blockdev_del(id, errp); + return; + } + + blk = blk_by_name(id); + if (!blk) { +- error_report("Device '%s' not found", id); ++ error_setg(errp, "Device '%s' not found", id); + return; + } + + if (!blk_legacy_dinfo(blk)) { +- error_report("Deleting device added with blockdev-add" +- " is not supported"); ++ error_setg(errp, "Deleting device added with blockdev-add" ++ " is not supported"); + return; + } + +@@ -2859,8 +2854,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) + + bs = blk_bs(blk); + if (bs) { +- if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, &local_err)) { +- error_report_err(local_err); ++ if (bdrv_op_is_blocked(bs, BLOCK_OP_TYPE_DRIVE_DEL, errp)) { + aio_context_release(aio_context); + return; + } +@@ -2885,6 +2879,16 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict) + aio_context_release(aio_context); + } + ++void hmp_drive_del(Monitor *mon, const QDict *qdict) ++{ ++ Error *local_err = NULL; ++ ++ qmp___com_redhat_drive_del(qdict_get_str(qdict, "id"), &local_err); ++ if (local_err) { ++ error_report_err(local_err); ++ } ++} ++ + void qmp_block_resize(bool has_device, const char *device, + bool has_node_name, const char *node_name, + int64_t size, Error **errp) +diff --git a/qapi/block.json b/qapi/block.json +index 46fca0e..4aa0959 100644 +--- a/qapi/block.json ++++ b/qapi/block.json +@@ -189,6 +189,29 @@ + '*force': 'bool' } } + + ## ++# @__com.redhat_drive_del: ++# ++# Remove host block device. ++# ++# Remove host block device. The result is that guest generated IO is no longer ++# submitted against the host device underlying the disk. Once a drive has ++# been deleted, the QEMU Block layer returns -EIO which results in IO ++# errors in the guest for applications that are reading/writing to the device. ++# These errors are always reported to the guest, regardless of the drive's error ++# actions (drive options rerror, werror). ++# ++# @id: the device's ID ++# ++# Example: ++# ++# -> { "execute": "__com.redhat_drive_del", "arguments": { "id": "block1" } } ++# <- { "return": {} } ++# ++## ++{ 'command': '__com.redhat_drive_del', ++ 'data': { 'id': 'str' } } ++ ++## + # @nbd-server-start: + # + # Start an NBD server listening on the given host and port. Block +-- +1.8.3.1 + diff --git a/SOURCES/0011-QMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch b/SOURCES/0011-QMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch new file mode 100644 index 0000000..b0597f0 --- /dev/null +++ b/SOURCES/0011-QMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch @@ -0,0 +1,228 @@ +From 6b8c0495aa317dfc5caa6d204373140811880d1a Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 14 Mar 2017 14:16:45 +0100 +Subject: QMP: Forward-port __com.redhat_drive_add from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-4-git-send-email-armbru@redhat.com> +Patchwork-id: 56294 +O-Subject: [PATCH v2 3/6] QMP: Forward-port __com.redhat_drive_add from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Code taken from RHEL-6 as of qemu-kvm-0.12.1.2-2.418.el6, backported +and fixed up as follows: + +* Update simple_drive_add() for commit 4e89978 "qemu-option: + qemu_opts_from_qdict(): use error_set()". + +* Update simple_drive_add() for commit 2d0d283 "Support default block + interfaces per QEMUMachine". + +* Add comment explaining drive_init() error reporting hacks to + simple_drive_add(). + +* qemu-monitor.hx has been split into qmp-commands.hx and + hmp-commands.hx. Copy the QMP parts to qmp-commands.hx. Clean up + second example slightly. + +* Trailing whitespace cleaned up. + +Signed-off-by: Markus Armbruster +(cherry picked from commit e833043c7cdcb81f46c43268c71f39b1dc1e6acc) + +Rebase notes (2.9.0): +- documentation moved from docs/qmp-commands.txt to qapi/block.json +- added argument to qmp_register_command +- explicit argument listing for correct documentation checking + +Rebase notes (2.8.0): +- qmp-commands.hx replaced by docs/qmp-commands.txt (commit bd6092e) + +Rebase notes (2.6.0): +- Added qapi/error.h to device-hotplug.c + +Rebase notes (2.4.0): +- removed qerror_report +- removed user_print + +Merged patches (2.9.0): +- 599ec5f QMP: Fix forward port of __com.redhat_drive_add + +Merged patches (2.7.0): +- 20af75a QMP: Relax __com.redhat_drive_add parameter checking + +(cherry picked from commit 6446da4d43937815708ac3c3ccd079759a097c23) +--- + device-hotplug.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++ + include/sysemu/blockdev.h | 2 ++ + monitor.c | 2 ++ + qapi/block.json | 45 +++++++++++++++++++++++++++++++++ + 4 files changed, 113 insertions(+) + +diff --git a/device-hotplug.c b/device-hotplug.c +index 126f73c..12c17e5 100644 +--- a/device-hotplug.c ++++ b/device-hotplug.c +@@ -31,6 +31,10 @@ + #include "sysemu/sysemu.h" + #include "monitor/monitor.h" + #include "block/block_int.h" ++#include "qemu/error-report.h" ++#include "qapi/qmp/qerror.h" ++#include "qapi/error.h" ++ + + static DriveInfo *add_init_drive(const char *optstr) + { +@@ -89,3 +93,63 @@ err: + blk_unref(blk); + } + } ++ ++static void check_parm(const char *key, QObject *obj, void *opaque) ++{ ++ static const char *unwanted_keys[] = { ++ "bus", "unit", "index", "if", "boot", "addr", ++ NULL ++ ++ }; ++ int *stopped = opaque; ++ const char **p; ++ ++ if (*stopped) { ++ return; ++ } ++ ++ for (p = unwanted_keys; *p; p++) { ++ if (!strcmp(key, *p)) { ++ error_report(QERR_INVALID_PARAMETER, key); ++ *stopped = 1; ++ return; ++ } ++ } ++} ++ ++void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp) ++{ ++ int stopped; ++ Error *local_err = NULL; ++ QemuOpts *opts; ++ DriveInfo *dinfo; ++ MachineClass *mc; ++ ++ if (!qdict_haskey(qdict, "id")) { ++ error_setg(errp, QERR_MISSING_PARAMETER, "id"); ++ return; ++ } ++ ++ stopped = 0; ++ qdict_iter(qdict, check_parm, &stopped); ++ if (stopped) { ++ return; ++ } ++ ++ opts = qemu_opts_from_qdict(&qemu_drive_opts, qdict, &local_err); ++ if (!opts) { ++ error_propagate(errp, local_err); ++ return; ++ } ++ qemu_opt_set(opts, "if", "none", &error_abort); ++ mc = MACHINE_GET_CLASS(current_machine); ++ dinfo = drive_new(opts, mc->block_default_type); ++ if (!dinfo) { ++ error_report(QERR_DEVICE_INIT_FAILED, ++ qemu_opts_id(opts)); ++ qemu_opts_del(opts); ++ return; ++ } ++ ++ return; ++} +diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h +index ac22f2a..3bda14c 100644 +--- a/include/sysemu/blockdev.h ++++ b/include/sysemu/blockdev.h +@@ -63,4 +63,6 @@ DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type); + + void hmp_commit(Monitor *mon, const QDict *qdict); + void hmp_drive_del(Monitor *mon, const QDict *qdict); ++ ++void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp); + #endif +diff --git a/monitor.c b/monitor.c +index be282ec..532bc34 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -1014,6 +1014,8 @@ void monitor_init_qmp_commands(void) + QCO_NO_OPTIONS); + qmp_register_command(&qmp_commands, "netdev_add", qmp_netdev_add, + QCO_NO_OPTIONS); ++ qmp_register_command(&qmp_commands, "__com.redhat_drive_add", simple_drive_add, ++ QCO_NO_OPTIONS); + + qmp_unregister_commands_hack(); + +diff --git a/qapi/block.json b/qapi/block.json +index 4aa0959..24eb9e7 100644 +--- a/qapi/block.json ++++ b/qapi/block.json +@@ -212,6 +212,51 @@ + 'data': { 'id': 'str' } } + + ## ++# @__com.redhat_drive_add: ++# ++# Create a drive similar to -drive if=none. ++# ++# @id: Drive ID, must be unique ++# @file: Disk image ++# @format: Disk format ++# @aio: How to perform asynchronous disk I/O ++# @cache: Host cache use policy ++# @cyls, "heads", "secs": Disk geometry ++# @trans: BIOS translation mode ++# @media: Media type ++# @readonly: Open image read-only ++# @rerror: What to do on read error ++# @werror: What to do on write error ++# @serial: Drive serial number ++# @snapshot: Enable snapshot mode ++# @copy-on-read: Enable copy-on-read mode ++# ++# Example: ++# ++# 1. Add a drive without medium: ++# ++# -> { "execute": "__com.redhat_drive_add", "arguments": { "id": "foo" } } ++# <- {"return": {}} ++# ++# 2. Add a drive with medium: ++# ++# -> { "execute": "__com.redhat_drive_add", ++# "arguments": { "id": "bar", "file": "tmp.qcow2", "format": "qcow2" } } ++# <- {"return": {}} ++# ++## ++{ 'command': '__com.redhat_drive_add', ++ 'data': { 'id': 'str', '*file': 'str', '*format': 'str', ++ '*aio': 'BlockdevAioOptions', ++ '*cache': 'BlockdevCacheOptions', ++ '*cyls': 'int', '*heads': 'int', '*secs': 'int', ++ '*trans': 'str', '*media': 'str', ++ '*readonly': 'bool', '*snapshot': 'bool', ++ '*rerror': 'str', '*werror': 'str', ++ '*copy-on-read': 'bool', '*serial': 'str' }, ++ 'gen': false } # just to minimize porting churn ++ ++## + # @nbd-server-start: + # + # Start an NBD server listening on the given host and port. Block +-- +1.8.3.1 + diff --git a/SOURCES/0012-HMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch b/SOURCES/0012-HMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch new file mode 100644 index 0000000..0a25a06 --- /dev/null +++ b/SOURCES/0012-HMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch @@ -0,0 +1,172 @@ +From 913177df4933b58f50ba55ad2e1205b03b61fc54 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Tue, 14 Mar 2017 14:25:44 +0100 +Subject: HMP: Forward-port __com.redhat_drive_add from RHEL-6 + +RH-Author: Markus Armbruster +Message-id: <1387262799-10350-5-git-send-email-armbru@redhat.com> +Patchwork-id: 56295 +O-Subject: [PATCH v2 4/6] HMP: Forward-port __com.redhat_drive_add from RHEL-6 +Bugzilla: 889051 +RH-Acked-by: Fam Zheng +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Luiz Capitulino + +From: Markus Armbruster + +Signed-off-by: Markus Armbruster +(cherry picked from commit eb3c8d3879df5cc4e623608a3d1b03bb7a8e3a0a) + +Rebase notes (2.8.0): +- qmp-commands.hx replaced by docs/qmp-commands.txt (commit bd6092e) +- mhandler.cmd attribute renamed to cmd (commit 2b9e357) + +Rebase notes (2.4.0): +- removed user_print + +Merged patches (2.9.0): +- 854d5bf Drop macro RFQDN_REDHAT (partially) +- 4804631 HMP: Clean up botched conflict resolution in user manual +- bb06f4 HMP: Fix documentation of __com.redhat.drive_add + +Merged patches (2.7.0): +- a28dcc5 Fix crash bug in rebase of__com.redhat_drive_add + +(cherry picked from commit c34a230c709de5e31b6f9e1a30ba622c5a5be1ee) +--- + blockdev.c | 14 ++++++++++++++ + device-hotplug.c | 12 +++++++++++- + hmp-commands.hx | 14 ++++++++++++++ + include/sysemu/blockdev.h | 4 +++- + include/sysemu/sysemu.h | 1 + + monitor.c | 2 +- + vl.c | 1 + + 7 files changed, 45 insertions(+), 3 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index 5a1b783..dddf2e1 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -4102,3 +4102,17 @@ QemuOptsList qemu_drive_opts = { + { /* end of list */ } + }, + }; ++ ++QemuOptsList qemu_simple_drive_opts = { ++ .name = "simple-drive", ++ .implied_opt_name = "format", ++ .head = QTAILQ_HEAD_INITIALIZER(qemu_simple_drive_opts.head), ++ .desc = { ++ /* ++ * no elements => accept any ++ * sanity checking will happen later ++ * when setting device properties ++ */ ++ { /* end if list */ } ++ } ++}; +diff --git a/device-hotplug.c b/device-hotplug.c +index 12c17e5..218f7b3 100644 +--- a/device-hotplug.c ++++ b/device-hotplug.c +@@ -117,7 +117,7 @@ static void check_parm(const char *key, QObject *obj, void *opaque) + } + } + +-void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp) ++void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp) + { + int stopped; + Error *local_err = NULL; +@@ -153,3 +153,13 @@ void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp) + + return; + } ++ ++void hmp_simple_drive_add(Monitor *mon, const QDict *qdict) ++{ ++ Error *err = NULL; ++ ++ qmp_simple_drive_add((QDict *)qdict, NULL, &err); ++ if (err) { ++ error_report_err(err); ++ } ++} +diff --git a/hmp-commands.hx b/hmp-commands.hx +index fbd02aa..9a9ff0f 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -1253,6 +1253,20 @@ Add drive to PCI storage controller. + ETEXI + + { ++ .name = "__com.redhat_drive_add", ++ .args_type = "simple-drive:O", ++ .params = "id=name,[file=file][,format=f][,media=d]...", ++ .help = "Create a drive similar to -drive if=none.", ++ .cmd = hmp_simple_drive_add, ++ }, ++ ++STEXI ++@item __com.redhat_drive_add ++@findex __com.redhat_drive_add ++Create a drive similar to -drive if=none. ++ETEXI ++ ++ { + .name = "pcie_aer_inject_error", + .args_type = "advisory_non_fatal:-a,correctable:-c," + "id:s,error_status:s," +diff --git a/include/sysemu/blockdev.h b/include/sysemu/blockdev.h +index 3bda14c..c19c36a 100644 +--- a/include/sysemu/blockdev.h ++++ b/include/sysemu/blockdev.h +@@ -64,5 +64,7 @@ DriveInfo *drive_new(QemuOpts *arg, BlockInterfaceType block_default_type); + void hmp_commit(Monitor *mon, const QDict *qdict); + void hmp_drive_del(Monitor *mon, const QDict *qdict); + +-void simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp); ++void hmp_simple_drive_add(Monitor *mon, const QDict *qdict); ++void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp); ++ + #endif +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 53a2588..22c0460 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -232,6 +232,7 @@ extern QemuOptsList qemu_legacy_drive_opts; + extern QemuOptsList qemu_common_drive_opts; + extern QemuOptsList qemu_drive_opts; + extern QemuOptsList bdrv_runtime_opts; ++extern QemuOptsList qemu_simple_drive_opts; + extern QemuOptsList qemu_chardev_opts; + extern QemuOptsList qemu_device_opts; + extern QemuOptsList qemu_netdev_opts; +diff --git a/monitor.c b/monitor.c +index 532bc34..fbcd058 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -1014,7 +1014,7 @@ void monitor_init_qmp_commands(void) + QCO_NO_OPTIONS); + qmp_register_command(&qmp_commands, "netdev_add", qmp_netdev_add, + QCO_NO_OPTIONS); +- qmp_register_command(&qmp_commands, "__com.redhat_drive_add", simple_drive_add, ++ qmp_register_command(&qmp_commands, "__com.redhat_drive_add", qmp_simple_drive_add, + QCO_NO_OPTIONS); + + qmp_unregister_commands_hack(); +diff --git a/vl.c b/vl.c +index 1f9a692..77af8df 100644 +--- a/vl.c ++++ b/vl.c +@@ -3002,6 +3002,7 @@ int main(int argc, char **argv, char **envp) + qemu_add_drive_opts(&qemu_common_drive_opts); + qemu_add_drive_opts(&qemu_drive_opts); + qemu_add_drive_opts(&bdrv_runtime_opts); ++ qemu_add_opts(&qemu_simple_drive_opts); + qemu_add_opts(&qemu_chardev_opts); + qemu_add_opts(&qemu_device_opts); + qemu_add_opts(&qemu_netdev_opts); +-- +1.8.3.1 + 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..763e2dd --- /dev/null +++ b/SOURCES/0013-Add-support-statement-to-help-output.patch @@ -0,0 +1,57 @@ +From 2a07700936e39856cc9f149c6a6517f0715536a6 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 +(cherry picked from commit 1d2bbc1bbb5c50f89c274df8b39796942d9d49ea) +(cherry picked from commit e102a5c0dc66b122d6e570e08e86fdf79b7517dc) +--- + vl.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/vl.c b/vl.c +index 77af8df..0296a90 100644 +--- a/vl.c ++++ b/vl.c +@@ -1908,9 +1908,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()); +@@ -1925,6 +1933,7 @@ static void help(int exitcode) + "\n" + "When using -nographic, press 'ctrl-a h' to get some help.\n"); + ++ print_rh_warning(); + exit(exitcode); + } + +-- +1.8.3.1 + diff --git a/SOURCES/0014-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch b/SOURCES/0014-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch new file mode 100644 index 0000000..713bffd --- /dev/null +++ b/SOURCES/0014-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch @@ -0,0 +1,47 @@ +From 5c401c750c8e52fe5c67b4e60143a862a0d584c1 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Mon, 7 Jul 2014 10:28:38 +0200 +Subject: vl: Round memory sizes below 2MiB up to 2MiB + +RH-Author: Markus Armbruster +Message-id: <1387459965-19517-2-git-send-email-armbru@redhat.com> +Patchwork-id: 56389 +O-Subject: [PATCH 7.0 qemu-kvm 1/1] vl: Round memory sizes below 2MiB up to 2MiB +Bugzilla: 999836 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Luiz Capitulino +RH-Acked-by: Igor Mammedov + +From: Markus Armbruster + +SeaBIOS requires at least 1MiB of RAM, but doesn't doesn't check for +it. It simply assumes it's there, and crashes when it isn't, often +without any indication what's wrong. No upstream SeaBIOS fix +expected. + +In RHEL-6, we round memory sizes below 2MiB up to 2MiB to protect +SeaBIOS (commit 551c098 and commit b9d6c40). Do the same for RHEL-7. +Not wanted upstream. + +Signed-off-by: Markus Armbruster +(cherry picked from commit 059f9d2454b587d72e186aeb49795601a5a809a6) +(cherry picked from commit 8687bf531780ccbed0a23d3eaa66af30b79d70e8) +--- + vl.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/vl.c b/vl.c +index 0296a90..8a5df00 100644 +--- a/vl.c ++++ b/vl.c +@@ -2873,6 +2873,7 @@ static void set_memory_options(uint64_t *ram_slots, ram_addr_t *maxram_size, + } + + sz = QEMU_ALIGN_UP(sz, 8192); ++ sz = MAX(sz, 2 * 1024 * 1024); + ram_size = sz; + if (ram_size != sz) { + error_report("ram size too large"); +-- +1.8.3.1 + diff --git a/SOURCES/0015-use-recommended-max-vcpu-count.patch b/SOURCES/0015-use-recommended-max-vcpu-count.patch new file mode 100644 index 0000000..77ce315 --- /dev/null +++ b/SOURCES/0015-use-recommended-max-vcpu-count.patch @@ -0,0 +1,43 @@ +From a4ceb63bdc5cbac19f5f633ec761b9de0dedb55e Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Tue, 21 Jan 2014 10:46:52 +0100 +Subject: use recommended max vcpu count + +RH-Author: Andrew Jones +Message-id: <1390301212-15344-1-git-send-email-drjones@redhat.com> +Patchwork-id: 56862 +O-Subject: [RHEL7.0 qemu-kvm PATCH v6] use recommended max vcpu count +Bugzilla: 998708 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Marcelo Tosatti + +The recommended vcpu max limit (KVM_CAP_NR_VCPUS) should be used instead +of the actual max vcpu limit (KVM_CAP_MAX_VCPUS) to give an error. + +This matches the limit tested by QE on RHEL6: 160. + +Signed-off-by: Andrew Jones +(cherry picked from commit 0c77563da9357ff2738c4e23db2df39e1ac7b96e) +(cherry picked from commit 2e43df9e18ae22b4f57c31b01130755a3100f8cb) +--- + kvm-all.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/kvm-all.c b/kvm-all.c +index 90b8573..a545d53 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -1633,6 +1633,9 @@ static int kvm_init(MachineState *ms) + soft_vcpus_limit = kvm_recommended_vcpus(s); + hard_vcpus_limit = kvm_max_vcpus(s); + ++ /* RHEL doesn't support nr_vcpus > soft_vcpus_limit */ ++ hard_vcpus_limit = soft_vcpus_limit; ++ + while (nc->name) { + if (nc->num > soft_vcpus_limit) { + fprintf(stderr, +-- +1.8.3.1 + diff --git a/SOURCES/0016-Add-support-for-simpletrace.patch b/SOURCES/0016-Add-support-for-simpletrace.patch new file mode 100644 index 0000000..70e9cd9 --- /dev/null +++ b/SOURCES/0016-Add-support-for-simpletrace.patch @@ -0,0 +1,119 @@ +From bfc1d7f3628f2ffbabbae71d57a506cea6663ddf Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 8 Oct 2015 09:50:17 +0200 +Subject: Add support for simpletrace + +As simpletrace is upstream, we just need to properly handle it during rpmbuild. + +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 9274e74b86d29a18e55f91083c7cbf3d80c236d2) + +Rebase notes (2.9.0): +- Added group argument for tracetool.py (upstream) + +Rebase notes (2.8.0): +- Changed tracetool.py parameters + +Merged patches (2.3.0): +- db959d6 redhat/qemu-kvm.spec.template: Install qemu-kvm-simpletrace.stp +- 5292fc3 trace: add SystemTap init scripts for simpletrace bridge +- eda9e5e simpletrace: install simpletrace.py +- 85c4c8f trace: add systemtap-initscript README file to RPM + +(cherry picked from commit caa1609a46316adc4a00559048e79d6d7a6c9d2e) +--- + .gitignore | 2 ++ + Makefile | 4 +++ + README.systemtap | 43 +++++++++++++++++++++++++++++++++ + redhat/qemu-kvm.spec.template | 27 +++++++++++++++++++-- + scripts/systemtap/conf.d/qemu_kvm.conf | 4 +++ + scripts/systemtap/script.d/qemu_kvm.stp | 1 + + 6 files changed, 79 insertions(+), 2 deletions(-) + create mode 100644 README.systemtap + create mode 100644 scripts/systemtap/conf.d/qemu_kvm.conf + create mode 100644 scripts/systemtap/script.d/qemu_kvm.stp + +diff --git a/Makefile b/Makefile +index 4202ee5..098c635 100644 +--- a/Makefile ++++ b/Makefile +@@ -624,6 +624,10 @@ endif + $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ + done + $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all" ++ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/script.d" ++ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/script.d/qemu_kvm.stp "$(DESTDIR)$(qemu_datadir)/systemtap/script.d/" ++ $(INSTALL_DIR) "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d" ++ $(INSTALL_DATA) $(SRC_PATH)/scripts/systemtap/conf.d/qemu_kvm.conf "$(DESTDIR)$(qemu_datadir)/systemtap/conf.d/" + for d in $(TARGET_DIRS); do \ + $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \ + done +diff --git a/README.systemtap b/README.systemtap +new file mode 100644 +index 0000000..ad913fc +--- /dev/null ++++ b/README.systemtap +@@ -0,0 +1,43 @@ ++QEMU tracing using systemtap-initscript ++--------------------------------------- ++ ++You can capture QEMU trace data all the time using systemtap-initscript. This ++uses SystemTap's flight recorder mode to trace all running guests to a ++fixed-size buffer on the host. Old trace entries are overwritten by new ++entries when the buffer size wraps. ++ ++1. Install the systemtap-initscript package: ++ # yum install systemtap-initscript ++ ++2. Install the systemtap scripts and the conf file: ++ # cp /usr/share/qemu-kvm/systemtap/script.d/qemu_kvm.stp /etc/systemtap/script.d/ ++ # cp /usr/share/qemu-kvm/systemtap/conf.d/qemu_kvm.conf /etc/systemtap/conf.d/ ++ ++The set of trace events to enable is given in qemu_kvm.stp. This SystemTap ++script can be customized to add or remove trace events provided in ++/usr/share/systemtap/tapset/qemu-kvm-simpletrace.stp. ++ ++SystemTap customizations can be made to qemu_kvm.conf to control the flight ++recorder buffer size and whether to store traces in memory only or disk too. ++See stap(1) for option documentation. ++ ++3. Start the systemtap service. ++ # service systemtap start qemu_kvm ++ ++4. Make the service start at boot time. ++ # chkconfig systemtap on ++ ++5. Confirm that the service works. ++ # service systemtap status qemu_kvm ++ qemu_kvm is running... ++ ++When you want to inspect the trace buffer, perform the following steps: ++ ++1. Dump the trace buffer. ++ # staprun -A qemu_kvm >/tmp/trace.log ++ ++2. Start the systemtap service because the preceding step stops the service. ++ # service systemtap start qemu_kvm ++ ++3. Translate the trace record to readable format. ++ # /usr/share/qemu-kvm/simpletrace.py --no-header /usr/share/qemu-kvm/trace-events /tmp/trace.log +diff --git a/scripts/systemtap/conf.d/qemu_kvm.conf b/scripts/systemtap/conf.d/qemu_kvm.conf +new file mode 100644 +index 0000000..372d816 +--- /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 0000000..c04abf9 +--- /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 {} +-- +1.8.3.1 + diff --git a/SOURCES/0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch b/SOURCES/0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch new file mode 100644 index 0000000..f4ee5a8 --- /dev/null +++ b/SOURCES/0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch @@ -0,0 +1,921 @@ +From 1c2dac56d5e710faebe25b7aa9cac594ec0f9d4b Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Fri, 14 Nov 2014 08:51:50 +0100 +Subject: Use qemu-kvm in documentation instead of qemu-system-i386 + +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. + +Signed-off-by: Miroslav Rezanina +(cherry picked from commit acd13dd2a1ddce4de705587bc90a07939e7b3d7f) + +Rebase Notes (2.9.0): +- fixed chunks missed on 2.8 rebase + +(cherry picked from commit c4a72f98eb8bbc3237e23725413dea0e23d7b88a) +--- + qemu-doc.texi | 110 ++++++++++++++++++++--------------------- + qemu-options.hx | 148 ++++++++++++++++++++++++++++---------------------------- + 2 files changed, 129 insertions(+), 129 deletions(-) + +diff --git a/qemu-doc.texi b/qemu-doc.texi +index 794ab4a..8a3d7d4 100644 +--- a/qemu-doc.texi ++++ b/qemu-doc.texi +@@ -199,12 +199,12 @@ Note that, by default, GUS shares IRQ(7) with parallel ports and so + QEMU must be told to not have parallel ports to have working GUS. + + @example +-qemu-system-i386 dos.img -soundhw gus -parallel none ++qemu-kvm dos.img -soundhw gus -parallel none + @end example + + Alternatively: + @example +-qemu-system-i386 dos.img -device gus,irq=5 ++qemu-kvm dos.img -device gus,irq=5 + @end example + + Or some other unclaimed IRQ. +@@ -220,7 +220,7 @@ CS4231A is the chip used in Windows Sound System and GUSMAX products + Download and uncompress the linux image (@file{linux.img}) and type: + + @example +-qemu-system-i386 linux.img ++qemu-kvm linux.img + @end example + + Linux should boot and give you a prompt. +@@ -230,7 +230,7 @@ Linux should boot and give you a prompt. + + @example + @c man begin SYNOPSIS +-@command{qemu-system-i386} [@var{options}] [@var{disk_image}] ++@command{qemu-kvm} [@var{options}] [@var{disk_image}] + @c man end + @end example + +@@ -789,7 +789,7 @@ QEMU can automatically create a virtual FAT disk image from a + directory tree. In order to use it, just type: + + @example +-qemu-system-i386 linux.img -hdb fat:/my_directory ++qemu-kvm linux.img -hdb fat:/my_directory + @end example + + Then you access access to all the files in the @file{/my_directory} +@@ -799,14 +799,14 @@ them via SAMBA or NFS. The default access is @emph{read-only}. + Floppies can be emulated with the @code{:floppy:} option: + + @example +-qemu-system-i386 linux.img -fda fat:floppy:/my_directory ++qemu-kvm linux.img -fda fat:floppy:/my_directory + @end example + + A read/write support is available for testing (beta stage) with the + @code{:rw:} option: + + @example +-qemu-system-i386 linux.img -fda fat:floppy:rw:/my_directory ++qemu-kvm linux.img -fda fat:floppy:rw:/my_directory + @end example + + What you should @emph{never} do: +@@ -824,14 +824,14 @@ QEMU can access directly to block device exported using the Network Block Device + protocol. + + @example +-qemu-system-i386 linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/ ++qemu-kvm linux.img -hdb nbd://my_nbd_server.mydomain.org:1024/ + @end example + + If the NBD server is located on the same host, you can use an unix socket instead + of an inet socket: + + @example +-qemu-system-i386 linux.img -hdb nbd+unix://?socket=/tmp/my_socket ++qemu-kvm linux.img -hdb nbd+unix://?socket=/tmp/my_socket + @end example + + In this case, the block device must be exported using qemu-nbd: +@@ -848,23 +848,23 @@ qemu-nbd --socket=/tmp/my_socket --share=2 my_disk.qcow2 + @noindent + and then you can use it with two guests: + @example +-qemu-system-i386 linux1.img -hdb nbd+unix://?socket=/tmp/my_socket +-qemu-system-i386 linux2.img -hdb nbd+unix://?socket=/tmp/my_socket ++qemu-kvm linux1.img -hdb nbd+unix://?socket=/tmp/my_socket ++qemu-kvm linux2.img -hdb nbd+unix://?socket=/tmp/my_socket + @end example + + If the nbd-server uses named exports (supported since NBD 2.9.18, or with QEMU's + own embedded NBD server), you must specify an export name in the URI: + @example +-qemu-system-i386 -cdrom nbd://localhost/debian-500-ppc-netinst +-qemu-system-i386 -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst ++qemu-kvm -cdrom nbd://localhost/debian-500-ppc-netinst ++qemu-kvm -cdrom nbd://localhost/openSUSE-11.1-ppc-netinst + @end example + + The URI syntax for NBD is supported since QEMU 1.3. An alternative syntax is + also available. Here are some example of the older syntax: + @example +-qemu-system-i386 linux.img -hdb nbd:my_nbd_server.mydomain.org:1024 +-qemu-system-i386 linux2.img -hdb nbd:unix:/tmp/my_socket +-qemu-system-i386 -cdrom nbd:localhost:10809:exportname=debian-500-ppc-netinst ++qemu-kvm linux.img -hdb nbd:my_nbd_server.mydomain.org:1024 ++qemu-kvm linux2.img -hdb nbd:unix:/tmp/my_socket ++qemu-kvm -cdrom nbd:localhost:10809:exportname=debian-500-ppc-netinst + @end example + + @node disk_images_sheepdog +@@ -889,7 +889,7 @@ qemu-img convert @var{filename} sheepdog:///@var{image} + + You can boot from the Sheepdog disk image with the command: + @example +-qemu-system-i386 sheepdog:///@var{image} ++qemu-kvm sheepdog:///@var{image} + @end example + + You can also create a snapshot of the Sheepdog image like qcow2. +@@ -901,7 +901,7 @@ where @var{tag} is a tag name of the newly created snapshot. + To boot from the Sheepdog snapshot, specify the tag name of the + snapshot. + @example +-qemu-system-i386 sheepdog:///@var{image}#@var{tag} ++qemu-kvm sheepdog:///@var{image}#@var{tag} + @end example + + You can create a cloned image from the existing snapshot. +@@ -914,14 +914,14 @@ is its tag name. + You can use an unix socket instead of an inet socket: + + @example +-qemu-system-i386 sheepdog+unix:///@var{image}?socket=@var{path} ++qemu-kvm sheepdog+unix:///@var{image}?socket=@var{path} + @end example + + If the Sheepdog daemon doesn't run on the local host, you need to + specify one of the Sheepdog servers to connect to. + @example + qemu-img create sheepdog://@var{hostname}:@var{port}/@var{image} @var{size} +-qemu-system-i386 sheepdog://@var{hostname}:@var{port}/@var{image} ++qemu-kvm sheepdog://@var{hostname}:@var{port}/@var{image} + @end example + + @node disk_images_iscsi +@@ -963,7 +963,7 @@ Various session related parameters can be set via special options, either + in a configuration file provided via '-readconfig' or directly on the + command line. + +-If the initiator-name is not specified qemu will use a default name ++If the initiator-name is not specified qemu-kvm will use a default name + of 'iqn.2008-11.org.linux-kvm[:'] where is the name of the + virtual machine. + +@@ -1010,7 +1010,7 @@ cat >iscsi.conf < using POSIX shm, you may specify + a memory backend that has hugepage support: + + @example +-qemu-system-x86_64 -object memory-backend-file,size=1G,mem-path=/dev/hugepages/my-shmem-file,share,id=mb1 ++qemu-kvm -object memory-backend-file,size=1G,mem-path=/dev/hugepages/my-shmem-file,share,id=mb1 + -device ivshmem-plain,memdev=mb1 + @end example + +@@ -1332,7 +1332,7 @@ kernel testing. + + The syntax is: + @example +-qemu-system-i386 -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" ++qemu-kvm -kernel arch/i386/boot/bzImage -hda root-2.4.20.img -append "root=/dev/hda" + @end example + + Use @option{-kernel} to provide the Linux kernel image and +@@ -1347,7 +1347,7 @@ If you do not need graphical output, you can disable it and redirect + the virtual serial port and the QEMU monitor to the console with the + @option{-nographic} option. The typical command line is: + @example +-qemu-system-i386 -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ ++qemu-kvm -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ + -append "root=/dev/hda console=ttyS0" -nographic + @end example + +@@ -1411,7 +1411,7 @@ Network adapter that supports CDC ethernet and RNDIS protocols. @var{options} + specifies NIC options as with @code{-net nic,}@var{options} (see description). + For instance, user-mode networking can be used with + @example +-qemu-system-i386 [...OPTIONS...] -net user,vlan=0 -usbdevice net:vlan=0 ++qemu-kvm [...OPTIONS...] -net user,vlan=0 -usbdevice net:vlan=0 + @end example + Currently this cannot be used in machines that support PCI NICs. + @item bt[:@var{hci-type}] +@@ -1421,7 +1421,7 @@ no type is given, the HCI logic corresponds to @code{-bt hci,vlan=0}. + This USB device implements the USB Transport Layer of HCI. Example + usage: + @example +-@command{qemu-system-i386} [...@var{OPTIONS}...] @option{-usbdevice} bt:hci,vlan=3 @option{-bt} device:keyboard,vlan=3 ++@command{qemu-kvm} [...@var{OPTIONS}...] @option{-usbdevice} bt:hci,vlan=3 @option{-bt} device:keyboard,vlan=3 + @end example + @end table + +@@ -1499,7 +1499,7 @@ For this setup it is recommended to restrict it to listen on a UNIX domain + socket only. For example + + @example +-qemu-system-i386 [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc ++qemu-kvm [...OPTIONS...] -vnc unix:/home/joebloggs/.qemu-myvm-vnc + @end example + + This ensures that only users on local box with read/write access to that +@@ -1522,7 +1522,7 @@ is running the password is set with the monitor. Until the monitor is used to + set the password all clients will be rejected. + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,password -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,password -monitor stdio + (qemu) change vnc password + Password: ******** + (qemu) +@@ -1539,7 +1539,7 @@ support provides a secure session, but no authentication. This allows any + client to connect, and provides an encrypted session. + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,tls,x509=/etc/pki/qemu -monitor stdio + @end example + + In the above example @code{/etc/pki/qemu} should contain at least three files, +@@ -1557,7 +1557,7 @@ then validate against the CA certificate. This is a good choice if deploying + in an environment with a private internal certificate authority. + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,tls,x509verify=/etc/pki/qemu -monitor stdio + @end example + + +@@ -1568,7 +1568,7 @@ Finally, the previous method can be combined with VNC password authentication + to provide two layers of authentication for clients. + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,password,tls,x509verify=/etc/pki/qemu -monitor stdio + (qemu) change vnc password + Password: ******** + (qemu) +@@ -1591,7 +1591,7 @@ used for authentication, but assuming use of one supporting SSF, + then QEMU can be launched with: + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,sasl -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,sasl -monitor stdio + @end example + + @node vnc_sec_certificate_sasl +@@ -1605,7 +1605,7 @@ credentials. This can be enabled, by combining the 'sasl' option + with the aforementioned TLS + x509 options: + + @example +-qemu-system-i386 [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio ++qemu-kvm [...OPTIONS...] -vnc :1,tls,x509,sasl -monitor stdio + @end example + + +@@ -1773,7 +1773,7 @@ QEMU has a primitive support to work with gdb, so that you can do + In order to use gdb, launch QEMU with the '-s' option. It will wait for a + gdb connection: + @example +-qemu-system-i386 -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ ++qemu-kvm -s -kernel arch/i386/boot/bzImage -hda root-2.4.20.img \ + -append "root=/dev/hda" + Connected to host network interface: tun0 + Waiting gdb connection on port 1234 +@@ -1955,7 +1955,7 @@ differences are mentioned in the following sections. + @section PowerPC System emulator + @cindex system emulation (PowerPC) + +-Use the executable @file{qemu-system-ppc} to simulate a complete PREP ++Use the executable @file{qemu-kvm} to simulate a complete PREP + or PowerMac PowerPC system. + + QEMU emulates the following PowerMac peripherals: +@@ -2019,7 +2019,7 @@ Set the initial VGA graphic mode. The default is 800x600x32. + Set OpenBIOS variables in NVRAM, for example: + + @example +-qemu-system-ppc -prom-env 'auto-boot?=false' \ ++qemu-kvm -prom-env 'auto-boot?=false' \ + -prom-env 'boot-device=hd:2,\yaboot' \ + -prom-env 'boot-args=conf=hd:2,\yaboot.conf' + @end example +diff --git a/qemu-options.hx b/qemu-options.hx +index d5a002d..b5544ac 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -195,7 +195,7 @@ This option defines a free-form string that can be used to describe @var{fd}. + + You can open an image using pre-opened file descriptors from an fd set: + @example +-qemu-system-i386 ++qemu-kvm + -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" + -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" + -drive file=/dev/fdset/2,index=0,media=disk +@@ -224,7 +224,7 @@ STEXI + Set default value of @var{driver}'s property @var{prop} to @var{value}, e.g.: + + @example +-qemu-system-i386 -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk ++qemu-kvm -global ide-drive.physical_block_size=4096 -drive file=file,if=ide,index=0,media=disk + @end example + + In particular, you can use this to set driver properties for devices which are +@@ -269,7 +269,7 @@ the recommended is 320x240, 640x480, 800x640. + + A timeout could be passed to bios, guest will pause for @var{rb_timeout} ms + when boot failed, then reboot. If @var{rb_timeout} is '-1', guest will not +-reboot, qemu passes '-1' to bios by default. Currently Seabios for X86 ++reboot, qemu-kvm passes '-1' to bios by default. Currently Seabios for X86 + system support it. + + Do strict boot via @option{strict=on} as far as firmware/BIOS +@@ -278,11 +278,11 @@ bootindex options. The default is non-strict boot. + + @example + # try to boot from network first, then from hard disk +-qemu-system-i386 -boot order=nc ++qemu-kvm -boot order=nc + # boot from CD-ROM first, switch back to default order after reboot +-qemu-system-i386 -boot once=d ++qemu-kvm -boot once=d + # boot with a splash picture for 5 seconds. +-qemu-system-i386 -boot menu=on,splash=/root/boot.bmp,splash-time=5000 ++qemu-kvm -boot menu=on,splash=/root/boot.bmp,splash-time=5000 + @end example + + Note: The legacy format '-boot @var{drives}' is still supported but its +@@ -311,7 +311,7 @@ For example, the following command-line sets the guest startup RAM size to + memory the guest can reach to 4GB: + + @example +-qemu-system-x86_64 -m 1G,slots=3,maxmem=4G ++qemu-kvm -m 1G,slots=3,maxmem=4G + @end example + + If @var{slots} and @var{maxmem} are not specified, memory hotplug won't +@@ -380,12 +380,12 @@ Enable audio and selected sound hardware. Use 'help' to print all + available sound hardware. + + @example +-qemu-system-i386 -soundhw sb16,adlib disk.img +-qemu-system-i386 -soundhw es1370 disk.img +-qemu-system-i386 -soundhw ac97 disk.img +-qemu-system-i386 -soundhw hda disk.img +-qemu-system-i386 -soundhw all disk.img +-qemu-system-i386 -soundhw help ++qemu-kvm -soundhw sb16,adlib disk.img ++qemu-kvm -soundhw es1370 disk.img ++qemu-kvm -soundhw ac97 disk.img ++qemu-kvm -soundhw hda disk.img ++qemu-kvm -soundhw all disk.img ++qemu-kvm -soundhw help + @end example + + Note that Linux's i810_audio OSS kernel (for AC97) module might +@@ -672,21 +672,21 @@ is off. + + Instead of @option{-cdrom} you can use: + @example +-qemu-system-i386 -drive file=file,index=2,media=cdrom ++qemu-kvm -drive file=file,index=2,media=cdrom + @end example + + Instead of @option{-hda}, @option{-hdb}, @option{-hdc}, @option{-hdd}, you can + use: + @example +-qemu-system-i386 -drive file=file,index=0,media=disk +-qemu-system-i386 -drive file=file,index=1,media=disk +-qemu-system-i386 -drive file=file,index=2,media=disk +-qemu-system-i386 -drive file=file,index=3,media=disk ++qemu-kvm -drive file=file,index=0,media=disk ++qemu-kvm -drive file=file,index=1,media=disk ++qemu-kvm -drive file=file,index=2,media=disk ++qemu-kvm -drive file=file,index=3,media=disk + @end example + + You can open an image using pre-opened file descriptors from an fd set: + @example +-qemu-system-i386 ++qemu-kvm + -add-fd fd=3,set=2,opaque="rdwr:/path/to/file" + -add-fd fd=4,set=2,opaque="rdonly:/path/to/file" + -drive file=/dev/fdset/2,index=0,media=disk +@@ -694,28 +694,28 @@ qemu-system-i386 + + You can connect a CDROM to the slave of ide0: + @example +-qemu-system-i386 -drive file=file,if=ide,index=1,media=cdrom ++qemu-kvm -drive file=file,if=ide,index=1,media=cdrom + @end example + + If you don't specify the "file=" argument, you define an empty drive: + @example +-qemu-system-i386 -drive if=ide,index=1,media=cdrom ++qemu-kvm -drive if=ide,index=1,media=cdrom + @end example + + Instead of @option{-fda}, @option{-fdb}, you can use: + @example +-qemu-system-i386 -drive file=file,index=0,if=floppy +-qemu-system-i386 -drive file=file,index=1,if=floppy ++qemu-kvm -drive file=file,index=0,if=floppy ++qemu-kvm -drive file=file,index=1,if=floppy + @end example + + By default, @var{interface} is "ide" and @var{index} is automatically + incremented: + @example +-qemu-system-i386 -drive file=a -drive file=b" ++qemu-kvm -drive file=a -drive file=b" + @end example + is interpreted like: + @example +-qemu-system-i386 -hda a -hdb b ++qemu-kvm -hda a -hdb b + @end example + ETEXI + +@@ -1840,7 +1840,7 @@ can not be resolved. + + Example: + @example +-qemu -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...] ++qemu-kvm -net user,dnssearch=mgmt.example.org,dnssearch=example.org [...] + @end example + + @item tftp=@var{dir} +@@ -1856,7 +1856,7 @@ a guest from a local directory. + + Example (using pxelinux): + @example +-qemu-system-i386 -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 ++qemu-kvm -hda linux.img -boot n -net user,tftp=/path/to/tftp/files,bootfile=/pxelinux.0 + @end example + + @item smb=@var{dir}[,smbserver=@var{addr}] +@@ -1891,7 +1891,7 @@ screen 0, use the following: + + @example + # on the host +-qemu-system-i386 -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...] ++qemu-kvm -net user,hostfwd=tcp:127.0.0.1:6001-:6000 [...] + # this host xterm should open in the guest X11 server + xterm -display :1 + @end example +@@ -1901,7 +1901,7 @@ the guest, use the following: + + @example + # on the host +-qemu-system-i386 -net user,hostfwd=tcp::5555-:23 [...] ++qemu-kvm -net user,hostfwd=tcp::5555-:23 [...] + telnet localhost 5555 + @end example + +@@ -1920,7 +1920,7 @@ lifetime, like in the following example: + @example + # open 10.10.1.1:4321 on bootup, connect 10.0.2.100:1234 to it whenever + # the guest accesses it +-qemu -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...] ++qemu-kvm -net user,guestfwd=tcp:10.0.2.100:1234-tcp:10.10.1.1:4321 [...] + @end example + + Or you can execute a command on every TCP connection established by the guest, +@@ -1929,7 +1929,7 @@ so that QEMU behaves similar to an inetd process for that virtual server: + @example + # call "netcat 10.10.1.1 4321" on every TCP connection to 10.0.2.100:1234 + # and connect the TCP stream to its stdin/stdout +-qemu -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' ++qemu-kvm -net 'user,guestfwd=tcp:10.0.2.100:1234-cmd:netcat 10.10.1.1 4321' + @end example + + @end table +@@ -1962,13 +1962,13 @@ Examples: + + @example + #launch a QEMU instance with the default network script +-qemu-system-i386 linux.img -net nic -net tap ++qemu-kvm linux.img -net nic -net tap + @end example + + @example + #launch a QEMU instance with two NICs, each one connected + #to a TAP device +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 \ + -net nic,vlan=1 -net tap,vlan=1,ifname=tap1 + @end example +@@ -1976,7 +1976,7 @@ qemu-system-i386 linux.img \ + @example + #launch a QEMU instance with the default network helper to + #connect a TAP device to bridge br0 +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic -net tap,"helper=/path/to/qemu-bridge-helper" + @end example + +@@ -1994,13 +1994,13 @@ Examples: + @example + #launch a QEMU instance with the default network helper to + #connect a TAP device to bridge br0 +-qemu-system-i386 linux.img -net bridge -net nic,model=virtio ++qemu-kvm linux.img -net bridge -net nic,model=virtio + @end example + + @example + #launch a QEMU instance with the default network helper to + #connect a TAP device to bridge qemubr0 +-qemu-system-i386 linux.img -net bridge,br=qemubr0 -net nic,model=virtio ++qemu-kvm linux.img -net bridge,br=qemubr0 -net nic,model=virtio + @end example + + @item -netdev socket,id=@var{id}[,fd=@var{h}][,listen=[@var{host}]:@var{port}][,connect=@var{host}:@var{port}] +@@ -2016,12 +2016,12 @@ specifies an already opened TCP socket. + Example: + @example + # launch a first QEMU instance +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,listen=:1234 + # connect the VLAN 0 of this instance to the VLAN 0 + # of the first instance +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:57 \ + -net socket,connect=127.0.0.1:1234 + @end example +@@ -2047,15 +2047,15 @@ Use @option{fd=h} to specify an already opened UDP multicast socket. + Example: + @example + # launch one QEMU instance +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,mcast=230.0.0.1:1234 + # launch another QEMU instance on same "bus" +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:57 \ + -net socket,mcast=230.0.0.1:1234 + # launch yet another QEMU instance on same "bus" +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:58 \ + -net socket,mcast=230.0.0.1:1234 + @end example +@@ -2064,7 +2064,7 @@ Example (User Mode Linux compat.): + @example + # launch QEMU instance (note mcast address selected + # is UML's default) +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,mcast=239.192.168.1:1102 + # launch UML +@@ -2073,7 +2073,7 @@ qemu-system-i386 linux.img \ + + Example (send packets from host's 1.2.3.4): + @example +-qemu-system-i386 linux.img \ ++qemu-kvm linux.img \ + -net nic,macaddr=52:54:00:12:34:56 \ + -net socket,mcast=239.192.168.1:1102,localaddr=1.2.3.4 + @end example +@@ -2132,7 +2132,7 @@ brctl addif br-lan vmtunnel0 + # on 4.3.2.1 + # launch QEMU instance - if your network has reorder or is very lossy add ,pincounter + +-qemu-system-i386 linux.img -net nic -net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter ++qemu-kvm linux.img -net nic -net l2tpv3,src=4.2.3.1,dst=1.2.3.4,udp,srcport=16384,dstport=16384,rxsession=0xffffffff,txsession=0xffffffff,counter + + + @end example +@@ -2150,7 +2150,7 @@ Example: + # launch vde switch + vde_switch -F -sock /tmp/myswitch + # launch QEMU instance +-qemu-system-i386 linux.img -net nic -net vde,sock=/tmp/myswitch ++qemu-kvm linux.img -net nic -net vde,sock=/tmp/myswitch + @end example + + @item -netdev hubport,id=@var{id},hubid=@var{hubid} +@@ -2172,11 +2172,11 @@ be created for multiqueue vhost-user. + + Example: + @example +-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 + @end example + + @item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}] +@@ -2544,7 +2544,7 @@ images for the guest storage. Both disk and cdrom images are supported. + Syntax for specifying iSCSI LUNs is + ``iscsi://[:]//'' + +-By default qemu will use the iSCSI initiator-name ++By default qemu-kvm will use the iSCSI initiator-name + 'iqn.2008-11.org.linux-kvm[:]' but this can also be set from the command + line or a configuration file. + +@@ -2555,21 +2555,21 @@ is specified in seconds. The default is 0 which means no timeout. Libiscsi + + Example (without authentication): + @example +-qemu-system-i386 -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \ ++qemu-kvm -iscsi initiator-name=iqn.2001-04.com.example:my-initiator \ + -cdrom iscsi://192.0.2.1/iqn.2001-04.com.example/2 \ + -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1 + @end example + + Example (CHAP username/password via URL): + @example +-qemu-system-i386 -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1 ++qemu-kvm -drive file=iscsi://user%password@@192.0.2.1/iqn.2001-04.com.example/1 + @end example + + Example (CHAP username/password via environment variables): + @example + LIBISCSI_CHAP_USERNAME="user" \ + LIBISCSI_CHAP_PASSWORD="password" \ +-qemu-system-i386 -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1 ++qemu-kvm -drive file=iscsi://192.0.2.1/iqn.2001-04.com.example/1 + @end example + + iSCSI support is an optional feature of QEMU and only available when +@@ -2599,12 +2599,12 @@ Syntax for specifying a NBD device using Unix Domain Sockets + + Example for TCP + @example +-qemu-system-i386 --drive file=nbd:192.0.2.1:30000 ++qemu-kvm --drive file=nbd:192.0.2.1:30000 + @end example + + Example for Unix Domain Sockets + @example +-qemu-system-i386 --drive file=nbd:unix:/tmp/nbd-socket ++qemu-kvm --drive file=nbd:unix:/tmp/nbd-socket + @end example + + @item SSH +@@ -2612,8 +2612,8 @@ QEMU supports SSH (Secure Shell) access to remote disks. + + Examples: + @example +-qemu-system-i386 -drive file=ssh://user@@host/path/to/disk.img +-qemu-system-i386 -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img ++qemu-kvm -drive file=ssh://user@@host/path/to/disk.img ++qemu-kvm -drive file.driver=ssh,file.user=user,file.host=host,file.port=22,file.path=/path/to/disk.img + @end example + + Currently authentication must be done using ssh-agent. Other +@@ -2631,7 +2631,7 @@ sheepdog[+tcp|+unix]://[host:port]/vdiname[?socket=path][#snapid|#tag] + + Example + @example +-qemu-system-i386 --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine ++qemu-kvm --drive file=sheepdog://192.0.2.1:30000/MyVirtualMachine + @end example + + See also @url{https://sheepdog.github.io/sheepdog/}. +@@ -2657,17 +2657,17 @@ JSON: + Example + @example + URI: +-qemu-system-x86_64 --drive file=gluster://192.0.2.1/testvol/a.img, ++qemu-kvm --drive file=gluster://192.0.2.1/testvol/a.img, + @ file.debug=9,file.logfile=/var/log/qemu-gluster.log + + JSON: +-qemu-system-x86_64 'json:@{"driver":"qcow2", ++qemu-kvm 'json:@{"driver":"qcow2", + @ "file":@{"driver":"gluster", + @ "volume":"testvol","path":"a.img", + @ "debug":9,"logfile":"/var/log/qemu-gluster.log", + @ "server":[@{"type":"tcp","host":"1.2.3.4","port":24007@}, + @ @{"type":"unix","socket":"/var/run/glusterd.socket"@}]@}@}' +-qemu-system-x86_64 -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img, ++qemu-kvm -drive driver=qcow2,file.driver=gluster,file.volume=testvol,file.path=/path/a.img, + @ file.debug=9,file.logfile=/var/log/qemu-gluster.log, + @ file.server.0.type=tcp,file.server.0.host=1.2.3.4,file.server.0.port=24007, + @ file.server.1.type=unix,file.server.1.socket=/var/run/glusterd.socket +@@ -2727,14 +2727,14 @@ that CURL waits for a response from the remote server to get the size of the + image to be downloaded. If not set, the default timeout of 5 seconds is used. + @end table + +-Note that when passing options to qemu explicitly, @option{driver} is the value ++Note that when passing options to qemu-kvm explicitly, @option{driver} is the value + of . + + Example: boot from a remote Fedora 20 live ISO image + @example +-qemu-system-x86_64 --drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly ++qemu-kvm --drive media=cdrom,file=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly + +-qemu-system-x86_64 --drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly ++qemu-kvm --drive media=cdrom,file.driver=http,file.url=http://dl.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso,readonly + @end example + + Example: boot from a remote Fedora 20 cloud image using a local overlay for +@@ -2742,7 +2742,7 @@ writes, copy-on-read, and a readahead of 64k + @example + qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"http",, "file.url":"https://dl.fedoraproject.org/pub/fedora/linux/releases/20/Images/x86_64/Fedora-x86_64-20-20131211.1-sda.qcow2",, "file.readahead":"64k"@}' /tmp/Fedora-x86_64-20-20131211.1-sda.qcow2 + +-qemu-system-x86_64 -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on ++qemu-kvm -drive file=/tmp/Fedora-x86_64-20-20131211.1-sda.qcow2,copy-on-read=on + @end example + + Example: boot from an image stored on a VMware vSphere server with a self-signed +@@ -2751,7 +2751,7 @@ of 10 seconds. + @example + qemu-img create -f qcow2 -o backing_file='json:@{"file.driver":"https",, "file.url":"https://user:password@@vsphere.example.com/folder/test/test-flat.vmdk?dcPath=Datacenter&dsName=datastore1",, "file.sslverify":"off",, "file.readahead":"64k",, "file.timeout":10@}' /tmp/test.qcow2 + +-qemu-system-x86_64 -drive file=/tmp/test.qcow2 ++qemu-kvm -drive file=/tmp/test.qcow2 + @end example + ETEXI + +@@ -2815,7 +2815,7 @@ and communicate. Requires the Linux @code{vhci} driver installed. Can + be used as following: + + @example +-qemu-system-i386 [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5 ++qemu-kvm [...OPTIONS...] -bt hci,vlan=5 -bt vhci,vlan=5 + @end example + + @item -bt device:@var{dev}[,vlan=@var{n}] +@@ -2861,7 +2861,7 @@ Options to each backend are described below. + + Use 'help' to print all available TPM backend types. + @example +-qemu -tpmdev help ++qemu-kvm -tpmdev help + @end example + + @item -tpmdev passthrough, id=@var{id}, path=@var{path}, cancel-path=@var{cancel-path} +@@ -3229,14 +3229,14 @@ ETEXI + + DEF("realtime", HAS_ARG, QEMU_OPTION_realtime, + "-realtime [mlock=on|off]\n" +- " run qemu with realtime features\n" ++ " run qemu-kvm with realtime features\n" + " mlock=on|off controls mlock support (default: on)\n", + QEMU_ARCH_ALL) + STEXI + @item -realtime mlock=on|off + @findex -realtime +-Run qemu with realtime features. +-mlocking qemu and guest memory can be enabled via @option{mlock=on} ++Run qemu-kvm with realtime features. ++mlocking qemu-kvm and guest memory can be enabled via @option{mlock=on} + (enabled by default). + ETEXI + +@@ -3250,7 +3250,7 @@ connections will likely be TCP-based, but also UDP, pseudo TTY, or even + stdio are reasonable use case. The latter is allowing to start QEMU from + within gdb and establish the connection via a pipe: + @example +-(gdb) target remote | exec qemu-system-i386 -gdb stdio ... ++(gdb) target remote | exec qemu-kvm -gdb stdio ... + @end example + ETEXI + +@@ -4059,7 +4059,7 @@ which specify the queue number of cryptodev backend, the default of + + @example + +- # qemu-system-x86_64 \ ++ # qemu-kvm \ + [...] \ + -object cryptodev-backend-builtin,id=cryptodev0 \ + -device virtio-crypto-pci,id=crypto0,cryptodev=cryptodev0 \ +-- +1.8.3.1 + diff --git a/SOURCES/0018-qmp-add-__com.redhat_reason-to-the-BLOCK_IO_ERROR-ev.patch b/SOURCES/0018-qmp-add-__com.redhat_reason-to-the-BLOCK_IO_ERROR-ev.patch new file mode 100644 index 0000000..eea75b2 --- /dev/null +++ b/SOURCES/0018-qmp-add-__com.redhat_reason-to-the-BLOCK_IO_ERROR-ev.patch @@ -0,0 +1,151 @@ +From 2f9487b60f700de33551208c543f5d3b4fa89236 Mon Sep 17 00:00:00 2001 +From: Luiz Capitulino +Date: Wed, 15 Mar 2017 13:25:17 +0100 +Subject: qmp: add __com.redhat_reason to the BLOCK_IO_ERROR event + +Patchwork-id: 64969 +O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH 1/2] qmp: add error reason to the BLOCK_IO_ERROR event +Bugzilla: 1199174 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Kevin Wolf +RH-Acked-by: Eric Blake + +This commit forward ports the following RHEL-7.0 commit to RHEL-7.2: + + commit 771a3a333eb0c9299a69a78ddb9c4181850b827d + Author: Laszlo Ersek + Date: Thu Nov 21 16:27:18 2013 +0100 + + error reason in BLOCK_IO_ERROR / BLOCK_JOB_ERROR events (RHEL 6->7 fwd) + +I had to redo the work because now events use the QAPI, but it +was straightforward. + +There's one significant difference though: this commit does not +extend the BLOCK_JOB_ERROR event as did the RHEL-7.0 commit. The +reason is that this extension was supposed to be used only by vdsm +and I don't think there's a requirement to have the extension +in BLOCK_JOB_ERROR too. Let's not spread it. + +Signed-off-by: Luiz Capitulino +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 75f90eaead001dfd1b529695bf6b99daeb62b78c) + +Rebase notes (2.9.0): +- moved documentation to schema + +(cherry picked from commit d54503313357e3b24bd465e62deaa26178b4296c) +--- + block/block-backend.c | 27 +++++++++++++++++++++++---- + qapi/block-core.json | 17 ++++++++++++++++- + 2 files changed, 39 insertions(+), 5 deletions(-) + +diff --git a/block/block-backend.c b/block/block-backend.c +index 7405024..dd131cf 100644 +--- a/block/block-backend.c ++++ b/block/block-backend.c +@@ -1422,9 +1422,25 @@ BlockErrorAction blk_get_error_action(BlockBackend *blk, bool is_read, + } + } + ++/* https://bugzilla.redhat.com/show_bug.cgi?id=1199174 */ ++static RHEL7BlockErrorReason get_rhel7_error_reason(int error) ++{ ++ switch (error) { ++ case ENOSPC: ++ return RHEL7_BLOCK_ERROR_REASON_ENOSPC; ++ case EPERM: ++ return RHEL7_BLOCK_ERROR_REASON_EPERM; ++ case EIO: ++ return RHEL7_BLOCK_ERROR_REASON_EIO; ++ default: ++ return RHEL7_BLOCK_ERROR_REASON_EOTHER; ++ } ++} ++ + static void send_qmp_error_event(BlockBackend *blk, + BlockErrorAction action, +- bool is_read, int error) ++ bool is_read, int error, ++ RHEL7BlockErrorReason res) + { + IoOperationType optype; + +@@ -1433,7 +1449,7 @@ static void send_qmp_error_event(BlockBackend *blk, + bdrv_get_node_name(blk_bs(blk)), optype, + action, blk_iostatus_is_enabled(blk), + error == ENOSPC, strerror(error), +- &error_abort); ++ res, &error_abort); + } + + /* This is done by device models because, while the block layer knows +@@ -1443,7 +1459,10 @@ static void send_qmp_error_event(BlockBackend *blk, + void blk_error_action(BlockBackend *blk, BlockErrorAction action, + bool is_read, int error) + { ++ RHEL7BlockErrorReason res; ++ + assert(error >= 0); ++ res = get_rhel7_error_reason(error); + + if (action == BLOCK_ERROR_ACTION_STOP) { + /* First set the iostatus, so that "info block" returns an iostatus +@@ -1461,10 +1480,10 @@ void blk_error_action(BlockBackend *blk, BlockErrorAction action, + * also ensures that the STOP/RESUME pair of events is emitted. + */ + qemu_system_vmstop_request_prepare(); +- send_qmp_error_event(blk, action, is_read, error); ++ send_qmp_error_event(blk, action, is_read, error, res); + qemu_system_vmstop_request(RUN_STATE_IO_ERROR); + } else { +- send_qmp_error_event(blk, action, is_read, error); ++ send_qmp_error_event(blk, action, is_read, error, res); + } + } + +diff --git a/qapi/block-core.json b/qapi/block-core.json +index 033457c..68ad316 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -3351,6 +3351,19 @@ + 'fatal' : 'bool' } } + + ## ++# @RHEL7BlockErrorReason: ++# ++# Block I/O error reason ++# ++# @eio: errno EIO ++# @eperm: errno EPERM ++# @enospc: errno ENOSPC ++# @eother: any errno other than EIO, EPERM, ENOSPC ++## ++{ 'enum': 'RHEL7BlockErrorReason', ++ 'data': [ 'enospc', 'eperm', 'eio', 'eother' ] } ++ ++## + # @BLOCK_IO_ERROR: + # + # Emitted when a disk I/O error occurs +@@ -3376,6 +3389,8 @@ + # (This field is a debugging aid for humans, it should not + # be parsed by applications) (since: 2.2) + # ++# @__com.redhat_reason: error reason ++# + # Note: If action is "stop", a STOP event will eventually follow the + # BLOCK_IO_ERROR event + # +@@ -3394,7 +3409,7 @@ + { 'event': 'BLOCK_IO_ERROR', + 'data': { 'device': 'str', 'node-name': 'str', 'operation': 'IoOperationType', + 'action': 'BlockErrorAction', '*nospace': 'bool', +- 'reason': 'str' } } ++ 'reason': 'str', '__com.redhat_reason': 'RHEL7BlockErrorReason' } } + + ## + # @BLOCK_JOB_COMPLETED: +-- +1.8.3.1 + diff --git a/SOURCES/0019-Migration-compat-for-pckbd.patch b/SOURCES/0019-Migration-compat-for-pckbd.patch new file mode 100644 index 0000000..857d859 --- /dev/null +++ b/SOURCES/0019-Migration-compat-for-pckbd.patch @@ -0,0 +1,61 @@ +From d2aba8a17b40c081f2ce29bc12b3945b7fb91d53 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 25 Jun 2015 16:34:25 +0200 +Subject: Migration compat for pckbd + +Patchwork-id: 66497 +O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH 1/1] Migration compat for pckbd +Bugzilla: 1215092 +RH-Acked-by: Juan Quintela +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +From: "Dr. David Alan Gilbert" + +2.2 added a new subsection to the pc keyboard model to preserve +the value of 'outport' across migration; to maintain migration +backwards compatibility this patch disables it on older machine types. +This leaves us no-worse-off than in older versions. + +Even with the new code, the value migrated in 'outport' isn't used +anywhere in the pckbd model; for example the value migrated doesn't +change the state of the A20 line or potentially do a reset. + +The only effect, as far as I can tell is if the guest were to +explicitly read the outport value it might get a more sensible reply. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 203b3380ba20f9836f00745141a69a91c646039e) +(cherry picked from commit 52ca66b68e09415470425f07e93940407aeb805d) +--- + hw/input/pckbd.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c +index 78b6c01..f475f33 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -26,6 +26,7 @@ + #include "hw/isa/isa.h" + #include "hw/i386/pc.h" + #include "hw/input/ps2.h" ++#include "migration/migration.h" + #include "sysemu/sysemu.h" + + /* debug PC keyboard */ +@@ -389,6 +390,11 @@ static int kbd_outport_post_load(void *opaque, int version_id) + static bool kbd_outport_needed(void *opaque) + { + KBDState *s = opaque; ++ ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return s->outport != kbd_outport_default(s); + } + +-- +1.8.3.1 + diff --git a/SOURCES/0020-Migration-compat-for-fdc.patch b/SOURCES/0020-Migration-compat-for-fdc.patch new file mode 100644 index 0000000..c3ebceb --- /dev/null +++ b/SOURCES/0020-Migration-compat-for-fdc.patch @@ -0,0 +1,127 @@ +From b18d89c56aa26e86fb6194f77a15a72244d5ff88 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Fri, 26 Jun 2015 16:19:47 +0200 +Subject: Migration compat for fdc + +Patchwork-id: 66534 +O-Subject: [RHEL-7.2 qemu-kvm-rhev PATCH 1/1] Migration compat for fdc +Bugzilla: 1215091 +RH-Acked-by: Amit Shah +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Juan Quintela + +From: "Dr. David Alan Gilbert" + +2.2 added some sections into the fdc and floppy drive, this patch +disables those new sections for reverse migration compatibility. + +There are three pieces of data added to the migration: + 1) 'perpendicular mode' on the drive - i.e. 2.88MB mode, that + was rare as hens teeth and the flag isn't actually used anywhere. + + 2) fdc_reset_sensei + This relates to the state of the fdc just after a reset command; + the fdc produces four 'sense' states internally (corresponding to + one external interrupt) that is there for backwards compatibility + to an older fdc (and to 8" drives!!). This compatibility code + was added to qemu to fix SCO Openserver floppy problems, ~2009. + Migration just after an fdc-reset would get the initial interrupt + but lose the extra 3 sense states. Print a log message since + that's guest visible, but it's not knowingly caused us a problem + so don't fail migration. + + 3) result-timer + The emulation models a delay after the 'read id' command which + is handled by a timer; if we migrate before the timer goes off + we probably wont complete the command. + I'm worried that the most likely time that a 'read id' would be + used would be in a background probe to see if there's a floppy + present, so again, don't fail the migrate, but do print a log + message. With any luck any sane floppy driver will have a + timeout; if we hit problems then a work around would be to + make the pre-save mark the command as finished with error. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 9a8a0a1bc3c15bc85aadc713280f37a13f6a3ba6) +(cherry picked from commit c58ef850bbb33ee9be2d0b1e1b10cfe3cc9ae4a1) +--- + hw/block/fdc.c | 39 +++++++++++++++++++++++++++++++++++++-- + 1 file changed, 37 insertions(+), 2 deletions(-) + +diff --git a/hw/block/fdc.c b/hw/block/fdc.c +index f4f038d..45927a3 100644 +--- a/hw/block/fdc.c ++++ b/hw/block/fdc.c +@@ -36,6 +36,7 @@ + #include "hw/isa/isa.h" + #include "hw/sysbus.h" + #include "hw/block/block.h" ++#include "migration/migration.h" + #include "sysemu/block-backend.h" + #include "sysemu/blockdev.h" + #include "sysemu/sysemu.h" +@@ -1042,6 +1043,10 @@ static bool fdrive_perpendicular_needed(void *opaque) + { + FDrive *drive = opaque; + ++ if (migrate_pre_2_2) { ++ return false; ++ } ++ + return drive->perpendicular != 0; + } + +@@ -1134,8 +1139,20 @@ static int fdc_post_load(void *opaque, int version_id) + static bool fdc_reset_sensei_needed(void *opaque) + { + FDCtrl *s = opaque; ++ bool needed = s->reset_sensei != 0; ++ ++ if (migrate_pre_2_2) { ++ /* ++ * This probably wont matter for most OSs, but it's good to log ++ * it just incase we find it causes problems. ++ */ ++ if (needed) { ++ error_report("INFO: fdc migration just after reset (sensei!=0)"); ++ } ++ return false; ++ } + +- return s->reset_sensei != 0; ++ return needed; + } + + static const VMStateDescription vmstate_fdc_reset_sensei = { +@@ -1152,8 +1169,26 @@ static const VMStateDescription vmstate_fdc_reset_sensei = { + static bool fdc_result_timer_needed(void *opaque) + { + FDCtrl *s = opaque; ++ bool needed = timer_pending(s->result_timer); ++ ++ if (migrate_pre_2_2) { ++ /* ++ * This could upset some OSs if their read-id command doesn't ++ * complete, so lets log something. ++ */ ++ if (needed) { ++ error_report("INFO: fdc migration just after read-id (timer!=0)"); ++ } ++ /* ++ * However, since it's not apparently caused us problems for many ++ * years, don't fail the migration, especially as this could ++ * happen as part of a background drive-probe which if it fails ++ * won't be a problem. ++ */ ++ return false; ++ } + +- return timer_pending(s->result_timer); ++ return needed; + } + + static const VMStateDescription vmstate_fdc_result_timer = { +-- +1.8.3.1 + diff --git a/SOURCES/0021-RHEL-Set-vcpus-hard-limit-to-240-for-Power.patch b/SOURCES/0021-RHEL-Set-vcpus-hard-limit-to-240-for-Power.patch new file mode 100644 index 0000000..2e91cde --- /dev/null +++ b/SOURCES/0021-RHEL-Set-vcpus-hard-limit-to-240-for-Power.patch @@ -0,0 +1,63 @@ +From 815a8be86930089767730c30cfb6b5373c138cf7 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 3 Sep 2015 04:09:04 +0200 +Subject: RHEL: Set vcpus hard limit to 240 for Power + +Patchwork-id: 67655 +O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH] RHEL: Set vcpus hard limit to 240 for Power +Bugzilla: 1257781 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth +RH-Acked-by: Laszlo Ersek + +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. + +However the POWER hard limit advertised by the kernel is 2048 (== NR_CPUS) +but we only want to allow up to the number of vCPUs we actually test, so +we force the hard limit to 240. + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 8329392ab135fcaaa7fed94a6e8068dbed0ca473) +(cherry picked from commit 598c434cf95391ca5a3ddc0e955221e227bf3344) +--- + kvm-all.c | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/kvm-all.c b/kvm-all.c +index a545d53..cc86415 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -1633,8 +1633,27 @@ static int kvm_init(MachineState *ms) + soft_vcpus_limit = kvm_recommended_vcpus(s); + hard_vcpus_limit = kvm_max_vcpus(s); + ++#ifdef HOST_PPC64 ++ /* ++ * RHEL hack: ++ * ++ * 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. ++ * ++ * However the POWER hard limit advertised by the kernel is 2048 ++ * (== NR_CPUS) but we only want to allow up to the number of ++ * vCPUs we actually test, so we force the hard limit to 240 ++ */ ++ hard_vcpus_limit = 240; ++ if (soft_vcpus_limit > hard_vcpus_limit) { ++ soft_vcpus_limit = hard_vcpus_limit; ++ } ++#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) { +-- +1.8.3.1 + diff --git a/SOURCES/0022-spapr-Reduce-advertised-max-LUNs-for-spapr_vscsi.patch b/SOURCES/0022-spapr-Reduce-advertised-max-LUNs-for-spapr_vscsi.patch new file mode 100644 index 0000000..2c1c2e3 --- /dev/null +++ b/SOURCES/0022-spapr-Reduce-advertised-max-LUNs-for-spapr_vscsi.patch @@ -0,0 +1,49 @@ +From 6c166e382c232ba4e527b4fc5ca9fdea151498d9 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 9 Sep 2015 02:03:04 +0200 +Subject: spapr: Reduce advertised max LUNs for spapr_vscsi + +Patchwork-id: 67711 +O-Subject: [RHEL7.2 qemu-kvm-rhev PATCH] spapr: Reduce advertised max LUNs for spapr_vscsi +Bugzilla: 1260464 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth + +The implementation of the PAPR paravirtual SCSI adapter currently +allows up to 32 LUNs (max_lun == 31). However the adapter isn't really +designed to support lots of devices - the PowerVM implementation only +ever puts one disk per vSCSI controller. + +More specifically, the Linux guest side vscsi driver (the only one we +really care about) is hardcoded to allow a maximum of 8 LUNs. + +So, reduce the number of LUNs on the qemu side to 8, so we don't +falsely advertise that more LUNs can work. + +Signed-off-by: David Gibson + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 0fcc97fd08e94a20514ac1e6bc91b09d19a13e5a) +(cherry picked from commit 6e59482de738f6827907c1bbe31822050fdee000) +--- + hw/scsi/spapr_vscsi.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c +index 55ee48c..92a3de3 100644 +--- a/hw/scsi/spapr_vscsi.c ++++ b/hw/scsi/spapr_vscsi.c +@@ -1178,7 +1178,7 @@ static const struct SCSIBusInfo vscsi_scsi_info = { + .tcq = true, + .max_channel = 7, /* logical unit addressing format */ + .max_target = 63, +- .max_lun = 31, ++ .max_lun = 7, + + .transfer_data = vscsi_transfer_data, + .complete = vscsi_command_complete, +-- +1.8.3.1 + diff --git a/SOURCES/0023-qmp-Report-__com.redhat_drive_add-error-to-monitor.patch b/SOURCES/0023-qmp-Report-__com.redhat_drive_add-error-to-monitor.patch new file mode 100644 index 0000000..eb13fd4 --- /dev/null +++ b/SOURCES/0023-qmp-Report-__com.redhat_drive_add-error-to-monitor.patch @@ -0,0 +1,52 @@ +From c5736179da1a310ddb384836fc025b2582f9e90d Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Thu, 19 May 2016 06:39:44 +0200 +Subject: qmp: Report __com.redhat_drive_add error to monitor + +RH-Author: Fam Zheng +Message-id: <1463639984-1165-1-git-send-email-famz@redhat.com> +Patchwork-id: 70412 +O-Subject: [RHEL-7.3 qemu-kvm-rhev PATCH] qmp: Report drive_add error to monitor +Bugzilla: 1337100 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Kevin Wolf + +In other error cases of this function we use error_setg, the same should +be done with drive_new() failures. This is useful for libvirt to +correctly detect the failure and report proper error message when a +specified image is not available. + +This bug cames from the forward porting from qemu-kvm, at which point we +overlooked the difference in QMP reporting between qerror_report and +error_report. + +Signed-off-by: Fam Zheng +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 7ee898a0e2d734bd535e3003459f50e000b6bb11) + +Rebase notes (2.8.0): +- Changed patch name + +(cherry picked from commit 8a1f601ec13449e736c05789c4f5ae52ab34f3a7) +--- + device-hotplug.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/device-hotplug.c b/device-hotplug.c +index 218f7b3..29f9a64 100644 +--- a/device-hotplug.c ++++ b/device-hotplug.c +@@ -145,8 +145,7 @@ void qmp_simple_drive_add(QDict *qdict, QObject **ret_data, Error **errp) + mc = MACHINE_GET_CLASS(current_machine); + dinfo = drive_new(opts, mc->block_default_type); + if (!dinfo) { +- error_report(QERR_DEVICE_INIT_FAILED, +- qemu_opts_id(opts)); ++ error_setg(errp, QERR_DEVICE_INIT_FAILED, qemu_opts_id(opts)); + qemu_opts_del(opts); + return; + } +-- +1.8.3.1 + diff --git a/SOURCES/0024-Add-PCIe-bridge-devices-for-AArch64.patch b/SOURCES/0024-Add-PCIe-bridge-devices-for-AArch64.patch new file mode 100644 index 0000000..1897898 --- /dev/null +++ b/SOURCES/0024-Add-PCIe-bridge-devices-for-AArch64.patch @@ -0,0 +1,45 @@ +From e9b413ef9b4e0eb716ab310efd0c065ada3742c6 Mon Sep 17 00:00:00 2001 +From: Wei Huang +Date: Sat, 28 May 2016 02:55:42 +0200 +Subject: Add PCIe bridge devices for AArch64 + +RH-Author: Wei Huang +Message-id: <1464404143-31188-2-git-send-email-wei@redhat.com> +Patchwork-id: 70497 +O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH V2 1/2] Add PCIe bridge devices for AArch64 +Bugzilla: 1326420 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Laurent Vivier +RH-Acked-by: Andrew Jones + +Old AArch64 QEMU only supports virtio-mmio devices. Because of this we +disabled many PCIe bridge devices. But in RHEL 7.3, we are expanding +the support for virtio-pci. This patch enables XIO and IOH devices to +support building either PCIe root port or PCIe switch. + +Signed-off-by: Wei Huang +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 8853fdad5470db88a1cd93ee0c7b4afbc6cab6f2) + +Rebase notes (2.9.0): +- Add option CONFIG_PCIE_PORT for aarch64 (enabled on other architectures) + +(cherry picked from commit e5797d741f98b685c865b6ecac7b3927cd027e4b) +--- + default-configs/aarch64-softmmu.mak | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index 38e9291..118b861 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -21,3 +21,6 @@ CONFIG_SMBIOS=y + CONFIG_PL061=y + CONFIG_GPIO_KEY=y + CONFIG_ARM_V7M=y ++CONFIG_PCIE_PORT=y ++CONFIG_XIO3130=y ++CONFIG_IOH3420=y +-- +1.8.3.1 + diff --git a/SOURCES/0025-Fix-qemu-kvm-does-not-quit-when-booting-guest-w-241-.patch b/SOURCES/0025-Fix-qemu-kvm-does-not-quit-when-booting-guest-w-241-.patch new file mode 100644 index 0000000..1ab1591 --- /dev/null +++ b/SOURCES/0025-Fix-qemu-kvm-does-not-quit-when-booting-guest-w-241-.patch @@ -0,0 +1,55 @@ +From 5090ba1ce35fa1d2157de83a4539d993826da82d Mon Sep 17 00:00:00 2001 +From: Marcelo Tosatti +Date: Mon, 27 Jun 2016 20:21:25 +0200 +Subject: Fix qemu-kvm does not quit when booting guest w/ 241 vcpus and + "-no-kvm" + +RH-Author: Marcelo Tosatti +Message-id: <20160627202124.GA26255@amt.cnet> +Patchwork-id: 70796 +O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH v3] Fix qemu-kvm does not quit when booting guest w/ 161 vcpus and "-no-kvm" (BZ 1126666) +Bugzilla: 1126666 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Andrew Jones + +Boot a guest with /usr/libexec/qemu-kvm -no-kvm -smp 241 +and it does not fail. + +Fix QEMU to match KVM's number of maximum supported CPUs. + +Backport commit #: not applicable. + +Note: this change was lost during the last rebase. +The RHEL-7.1 commit number for that change is: +commit ce72a826c4882e62d8b897efc2183c39d9c21906 +Author: Markus Armbruster +Date: Mon Aug 11 07:54:35 2014 +0200 + + exit when -no-kvm and vcpu count > 160 + +Signed-off-by: Marcelo Tosatti +Signed-off-by: Miroslav Rezanina +(cherry picked from commit ff9e7316daa93ddfc0b11466128bf03540afcf74) +(cherry picked from commit 13a605ab2f26363751d2b6c72b081d2fd39e6f45) +--- + hw/i386/pc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 2764b77..6ed4d23 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -2332,7 +2332,8 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + mc->default_boot_order = "cad"; + mc->hot_add_cpu = pc_hot_add_cpu; + 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; + hc->pre_plug = pc_machine_device_pre_plug_cb; + hc->plug = pc_machine_device_plug_cb; +-- +1.8.3.1 + diff --git a/SOURCES/0026-RHEL-only-hw-char-pl011-fix-SBSA-reset.patch b/SOURCES/0026-RHEL-only-hw-char-pl011-fix-SBSA-reset.patch new file mode 100644 index 0000000..a1aa8d1 --- /dev/null +++ b/SOURCES/0026-RHEL-only-hw-char-pl011-fix-SBSA-reset.patch @@ -0,0 +1,58 @@ +From 15ee295534f654d6b6ba9499cdd380aa9c954920 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Mon, 1 Aug 2016 14:27:09 +0200 +Subject: RHEL-only: hw/char/pl011: fix SBSA reset + +RH-Author: Andrew Jones +Message-id: <1470061629-6395-1-git-send-email-drjones@redhat.com> +Patchwork-id: 71697 +O-Subject: [AArch64 RHEL-7.3 qemu-kvm-rhev PATCH] RHEL-only: hw/char/pl011: fix SBSA reset +Bugzilla: 1266048 +RH-Acked-by: Auger Eric +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Wei Huang + +When booting Linux with an SBSA UART, e.g. when booting mach-virt +with ACPI, if the user types on the console during boot, then when +the login prompt appears she won't be able to log in. This is +because during boot the SBSA UART needs to be reset, but the SBSA +specification doesn't provide registers to enable/disable the FIFOs. +This patch observes a couple registers the SBSA UART does write to +in order to attempt to guess when a reset is needed, and then do it. +We risk losing some characters from the FIFO if the guess is wrong, +but the risk of that should be quite low. + +Signed-off-by: Andrew Jones +Signed-off-by: Miroslav Rezanina +(cherry picked from commit aa0041f7036b3052ec9477bffae2fd6f41ac7ede) +(cherry picked from commit 4fed0775a0a86b05fb5539aca43d5ee70fc0ab99) +--- + hw/char/pl011.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/hw/char/pl011.c b/hw/char/pl011.c +index 24ea973..453fcde 100644 +--- a/hw/char/pl011.c ++++ b/hw/char/pl011.c +@@ -209,6 +209,18 @@ static void pl011_write(void *opaque, hwaddr offset, + pl011_update(s); + break; + case 17: /* UARTICR */ ++ /* ++ * RHEL-only, fixes BZ1266048 ++ * ++ * Look for the "signature" of a driver init or shutdown in ++ * order to know that we need to reset the SBSA UART. Yes, ++ * this is hacky, but as SBSA drivers aren't required to write ++ * UARTLCR_H or UARTCR, then we don't have much choice... ++ */ ++ if (s->int_enabled == 0 && value == 0xffff) { ++ s->read_count = 0; ++ s->read_pos = 0; ++ } + s->int_level &= ~value; + pl011_update(s); + break; +-- +1.8.3.1 + diff --git a/SOURCES/0027-blockdev-ignore-cache-options-for-empty-CDROM-drives.patch b/SOURCES/0027-blockdev-ignore-cache-options-for-empty-CDROM-drives.patch new file mode 100644 index 0000000..fe1196a --- /dev/null +++ b/SOURCES/0027-blockdev-ignore-cache-options-for-empty-CDROM-drives.patch @@ -0,0 +1,91 @@ +From 89b162019bfd202bbbd00563d03a030c2f7c1395 Mon Sep 17 00:00:00 2001 +From: John Snow +Date: Fri, 16 Sep 2016 22:06:28 +0200 +Subject: blockdev: ignore cache options for empty CDROM drives + +RH-Author: John Snow +Message-id: <1474063588-6370-2-git-send-email-jsnow@redhat.com> +Patchwork-id: 72377 +O-Subject: [RHEV-7.3 qemu-kvm-rhev PATCH 1/1] blockdev: ignore cache options for empty CDROM drives +Bugzilla: 1342999 +RH-Acked-by: Max Reitz +RH-Acked-by: Kevin Wolf +RH-Acked-by: Stefan Hajnoczi + +In qemu-kvm-rhev-2.3.0, QEMU will accept cache options for empty CDROM +devices, but silently ignore them as they will be overwritten when the +next CDROM is inserted. + +Libvirt and VMM are capable of generating XML configurations which +attempt to specify these cache options to QEMU, though they don't have +any effect. + +Upstream, a refactoring of cache option mechanisms means that we have +started rejecting invalid configurations where cache options are supplied +without any target to actually apply them to. + +This means that there are combinations of QEMU and libvirt that will fail +to start a VM if a user selects a cache option. + +This patch is a downstream-only workaround until libvirt can stop +supplying cache settings for empty CDROMs and/or until libvirt can take +advantage of the new QMP tray/medium manipulation mechanisms that will +allow proper cache specification for removable media. + +Signed-off-by: John Snow +Signed-off-by: Miroslav Rezanina +(cherry picked from commit f9bc62a9e433fb67845477fd76e0c2b8d6685b93) +(cherry picked from commit 018339d32a9393371c1a49ff52e83de7d2ec4910) +--- + blockdev.c | 28 +++++++++++++++++++++++++++- + 1 file changed, 27 insertions(+), 1 deletion(-) + +diff --git a/blockdev.c b/blockdev.c +index dddf2e1..a52e035 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -448,6 +448,32 @@ static void extract_common_blockdev_options(QemuOpts *opts, int *bdrv_flags, + } + } + ++/** ++ * libvirt expects to be able to pass cache options for CDROM drives without ++ * inserted media. Historically, QEMU eventually ignores these cache options as ++ * they are lost when media is inserted. Recently, QEMU started rejecting these ++ * configurations. Libvirt however still generates such configurations. ++ * ++ * To prevent QEMU from being unable to start, pretend there are no options ++ * present if the only options present are cache options for the BDS. ++ */ ++static bool __redhat_com_has_bs_opts(QDict *bs_opts) ++{ ++ size_t n, s; ++ s = qdict_size(bs_opts); ++ ++ if (s == 0) { ++ return false; ++ } else if (s > 2) { ++ return true; ++ } ++ ++ n = qdict_haskey(bs_opts, BDRV_OPT_CACHE_DIRECT); ++ n += qdict_haskey(bs_opts, BDRV_OPT_CACHE_NO_FLUSH); ++ ++ return s != n; ++} ++ + /* Takes the ownership of bs_opts */ + static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + Error **errp) +@@ -555,7 +581,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + read_only = qemu_opt_get_bool(opts, BDRV_OPT_READ_ONLY, false); + + /* init */ +- if ((!file || !*file) && !qdict_size(bs_opts)) { ++ if ((!file || !*file) && !__redhat_com_has_bs_opts(bs_opts)) { + BlockBackendRootState *blk_rs; + + blk = blk_new(0, BLK_PERM_ALL); +-- +1.8.3.1 + diff --git a/SOURCES/0028-Revert-kvm_stat-Remove.patch b/SOURCES/0028-Revert-kvm_stat-Remove.patch new file mode 100644 index 0000000..1c44412 --- /dev/null +++ b/SOURCES/0028-Revert-kvm_stat-Remove.patch @@ -0,0 +1,1263 @@ +From d4a8e35b84072816c79e23f5d0a69a2145217004 Mon Sep 17 00:00:00 2001 +From: "Danilo C. L. de Paula" +Date: Mon, 16 Jan 2017 11:52:49 +0100 +Subject: Revert "kvm_stat: Remove" + +RH-Author: ddepaula +Message-id: <1479302806-10135-2-git-send-email-ddepaula@redhat.com> +Patchwork-id: 72851 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH v3 1/3] Revert "kvm_stat: Remove" +Bugzilla: 1389238 +RH-Acked-by: John Snow +RH-Acked-by: David Hildenbrand +RH-Acked-by: Miroslav Rezanina + +kvm_stat script was removed in QEMU 2.7.0 as it become part of kernel +tree. However kvm_stat is shipped in qemu-kvm-tools package in RHEL. + +This reverts commit 60b412dd18362bd4ddc44ba7022aacb6af074b5d. + +Signed-off-by: Danilo Cesar Lemes de Paula +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 98e1a0c3ceec3c7a5e700cced47aef6043224169) + +Merged patches (2.9.0): +- 1e69b1b Include kvm_stat in qemu-kvm.spec +- 7fcfc94 tools: kvm_stat: Powerpc related fixes +- 7f89136 tools: kvm_stat: Introduce pid monitoring +- c728a6b tools: kvm_stat: Add comments +- 27fb856 Package man page of "kvm_stat" tool + +(cherry picked from commit c660ef06c18219a99468f96701d9d02b9c16baa1) +--- + Makefile | 8 + + redhat/qemu-kvm.spec.template | 7 +- + scripts/kvm/kvm_stat | 1127 +++++++++++++++++++++++++++++++++++++++++ + scripts/kvm/kvm_stat.texi | 55 ++ + 4 files changed, 1196 insertions(+), 1 deletion(-) + create mode 100755 scripts/kvm/kvm_stat + create mode 100644 scripts/kvm/kvm_stat.texi + +diff --git a/Makefile b/Makefile +index 098c635..ab42582 100644 +--- a/Makefile ++++ b/Makefile +@@ -209,6 +209,9 @@ ifdef BUILD_DOCS + DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 qemu-ga.8 + DOCS+=docs/qemu-qmp-ref.html docs/qemu-qmp-ref.txt docs/qemu-qmp-ref.7 + DOCS+=docs/qemu-ga-ref.html docs/qemu-ga-ref.txt docs/qemu-ga-ref.7 ++ifdef CONFIG_LINUX ++DOCS+=kvm_stat.1 ++endif + ifdef CONFIG_VIRTFS + DOCS+=fsdev/virtfs-proxy-helper.1 + endif +@@ -723,6 +726,11 @@ html: qemu-doc.html docs/qemu-qmp-ref.html docs/qemu-ga-ref.html + info: qemu-doc.info docs/qemu-qmp-ref.info docs/qemu-ga-ref.info + pdf: qemu-doc.pdf docs/qemu-qmp-ref.pdf docs/qemu-ga-ref.pdf + txt: qemu-doc.txt docs/qemu-qmp-ref.txt docs/qemu-ga-ref.txt ++kvm_stat.1: scripts/kvm/kvm_stat.texi ++ $(call quiet-command, \ ++ perl -Ww -- $(SRC_PATH)/scripts/texi2pod.pl $< kvm_stat.pod && \ ++ $(POD2MAN) --section=1 --center=" " --release=" " kvm_stat.pod > $@, \ ++ " GEN $@") + + qemu-doc.html qemu-doc.info qemu-doc.pdf qemu-doc.txt: \ + qemu-img.texi qemu-nbd.texi qemu-options.texi qemu-option-trace.texi \ +diff --git a/scripts/kvm/kvm_stat b/scripts/kvm/kvm_stat +new file mode 100755 +index 0000000..581278c +--- /dev/null ++++ b/scripts/kvm/kvm_stat +@@ -0,0 +1,1127 @@ ++#!/usr/bin/python ++# ++# top-like utility for displaying kvm statistics ++# ++# Copyright 2006-2008 Qumranet Technologies ++# Copyright 2008-2011 Red Hat, Inc. ++# ++# Authors: ++# Avi Kivity ++# ++# This work is licensed under the terms of the GNU GPL, version 2. See ++# the COPYING file in the top-level directory. ++"""The kvm_stat module outputs statistics about running KVM VMs ++ ++Three different ways of output formatting are available: ++- as a top-like text ui ++- in a key -> value format ++- in an all keys, all values format ++ ++The data is sampled from the KVM's debugfs entries and its perf events. ++""" ++ ++import curses ++import sys ++import os ++import time ++import optparse ++import ctypes ++import fcntl ++import resource ++import struct ++import re ++from collections import defaultdict ++from time import sleep ++ ++VMX_EXIT_REASONS = { ++ 'EXCEPTION_NMI': 0, ++ 'EXTERNAL_INTERRUPT': 1, ++ 'TRIPLE_FAULT': 2, ++ 'PENDING_INTERRUPT': 7, ++ 'NMI_WINDOW': 8, ++ 'TASK_SWITCH': 9, ++ 'CPUID': 10, ++ 'HLT': 12, ++ 'INVLPG': 14, ++ 'RDPMC': 15, ++ 'RDTSC': 16, ++ 'VMCALL': 18, ++ 'VMCLEAR': 19, ++ 'VMLAUNCH': 20, ++ 'VMPTRLD': 21, ++ 'VMPTRST': 22, ++ 'VMREAD': 23, ++ 'VMRESUME': 24, ++ 'VMWRITE': 25, ++ 'VMOFF': 26, ++ 'VMON': 27, ++ 'CR_ACCESS': 28, ++ 'DR_ACCESS': 29, ++ 'IO_INSTRUCTION': 30, ++ 'MSR_READ': 31, ++ 'MSR_WRITE': 32, ++ 'INVALID_STATE': 33, ++ 'MWAIT_INSTRUCTION': 36, ++ 'MONITOR_INSTRUCTION': 39, ++ 'PAUSE_INSTRUCTION': 40, ++ 'MCE_DURING_VMENTRY': 41, ++ 'TPR_BELOW_THRESHOLD': 43, ++ 'APIC_ACCESS': 44, ++ 'EPT_VIOLATION': 48, ++ 'EPT_MISCONFIG': 49, ++ 'WBINVD': 54, ++ 'XSETBV': 55, ++ 'APIC_WRITE': 56, ++ 'INVPCID': 58, ++} ++ ++SVM_EXIT_REASONS = { ++ 'READ_CR0': 0x000, ++ 'READ_CR3': 0x003, ++ 'READ_CR4': 0x004, ++ 'READ_CR8': 0x008, ++ 'WRITE_CR0': 0x010, ++ 'WRITE_CR3': 0x013, ++ 'WRITE_CR4': 0x014, ++ 'WRITE_CR8': 0x018, ++ 'READ_DR0': 0x020, ++ 'READ_DR1': 0x021, ++ 'READ_DR2': 0x022, ++ 'READ_DR3': 0x023, ++ 'READ_DR4': 0x024, ++ 'READ_DR5': 0x025, ++ 'READ_DR6': 0x026, ++ 'READ_DR7': 0x027, ++ 'WRITE_DR0': 0x030, ++ 'WRITE_DR1': 0x031, ++ 'WRITE_DR2': 0x032, ++ 'WRITE_DR3': 0x033, ++ 'WRITE_DR4': 0x034, ++ 'WRITE_DR5': 0x035, ++ 'WRITE_DR6': 0x036, ++ 'WRITE_DR7': 0x037, ++ 'EXCP_BASE': 0x040, ++ 'INTR': 0x060, ++ 'NMI': 0x061, ++ 'SMI': 0x062, ++ 'INIT': 0x063, ++ 'VINTR': 0x064, ++ 'CR0_SEL_WRITE': 0x065, ++ 'IDTR_READ': 0x066, ++ 'GDTR_READ': 0x067, ++ 'LDTR_READ': 0x068, ++ 'TR_READ': 0x069, ++ 'IDTR_WRITE': 0x06a, ++ 'GDTR_WRITE': 0x06b, ++ 'LDTR_WRITE': 0x06c, ++ 'TR_WRITE': 0x06d, ++ 'RDTSC': 0x06e, ++ 'RDPMC': 0x06f, ++ 'PUSHF': 0x070, ++ 'POPF': 0x071, ++ 'CPUID': 0x072, ++ 'RSM': 0x073, ++ 'IRET': 0x074, ++ 'SWINT': 0x075, ++ 'INVD': 0x076, ++ 'PAUSE': 0x077, ++ 'HLT': 0x078, ++ 'INVLPG': 0x079, ++ 'INVLPGA': 0x07a, ++ 'IOIO': 0x07b, ++ 'MSR': 0x07c, ++ 'TASK_SWITCH': 0x07d, ++ 'FERR_FREEZE': 0x07e, ++ 'SHUTDOWN': 0x07f, ++ 'VMRUN': 0x080, ++ 'VMMCALL': 0x081, ++ 'VMLOAD': 0x082, ++ 'VMSAVE': 0x083, ++ 'STGI': 0x084, ++ 'CLGI': 0x085, ++ 'SKINIT': 0x086, ++ 'RDTSCP': 0x087, ++ 'ICEBP': 0x088, ++ 'WBINVD': 0x089, ++ 'MONITOR': 0x08a, ++ 'MWAIT': 0x08b, ++ 'MWAIT_COND': 0x08c, ++ 'XSETBV': 0x08d, ++ 'NPF': 0x400, ++} ++ ++# EC definition of HSR (from arch/arm64/include/asm/kvm_arm.h) ++AARCH64_EXIT_REASONS = { ++ 'UNKNOWN': 0x00, ++ 'WFI': 0x01, ++ 'CP15_32': 0x03, ++ 'CP15_64': 0x04, ++ 'CP14_MR': 0x05, ++ 'CP14_LS': 0x06, ++ 'FP_ASIMD': 0x07, ++ 'CP10_ID': 0x08, ++ 'CP14_64': 0x0C, ++ 'ILL_ISS': 0x0E, ++ 'SVC32': 0x11, ++ 'HVC32': 0x12, ++ 'SMC32': 0x13, ++ 'SVC64': 0x15, ++ 'HVC64': 0x16, ++ 'SMC64': 0x17, ++ 'SYS64': 0x18, ++ 'IABT': 0x20, ++ 'IABT_HYP': 0x21, ++ 'PC_ALIGN': 0x22, ++ 'DABT': 0x24, ++ 'DABT_HYP': 0x25, ++ 'SP_ALIGN': 0x26, ++ 'FP_EXC32': 0x28, ++ 'FP_EXC64': 0x2C, ++ 'SERROR': 0x2F, ++ 'BREAKPT': 0x30, ++ 'BREAKPT_HYP': 0x31, ++ 'SOFTSTP': 0x32, ++ 'SOFTSTP_HYP': 0x33, ++ 'WATCHPT': 0x34, ++ 'WATCHPT_HYP': 0x35, ++ 'BKPT32': 0x38, ++ 'VECTOR32': 0x3A, ++ 'BRK64': 0x3C, ++} ++ ++# From include/uapi/linux/kvm.h, KVM_EXIT_xxx ++USERSPACE_EXIT_REASONS = { ++ 'UNKNOWN': 0, ++ 'EXCEPTION': 1, ++ 'IO': 2, ++ 'HYPERCALL': 3, ++ 'DEBUG': 4, ++ 'HLT': 5, ++ 'MMIO': 6, ++ 'IRQ_WINDOW_OPEN': 7, ++ 'SHUTDOWN': 8, ++ 'FAIL_ENTRY': 9, ++ 'INTR': 10, ++ 'SET_TPR': 11, ++ 'TPR_ACCESS': 12, ++ 'S390_SIEIC': 13, ++ 'S390_RESET': 14, ++ 'DCR': 15, ++ 'NMI': 16, ++ 'INTERNAL_ERROR': 17, ++ 'OSI': 18, ++ 'PAPR_HCALL': 19, ++ 'S390_UCONTROL': 20, ++ 'WATCHDOG': 21, ++ 'S390_TSCH': 22, ++ 'EPR': 23, ++ 'SYSTEM_EVENT': 24, ++} ++ ++IOCTL_NUMBERS = { ++ 'SET_FILTER': 0x40082406, ++ 'ENABLE': 0x00002400, ++ 'DISABLE': 0x00002401, ++ 'RESET': 0x00002403, ++} ++ ++class Arch(object): ++ """Encapsulates global architecture specific data. ++ ++ Contains the performance event open syscall and ioctl numbers, as ++ well as the VM exit reasons for the architecture it runs on. ++ ++ """ ++ @staticmethod ++ def get_arch(): ++ machine = os.uname()[4] ++ ++ if machine.startswith('ppc'): ++ return ArchPPC() ++ elif machine.startswith('aarch64'): ++ return ArchA64() ++ elif machine.startswith('s390'): ++ return ArchS390() ++ else: ++ # X86_64 ++ for line in open('/proc/cpuinfo'): ++ if not line.startswith('flags'): ++ continue ++ ++ flags = line.split() ++ if 'vmx' in flags: ++ return ArchX86(VMX_EXIT_REASONS) ++ if 'svm' in flags: ++ return ArchX86(SVM_EXIT_REASONS) ++ return ++ ++class ArchX86(Arch): ++ def __init__(self, exit_reasons): ++ self.sc_perf_evt_open = 298 ++ self.ioctl_numbers = IOCTL_NUMBERS ++ self.exit_reasons = exit_reasons ++ ++class ArchPPC(Arch): ++ def __init__(self): ++ self.sc_perf_evt_open = 319 ++ self.ioctl_numbers = IOCTL_NUMBERS ++ self.ioctl_numbers['ENABLE'] = 0x20002400 ++ self.ioctl_numbers['DISABLE'] = 0x20002401 ++ self.ioctl_numbers['RESET'] = 0x20002403 ++ ++ # PPC comes in 32 and 64 bit and some generated ioctl ++ # numbers depend on the wordsize. ++ char_ptr_size = ctypes.sizeof(ctypes.c_char_p) ++ self.ioctl_numbers['SET_FILTER'] = 0x80002406 | char_ptr_size << 16 ++ self.exit_reasons = {} ++ ++class ArchA64(Arch): ++ def __init__(self): ++ self.sc_perf_evt_open = 241 ++ self.ioctl_numbers = IOCTL_NUMBERS ++ self.exit_reasons = AARCH64_EXIT_REASONS ++ ++class ArchS390(Arch): ++ def __init__(self): ++ self.sc_perf_evt_open = 331 ++ self.ioctl_numbers = IOCTL_NUMBERS ++ self.exit_reasons = None ++ ++ARCH = Arch.get_arch() ++ ++ ++def walkdir(path): ++ """Returns os.walk() data for specified directory. ++ ++ As it is only a wrapper it returns the same 3-tuple of (dirpath, ++ dirnames, filenames). ++ """ ++ return next(os.walk(path)) ++ ++ ++def parse_int_list(list_string): ++ """Returns an int list from a string of comma separated integers and ++ integer ranges.""" ++ integers = [] ++ members = list_string.split(',') ++ ++ for member in members: ++ if '-' not in member: ++ integers.append(int(member)) ++ else: ++ int_range = member.split('-') ++ integers.extend(range(int(int_range[0]), ++ int(int_range[1]) + 1)) ++ ++ return integers ++ ++ ++def get_online_cpus(): ++ """Returns a list of cpu id integers.""" ++ with open('/sys/devices/system/cpu/online') as cpu_list: ++ cpu_string = cpu_list.readline() ++ return parse_int_list(cpu_string) ++ ++ ++def get_filters(): ++ """Returns a dict of trace events, their filter ids and ++ the values that can be filtered. ++ ++ Trace events can be filtered for special values by setting a ++ filter string via an ioctl. The string normally has the format ++ identifier==value. For each filter a new event will be created, to ++ be able to distinguish the events. ++ ++ """ ++ filters = {} ++ filters['kvm_userspace_exit'] = ('reason', USERSPACE_EXIT_REASONS) ++ if ARCH.exit_reasons: ++ filters['kvm_exit'] = ('exit_reason', ARCH.exit_reasons) ++ return filters ++ ++libc = ctypes.CDLL('libc.so.6', use_errno=True) ++syscall = libc.syscall ++ ++class perf_event_attr(ctypes.Structure): ++ """Struct that holds the necessary data to set up a trace event. ++ ++ For an extensive explanation see perf_event_open(2) and ++ include/uapi/linux/perf_event.h, struct perf_event_attr ++ ++ All fields that are not initialized in the constructor are 0. ++ ++ """ ++ _fields_ = [('type', ctypes.c_uint32), ++ ('size', ctypes.c_uint32), ++ ('config', ctypes.c_uint64), ++ ('sample_freq', ctypes.c_uint64), ++ ('sample_type', ctypes.c_uint64), ++ ('read_format', ctypes.c_uint64), ++ ('flags', ctypes.c_uint64), ++ ('wakeup_events', ctypes.c_uint32), ++ ('bp_type', ctypes.c_uint32), ++ ('bp_addr', ctypes.c_uint64), ++ ('bp_len', ctypes.c_uint64), ++ ] ++ ++ def __init__(self): ++ super(self.__class__, self).__init__() ++ self.type = PERF_TYPE_TRACEPOINT ++ self.size = ctypes.sizeof(self) ++ self.read_format = PERF_FORMAT_GROUP ++ ++def perf_event_open(attr, pid, cpu, group_fd, flags): ++ """Wrapper for the sys_perf_evt_open() syscall. ++ ++ Used to set up performance events, returns a file descriptor or -1 ++ on error. ++ ++ Attributes are: ++ - syscall number ++ - struct perf_event_attr * ++ - pid or -1 to monitor all pids ++ - cpu number or -1 to monitor all cpus ++ - The file descriptor of the group leader or -1 to create a group. ++ - flags ++ ++ """ ++ return syscall(ARCH.sc_perf_evt_open, ctypes.pointer(attr), ++ ctypes.c_int(pid), ctypes.c_int(cpu), ++ ctypes.c_int(group_fd), ctypes.c_long(flags)) ++ ++PERF_TYPE_TRACEPOINT = 2 ++PERF_FORMAT_GROUP = 1 << 3 ++ ++PATH_DEBUGFS_TRACING = '/sys/kernel/debug/tracing' ++PATH_DEBUGFS_KVM = '/sys/kernel/debug/kvm' ++ ++class Group(object): ++ """Represents a perf event group.""" ++ ++ def __init__(self): ++ self.events = [] ++ ++ def add_event(self, event): ++ self.events.append(event) ++ ++ def read(self): ++ """Returns a dict with 'event name: value' for all events in the ++ group. ++ ++ Values are read by reading from the file descriptor of the ++ event that is the group leader. See perf_event_open(2) for ++ details. ++ ++ Read format for the used event configuration is: ++ struct read_format { ++ u64 nr; /* The number of events */ ++ struct { ++ u64 value; /* The value of the event */ ++ } values[nr]; ++ }; ++ ++ """ ++ length = 8 * (1 + len(self.events)) ++ read_format = 'xxxxxxxx' + 'Q' * len(self.events) ++ return dict(zip([event.name for event in self.events], ++ struct.unpack(read_format, ++ os.read(self.events[0].fd, length)))) ++ ++class Event(object): ++ """Represents a performance event and manages its life cycle.""" ++ def __init__(self, name, group, trace_cpu, trace_pid, trace_point, ++ trace_filter, trace_set='kvm'): ++ self.name = name ++ self.fd = None ++ self.setup_event(group, trace_cpu, trace_pid, trace_point, ++ trace_filter, trace_set) ++ ++ def __del__(self): ++ """Closes the event's file descriptor. ++ ++ As no python file object was created for the file descriptor, ++ python will not reference count the descriptor and will not ++ close it itself automatically, so we do it. ++ ++ """ ++ if self.fd: ++ os.close(self.fd) ++ ++ def setup_event_attribute(self, trace_set, trace_point): ++ """Returns an initialized ctype perf_event_attr struct.""" ++ ++ id_path = os.path.join(PATH_DEBUGFS_TRACING, 'events', trace_set, ++ trace_point, 'id') ++ ++ event_attr = perf_event_attr() ++ event_attr.config = int(open(id_path).read()) ++ return event_attr ++ ++ def setup_event(self, group, trace_cpu, trace_pid, trace_point, ++ trace_filter, trace_set): ++ """Sets up the perf event in Linux. ++ ++ Issues the syscall to register the event in the kernel and ++ then sets the optional filter. ++ ++ """ ++ ++ event_attr = self.setup_event_attribute(trace_set, trace_point) ++ ++ # First event will be group leader. ++ group_leader = -1 ++ ++ # All others have to pass the leader's descriptor instead. ++ if group.events: ++ group_leader = group.events[0].fd ++ ++ fd = perf_event_open(event_attr, trace_pid, ++ trace_cpu, group_leader, 0) ++ if fd == -1: ++ err = ctypes.get_errno() ++ raise OSError(err, os.strerror(err), ++ 'while calling sys_perf_event_open().') ++ ++ if trace_filter: ++ fcntl.ioctl(fd, ARCH.ioctl_numbers['SET_FILTER'], ++ trace_filter) ++ ++ self.fd = fd ++ ++ def enable(self): ++ """Enables the trace event in the kernel. ++ ++ Enabling the group leader makes reading counters from it and the ++ events under it possible. ++ ++ """ ++ fcntl.ioctl(self.fd, ARCH.ioctl_numbers['ENABLE'], 0) ++ ++ def disable(self): ++ """Disables the trace event in the kernel. ++ ++ Disabling the group leader makes reading all counters under it ++ impossible. ++ ++ """ ++ fcntl.ioctl(self.fd, ARCH.ioctl_numbers['DISABLE'], 0) ++ ++ def reset(self): ++ """Resets the count of the trace event in the kernel.""" ++ fcntl.ioctl(self.fd, ARCH.ioctl_numbers['RESET'], 0) ++ ++class TracepointProvider(object): ++ """Data provider for the stats class. ++ ++ Manages the events/groups from which it acquires its data. ++ ++ """ ++ def __init__(self): ++ self.group_leaders = [] ++ self.filters = get_filters() ++ self._fields = self.get_available_fields() ++ self._pid = 0 ++ ++ def get_available_fields(self): ++ """Returns a list of available event's of format 'event name(filter ++ name)'. ++ ++ All available events have directories under ++ /sys/kernel/debug/tracing/events/ which export information ++ about the specific event. Therefore, listing the dirs gives us ++ a list of all available events. ++ ++ Some events like the vm exit reasons can be filtered for ++ specific values. To take account for that, the routine below ++ creates special fields with the following format: ++ event name(filter name) ++ ++ """ ++ path = os.path.join(PATH_DEBUGFS_TRACING, 'events', 'kvm') ++ fields = walkdir(path)[1] ++ extra = [] ++ for field in fields: ++ if field in self.filters: ++ filter_name_, filter_dicts = self.filters[field] ++ for name in filter_dicts: ++ extra.append(field + '(' + name + ')') ++ fields += extra ++ return fields ++ ++ def setup_traces(self): ++ """Creates all event and group objects needed to be able to retrieve ++ data.""" ++ if self._pid > 0: ++ # Fetch list of all threads of the monitored pid, as qemu ++ # starts a thread for each vcpu. ++ path = os.path.join('/proc', str(self._pid), 'task') ++ groupids = walkdir(path)[1] ++ else: ++ groupids = get_online_cpus() ++ ++ # The constant is needed as a buffer for python libs, std ++ # streams and other files that the script opens. ++ newlim = len(groupids) * len(self._fields) + 50 ++ try: ++ softlim_, hardlim = resource.getrlimit(resource.RLIMIT_NOFILE) ++ ++ if hardlim < newlim: ++ # Now we need CAP_SYS_RESOURCE, to increase the hard limit. ++ resource.setrlimit(resource.RLIMIT_NOFILE, (newlim, newlim)) ++ else: ++ # Raising the soft limit is sufficient. ++ resource.setrlimit(resource.RLIMIT_NOFILE, (newlim, hardlim)) ++ ++ except ValueError: ++ sys.exit("NOFILE rlimit could not be raised to {0}".format(newlim)) ++ ++ for groupid in groupids: ++ group = Group() ++ for name in self._fields: ++ tracepoint = name ++ tracefilter = None ++ match = re.match(r'(.*)\((.*)\)', name) ++ if match: ++ tracepoint, sub = match.groups() ++ tracefilter = ('%s==%d\0' % ++ (self.filters[tracepoint][0], ++ self.filters[tracepoint][1][sub])) ++ ++ # From perf_event_open(2): ++ # pid > 0 and cpu == -1 ++ # This measures the specified process/thread on any CPU. ++ # ++ # pid == -1 and cpu >= 0 ++ # This measures all processes/threads on the specified CPU. ++ trace_cpu = groupid if self._pid == 0 else -1 ++ trace_pid = int(groupid) if self._pid != 0 else -1 ++ ++ group.add_event(Event(name=name, ++ group=group, ++ trace_cpu=trace_cpu, ++ trace_pid=trace_pid, ++ trace_point=tracepoint, ++ trace_filter=tracefilter)) ++ ++ self.group_leaders.append(group) ++ ++ def available_fields(self): ++ return self.get_available_fields() ++ ++ @property ++ def fields(self): ++ return self._fields ++ ++ @fields.setter ++ def fields(self, fields): ++ """Enables/disables the (un)wanted events""" ++ self._fields = fields ++ for group in self.group_leaders: ++ for index, event in enumerate(group.events): ++ if event.name in fields: ++ event.reset() ++ event.enable() ++ else: ++ # Do not disable the group leader. ++ # It would disable all of its events. ++ if index != 0: ++ event.disable() ++ ++ @property ++ def pid(self): ++ return self._pid ++ ++ @pid.setter ++ def pid(self, pid): ++ """Changes the monitored pid by setting new traces.""" ++ self._pid = pid ++ # The garbage collector will get rid of all Event/Group ++ # objects and open files after removing the references. ++ self.group_leaders = [] ++ self.setup_traces() ++ self.fields = self._fields ++ ++ def read(self): ++ """Returns 'event name: current value' for all enabled events.""" ++ ret = defaultdict(int) ++ for group in self.group_leaders: ++ for name, val in group.read().iteritems(): ++ if name in self._fields: ++ ret[name] += val ++ return ret ++ ++class DebugfsProvider(object): ++ """Provides data from the files that KVM creates in the kvm debugfs ++ folder.""" ++ def __init__(self): ++ self._fields = self.get_available_fields() ++ self._pid = 0 ++ self.do_read = True ++ ++ def get_available_fields(self): ++ """"Returns a list of available fields. ++ ++ The fields are all available KVM debugfs files ++ ++ """ ++ return walkdir(PATH_DEBUGFS_KVM)[2] ++ ++ @property ++ def fields(self): ++ return self._fields ++ ++ @fields.setter ++ def fields(self, fields): ++ self._fields = fields ++ ++ @property ++ def pid(self): ++ return self._pid ++ ++ @pid.setter ++ def pid(self, pid): ++ if pid != 0: ++ self._pid = pid ++ ++ vms = walkdir(PATH_DEBUGFS_KVM)[1] ++ if len(vms) == 0: ++ self.do_read = False ++ ++ self.paths = filter(lambda x: "{}-".format(pid) in x, vms) ++ ++ else: ++ self.paths = [''] ++ self.do_read = True ++ ++ def read(self): ++ """Returns a dict with format:'file name / field -> current value'.""" ++ results = {} ++ ++ # If no debugfs filtering support is available, then don't read. ++ if not self.do_read: ++ return results ++ ++ for path in self.paths: ++ for field in self._fields: ++ results[field] = results.get(field, 0) \ ++ + self.read_field(field, path) ++ ++ return results ++ ++ def read_field(self, field, path): ++ """Returns the value of a single field from a specific VM.""" ++ try: ++ return int(open(os.path.join(PATH_DEBUGFS_KVM, ++ path, ++ field)) ++ .read()) ++ except IOError: ++ return 0 ++ ++class Stats(object): ++ """Manages the data providers and the data they provide. ++ ++ It is used to set filters on the provider's data and collect all ++ provider data. ++ ++ """ ++ def __init__(self, providers, pid, fields=None): ++ self.providers = providers ++ self._pid_filter = pid ++ self._fields_filter = fields ++ self.values = {} ++ self.update_provider_pid() ++ self.update_provider_filters() ++ ++ def update_provider_filters(self): ++ """Propagates fields filters to providers.""" ++ def wanted(key): ++ if not self._fields_filter: ++ return True ++ return re.match(self._fields_filter, key) is not None ++ ++ # As we reset the counters when updating the fields we can ++ # also clear the cache of old values. ++ self.values = {} ++ for provider in self.providers: ++ provider_fields = [key for key in provider.get_available_fields() ++ if wanted(key)] ++ provider.fields = provider_fields ++ ++ def update_provider_pid(self): ++ """Propagates pid filters to providers.""" ++ for provider in self.providers: ++ provider.pid = self._pid_filter ++ ++ @property ++ def fields_filter(self): ++ return self._fields_filter ++ ++ @fields_filter.setter ++ def fields_filter(self, fields_filter): ++ self._fields_filter = fields_filter ++ self.update_provider_filters() ++ ++ @property ++ def pid_filter(self): ++ return self._pid_filter ++ ++ @pid_filter.setter ++ def pid_filter(self, pid): ++ self._pid_filter = pid ++ self.values = {} ++ self.update_provider_pid() ++ ++ def get(self): ++ """Returns a dict with field -> (value, delta to last value) of all ++ provider data.""" ++ for provider in self.providers: ++ new = provider.read() ++ for key in provider.fields: ++ oldval = self.values.get(key, (0, 0)) ++ newval = new.get(key, 0) ++ newdelta = None ++ if oldval is not None: ++ newdelta = newval - oldval[0] ++ self.values[key] = (newval, newdelta) ++ return self.values ++ ++LABEL_WIDTH = 40 ++NUMBER_WIDTH = 10 ++ ++class Tui(object): ++ """Instruments curses to draw a nice text ui.""" ++ def __init__(self, stats): ++ self.stats = stats ++ self.screen = None ++ self.drilldown = False ++ self.update_drilldown() ++ ++ def __enter__(self): ++ """Initialises curses for later use. Based on curses.wrapper ++ implementation from the Python standard library.""" ++ self.screen = curses.initscr() ++ curses.noecho() ++ curses.cbreak() ++ ++ # The try/catch works around a minor bit of ++ # over-conscientiousness in the curses module, the error ++ # return from C start_color() is ignorable. ++ try: ++ curses.start_color() ++ except: ++ pass ++ ++ curses.use_default_colors() ++ return self ++ ++ def __exit__(self, *exception): ++ """Resets the terminal to its normal state. Based on curses.wrappre ++ implementation from the Python standard library.""" ++ if self.screen: ++ self.screen.keypad(0) ++ curses.echo() ++ curses.nocbreak() ++ curses.endwin() ++ ++ def update_drilldown(self): ++ """Sets or removes a filter that only allows fields without braces.""" ++ if not self.stats.fields_filter: ++ self.stats.fields_filter = r'^[^\(]*$' ++ ++ elif self.stats.fields_filter == r'^[^\(]*$': ++ self.stats.fields_filter = None ++ ++ def update_pid(self, pid): ++ """Propagates pid selection to stats object.""" ++ self.stats.pid_filter = pid ++ ++ def refresh(self, sleeptime): ++ """Refreshes on-screen data.""" ++ self.screen.erase() ++ if self.stats.pid_filter > 0: ++ self.screen.addstr(0, 0, 'kvm statistics - pid {0}' ++ .format(self.stats.pid_filter), ++ curses.A_BOLD) ++ else: ++ self.screen.addstr(0, 0, 'kvm statistics - summary', curses.A_BOLD) ++ self.screen.addstr(2, 1, 'Event') ++ self.screen.addstr(2, 1 + LABEL_WIDTH + NUMBER_WIDTH - ++ len('Total'), 'Total') ++ self.screen.addstr(2, 1 + LABEL_WIDTH + NUMBER_WIDTH + 8 - ++ len('Current'), 'Current') ++ row = 3 ++ stats = self.stats.get() ++ def sortkey(x): ++ if stats[x][1]: ++ return (-stats[x][1], -stats[x][0]) ++ else: ++ return (0, -stats[x][0]) ++ for key in sorted(stats.keys(), key=sortkey): ++ ++ if row >= self.screen.getmaxyx()[0]: ++ break ++ values = stats[key] ++ if not values[0] and not values[1]: ++ break ++ col = 1 ++ self.screen.addstr(row, col, key) ++ col += LABEL_WIDTH ++ self.screen.addstr(row, col, '%10d' % (values[0],)) ++ col += NUMBER_WIDTH ++ if values[1] is not None: ++ self.screen.addstr(row, col, '%8d' % (values[1] / sleeptime,)) ++ row += 1 ++ self.screen.refresh() ++ ++ def show_filter_selection(self): ++ """Draws filter selection mask. ++ ++ Asks for a valid regex and sets the fields filter accordingly. ++ ++ """ ++ while True: ++ self.screen.erase() ++ self.screen.addstr(0, 0, ++ "Show statistics for events matching a regex.", ++ curses.A_BOLD) ++ self.screen.addstr(2, 0, ++ "Current regex: {0}" ++ .format(self.stats.fields_filter)) ++ self.screen.addstr(3, 0, "New regex: ") ++ curses.echo() ++ regex = self.screen.getstr() ++ curses.noecho() ++ if len(regex) == 0: ++ return ++ try: ++ re.compile(regex) ++ self.stats.fields_filter = regex ++ return ++ except re.error: ++ continue ++ ++ def show_vm_selection(self): ++ """Draws PID selection mask. ++ ++ Asks for a pid until a valid pid or 0 has been entered. ++ ++ """ ++ while True: ++ self.screen.erase() ++ self.screen.addstr(0, 0, ++ 'Show statistics for specific pid.', ++ curses.A_BOLD) ++ self.screen.addstr(1, 0, ++ 'This might limit the shown data to the trace ' ++ 'statistics.') ++ ++ curses.echo() ++ self.screen.addstr(3, 0, "Pid [0 or pid]: ") ++ pid = self.screen.getstr() ++ curses.noecho() ++ ++ try: ++ pid = int(pid) ++ ++ if pid == 0: ++ self.update_pid(pid) ++ break ++ else: ++ if not os.path.isdir(os.path.join('/proc/', str(pid))): ++ continue ++ else: ++ self.update_pid(pid) ++ break ++ ++ except ValueError: ++ continue ++ ++ def show_stats(self): ++ """Refreshes the screen and processes user input.""" ++ sleeptime = 0.25 ++ while True: ++ self.refresh(sleeptime) ++ curses.halfdelay(int(sleeptime * 10)) ++ sleeptime = 3 ++ try: ++ char = self.screen.getkey() ++ if char == 'x': ++ self.drilldown = not self.drilldown ++ self.update_drilldown() ++ if char == 'q': ++ break ++ if char == 'f': ++ self.show_filter_selection() ++ if char == 'p': ++ self.show_vm_selection() ++ except KeyboardInterrupt: ++ break ++ except curses.error: ++ continue ++ ++def batch(stats): ++ """Prints statistics in a key, value format.""" ++ s = stats.get() ++ time.sleep(1) ++ s = stats.get() ++ for key in sorted(s.keys()): ++ values = s[key] ++ print '%-42s%10d%10d' % (key, values[0], values[1]) ++ ++def log(stats): ++ """Prints statistics as reiterating key block, multiple value blocks.""" ++ keys = sorted(stats.get().iterkeys()) ++ def banner(): ++ for k in keys: ++ print '%s' % k, ++ print ++ def statline(): ++ s = stats.get() ++ for k in keys: ++ print ' %9d' % s[k][1], ++ print ++ line = 0 ++ banner_repeat = 20 ++ while True: ++ time.sleep(1) ++ if line % banner_repeat == 0: ++ banner() ++ statline() ++ line += 1 ++ ++def get_options(): ++ """Returns processed program arguments.""" ++ description_text = """ ++This script displays various statistics about VMs running under KVM. ++The statistics are gathered from the KVM debugfs entries and / or the ++currently available perf traces. ++ ++The monitoring takes additional cpu cycles and might affect the VM's ++performance. ++ ++Requirements: ++- Access to: ++ /sys/kernel/debug/kvm ++ /sys/kernel/debug/trace/events/* ++ /proc/pid/task ++- /proc/sys/kernel/perf_event_paranoid < 1 if user has no ++ CAP_SYS_ADMIN and perf events are used. ++- CAP_SYS_RESOURCE if the hard limit is not high enough to allow ++ the large number of files that are possibly opened. ++""" ++ ++ class PlainHelpFormatter(optparse.IndentedHelpFormatter): ++ def format_description(self, description): ++ if description: ++ return description + "\n" ++ else: ++ return "" ++ ++ optparser = optparse.OptionParser(description=description_text, ++ formatter=PlainHelpFormatter()) ++ optparser.add_option('-1', '--once', '--batch', ++ action='store_true', ++ default=False, ++ dest='once', ++ help='run in batch mode for one second', ++ ) ++ optparser.add_option('-l', '--log', ++ action='store_true', ++ default=False, ++ dest='log', ++ help='run in logging mode (like vmstat)', ++ ) ++ optparser.add_option('-t', '--tracepoints', ++ action='store_true', ++ default=False, ++ dest='tracepoints', ++ help='retrieve statistics from tracepoints', ++ ) ++ optparser.add_option('-d', '--debugfs', ++ action='store_true', ++ default=False, ++ dest='debugfs', ++ help='retrieve statistics from debugfs', ++ ) ++ optparser.add_option('-f', '--fields', ++ action='store', ++ default=None, ++ dest='fields', ++ help='fields to display (regex)', ++ ) ++ optparser.add_option('-p', '--pid', ++ action='store', ++ default=0, ++ type=int, ++ dest='pid', ++ help='restrict statistics to pid', ++ ) ++ (options, _) = optparser.parse_args(sys.argv) ++ return options ++ ++def get_providers(options): ++ """Returns a list of data providers depending on the passed options.""" ++ providers = [] ++ ++ if options.tracepoints: ++ providers.append(TracepointProvider()) ++ if options.debugfs: ++ providers.append(DebugfsProvider()) ++ if len(providers) == 0: ++ providers.append(TracepointProvider()) ++ ++ return providers ++ ++def check_access(options): ++ """Exits if the current user can't access all needed directories.""" ++ if not os.path.exists('/sys/kernel/debug'): ++ sys.stderr.write('Please enable CONFIG_DEBUG_FS in your kernel.') ++ sys.exit(1) ++ ++ if not os.path.exists(PATH_DEBUGFS_KVM): ++ sys.stderr.write("Please make sure, that debugfs is mounted and " ++ "readable by the current user:\n" ++ "('mount -t debugfs debugfs /sys/kernel/debug')\n" ++ "Also ensure, that the kvm modules are loaded.\n") ++ sys.exit(1) ++ ++ if not os.path.exists(PATH_DEBUGFS_TRACING) and (options.tracepoints ++ or not options.debugfs): ++ sys.stderr.write("Please enable CONFIG_TRACING in your kernel " ++ "when using the option -t (default).\n" ++ "If it is enabled, make {0} readable by the " ++ "current user.\n" ++ .format(PATH_DEBUGFS_TRACING)) ++ if options.tracepoints: ++ sys.exit(1) ++ ++ sys.stderr.write("Falling back to debugfs statistics!\n") ++ options.debugfs = True ++ sleep(5) ++ ++ return options ++ ++def main(): ++ options = get_options() ++ options = check_access(options) ++ ++ if (options.pid > 0 and ++ not os.path.isdir(os.path.join('/proc/', ++ str(options.pid)))): ++ sys.stderr.write('Did you use a (unsupported) tid instead of a pid?\n') ++ sys.exit('Specified pid does not exist.') ++ ++ providers = get_providers(options) ++ stats = Stats(providers, options.pid, fields=options.fields) ++ ++ if options.log: ++ log(stats) ++ elif not options.once: ++ with Tui(stats) as tui: ++ tui.show_stats() ++ else: ++ batch(stats) ++ ++if __name__ == "__main__": ++ main() +diff --git a/scripts/kvm/kvm_stat.texi b/scripts/kvm/kvm_stat.texi +new file mode 100644 +index 0000000..4faf1a6 +--- /dev/null ++++ b/scripts/kvm/kvm_stat.texi +@@ -0,0 +1,55 @@ ++@example ++@c man begin SYNOPSIS ++usage: kvm_stat [OPTION]... ++@c man end ++@end example ++ ++@c man begin DESCRIPTION ++ ++kvm_stat prints counts of KVM kernel module trace events. These events signify ++state transitions such as guest mode entry and exit. ++ ++This tool is useful for observing guest behavior from the host perspective. ++Often conclusions about performance or buggy behavior can be drawn from the ++output. ++ ++The set of KVM kernel module trace events may be specific to the kernel version ++or architecture. It is best to check the KVM kernel module source code for the ++meaning of events. ++ ++@c man end ++ ++@c man begin OPTIONS ++@table @option ++@item -1, --once, --batch ++ run in batch mode for one second ++@item -l, --log ++ run in logging mode (like vmstat) ++@item -t, --tracepoints ++ retrieve statistics from tracepoints ++@item -d, --debugfs ++ retrieve statistics from debugfs ++@item -p, --pid=@var{pid} ++ limit statistics to one virtual machine (pid) ++@item -f, --fields=@var{fields} ++ fields to display (regex) ++@item -h, --help ++ show help message ++@end table ++ ++@c man end ++ ++@ignore ++ ++@setfilename kvm_stat ++@settitle Report KVM kernel module event counters. ++ ++@c man begin AUTHOR ++Stefan Hajnoczi ++@c man end ++ ++@c man begin SEEALSO ++perf(1), trace-cmd(1) ++@c man end ++ ++@end ignore +-- +1.8.3.1 + diff --git a/SOURCES/0029-migcompat-e1000e-Work-around-7.3-msi-intr_state-fiel.patch b/SOURCES/0029-migcompat-e1000e-Work-around-7.3-msi-intr_state-fiel.patch new file mode 100644 index 0000000..1f854de --- /dev/null +++ b/SOURCES/0029-migcompat-e1000e-Work-around-7.3-msi-intr_state-fiel.patch @@ -0,0 +1,136 @@ +From 7b3c2e676cd62e947e9b020bba9309a171e94c9e Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 9 Feb 2017 13:06:18 +0100 +Subject: migcompat/e1000e: Work around 7.3 msi/intr_state field + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170209130618.20328-1-dgilbert@redhat.com> +Patchwork-id: 73730 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/1] migcompat/e1000e: Work around 7.3 msi/intr_state field +Bugzilla: 1420216 +RH-Acked-by: Thomas Huth +RH-Acked-by: Xiao Wang +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +bz: https://bugzilla.redhat.com/show_bug.cgi?id=1420216 +brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=12518741 +upstream: No, fixing downstream inconsistency + +Our 7.3 e1000e model has an 'intr_state' field that's used +only in the cleanup of msi & msix. + +e1000e was introducing in 2.7 but was backported to the 2.6 based +qemu-kvm-rhev 7.3 by backporting 6f3fbe4 and 103916. + +During the 2.7rc's the migration structure was changed by +e0af5a0e8 and 66bf7d but we never pulled those into 7.3 which +removed the 'intr_state' field. + +For compatibility add the field back (guarded by a property on 7.3) +and populate the values based on the source MSI state. +Since the flags were only used for cleanup I don't think +we need to pay attention to the value we receive. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 4ed53cd6a385c6dca4a088cf406d03165d17c28d) +(cherry picked from commit ee177ab97e10a60746ec59032d83aa5bd1a26445) +--- + hw/net/e1000e.c | 21 +++++++++++++++++++++ + include/hw/compat.h | 4 ++++ + 2 files changed, 25 insertions(+) + +diff --git a/hw/net/e1000e.c b/hw/net/e1000e.c +index e849f79..f36f211 100644 +--- a/hw/net/e1000e.c ++++ b/hw/net/e1000e.c +@@ -73,6 +73,11 @@ typedef 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; + } E1000EState; + + #define E1000E_MMIO_IDX 0 +@@ -88,6 +93,10 @@ typedef 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) + { +@@ -299,6 +308,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; + } + } + } +@@ -465,6 +476,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, +@@ -586,6 +599,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, +@@ -597,6 +615,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, +@@ -645,6 +664,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_DEFAULT("disable_vnet_hdr", E1000EState, disable_vnet, false, + e1000e_prop_disable_vnet, bool), + DEFINE_PROP_DEFAULT("subsys_ven", E1000EState, subsys_ven, +diff --git a/include/hw/compat.h b/include/hw/compat.h +index 6f64306..66320b5 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -324,6 +324,10 @@ + .driver = "virtio-pci",\ + .property = "x-ignore-backend-features",\ + .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "e1000e",\ ++ .property = "__redhat_e1000e_7_3_intr_state",\ ++ .value = "on",\ + }, + + #endif /* HW_COMPAT_H */ +-- +1.8.3.1 + diff --git a/SOURCES/0030-migcompat-rtl8139-Work-around-version-bump.patch b/SOURCES/0030-migcompat-rtl8139-Work-around-version-bump.patch new file mode 100644 index 0000000..7047fdb --- /dev/null +++ b/SOURCES/0030-migcompat-rtl8139-Work-around-version-bump.patch @@ -0,0 +1,63 @@ +From 45ca263288bcbc98f36fae68c55e1a1b55e09221 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 29 Mar 2017 10:57:23 +0200 +Subject: migcompat/rtl8139: Work around version bump + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170329105723.7789-2-dgilbert@redhat.com> +Patchwork-id: 74581 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/1] migcompat/rtl8139: Work around version bump +Bugzilla: 1420195 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Juan Quintela +RH-Acked-by: Laurent Vivier + +From: "Dr. David Alan Gilbert" + +commit 46fe8bef in 2.7 bumped the version number of the rtl8139 +vmstate, and added back a field that had been lost ~7 years ago +by 9d29cde in v0.11. + +To keep backwards compatibility we can't bump the version, so push +the version number back down and remove the field that was added. +The field doesn't seem to be that significant, especially since we've +survived for 7 years with out it. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 010c2cdbafbff156bde551db28f330c4fa8564ec) + +Rebase notes (2.9.0): +- Patch rewritten + +(cherry picked from commit 2f07a034d03b9c150f06fc6007d648dffc74e07e) +--- + hw/net/rtl8139.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c +index 450658c..80c62dc 100644 +--- a/hw/net/rtl8139.c ++++ b/hw/net/rtl8139.c +@@ -3206,7 +3206,7 @@ static void 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, +@@ -3287,7 +3287,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), + +-- +1.8.3.1 + diff --git a/SOURCES/0031-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-2.patch b/SOURCES/0031-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-2.patch new file mode 100644 index 0000000..295ae22 --- /dev/null +++ b/SOURCES/0031-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-2.patch @@ -0,0 +1,54 @@ +From 3c52050d74d4360395cca8d8917027df022ee8a5 Mon Sep 17 00:00:00 2001 +From: Radim Krcmar +Date: Tue, 7 Mar 2017 17:32:12 +0100 +Subject: x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 288 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Radim Krcmar +Message-id: <20170307173212.5752-1-rkrcmar@redhat.com> +Patchwork-id: 74248 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 288 +Bugzilla: 1289151 +RH-Acked-by: John Snow +RH-Acked-by: Peter Xu +RH-Acked-by: Igor Mammedov +RH-Acked-by: Paolo Bonzini + +RHEL only. This is inspired by patch 00d0f9fd6602 ("pc: q35: Bump +max_cpus to 288"), which was included in the rebase, but didn't affect +our machine types. + +tested: by me, with kernel patches that allow 288 VCPUs + +Signed-off-by: Radim Krčmář +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 414bc0d056f27c43595249c1981c97be5d96d4c0) +--- + hw/i386/pc_q35.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index a8ab052..b86e24d 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -379,6 +379,7 @@ static void pc_q35_machine_rhel7_options(MachineClass *m) + m->no_floppy = 1; + m->has_dynamic_sysbus = true; + m->alias = "q35"; ++ m->max_cpus = 288; + SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); + } + +@@ -406,6 +407,7 @@ static void pc_q35_machine_rhel730_options(MachineClass *m) + pc_q35_machine_rhel740_options(m); + m->alias = NULL; + m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; ++ m->max_cpus = 255; + SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); + } + +-- +1.8.3.1 + diff --git a/SOURCES/0032-x86-Work-around-SMI-breakages.patch b/SOURCES/0032-x86-Work-around-SMI-breakages.patch new file mode 100644 index 0000000..10dd329 --- /dev/null +++ b/SOURCES/0032-x86-Work-around-SMI-breakages.patch @@ -0,0 +1,80 @@ +From 0ed92ca843fec14757ea7b59f4c83ed52b91b815 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 22 Mar 2017 11:26:40 +0100 +Subject: x86: Work around SMI breakages + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170322112640.5933-1-dgilbert@redhat.com> +Patchwork-id: 74427 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2] x86: Work around SMI breakages +Bugzilla: 1420679 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Igor Mammedov + +From: "Dr. David Alan Gilbert" + +This enables the fix added upstream in fc3a1fd7 on 7.3 machine types +and earlier. + +The reported symptom was that a 7.2->7.4 migration failed with the +guest rebooting on the destination; 7.2->7.3 worked as did 7.3->7.4 + +7.2,7.3,7.4 all have different levels of support for SMI's: + 7.2 basically doesn't support it, but knows enough to set the + CPU_INTERRUPT_SMI flag. + + 7.3 thought it supported SMIs but fails to deliver SMI interrupts + (see upstream 68c6efe07a) - but it does clear the + CPU_INTERRUPT_SMI flag when it tries. + + 7.4 apparently supports SMIs + +On 7.2 something tries an SMI, but the interrupt never happens, +but it does leave the CPU_INTERRUPT_SMI flag set - this ends up +in the migration stream, but it's ignored by 7.2. + +7.2->7.3 sees the CPU_INTERRUPT_SMI, clears the flag but fails +to actually enter the SMI code. Everything seems to survive, +but perhaps this explains some of the bugs we hit until we +disabled the SMI in Seabios in 7.3 + +7.2->7.4 sees the CPU_INTERRUPT_SMI and actually takes the SMI, +landing in what I think is empty SMRAM space, eventually falling +off the end, triple faulting and rebooting - which is what we hit +here. + +The (nasty) fix is to reinstate the 7.3 bug for machine types older +than 7.4; that should keep us compatible with 7.3 and get +lucky in the same way as we did with 7.2. + +Note: We still have to be careful in the ROMs we provide with 7.4 +because the ROM contents will get migrated whenever we do +7.4->7.3/7.2 migrates. + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +(cherry picked from commit c094723a6ed544df512c4c3fd22d0eec71262886) +--- + include/hw/i386/pc.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index c88c46a..b69e53c 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -1042,6 +1042,11 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + .driver = TYPE_X86_CPU,\ + .property = "cpuid-0xb",\ + .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "kvm-no-smi-migration",\ ++ .value = "on",\ + }, + + #define PC_RHEL7_2_COMPAT \ +-- +1.8.3.1 + diff --git a/SOURCES/0033-s390x-virtio-ccw-Disable-crypto-device-in-downstream.patch b/SOURCES/0033-s390x-virtio-ccw-Disable-crypto-device-in-downstream.patch new file mode 100644 index 0000000..f201848 --- /dev/null +++ b/SOURCES/0033-s390x-virtio-ccw-Disable-crypto-device-in-downstream.patch @@ -0,0 +1,77 @@ +From a522114821c2af434ec14c2f04b2c4df184de8b0 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Thu, 23 Mar 2017 16:38:09 +0100 +Subject: s390x/virtio-ccw: Disable crypto device in downstream RHEL builds + +RH-Author: Thomas Huth +Message-id: <1490287090-14987-2-git-send-email-thuth@redhat.com> +Patchwork-id: 74492 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/2] s390x/virtio-ccw: Disable crypto device in downstream RHEL builds +Bugzilla: 1434717 +RH-Acked-by: Laurent Vivier +RH-Acked-by: David Hildenbrand +RH-Acked-by: Dr. David Alan Gilbert + +The generic virtio-crypto device code is disabled in downstream RHEL, +so we've got to disable the virtio-ccw-crypto device, too. + +Signed-off-by: Thomas Huth +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 2a4096aface8cf09d8643e0d180bf1be809d47e1) +--- + hw/s390x/virtio-ccw.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c +index 00b3bde..bceaecf 100644 +--- a/hw/s390x/virtio-ccw.c ++++ b/hw/s390x/virtio-ccw.c +@@ -901,6 +901,8 @@ static void virtio_ccw_rng_realize(VirtioCcwDevice *ccw_dev, Error **errp) + NULL); + } + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ ++ + static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp) + { + VirtIOCryptoCcw *dev = VIRTIO_CRYPTO_CCW(ccw_dev); +@@ -919,6 +921,8 @@ static void virtio_ccw_crypto_realize(VirtioCcwDevice *ccw_dev, Error **errp) + NULL); + } + ++#endif ++ + /* DeviceState to VirtioCcwDevice. Note: used on datapath, + * be careful and test performance if you change this. + */ +@@ -1566,6 +1570,8 @@ static const TypeInfo virtio_ccw_rng = { + .class_init = virtio_ccw_rng_class_init, + }; + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ ++ + static Property virtio_ccw_crypto_properties[] = { + DEFINE_PROP_CSS_DEV_ID("devno", VirtioCcwDevice, parent_obj.bus_id), + DEFINE_PROP_BIT("ioeventfd", VirtioCcwDevice, flags, +@@ -1608,6 +1614,8 @@ static const TypeInfo virtio_ccw_crypto = { + .class_init = virtio_ccw_crypto_class_init, + }; + ++#endif ++ + static void virtio_ccw_busdev_realize(DeviceState *dev, Error **errp) + { + VirtioCcwDevice *_dev = (VirtioCcwDevice *)dev; +@@ -1810,7 +1818,9 @@ static void virtio_ccw_register(void) + #ifdef CONFIG_VHOST_VSOCK + type_register_static(&vhost_vsock_ccw_info); + #endif ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + type_register_static(&virtio_ccw_crypto); ++#endif + } + + type_init(virtio_ccw_register) +-- +1.8.3.1 + diff --git a/SOURCES/0035-spapr-update-SPAPR_COMPAT_RHEL7_3.patch b/SOURCES/0035-spapr-update-SPAPR_COMPAT_RHEL7_3.patch new file mode 100644 index 0000000..72a16c0 --- /dev/null +++ b/SOURCES/0035-spapr-update-SPAPR_COMPAT_RHEL7_3.patch @@ -0,0 +1,56 @@ +From f7b5a7fc99c73beaf27fb326ec605cbdadc02037 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Fri, 24 Mar 2017 10:53:00 +0100 +Subject: spapr: update SPAPR_COMPAT_RHEL7_3 + +RH-Author: Laurent Vivier +Message-id: <20170324105301.29006-2-lvivier@redhat.com> +Patchwork-id: 74527 +O-Subject: [PATCH v3 1/2] spapr: update SPAPR_COMPAT_RHEL7_3 +Bugzilla: 1435086 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Laszlo Ersek + +Add property from SPAPR_COMPAT_2_8 to SPAPR_COMPAT_RHEL7_3: + { + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, + .property = "pcie-extended-configuration-space", + .value = "off", + }, + +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +(cherry picked from commit a4e58bb68cc35e269a08841d2dc8f389a0499bf1) +--- + hw/ppc/spapr.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 9bcf6c3..51766af 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -3456,7 +3456,7 @@ DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", true); + + /* + * pseries-rhel7.3.0 +- * like SPAPR_COMPAT_2_6 and _2_7 but "ddw" has been backported to RHEL7_3 ++ * like SPAPR_COMPAT_2_6/_2_7/_2_8 but "ddw" has been backported to RHEL7_3 + */ + #define SPAPR_COMPAT_RHEL7_3 \ + HW_COMPAT_RHEL7_3 \ +@@ -3479,6 +3479,11 @@ DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", true); + .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ + .property = "pre-2.8-migration", \ + .value = "on", \ ++ }, \ ++ { \ ++ .driver = TYPE_SPAPR_PCI_HOST_BRIDGE, \ ++ .property = "pcie-extended-configuration-space",\ ++ .value = "off", \ + }, + + static void spapr_machine_rhel730_instance_options(MachineState *machine) +-- +1.8.3.1 + diff --git a/SOURCES/0036-migration-update-HW_COMPAT_RHEL7_3.patch b/SOURCES/0036-migration-update-HW_COMPAT_RHEL7_3.patch new file mode 100644 index 0000000..cfcde99 --- /dev/null +++ b/SOURCES/0036-migration-update-HW_COMPAT_RHEL7_3.patch @@ -0,0 +1,72 @@ +From 04faf4dbd017c97f66153830a64756001b70933e Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Fri, 24 Mar 2017 10:53:01 +0100 +Subject: migration: update HW_COMPAT_RHEL7_3 + +RH-Author: Laurent Vivier +Message-id: <20170324105301.29006-3-lvivier@redhat.com> +Patchwork-id: 74528 +O-Subject: [PATCH v3 2/2] migration: update HW_COMPAT_RHEL7_3 +Bugzilla: 1435086 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Laszlo Ersek + +The "pci-bridge"/"shpc" part is needed to fix BZ1435086. + +But all the other entries are needed to be able to migrate +a RHEL7.3 machine to RHEL7.4 host. + +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +(cherry picked from commit 85704bac1522899cf735869d208a656906c2725d) +--- + include/hw/compat.h | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +diff --git a/include/hw/compat.h b/include/hw/compat.h +index 66320b5..b0c57ec 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -325,6 +325,38 @@ + .property = "x-ignore-backend-features",\ + .value = "on",\ + },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "fw_cfg_mem",\ ++ .property = "x-file-slots",\ ++ .value = stringify(0x10),\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "fw_cfg_io",\ ++ .property = "x-file-slots",\ ++ .value = stringify(0x10),\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "pflash_cfi01",\ ++ .property = "old-multiple-chip-handling",\ ++ .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "pci-bridge",\ ++ .property = "shpc",\ ++ .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = TYPE_PCI_DEVICE,\ ++ .property = "x-pcie-extcap-init",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-pci",\ ++ .property = "x-pcie-deverr-init",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-pci",\ ++ .property = "x-pcie-lnkctl-init",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-pci",\ ++ .property = "x-pcie-pm-init",\ ++ .value = "off",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ + .driver = "e1000e",\ + .property = "__redhat_e1000e_7_3_intr_state",\ + .value = "on",\ +-- +1.8.3.1 + diff --git a/SOURCES/0038-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-3.patch b/SOURCES/0038-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-3.patch new file mode 100644 index 0000000..81f4593 --- /dev/null +++ b/SOURCES/0038-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-3.patch @@ -0,0 +1,48 @@ +From 9982768f5fc53178a0886b25a7a4b0ce2fe36c16 Mon Sep 17 00:00:00 2001 +From: Radim Krcmar +Date: Wed, 19 Apr 2017 13:04:02 +0200 +Subject: x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 384 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Radim Krcmar +Message-id: <20170413204227.12678-1-rkrcmar@redhat.com> +Patchwork-id: 74778 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] x86: bump maximum vcpu count of pc-q35-rhel7.4.0 to 384 +Bugzilla: 1433956 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Bandan Das + +bug: https://bugzilla.redhat.com/show_bug.cgi?id=1433956 +brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13014435 +tested: by me, with kernel patches posted at the same time + +RHEL only. This is asked by SAP for their upcoming bigger VMs. +Upstream is going to use a more flexible limit of INT_MAX, but the patch +is not merged yet and enforcing the supported limit might be what we +want. In any case, bumping one number is not a big maintenance burden. + +Signed-off-by: Radim Krčmář +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_q35.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index b86e24d..23d5f6b 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -379,7 +379,7 @@ static void pc_q35_machine_rhel7_options(MachineClass *m) + m->no_floppy = 1; + m->has_dynamic_sysbus = true; + m->alias = "q35"; +- m->max_cpus = 288; ++ m->max_cpus = 384; + SET_MACHINE_COMPAT(m, PC_RHEL_COMPAT); + } + +-- +1.8.3.1 + diff --git a/SOURCES/0039-re-enable-DMA-for-7.3-machine-type.patch b/SOURCES/0039-re-enable-DMA-for-7.3-machine-type.patch new file mode 100644 index 0000000..d385f1e --- /dev/null +++ b/SOURCES/0039-re-enable-DMA-for-7.3-machine-type.patch @@ -0,0 +1,46 @@ +From f5095ba58c62fd97dbdc5b64ce5edb8fdaabedb2 Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Fri, 21 Apr 2017 05:51:22 +0200 +Subject: re-enable DMA for 7.3 machine type + +RH-Author: Igor Mammedov +Message-id: <1492513124-179039-1-git-send-email-imammedo@redhat.com> +Patchwork-id: 74800 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] re-enable DMA for 7.3 machine type +Bugzilla: 1441394 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Miroslav Rezanina + +FWCFG property 'dma_enabled' is set to 'true' for released +7.3 machine types, however during rebase for 7.4 it got flipped +to 'false' as it happend upstream (taken from 2.6 machine type), +which regresses migration. +Fix it by reverting back to default value (true) for 7.3 +machine types. + +Signed-off-by: Igor Mammedov +Signed-off-by: Miroslav Rezanina +--- + include/hw/i386/pc.h | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index b69e53c..7cd1719 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -1034,11 +1034,6 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + .value = "off",\ + },\ + { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \ +- .driver = "fw_cfg_io",\ +- .property = "dma_enabled",\ +- .value = "off",\ +- },\ +- { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_6 */ \ + .driver = TYPE_X86_CPU,\ + .property = "cpuid-0xb",\ + .value = "off",\ +-- +1.8.3.1 + diff --git a/SOURCES/50-kvm-pgste.conf b/SOURCES/50-kvm-pgste.conf new file mode 100644 index 0000000..0df7f0d --- /dev/null +++ b/SOURCES/50-kvm-pgste.conf @@ -0,0 +1,3 @@ +# KVM S390 VM creation fails without this set +# https://www.mail-archive.com/kvm@vger.kernel.org/msg115576.html +vm.allocate_pgste = 1 diff --git a/SOURCES/80-kvm.rules b/SOURCES/80-kvm.rules new file mode 100644 index 0000000..e61b48f --- /dev/null +++ b/SOURCES/80-kvm.rules @@ -0,0 +1 @@ +KERNEL=="kvm", GROUP="kvm", MODE="0666" diff --git a/SOURCES/85-kvm.preset b/SOURCES/85-kvm.preset new file mode 100644 index 0000000..8024052 --- /dev/null +++ b/SOURCES/85-kvm.preset @@ -0,0 +1,5 @@ +# Enable kvm-setup by default. This can have odd side effects on +# PowerNV systems that aren't intended as KVM hosts, but at present we +# only support RHEL on PowerNV for the purpose of being a RHEV host. + +enable kvm-setup.service 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.rhel6-gpxe-source b/SOURCES/README.rhel6-gpxe-source new file mode 100644 index 0000000..959ac38 --- /dev/null +++ b/SOURCES/README.rhel6-gpxe-source @@ -0,0 +1,9 @@ +The ROM images on /usr/share/qemu-kvm/rhel6-*.rom come from the +Red Hat Enterprise Linux 6.4 package gpxe-roms-qemu-0.9.7-6.16.el6.noarch.rpm. + +The source code for those images can be downloaded from: +http://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/gpxe-0.9.7-6.16.el6.src.rpm + +For more information on how to obtain source code for Red Hat Enterprise Linux +software, you can refer to Chapter 1. Obtaining Red Hat Enterprise Linux of the +Red Hat Enterprise Linux Installation Guide. 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/build_configure.sh b/SOURCES/build_configure.sh new file mode 100755 index 0000000..b806cdf --- /dev/null +++ b/SOURCES/build_configure.sh @@ -0,0 +1,156 @@ +#!/bin/sh + +_prefix=$1 +shift +_libdir=$1 +shift +_sysconfdir=$1 +shift +_localstatedir=$1 +shift +_libexecdir=$1 +shift +qemudocdir=$1 +shift +pkgname=$1 +shift +arch=$1 +shift +nvr=$1 +shift +optflags=$1 +shift +have_fdt=$1 +shift +have_gluster=$1 +shift +have_guest_agent=$1 +shift +have_numa=$1 +shift +have_rbd=$1 +shift +have_rdma=$1 +shift +have_seccomp=$1 +shift +have_spice=$1 +shift +have_usbredir=$1 +shift +have_tcmalloc=$1 +shift +have_vxhs=$1 +shift +have_vtd=$1 +shift +have_live_block_ops=$1 +shift +have_vhost_user=$1 +shift + +if [ "$have_rbd" == "enable" ]; then + rbd_driver=rbd, +fi + +if [ "$have_gluster" == "enable" ]; then + gluster_driver=gluster, +fi + +if [ "$have_vxhs" == "enable" ]; then + vxhs_driver=vxhs, +fi + +./configure \ + --prefix=${_prefix} \ + --libdir=${_libdir} \ + --sysconfdir=${_sysconfdir} \ + --interp-prefix=${_prefix}/qemu-%M \ + --localstatedir=${_localstatedir} \ + --docdir=${qemudocdir} \ + --libexecdir=${_libexecdir} \ + --extra-ldflags="$extraldflags -pie -Wl,-z,relro -Wl,-z,now" \ + --extra-cflags="${optflags} -fPIE -DPIE" \ + --with-pkgversion=${nvr} \ + --with-confsuffix=/${pkgname} \ + --with-coroutine=ucontext \ + --with-system-pixman \ + --tls-priority=NORMAL \ + --disable-bluez \ + --disable-brlapi \ + --disable-cap-ng \ + --enable-coroutine-pool \ + --enable-curl \ + --disable-curses \ + --disable-debug-tcg \ + --enable-docs \ + --disable-gtk \ + --enable-kvm \ + --enable-libiscsi \ + --disable-libnfs \ + --enable-libssh2 \ + --enable-libusb \ + --disable-bzip2 \ + --enable-linux-aio \ + --disable-live-block-migration \ + --enable-lzo \ + --disable-opengl \ + --enable-pie \ + --disable-qom-cast-debug \ + --disable-sdl \ + --enable-snappy \ + --disable-sparse \ + --disable-strip \ + --disable-tpm \ + --enable-trace-backend=dtrace \ + --disable-vde \ + --disable-vhost-scsi \ + --disable-virtfs \ + --disable-vnc-jpeg \ + --disable-vte \ + --enable-vnc-png \ + --enable-vnc-sasl \ + --enable-werror \ + --disable-xen \ + --disable-xfsctl \ + --enable-gnutls \ + --disable-gcrypt \ + --enable-nettle \ + --enable-attr \ + --disable-bsd-user \ + --disable-cocoa \ + --enable-debug-info \ + --disable-guest-agent-msi \ + --disable-hax \ + --disable-jemalloc \ + --disable-linux-user \ + --disable-modules \ + --disable-netmap \ + --disable-replication \ + --enable-system \ + --enable-tools \ + --disable-user \ + --enable-vhost-net \ + --enable-vhost-vsock \ + --enable-vnc \ + --disable-virglrenderer \ + --disable-xen-pci-passthrough \ + --${have_fdt}-fdt \ + --${have_gluster}-glusterfs \ + --${have_guest_agent}-guest-agent \ + --${have_numa}-numa \ + --${have_rbd}-rbd \ + --${have_rdma}-rdma \ + --${have_seccomp}-seccomp \ + --${have_spice}-spice \ + --${have_spice}-smartcard \ + --${have_usbredir}-usb-redir \ + --${have_tcmalloc}-tcmalloc \ + --${have_vxhs}-vxhs \ + --${have_vtd}-vtd \ + --${have_live_block_ops}-live-block-ops \ + --${have_vhost_user}-vhost-user \ + --audio-drv-list= \ + --block-drv-rw-whitelist=qcow2,raw,file,host_device,nbd,iscsi,${gluster_driver}${rbd_driver}${vxhs_driver}blkdebug,luks \ + --block-drv-ro-whitelist=vmdk,vhdx,vpc,https,ssh \ + "$@" 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..320ce74 --- /dev/null +++ b/SOURCES/ksmtuned @@ -0,0 +1,138 @@ +#!/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 () { + local pidlist + pidlist=$(pgrep -d ' ' -- '^qemu(-kvm|:.{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-AArch64-Add-pci-testdev.patch b/SOURCES/kvm-AArch64-Add-pci-testdev.patch new file mode 100644 index 0000000..7e32f39 --- /dev/null +++ b/SOURCES/kvm-AArch64-Add-pci-testdev.patch @@ -0,0 +1,39 @@ +From f13b78302e1ef00ec0c91741f29948085809fc58 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Mon, 26 Jun 2017 13:57:58 +0200 +Subject: [PATCH] AArch64: Add pci-testdev + +RH-Author: Andrew Jones +Message-id: <20170626135758.14790-1-drjones@redhat.com> +Patchwork-id: 75685 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] AArch64: Add pci-testdev +Bugzilla: 1465048 +RH-Acked-by: Auger Eric +RH-Acked-by: Laurent Vivier +RH-Acked-by: Wei Huang + +kvm-unit-tests/arm64 supports pci-testdev and we build it for +other architectures which have kvm-unit-tests support, so let's +do the same for AArch64. + +Signed-off-by: Andrew Jones +Signed-off-by: Miroslav Rezanina +--- + default-configs/aarch64-softmmu.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index 4855c9c..96a6232 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -6,6 +6,7 @@ + # CONFIG_DPCD=y + # CONFIG_XLNX_ZYNQMP=y + CONFIG_PCI=y ++CONFIG_PCI_TESTDEV=y + CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO=y + CONFIG_STELLARIS=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-AArch64-remove-mach-virt-7.3-machine-type.patch b/SOURCES/kvm-AArch64-remove-mach-virt-7.3-machine-type.patch new file mode 100644 index 0000000..ebe6dcd --- /dev/null +++ b/SOURCES/kvm-AArch64-remove-mach-virt-7.3-machine-type.patch @@ -0,0 +1,61 @@ +From 8c3f45abd098e47ab4c3fd2ca7681de27d804020 Mon Sep 17 00:00:00 2001 +From: Andrew Jones +Date: Fri, 21 Jul 2017 08:20:14 +0200 +Subject: [PATCH 01/17] AArch64: remove mach-virt-7.3 machine type + +RH-Author: Andrew Jones +Message-id: <20170721082014.31965-1-drjones@redhat.com> +Patchwork-id: 75828 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] AArch64: remove mach-virt-7.3 machine type +Bugzilla: 1473548 +RH-Acked-by: Wei Huang +RH-Acked-by: Auger Eric +RH-Acked-by: Laszlo Ersek + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1473548 + +We never officially released any machine type, so we only ever want the +most recent one available in our unofficial releases. Time to remove the +last one again. + +Signed-off-by: Andrew Jones +Signed-off-by: Miroslav Rezanina +--- + hw/arm/virt.c | 24 ------------------------ + 1 file changed, 24 deletions(-) + +diff --git a/hw/arm/virt.c b/hw/arm/virt.c +index 82d2636..869ff18 100644 +--- a/hw/arm/virt.c ++++ b/hw/arm/virt.c +@@ -1793,27 +1793,3 @@ static void rhel740_virt_options(MachineClass *mc) + SET_MACHINE_COMPAT(mc, ARM_RHEL_COMPAT); + } + DEFINE_RHEL_MACHINE_AS_LATEST(7, 4, 0) +- +-#define ARM_COMPAT_RHEL7_3 \ +- HW_COMPAT_RHEL7_3 +- +-static void rhel730_virt_instance_init(Object *obj) +-{ +- rhel740_virt_instance_init(obj); +-} +- +-static void rhel730_virt_options(MachineClass *mc) +-{ +- VirtMachineClass *vmc = VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); +- +- rhel740_virt_options(mc); +- SET_MACHINE_COMPAT(mc, ARM_COMPAT_RHEL7_3); +- /* the following options need to be re-configured because they weren't +- * present in RHEL 7.3. +- */ +- vmc->disallow_affinity_adjustment = true; +- vmc->no_its = true; +- vmc->no_pmu = true; +- mc->minimum_page_bits = 0; +-} +-DEFINE_RHEL_MACHINE(7, 3, 0) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Disable-rs6000-mc-device.patch b/SOURCES/kvm-Disable-rs6000-mc-device.patch new file mode 100644 index 0000000..6a4eb60 --- /dev/null +++ b/SOURCES/kvm-Disable-rs6000-mc-device.patch @@ -0,0 +1,35 @@ +From 728e7e89dad569198d921fbc82e28599212d6a86 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 19 Apr 2017 09:18:24 +0200 +Subject: [PATCH 03/23] Disable rs6000-mc device + +RH-Author: Miroslav Rezanina +Message-id: <2070e40cf7cd48434eaedc662379fc6069a93229.1492512993.git.mrezanin@redhat.com> +Patchwork-id: 74796 +O-Subject: [RHV 7.4 qemu-kvm-rhev PATCH 3/3] Disable rs6000-mc device +Bugzilla: 1443029 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier + +From: Miroslav Rezanina + +We are not going to support rs6000-mc device so disable it. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/ppc64-softmmu.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index 0bc95e5..f711f44 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -25,4 +25,3 @@ CONFIG_XICS_SPAPR=$(CONFIG_PSERIES) + CONFIG_XICS_KVM=$(and $(CONFIG_PSERIES),$(CONFIG_KVM)) + # For PReP + CONFIG_MEM_HOTPLUG=y +-CONFIG_RS6000_MC=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Disable-serial-isa-for-ppc64.patch b/SOURCES/kvm-Disable-serial-isa-for-ppc64.patch new file mode 100644 index 0000000..a28200c --- /dev/null +++ b/SOURCES/kvm-Disable-serial-isa-for-ppc64.patch @@ -0,0 +1,38 @@ +From 5c0ea496a9b8d35f6ea473dd1d0fceb19bb2af49 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 19 Apr 2017 09:18:23 +0200 +Subject: [PATCH 02/23] Disable serial-isa for ppc64 + +RH-Author: Miroslav Rezanina +Message-id: <6c9ed7131e9b62e7dfb09967011fc30ee8fe501e.1492512993.git.mrezanin@redhat.com> +Patchwork-id: 74795 +O-Subject: [RHV 7.4 qemu-kvm-rhev PATCH 2/3] Disable serial-isa for ppc64 +Bugzilla: 1443029 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier + +From: Miroslav Rezanina + +With 2.9, serial-isa can be disabled for ppc64 architecture as it +is not used. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/ppc64-softmmu.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index a1fbb8d..0bc95e5 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -24,6 +24,5 @@ CONFIG_XICS=$(CONFIG_PSERIES) + CONFIG_XICS_SPAPR=$(CONFIG_PSERIES) + CONFIG_XICS_KVM=$(and $(CONFIG_PSERIES),$(CONFIG_KVM)) + # For PReP +-CONFIG_SERIAL_ISA=y + CONFIG_MEM_HOTPLUG=y + CONFIG_RS6000_MC=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Disable-unimplemented-device.patch b/SOURCES/kvm-Disable-unimplemented-device.patch new file mode 100644 index 0000000..4762f2b --- /dev/null +++ b/SOURCES/kvm-Disable-unimplemented-device.patch @@ -0,0 +1,39 @@ +From 15dbf98520f2a7334c6b33fd542eb1d879d6c1d3 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Wed, 19 Apr 2017 09:18:22 +0200 +Subject: [PATCH 01/23] Disable unimplemented device + +RH-Author: Miroslav Rezanina +Message-id: <35363fe3b7630038090282e12028ecd0d62546b1.1492512993.git.mrezanin@redhat.com> +Patchwork-id: 74794 +O-Subject: [RHV 7.4 qemu-kvm-rhev PATCH 1/3] Disable unimplemented device +Bugzilla: 1443029 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier + +From: Miroslav Rezanina + +We are not going to support unimplemented-device so we are disabling it. + +Signed-off-by: Miroslav Rezanina +--- + hw/misc/Makefile.objs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs +index c8b4893..94e0783 100644 +--- a/hw/misc/Makefile.objs ++++ b/hw/misc/Makefile.objs +@@ -6,7 +6,7 @@ common-obj-$(CONFIG_SGA) += sga.o + common-obj-$(CONFIG_ISA_TESTDEV) += pc-testdev.o + common-obj-$(CONFIG_PCI_TESTDEV) += pci-testdev.o + +-common-obj-y += unimp.o ++#common-obj-y += unimp.o + + obj-$(CONFIG_VMPORT) += vmport.o + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Disable-virtio-pci-for-s390x-builds.patch b/SOURCES/kvm-Disable-virtio-pci-for-s390x-builds.patch new file mode 100644 index 0000000..dcaf8b6 --- /dev/null +++ b/SOURCES/kvm-Disable-virtio-pci-for-s390x-builds.patch @@ -0,0 +1,41 @@ +From 81867afa42adc52dbcd9942aef4a140d30248492 Mon Sep 17 00:00:00 2001 +From: Cornelia Huck +Date: Thu, 13 Jul 2017 11:23:42 +0200 +Subject: [PATCH 2/6] Disable virtio-pci for s390x builds + +RH-Author: Cornelia Huck +Message-id: <20170713112342.9148-2-cohuck@redhat.com> +Patchwork-id: 75762 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH 1/1] Disable virtio-pci for s390x builds +Bugzilla: 1469000 +RH-Acked-by: Thomas Huth +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Jens Freimann + +Pci support for s390x is not yet mature, so disable at least +virtio-pci by removing it from the default config for s390x-softmmu. + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1469000 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13650942 +Upstream: N/A + +Signed-off-by: Cornelia Huck +Signed-off-by: Miroslav Rezanina +--- + default-configs/s390x-softmmu.mak | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-softmmu.mak +index 36e15de..54e5c45 100644 +--- a/default-configs/s390x-softmmu.mak ++++ b/default-configs/s390x-softmmu.mak +@@ -1,5 +1,5 @@ + CONFIG_PCI=y +-CONFIG_VIRTIO_PCI=y ++#CONFIG_VIRTIO_PCI=y + CONFIG_VIRTIO=y + CONFIG_SCLPCONSOLE=y + CONFIG_S390_FLIC=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Downstream-Update-pseries-machine-types-for-RHEL-ALT.patch b/SOURCES/kvm-Downstream-Update-pseries-machine-types-for-RHEL-ALT.patch new file mode 100644 index 0000000..75d14f3 --- /dev/null +++ b/SOURCES/kvm-Downstream-Update-pseries-machine-types-for-RHEL-ALT.patch @@ -0,0 +1,130 @@ +From d5df1efe63c6a0d8502f2066d4aaa2f03713f6f1 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 2 Aug 2017 03:50:04 +0200 +Subject: [PATCH 1/4] Downstream: Update pseries machine types for RHEL-ALT-7.4 + +RH-Author: David Gibson +Message-id: <20170802035004.29766-1-dgibson@redhat.com> +Patchwork-id: 75878 +O-Subject: [PATCH] Downstream: Update pseries machine types for RHEL-ALT-7.4 +Bugzilla: 1473518 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +From: David Gibson + +At present Pegas 1.0 (RHEL-ALT-7.4) presents an identical machine type to +guests as RHEL 7.4. However, that's not certain to stay the case, so it +seems safest to create a new machine type for the Pegas release, +'pseries-rhel7.4.0alt'. + +Furthermore, pegas 1.0 (RHEL-ALT-7.4) supports only POWER9 native guests +- we will only support guests in POWER8 compatibility mode in Pegas1.1. +Since earlier (non-Pegas) releases supported only POWER8, it's impossible +to migrate any existing guests to Pegas1.0. + +Therefore we don't need to include the earlier RHEL specific machine types +in Pegas1.0 (they won't support POWER9 anyway). So we also disable those. + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 29 ++++++++++++++++++++++++++--- + 1 file changed, 26 insertions(+), 3 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 0c401bf..b0ec050 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -3349,6 +3349,7 @@ DEFINE_SPAPR_MACHINE(2_8, "2.8", false); + }, + #endif + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, + uint64_t *buid, hwaddr *pio, + hwaddr *mmio32, hwaddr *mmio64, +@@ -3398,7 +3399,6 @@ static void phb_placement_2_7(sPAPRMachineState *spapr, uint32_t index, + */ + } + +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + static void spapr_machine_2_7_instance_options(MachineState *machine) + { + sPAPRMachineState *spapr = SPAPR_MACHINE(machine); +@@ -3565,18 +3565,37 @@ DEFINE_SPAPR_MACHINE(2_1, "2.1", false); + #endif + + /* ++ * pseries-rhel7.4.0alt ++ */ ++static void spapr_machine_rhel740alt_instance_options(MachineState *machine) ++{ ++} ++ ++static void spapr_machine_rhel740alt_class_options(MachineClass *mc) ++{ ++ /* Defaults for the latest behaviour inherited from the base class */ ++} ++ ++DEFINE_SPAPR_MACHINE(rhel740alt, "rhel7.4.0alt", true); ++ ++ ++/* + * pseries-rhel7.4.0 + */ ++ ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + static void spapr_machine_rhel740_instance_options(MachineState *machine) + { ++ spapr_machine_rhel740alt_instance_options(machine); + } + + static void spapr_machine_rhel740_class_options(MachineClass *mc) + { +- /* Defaults for the latest behaviour inherited from the base class */ ++ spapr_machine_rhel740alt_class_options(mc); + } + +-DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", true); ++DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", false); ++#endif + + /* + * pseries-rhel7.3.0 +@@ -3610,6 +3629,7 @@ DEFINE_SPAPR_MACHINE(rhel740, "rhel7.4.0", true); + .value = "off", \ + }, + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + static void spapr_machine_rhel730_instance_options(MachineState *machine) + { + sPAPRMachineState *spapr = SPAPR_MACHINE(machine); +@@ -3629,6 +3649,7 @@ static void spapr_machine_rhel730_class_options(MachineClass *mc) + } + + DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false); ++#endif + + /* + * pseries-rhel7.2.0 +@@ -3650,6 +3671,7 @@ DEFINE_SPAPR_MACHINE(rhel730, "rhel7.3.0", false); + }, + + ++#if 0 /* Disabled in Red Hat Enterprise Linux */ + static void spapr_machine_rhel720_instance_options(MachineState *machine) + { + spapr_machine_rhel730_instance_options(machine); +@@ -3668,6 +3690,7 @@ static void spapr_machine_rhel720_class_options(MachineClass *mc) + } + + DEFINE_SPAPR_MACHINE(rhel720, "rhel7.2.0", false); ++#endif + + static void spapr_machine_register_types(void) + { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Enable-USB_CONFIG-for-aarch64.patch b/SOURCES/kvm-Enable-USB_CONFIG-for-aarch64.patch new file mode 100644 index 0000000..3c964c5 --- /dev/null +++ b/SOURCES/kvm-Enable-USB_CONFIG-for-aarch64.patch @@ -0,0 +1,34 @@ +From 984f5cd8e225b793b04e752281df1a304afc26b7 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Tue, 13 Jun 2017 07:13:09 +0200 +Subject: [PATCH] Enable USB_CONFIG for aarch64 + +RH-Author: Miroslav Rezanina +Message-id: <20170613071309.13086-1-mrezanin@redhat.com> +Patchwork-id: 75596 +O-Subject: [Pegas 1.0 qemu-kvm PATCH] Enable USB_CONFIG for aarch64 +Bugzilla: 1460010 +RH-Acked-by: Andrew Jones +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Thomas Huth + +Due to missing USB_CONFIG for aarch64 no USB human input device is available +for the aarch64 guests and so they are useless with any human interface. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/aarch64-softmmu.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index a697f40..4855c9c 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -25,3 +25,4 @@ CONFIG_PCIE_PORT=y + CONFIG_XIO3130=y + CONFIG_IOH3420=y + CONFIG_USB_XHCI=y ++CONFIG_USB=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-Diff.-Add-option-in-configure-to-disable-live-b.patch b/SOURCES/kvm-RHEL-Diff.-Add-option-in-configure-to-disable-live-b.patch new file mode 100644 index 0000000..a8ca837 --- /dev/null +++ b/SOURCES/kvm-RHEL-Diff.-Add-option-in-configure-to-disable-live-b.patch @@ -0,0 +1,77 @@ +From 29a041458edc3c068a20e3bc4052e820978607b9 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 31 Jul 2017 16:25:56 +0200 +Subject: [PATCH 14/17] RHEL Diff.: Add option in configure to disable live + block ops + +RH-Author: Jeffrey Cody +Message-id: <99a23905993eea8c6343f72812813abe82500e9c.1501517983.git.jcody@redhat.com> +Patchwork-id: 75873 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v4 1/4] RHEL Diff.: Add option in configure to disable live block ops +Bugzilla: 1418532 +RH-Acked-by: Eric Blake +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +This adds in the option to disable the live block operations. The +resultant config option is not checked until subsequent patches. + +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + configure | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/configure b/configure +index a658481..9f200c2 100755 +--- a/configure ++++ b/configure +@@ -318,6 +318,7 @@ virglrenderer="" + tpm="yes" + libssh2="" + live_block_migration="no" ++live_block_ops="yes" + numa="" + tcmalloc="no" + jemalloc="no" +@@ -1191,6 +1192,10 @@ for opt do + ;; + --enable-live-block-migration) live_block_migration="yes" + ;; ++ --disable-live-block-ops) live_block_ops="no" ++ ;; ++ --enable-live-block-ops) live_block_ops="yes" ++ ;; + --disable-vxhs) vxhs="no" + ;; + --enable-vxhs) vxhs="yes" +@@ -1434,6 +1439,7 @@ disabled with --disable-FEATURE, default is enabled if available: + tpm TPM support + libssh2 ssh block device support + live-block-migration live block migration support ++ live-block-ops live block operations support + numa libnuma support + tcmalloc tcmalloc support + jemalloc jemalloc support +@@ -5159,6 +5165,7 @@ echo "libssh2 support $libssh2" + echo "TPM passthrough $tpm_passthrough" + echo "QOM debugging $qom_cast_debug" + echo "Live block migration $live_block_migration" ++echo "Live block ops $live_block_ops" + echo "lzo support $lzo" + echo "snappy support $snappy" + echo "bzip2 support $bzip2" +@@ -5734,6 +5741,10 @@ if test "$live_block_migration" = "yes" ; then + echo "CONFIG_LIVE_BLOCK_MIGRATION=y" >> $config_host_mak + fi + ++if test "$live_block_ops" = "yes" ; then ++ echo "CONFIG_LIVE_BLOCK_OPS=y" >> $config_host_mak ++fi ++ + # USB host support + if test "$libusb" = "yes"; then + echo "HOST_USB=libusb legacy" >> $config_host_mak +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-Diff.-Disable-live-block-operations-in-HMP-moni.patch b/SOURCES/kvm-RHEL-Diff.-Disable-live-block-operations-in-HMP-moni.patch new file mode 100644 index 0000000..e8b499d --- /dev/null +++ b/SOURCES/kvm-RHEL-Diff.-Disable-live-block-operations-in-HMP-moni.patch @@ -0,0 +1,164 @@ +From c590551b1615b5c263437bb1c34fefc543d3546d Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 31 Jul 2017 16:25:58 +0200 +Subject: [PATCH 16/17] RHEL Diff.: Disable live block operations in HMP + monitor + +RH-Author: Jeffrey Cody +Message-id: <1b8c30b6d2cfbe225b34da89668b2f3f5a3de612.1501517983.git.jcody@redhat.com> +Patchwork-id: 75875 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v4 3/4] RHEL Diff.: Disable live block operations in HMP monitor +Bugzilla: 1418532 +RH-Acked-by: Eric Blake +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + hmp-commands-info.hx | 4 ++++ + hmp-commands.hx | 12 ++++++++++++ + hmp.c | 12 ++++++++++++ + 3 files changed, 28 insertions(+) + +diff --git a/hmp-commands-info.hx b/hmp-commands-info.hx +index a53f105..194c930 100644 +--- a/hmp-commands-info.hx ++++ b/hmp-commands-info.hx +@@ -84,6 +84,8 @@ STEXI + Show block device statistics. + ETEXI + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + { + .name = "block-jobs", + .args_type = "", +@@ -98,6 +100,8 @@ STEXI + Show progress of ongoing block device operations. + ETEXI + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + { + .name = "registers", + .args_type = "", +diff --git a/hmp-commands.hx b/hmp-commands.hx +index f8b2b1c..f76b4d9 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -73,6 +73,8 @@ but should be used with extreme caution. Note that this command only + resizes image files, it can not resize block devices like LVM volumes. + ETEXI + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + { + .name = "block_stream", + .args_type = "device:B,speed:o?,base:s?", +@@ -159,6 +161,8 @@ STEXI + Resume a paused block streaming operation. + ETEXI + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + { + .name = "eject", + .args_type = "force:-f,device:B", +@@ -1167,6 +1171,8 @@ STEXI + Save guest storage keys to a file. + ETEXI + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + { + .name = "snapshot_blkdev", + .args_type = "reuse:-n,device:B,snapshot-file:s?,format:s?", +@@ -1188,6 +1194,8 @@ STEXI + Snapshot device, using snapshot file as target if provided + ETEXI + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + { + .name = "snapshot_blkdev_internal", + .args_type = "device:B,name:s", +@@ -1222,6 +1230,8 @@ STEXI + Delete an internal snapshot on device if it support + ETEXI + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + { + .name = "drive_mirror", + .args_type = "reuse:-n,full:-f,device:B,target:s,format:s?", +@@ -1265,6 +1275,8 @@ STEXI + Start a point-in-time copy of a block device to a specificed target. + ETEXI + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + { + .name = "drive_add", + .args_type = "node:-n,pci_addr:s,opts:s", +diff --git a/hmp.c b/hmp.c +index 33ee308..3e621f0 100644 +--- a/hmp.c ++++ b/hmp.c +@@ -893,6 +893,8 @@ void hmp_info_pci(Monitor *mon, const QDict *qdict) + qapi_free_PciInfoList(info_list); + } + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + void hmp_info_block_jobs(Monitor *mon, const QDict *qdict) + { + BlockJobInfoList *list; +@@ -931,6 +933,8 @@ void hmp_info_block_jobs(Monitor *mon, const QDict *qdict) + qapi_free_BlockJobInfoList(list); + } + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + void hmp_info_tpm(Monitor *mon, const QDict *qdict) + { + TPMInfoList *info_list, *info; +@@ -1164,6 +1168,8 @@ void hmp_block_resize(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &err); + } + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + void hmp_drive_mirror(Monitor *mon, const QDict *qdict) + { + const char *filename = qdict_get_str(qdict, "target"); +@@ -1247,6 +1253,8 @@ void hmp_snapshot_blkdev(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &err); + } + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + void hmp_snapshot_blkdev_internal(Monitor *mon, const QDict *qdict) + { + const char *device = qdict_get_str(qdict, "device"); +@@ -1571,6 +1579,8 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &err); + } + ++#ifdef CONFIG_LIVE_BLOCK_OPS ++ + void hmp_block_stream(Monitor *mon, const QDict *qdict) + { + Error *error = NULL; +@@ -1637,6 +1647,8 @@ void hmp_block_job_complete(Monitor *mon, const QDict *qdict) + hmp_handle_error(mon, &error); + } + ++#endif /* CONFIG_LIVE_BLOCK_OPS */ ++ + typedef struct HMPMigrationStatus + { + QEMUTimer *timer; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-RHEL-Diff.-Unregister-live-block-operations.patch b/SOURCES/kvm-RHEL-Diff.-Unregister-live-block-operations.patch new file mode 100644 index 0000000..6245529 --- /dev/null +++ b/SOURCES/kvm-RHEL-Diff.-Unregister-live-block-operations.patch @@ -0,0 +1,53 @@ +From 1f33b2998d43cd80ade8887b14b3a606997d0bca Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 31 Jul 2017 16:25:57 +0200 +Subject: [PATCH 15/17] RHEL Diff.: Unregister live block operations + +RH-Author: Jeffrey Cody +Message-id: <54901950979015a082c63235d9f159e53d3abe28.1501517983.git.jcody@redhat.com> +Patchwork-id: 75874 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v4 2/4] RHEL Diff.: Unregister live block operations +Bugzilla: 1418532 +RH-Acked-by: Eric Blake +RH-Acked-by: Markus Armbruster +RH-Acked-by: Miroslav Rezanina + +Commands association with live block operations, and block jobs are +disabled for RHEL. + +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + monitor.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/monitor.c b/monitor.c +index 715995f..44dc9a3 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -999,6 +999,22 @@ static void qmp_unregister_commands_hack(void) + && !defined(TARGET_S390X) + qmp_unregister_command(&qmp_commands, "query-cpu-definitions"); + #endif ++#ifndef CONFIG_LIVE_BLOCK_OPS ++ qmp_unregister_command(&qmp_commands, "block-stream"); ++ qmp_unregister_command(&qmp_commands, "block-commit"); ++ qmp_unregister_command(&qmp_commands, "drive-mirror"); ++ qmp_unregister_command(&qmp_commands, "blockdev-mirror"); ++ qmp_unregister_command(&qmp_commands, "drive-backup"); ++ qmp_unregister_command(&qmp_commands, "blockdev-backup"); ++ qmp_unregister_command(&qmp_commands, "blockdev-snapshot"); ++ qmp_unregister_command(&qmp_commands, "blockdev-snapshot-sync"); ++ qmp_unregister_command(&qmp_commands, "block-job-set-speed"); ++ qmp_unregister_command(&qmp_commands, "block-job-cancel"); ++ qmp_unregister_command(&qmp_commands, "block-job-pause"); ++ qmp_unregister_command(&qmp_commands, "block-job-resume"); ++ qmp_unregister_command(&qmp_commands, "block-job-complete"); ++ qmp_unregister_command(&qmp_commands, "query-block-jobs"); ++#endif + } + + void monitor_init_qmp_commands(void) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Reenable-Educational-device.patch b/SOURCES/kvm-Reenable-Educational-device.patch new file mode 100644 index 0000000..4c80032 --- /dev/null +++ b/SOURCES/kvm-Reenable-Educational-device.patch @@ -0,0 +1,40 @@ +From 5c4df94779ce82a5d4ba1ca55237cbb8e79e02ee Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 26 Jan 2017 10:19:46 +0100 +Subject: [PATCH 1/7] Reenable Educational device + +RH-Author: Miroslav Rezanina +Message-id: <20170126101946.14003-1-mrezanin@redhat.com> +Patchwork-id: 73374 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] Reenable Educational device +Bugzilla: 1414694 +RH-Acked-by: Andrew Jones +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Peter Xu + +From: Miroslav Rezanina + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1414694 +Brew: http://brewweb.engineering.redhat.com/brew/taskinfo?taskID=12444064 +Upstream: n/a + +kvm-unit-tests uses Educational device to perform some of tests. To extend +usability with this test suit we will reenable this device. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/pci.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/pci.mak b/default-configs/pci.mak +index f943baa..7d46711 100644 +--- a/default-configs/pci.mak ++++ b/default-configs/pci.mak +@@ -23,3 +23,4 @@ CONFIG_PCI_TESTDEV=y + CONFIG_VGA=y + CONFIG_VGA_PCI=y + CONFIG_IVSHMEM=$(CONFIG_EVENTFD) ++CONFIG_EDU=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Revert-Change-net-socket.c-to-use-socket_-functions-.patch b/SOURCES/kvm-Revert-Change-net-socket.c-to-use-socket_-functions-.patch new file mode 100644 index 0000000..4decce8 --- /dev/null +++ b/SOURCES/kvm-Revert-Change-net-socket.c-to-use-socket_-functions-.patch @@ -0,0 +1,236 @@ +From 8590cce4d4e18bd7fc02cbfa95931ff0c307b263 Mon Sep 17 00:00:00 2001 +From: Xiao Wang +Date: Fri, 9 Jun 2017 05:31:03 +0200 +Subject: [PATCH 01/13] Revert "Change net/socket.c to use socket_*() + functions" again + +RH-Author: Xiao Wang +Message-id: <1496986263-5321-1-git-send-email-jasowang@redhat.com> +Patchwork-id: 75543 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] Revert "Change net/socket.c to use socket_*() functions" again +Bugzilla: 1451629 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: David Hildenbrand +RH-Acked-by: Vlad Yasevich +RH-Acked-by: wexu@redhat.com + +From: "Daniel P. Berrange" + +Bugzilla: 1451629 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13387504 +Test status: Tested by QE and me +Notes: conflict since we're lacking of 226799cec5fa ("socket: Make errp + the last parameter of socket_connect") + +This reverts commit 883e4f7624e10b98d16d9adaffb8b1795664d899. + +This code changed net/socket.c from using socket()+connect(), +to using socket_connect(). In theory this is great, but in +practice this has completely broken the ability to connect +the frontend and backend: + + $ ./x86_64-softmmu/qemu-system-x86_64 \ + -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05 \ + -netdev socket,id=hn0,connect=localhost:1234 + qemu-system-x86_64: -device e1000,id=e0,netdev=hn0,mac=DE:AD:BE:EF:AF:05: Property 'e1000.netdev' can't find value 'hn0' + +The old code would call net_socket_fd_init() synchronously, +while letting the connect() complete in the backgorund. The +new code moved net_socket_fd_init() so that it is only called +after connect() completes in the background. + +Thus at the time we initialize the NIC frontend, the backend +does not exist. + +The socket_connect() conversion as done is a bad fit for the +current code, since it did not try to change the way it deals +with async connection completion. Rather than try to fix this, +just revert the socket_connect() conversion entirely. + +The code is about to be converted to use QIOChannel which +will let the problem be solved in a cleaner manner. This +revert is more suitable for stable branches in the meantime. + +Signed-off-by: Daniel P. Berrange +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Jason Wang +(cherry picked from commit 6701e5514beab7b781a10424a94e9850c707287c) +Signed-off-by: Jason Wang +Signed-off-by: Miroslav Rezanina + +Conflicts: + net/socket.c +--- + net/socket.c | 127 ++++++++++++++++++++++++++--------------------------------- + 1 file changed, 56 insertions(+), 71 deletions(-) + +diff --git a/net/socket.c b/net/socket.c +index fe3547b..dcae1ae 100644 +--- a/net/socket.c ++++ b/net/socket.c +@@ -489,106 +489,91 @@ static int net_socket_listen_init(NetClientState *peer, + { + NetClientState *nc; + NetSocketState *s; +- SocketAddress *saddr; +- int ret; +- Error *local_error = NULL; ++ struct sockaddr_in saddr; ++ int fd, ret; + +- saddr = socket_parse(host_str, &local_error); +- if (saddr == NULL) { +- error_report_err(local_error); ++ if (parse_host_port(&saddr, host_str) < 0) ++ return -1; ++ ++ fd = qemu_socket(PF_INET, SOCK_STREAM, 0); ++ if (fd < 0) { ++ perror("socket"); + return -1; + } ++ qemu_set_nonblock(fd); ++ ++ socket_set_fast_reuse(fd); + +- ret = socket_listen(saddr, &local_error); ++ ret = bind(fd, (struct sockaddr *)&saddr, sizeof(saddr)); + if (ret < 0) { +- qapi_free_SocketAddress(saddr); +- error_report_err(local_error); ++ perror("bind"); ++ closesocket(fd); ++ return -1; ++ } ++ ret = listen(fd, 0); ++ if (ret < 0) { ++ perror("listen"); ++ closesocket(fd); + return -1; + } + + nc = qemu_new_net_client(&net_socket_info, peer, model, name); + s = DO_UPCAST(NetSocketState, nc, nc); + s->fd = -1; +- s->listen_fd = ret; ++ s->listen_fd = fd; + s->nc.link_down = true; + net_socket_rs_init(&s->rs, net_socket_rs_finalize); + + qemu_set_fd_handler(s->listen_fd, net_socket_accept, NULL, s); +- qapi_free_SocketAddress(saddr); + return 0; + } + +-typedef struct { +- NetClientState *peer; +- SocketAddress *saddr; +- char *model; +- char *name; +-} socket_connect_data; +- +-static void socket_connect_data_free(socket_connect_data *c) +-{ +- qapi_free_SocketAddress(c->saddr); +- g_free(c->model); +- g_free(c->name); +- g_free(c); +-} +- +-static void net_socket_connected(int fd, Error *err, void *opaque) +-{ +- socket_connect_data *c = opaque; +- NetSocketState *s; +- char *addr_str = NULL; +- Error *local_error = NULL; +- +- addr_str = socket_address_to_string(c->saddr, &local_error); +- if (addr_str == NULL) { +- error_report_err(local_error); +- closesocket(fd); +- goto end; +- } +- +- s = net_socket_fd_init(c->peer, c->model, c->name, fd, true); +- if (!s) { +- closesocket(fd); +- goto end; +- } +- +- snprintf(s->nc.info_str, sizeof(s->nc.info_str), +- "socket: connect to %s", addr_str); +- +-end: +- g_free(addr_str); +- socket_connect_data_free(c); +-} +- + static int net_socket_connect_init(NetClientState *peer, + const char *model, + const char *name, + const char *host_str) + { +- socket_connect_data *c = g_new0(socket_connect_data, 1); +- int fd = -1; +- Error *local_error = NULL; ++ NetSocketState *s; ++ int fd, connected, ret; ++ struct sockaddr_in saddr; + +- c->peer = peer; +- c->model = g_strdup(model); +- c->name = g_strdup(name); +- c->saddr = socket_parse(host_str, &local_error); +- if (c->saddr == NULL) { +- goto err; +- } ++ if (parse_host_port(&saddr, host_str) < 0) ++ return -1; + +- fd = socket_connect(c->saddr, &local_error, net_socket_connected, c); ++ fd = qemu_socket(PF_INET, SOCK_STREAM, 0); + if (fd < 0) { +- goto err; ++ perror("socket"); ++ return -1; + } ++ qemu_set_nonblock(fd); + ++ connected = 0; ++ for(;;) { ++ ret = connect(fd, (struct sockaddr *)&saddr, sizeof(saddr)); ++ if (ret < 0) { ++ if (errno == EINTR || errno == EWOULDBLOCK) { ++ /* continue */ ++ } else if (errno == EINPROGRESS || ++ errno == EALREADY || ++ errno == EINVAL) { ++ break; ++ } else { ++ perror("connect"); ++ closesocket(fd); ++ return -1; ++ } ++ } else { ++ connected = 1; ++ break; ++ } ++ } ++ s = net_socket_fd_init(peer, model, name, fd, connected); ++ if (!s) ++ return -1; ++ snprintf(s->nc.info_str, sizeof(s->nc.info_str), ++ "socket: connect to %s:%d", ++ inet_ntoa(saddr.sin_addr), ntohs(saddr.sin_port)); + return 0; +- +-err: +- error_report_err(local_error); +- socket_connect_data_free(c); +- return -1; + } + + static int net_socket_mcast_init(NetClientState *peer, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-Revert-hw-pci-disable-pci-bridge-s-shpc-by-default.patch b/SOURCES/kvm-Revert-hw-pci-disable-pci-bridge-s-shpc-by-default.patch new file mode 100644 index 0000000..f63a126 --- /dev/null +++ b/SOURCES/kvm-Revert-hw-pci-disable-pci-bridge-s-shpc-by-default.patch @@ -0,0 +1,72 @@ +From 8c122a5b79df2e326f429c2f08a667285be52529 Mon Sep 17 00:00:00 2001 +From: Marcel Apfelbaum +Date: Wed, 24 May 2017 11:35:59 +0200 +Subject: [PATCH 4/6] Revert "hw/pci: disable pci-bridge's shpc by default" + +RH-Author: Marcel Apfelbaum +Message-id: <20170524113559.17638-1-marcel@redhat.com> +Patchwork-id: 75407 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH V2] Revert "hw/pci: disable pci-bridge's shpc by default" +Bugzilla: 1434706 +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Michael S. Tsirkin + +Tests: Tested the empty pci bridge gets the IO range resources + +This reverts commit dc0ae767700c156894e36fab89a745a2dc4173de. + +Disabling the shpc controller has an undesired side effect. +The PCI bridge remains with no attached devices at boot time, +and the guest operating systems do not allocate any resources +for it, leaving the bridge unusable. Note that the behaviour +is dictated by the pci bridge specification. + +Revert the commit and leave the shpc controller even if is not +actually used by any architecture. Slot 0 remains unusable at boot time. + +Keep shpc off for QEMU 2.9 machines. + +Signed-off-by: Marcel Apfelbaum +Reviewed-by: Paolo Bonzini +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 2fa356629ed2ce9c714f11c89c1a074b8bad3fcb) +Signed-off-by: Marcel Apfelbaum +Signed-off-by: Miroslav Rezanina +--- + hw/pci-bridge/pci_bridge_dev.c | 2 +- + include/hw/compat.h | 4 ---- + 2 files changed, 1 insertion(+), 5 deletions(-) + +diff --git a/hw/pci-bridge/pci_bridge_dev.c b/hw/pci-bridge/pci_bridge_dev.c +index 647ad80..5dbd933 100644 +--- a/hw/pci-bridge/pci_bridge_dev.c ++++ b/hw/pci-bridge/pci_bridge_dev.c +@@ -163,7 +163,7 @@ static Property pci_bridge_dev_properties[] = { + DEFINE_PROP_ON_OFF_AUTO(PCI_BRIDGE_DEV_PROP_MSI, PCIBridgeDev, msi, + ON_OFF_AUTO_AUTO), + DEFINE_PROP_BIT(PCI_BRIDGE_DEV_PROP_SHPC, PCIBridgeDev, flags, +- PCI_BRIDGE_DEV_F_SHPC_REQ, false), ++ PCI_BRIDGE_DEV_F_SHPC_REQ, true), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/include/hw/compat.h b/include/hw/compat.h +index f85c1c2..8366acc 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -341,10 +341,6 @@ + .property = "old-multiple-chip-handling",\ + .value = "on",\ + },{ /* HW_COMPAT_RHEL7_3 */ \ +- .driver = "pci-bridge",\ +- .property = "shpc",\ +- .value = "on",\ +- },{ /* HW_COMPAT_RHEL7_3 */ \ + .driver = TYPE_PCI_DEVICE,\ + .property = "x-pcie-extcap-init",\ + .value = "off",\ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-aarch64-Enable-usb-xhci.patch b/SOURCES/kvm-aarch64-Enable-usb-xhci.patch new file mode 100644 index 0000000..d301863 --- /dev/null +++ b/SOURCES/kvm-aarch64-Enable-usb-xhci.patch @@ -0,0 +1,44 @@ +From a9364631e195042657e5104f59a799dc4cda33c0 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Mon, 15 May 2017 13:43:30 +0200 +Subject: [PATCH 01/27] aarch64: Enable usb-xhci + +RH-Author: Miroslav Rezanina +Message-id: <20170515134330.16970-1-mrezanin@redhat.com> +Patchwork-id: 75163 +O-Subject: [RHV 7.4 qemu-kvm-rhev PATCH] aarch64: Enable usb-xhci +Bugzilla: 1446570 +RH-Acked-by: Markus Armbruster +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: John Snow +RH-Acked-by: Wei Huang + +From: Miroslav Rezanina + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1446570 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13198239 + +We did not support usb-xhci on the aarch64 architecture. However, we are +going to use this device on aarch64 so enabling it. + +Note: Libvirt will prefer qemu-xhci device. Unfortunatelly, it's not possible +to configure build only this version of usb-xhci device with keeping +nec-usb-xhci disabled so both device will be enabled by this patch. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/aarch64-softmmu.mak | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/default-configs/aarch64-softmmu.mak b/default-configs/aarch64-softmmu.mak +index 118b861..a697f40 100644 +--- a/default-configs/aarch64-softmmu.mak ++++ b/default-configs/aarch64-softmmu.mak +@@ -24,3 +24,4 @@ CONFIG_ARM_V7M=y + CONFIG_PCIE_PORT=y + CONFIG_XIO3130=y + CONFIG_IOH3420=y ++CONFIG_USB_XHCI=y +-- +1.8.3.1 + diff --git a/SOURCES/kvm-aio-add-missing-aio_notify-to-aio_enable_external.patch b/SOURCES/kvm-aio-add-missing-aio_notify-to-aio_enable_external.patch new file mode 100644 index 0000000..42d7a1c --- /dev/null +++ b/SOURCES/kvm-aio-add-missing-aio_notify-to-aio_enable_external.patch @@ -0,0 +1,83 @@ +From 988413c0fb5eed4d0f11d218e2d2a883d713e777 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Mon, 15 May 2017 14:25:31 +0200 +Subject: [PATCH 4/5] aio: add missing aio_notify() to aio_enable_external() + +RH-Author: Stefan Hajnoczi +Message-id: <20170515142531.15830-2-stefanha@redhat.com> +Patchwork-id: 75165 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] aio: add missing aio_notify() to aio_enable_external() +Bugzilla: 1446498 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Fam Zheng +RH-Acked-by: Laurent Vivier + +The main loop uses aio_disable_external()/aio_enable_external() to +temporarily disable processing of external AioContext clients like +device emulation. + +This allows monitor commands to quiesce I/O and prevent the guest from +submitting new requests while a monitor command is in progress. + +The aio_enable_external() API is currently broken when an IOThread is in +aio_poll() waiting for fd activity when the main loop re-enables +external clients. Incrementing ctx->external_disable_cnt does not wake +the IOThread from ppoll(2) so fd processing remains suspended and leads +to unresponsive emulated devices. + +This patch adds an aio_notify() call to aio_enable_external() so the +IOThread is kicked out of ppoll(2) and will re-arm the file descriptors. + +The bug can be reproduced as follows: + + $ qemu -M accel=kvm -m 1024 \ + -object iothread,id=iothread0 \ + -device virtio-scsi-pci,iothread=iothread0,id=virtio-scsi-pci0 \ + -drive if=none,id=drive0,aio=native,cache=none,format=raw,file=test.img \ + -device scsi-hd,id=scsi-hd0,drive=drive0 \ + -qmp tcp::5555,server,nowait + + $ scripts/qmp/qmp-shell localhost:5555 + (qemu) blockdev-snapshot-sync device=drive0 snapshot-file=sn1.qcow2 + mode=absolute-paths format=qcow2 + +After blockdev-snapshot-sync completes the SCSI disk will be +unresponsive. This leads to request timeouts inside the guest. + +Reported-by: Qianqian Zhu +Reviewed-by: Fam Zheng +Signed-off-by: Stefan Hajnoczi +Message-id: 20170508180705.20609-1-stefanha@redhat.com +Suggested-by: Fam Zheng +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 321d1dba8bef9676a77e9399484e3cd8bf2cf16a) +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Miroslav Rezanina +--- + include/block/aio.h | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/include/block/aio.h b/include/block/aio.h +index 406e323..e9aeeae 100644 +--- a/include/block/aio.h ++++ b/include/block/aio.h +@@ -454,8 +454,14 @@ static inline void aio_disable_external(AioContext *ctx) + */ + static inline void aio_enable_external(AioContext *ctx) + { +- assert(ctx->external_disable_cnt > 0); +- atomic_dec(&ctx->external_disable_cnt); ++ int old; ++ ++ old = atomic_fetch_dec(&ctx->external_disable_cnt); ++ assert(old > 0); ++ if (old == 1) { ++ /* Kick event loop so it re-arms file descriptors */ ++ aio_notify(ctx); ++ } + } + + /** +-- +1.8.3.1 + diff --git a/SOURCES/kvm-all-Pass-an-error-object-to-kvm_device_access.patch b/SOURCES/kvm-all-Pass-an-error-object-to-kvm_device_access.patch new file mode 100644 index 0000000..034b87b --- /dev/null +++ b/SOURCES/kvm-all-Pass-an-error-object-to-kvm_device_access.patch @@ -0,0 +1,224 @@ +From 9c4152bb3eec460be32ab6704753f61edf9f8472 Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Fri, 16 Jun 2017 15:17:53 +0200 +Subject: [PATCH 2/5] kvm-all: Pass an error object to kvm_device_access + +RH-Author: Auger Eric +Message-id: <1497626276-18221-3-git-send-email-eric.auger@redhat.com> +Patchwork-id: 75638 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 2/5] kvm-all: Pass an error object to kvm_device_access +Bugzilla: 1462061 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina + +In some circumstances, we don't want to abort if the +kvm_device_access fails. This will be the case during ITS +migration, in case the ITS table save/restore fails because +the guest did not program the vITS correctly. So let's pass an +error object to the function and return the ioctl value. New +callers will be able to make a decision upon this returned +value. + +Existing callers pass &error_abort which will cause the +function to abort on failure. + +Signed-off-by: Eric Auger +Reviewed-by: Juan Quintela +Reviewed-by: Peter Xu +Message-id: 1497023553-18411-2-git-send-email-eric.auger@redhat.com +[PMM: wrapped long line] +Signed-off-by: Peter Maydell + +(cherry picked from commit 556969e938a97e98eec9df039944741ed74ce049) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/intc/arm_gic_kvm.c | 9 +++++---- + hw/intc/arm_gicv3_its_kvm.c | 2 +- + hw/intc/arm_gicv3_kvm.c | 14 +++++++------- + include/sysemu/kvm.h | 11 +++++++---- + kvm-all.c | 14 ++++++++------ + 5 files changed, 28 insertions(+), 22 deletions(-) + +diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc/arm_gic_kvm.c +index ec952ec..98fbe98 100644 +--- a/hw/intc/arm_gic_kvm.c ++++ b/hw/intc/arm_gic_kvm.c +@@ -100,14 +100,14 @@ static void kvm_gicd_access(GICState *s, int offset, int cpu, + uint32_t *val, bool write) + { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_DIST_REGS, +- KVM_VGIC_ATTR(offset, cpu), val, write); ++ KVM_VGIC_ATTR(offset, cpu), val, write, &error_abort); + } + + static void kvm_gicc_access(GICState *s, int offset, int cpu, + uint32_t *val, bool write) + { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_REGS, +- KVM_VGIC_ATTR(offset, cpu), val, write); ++ KVM_VGIC_ATTR(offset, cpu), val, write, &error_abort); + } + + #define for_each_irq_reg(_ctr, _max_irq, _field_width) \ +@@ -538,13 +538,14 @@ static void kvm_arm_gic_realize(DeviceState *dev, Error **errp) + if (kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0)) { + uint32_t numirqs = s->num_irq; + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, 0, +- &numirqs, true); ++ &numirqs, true, &error_abort); + } + /* Tell the kernel to complete VGIC initialization now */ + if (kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, + KVM_DEV_ARM_VGIC_CTRL_INIT)) { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, +- KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true); ++ KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true, ++ &error_abort); + } + } else if (ret != -ENODEV && ret != -ENOTSUP) { + error_setg_errno(errp, -ret, "error creating in-kernel VGIC"); +diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c +index bd4f3aa..ad2a1db 100644 +--- a/hw/intc/arm_gicv3_its_kvm.c ++++ b/hw/intc/arm_gicv3_its_kvm.c +@@ -78,7 +78,7 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp) + + /* explicit init of the ITS */ + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, +- KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true); ++ KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true, &error_abort); + + /* register the base address */ + kvm_arm_register_device(&s->iomem_its_cntrl, -1, KVM_DEV_ARM_VGIC_GRP_ADDR, +diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c +index 19aab56..824475f 100644 +--- a/hw/intc/arm_gicv3_kvm.c ++++ b/hw/intc/arm_gicv3_kvm.c +@@ -93,7 +93,7 @@ static inline void kvm_gicd_access(GICv3State *s, int offset, + { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_DIST_REGS, + KVM_VGIC_ATTR(offset, 0), +- val, write); ++ val, write, &error_abort); + } + + static inline void kvm_gicr_access(GICv3State *s, int offset, int cpu, +@@ -101,7 +101,7 @@ static inline void kvm_gicr_access(GICv3State *s, int offset, int cpu, + { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_REDIST_REGS, + KVM_VGIC_ATTR(offset, s->cpu[cpu].gicr_typer), +- val, write); ++ val, write, &error_abort); + } + + static inline void kvm_gicc_access(GICv3State *s, uint64_t reg, int cpu, +@@ -109,7 +109,7 @@ static inline void kvm_gicc_access(GICv3State *s, uint64_t reg, int cpu, + { + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS, + KVM_VGIC_ATTR(reg, s->cpu[cpu].gicr_typer), +- val, write); ++ val, write, &error_abort); + } + + static inline void kvm_gic_line_level_access(GICv3State *s, int irq, int cpu, +@@ -119,7 +119,7 @@ static inline void kvm_gic_line_level_access(GICv3State *s, int irq, int cpu, + KVM_VGIC_ATTR(irq, s->cpu[cpu].gicr_typer) | + (VGIC_LEVEL_INFO_LINE_LEVEL << + KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT), +- val, write); ++ val, write, &error_abort); + } + + /* Loop through each distributor IRQ related register; since bits +@@ -630,7 +630,7 @@ static void arm_gicv3_icc_reset(CPUARMState *env, const ARMCPRegInfo *ri) + /* Initialize to actual HW supported configuration */ + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS, + KVM_VGIC_ATTR(ICC_CTLR_EL1, cpu->mp_affinity), +- &c->icc_ctlr_el1[GICV3_NS], false); ++ &c->icc_ctlr_el1[GICV3_NS], false, &error_abort); + + c->icc_ctlr_el1[GICV3_S] = c->icc_ctlr_el1[GICV3_NS]; + } +@@ -717,11 +717,11 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) + } + + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_NR_IRQS, +- 0, &s->num_irq, true); ++ 0, &s->num_irq, true, &error_abort); + + /* Tell the kernel to complete VGIC initialization now */ + kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, +- KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true); ++ KVM_DEV_ARM_VGIC_CTRL_INIT, NULL, true, &error_abort); + + kvm_arm_register_device(&s->iomem_dist, -1, KVM_DEV_ARM_VGIC_GRP_ADDR, + KVM_VGIC_V3_ADDR_TYPE_DIST, s->dev_fd); +diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h +index 5cc83f2..b4f52b0 100644 +--- a/include/sysemu/kvm.h ++++ b/include/sysemu/kvm.h +@@ -294,12 +294,15 @@ int kvm_device_check_attr(int fd, uint32_t group, uint64_t attr); + * @attr: the attribute of that group to set or get + * @val: pointer to a storage area for the value + * @write: true for set and false for get operation ++ * @errp: error object handle + * +- * This function is not allowed to fail. Use kvm_device_check_attr() +- * in order to check for the availability of optional attributes. ++ * Returns: 0 on success ++ * < 0 on error ++ * Use kvm_device_check_attr() in order to check for the availability ++ * of optional attributes. + */ +-void kvm_device_access(int fd, int group, uint64_t attr, +- void *val, bool write); ++int kvm_device_access(int fd, int group, uint64_t attr, ++ void *val, bool write, Error **errp); + + /** + * kvm_create_device - create a KVM device for the device control API +diff --git a/kvm-all.c b/kvm-all.c +index 128f5c8..bed0288 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -23,6 +23,7 @@ + #include "qemu/option.h" + #include "qemu/config-file.h" + #include "qemu/error-report.h" ++#include "qapi/error.h" + #include "hw/hw.h" + #include "hw/pci/msi.h" + #include "hw/pci/msix.h" +@@ -2228,8 +2229,8 @@ int kvm_device_check_attr(int dev_fd, uint32_t group, uint64_t attr) + return kvm_device_ioctl(dev_fd, KVM_HAS_DEVICE_ATTR, &attribute) ? 0 : 1; + } + +-void kvm_device_access(int fd, int group, uint64_t attr, +- void *val, bool write) ++int kvm_device_access(int fd, int group, uint64_t attr, ++ void *val, bool write, Error **errp) + { + struct kvm_device_attr kvmattr; + int err; +@@ -2243,11 +2244,12 @@ void kvm_device_access(int fd, int group, uint64_t attr, + write ? KVM_SET_DEVICE_ATTR : KVM_GET_DEVICE_ATTR, + &kvmattr); + if (err < 0) { +- error_report("KVM_%s_DEVICE_ATTR failed: %s", +- write ? "SET" : "GET", strerror(-err)); +- error_printf("Group %d attr 0x%016" PRIx64 "\n", group, attr); +- abort(); ++ error_setg_errno(errp, -err, ++ "KVM_%s_DEVICE_ATTR failed: Group %d " ++ "attr 0x%016" PRIx64, ++ write ? "SET" : "GET", group, attr); + } ++ return err; + } + + /* Return 1 on success, 0 on failure */ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-Add-errp-to-b-lk-drv-_truncate.patch b/SOURCES/kvm-block-Add-errp-to-b-lk-drv-_truncate.patch new file mode 100644 index 0000000..fe4bd59 --- /dev/null +++ b/SOURCES/kvm-block-Add-errp-to-b-lk-drv-_truncate.patch @@ -0,0 +1,629 @@ +From 0a86fe65bd08fb190d71a0276b8bbddd7853b196 Mon Sep 17 00:00:00 2001 +From: John Snow +Date: Tue, 16 May 2017 21:00:40 +0200 +Subject: [PATCH 04/27] block: Add errp to b{lk, drv}_truncate() + +RH-Author: John Snow +Message-id: <20170516210041.12856-3-jsnow@redhat.com> +Patchwork-id: 75198 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH v2 2/3] block: Add errp to b{lk, drv}_truncate() +Bugzilla: 1447551 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Paolo Bonzini + +From: Max Reitz + +For one thing, this allows us to drop the error message generation from +qemu-img.c and blockdev.c and instead have it unified in +bdrv_truncate(). + +Signed-off-by: Max Reitz +Message-id: 20170328205129.15138-3-mreitz@redhat.com +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Max Reitz +(cherry picked from commit ed3d2ec98a33fbdeabc471b11ff807075f07e996) +Signed-off-by: John Snow +Signed-off-by: Miroslav Rezanina +--- + block.c | 16 ++++++++++++---- + block/blkdebug.c | 2 +- + block/block-backend.c | 5 +++-- + block/commit.c | 5 +++-- + block/crypto.c | 2 +- + block/mirror.c | 2 +- + block/parallels.c | 13 ++++++++----- + block/qcow.c | 6 +++--- + block/qcow2-refcount.c | 5 ++++- + block/qcow2.c | 14 +++++++++----- + block/qed.c | 2 +- + block/raw-format.c | 2 +- + block/vdi.c | 4 ++-- + block/vhdx-log.c | 2 +- + block/vhdx.c | 10 +++------- + block/vmdk.c | 13 +++---------- + block/vpc.c | 13 +++++++------ + blockdev.c | 21 +-------------------- + include/block/block.h | 2 +- + include/sysemu/block-backend.h | 2 +- + qemu-img.c | 17 ++++------------- + qemu-io-cmds.c | 5 +++-- + 22 files changed, 73 insertions(+), 90 deletions(-) + +diff --git a/block.c b/block.c +index 9fca814..6201991 100644 +--- a/block.c ++++ b/block.c +@@ -3307,7 +3307,7 @@ exit: + /** + * Truncate file to 'offset' bytes (needed only for file protocols) + */ +-int bdrv_truncate(BdrvChild *child, int64_t offset) ++int bdrv_truncate(BdrvChild *child, int64_t offset, Error **errp) + { + BlockDriverState *bs = child->bs; + BlockDriver *drv = bs->drv; +@@ -3319,12 +3319,18 @@ int bdrv_truncate(BdrvChild *child, int64_t offset) + * cannot assert this permission in that case. */ + // assert(child->perm & BLK_PERM_RESIZE); + +- if (!drv) ++ if (!drv) { ++ error_setg(errp, "No medium inserted"); + return -ENOMEDIUM; +- if (!drv->bdrv_truncate) ++ } ++ if (!drv->bdrv_truncate) { ++ error_setg(errp, "Image format driver does not support resize"); + return -ENOTSUP; +- if (bs->read_only) ++ } ++ if (bs->read_only) { ++ error_setg(errp, "Image is read-only"); + return -EACCES; ++ } + + ret = drv->bdrv_truncate(bs, offset); + if (ret == 0) { +@@ -3332,6 +3338,8 @@ int bdrv_truncate(BdrvChild *child, int64_t offset) + bdrv_dirty_bitmap_truncate(bs); + bdrv_parent_cb_resize(bs); + ++bs->write_gen; ++ } else { ++ error_setg_errno(errp, -ret, "Failed to resize image"); + } + return ret; + } +diff --git a/block/blkdebug.c b/block/blkdebug.c +index 67e8024..15a9966 100644 +--- a/block/blkdebug.c ++++ b/block/blkdebug.c +@@ -663,7 +663,7 @@ static int64_t blkdebug_getlength(BlockDriverState *bs) + + static int blkdebug_truncate(BlockDriverState *bs, int64_t offset) + { +- return bdrv_truncate(bs->file, offset); ++ return bdrv_truncate(bs->file, offset, NULL); + } + + static void blkdebug_refresh_filename(BlockDriverState *bs, QDict *options) +diff --git a/block/block-backend.c b/block/block-backend.c +index dd131cf..67753ee 100644 +--- a/block/block-backend.c ++++ b/block/block-backend.c +@@ -1765,13 +1765,14 @@ int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, + BDRV_REQ_WRITE_COMPRESSED); + } + +-int blk_truncate(BlockBackend *blk, int64_t offset) ++int blk_truncate(BlockBackend *blk, int64_t offset, Error **errp) + { + if (!blk_is_available(blk)) { ++ error_setg(errp, "No medium inserted"); + return -ENOMEDIUM; + } + +- return bdrv_truncate(blk->root, offset); ++ return bdrv_truncate(blk->root, offset, errp); + } + + static void blk_pdiscard_entry(void *opaque) +diff --git a/block/commit.c b/block/commit.c +index 91d2c34..76a0d98 100644 +--- a/block/commit.c ++++ b/block/commit.c +@@ -151,7 +151,7 @@ static void coroutine_fn commit_run(void *opaque) + } + + if (base_len < s->common.len) { +- ret = blk_truncate(s->base, s->common.len); ++ ret = blk_truncate(s->base, s->common.len, NULL); + if (ret) { + goto out; + } +@@ -511,8 +511,9 @@ int bdrv_commit(BlockDriverState *bs) + * grow the backing file image if possible. If not possible, + * we must return an error */ + if (length > backing_length) { +- ret = blk_truncate(backing, length); ++ ret = blk_truncate(backing, length, &local_err); + if (ret < 0) { ++ error_report_err(local_err); + goto ro_cleanup; + } + } +diff --git a/block/crypto.c b/block/crypto.c +index 4a20388..52e4f2b 100644 +--- a/block/crypto.c ++++ b/block/crypto.c +@@ -389,7 +389,7 @@ static int block_crypto_truncate(BlockDriverState *bs, int64_t offset) + + offset += payload_offset; + +- return bdrv_truncate(bs->file, offset); ++ return bdrv_truncate(bs->file, offset, NULL); + } + + static void block_crypto_close(BlockDriverState *bs) +diff --git a/block/mirror.c b/block/mirror.c +index 164438f..2173a2f 100644 +--- a/block/mirror.c ++++ b/block/mirror.c +@@ -724,7 +724,7 @@ static void coroutine_fn mirror_run(void *opaque) + } + + if (s->bdev_length > base_length) { +- ret = blk_truncate(s->target, s->bdev_length); ++ ret = blk_truncate(s->target, s->bdev_length, NULL); + if (ret < 0) { + goto immediate_exit; + } +diff --git a/block/parallels.c b/block/parallels.c +index 90acf79..8be46a7 100644 +--- a/block/parallels.c ++++ b/block/parallels.c +@@ -223,7 +223,8 @@ static int64_t allocate_clusters(BlockDriverState *bs, int64_t sector_num, + space << BDRV_SECTOR_BITS, 0); + } else { + ret = bdrv_truncate(bs->file, +- (s->data_end + space) << BDRV_SECTOR_BITS); ++ (s->data_end + space) << BDRV_SECTOR_BITS, ++ NULL); + } + if (ret < 0) { + return ret; +@@ -456,8 +457,10 @@ static int parallels_check(BlockDriverState *bs, BdrvCheckResult *res, + size - res->image_end_offset); + res->leaks += count; + if (fix & BDRV_FIX_LEAKS) { +- ret = bdrv_truncate(bs->file, res->image_end_offset); ++ Error *local_err = NULL; ++ ret = bdrv_truncate(bs->file, res->image_end_offset, &local_err); + if (ret < 0) { ++ error_report_err(local_err); + res->check_errors++; + return ret; + } +@@ -504,7 +507,7 @@ static int parallels_create(const char *filename, QemuOpts *opts, Error **errp) + + blk_set_allow_write_beyond_eof(file, true); + +- ret = blk_truncate(file, 0); ++ ret = blk_truncate(file, 0, errp); + if (ret < 0) { + goto exit; + } +@@ -696,7 +699,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags, + } + + if (!(flags & BDRV_O_RESIZE) || !bdrv_has_zero_init(bs->file->bs) || +- bdrv_truncate(bs->file, bdrv_getlength(bs->file->bs)) != 0) { ++ bdrv_truncate(bs->file, bdrv_getlength(bs->file->bs), NULL) != 0) { + s->prealloc_mode = PRL_PREALLOC_MODE_FALLOCATE; + } + +@@ -739,7 +742,7 @@ static void parallels_close(BlockDriverState *bs) + } + + if (bs->open_flags & BDRV_O_RDWR) { +- bdrv_truncate(bs->file, s->data_end << BDRV_SECTOR_BITS); ++ bdrv_truncate(bs->file, s->data_end << BDRV_SECTOR_BITS, NULL); + } + + g_free(s->bat_dirty_bmap); +diff --git a/block/qcow.c b/block/qcow.c +index 9d6ac83..5d147b9 100644 +--- a/block/qcow.c ++++ b/block/qcow.c +@@ -473,7 +473,7 @@ static uint64_t get_cluster_offset(BlockDriverState *bs, + /* round to cluster size */ + cluster_offset = (cluster_offset + s->cluster_size - 1) & + ~(s->cluster_size - 1); +- bdrv_truncate(bs->file, cluster_offset + s->cluster_size); ++ bdrv_truncate(bs->file, cluster_offset + s->cluster_size, NULL); + /* if encrypted, we must initialize the cluster + content which won't be written */ + if (bs->encrypted && +@@ -833,7 +833,7 @@ static int qcow_create(const char *filename, QemuOpts *opts, Error **errp) + + blk_set_allow_write_beyond_eof(qcow_blk, true); + +- ret = blk_truncate(qcow_blk, 0); ++ ret = blk_truncate(qcow_blk, 0, errp); + if (ret < 0) { + goto exit; + } +@@ -916,7 +916,7 @@ static int qcow_make_empty(BlockDriverState *bs) + if (bdrv_pwrite_sync(bs->file, s->l1_table_offset, s->l1_table, + l1_length) < 0) + return -1; +- ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length); ++ ret = bdrv_truncate(bs->file, s->l1_table_offset + l1_length, NULL); + if (ret < 0) + return ret; + +diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c +index 9e96f64..4efca7e 100644 +--- a/block/qcow2-refcount.c ++++ b/block/qcow2-refcount.c +@@ -1728,14 +1728,17 @@ static int check_refblocks(BlockDriverState *bs, BdrvCheckResult *res, + + if (fix & BDRV_FIX_ERRORS) { + int64_t new_nb_clusters; ++ Error *local_err = NULL; + + if (offset > INT64_MAX - s->cluster_size) { + ret = -EINVAL; + goto resize_fail; + } + +- ret = bdrv_truncate(bs->file, offset + s->cluster_size); ++ ret = bdrv_truncate(bs->file, offset + s->cluster_size, ++ &local_err); + if (ret < 0) { ++ error_report_err(local_err); + goto resize_fail; + } + size = bdrv_getlength(bs->file->bs); +diff --git a/block/qcow2.c b/block/qcow2.c +index 6a92d2e..845eee4 100644 +--- a/block/qcow2.c ++++ b/block/qcow2.c +@@ -2294,9 +2294,9 @@ static int qcow2_create2(const char *filename, int64_t total_size, + } + + /* Okay, now that we have a valid image, let's give it the right size */ +- ret = blk_truncate(blk, total_size); ++ ret = blk_truncate(blk, total_size, errp); + if (ret < 0) { +- error_setg_errno(errp, -ret, "Could not resize image"); ++ error_prepend(errp, "Could not resize image: "); + goto out; + } + +@@ -2584,7 +2584,7 @@ qcow2_co_pwritev_compressed(BlockDriverState *bs, uint64_t offset, + /* align end of file to a sector boundary to ease reading with + sector based I/Os */ + cluster_offset = bdrv_getlength(bs->file->bs); +- return bdrv_truncate(bs->file, cluster_offset); ++ return bdrv_truncate(bs->file, cluster_offset, NULL); + } + + buf = qemu_blockalign(bs, s->cluster_size); +@@ -2674,6 +2674,7 @@ fail: + static int make_completely_empty(BlockDriverState *bs) + { + BDRVQcow2State *s = bs->opaque; ++ Error *local_err = NULL; + int ret, l1_clusters; + int64_t offset; + uint64_t *new_reftable = NULL; +@@ -2798,8 +2799,10 @@ static int make_completely_empty(BlockDriverState *bs) + goto fail; + } + +- ret = bdrv_truncate(bs->file, (3 + l1_clusters) * s->cluster_size); ++ ret = bdrv_truncate(bs->file, (3 + l1_clusters) * s->cluster_size, ++ &local_err); + if (ret < 0) { ++ error_report_err(local_err); + goto fail; + } + +@@ -3273,9 +3276,10 @@ static int qcow2_amend_options(BlockDriverState *bs, QemuOpts *opts, + return ret; + } + +- ret = blk_truncate(blk, new_size); ++ ret = blk_truncate(blk, new_size, &local_err); + blk_unref(blk); + if (ret < 0) { ++ error_report_err(local_err); + return ret; + } + } +diff --git a/block/qed.c b/block/qed.c +index 5ec7fd8..53199ac 100644 +--- a/block/qed.c ++++ b/block/qed.c +@@ -635,7 +635,7 @@ static int qed_create(const char *filename, uint32_t cluster_size, + blk_set_allow_write_beyond_eof(blk, true); + + /* File must start empty and grow, check truncate is supported */ +- ret = blk_truncate(blk, 0); ++ ret = blk_truncate(blk, 0, errp); + if (ret < 0) { + goto out; + } +diff --git a/block/raw-format.c b/block/raw-format.c +index 86fbc65..a800733 100644 +--- a/block/raw-format.c ++++ b/block/raw-format.c +@@ -341,7 +341,7 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset) + + s->size = offset; + offset += s->offset; +- return bdrv_truncate(bs->file, offset); ++ return bdrv_truncate(bs->file, offset, NULL); + } + + static int raw_media_changed(BlockDriverState *bs) +diff --git a/block/vdi.c b/block/vdi.c +index 9b4f70e..d12d9cd 100644 +--- a/block/vdi.c ++++ b/block/vdi.c +@@ -832,9 +832,9 @@ static int vdi_create(const char *filename, QemuOpts *opts, Error **errp) + } + + if (image_type == VDI_TYPE_STATIC) { +- ret = blk_truncate(blk, offset + blocks * block_size); ++ ret = blk_truncate(blk, offset + blocks * block_size, errp); + if (ret < 0) { +- error_setg(errp, "Failed to statically allocate %s", filename); ++ error_prepend(errp, "Failed to statically allocate %s", filename); + goto exit; + } + } +diff --git a/block/vhdx-log.c b/block/vhdx-log.c +index 67a91c0..3f4c2aa 100644 +--- a/block/vhdx-log.c ++++ b/block/vhdx-log.c +@@ -548,7 +548,7 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, + if (new_file_size % (1024*1024)) { + /* round up to nearest 1MB boundary */ + new_file_size = ((new_file_size >> 20) + 1) << 20; +- bdrv_truncate(bs->file, new_file_size); ++ bdrv_truncate(bs->file, new_file_size, NULL); + } + } + qemu_vfree(desc_entries); +diff --git a/block/vhdx.c b/block/vhdx.c +index d25bcd9..e8fe3fb 100644 +--- a/block/vhdx.c ++++ b/block/vhdx.c +@@ -1171,7 +1171,7 @@ static int vhdx_allocate_block(BlockDriverState *bs, BDRVVHDXState *s, + /* per the spec, the address for a block is in units of 1MB */ + *new_offset = ROUND_UP(*new_offset, 1024 * 1024); + +- return bdrv_truncate(bs->file, *new_offset + s->block_size); ++ return bdrv_truncate(bs->file, *new_offset + s->block_size, NULL); + } + + /* +@@ -1607,17 +1607,13 @@ static int vhdx_create_bat(BlockBackend *blk, BDRVVHDXState *s, + if (type == VHDX_TYPE_DYNAMIC) { + /* All zeroes, so we can just extend the file - the end of the BAT + * is the furthest thing we have written yet */ +- ret = blk_truncate(blk, data_file_offset); ++ ret = blk_truncate(blk, data_file_offset, errp); + if (ret < 0) { +- error_setg_errno(errp, -ret, +- "Failed to resize the underlying file"); + goto exit; + } + } else if (type == VHDX_TYPE_FIXED) { +- ret = blk_truncate(blk, data_file_offset + image_size); ++ ret = blk_truncate(blk, data_file_offset + image_size, errp); + if (ret < 0) { +- error_setg_errno(errp, -ret, +- "Failed to resize the underlying file"); + goto exit; + } + } else { +diff --git a/block/vmdk.c b/block/vmdk.c +index a9bd22b..c61b9cc 100644 +--- a/block/vmdk.c ++++ b/block/vmdk.c +@@ -1714,10 +1714,7 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, + blk_set_allow_write_beyond_eof(blk, true); + + if (flat) { +- ret = blk_truncate(blk, filesize); +- if (ret < 0) { +- error_setg_errno(errp, -ret, "Could not truncate file"); +- } ++ ret = blk_truncate(blk, filesize, errp); + goto exit; + } + magic = cpu_to_be32(VMDK4_MAGIC); +@@ -1780,9 +1777,8 @@ static int vmdk_create_extent(const char *filename, int64_t filesize, + goto exit; + } + +- ret = blk_truncate(blk, le64_to_cpu(header.grain_offset) << 9); ++ ret = blk_truncate(blk, le64_to_cpu(header.grain_offset) << 9, errp); + if (ret < 0) { +- error_setg_errno(errp, -ret, "Could not truncate file"); + goto exit; + } + +@@ -2090,10 +2086,7 @@ static int vmdk_create(const char *filename, QemuOpts *opts, Error **errp) + /* bdrv_pwrite write padding zeros to align to sector, we don't need that + * for description file */ + if (desc_offset == 0) { +- ret = blk_truncate(new_blk, desc_len); +- if (ret < 0) { +- error_setg_errno(errp, -ret, "Could not truncate file"); +- } ++ ret = blk_truncate(new_blk, desc_len, errp); + } + exit: + if (new_blk) { +diff --git a/block/vpc.c b/block/vpc.c +index f591d4b..ecfee77 100644 +--- a/block/vpc.c ++++ b/block/vpc.c +@@ -851,20 +851,21 @@ static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, + } + + static int create_fixed_disk(BlockBackend *blk, uint8_t *buf, +- int64_t total_size) ++ int64_t total_size, Error **errp) + { + int ret; + + /* Add footer to total size */ + total_size += HEADER_SIZE; + +- ret = blk_truncate(blk, total_size); ++ ret = blk_truncate(blk, total_size, errp); + if (ret < 0) { + return ret; + } + + ret = blk_pwrite(blk, total_size - HEADER_SIZE, buf, HEADER_SIZE, 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Unable to write VHD header"); + return ret; + } + +@@ -996,11 +997,11 @@ static int vpc_create(const char *filename, QemuOpts *opts, Error **errp) + + if (disk_type == VHD_DYNAMIC) { + ret = create_dynamic_disk(blk, buf, total_sectors); ++ if (ret < 0) { ++ error_setg(errp, "Unable to create or write VHD header"); ++ } + } else { +- ret = create_fixed_disk(blk, buf, total_size); +- } +- if (ret < 0) { +- error_setg(errp, "Unable to create or write VHD header"); ++ ret = create_fixed_disk(blk, buf, total_size, errp); + } + + out: +diff --git a/blockdev.c b/blockdev.c +index 033c3fd..6a50742 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -2975,26 +2975,7 @@ void qmp_block_resize(bool has_device, const char *device, + /* complete all in-flight operations before resizing the device */ + bdrv_drain_all(); + +- ret = blk_truncate(blk, size); +- switch (ret) { +- case 0: +- break; +- case -ENOMEDIUM: +- error_setg(errp, QERR_DEVICE_HAS_NO_MEDIUM, device); +- break; +- case -ENOTSUP: +- error_setg(errp, QERR_UNSUPPORTED); +- break; +- case -EACCES: +- error_setg(errp, "Device '%s' is read only", device); +- break; +- case -EBUSY: +- error_setg(errp, QERR_DEVICE_IN_USE, device); +- break; +- default: +- error_setg_errno(errp, -ret, "Could not resize"); +- break; +- } ++ ret = blk_truncate(blk, size, errp); + + out: + blk_unref(blk); +diff --git a/include/block/block.h b/include/block/block.h +index 56b27fb..54b70ee 100644 +--- a/include/block/block.h ++++ b/include/block/block.h +@@ -294,7 +294,7 @@ BlockDriverState *bdrv_find_backing_image(BlockDriverState *bs, + const char *backing_file); + int bdrv_get_backing_file_depth(BlockDriverState *bs); + void bdrv_refresh_filename(BlockDriverState *bs); +-int bdrv_truncate(BdrvChild *child, int64_t offset); ++int bdrv_truncate(BdrvChild *child, int64_t offset, Error **errp); + int64_t bdrv_nb_sectors(BlockDriverState *bs); + int64_t bdrv_getlength(BlockDriverState *bs); + int64_t bdrv_get_allocated_file_size(BlockDriverState *bs); +diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h +index 7462228..0ba4e27 100644 +--- a/include/sysemu/block-backend.h ++++ b/include/sysemu/block-backend.h +@@ -225,7 +225,7 @@ int coroutine_fn blk_co_pwrite_zeroes(BlockBackend *blk, int64_t offset, + int count, BdrvRequestFlags flags); + int blk_pwrite_compressed(BlockBackend *blk, int64_t offset, const void *buf, + int count); +-int blk_truncate(BlockBackend *blk, int64_t offset); ++int blk_truncate(BlockBackend *blk, int64_t offset, Error **errp); + int blk_pdiscard(BlockBackend *blk, int64_t offset, int count); + int blk_save_vmstate(BlockBackend *blk, const uint8_t *buf, + int64_t pos, int size); +diff --git a/qemu-img.c b/qemu-img.c +index b220cf7..37c2894 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -3500,20 +3500,11 @@ static int img_resize(int argc, char **argv) + goto out; + } + +- ret = blk_truncate(blk, total_size); +- switch (ret) { +- case 0: ++ ret = blk_truncate(blk, total_size, &err); ++ if (!ret) { + qprintf(quiet, "Image resized.\n"); +- break; +- case -ENOTSUP: +- error_report("This image does not support resize"); +- break; +- case -EACCES: +- error_report("Image is read-only"); +- break; +- default: +- error_report("Error resizing image: %s", strerror(-ret)); +- break; ++ } else { ++ error_report_err(err); + } + out: + blk_unref(blk); +diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c +index 312fc6d..21af9e6 100644 +--- a/qemu-io-cmds.c ++++ b/qemu-io-cmds.c +@@ -1567,6 +1567,7 @@ static const cmdinfo_t flush_cmd = { + + static int truncate_f(BlockBackend *blk, int argc, char **argv) + { ++ Error *local_err = NULL; + int64_t offset; + int ret; + +@@ -1576,9 +1577,9 @@ static int truncate_f(BlockBackend *blk, int argc, char **argv) + return 0; + } + +- ret = blk_truncate(blk, offset); ++ ret = blk_truncate(blk, offset, &local_err); + if (ret < 0) { +- printf("truncate: %s\n", strerror(-ret)); ++ error_report_err(local_err); + return 0; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-An-empty-filename-counts-as-no-filename.patch b/SOURCES/kvm-block-An-empty-filename-counts-as-no-filename.patch new file mode 100644 index 0000000..3045764 --- /dev/null +++ b/SOURCES/kvm-block-An-empty-filename-counts-as-no-filename.patch @@ -0,0 +1,57 @@ +From 010ef312704884412f63b1d6bcb308a766f21f6a Mon Sep 17 00:00:00 2001 +From: Max Reitz +Date: Fri, 19 May 2017 14:29:46 +0200 +Subject: [PATCH 26/27] block: An empty filename counts as no filename +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Max Reitz +Message-id: <20170519142946.22012-2-mreitz@redhat.com> +Patchwork-id: 75383 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] block: An empty filename counts as no filename +Bugzilla: 1452702 +RH-Acked-by: Kevin Wolf +RH-Acked-by: Wei Huang +RH-Acked-by: Jeffrey Cody + +Reproducer: + $ ./qemu-img info '' + qemu-img: ./block.c:1008: bdrv_open_driver: Assertion + `!drv->bdrv_needs_filename || bs->filename[0]' failed. + [1] 26105 abort (core dumped) ./qemu-img info '' + +This patch fixes this to be: + $ ./qemu-img info '' + qemu-img: Could not open '': The 'file' block driver requires a file + name + +Cc: qemu-stable +Signed-off-by: Max Reitz +Reviewed-by: Eric Blake +Reviewed-by: Fam Zheng +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: Kevin Wolf +(cherry picked from commit 4a0082401a770261b85625a41eef4a4e89ad7a74) +Signed-off-by: Max Reitz +Signed-off-by: Miroslav Rezanina +--- + block.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/block.c b/block.c +index 6201991..5bc0504 100644 +--- a/block.c ++++ b/block.c +@@ -1204,7 +1204,7 @@ static int bdrv_open_common(BlockDriverState *bs, BlockBackend *file, + filename = qdict_get_try_str(options, "filename"); + } + +- if (drv->bdrv_needs_filename && !filename) { ++ if (drv->bdrv_needs_filename && (!filename || !filename[0])) { + error_setg(errp, "The '%s' block driver requires a file name", + drv->format_name); + ret = -EINVAL; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-Do-not-unref-bs-file-on-error-in-BD-s-open.patch b/SOURCES/kvm-block-Do-not-unref-bs-file-on-error-in-BD-s-open.patch new file mode 100644 index 0000000..352a8b5 --- /dev/null +++ b/SOURCES/kvm-block-Do-not-unref-bs-file-on-error-in-BD-s-open.patch @@ -0,0 +1,90 @@ +From 564521b7f134594c3fa42e0e1335f296848ced6a Mon Sep 17 00:00:00 2001 +From: Max Reitz +Date: Fri, 19 May 2017 14:58:00 +0200 +Subject: [PATCH 27/27] block: Do not unref bs->file on error in BD's open + +RH-Author: Max Reitz +Message-id: <20170519145800.28315-2-mreitz@redhat.com> +Patchwork-id: 75385 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] block: Do not unref bs->file on error in BD's open +Bugzilla: 1452752 +RH-Acked-by: John Snow +RH-Acked-by: Fam Zheng +RH-Acked-by: Thomas Huth + +The block layer takes care of removing the bs->file child if the block +driver's bdrv_open()/bdrv_file_open() implementation fails. The block +driver therefore does not need to do so, and indeed should not unless it +sets bs->file to NULL afterwards -- because if this is not done, the +bdrv_unref_child() in bdrv_open_inherit() will dereference the freed +memory block at bs->file afterwards, which is not good. + +We can now decide whether to add a "bs->file = NULL;" after each of the +offending bdrv_unref_child() invocations, or just drop them altogether. +The latter is simpler, so let's do that. + +Cc: qemu-stable +Signed-off-by: Max Reitz +Reviewed-by: Eric Blake +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Kevin Wolf +(cherry picked from commit de234897b60e034ba94b307fc289e2dc692c9251) +Signed-off-by: Max Reitz +Signed-off-by: Miroslav Rezanina +--- + block/blkdebug.c | 4 +--- + block/blkreplay.c | 3 --- + block/blkverify.c | 3 --- + 3 files changed, 1 insertion(+), 9 deletions(-) + +diff --git a/block/blkdebug.c b/block/blkdebug.c +index 15a9966..9bd066e 100644 +--- a/block/blkdebug.c ++++ b/block/blkdebug.c +@@ -389,14 +389,12 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, + } else if (align) { + error_setg(errp, "Invalid alignment"); + ret = -EINVAL; +- goto fail_unref; ++ goto out; + } + + ret = 0; + goto out; + +-fail_unref: +- bdrv_unref_child(bs, bs->file); + out: + if (ret < 0) { + g_free(s->config_file); +diff --git a/block/blkreplay.c b/block/blkreplay.c +index e110211..6aa5fd4 100755 +--- a/block/blkreplay.c ++++ b/block/blkreplay.c +@@ -37,9 +37,6 @@ static int blkreplay_open(BlockDriverState *bs, QDict *options, int flags, + + ret = 0; + fail: +- if (ret < 0) { +- bdrv_unref_child(bs, bs->file); +- } + return ret; + } + +diff --git a/block/blkverify.c b/block/blkverify.c +index 9a1e21c..af23281 100644 +--- a/block/blkverify.c ++++ b/block/blkverify.c +@@ -142,9 +142,6 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, + + ret = 0; + fail: +- if (ret < 0) { +- bdrv_unref_child(bs, bs->file); +- } + qemu_opts_del(opts); + return ret; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-Reuse-bs-as-backing-hd-for-drive-backup-sync-n.patch b/SOURCES/kvm-block-Reuse-bs-as-backing-hd-for-drive-backup-sync-n.patch new file mode 100644 index 0000000..05b3148 --- /dev/null +++ b/SOURCES/kvm-block-Reuse-bs-as-backing-hd-for-drive-backup-sync-n.patch @@ -0,0 +1,92 @@ +From 7e36f6ce772d6aedad81c6e8d4cd3c5100a57369 Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Thu, 18 May 2017 10:02:17 +0200 +Subject: [PATCH 18/27] block: Reuse bs as backing hd for drive-backup + sync=none + +RH-Author: Fam Zheng +Message-id: <20170518100217.15981-2-famz@redhat.com> +Patchwork-id: 75310 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] block: Reuse bs as backing hd for drive-backup sync=none +Bugzilla: 1452066 +RH-Acked-by: Kevin Wolf +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +Opening the backing image for the second time is bad, especially here +when it is also in use as the active image as the source. The +drive-backup job itself doesn't read from target->backing for COW, +instead it gets data from the write notifier, so it's not a big problem. +However, exporting the target to NBD etc. won't work, because of the +likely stale metadata cache. + +Use BDRV_O_NO_BACKING in this case and manually set up the backing +BdrvChild. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Fam Zheng +Signed-off-by: Kevin Wolf +(cherry picked from commit fc0932fdcfc3e5cafa3641e361b681c07f639812) +Signed-off-by: Fam Zheng + +Context conflict because downstream doesn't have the new +qdict_put_str(), which conversion happened in 46f5ac205a9d (qobject: Use +simpler QDict/QList scalar insertion macros). Note that specific hunk is +a superfluous change in the upstream commit, but let's follow suit to +reduce future conflict. + +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/blockdev.c b/blockdev.c +index b0894fa..4432143 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -3199,6 +3199,7 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, + Error *local_err = NULL; + int flags; + int64_t size; ++ bool set_backing_hd = false; + + if (!backup->has_speed) { + backup->speed = 0; +@@ -3249,6 +3250,8 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, + } + if (backup->sync == MIRROR_SYNC_MODE_NONE) { + source = bs; ++ flags |= BDRV_O_NO_BACKING; ++ set_backing_hd = true; + } + + size = bdrv_getlength(bs); +@@ -3275,7 +3278,9 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, + } + + if (backup->format) { +- options = qdict_new(); ++ if (!options) { ++ options = qdict_new(); ++ } + qdict_put(options, "driver", qstring_from_str(backup->format)); + } + +@@ -3286,6 +3291,14 @@ static BlockJob *do_drive_backup(DriveBackup *backup, BlockJobTxn *txn, + + bdrv_set_aio_context(target_bs, aio_context); + ++ if (set_backing_hd) { ++ bdrv_set_backing_hd(target_bs, source, &local_err); ++ if (local_err) { ++ bdrv_unref(target_bs); ++ goto out; ++ } ++ } ++ + if (backup->has_bitmap) { + bmap = bdrv_find_dirty_bitmap(bs, backup->bitmap); + if (!bmap) { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-add-bdrv_set_read_only-helper-function.patch b/SOURCES/kvm-block-add-bdrv_set_read_only-helper-function.patch new file mode 100644 index 0000000..c9cc011 --- /dev/null +++ b/SOURCES/kvm-block-add-bdrv_set_read_only-helper-function.patch @@ -0,0 +1,138 @@ +From e9c5d55aa2132484144d231261d128f57e7ec9dd Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:48 +0200 +Subject: [PATCH 02/11] block: add bdrv_set_read_only() helper function + +RH-Author: Jeffrey Cody +Message-id: <90cc08632a1a1a4b57830ba63f430506952dd49c.1493236824.git.jcody@redhat.com> +Patchwork-id: 74895 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 1/8] block: add bdrv_set_read_only() helper function +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +We have a helper wrapper for checking for the BDS read_only flag, +add a helper wrapper to set the read_only flag as well. + +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Jeff Cody +Reviewed-by: John Snow +Message-id: 9b18972d05f5fa2ac16c014f0af98d680553048d.1491597120.git.jcody@redhat.com +(cherry picked from commit fe5241bfe3fb61ec3f589ceacd91c1469bfd400f) +Signed-off-by: Miroslav Rezanina +--- + block.c | 5 +++++ + block/bochs.c | 2 +- + block/cloop.c | 2 +- + block/dmg.c | 2 +- + block/rbd.c | 2 +- + block/vvfat.c | 4 ++-- + include/block/block.h | 1 + + 7 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/block.c b/block.c +index 1fbbb8d..25a4cfd 100644 +--- a/block.c ++++ b/block.c +@@ -192,6 +192,11 @@ void path_combine(char *dest, int dest_size, + } + } + ++void bdrv_set_read_only(BlockDriverState *bs, bool read_only) ++{ ++ bs->read_only = read_only; ++} ++ + void bdrv_get_full_backing_filename_from_filename(const char *backed, + const char *backing, + char *dest, size_t sz, +diff --git a/block/bochs.c b/block/bochs.c +index 516da56..bdc2831 100644 +--- a/block/bochs.c ++++ b/block/bochs.c +@@ -110,7 +110,7 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, + return -EINVAL; + } + +- bs->read_only = true; /* no write support yet */ ++ bdrv_set_read_only(bs, true); /* no write support yet */ + + ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)); + if (ret < 0) { +diff --git a/block/cloop.c b/block/cloop.c +index a6c7b9d..11f17c8 100644 +--- a/block/cloop.c ++++ b/block/cloop.c +@@ -72,7 +72,7 @@ static int cloop_open(BlockDriverState *bs, QDict *options, int flags, + return -EINVAL; + } + +- bs->read_only = true; ++ bdrv_set_read_only(bs, true); + + /* read header */ + ret = bdrv_pread(bs->file, 128, &s->block_size, 4); +diff --git a/block/dmg.c b/block/dmg.c +index a7d25fc..27ce4a6 100644 +--- a/block/dmg.c ++++ b/block/dmg.c +@@ -420,7 +420,7 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags, + } + + block_module_load_one("dmg-bz2"); +- bs->read_only = true; ++ bdrv_set_read_only(bs, true); + + s->n_chunks = 0; + s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL; +diff --git a/block/rbd.c b/block/rbd.c +index 1ceeeb5..6ad2904 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -641,7 +641,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + goto failed_open; + } + +- bs->read_only = (s->snap != NULL); ++ bdrv_set_read_only(bs, (s->snap != NULL)); + + qemu_opts_del(opts); + return 0; +diff --git a/block/vvfat.c b/block/vvfat.c +index af5153d..d4ce6d7 100644 +--- a/block/vvfat.c ++++ b/block/vvfat.c +@@ -1157,7 +1157,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, + s->current_cluster=0xffffffff; + + /* read only is the default for safety */ +- bs->read_only = true; ++ bdrv_set_read_only(bs, true); + s->qcow = NULL; + s->qcow_filename = NULL; + s->fat2 = NULL; +@@ -1173,7 +1173,7 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, + if (ret < 0) { + goto fail; + } +- bs->read_only = false; ++ bdrv_set_read_only(bs, false); + } + + bs->total_sectors = cyls * heads * secs; +diff --git a/include/block/block.h b/include/block/block.h +index 5ddc0cf..16eb909 100644 +--- a/include/block/block.h ++++ b/include/block/block.h +@@ -434,6 +434,7 @@ int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base, + int64_t sector_num, int nb_sectors, int *pnum); + + bool bdrv_is_read_only(BlockDriverState *bs); ++void bdrv_set_read_only(BlockDriverState *bs, bool read_only); + bool bdrv_is_sg(BlockDriverState *bs); + bool bdrv_is_inserted(BlockDriverState *bs); + int bdrv_media_changed(BlockDriverState *bs); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-code-movement.patch b/SOURCES/kvm-block-code-movement.patch new file mode 100644 index 0000000..a429565 --- /dev/null +++ b/SOURCES/kvm-block-code-movement.patch @@ -0,0 +1,57 @@ +From 8221af076858e65c0a9ae1b4391abb5db9df378a Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:51 +0200 +Subject: [PATCH 05/11] block: code movement + +RH-Author: Jeffrey Cody +Message-id: +Patchwork-id: 74899 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 4/8] block: code movement +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +Move bdrv_is_read_only() up with its friends. + +Reviewed-by: Stefan Hajnoczi +Reviewed-by: John Snow +Signed-off-by: Jeff Cody +Message-id: 73b2399459760c32506f9407efb9dddb3a2789de.1491597120.git.jcody@redhat.com +(cherry picked from commit 93ed524e3de732f70b3b042e3c56bc4ed719498d) +Signed-off-by: Miroslav Rezanina +--- + block.c | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/block.c b/block.c +index b74d445..bf09026 100644 +--- a/block.c ++++ b/block.c +@@ -192,6 +192,11 @@ void path_combine(char *dest, int dest_size, + } + } + ++bool bdrv_is_read_only(BlockDriverState *bs) ++{ ++ return bs->read_only; ++} ++ + int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) + { + /* Do not set read_only if copy_on_read is enabled */ +@@ -3375,11 +3380,6 @@ void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr) + *nb_sectors_ptr = nb_sectors < 0 ? 0 : nb_sectors; + } + +-bool bdrv_is_read_only(BlockDriverState *bs) +-{ +- return bs->read_only; +-} +- + bool bdrv_is_sg(BlockDriverState *bs) + { + return bs->sg; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-do-not-set-BDS-read_only-if-copy_on_read-enabl.patch b/SOURCES/kvm-block-do-not-set-BDS-read_only-if-copy_on_read-enabl.patch new file mode 100644 index 0000000..d908fed --- /dev/null +++ b/SOURCES/kvm-block-do-not-set-BDS-read_only-if-copy_on_read-enabl.patch @@ -0,0 +1,206 @@ +From 04ecb169e46d027d3c5ac0ec2277e10065fa8c9c Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:49 +0200 +Subject: [PATCH 03/11] block: do not set BDS read_only if copy_on_read enabled + +RH-Author: Jeffrey Cody +Message-id: +Patchwork-id: 74897 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 2/8] block: do not set BDS read_only if copy_on_read enabled +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +A few block drivers will set the BDS read_only flag from their +.bdrv_open() function. This means the bs->read_only flag could +be set after we enable copy_on_read, as the BDRV_O_COPY_ON_READ +flag check occurs prior to the call to bdrv->bdrv_open(). + +This adds an error return to bdrv_set_read_only(), and an error will be +return if we try to set the BDS to read_only while copy_on_read is +enabled. + +This patch also changes the behavior of vvfat. Before, vvfat could +override the drive 'readonly' flag with its own, internal 'rw' flag. + +For instance, this -drive parameter would result in a writable image: + +"-drive format=vvfat,dir=/tmp/vvfat,rw,if=virtio,readonly=on" + +This is not correct. Now, attempting to use the above -drive parameter +will result in an error (i.e., 'rw' is incompatible with 'readonly=on'). + +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Reviewed-by: John Snow +Message-id: 0c5b4c1cc2c651471b131f21376dfd5ea24d2196.1491597120.git.jcody@redhat.com +(cherry picked from commit e2b8247a322cd92945785edf25f09e6b3e8285f9) +Signed-off-by: Miroslav Rezanina +--- + block.c | 10 +++++++++- + block/bochs.c | 5 ++++- + block/cloop.c | 5 ++++- + block/dmg.c | 6 +++++- + block/rbd.c | 11 ++++++++++- + block/vvfat.c | 19 +++++++++++++++---- + include/block/block.h | 2 +- + 7 files changed, 48 insertions(+), 10 deletions(-) + +diff --git a/block.c b/block.c +index 25a4cfd..4766b8a 100644 +--- a/block.c ++++ b/block.c +@@ -192,9 +192,17 @@ void path_combine(char *dest, int dest_size, + } + } + +-void bdrv_set_read_only(BlockDriverState *bs, bool read_only) ++int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) + { ++ /* Do not set read_only if copy_on_read is enabled */ ++ if (bs->copy_on_read && read_only) { ++ error_setg(errp, "Can't set node '%s' to r/o with copy-on-read enabled", ++ bdrv_get_device_or_node_name(bs)); ++ return -EINVAL; ++ } ++ + bs->read_only = read_only; ++ return 0; + } + + void bdrv_get_full_backing_filename_from_filename(const char *backed, +diff --git a/block/bochs.c b/block/bochs.c +index bdc2831..a759b6e 100644 +--- a/block/bochs.c ++++ b/block/bochs.c +@@ -110,7 +110,10 @@ static int bochs_open(BlockDriverState *bs, QDict *options, int flags, + return -EINVAL; + } + +- bdrv_set_read_only(bs, true); /* no write support yet */ ++ ret = bdrv_set_read_only(bs, true, errp); /* no write support yet */ ++ if (ret < 0) { ++ return ret; ++ } + + ret = bdrv_pread(bs->file, 0, &bochs, sizeof(bochs)); + if (ret < 0) { +diff --git a/block/cloop.c b/block/cloop.c +index 11f17c8..d6597fc 100644 +--- a/block/cloop.c ++++ b/block/cloop.c +@@ -72,7 +72,10 @@ static int cloop_open(BlockDriverState *bs, QDict *options, int flags, + return -EINVAL; + } + +- bdrv_set_read_only(bs, true); ++ ret = bdrv_set_read_only(bs, true, errp); ++ if (ret < 0) { ++ return ret; ++ } + + /* read header */ + ret = bdrv_pread(bs->file, 128, &s->block_size, 4); +diff --git a/block/dmg.c b/block/dmg.c +index 27ce4a6..900ae5a 100644 +--- a/block/dmg.c ++++ b/block/dmg.c +@@ -419,8 +419,12 @@ static int dmg_open(BlockDriverState *bs, QDict *options, int flags, + return -EINVAL; + } + ++ ret = bdrv_set_read_only(bs, true, errp); ++ if (ret < 0) { ++ return ret; ++ } ++ + block_module_load_one("dmg-bz2"); +- bdrv_set_read_only(bs, true); + + s->n_chunks = 0; + s->offsets = s->lengths = s->sectors = s->sectorcounts = NULL; +diff --git a/block/rbd.c b/block/rbd.c +index 6ad2904..1c43171 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -635,13 +635,22 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + goto failed_shutdown; + } + ++ /* rbd_open is always r/w */ + r = rbd_open(s->io_ctx, s->name, &s->image, s->snap); + if (r < 0) { + error_setg_errno(errp, -r, "error reading header from %s", s->name); + goto failed_open; + } + +- bdrv_set_read_only(bs, (s->snap != NULL)); ++ /* If we are using an rbd snapshot, we must be r/o, otherwise ++ * leave as-is */ ++ if (s->snap != NULL) { ++ r = bdrv_set_read_only(bs, true, &local_err); ++ if (r < 0) { ++ error_propagate(errp, local_err); ++ goto failed_open; ++ } ++ } + + qemu_opts_del(opts); + return 0; +diff --git a/block/vvfat.c b/block/vvfat.c +index d4ce6d7..b509d55 100644 +--- a/block/vvfat.c ++++ b/block/vvfat.c +@@ -1156,8 +1156,6 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, + + s->current_cluster=0xffffffff; + +- /* read only is the default for safety */ +- bdrv_set_read_only(bs, true); + s->qcow = NULL; + s->qcow_filename = NULL; + s->fat2 = NULL; +@@ -1169,11 +1167,24 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, + s->sector_count = cyls * heads * secs - (s->first_sectors_number - 1); + + if (qemu_opt_get_bool(opts, "rw", false)) { +- ret = enable_write_target(bs, errp); ++ if (!bdrv_is_read_only(bs)) { ++ ret = enable_write_target(bs, errp); ++ if (ret < 0) { ++ goto fail; ++ } ++ } else { ++ ret = -EPERM; ++ error_setg(errp, ++ "Unable to set VVFAT to 'rw' when drive is read-only"); ++ goto fail; ++ } ++ } else { ++ /* read only is the default for safety */ ++ ret = bdrv_set_read_only(bs, true, &local_err); + if (ret < 0) { ++ error_propagate(errp, local_err); + goto fail; + } +- bdrv_set_read_only(bs, false); + } + + bs->total_sectors = cyls * heads * secs; +diff --git a/include/block/block.h b/include/block/block.h +index 16eb909..3525590 100644 +--- a/include/block/block.h ++++ b/include/block/block.h +@@ -434,7 +434,7 @@ int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base, + int64_t sector_num, int nb_sectors, int *pnum); + + bool bdrv_is_read_only(BlockDriverState *bs); +-void bdrv_set_read_only(BlockDriverState *bs, bool read_only); ++int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp); + bool bdrv_is_sg(BlockDriverState *bs); + bool bdrv_is_inserted(BlockDriverState *bs); + int bdrv_media_changed(BlockDriverState *bs); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-fix-external-snapshot-abort-permission-error.patch b/SOURCES/kvm-block-fix-external-snapshot-abort-permission-error.patch new file mode 100644 index 0000000..f4bb6fc --- /dev/null +++ b/SOURCES/kvm-block-fix-external-snapshot-abort-permission-error.patch @@ -0,0 +1,51 @@ +From 1ffa7d12a15fdc4f1bbed59bf5d3292ac2b574b3 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 12 Jun 2017 14:46:56 +0200 +Subject: [PATCH 11/13] block: fix external snapshot abort permission error + +RH-Author: Jeffrey Cody +Message-id: <14e6e82657b93fb6bec16eddce051ced36db5ff9.1497278737.git.jcody@redhat.com> +Patchwork-id: 75593 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH 1/1] block: fix external snapshot abort permission error +Bugzilla: 1447184 +RH-Acked-by: Kevin Wolf +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +In external_snapshot_abort(), we try to undo what was done in +external_snapshot_prepare() calling bdrv_replace_node() to swap the +nodes back. However, we receive a permissions error as writers are +blocked on the old node, which is now the new node backing file. + +An easy fix (initially suggested by Kevin Wolf) is to call +bdrv_set_backing_hd() on the new node, to set the backing node to NULL. + +Signed-off-by: Jeff Cody +Reviewed-by: Eric Blake +Signed-off-by: Kevin Wolf +(cherry picked from commit 719fc28c80a22ab9f1533d775bae09c14442bbbe) +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/blockdev.c b/blockdev.c +index 4432143..a3a0731 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -1847,7 +1847,11 @@ static void external_snapshot_abort(BlkActionState *common) + DO_UPCAST(ExternalSnapshotState, common, common); + if (state->new_bs) { + if (state->overlay_appended) { ++ bdrv_ref(state->old_bs); /* we can't let bdrv_set_backind_hd() ++ close state->old_bs; we need it */ ++ bdrv_set_backing_hd(state->new_bs, NULL, &error_abort); + bdrv_replace_node(state->new_bs, state->old_bs, &error_abort); ++ bdrv_unref(state->old_bs); /* bdrv_replace_node() ref'ed old_bs */ + } + } + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-gluster-glfs_lseek-workaround.patch b/SOURCES/kvm-block-gluster-glfs_lseek-workaround.patch new file mode 100644 index 0000000..ff5ca7c --- /dev/null +++ b/SOURCES/kvm-block-gluster-glfs_lseek-workaround.patch @@ -0,0 +1,118 @@ +From 9df594fcb09af8318fa5d0abc32fd5dddbeb4ce3 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Tue, 30 May 2017 20:18:21 +0200 +Subject: [PATCH 02/13] block/gluster: glfs_lseek() workaround + +RH-Author: Jeffrey Cody +Message-id: <2fe278e911ea53cdc0d24b547ed3012c0dbedbb9.1496175329.git.jcody@redhat.com> +Patchwork-id: 75436 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH v2] block/gluster: glfs_lseek() workaround +Bugzilla: 1451191 +RH-Acked-by: Eric Blake +RH-Acked-by: Laurent Vivier +RH-Acked-by: Stefan Hajnoczi + +On current released versions of glusterfs, glfs_lseek() will sometimes +return invalid values for SEEK_DATA or SEEK_HOLE. For SEEK_DATA and +SEEK_HOLE, the returned value should be >= the passed offset, or < 0 in +the case of error: + +LSEEK(2): + + off_t lseek(int fd, off_t offset, int whence); + + [...] + + SEEK_HOLE + Adjust the file offset to the next hole in the file greater + than or equal to offset. If offset points into the middle of + a hole, then the file offset is set to offset. If there is no + hole past offset, then the file offset is adjusted to the end + of the file (i.e., there is an implicit hole at the end of + any file). + + [...] + + RETURN VALUE + Upon successful completion, lseek() returns the resulting + offset location as measured in bytes from the beginning of the + file. On error, the value (off_t) -1 is returned and errno is + set to indicate the error + +However, occasionally glfs_lseek() for SEEK_HOLE/DATA will return a +value less than the passed offset, yet greater than zero. + +For instance, here are example values observed from this call: + + offs = glfs_lseek(s->fd, start, SEEK_HOLE); + if (offs < 0) { + return -errno; /* D1 and (H3 or H4) */ + } + +start == 7608336384 +offs == 7607877632 + +This causes QEMU to abort on the assert test. When this value is +returned, errno is also 0. + +This is a reported and known bug to glusterfs: +https://bugzilla.redhat.com/show_bug.cgi?id=1425293 + +Although this is being fixed in gluster, we still should work around it +in QEMU, given that multiple released versions of gluster behave this +way. + +This patch treats the return case of (offs < start) the same as if an +error value other than ENXIO is returned; we will assume we learned +nothing, and there are no holes in the file. + +Signed-off-by: Jeff Cody +Reviewed-by: Eric Blake +Reviewed-by: Niels de Vos +Message-id: 87c0140e9407c08f6e74b04131b610f2e27c014c.1495560397.git.jcody@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 223a23c198787328ae75bc65d84edf5fde33c0b6) +Signed-off-by: Miroslav Rezanina +--- + block/gluster.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) + +diff --git a/block/gluster.c b/block/gluster.c +index cf29b5f..6ea91ef 100644 +--- a/block/gluster.c ++++ b/block/gluster.c +@@ -1272,7 +1272,14 @@ static int find_allocation(BlockDriverState *bs, off_t start, + if (offs < 0) { + return -errno; /* D3 or D4 */ + } +- assert(offs >= start); ++ ++ if (offs < start) { ++ /* This is not a valid return by lseek(). We are safe to just return ++ * -EIO in this case, and we'll treat it like D4. Unfortunately some ++ * versions of gluster server will return offs < start, so an assert ++ * here will unnecessarily abort QEMU. */ ++ return -EIO; ++ } + + if (offs > start) { + /* D2: in hole, next data at offs */ +@@ -1304,7 +1311,14 @@ static int find_allocation(BlockDriverState *bs, off_t start, + if (offs < 0) { + return -errno; /* D1 and (H3 or H4) */ + } +- assert(offs >= start); ++ ++ if (offs < start) { ++ /* This is not a valid return by lseek(). We are safe to just return ++ * -EIO in this case, and we'll treat it like H4. Unfortunately some ++ * versions of gluster server will return offs < start, so an assert ++ * here will unnecessarily abort QEMU. */ ++ return -EIO; ++ } + + if (offs > start) { + /* +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-honor-BDRV_O_ALLOW_RDWR-when-clearing-bs-read_.patch b/SOURCES/kvm-block-honor-BDRV_O_ALLOW_RDWR-when-clearing-bs-read_.patch new file mode 100644 index 0000000..197b661 --- /dev/null +++ b/SOURCES/kvm-block-honor-BDRV_O_ALLOW_RDWR-when-clearing-bs-read_.patch @@ -0,0 +1,51 @@ +From 1bd388d808de32139d2a642d68d55793a22cbc48 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:50 +0200 +Subject: [PATCH 04/11] block: honor BDRV_O_ALLOW_RDWR when clearing + bs->read_only + +RH-Author: Jeffrey Cody +Message-id: <7b5c2f86cb3988c2365e53d47d54d469dcb5ab2f.1493236824.git.jcody@redhat.com> +Patchwork-id: 74898 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 3/8] block: honor BDRV_O_ALLOW_RDWR when clearing bs->read_only +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +The BDRV_O_ALLOW_RDWR flag allows / prohibits the changing of +the BDS 'read_only' state, but there are a few places where it +is ignored. In the bdrv_set_read_only() helper, make sure to +honor the flag. + +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Reviewed-by: John Snow +Message-id: be2e5fb2d285cbece2b6d06bed54a6f56520d251.1491597120.git.jcody@redhat.com +(cherry picked from commit d6fcdf06d9fc7d72151cc2069dc5c1adf5c21707) +Signed-off-by: Miroslav Rezanina +--- + block.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/block.c b/block.c +index 4766b8a..b74d445 100644 +--- a/block.c ++++ b/block.c +@@ -201,6 +201,13 @@ int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) + return -EINVAL; + } + ++ /* Do not clear read_only if it is prohibited */ ++ if (!read_only && !(bs->open_flags & BDRV_O_ALLOW_RDWR)) { ++ error_setg(errp, "Node '%s' is read only", ++ bdrv_get_device_or_node_name(bs)); ++ return -EPERM; ++ } ++ + bs->read_only = read_only; + return 0; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-introduce-bdrv_can_set_read_only.patch b/SOURCES/kvm-block-introduce-bdrv_can_set_read_only.patch new file mode 100644 index 0000000..737fede --- /dev/null +++ b/SOURCES/kvm-block-introduce-bdrv_can_set_read_only.patch @@ -0,0 +1,75 @@ +From 933635fed9341bfdb4813fced23c66c7d9848b25 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:52 +0200 +Subject: [PATCH 06/11] block: introduce bdrv_can_set_read_only() + +RH-Author: Jeffrey Cody +Message-id: <332c4906d8d1ccc4efc19d57e52297a842c1486e.1493236824.git.jcody@redhat.com> +Patchwork-id: 74900 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 5/8] block: introduce bdrv_can_set_read_only() +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +Introduce check function for setting read_only flags. Will return < 0 on +error, with appropriate Error value set. Does not alter any flags. + +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Reviewed-by: John Snow +Message-id: e2bba34ac3bc76a0c42adc390413f358ae0566e8.1491597120.git.jcody@redhat.com +(cherry picked from commit 45803a039670cbee914dcb54cf3952f9b2d64d1f) +Signed-off-by: Miroslav Rezanina +--- + block.c | 14 +++++++++++++- + include/block/block.h | 1 + + 2 files changed, 14 insertions(+), 1 deletion(-) + +diff --git a/block.c b/block.c +index bf09026..84f12f7 100644 +--- a/block.c ++++ b/block.c +@@ -197,7 +197,7 @@ bool bdrv_is_read_only(BlockDriverState *bs) + return bs->read_only; + } + +-int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) ++int bdrv_can_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) + { + /* Do not set read_only if copy_on_read is enabled */ + if (bs->copy_on_read && read_only) { +@@ -213,6 +213,18 @@ int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) + return -EPERM; + } + ++ return 0; ++} ++ ++int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp) ++{ ++ int ret = 0; ++ ++ ret = bdrv_can_set_read_only(bs, read_only, errp); ++ if (ret < 0) { ++ return ret; ++ } ++ + bs->read_only = read_only; + return 0; + } +diff --git a/include/block/block.h b/include/block/block.h +index 3525590..56b27fb 100644 +--- a/include/block/block.h ++++ b/include/block/block.h +@@ -434,6 +434,7 @@ int bdrv_is_allocated_above(BlockDriverState *top, BlockDriverState *base, + int64_t sector_num, int nb_sectors, int *pnum); + + bool bdrv_is_read_only(BlockDriverState *bs); ++int bdrv_can_set_read_only(BlockDriverState *bs, bool read_only, Error **errp); + int bdrv_set_read_only(BlockDriverState *bs, bool read_only, Error **errp); + bool bdrv_is_sg(BlockDriverState *bs); + bool bdrv_is_inserted(BlockDriverState *bs); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-iscsi-enable-filename-option-and-parsing.patch b/SOURCES/kvm-block-iscsi-enable-filename-option-and-parsing.patch new file mode 100644 index 0000000..8b90d95 --- /dev/null +++ b/SOURCES/kvm-block-iscsi-enable-filename-option-and-parsing.patch @@ -0,0 +1,89 @@ +From 55eff7c7c9dea635415014de0ab460dae7eef13d Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Thu, 15 Jun 2017 15:50:29 +0200 +Subject: [PATCH 4/8] block/iscsi: enable filename option and parsing + +RH-Author: Jeffrey Cody +Message-id: +Patchwork-id: 75615 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH 2/2] block/iscsi: enable filename option and parsing +Bugzilla: 1457088 +RH-Acked-by: Juan Quintela +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz +RH-Acked-by: Richard Jones + +When enabling option parsing and blockdev-add for iscsi, we removed the +'filename' option. Unfortunately, this was a bit optimistic, as +previous versions of QEMU allowed the use of the option in backing +filenames via json. This means that without parsing this option, we +cannot open existing images that used to work fine. + +See bug: https://bugzilla.redhat.com/show_bug.cgi?id=1457088 + +Tested-by: Richard W.M. Jones +Signed-off-by: Jeff Cody +Message-id: 0789ab6c32814ab4b6896707d378804bd4424c65.1497444637.git.jcody@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 5c3ad1a6a8fa041c57403dbe1fc5927eec0be66b) +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + block/iscsi.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/block/iscsi.c b/block/iscsi.c +index 42fb0b0..2d16861 100644 +--- a/block/iscsi.c ++++ b/block/iscsi.c +@@ -1732,6 +1732,10 @@ static QemuOptsList runtime_opts = { + .name = "timeout", + .type = QEMU_OPT_NUMBER, + }, ++ { ++ .name = "filename", ++ .type = QEMU_OPT_STRING, ++ }, + { /* end of list */ } + }, + }; +@@ -1747,12 +1751,27 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags, + char *initiator_name = NULL; + QemuOpts *opts; + Error *local_err = NULL; +- const char *transport_name, *portal, *target; ++ const char *transport_name, *portal, *target, *filename; + #if LIBISCSI_API_VERSION >= (20160603) + enum iscsi_transport_type transport; + #endif + int i, ret = 0, timeout = 0, lun; + ++ /* If we are given a filename, parse the filename, with precedence given to ++ * filename encoded options */ ++ filename = qdict_get_try_str(options, "filename"); ++ if (filename) { ++ error_report("Warning: 'filename' option specified. " ++ "This is an unsupported option, and may be deprecated " ++ "in the future"); ++ iscsi_parse_filename(filename, options, &local_err); ++ if (local_err) { ++ ret = -EINVAL; ++ error_propagate(errp, local_err); ++ goto exit; ++ } ++ } ++ + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); + qemu_opts_absorb_qdict(opts, options, &local_err); + if (local_err) { +@@ -1967,6 +1986,7 @@ out: + } + memset(iscsilun, 0, sizeof(IscsiLun)); + } ++exit: + return ret; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-rbd-Add-support-for-reopen.patch b/SOURCES/kvm-block-rbd-Add-support-for-reopen.patch new file mode 100644 index 0000000..f0ad6fe --- /dev/null +++ b/SOURCES/kvm-block-rbd-Add-support-for-reopen.patch @@ -0,0 +1,71 @@ +From 6683e30ae45021bbff0c89e7867c6419451d294f Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:55 +0200 +Subject: [PATCH 09/11] block/rbd: Add support for reopen() + +RH-Author: Jeffrey Cody +Message-id: +Patchwork-id: 74902 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 8/8] block/rbd: Add support for reopen() +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +This adds support for reopen in rbd, for changing between r/w and r/o. + +Note, that this is only a flag change, but we will block a change from +r/o to r/w if we are using an RBD internal snapshot. + +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Jeff Cody +Reviewed-by: John Snow +Message-id: d4e87539167ec6527d44c97b164eabcccf96e4f3.1491597120.git.jcody@redhat.com +(cherry picked from commit 56e7cf8df03ae142c7797435dc0ece80a42f4fd0) +Signed-off-by: Miroslav Rezanina +--- + block/rbd.c | 21 +++++++++++++++++++++ + 1 file changed, 21 insertions(+) + +diff --git a/block/rbd.c b/block/rbd.c +index 35853c9..6471f4f 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -668,6 +668,26 @@ failed_opts: + return r; + } + ++ ++/* Since RBD is currently always opened R/W via the API, ++ * we just need to check if we are using a snapshot or not, in ++ * order to determine if we will allow it to be R/W */ ++static int qemu_rbd_reopen_prepare(BDRVReopenState *state, ++ BlockReopenQueue *queue, Error **errp) ++{ ++ BDRVRBDState *s = state->bs->opaque; ++ int ret = 0; ++ ++ if (s->snap && state->flags & BDRV_O_RDWR) { ++ error_setg(errp, ++ "Cannot change node '%s' to r/w when using RBD snapshot", ++ bdrv_get_device_or_node_name(state->bs)); ++ ret = -EINVAL; ++ } ++ ++ return ret; ++} ++ + static void qemu_rbd_close(BlockDriverState *bs) + { + BDRVRBDState *s = bs->opaque; +@@ -1074,6 +1094,7 @@ static BlockDriver bdrv_rbd = { + .bdrv_parse_filename = qemu_rbd_parse_filename, + .bdrv_file_open = qemu_rbd_open, + .bdrv_close = qemu_rbd_close, ++ .bdrv_reopen_prepare = qemu_rbd_reopen_prepare, + .bdrv_create = qemu_rbd_create, + .bdrv_has_zero_init = bdrv_has_zero_init_1, + .bdrv_get_info = qemu_rbd_getinfo, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-rbd-enable-filename-option-and-parsing.patch b/SOURCES/kvm-block-rbd-enable-filename-option-and-parsing.patch new file mode 100644 index 0000000..55c9d1c --- /dev/null +++ b/SOURCES/kvm-block-rbd-enable-filename-option-and-parsing.patch @@ -0,0 +1,89 @@ +From f30511e056647e04317d67b43b49c95b68170ec2 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Thu, 15 Jun 2017 15:50:28 +0200 +Subject: [PATCH 3/8] block/rbd: enable filename option and parsing + +RH-Author: Jeffrey Cody +Message-id: <679a297faf8ee6b90984f52587a7ccf02c862436.1497541513.git.jcody@redhat.com> +Patchwork-id: 75617 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH 1/2] block/rbd: enable filename option and parsing +Bugzilla: 1457088 +RH-Acked-by: Juan Quintela +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz +RH-Acked-by: Richard Jones + +When enabling option parsing and blockdev-add for rbd, we removed the +'filename' option. Unfortunately, this was a bit optimistic, as +previous versions of QEMU allowed the use of the option in backing +filenames via json. This means that without parsing this option, we +cannot open existing images that used to work fine. + +See bug: https://bugzilla.redhat.com/show_bug.cgi?id=1457088 + +Tested-by: Richard W.M. Jones +Signed-off-by: Jeff Cody +Message-id: 937dc9fde348d13311eb8e23444df3bc3190b612.1497444637.git.jcody@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 91589d9e5ca658abcc915b078aaa66531a112348) +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + block/rbd.c | 22 +++++++++++++++++++++- + 1 file changed, 21 insertions(+), 1 deletion(-) + +diff --git a/block/rbd.c b/block/rbd.c +index 6471f4f..ce45b65 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -340,6 +340,10 @@ static QemuOptsList runtime_opts = { + .type = QEMU_OPT_STRING, + .help = "Legacy rados key/value option parameters", + }, ++ { ++ .name = "filename", ++ .type = QEMU_OPT_STRING, ++ }, + { /* end of list */ } + }, + }; +@@ -541,12 +545,27 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + { + BDRVRBDState *s = bs->opaque; + const char *pool, *snap, *conf, *user, *image_name, *keypairs; +- const char *secretid; ++ const char *secretid, *filename; + QemuOpts *opts; + Error *local_err = NULL; + char *mon_host = NULL; + int r; + ++ /* If we are given a filename, parse the filename, with precedence given to ++ * filename encoded options */ ++ filename = qdict_get_try_str(options, "filename"); ++ if (filename) { ++ error_report("Warning: 'filename' option specified. " ++ "This is an unsupported option, and may be deprecated " ++ "in the future"); ++ qemu_rbd_parse_filename(filename, options, &local_err); ++ if (local_err) { ++ r = -EINVAL; ++ error_propagate(errp, local_err); ++ goto exit; ++ } ++ } ++ + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); + qemu_opts_absorb_qdict(opts, options, &local_err); + if (local_err) { +@@ -665,6 +684,7 @@ failed_shutdown: + failed_opts: + qemu_opts_del(opts); + g_free(mon_host); ++exit: + return r; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-rbd-update-variable-names-to-more-apt-names.patch b/SOURCES/kvm-block-rbd-update-variable-names-to-more-apt-names.patch new file mode 100644 index 0000000..f929401 --- /dev/null +++ b/SOURCES/kvm-block-rbd-update-variable-names-to-more-apt-names.patch @@ -0,0 +1,150 @@ +From e62afefee293b3188ae9b633f5610002eb709d41 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:54 +0200 +Subject: [PATCH 08/11] block/rbd - update variable names to more apt names + +RH-Author: Jeffrey Cody +Message-id: <0a980f47dfd0a02181a5e9fa84f34ed44d9971fe.1493236824.git.jcody@redhat.com> +Patchwork-id: 74903 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 7/8] block/rbd - update variable names to more apt names +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +Update 'clientname' to be 'user', which tracks better with both +the QAPI and rados variable naming. + +Update 'name' to be 'image_name', as it indicates the rbd image. +Naming it 'image' would have been ideal, but we are using that for +the rados_image_t value returned by rbd_open(). + +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Jeff Cody +Reviewed-by: John Snow +Message-id: b7ec1fb2e1cf36f9b6911631447a5b0422590b7d.1491597120.git.jcody@redhat.com +(cherry picked from commit 80b61a27c69c67492ce87ddd63ee497b5bc00e7e) +Signed-off-by: Miroslav Rezanina +--- + block/rbd.c | 33 +++++++++++++++++---------------- + 1 file changed, 17 insertions(+), 16 deletions(-) + +diff --git a/block/rbd.c b/block/rbd.c +index 1c43171..35853c9 100644 +--- a/block/rbd.c ++++ b/block/rbd.c +@@ -94,7 +94,7 @@ typedef struct BDRVRBDState { + rados_t cluster; + rados_ioctx_t io_ctx; + rbd_image_t image; +- char *name; ++ char *image_name; + char *snap; + } BDRVRBDState; + +@@ -350,7 +350,7 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp) + int64_t bytes = 0; + int64_t objsize; + int obj_order = 0; +- const char *pool, *name, *conf, *clientname, *keypairs; ++ const char *pool, *image_name, *conf, *user, *keypairs; + const char *secretid; + rados_t cluster; + rados_ioctx_t io_ctx; +@@ -393,11 +393,11 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp) + */ + pool = qdict_get_try_str(options, "pool"); + conf = qdict_get_try_str(options, "conf"); +- clientname = qdict_get_try_str(options, "user"); +- name = qdict_get_try_str(options, "image"); ++ user = qdict_get_try_str(options, "user"); ++ image_name = qdict_get_try_str(options, "image"); + keypairs = qdict_get_try_str(options, "=keyvalue-pairs"); + +- ret = rados_create(&cluster, clientname); ++ ret = rados_create(&cluster, user); + if (ret < 0) { + error_setg_errno(errp, -ret, "error initializing"); + goto exit; +@@ -434,7 +434,7 @@ static int qemu_rbd_create(const char *filename, QemuOpts *opts, Error **errp) + goto shutdown; + } + +- ret = rbd_create(io_ctx, name, bytes, &obj_order); ++ ret = rbd_create(io_ctx, image_name, bytes, &obj_order); + if (ret < 0) { + error_setg_errno(errp, -ret, "error rbd create"); + } +@@ -540,7 +540,7 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + Error **errp) + { + BDRVRBDState *s = bs->opaque; +- const char *pool, *snap, *conf, *clientname, *name, *keypairs; ++ const char *pool, *snap, *conf, *user, *image_name, *keypairs; + const char *secretid; + QemuOpts *opts; + Error *local_err = NULL; +@@ -567,24 +567,24 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + pool = qemu_opt_get(opts, "pool"); + conf = qemu_opt_get(opts, "conf"); + snap = qemu_opt_get(opts, "snapshot"); +- clientname = qemu_opt_get(opts, "user"); +- name = qemu_opt_get(opts, "image"); ++ user = qemu_opt_get(opts, "user"); ++ image_name = qemu_opt_get(opts, "image"); + keypairs = qemu_opt_get(opts, "=keyvalue-pairs"); + +- if (!pool || !name) { ++ if (!pool || !image_name) { + error_setg(errp, "Parameters 'pool' and 'image' are required"); + r = -EINVAL; + goto failed_opts; + } + +- r = rados_create(&s->cluster, clientname); ++ r = rados_create(&s->cluster, user); + if (r < 0) { + error_setg_errno(errp, -r, "error initializing"); + goto failed_opts; + } + + s->snap = g_strdup(snap); +- s->name = g_strdup(name); ++ s->image_name = g_strdup(image_name); + + /* try default location when conf=NULL, but ignore failure */ + r = rados_conf_read_file(s->cluster, conf); +@@ -636,9 +636,10 @@ static int qemu_rbd_open(BlockDriverState *bs, QDict *options, int flags, + } + + /* rbd_open is always r/w */ +- r = rbd_open(s->io_ctx, s->name, &s->image, s->snap); ++ r = rbd_open(s->io_ctx, s->image_name, &s->image, s->snap); + if (r < 0) { +- error_setg_errno(errp, -r, "error reading header from %s", s->name); ++ error_setg_errno(errp, -r, "error reading header from %s", ++ s->image_name); + goto failed_open; + } + +@@ -660,7 +661,7 @@ failed_open: + failed_shutdown: + rados_shutdown(s->cluster); + g_free(s->snap); +- g_free(s->name); ++ g_free(s->image_name); + failed_opts: + qemu_opts_del(opts); + g_free(mon_host); +@@ -674,7 +675,7 @@ static void qemu_rbd_close(BlockDriverState *bs) + rbd_close(s->image); + rados_ioctx_destroy(s->io_ctx); + g_free(s->snap); +- g_free(s->name); ++ g_free(s->image_name); + rados_shutdown(s->cluster); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-use-bdrv_can_set_read_only-during-reopen.patch b/SOURCES/kvm-block-use-bdrv_can_set_read_only-during-reopen.patch new file mode 100644 index 0000000..24ea8d6 --- /dev/null +++ b/SOURCES/kvm-block-use-bdrv_can_set_read_only-during-reopen.patch @@ -0,0 +1,59 @@ +From bda8e9c91bc93d9185e9094b2a188fff44173a3e Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Wed, 26 Apr 2017 20:08:53 +0200 +Subject: [PATCH 07/11] block: use bdrv_can_set_read_only() during reopen + +RH-Author: Jeffrey Cody +Message-id: +Patchwork-id: 74901 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 6/8] block: use bdrv_can_set_read_only() during reopen +Bugzilla: 1189998 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Max Reitz + +Signed-off-by: Jeff Cody +Reviewed-by: Stefan Hajnoczi +Reviewed-by: John Snow +Message-id: 00aed7ffdd7be4b9ed9ce1007d50028a72b34ebe.1491597120.git.jcody@redhat.com +(cherry picked from commit 3d8ce171cb4a62b55727bc949e2e9427f77de6fb) +Signed-off-by: Miroslav Rezanina +--- + block.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +diff --git a/block.c b/block.c +index 84f12f7..9fca814 100644 +--- a/block.c ++++ b/block.c +@@ -2789,6 +2789,7 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, + BlockDriver *drv; + QemuOpts *opts; + const char *value; ++ bool read_only; + + assert(reopen_state != NULL); + assert(reopen_state->bs->drv != NULL); +@@ -2817,12 +2818,13 @@ int bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue, + qdict_put(reopen_state->options, "driver", qstring_from_str(value)); + } + +- /* if we are to stay read-only, do not allow permission change +- * to r/w */ +- if (!(reopen_state->bs->open_flags & BDRV_O_ALLOW_RDWR) && +- reopen_state->flags & BDRV_O_RDWR) { +- error_setg(errp, "Node '%s' is read only", +- bdrv_get_device_or_node_name(reopen_state->bs)); ++ /* If we are to stay read-only, do not allow permission change ++ * to r/w. Attempting to set to r/w may fail if either BDRV_O_ALLOW_RDWR is ++ * not set, or if the BDS still has copy_on_read enabled */ ++ read_only = !(reopen_state->flags & BDRV_O_RDWR); ++ ret = bdrv_can_set_read_only(reopen_state->bs, read_only, &local_err); ++ if (local_err) { ++ error_propagate(errp, local_err); + goto error; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-vhdx-Make-vhdx_create-always-set-errp.patch b/SOURCES/kvm-block-vhdx-Make-vhdx_create-always-set-errp.patch new file mode 100644 index 0000000..671a6a8 --- /dev/null +++ b/SOURCES/kvm-block-vhdx-Make-vhdx_create-always-set-errp.patch @@ -0,0 +1,166 @@ +From 0c48bb933ecd0792182c33c89c370841e3c1c15f Mon Sep 17 00:00:00 2001 +From: John Snow +Date: Tue, 16 May 2017 21:00:39 +0200 +Subject: [PATCH 03/27] block/vhdx: Make vhdx_create() always set errp + +RH-Author: John Snow +Message-id: <20170516210041.12856-2-jsnow@redhat.com> +Patchwork-id: 75197 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH v2 1/3] block/vhdx: Make vhdx_create() always set errp +Bugzilla: 1447551 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Paolo Bonzini + +From: Max Reitz + +This patch makes vhdx_create() always set errp in case of an error. It +also adds errp parameters to vhdx_create_bat() and +vhdx_create_new_region_table() so we can pass on the error object +generated by blk_truncate() as of a future commit. + +Signed-off-by: Max Reitz +Reviewed-by: Kevin Wolf +Message-id: 20170328205129.15138-2-mreitz@redhat.com +Reviewed-by: Stefan Hajnoczi +Signed-off-by: Max Reitz +(cherry picked from commit 55b9392b98e500399f2da1edc1d110bbfd40fb05) +Signed-off-by: John Snow +Signed-off-by: Miroslav Rezanina +--- + block/vhdx.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/block/vhdx.c b/block/vhdx.c +index 052a753..d25bcd9 100644 +--- a/block/vhdx.c ++++ b/block/vhdx.c +@@ -1586,7 +1586,7 @@ exit: + static int vhdx_create_bat(BlockBackend *blk, BDRVVHDXState *s, + uint64_t image_size, VHDXImageType type, + bool use_zero_blocks, uint64_t file_offset, +- uint32_t length) ++ uint32_t length, Error **errp) + { + int ret = 0; + uint64_t data_file_offset; +@@ -1609,14 +1609,19 @@ static int vhdx_create_bat(BlockBackend *blk, BDRVVHDXState *s, + * is the furthest thing we have written yet */ + ret = blk_truncate(blk, data_file_offset); + if (ret < 0) { ++ error_setg_errno(errp, -ret, ++ "Failed to resize the underlying file"); + goto exit; + } + } else if (type == VHDX_TYPE_FIXED) { + ret = blk_truncate(blk, data_file_offset + image_size); + if (ret < 0) { ++ error_setg_errno(errp, -ret, ++ "Failed to resize the underlying file"); + goto exit; + } + } else { ++ error_setg(errp, "Unsupported image type"); + ret = -ENOTSUP; + goto exit; + } +@@ -1627,6 +1632,7 @@ static int vhdx_create_bat(BlockBackend *blk, BDRVVHDXState *s, + /* for a fixed file, the default BAT entry is not zero */ + s->bat = g_try_malloc0(length); + if (length && s->bat == NULL) { ++ error_setg(errp, "Failed to allocate memory for the BAT"); + ret = -ENOMEM; + goto exit; + } +@@ -1646,6 +1652,7 @@ static int vhdx_create_bat(BlockBackend *blk, BDRVVHDXState *s, + } + ret = blk_pwrite(blk, file_offset, s->bat, length, 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write the BAT"); + goto exit; + } + } +@@ -1671,7 +1678,8 @@ static int vhdx_create_new_region_table(BlockBackend *blk, + uint32_t log_size, + bool use_zero_blocks, + VHDXImageType type, +- uint64_t *metadata_offset) ++ uint64_t *metadata_offset, ++ Error **errp) + { + int ret = 0; + uint32_t offset = 0; +@@ -1740,7 +1748,7 @@ static int vhdx_create_new_region_table(BlockBackend *blk, + /* The region table gives us the data we need to create the BAT, + * so do that now */ + ret = vhdx_create_bat(blk, s, image_size, type, use_zero_blocks, +- bat_file_offset, bat_length); ++ bat_file_offset, bat_length, errp); + if (ret < 0) { + goto exit; + } +@@ -1749,12 +1757,14 @@ static int vhdx_create_new_region_table(BlockBackend *blk, + ret = blk_pwrite(blk, VHDX_REGION_TABLE_OFFSET, buffer, + VHDX_HEADER_BLOCK_SIZE, 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write first region table"); + goto exit; + } + + ret = blk_pwrite(blk, VHDX_REGION_TABLE2_OFFSET, buffer, + VHDX_HEADER_BLOCK_SIZE, 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write second region table"); + goto exit; + } + +@@ -1825,6 +1835,7 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) + ret = -ENOTSUP; + goto exit; + } else { ++ error_setg(errp, "Invalid subformat '%s'", type); + ret = -EINVAL; + goto exit; + } +@@ -1879,12 +1890,14 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) + ret = blk_pwrite(blk, VHDX_FILE_ID_OFFSET, &signature, sizeof(signature), + 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write file signature"); + goto delete_and_exit; + } + if (creator) { + ret = blk_pwrite(blk, VHDX_FILE_ID_OFFSET + sizeof(signature), + creator, creator_items * sizeof(gunichar2), 0); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write creator field"); + goto delete_and_exit; + } + } +@@ -1893,13 +1906,14 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) + /* Creates (B),(C) */ + ret = vhdx_create_new_headers(blk, image_size, log_size); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to write image headers"); + goto delete_and_exit; + } + + /* Creates (D),(E),(G) explicitly. (F) created as by-product */ + ret = vhdx_create_new_region_table(blk, image_size, block_size, 512, + log_size, use_zero_blocks, image_type, +- &metadata_offset); ++ &metadata_offset, errp); + if (ret < 0) { + goto delete_and_exit; + } +@@ -1908,6 +1922,7 @@ static int vhdx_create(const char *filename, QemuOpts *opts, Error **errp) + ret = vhdx_create_new_metadata(blk, image_size, block_size, 512, + metadata_offset, image_type); + if (ret < 0) { ++ error_setg_errno(errp, -ret, "Failed to initialize metadata"); + goto delete_and_exit; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-vxhs-modularize-VXHS-via-g_module.patch b/SOURCES/kvm-block-vxhs-modularize-VXHS-via-g_module.patch new file mode 100644 index 0000000..b9d926d --- /dev/null +++ b/SOURCES/kvm-block-vxhs-modularize-VXHS-via-g_module.patch @@ -0,0 +1,479 @@ +From 1b7bbc5ff814406dfe9f64203462d92d8f71ef3a Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 8 May 2017 22:11:16 +0200 +Subject: [PATCH 6/7] block/vxhs: modularize VXHS via g_module + +RH-Author: Jeffrey Cody +Message-id: <8a91a423440b7a5a14e868279c772e99b865bfc6.1494281291.git.jcody@redhat.com> +Patchwork-id: 75046 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 4/4] block/vxhs: modularize VXHS via g_module +Bugzilla: 1265869 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +This converts the VXHS driver to be a runtime loaded module, with no +external build dependencies on libvxhs / libqnio. This (libvxhs) is a +3rd party library, written by Veritas, to interface with the VXHS +server. + +Red Hat is not going to distribute libvxhs, nor will Red Hat use libvxhs +in the build systems. So that creates two criteria for the +modularization, for business reasons: + +1. No runtime dependencies on libvxhs (aside from opening the library on +vxhs open) + +2. No build dependencies on libvxhs packages. + +There is support in QEMU for modular block drivers, however there are +two issues with using the built-in support: + + A. It is all-or-none; if modules are enabled all protocols are built + as modules. This wouldn't be that bad, as it would of course + enable more granular dependencies for qemu rpm packages. But... + + B. It is not designed with criteria #2 in mind; it reduces runtime + dependencies, not build dependencies. The protocol libraries + that are still built linked against external libraries and using + external headers. + +This patch uses g_module to load the libvxhs library, and incorporates +the libvxhs.h header in the build tree. If block driver protocols are +also built as modules, libvxhs will still work and be built as a module +too, except the shared library will still not have any dependency on +libvxhs. + +There are a few changes in this patch from upstream (aside from the +module loading aspects): + +1. It enables VXHS support to be built as a protocl module if +--enable-modules is used during configure. + +2. If the init call to iio_init() fails, populate errp with a +meaningful error message. + +3. Since we are loading the library dynamically, make check the min and +max supported versions in the libvxhs library on load. + +Patches for items #1 and #2 have been posted upstream. + +It is expected that the libvxhs library is located at the following +pathname: /usr/lib64/qemu/libvxhs.so.1 + +VXHS support is only built for x86_64 in RHEV. + +Signed-off-by: Jeff Cody +Signed-off-by: Miroslav Rezanina +--- + block/vxhs.c | 122 +++++++++++++++++++++++++++++++---- + configure | 33 +--------- + include/block/vxhs_shim.h | 143 ++++++++++++++++++++++++++++++++++++++++++ + redhat/build_configure.sh | 9 ++- + redhat/qemu-kvm.spec.template | 7 +++ + 5 files changed, 272 insertions(+), 42 deletions(-) + create mode 100644 include/block/vxhs_shim.h + +diff --git a/block/vxhs.c b/block/vxhs.c +index 9ffe9d3..fbce83e 100644 +--- a/block/vxhs.c ++++ b/block/vxhs.c +@@ -9,7 +9,8 @@ + */ + + #include "qemu/osdep.h" +-#include ++#include "block/vxhs_shim.h" ++#include + #include + #include "block/block_int.h" + #include "qapi/qmp/qerror.h" +@@ -58,6 +59,96 @@ typedef struct BDRVVXHSState { + char *tlscredsid; /* tlscredsid */ + } BDRVVXHSState; + ++#define LIBVXHS_FULL_PATHNAME "/usr/lib64/qemu/libvxhs.so.1" ++static bool libvxhs_loaded; ++static GModule *libvxhs_handle; ++ ++static LibVXHSFuncs libvxhs; ++ ++typedef struct LibVXHSSymbols { ++ const char *name; ++ gpointer *addr; ++} LibVXHSSymbols; ++ ++static LibVXHSSymbols libvxhs_symbols[] = { ++ {"iio_init", (gpointer *) &libvxhs.iio_init}, ++ {"iio_fini", (gpointer *) &libvxhs.iio_fini}, ++ {"iio_min_version", (gpointer *) &libvxhs.iio_min_version}, ++ {"iio_max_version", (gpointer *) &libvxhs.iio_max_version}, ++ {"iio_open", (gpointer *) &libvxhs.iio_open}, ++ {"iio_close", (gpointer *) &libvxhs.iio_close}, ++ {"iio_writev", (gpointer *) &libvxhs.iio_writev}, ++ {"iio_readv", (gpointer *) &libvxhs.iio_readv}, ++ {"iio_ioctl", (gpointer *) &libvxhs.iio_ioctl}, ++ {NULL} ++}; ++ ++static void bdrv_vxhs_set_funcs(GModule *handle, Error **errp) ++{ ++ int i = 0; ++ while (libvxhs_symbols[i].name) { ++ const char *name = libvxhs_symbols[i].name; ++ if (!g_module_symbol(handle, name, libvxhs_symbols[i].addr)) { ++ error_setg(errp, "%s could not be loaded from libvxhs: %s", ++ name, g_module_error()); ++ return; ++ } ++ ++i; ++ } ++} ++ ++static void bdrv_vxhs_load_libs(Error **errp) ++{ ++ Error *local_err = NULL; ++ int32_t ver; ++ ++ if (libvxhs_loaded) { ++ return; ++ } ++ ++ if (!g_module_supported()) { ++ error_setg(errp, "modules are not supported on this platform: %s", ++ g_module_error()); ++ return; ++ } ++ ++ libvxhs_handle = g_module_open(LIBVXHS_FULL_PATHNAME, ++ G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL); ++ if (!libvxhs_handle) { ++ error_setg(errp, "error loading libvxhs: %s", g_module_error()); ++ return; ++ } ++ ++ g_module_make_resident(libvxhs_handle); ++ ++ bdrv_vxhs_set_funcs(libvxhs_handle, &local_err); ++ if (local_err) { ++ error_propagate(errp, local_err); ++ return; ++ } ++ ++ /* Now check to see if the libvxhs we are using here is supported ++ * by the loaded version */ ++ ++ ver = (*libvxhs.iio_min_version)(); ++ if (ver > QNIO_VERSION) { ++ error_setg(errp, "Trying to use libvxhs version %"PRId32" API, but " ++ "only %"PRId32" or newer is supported by %s", ++ QNIO_VERSION, ver, LIBVXHS_FULL_PATHNAME); ++ return; ++ } ++ ++ ver = (*libvxhs.iio_max_version)(); ++ if (ver < QNIO_VERSION) { ++ error_setg(errp, "Trying to use libvxhs version %"PRId32" API, but " ++ "only %"PRId32" or earlier is supported by %s", ++ QNIO_VERSION, ver, LIBVXHS_FULL_PATHNAME); ++ return; ++ } ++ ++ libvxhs_loaded = true; ++} ++ + static void vxhs_complete_aio_bh(void *opaque) + { + VXHSAIOCB *acb = opaque; +@@ -219,7 +310,7 @@ static void vxhs_parse_filename(const char *filename, QDict *options, + static int vxhs_init_and_ref(void) + { + if (vxhs_ref++ == 0) { +- if (iio_init(QNIO_VERSION, vxhs_iio_callback)) { ++ if ((*libvxhs.iio_init)(QNIO_VERSION, vxhs_iio_callback)) { + return -ENODEV; + } + } +@@ -229,7 +320,7 @@ static int vxhs_init_and_ref(void) + static void vxhs_unref(void) + { + if (--vxhs_ref == 0) { +- iio_fini(); ++ (*libvxhs.iio_fini)(); + } + } + +@@ -299,8 +390,17 @@ static int vxhs_open(BlockDriverState *bs, QDict *options, + char *client_key = NULL; + char *client_cert = NULL; + ++ bdrv_vxhs_load_libs(&local_err); ++ if (local_err) { ++ error_propagate(errp, local_err); ++ /* on error, cannot cleanup because the iio_fini() function ++ * is not loaded */ ++ return -EINVAL; ++ } ++ + ret = vxhs_init_and_ref(); + if (ret < 0) { ++ error_setg(&local_err, "libvxhs iio_init() failed"); + ret = -EINVAL; + goto out; + } +@@ -385,8 +485,8 @@ static int vxhs_open(BlockDriverState *bs, QDict *options, + /* + * Open qnio channel to storage agent if not opened before + */ +- dev_handlep = iio_open(of_vsa_addr, s->vdisk_guid, 0, +- cacert, client_key, client_cert); ++ dev_handlep = (*libvxhs.iio_open)(of_vsa_addr, s->vdisk_guid, 0, ++ cacert, client_key, client_cert); + if (dev_handlep == NULL) { + trace_vxhs_open_iio_open(of_vsa_addr); + ret = -ENODEV; +@@ -450,12 +550,12 @@ static BlockAIOCB *vxhs_aio_rw(BlockDriverState *bs, int64_t sector_num, + + switch (iodir) { + case VDISK_AIO_WRITE: +- ret = iio_writev(dev_handle, acb, qiov->iov, qiov->niov, +- offset, (uint64_t)size, iio_flags); ++ ret = (*libvxhs.iio_writev)(dev_handle, acb, qiov->iov, qiov->niov, ++ offset, (uint64_t)size, iio_flags); + break; + case VDISK_AIO_READ: +- ret = iio_readv(dev_handle, acb, qiov->iov, qiov->niov, +- offset, (uint64_t)size, iio_flags); ++ ret = (*libvxhs.iio_readv)(dev_handle, acb, qiov->iov, qiov->niov, ++ offset, (uint64_t)size, iio_flags); + break; + default: + trace_vxhs_aio_rw_invalid(iodir); +@@ -505,7 +605,7 @@ static void vxhs_close(BlockDriverState *bs) + * Close vDisk device + */ + if (s->vdisk_hostinfo.dev_handle) { +- iio_close(s->vdisk_hostinfo.dev_handle); ++ (*libvxhs.iio_close)(s->vdisk_hostinfo.dev_handle); + s->vdisk_hostinfo.dev_handle = NULL; + } + +@@ -527,7 +627,7 @@ static int64_t vxhs_get_vdisk_stat(BDRVVXHSState *s) + int ret = 0; + void *dev_handle = s->vdisk_hostinfo.dev_handle; + +- ret = iio_ioctl(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0); ++ ret = (*libvxhs.iio_ioctl)(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0); + if (ret < 0) { + trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno); + return -EIO; +diff --git a/configure b/configure +index 47b2475..2ca95f4 100755 +--- a/configure ++++ b/configure +@@ -3091,7 +3091,7 @@ else + glib_req_ver=2.22 + fi + glib_modules=gthread-2.0 +-if test "$modules" = yes; then ++if test "$modules" = yes -o "$vxhs" = yes; then + glib_modules="$glib_modules gmodule-2.0" + fi + +@@ -4793,33 +4793,6 @@ if compile_prog "" "" ; then + fi + + ########################################## +-# Veritas HyperScale block driver VxHS +-# Check if libvxhs is installed +- +-if test "$vxhs" != "no" ; then +- cat > $TMPC < +-#include +- +-void *vxhs_callback; +- +-int main(void) { +- iio_init(QNIO_VERSION, vxhs_callback); +- return 0; +-} +-EOF +- vxhs_libs="-lvxhs -lssl" +- if compile_prog "" "$vxhs_libs" ; then +- vxhs=yes +- else +- if test "$vxhs" = "yes" ; then +- feature_not_found "vxhs block device" "Install libvxhs See github" +- fi +- vxhs=no +- fi +-fi +- +-########################################## + # End of CC checks + # After here, no more $cc or $ld runs + +@@ -5831,8 +5804,8 @@ if test "$pthread_setname_np" = "yes" ; then + fi + + if test "$vxhs" = "yes" ; then +- echo "CONFIG_VXHS=y" >> $config_host_mak +- echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak ++ echo "CONFIG_VXHS=m" >> $config_host_mak ++ echo "VXHS_LIBS= -lssl" >> $config_host_mak + fi + + if test "$tcg_interpreter" = "yes"; then +diff --git a/include/block/vxhs_shim.h b/include/block/vxhs_shim.h +new file mode 100644 +index 0000000..42519ae +--- /dev/null ++++ b/include/block/vxhs_shim.h +@@ -0,0 +1,143 @@ ++/* ++ * Network IO library for VxHS QEMU block driver (Veritas Technologies) ++ * ++ * This work is licensed under the terms of the GNU GPL, version 2. See ++ * the COPYING file in the top-level directory. ++ * ++ * Contributions after 2014-08-15 are licensed under the terms of the ++ * GNU GPL, version 2 or (at your option) any later version. ++ */ ++ ++#ifndef QNIO_API_H ++#define QNIO_API_H ++ ++#include ++ ++/* ++ * Bump up the version everytime this file is modified ++ */ ++#define QNIO_VERSION 34 ++ ++/* ++ * These are the opcodes referenced by callback routine. ++ */ ++#define IRP_READ_REQUEST 0x1FFF ++#define IRP_WRITE_REQUEST 0x2FFF ++#define IRP_VDISK_CHECK_IO_FAILOVER_READY 2020 ++ ++/* ++ * opcodes for iio_ioctl. ++ */ ++#define IOR_VDISK_STAT 1005 ++ ++/* ++ * Error values for iio_cb_t callback function. ++ */ ++#define QNIOERROR_HUP 901 /* Retriable error */ ++#define QNIOERROR_NOCONN 902 /* Non-retriable error */ ++ ++ ++/* Operation Flags */ ++#define IIO_FLAG_ASYNC 0x0001 /* Do an async send */ ++ ++/* ++ * INPUT: ++ * ctx - opaque context ++ * opcode - Operation ++ * error - 0 for sucess, non-zero for failure. ++ * RETURNS: ++ * void ++ * DESCRIPTION: ++ * This callback is called, after Async request completes. ++ * ++ * CONTEXT: ++ * The callback should be wait-free. ++ */ ++typedef void (*iio_cb_t) (void *ctx, uint32_t opcode, uint32_t error); ++ ++typedef struct LibVXHSFuncs { ++/* ++ * RETURNS: ++ * 0 for sucess, non-zero for failure. ++ * DESCRIPTION: ++ * Intilize the library state. This should be called at the ++ * begining before issuing any library call. ++ */ ++ int (*iio_init)(int32_t version, iio_cb_t cb); ++/* ++ * RETURNS: ++ * void ++ * DESCRIPTION: ++ * Relinquish library resources. This should be called on the ++ * close of last open device. ++ */ ++ void (*iio_fini)(void); ++/* ++ * DESCRIPTION: ++ * Returns minimum QNIO API version supported by library. ++ */ ++ int32_t (*iio_min_version)(void); ++/* ++ * DESCRIPTION: ++ * Returns maximum QNIO API version supported by library. ++ */ ++ int32_t (*iio_max_version)(void); ++/* ++ * INPUT: ++ * uri - const string of the format of://:port ++ * devid - Device ID. ++ * flags - currently unused, this must be set to 0 ++ * cacert - CA certificates file in PEM format ++ * client_key - Client private key file in PEM format ++ * client_cert - Client certificate file in PEM format ++ * RETURNS: ++ * opeque device handle on success, NULL on failure. ++ * DESCRIPTION: ++ * This call returns device handle on success. Returns NULL on ++ * failure with errno set ++ * errno can be one of: ++ * ENODEV - remote device not found ++ * EBADF - Unable to open communication channel. ++ * EBUSY - The call cannot be completed right now ++ */ ++ void *(*iio_open)(const char *uri, const char *devid, uint32_t flags, ++ const char *cacert, const char *client_key, ++ const char *client_cert); ++/* ++ * Close the device. ++ * For every matching iio_open() there should be a matching iio_close() ++ * The last close free all data structures associated with the device. ++ */ ++ int32_t (*iio_close)(void *dev_handle); ++/* ++ * INPUT: ++ * dev_handle - device descriptor on which read/write needs to be performed ++ * ctx - an opaque context that is not interpreted This is set for ++ * async calls only. It can be NULL. ++ * iov - an array of iovecs (This is a scatter gather operation) ++ * iovcnt - the number of iovecs ++ * offset - an offset to perform the write ++ * size - I/O size ++ * flags - can be one of ++ * IIO_FLAG_ASYNC - indicating this is a aio call. ++ * RETURNS: ++ * -1 on error, sets errno ++ * EBADF - the remote fd is bad ++ * EBUSY - The call cannot be completed right now ++ * EPIPE - the channel got disconnected, call back would be called in ++ * addition to this. ++ */ ++ int32_t (*iio_writev)(void *dev_handle, void *ctx, struct iovec *iov, ++ int iovcnt, uint64_t offset, uint64_t size, ++ uint32_t flags); ++ ++ int32_t (*iio_readv)(void *dev_handle, void *ctx, struct iovec *iov, ++ int iovcnt, uint64_t offset, uint64_t size, ++ uint32_t flags); ++ ++ int32_t (*iio_ioctl)(void *dev_handle, uint32_t opcode, void *opaque, ++ uint32_t flags); ++ ++} LibVXHSFuncs; ++ ++#endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-vxhs.c-Add-qemu-iotests-for-new-block-device-t.patch b/SOURCES/kvm-block-vxhs.c-Add-qemu-iotests-for-new-block-device-t.patch new file mode 100644 index 0000000..9f6208d --- /dev/null +++ b/SOURCES/kvm-block-vxhs.c-Add-qemu-iotests-for-new-block-device-t.patch @@ -0,0 +1,153 @@ +From e37c3c50e638d5f628d658b36e41c3310f2ba505 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 8 May 2017 22:11:14 +0200 +Subject: [PATCH 4/7] block/vxhs.c: Add qemu-iotests for new block device type + "vxhs" + +RH-Author: Jeffrey Cody +Message-id: <3384a73672d5f90523c0ed394b332e82ec760d45.1494281291.git.jcody@redhat.com> +Patchwork-id: 75047 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 2/4] block/vxhs.c: Add qemu-iotests for new block device type "vxhs" +Bugzilla: 1265869 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Ashish Mittal + +These changes use a vxhs test server that is a part of the following +repository: +https://github.com/VeritasHyperScale/libqnio.git + +Signed-off-by: Ashish Mittal +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Jeff Cody +Signed-off-by: Jeff Cody +Message-id: 1491277689-24949-3-git-send-email-Ashish.Mittal@veritas.com +(cherry picked from commit ae0c0a3decabba6b710d8e6902d43495f7490de2) +Signed-off-by: Miroslav Rezanina +--- + tests/qemu-iotests/common | 6 ++++++ + tests/qemu-iotests/common.config | 13 +++++++++++++ + tests/qemu-iotests/common.filter | 1 + + tests/qemu-iotests/common.rc | 19 +++++++++++++++++++ + 4 files changed, 39 insertions(+) + +diff --git a/tests/qemu-iotests/common b/tests/qemu-iotests/common +index 4d5650d..9c6f972 100644 +--- a/tests/qemu-iotests/common ++++ b/tests/qemu-iotests/common +@@ -157,6 +157,7 @@ check options + -ssh test ssh + -nfs test nfs + -luks test luks ++ -vxhs test vxhs + -xdiff graphical mode diff + -nocache use O_DIRECT on backing file + -misalign misalign memory allocations +@@ -260,6 +261,11 @@ testlist options + xpand=false + ;; + ++ -vxhs) ++ IMGPROTO=vxhs ++ xpand=false ++ ;; ++ + -ssh) + IMGPROTO=ssh + xpand=false +diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config +index 55527aa..c4b51b3 100644 +--- a/tests/qemu-iotests/common.config ++++ b/tests/qemu-iotests/common.config +@@ -105,6 +105,10 @@ if [ -z "$QEMU_NBD_PROG" ]; then + export QEMU_NBD_PROG="`set_prog_path qemu-nbd`" + fi + ++if [ -z "$QEMU_VXHS_PROG" ]; then ++ export QEMU_VXHS_PROG="`set_prog_path qnio_server`" ++fi ++ + _qemu_wrapper() + { + ( +@@ -156,10 +160,19 @@ _qemu_nbd_wrapper() + ) + } + ++_qemu_vxhs_wrapper() ++{ ++ ( ++ echo $BASHPID > "${TEST_DIR}/qemu-vxhs.pid" ++ exec "$QEMU_VXHS_PROG" $QEMU_VXHS_OPTIONS "$@" ++ ) ++} ++ + export QEMU=_qemu_wrapper + export QEMU_IMG=_qemu_img_wrapper + export QEMU_IO=_qemu_io_wrapper + export QEMU_NBD=_qemu_nbd_wrapper ++export QEMU_VXHS=_qemu_vxhs_wrapper + + QEMU_IMG_EXTRA_ARGS= + if [ "$IMGOPTSSYNTAX" = "true" ]; then +diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter +index 1040013..c9a2d5c 100644 +--- a/tests/qemu-iotests/common.filter ++++ b/tests/qemu-iotests/common.filter +@@ -122,6 +122,7 @@ _filter_img_info() + -e "s#$TEST_DIR#TEST_DIR#g" \ + -e "s#$IMGFMT#IMGFMT#g" \ + -e 's#nbd://127.0.0.1:10810$#TEST_DIR/t.IMGFMT#g' \ ++ -e 's#json.*vdisk-id.*vxhs"}}#TEST_DIR/t.IMGFMT#' \ + -e "/encrypted: yes/d" \ + -e "/cluster_size: [0-9]\\+/d" \ + -e "/table_size: [0-9]\\+/d" \ +diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc +index 7d4781d..62529ee 100644 +--- a/tests/qemu-iotests/common.rc ++++ b/tests/qemu-iotests/common.rc +@@ -85,6 +85,9 @@ else + elif [ "$IMGPROTO" = "nfs" ]; then + TEST_DIR="nfs://127.0.0.1/$TEST_DIR" + TEST_IMG=$TEST_DIR/t.$IMGFMT ++ elif [ "$IMGPROTO" = "vxhs" ]; then ++ TEST_IMG_FILE=$TEST_DIR/t.$IMGFMT ++ TEST_IMG="vxhs://127.0.0.1:9999/t.$IMGFMT" + else + TEST_IMG=$IMGPROTO:$TEST_DIR/t.$IMGFMT + fi +@@ -171,6 +174,12 @@ _make_test_img() + eval "$QEMU_NBD -v -t -b 127.0.0.1 -p 10810 -f $IMGFMT $TEST_IMG_FILE >/dev/null &" + sleep 1 # FIXME: qemu-nbd needs to be listening before we continue + fi ++ ++ # Start QNIO server on image directory for vxhs protocol ++ if [ $IMGPROTO = "vxhs" ]; then ++ eval "$QEMU_VXHS -d $TEST_DIR > /dev/null &" ++ sleep 1 # Wait for server to come up. ++ fi + } + + _rm_test_img() +@@ -197,6 +206,16 @@ _cleanup_test_img() + fi + rm -f "$TEST_IMG_FILE" + ;; ++ vxhs) ++ if [ -f "${TEST_DIR}/qemu-vxhs.pid" ]; then ++ local QEMU_VXHS_PID ++ read QEMU_VXHS_PID < "${TEST_DIR}/qemu-vxhs.pid" ++ kill ${QEMU_VXHS_PID} >/dev/null 2>&1 ++ rm -f "${TEST_DIR}/qemu-vxhs.pid" ++ fi ++ rm -f "$TEST_IMG_FILE" ++ ;; ++ + file) + _rm_test_img "$TEST_DIR/t.$IMGFMT" + _rm_test_img "$TEST_DIR/t.$IMGFMT.orig" +-- +1.8.3.1 + diff --git a/SOURCES/kvm-block-vxhs.c-Add-support-for-a-new-block-device-type.patch b/SOURCES/kvm-block-vxhs.c-Add-support-for-a-new-block-device-type.patch new file mode 100644 index 0000000..ea6109e --- /dev/null +++ b/SOURCES/kvm-block-vxhs.c-Add-support-for-a-new-block-device-type.patch @@ -0,0 +1,825 @@ +From 26e2ce51252b84b36962ba786de9298415539720 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 8 May 2017 22:11:13 +0200 +Subject: [PATCH 3/7] block/vxhs.c: Add support for a new block device type + called "vxhs" + +RH-Author: Jeffrey Cody +Message-id: <3ad63ba3f75889d8c8dcbbaf53ebe5ab875a224c.1494281291.git.jcody@redhat.com> +Patchwork-id: 75045 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 1/4] block/vxhs.c: Add support for a new block device type called "vxhs" +Bugzilla: 1265869 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Ashish Mittal + +Source code for the qnio library that this code loads can be downloaded from: +https://github.com/VeritasHyperScale/libqnio.git + +Sample command line using JSON syntax: +./x86_64-softmmu/qemu-system-x86_64 -name instance-00000008 -S -vnc 0.0.0.0:0 +-k en-us -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5 +-msg timestamp=on +'json:{"driver":"vxhs","vdisk-id":"c3e9095a-a5ee-4dce-afeb-2a59fb387410", +"server":{"host":"172.172.17.4","port":"9999"}}' + +Sample command line using URI syntax: +qemu-img convert -f raw -O raw -n +/var/lib/nova/instances/_base/0c5eacd5ebea5ed914b6a3e7b18f1ce734c386ad +vxhs://192.168.0.1:9999/c6718f6b-0401-441d-a8c3-1f0064d75ee0 + +Sample command line using TLS credentials (run in secure mode): +./qemu-io --object +tls-creds-x509,id=tls0,dir=/etc/pki/qemu/vxhs,endpoint=client -c 'read +-v 66000 2.5k' 'json:{"server.host": "127.0.0.1", "server.port": "9999", +"vdisk-id": "/test.raw", "driver": "vxhs", "tls-creds":"tls0"}' + +[Jeff: Modified trace-events with the correct string formatting] + +Signed-off-by: Ashish Mittal +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Jeff Cody +Signed-off-by: Jeff Cody +Message-id: 1491277689-24949-2-git-send-email-Ashish.Mittal@veritas.com +(cherry picked from commit da92c3ff60b20392dd34902fb96304c4633b5fba) +Signed-off-by: Miroslav Rezanina +--- + block/Makefile.objs | 2 + + block/trace-events | 17 ++ + block/vxhs.c | 575 +++++++++++++++++++++++++++++++++++++++++++++++++++ + configure | 39 ++++ + qapi/block-core.json | 23 ++- + 5 files changed, 654 insertions(+), 2 deletions(-) + create mode 100644 block/vxhs.c + +diff --git a/block/Makefile.objs b/block/Makefile.objs +index de96f8e..ea95530 100644 +--- a/block/Makefile.objs ++++ b/block/Makefile.objs +@@ -19,6 +19,7 @@ block-obj-$(CONFIG_LIBNFS) += nfs.o + block-obj-$(CONFIG_CURL) += curl.o + block-obj-$(CONFIG_RBD) += rbd.o + block-obj-$(CONFIG_GLUSTERFS) += gluster.o ++block-obj-$(CONFIG_VXHS) += vxhs.o + block-obj-$(CONFIG_LIBSSH2) += ssh.o + block-obj-y += accounting.o dirty-bitmap.o + block-obj-y += write-threshold.o +@@ -38,6 +39,7 @@ rbd.o-cflags := $(RBD_CFLAGS) + rbd.o-libs := $(RBD_LIBS) + gluster.o-cflags := $(GLUSTERFS_CFLAGS) + gluster.o-libs := $(GLUSTERFS_LIBS) ++vxhs.o-libs := $(VXHS_LIBS) + ssh.o-cflags := $(LIBSSH2_CFLAGS) + ssh.o-libs := $(LIBSSH2_LIBS) + block-obj-$(if $(CONFIG_BZIP2),m,n) += dmg-bz2.o +diff --git a/block/trace-events b/block/trace-events +index 0bc5c0a..9a71c7f 100644 +--- a/block/trace-events ++++ b/block/trace-events +@@ -110,3 +110,20 @@ qed_aio_write_data(void *s, void *acb, int ret, uint64_t offset, size_t len) "s + qed_aio_write_prefill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64 + qed_aio_write_postfill(void *s, void *acb, uint64_t start, size_t len, uint64_t offset) "s %p acb %p start %"PRIu64" len %zu offset %"PRIu64 + qed_aio_write_main(void *s, void *acb, int ret, uint64_t offset, size_t len) "s %p acb %p ret %d offset %"PRIu64" len %zu" ++ ++# block/vxhs.c ++vxhs_iio_callback(int error) "ctx is NULL: error %d" ++vxhs_iio_callback_chnfail(int err, int error) "QNIO channel failed, no i/o %d, %d" ++vxhs_iio_callback_unknwn(int opcode, int err) "unexpected opcode %d, errno %d" ++vxhs_aio_rw_invalid(int req) "Invalid I/O request iodir %d" ++vxhs_aio_rw_ioerr(char *guid, int iodir, uint64_t size, uint64_t off, void *acb, int ret, int err) "IO ERROR (vDisk %s) FOR : Read/Write = %d size = %"PRIu64" offset = %"PRIu64" ACB = %p. Error = %d, errno = %d" ++vxhs_get_vdisk_stat_err(char *guid, int ret, int err) "vDisk (%s) stat ioctl failed, ret = %d, errno = %d" ++vxhs_get_vdisk_stat(char *vdisk_guid, uint64_t vdisk_size) "vDisk %s stat ioctl returned size %"PRIu64 ++vxhs_complete_aio(void *acb, uint64_t ret) "aio failed acb %p ret %"PRIu64 ++vxhs_parse_uri_filename(const char *filename) "URI passed via bdrv_parse_filename %s" ++vxhs_open_vdiskid(const char *vdisk_id) "Opening vdisk-id %s" ++vxhs_open_hostinfo(char *of_vsa_addr, int port) "Adding host %s:%d to BDRVVXHSState" ++vxhs_open_iio_open(const char *host) "Failed to connect to storage agent on host %s" ++vxhs_parse_uri_hostinfo(char *host, int port) "Host: IP %s, Port %d" ++vxhs_close(char *vdisk_guid) "Closing vdisk %s" ++vxhs_get_creds(const char *cacert, const char *client_key, const char *client_cert) "cacert %s, client_key %s, client_cert %s" +diff --git a/block/vxhs.c b/block/vxhs.c +new file mode 100644 +index 0000000..9ffe9d3 +--- /dev/null ++++ b/block/vxhs.c +@@ -0,0 +1,575 @@ ++/* ++ * QEMU Block driver for Veritas HyperScale (VxHS) ++ * ++ * Copyright (c) 2017 Veritas Technologies LLC. ++ * ++ * This work is licensed under the terms of the GNU GPL, version 2 or later. ++ * See the COPYING file in the top-level directory. ++ * ++ */ ++ ++#include "qemu/osdep.h" ++#include ++#include ++#include "block/block_int.h" ++#include "qapi/qmp/qerror.h" ++#include "qapi/qmp/qdict.h" ++#include "qapi/qmp/qstring.h" ++#include "trace.h" ++#include "qemu/uri.h" ++#include "qapi/error.h" ++#include "qemu/uuid.h" ++#include "crypto/tlscredsx509.h" ++ ++#define VXHS_OPT_FILENAME "filename" ++#define VXHS_OPT_VDISK_ID "vdisk-id" ++#define VXHS_OPT_SERVER "server" ++#define VXHS_OPT_HOST "host" ++#define VXHS_OPT_PORT "port" ++ ++/* Only accessed under QEMU global mutex */ ++static uint32_t vxhs_ref; ++ ++typedef enum { ++ VDISK_AIO_READ, ++ VDISK_AIO_WRITE, ++} VDISKAIOCmd; ++ ++/* ++ * HyperScale AIO callbacks structure ++ */ ++typedef struct VXHSAIOCB { ++ BlockAIOCB common; ++ int err; ++} VXHSAIOCB; ++ ++typedef struct VXHSvDiskHostsInfo { ++ void *dev_handle; /* Device handle */ ++ char *host; /* Host name or IP */ ++ int port; /* Host's port number */ ++} VXHSvDiskHostsInfo; ++ ++/* ++ * Structure per vDisk maintained for state ++ */ ++typedef struct BDRVVXHSState { ++ VXHSvDiskHostsInfo vdisk_hostinfo; /* Per host info */ ++ char *vdisk_guid; ++ char *tlscredsid; /* tlscredsid */ ++} BDRVVXHSState; ++ ++static void vxhs_complete_aio_bh(void *opaque) ++{ ++ VXHSAIOCB *acb = opaque; ++ BlockCompletionFunc *cb = acb->common.cb; ++ void *cb_opaque = acb->common.opaque; ++ int ret = 0; ++ ++ if (acb->err != 0) { ++ trace_vxhs_complete_aio(acb, acb->err); ++ ret = (-EIO); ++ } ++ ++ qemu_aio_unref(acb); ++ cb(cb_opaque, ret); ++} ++ ++/* ++ * Called from a libqnio thread ++ */ ++static void vxhs_iio_callback(void *ctx, uint32_t opcode, uint32_t error) ++{ ++ VXHSAIOCB *acb = NULL; ++ ++ switch (opcode) { ++ case IRP_READ_REQUEST: ++ case IRP_WRITE_REQUEST: ++ ++ /* ++ * ctx is VXHSAIOCB* ++ * ctx is NULL if error is QNIOERROR_CHANNEL_HUP ++ */ ++ if (ctx) { ++ acb = ctx; ++ } else { ++ trace_vxhs_iio_callback(error); ++ goto out; ++ } ++ ++ if (error) { ++ if (!acb->err) { ++ acb->err = error; ++ } ++ trace_vxhs_iio_callback(error); ++ } ++ ++ aio_bh_schedule_oneshot(bdrv_get_aio_context(acb->common.bs), ++ vxhs_complete_aio_bh, acb); ++ break; ++ ++ default: ++ if (error == QNIOERROR_HUP) { ++ /* ++ * Channel failed, spontaneous notification, ++ * not in response to I/O ++ */ ++ trace_vxhs_iio_callback_chnfail(error, errno); ++ } else { ++ trace_vxhs_iio_callback_unknwn(opcode, error); ++ } ++ break; ++ } ++out: ++ return; ++} ++ ++static QemuOptsList runtime_opts = { ++ .name = "vxhs", ++ .head = QTAILQ_HEAD_INITIALIZER(runtime_opts.head), ++ .desc = { ++ { ++ .name = VXHS_OPT_FILENAME, ++ .type = QEMU_OPT_STRING, ++ .help = "URI to the Veritas HyperScale image", ++ }, ++ { ++ .name = VXHS_OPT_VDISK_ID, ++ .type = QEMU_OPT_STRING, ++ .help = "UUID of the VxHS vdisk", ++ }, ++ { ++ .name = "tls-creds", ++ .type = QEMU_OPT_STRING, ++ .help = "ID of the TLS/SSL credentials to use", ++ }, ++ { /* end of list */ } ++ }, ++}; ++ ++static QemuOptsList runtime_tcp_opts = { ++ .name = "vxhs_tcp", ++ .head = QTAILQ_HEAD_INITIALIZER(runtime_tcp_opts.head), ++ .desc = { ++ { ++ .name = VXHS_OPT_HOST, ++ .type = QEMU_OPT_STRING, ++ .help = "host address (ipv4 addresses)", ++ }, ++ { ++ .name = VXHS_OPT_PORT, ++ .type = QEMU_OPT_NUMBER, ++ .help = "port number on which VxHSD is listening (default 9999)", ++ .def_value_str = "9999" ++ }, ++ { /* end of list */ } ++ }, ++}; ++ ++/* ++ * Parse incoming URI and populate *options with the host ++ * and device information ++ */ ++static int vxhs_parse_uri(const char *filename, QDict *options) ++{ ++ URI *uri = NULL; ++ char *port; ++ int ret = 0; ++ ++ trace_vxhs_parse_uri_filename(filename); ++ uri = uri_parse(filename); ++ if (!uri || !uri->server || !uri->path) { ++ uri_free(uri); ++ return -EINVAL; ++ } ++ ++ qdict_put(options, VXHS_OPT_SERVER".host", qstring_from_str(uri->server)); ++ ++ if (uri->port) { ++ port = g_strdup_printf("%d", uri->port); ++ qdict_put(options, VXHS_OPT_SERVER".port", qstring_from_str(port)); ++ g_free(port); ++ } ++ ++ qdict_put(options, "vdisk-id", qstring_from_str(uri->path)); ++ ++ trace_vxhs_parse_uri_hostinfo(uri->server, uri->port); ++ uri_free(uri); ++ ++ return ret; ++} ++ ++static void vxhs_parse_filename(const char *filename, QDict *options, ++ Error **errp) ++{ ++ if (qdict_haskey(options, "vdisk-id") || qdict_haskey(options, "server")) { ++ error_setg(errp, "vdisk-id/server and a file name may not be specified " ++ "at the same time"); ++ return; ++ } ++ ++ if (strstr(filename, "://")) { ++ int ret = vxhs_parse_uri(filename, options); ++ if (ret < 0) { ++ error_setg(errp, "Invalid URI. URI should be of the form " ++ " vxhs://:/"); ++ } ++ } ++} ++ ++static int vxhs_init_and_ref(void) ++{ ++ if (vxhs_ref++ == 0) { ++ if (iio_init(QNIO_VERSION, vxhs_iio_callback)) { ++ return -ENODEV; ++ } ++ } ++ return 0; ++} ++ ++static void vxhs_unref(void) ++{ ++ if (--vxhs_ref == 0) { ++ iio_fini(); ++ } ++} ++ ++static void vxhs_get_tls_creds(const char *id, char **cacert, ++ char **key, char **cert, Error **errp) ++{ ++ Object *obj; ++ QCryptoTLSCreds *creds; ++ QCryptoTLSCredsX509 *creds_x509; ++ ++ obj = object_resolve_path_component( ++ object_get_objects_root(), id); ++ ++ if (!obj) { ++ error_setg(errp, "No TLS credentials with id '%s'", ++ id); ++ return; ++ } ++ ++ creds_x509 = (QCryptoTLSCredsX509 *) ++ object_dynamic_cast(obj, TYPE_QCRYPTO_TLS_CREDS_X509); ++ ++ if (!creds_x509) { ++ error_setg(errp, "Object with id '%s' is not TLS credentials", ++ id); ++ return; ++ } ++ ++ creds = &creds_x509->parent_obj; ++ ++ if (creds->endpoint != QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT) { ++ error_setg(errp, ++ "Expecting TLS credentials with a client endpoint"); ++ return; ++ } ++ ++ /* ++ * Get the cacert, client_cert and client_key file names. ++ */ ++ if (!creds->dir) { ++ error_setg(errp, "TLS object missing 'dir' property value"); ++ return; ++ } ++ ++ *cacert = g_strdup_printf("%s/%s", creds->dir, ++ QCRYPTO_TLS_CREDS_X509_CA_CERT); ++ *cert = g_strdup_printf("%s/%s", creds->dir, ++ QCRYPTO_TLS_CREDS_X509_CLIENT_CERT); ++ *key = g_strdup_printf("%s/%s", creds->dir, ++ QCRYPTO_TLS_CREDS_X509_CLIENT_KEY); ++} ++ ++static int vxhs_open(BlockDriverState *bs, QDict *options, ++ int bdrv_flags, Error **errp) ++{ ++ BDRVVXHSState *s = bs->opaque; ++ void *dev_handlep; ++ QDict *backing_options = NULL; ++ QemuOpts *opts = NULL; ++ QemuOpts *tcp_opts = NULL; ++ char *of_vsa_addr = NULL; ++ Error *local_err = NULL; ++ const char *vdisk_id_opt; ++ const char *server_host_opt; ++ int ret = 0; ++ char *cacert = NULL; ++ char *client_key = NULL; ++ char *client_cert = NULL; ++ ++ ret = vxhs_init_and_ref(); ++ if (ret < 0) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ /* Create opts info from runtime_opts and runtime_tcp_opts list */ ++ opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); ++ tcp_opts = qemu_opts_create(&runtime_tcp_opts, NULL, 0, &error_abort); ++ ++ qemu_opts_absorb_qdict(opts, options, &local_err); ++ if (local_err) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ /* vdisk-id is the disk UUID */ ++ vdisk_id_opt = qemu_opt_get(opts, VXHS_OPT_VDISK_ID); ++ if (!vdisk_id_opt) { ++ error_setg(&local_err, QERR_MISSING_PARAMETER, VXHS_OPT_VDISK_ID); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ /* vdisk-id may contain a leading '/' */ ++ if (strlen(vdisk_id_opt) > UUID_FMT_LEN + 1) { ++ error_setg(&local_err, "vdisk-id cannot be more than %d characters", ++ UUID_FMT_LEN); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ s->vdisk_guid = g_strdup(vdisk_id_opt); ++ trace_vxhs_open_vdiskid(vdisk_id_opt); ++ ++ /* get the 'server.' arguments */ ++ qdict_extract_subqdict(options, &backing_options, VXHS_OPT_SERVER"."); ++ ++ qemu_opts_absorb_qdict(tcp_opts, backing_options, &local_err); ++ if (local_err != NULL) { ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ server_host_opt = qemu_opt_get(tcp_opts, VXHS_OPT_HOST); ++ if (!server_host_opt) { ++ error_setg(&local_err, QERR_MISSING_PARAMETER, ++ VXHS_OPT_SERVER"."VXHS_OPT_HOST); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ if (strlen(server_host_opt) > MAXHOSTNAMELEN) { ++ error_setg(&local_err, "server.host cannot be more than %d characters", ++ MAXHOSTNAMELEN); ++ ret = -EINVAL; ++ goto out; ++ } ++ ++ /* check if we got tls-creds via the --object argument */ ++ s->tlscredsid = g_strdup(qemu_opt_get(opts, "tls-creds")); ++ if (s->tlscredsid) { ++ vxhs_get_tls_creds(s->tlscredsid, &cacert, &client_key, ++ &client_cert, &local_err); ++ if (local_err != NULL) { ++ ret = -EINVAL; ++ goto out; ++ } ++ trace_vxhs_get_creds(cacert, client_key, client_cert); ++ } ++ ++ s->vdisk_hostinfo.host = g_strdup(server_host_opt); ++ s->vdisk_hostinfo.port = g_ascii_strtoll(qemu_opt_get(tcp_opts, ++ VXHS_OPT_PORT), ++ NULL, 0); ++ ++ trace_vxhs_open_hostinfo(s->vdisk_hostinfo.host, ++ s->vdisk_hostinfo.port); ++ ++ of_vsa_addr = g_strdup_printf("of://%s:%d", ++ s->vdisk_hostinfo.host, ++ s->vdisk_hostinfo.port); ++ ++ /* ++ * Open qnio channel to storage agent if not opened before ++ */ ++ dev_handlep = iio_open(of_vsa_addr, s->vdisk_guid, 0, ++ cacert, client_key, client_cert); ++ if (dev_handlep == NULL) { ++ trace_vxhs_open_iio_open(of_vsa_addr); ++ ret = -ENODEV; ++ goto out; ++ } ++ s->vdisk_hostinfo.dev_handle = dev_handlep; ++ ++out: ++ g_free(of_vsa_addr); ++ QDECREF(backing_options); ++ qemu_opts_del(tcp_opts); ++ qemu_opts_del(opts); ++ g_free(cacert); ++ g_free(client_key); ++ g_free(client_cert); ++ ++ if (ret < 0) { ++ vxhs_unref(); ++ error_propagate(errp, local_err); ++ g_free(s->vdisk_hostinfo.host); ++ g_free(s->vdisk_guid); ++ g_free(s->tlscredsid); ++ s->vdisk_guid = NULL; ++ } ++ ++ return ret; ++} ++ ++static const AIOCBInfo vxhs_aiocb_info = { ++ .aiocb_size = sizeof(VXHSAIOCB) ++}; ++ ++/* ++ * This allocates QEMU-VXHS callback for each IO ++ * and is passed to QNIO. When QNIO completes the work, ++ * it will be passed back through the callback. ++ */ ++static BlockAIOCB *vxhs_aio_rw(BlockDriverState *bs, int64_t sector_num, ++ QEMUIOVector *qiov, int nb_sectors, ++ BlockCompletionFunc *cb, void *opaque, ++ VDISKAIOCmd iodir) ++{ ++ VXHSAIOCB *acb = NULL; ++ BDRVVXHSState *s = bs->opaque; ++ size_t size; ++ uint64_t offset; ++ int iio_flags = 0; ++ int ret = 0; ++ void *dev_handle = s->vdisk_hostinfo.dev_handle; ++ ++ offset = sector_num * BDRV_SECTOR_SIZE; ++ size = nb_sectors * BDRV_SECTOR_SIZE; ++ acb = qemu_aio_get(&vxhs_aiocb_info, bs, cb, opaque); ++ ++ /* ++ * Initialize VXHSAIOCB. ++ */ ++ acb->err = 0; ++ ++ iio_flags = IIO_FLAG_ASYNC; ++ ++ switch (iodir) { ++ case VDISK_AIO_WRITE: ++ ret = iio_writev(dev_handle, acb, qiov->iov, qiov->niov, ++ offset, (uint64_t)size, iio_flags); ++ break; ++ case VDISK_AIO_READ: ++ ret = iio_readv(dev_handle, acb, qiov->iov, qiov->niov, ++ offset, (uint64_t)size, iio_flags); ++ break; ++ default: ++ trace_vxhs_aio_rw_invalid(iodir); ++ goto errout; ++ } ++ ++ if (ret != 0) { ++ trace_vxhs_aio_rw_ioerr(s->vdisk_guid, iodir, size, offset, ++ acb, ret, errno); ++ goto errout; ++ } ++ return &acb->common; ++ ++errout: ++ qemu_aio_unref(acb); ++ return NULL; ++} ++ ++static BlockAIOCB *vxhs_aio_readv(BlockDriverState *bs, ++ int64_t sector_num, QEMUIOVector *qiov, ++ int nb_sectors, ++ BlockCompletionFunc *cb, void *opaque) ++{ ++ return vxhs_aio_rw(bs, sector_num, qiov, nb_sectors, cb, ++ opaque, VDISK_AIO_READ); ++} ++ ++static BlockAIOCB *vxhs_aio_writev(BlockDriverState *bs, ++ int64_t sector_num, QEMUIOVector *qiov, ++ int nb_sectors, ++ BlockCompletionFunc *cb, void *opaque) ++{ ++ return vxhs_aio_rw(bs, sector_num, qiov, nb_sectors, ++ cb, opaque, VDISK_AIO_WRITE); ++} ++ ++static void vxhs_close(BlockDriverState *bs) ++{ ++ BDRVVXHSState *s = bs->opaque; ++ ++ trace_vxhs_close(s->vdisk_guid); ++ ++ g_free(s->vdisk_guid); ++ s->vdisk_guid = NULL; ++ ++ /* ++ * Close vDisk device ++ */ ++ if (s->vdisk_hostinfo.dev_handle) { ++ iio_close(s->vdisk_hostinfo.dev_handle); ++ s->vdisk_hostinfo.dev_handle = NULL; ++ } ++ ++ vxhs_unref(); ++ ++ /* ++ * Free the dynamically allocated host string etc ++ */ ++ g_free(s->vdisk_hostinfo.host); ++ g_free(s->tlscredsid); ++ s->tlscredsid = NULL; ++ s->vdisk_hostinfo.host = NULL; ++ s->vdisk_hostinfo.port = 0; ++} ++ ++static int64_t vxhs_get_vdisk_stat(BDRVVXHSState *s) ++{ ++ int64_t vdisk_size = -1; ++ int ret = 0; ++ void *dev_handle = s->vdisk_hostinfo.dev_handle; ++ ++ ret = iio_ioctl(dev_handle, IOR_VDISK_STAT, &vdisk_size, 0); ++ if (ret < 0) { ++ trace_vxhs_get_vdisk_stat_err(s->vdisk_guid, ret, errno); ++ return -EIO; ++ } ++ ++ trace_vxhs_get_vdisk_stat(s->vdisk_guid, vdisk_size); ++ return vdisk_size; ++} ++ ++/* ++ * Returns the size of vDisk in bytes. This is required ++ * by QEMU block upper block layer so that it is visible ++ * to guest. ++ */ ++static int64_t vxhs_getlength(BlockDriverState *bs) ++{ ++ BDRVVXHSState *s = bs->opaque; ++ int64_t vdisk_size; ++ ++ vdisk_size = vxhs_get_vdisk_stat(s); ++ if (vdisk_size < 0) { ++ return -EIO; ++ } ++ ++ return vdisk_size; ++} ++ ++static BlockDriver bdrv_vxhs = { ++ .format_name = "vxhs", ++ .protocol_name = "vxhs", ++ .instance_size = sizeof(BDRVVXHSState), ++ .bdrv_file_open = vxhs_open, ++ .bdrv_parse_filename = vxhs_parse_filename, ++ .bdrv_close = vxhs_close, ++ .bdrv_getlength = vxhs_getlength, ++ .bdrv_aio_readv = vxhs_aio_readv, ++ .bdrv_aio_writev = vxhs_aio_writev, ++}; ++ ++static void bdrv_vxhs_init(void) ++{ ++ bdrv_register(&bdrv_vxhs); ++} ++ ++block_init(bdrv_vxhs_init); +diff --git a/configure b/configure +index a1842a8..47b2475 100755 +--- a/configure ++++ b/configure +@@ -321,6 +321,7 @@ numa="" + tcmalloc="no" + jemalloc="no" + replication="yes" ++vxhs="" + + supported_cpu="no" + supported_os="no" +@@ -1188,6 +1189,10 @@ for opt do + ;; + --enable-live-block-migration) live_block_migration="yes" + ;; ++ --disable-vxhs) vxhs="no" ++ ;; ++ --enable-vxhs) vxhs="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1433,6 +1438,7 @@ disabled with --disable-FEATURE, default is enabled if available: + xfsctl xfsctl support + qom-cast-debug cast debugging support + tools build qemu-io, qemu-nbd and qemu-image tools ++ vxhs Veritas HyperScale vDisk backend support + + NOTE: The object files are built at the place where configure is launched + EOF +@@ -4787,6 +4793,33 @@ if compile_prog "" "" ; then + fi + + ########################################## ++# Veritas HyperScale block driver VxHS ++# Check if libvxhs is installed ++ ++if test "$vxhs" != "no" ; then ++ cat > $TMPC < ++#include ++ ++void *vxhs_callback; ++ ++int main(void) { ++ iio_init(QNIO_VERSION, vxhs_callback); ++ return 0; ++} ++EOF ++ vxhs_libs="-lvxhs -lssl" ++ if compile_prog "" "$vxhs_libs" ; then ++ vxhs=yes ++ else ++ if test "$vxhs" = "yes" ; then ++ feature_not_found "vxhs block device" "Install libvxhs See github" ++ fi ++ vxhs=no ++ fi ++fi ++ ++########################################## + # End of CC checks + # After here, no more $cc or $ld runs + +@@ -5153,6 +5186,7 @@ echo "tcmalloc support $tcmalloc" + echo "jemalloc support $jemalloc" + echo "avx2 optimization $avx2_opt" + echo "replication support $replication" ++echo "VxHS block device $vxhs" + + if test "$sdl_too_old" = "yes"; then + echo "-> Your SDL version is too old - please upgrade to have SDL support" +@@ -5796,6 +5830,11 @@ if test "$pthread_setname_np" = "yes" ; then + echo "CONFIG_PTHREAD_SETNAME_NP=y" >> $config_host_mak + fi + ++if test "$vxhs" = "yes" ; then ++ echo "CONFIG_VXHS=y" >> $config_host_mak ++ echo "VXHS_LIBS=$vxhs_libs" >> $config_host_mak ++fi ++ + if test "$tcg_interpreter" = "yes"; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + elif test "$ARCH" = "sparc64" ; then +diff --git a/qapi/block-core.json b/qapi/block-core.json +index 68ad316..e9fcffb 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -2108,6 +2108,8 @@ + # + # Drivers that are supported in block device operations. + # ++# @vxhs: Since 2.10 ++# + # Since: 2.9 + ## + { 'enum': 'BlockdevDriver', +@@ -2116,7 +2118,7 @@ + 'host_device', 'http', 'https', 'iscsi', 'luks', 'nbd', 'nfs', + 'null-aio', 'null-co', 'parallels', 'qcow', 'qcow2', 'qed', + 'quorum', 'raw', 'rbd', 'replication', 'sheepdog', 'ssh', +- 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } ++ 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat', 'vxhs' ] } + + ## + # @BlockdevOptionsFile: +@@ -2866,6 +2868,22 @@ + 'data': { '*offset': 'int', '*size': 'int' } } + + ## ++# @BlockdevOptionsVxHS: ++# ++# Driver specific block device options for VxHS ++# ++# @vdisk-id: UUID of VxHS volume ++# @server: vxhs server IP, port ++# @tls-creds: TLS credentials ID ++# ++# Since: 2.10 ++## ++{ 'struct': 'BlockdevOptionsVxHS', ++ 'data': { 'vdisk-id': 'str', ++ 'server': 'InetSocketAddressBase', ++ '*tls-creds': 'str' } } ++ ++## + # @BlockdevOptions: + # + # Options for creating a block device. Many options are available for all +@@ -2927,7 +2945,8 @@ + 'vhdx': 'BlockdevOptionsGenericFormat', + 'vmdk': 'BlockdevOptionsGenericCOWFormat', + 'vpc': 'BlockdevOptionsGenericFormat', +- 'vvfat': 'BlockdevOptionsVVFAT' ++ 'vvfat': 'BlockdevOptionsVVFAT', ++ 'vxhs': 'BlockdevOptionsVxHS' + } } + + ## +-- +1.8.3.1 + diff --git a/SOURCES/kvm-blockdev-ignore-aio-native-for-empty-drives.patch b/SOURCES/kvm-blockdev-ignore-aio-native-for-empty-drives.patch new file mode 100644 index 0000000..f750d4d --- /dev/null +++ b/SOURCES/kvm-blockdev-ignore-aio-native-for-empty-drives.patch @@ -0,0 +1,73 @@ +From cda174ad842c9a61bc275315bf3155139ba19bc0 Mon Sep 17 00:00:00 2001 +From: John Snow +Date: Thu, 11 May 2017 20:53:51 +0200 +Subject: [PATCH 1/5] blockdev: ignore aio=native for empty drives + +RH-Author: John Snow +Message-id: <20170511205351.6337-2-jsnow@redhat.com> +Patchwork-id: 75070 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] blockdev: ignore aio=native for empty drives +Bugzilla: 1402645 +RH-Acked-by: Kevin Wolf +RH-Acked-by: Eric Blake +RH-Acked-by: Max Reitz + +This is a bit of a gross one; Upstream QEMU changed the way it handles +cache options with regards to removable media, associating options more +with the medium instead of the device. As part of that, it became +impossible to specify cache options on empty drives. + +In the future, one would use blockdev-add instead to choose cache options +per-medium instead of per-device, but we're not there yet in libvirt so +we added a workaround downstream to simply ignore cache options on empty +CDROMs under the premise of "It actually never worked anyway." + +As fallout from this decision, it is now no longer possible to specify +aio=native on empty CDROM devices either, as that requires the use of a +cache option that you can no longer specify. As a bad, gross, disgusting +workaround, simply ignore aio=native on empty drives until such time that +libvirt stops providing such configurations. + +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 17 ++++++++++++++++- + 1 file changed, 16 insertions(+), 1 deletion(-) + +diff --git a/blockdev.c b/blockdev.c +index a52e035..033c3fd 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -474,6 +474,21 @@ static bool __redhat_com_has_bs_opts(QDict *bs_opts) + return s != n; + } + ++/** ++ * libvirt expects to be able to pass io driver options (aio=native) for CDROM ++ * drives without inserted media. While this has worked historically, given the ++ * above workaround and lack of a supported alternative in current versions of ++ * libvirt, certain options such as aio=native cannot be supported as it ++ * requires the use of an accompanying cache option, which we also ignore. ++ * Until libvirt learns how to supply cache options to inserted media, ignore ++ * the aio= preference on empty CDROMs with the understanding that un-tuned ++ * performance is preferable to being unable to use the CDROM at all. ++ */ ++static int __redhat_com_filter_flags(int flags) ++{ ++ return flags & ~BDRV_O_NATIVE_AIO; ++} ++ + /* Takes the ownership of bs_opts */ + static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + Error **errp) +@@ -586,7 +601,7 @@ static BlockBackend *blockdev_init(const char *file, QDict *bs_opts, + + blk = blk_new(0, BLK_PERM_ALL); + blk_rs = blk_get_root_state(blk); +- blk_rs->open_flags = bdrv_flags; ++ blk_rs->open_flags = __redhat_com_filter_flags(bdrv_flags); + blk_rs->read_only = read_only; + blk_rs->detect_zeroes = detect_zeroes; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-blockdev-use-drained_begin-end-for-qmp_block_resize.patch b/SOURCES/kvm-blockdev-use-drained_begin-end-for-qmp_block_resize.patch new file mode 100644 index 0000000..9de4b31 --- /dev/null +++ b/SOURCES/kvm-blockdev-use-drained_begin-end-for-qmp_block_resize.patch @@ -0,0 +1,56 @@ +From 9d7066090ad7cde8ce74aa2566959fe7789908b9 Mon Sep 17 00:00:00 2001 +From: John Snow +Date: Tue, 16 May 2017 21:00:41 +0200 +Subject: [PATCH 05/27] blockdev: use drained_begin/end for qmp_block_resize + +RH-Author: John Snow +Message-id: <20170516210041.12856-4-jsnow@redhat.com> +Patchwork-id: 75196 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH v2 3/3] blockdev: use drained_begin/end for qmp_block_resize +Bugzilla: 1447551 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Paolo Bonzini + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1447551 + +If one tries to issue a block_resize while a guest is busy +accessing the disk, it is possible that qemu may deadlock +when invoking aio_poll from both the main loop and the iothread. + +Replace another instance of bdrv_drain_all that doesn't +quite belong. + +Cc: qemu-stable@nongnu.org +Suggested-by: Paolo Bonzini +Signed-off-by: John Snow +Reviewed-by: Eric Blake +Reviewed-by: Paolo Bonzini +Signed-off-by: Kevin Wolf +(cherry picked from commit 698bdfa07d66b5ec218a60229e58eae1dcde00e5) +Signed-off-by: John Snow +Signed-off-by: Miroslav Rezanina +--- + blockdev.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/blockdev.c b/blockdev.c +index 6a50742..b0894fa 100644 +--- a/blockdev.c ++++ b/blockdev.c +@@ -2972,10 +2972,9 @@ void qmp_block_resize(bool has_device, const char *device, + goto out; + } + +- /* complete all in-flight operations before resizing the device */ +- bdrv_drain_all(); +- ++ bdrv_drained_begin(bs); + ret = blk_truncate(blk, size, errp); ++ bdrv_drained_end(bs); + + out: + blk_unref(blk); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-commit-Fix-completion-with-extra-reference.patch b/SOURCES/kvm-commit-Fix-completion-with-extra-reference.patch new file mode 100644 index 0000000..f9f3d15 --- /dev/null +++ b/SOURCES/kvm-commit-Fix-completion-with-extra-reference.patch @@ -0,0 +1,54 @@ +From 0ed4b7e81898ee7003aee3488a0fa693474a0890 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jun 2017 13:33:33 +0200 +Subject: [PATCH 07/13] commit: Fix completion with extra reference + +RH-Author: Kevin Wolf +Message-id: <1497274415-4884-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75588 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/3] commit: Fix completion with extra reference +Bugzilla: 1453169 +RH-Acked-by: Max Reitz +RH-Acked-by: Jeffrey Cody +RH-Acked-by: John Snow + +commit_complete() can't assume that after its block_job_completed() the +job is actually immediately freed; someone else may still be holding +references. In this case, the op blockers on the intermediate nodes make +the graph reconfiguration in the completion code fail. + +Call block_job_remove_all_bdrv() manually so that we know for sure that +any blockers on intermediate nodes are given up. + +Upstream status: Applied to git://repo.or.cz/qemu/kevin.git block +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +Reviewed-by: Max Reitz + +Signed-off-by: Miroslav Rezanina +--- + block/commit.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/block/commit.c b/block/commit.c +index 3bae46e..fba25e2 100644 +--- a/block/commit.c ++++ b/block/commit.c +@@ -119,6 +119,13 @@ static void commit_complete(BlockJob *job, void *opaque) + } + g_free(s->backing_file_str); + blk_unref(s->top); ++ ++ /* If there is more than one reference to the job (e.g. if called from ++ * block_job_finish_sync()), block_job_completed() won't free it and ++ * therefore the blockers on the intermediate nodes remain. This would ++ * cause bdrv_set_backing_hd() to fail. */ ++ block_job_remove_all_bdrv(job); ++ + block_job_completed(&s->common, ret); + g_free(data); + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-commit-Fix-use-after-free-in-completion.patch b/SOURCES/kvm-commit-Fix-use-after-free-in-completion.patch new file mode 100644 index 0000000..9450c7e --- /dev/null +++ b/SOURCES/kvm-commit-Fix-use-after-free-in-completion.patch @@ -0,0 +1,61 @@ +From 43003baf954053a0857535220292294512c8ada2 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jun 2017 13:03:41 +0200 +Subject: [PATCH 05/13] commit: Fix use after free in completion + +RH-Author: Kevin Wolf +Message-id: <1497272622-32221-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75583 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/2] commit: Fix use after free in completion +Bugzilla: 1452048 +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +The final bdrv_set_backing_hd() could be working on already freed nodes +because the commit job drops its references (through BlockBackends) to +both overlay_bs and top already a bit earlier. + +One way to trigger the bug is hot unplugging a disk for which +blockdev_mark_auto_del() cancels the block job. + +Fix this by taking BDS-level references while we're still using the +nodes. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Reviewed-by: John Snow +(cherry picked from commit 19ebd13ed45ad5d5f277f5914d55b83f13eb09eb) +Signed-off-by: Miroslav Rezanina +--- + block/commit.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/block/commit.c b/block/commit.c +index 76a0d98..3bae46e 100644 +--- a/block/commit.c ++++ b/block/commit.c +@@ -89,6 +89,10 @@ static void commit_complete(BlockJob *job, void *opaque) + int ret = data->ret; + bool remove_commit_top_bs = false; + ++ /* Make sure overlay_bs and top stay around until bdrv_set_backing_hd() */ ++ bdrv_ref(top); ++ bdrv_ref(overlay_bs); ++ + /* Remove base node parent that still uses BLK_PERM_WRITE/RESIZE before + * the normal backing chain can be restored. */ + blk_unref(s->base); +@@ -124,6 +128,9 @@ static void commit_complete(BlockJob *job, void *opaque) + if (remove_commit_top_bs) { + bdrv_set_backing_hd(overlay_bs, top, &error_abort); + } ++ ++ bdrv_unref(overlay_bs); ++ bdrv_unref(top); + } + + static void coroutine_fn commit_run(void *opaque) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-configure-allow-to-disable-VT-d-emulation.patch b/SOURCES/kvm-configure-allow-to-disable-VT-d-emulation.patch new file mode 100644 index 0000000..8def1a3 --- /dev/null +++ b/SOURCES/kvm-configure-allow-to-disable-VT-d-emulation.patch @@ -0,0 +1,93 @@ +From f1ec0e873266ddec6eca3f52a1a9d5ee479ae3f5 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Wed, 19 Jul 2017 07:25:08 +0200 +Subject: [PATCH 12/17] configure: allow to disable VT-d emulation + +RH-Author: Peter Xu +Message-id: <1500449109-20652-2-git-send-email-peterx@redhat.com> +Patchwork-id: 75809 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 1/2] configure: allow to disable VT-d emulation +Bugzilla: 1465450 +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Jeffrey Cody + +Provide a way to disable VT-d emulation for x86 guests. + +x86-iommu.c is still required since it provides some interfaces that is +used in common codes, like ACPI. + +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + configure | 11 +++++++++++ + hw/i386/Makefile.objs | 3 ++- + 2 files changed, 13 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index b019b33..a658481 100755 +--- a/configure ++++ b/configure +@@ -323,6 +323,7 @@ tcmalloc="no" + jemalloc="no" + replication="yes" + vxhs="" ++vtd="yes" + + supported_cpu="no" + supported_os="no" +@@ -1194,6 +1195,10 @@ for opt do + ;; + --enable-vxhs) vxhs="yes" + ;; ++ --disable-vtd) vtd="no" ++ ;; ++ --enable-vtd) vtd="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1440,6 +1445,7 @@ disabled with --disable-FEATURE, default is enabled if available: + qom-cast-debug cast debugging support + tools build qemu-io, qemu-nbd and qemu-image tools + vxhs Veritas HyperScale vDisk backend support ++ vtd Emulated VT-d support (only affects x86 targets) + + NOTE: The object files are built at the place where configure is launched + EOF +@@ -5162,6 +5168,7 @@ echo "jemalloc support $jemalloc" + echo "avx2 optimization $avx2_opt" + echo "replication support $replication" + echo "VxHS block device $vxhs" ++echo "VT-d emulation $vtd" + + if test "$sdl_too_old" = "yes"; then + echo "-> Your SDL version is too old - please upgrade to have SDL support" +@@ -5814,6 +5821,10 @@ if test "$vxhs" = "yes" ; then + echo "VXHS_LIBS= -lssl" >> $config_host_mak + fi + ++if test "$vtd" = "yes" ; then ++ echo "CONFIG_VTD=y" >> $config_host_mak ++fi ++ + if test "$tcg_interpreter" = "yes"; then + QEMU_INCLUDES="-I\$(SRC_PATH)/tcg/tci $QEMU_INCLUDES" + elif test "$ARCH" = "sparc64" ; then +diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs +index a15db94..68a2c3b 100644 +--- a/hw/i386/Makefile.objs ++++ b/hw/i386/Makefile.objs +@@ -2,7 +2,8 @@ obj-$(CONFIG_KVM) += kvm/ + obj-y += multiboot.o + obj-y += pc.o pc_piix.o pc_q35.o + obj-y += pc_sysfw.o +-obj-y += x86-iommu.o intel_iommu.o ++obj-y += x86-iommu.o ++obj-$(CONFIG_VTD) += intel_iommu.o + # Disabled in Red Hat Enterprise Linux + # obj-y += amd_iommu.o + obj-$(CONFIG_XEN) += ../xenpv/ xen/ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-cpu-don-t-allow-negative-core-id.patch b/SOURCES/kvm-cpu-don-t-allow-negative-core-id.patch new file mode 100644 index 0000000..640cef4 --- /dev/null +++ b/SOURCES/kvm-cpu-don-t-allow-negative-core-id.patch @@ -0,0 +1,54 @@ +From 32fb43910b25c19261f4c3153a7442713cbc4de3 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Fri, 4 Aug 2017 16:50:30 +0200 +Subject: [PATCH 2/4] cpu: don't allow negative core id + +RH-Author: Laurent Vivier +Message-id: <20170804165030.26586-1-lvivier@redhat.com> +Patchwork-id: 75897 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] cpu: don't allow negative core id +Bugzilla: 1476181 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Eduardo Habkost + +With pseries machine type a negative core-id is not managed properly: +-1 gives an inaccurate error message ("core -1 already populated"), +-2 crashes QEMU (core dump) + +As it seems a negative value is invalid for any architecture, +instead of checking this in spapr_core_pre_plug() I think it's better +to check this in the generic part, core_prop_set_core_id() + +Signed-off-by: Laurent Vivier +Message-Id: <20170802103259.25940-1-lvivier@redhat.com> +Reviewed-by: Greg Kurz +Reviewed-by: David Gibson +Reviewed-by: Eduardo Habkost +Signed-off-by: Eduardo Habkost +(cherry picked from commit be2960baae07e5257cde8c814cbd91647e235147) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/cpu/core.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/hw/cpu/core.c b/hw/cpu/core.c +index 2bf960d..bd578ab 100644 +--- a/hw/cpu/core.c ++++ b/hw/cpu/core.c +@@ -33,6 +33,11 @@ static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name, + return; + } + ++ if (value < 0) { ++ error_setg(errp, "Invalid core id %"PRId64, value); ++ return; ++ } ++ + core->core_id = value; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-avoid-recursive-locking-of-BDRVCURLState-mutex.patch b/SOURCES/kvm-curl-avoid-recursive-locking-of-BDRVCURLState-mutex.patch new file mode 100644 index 0000000..74eb5f3 --- /dev/null +++ b/SOURCES/kvm-curl-avoid-recursive-locking-of-BDRVCURLState-mutex.patch @@ -0,0 +1,141 @@ +From e8ba6a37c3ab919f93c82639ea646d34c0bdc23a Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:17 +0200 +Subject: [PATCH 11/27] curl: avoid recursive locking of BDRVCURLState mutex + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-4-pbonzini@redhat.com> +Patchwork-id: 75261 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 3/7] curl: avoid recursive locking of BDRVCURLState mutex +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +The curl driver has a ugly hack where, if it cannot find an empty CURLState, +it just uses aio_poll to wait for one to be empty. This is probably +buggy when used together with dataplane, and the simplest way to fix it +is to use coroutines instead. + +A more immediate effect of the bug however is that it can cause a +recursive call to curl_readv_bh_cb and recursively taking the +BDRVCURLState mutex. This causes a deadlock. + +The fix is to unlock the mutex around aio_poll, but for cleanliness we +should also take the mutex around all calls to curl_init_state, even if +reaching the unlock/lock pair is impossible. The same is true for +curl_clean_state. + +Reported-by: Kun Wei +Tested-by: Richard W.M. Jones +Reviewed-by: Max Reitz +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Message-id: 20170515100059.15795-4-pbonzini@redhat.com +Cc: qemu-stable@nongnu.org +Cc: Jeff Cody +Signed-off-by: Paolo Bonzini +Signed-off-by: Jeff Cody +(cherry picked from commit 456af346297ebef86aa097b3609534d34f3d2f75) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 14 +++++++++++++- + 1 file changed, 13 insertions(+), 1 deletion(-) + +diff --git a/block/curl.c b/block/curl.c +index 94a1e16..7001476 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -281,6 +281,7 @@ read_end: + return size * nmemb; + } + ++/* Called with s->mutex held. */ + static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len, + CURLAIOCB *acb) + { +@@ -453,6 +454,7 @@ static void curl_multi_timeout_do(void *arg) + #endif + } + ++/* Called with s->mutex held. */ + static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) + { + CURLState *state = NULL; +@@ -471,7 +473,9 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) + break; + } + if (!state) { ++ qemu_mutex_unlock(&s->mutex); + aio_poll(bdrv_get_aio_context(bs), true); ++ qemu_mutex_lock(&s->mutex); + } + } while(!state); + +@@ -534,6 +538,7 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) + return state; + } + ++/* Called with s->mutex held. */ + static void curl_clean_state(CURLState *s) + { + int j; +@@ -565,6 +570,7 @@ static void curl_detach_aio_context(BlockDriverState *bs) + BDRVCURLState *s = bs->opaque; + int i; + ++ qemu_mutex_lock(&s->mutex); + for (i = 0; i < CURL_NUM_STATES; i++) { + if (s->states[i].in_use) { + curl_clean_state(&s->states[i]); +@@ -580,6 +586,7 @@ static void curl_detach_aio_context(BlockDriverState *bs) + curl_multi_cleanup(s->multi); + s->multi = NULL; + } ++ qemu_mutex_unlock(&s->mutex); + + timer_del(&s->timer); + } +@@ -677,6 +684,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + return -EROFS; + } + ++ qemu_mutex_init(&s->mutex); + opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); + qemu_opts_absorb_qdict(opts, options, &local_err); + if (local_err) { +@@ -747,7 +755,9 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + DPRINTF("CURL: Opening %s\n", file); + s->aio_context = bdrv_get_aio_context(bs); + s->url = g_strdup(file); ++ qemu_mutex_lock(&s->mutex); + state = curl_init_state(bs, s); ++ qemu_mutex_unlock(&s->mutex); + if (!state) + goto out_noclean; + +@@ -791,11 +801,12 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + } + DPRINTF("CURL: Size = %zd\n", s->len); + ++ qemu_mutex_lock(&s->mutex); + curl_clean_state(state); ++ qemu_mutex_unlock(&s->mutex); + curl_easy_cleanup(state->curl); + state->curl = NULL; + +- qemu_mutex_init(&s->mutex); + curl_attach_aio_context(bs, bdrv_get_aio_context(bs)); + + qemu_opts_del(opts); +@@ -806,6 +817,7 @@ out: + curl_easy_cleanup(state->curl); + state->curl = NULL; + out_noclean: ++ qemu_mutex_destroy(&s->mutex); + g_free(s->cookie); + g_free(s->url); + qemu_opts_del(opts); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-convert-CURLAIOCB-to-byte-values.patch b/SOURCES/kvm-curl-convert-CURLAIOCB-to-byte-values.patch new file mode 100644 index 0000000..7535659 --- /dev/null +++ b/SOURCES/kvm-curl-convert-CURLAIOCB-to-byte-values.patch @@ -0,0 +1,169 @@ +From 684bca41b314efcb3cfd71c6681e9667b484e0ca Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:19 +0200 +Subject: [PATCH 13/27] curl: convert CURLAIOCB to byte values + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-6-pbonzini@redhat.com> +Patchwork-id: 75264 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 5/7] curl: convert CURLAIOCB to byte values +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +This is in preparation for the conversion from bdrv_aio_readv to +bdrv_co_preadv, and it also requires changing some of the size_t values +to uint64_t. This was broken before for disks > 2TB, but now it would +break at 4GB. + +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-6-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 2125e5ea6ea8f2c6dd9b06b023200da28fa0305b) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 44 ++++++++++++++++++++++---------------------- + 1 file changed, 22 insertions(+), 22 deletions(-) + +diff --git a/block/curl.c b/block/curl.c +index 75e63d3..cca6386 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -96,8 +96,8 @@ typedef struct CURLAIOCB { + BlockAIOCB common; + QEMUIOVector *qiov; + +- int64_t sector_num; +- int nb_sectors; ++ uint64_t offset; ++ uint64_t bytes; + + size_t start; + size_t end; +@@ -115,7 +115,7 @@ typedef struct CURLState + CURL *curl; + QLIST_HEAD(, CURLSocket) sockets; + char *orig_buf; +- size_t buf_start; ++ uint64_t buf_start; + size_t buf_off; + size_t buf_len; + char range[128]; +@@ -126,7 +126,7 @@ typedef struct CURLState + typedef struct BDRVCURLState { + CURLM *multi; + QEMUTimer timer; +- size_t len; ++ uint64_t len; + CURLState states[CURL_NUM_STATES]; + char *url; + size_t readahead_size; +@@ -257,7 +257,7 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + continue; + + if ((s->buf_off >= acb->end)) { +- size_t request_length = acb->nb_sectors * BDRV_SECTOR_SIZE; ++ size_t request_length = acb->bytes; + + qemu_iovec_from_buf(acb->qiov, 0, s->orig_buf + acb->start, + acb->end - acb->start); +@@ -282,18 +282,18 @@ read_end: + } + + /* Called with s->mutex held. */ +-static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len, ++static int curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, + CURLAIOCB *acb) + { + int i; +- size_t end = start + len; +- size_t clamped_end = MIN(end, s->len); +- size_t clamped_len = clamped_end - start; ++ uint64_t end = start + len; ++ uint64_t clamped_end = MIN(end, s->len); ++ uint64_t clamped_len = clamped_end - start; + + for (i=0; istates[i]; +- size_t buf_end = (state->buf_start + state->buf_off); +- size_t buf_fend = (state->buf_start + state->buf_len); ++ uint64_t buf_end = (state->buf_start + state->buf_off); ++ uint64_t buf_fend = (state->buf_start + state->buf_len); + + if (!state->orig_buf) + continue; +@@ -788,7 +788,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + } + #endif + +- s->len = (size_t)d; ++ s->len = d; + + if ((!strncasecmp(s->url, "http://", strlen("http://")) + || !strncasecmp(s->url, "https://", strlen("https://"))) +@@ -797,7 +797,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + "Server does not support 'range' (byte ranges)."); + goto out; + } +- DPRINTF("CURL: Size = %zd\n", s->len); ++ DPRINTF("CURL: Size = %" PRIu64 "\n", s->len); + + qemu_mutex_lock(&s->mutex); + curl_clean_state(state); +@@ -837,14 +837,14 @@ static void curl_readv_bh_cb(void *p) + BlockDriverState *bs = acb->common.bs; + BDRVCURLState *s = bs->opaque; + +- size_t start = acb->sector_num * BDRV_SECTOR_SIZE; +- size_t end; ++ uint64_t start = acb->offset; ++ uint64_t end; + + qemu_mutex_lock(&s->mutex); + + // In case we have the requested data already (e.g. read-ahead), + // we can just call the callback and be done. +- switch (curl_find_buf(s, start, acb->nb_sectors * BDRV_SECTOR_SIZE, acb)) { ++ switch (curl_find_buf(s, start, acb->bytes, acb)) { + case FIND_RET_OK: + ret = 0; + goto out; +@@ -872,7 +872,7 @@ static void curl_readv_bh_cb(void *p) + } + + acb->start = 0; +- acb->end = MIN(acb->nb_sectors * BDRV_SECTOR_SIZE, s->len - start); ++ acb->end = MIN(acb->bytes, s->len - start); + + state->buf_off = 0; + g_free(state->orig_buf); +@@ -887,9 +887,9 @@ static void curl_readv_bh_cb(void *p) + } + state->acb[0] = acb; + +- snprintf(state->range, 127, "%zd-%zd", start, end); +- DPRINTF("CURL (AIO): Reading %llu at %zd (%s)\n", +- (acb->nb_sectors * BDRV_SECTOR_SIZE), start, state->range); ++ snprintf(state->range, 127, "%" PRIu64 "-%" PRIu64, start, end); ++ DPRINTF("CURL (AIO): Reading %" PRIu64 " at %" PRIu64 " (%s)\n", ++ acb->bytes, start, state->range); + curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range); + + curl_multi_add_handle(s->multi, state->curl); +@@ -914,8 +914,8 @@ static BlockAIOCB *curl_aio_readv(BlockDriverState *bs, + acb = qemu_aio_get(&curl_aiocb_info, bs, cb, opaque); + + acb->qiov = qiov; +- acb->sector_num = sector_num; +- acb->nb_sectors = nb_sectors; ++ acb->offset = sector_num * BDRV_SECTOR_SIZE; ++ acb->bytes = nb_sectors * BDRV_SECTOR_SIZE; + + aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), curl_readv_bh_cb, acb); + return &acb->common; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-convert-readv-to-coroutines.patch b/SOURCES/kvm-curl-convert-readv-to-coroutines.patch new file mode 100644 index 0000000..8b6eac5 --- /dev/null +++ b/SOURCES/kvm-curl-convert-readv-to-coroutines.patch @@ -0,0 +1,263 @@ +From 952ef02c7ee3c2bdbe1856c394ff68b2677b3702 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:20 +0200 +Subject: [PATCH 14/27] curl: convert readv to coroutines + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-7-pbonzini@redhat.com> +Patchwork-id: 75268 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 6/7] curl: convert readv to coroutines +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +This is pretty simple. The bottom half goes away because, unlike +bdrv_aio_readv, coroutine-based read can return immediately without +yielding. However, for simplicity I kept the former bottom half +handler in a separate function. + +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-7-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 28256d8246f8905cc41cae3db50e5967059d4600) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 94 ++++++++++++++++++++++++------------------------------------ + 1 file changed, 38 insertions(+), 56 deletions(-) + +diff --git a/block/curl.c b/block/curl.c +index cca6386..acfbe52 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -76,10 +76,6 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, + #define CURL_TIMEOUT_DEFAULT 5 + #define CURL_TIMEOUT_MAX 10000 + +-#define FIND_RET_NONE 0 +-#define FIND_RET_OK 1 +-#define FIND_RET_WAIT 2 +- + #define CURL_BLOCK_OPT_URL "url" + #define CURL_BLOCK_OPT_READAHEAD "readahead" + #define CURL_BLOCK_OPT_SSLVERIFY "sslverify" +@@ -93,11 +89,12 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle, + struct BDRVCURLState; + + typedef struct CURLAIOCB { +- BlockAIOCB common; ++ Coroutine *co; + QEMUIOVector *qiov; + + uint64_t offset; + uint64_t bytes; ++ int ret; + + size_t start; + size_t end; +@@ -268,11 +265,11 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + request_length - offset); + } + ++ acb->ret = 0; ++ s->acb[i] = NULL; + qemu_mutex_unlock(&s->s->mutex); +- acb->common.cb(acb->common.opaque, 0); ++ aio_co_wake(acb->co); + qemu_mutex_lock(&s->s->mutex); +- qemu_aio_unref(acb); +- s->acb[i] = NULL; + } + } + +@@ -282,8 +279,8 @@ read_end: + } + + /* Called with s->mutex held. */ +-static int curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, +- CURLAIOCB *acb) ++static bool curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, ++ CURLAIOCB *acb) + { + int i; + uint64_t end = start + len; +@@ -312,7 +309,8 @@ static int curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, + if (clamped_len < len) { + qemu_iovec_memset(acb->qiov, clamped_len, 0, len - clamped_len); + } +- return FIND_RET_OK; ++ acb->ret = 0; ++ return true; + } + + // Wait for unfinished chunks +@@ -330,13 +328,13 @@ static int curl_find_buf(BDRVCURLState *s, uint64_t start, uint64_t len, + for (j=0; jacb[j]) { + state->acb[j] = acb; +- return FIND_RET_WAIT; ++ return true; + } + } + } + } + +- return FIND_RET_NONE; ++ return false; + } + + /* Called with s->mutex held. */ +@@ -381,11 +379,11 @@ static void curl_multi_check_completion(BDRVCURLState *s) + continue; + } + ++ acb->ret = -EIO; ++ state->acb[i] = NULL; + qemu_mutex_unlock(&s->mutex); +- acb->common.cb(acb->common.opaque, -EIO); ++ aio_co_wake(acb->co); + qemu_mutex_lock(&s->mutex); +- qemu_aio_unref(acb); +- state->acb[i] = NULL; + } + } + +@@ -822,19 +820,11 @@ out_noclean: + return -EINVAL; + } + +-static const AIOCBInfo curl_aiocb_info = { +- .aiocb_size = sizeof(CURLAIOCB), +-}; +- +- +-static void curl_readv_bh_cb(void *p) ++static void curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) + { + CURLState *state; + int running; +- int ret = -EINPROGRESS; + +- CURLAIOCB *acb = p; +- BlockDriverState *bs = acb->common.bs; + BDRVCURLState *s = bs->opaque; + + uint64_t start = acb->offset; +@@ -844,14 +834,8 @@ static void curl_readv_bh_cb(void *p) + + // In case we have the requested data already (e.g. read-ahead), + // we can just call the callback and be done. +- switch (curl_find_buf(s, start, acb->bytes, acb)) { +- case FIND_RET_OK: +- ret = 0; +- goto out; +- case FIND_RET_WAIT: +- goto out; +- default: +- break; ++ if (curl_find_buf(s, start, acb->bytes, acb)) { ++ goto out; + } + + // No cache found, so let's start a new request +@@ -867,7 +851,7 @@ static void curl_readv_bh_cb(void *p) + + if (curl_init_state(s, state) < 0) { + curl_clean_state(state); +- ret = -EIO; ++ acb->ret = -EIO; + goto out; + } + +@@ -882,7 +866,7 @@ static void curl_readv_bh_cb(void *p) + state->orig_buf = g_try_malloc(state->buf_len); + if (state->buf_len && state->orig_buf == NULL) { + curl_clean_state(state); +- ret = -ENOMEM; ++ acb->ret = -ENOMEM; + goto out; + } + state->acb[0] = acb; +@@ -899,26 +883,24 @@ static void curl_readv_bh_cb(void *p) + + out: + qemu_mutex_unlock(&s->mutex); +- if (ret != -EINPROGRESS) { +- acb->common.cb(acb->common.opaque, ret); +- qemu_aio_unref(acb); +- } + } + +-static BlockAIOCB *curl_aio_readv(BlockDriverState *bs, +- int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, +- BlockCompletionFunc *cb, void *opaque) ++static int coroutine_fn curl_co_preadv(BlockDriverState *bs, ++ uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, int flags) + { +- CURLAIOCB *acb; +- +- acb = qemu_aio_get(&curl_aiocb_info, bs, cb, opaque); +- +- acb->qiov = qiov; +- acb->offset = sector_num * BDRV_SECTOR_SIZE; +- acb->bytes = nb_sectors * BDRV_SECTOR_SIZE; +- +- aio_bh_schedule_oneshot(bdrv_get_aio_context(bs), curl_readv_bh_cb, acb); +- return &acb->common; ++ CURLAIOCB acb = { ++ .co = qemu_coroutine_self(), ++ .ret = -EINPROGRESS, ++ .qiov = qiov, ++ .offset = offset, ++ .bytes = bytes ++ }; ++ ++ curl_setup_preadv(bs, &acb); ++ while (acb.ret == -EINPROGRESS) { ++ qemu_coroutine_yield(); ++ } ++ return acb.ret; + } + + static void curl_close(BlockDriverState *bs) +@@ -949,7 +931,7 @@ static BlockDriver bdrv_http = { + .bdrv_close = curl_close, + .bdrv_getlength = curl_getlength, + +- .bdrv_aio_readv = curl_aio_readv, ++ .bdrv_co_preadv = curl_co_preadv, + + .bdrv_detach_aio_context = curl_detach_aio_context, + .bdrv_attach_aio_context = curl_attach_aio_context, +@@ -965,7 +947,7 @@ static BlockDriver bdrv_https = { + .bdrv_close = curl_close, + .bdrv_getlength = curl_getlength, + +- .bdrv_aio_readv = curl_aio_readv, ++ .bdrv_co_preadv = curl_co_preadv, + + .bdrv_detach_aio_context = curl_detach_aio_context, + .bdrv_attach_aio_context = curl_attach_aio_context, +@@ -981,7 +963,7 @@ static BlockDriver bdrv_ftp = { + .bdrv_close = curl_close, + .bdrv_getlength = curl_getlength, + +- .bdrv_aio_readv = curl_aio_readv, ++ .bdrv_co_preadv = curl_co_preadv, + + .bdrv_detach_aio_context = curl_detach_aio_context, + .bdrv_attach_aio_context = curl_attach_aio_context, +@@ -997,7 +979,7 @@ static BlockDriver bdrv_ftps = { + .bdrv_close = curl_close, + .bdrv_getlength = curl_getlength, + +- .bdrv_aio_readv = curl_aio_readv, ++ .bdrv_co_preadv = curl_co_preadv, + + .bdrv_detach_aio_context = curl_detach_aio_context, + .bdrv_attach_aio_context = curl_attach_aio_context, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-do-not-do-aio_poll-when-waiting-for-a-free-CURL.patch b/SOURCES/kvm-curl-do-not-do-aio_poll-when-waiting-for-a-free-CURL.patch new file mode 100644 index 0000000..05f4816 --- /dev/null +++ b/SOURCES/kvm-curl-do-not-do-aio_poll-when-waiting-for-a-free-CURL.patch @@ -0,0 +1,101 @@ +From 0493fc983cc97eeb9c142ab7efcfce940f0cf75d Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:21 +0200 +Subject: [PATCH 15/27] curl: do not do aio_poll when waiting for a free + CURLState + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-8-pbonzini@redhat.com> +Patchwork-id: 75266 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 7/7] curl: do not do aio_poll when waiting for a free CURLState +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +Instead, put the CURLAIOCB on a wait list and yield; curl_clean_state will +wake the corresponding coroutine. + +Because of CURL's callback-based structure, we cannot easily convert +everything to CoMutex/CoQueue; keeping the QemuMutex is simpler. However, +CoQueue is a simple wrapper around a linked list, so we can easily +use QSIMPLEQ and open-code a CoQueue, protected by the BDRVCURLState +QemuMutex instead of a CoMutex. + +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-8-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 2bb5c936c5827e1d831002f7a7517cb8c2c2201d) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/block/curl.c b/block/curl.c +index acfbe52..eb9fda7 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -98,6 +98,8 @@ typedef struct CURLAIOCB { + + size_t start; + size_t end; ++ ++ QSIMPLEQ_ENTRY(CURLAIOCB) next; + } CURLAIOCB; + + typedef struct CURLSocket { +@@ -133,6 +135,7 @@ typedef struct BDRVCURLState { + bool accept_range; + AioContext *aio_context; + QemuMutex mutex; ++ QSIMPLEQ_HEAD(, CURLAIOCB) free_state_waitq; + char *username; + char *password; + char *proxyusername; +@@ -532,6 +535,7 @@ static int curl_init_state(BDRVCURLState *s, CURLState *state) + /* Called with s->mutex held. */ + static void curl_clean_state(CURLState *s) + { ++ CURLAIOCB *next; + int j; + for (j = 0; j < CURL_NUM_ACB; j++) { + assert(!s->acb[j]); +@@ -548,6 +552,14 @@ static void curl_clean_state(CURLState *s) + } + + s->in_use = 0; ++ ++ next = QSIMPLEQ_FIRST(&s->s->free_state_waitq); ++ if (next) { ++ QSIMPLEQ_REMOVE_HEAD(&s->s->free_state_waitq, next); ++ qemu_mutex_unlock(&s->s->mutex); ++ aio_co_wake(next->co); ++ qemu_mutex_lock(&s->s->mutex); ++ } + } + + static void curl_parse_filename(const char *filename, QDict *options, +@@ -744,6 +756,7 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + } + + DPRINTF("CURL: Opening %s\n", file); ++ QSIMPLEQ_INIT(&s->free_state_waitq); + s->aio_context = bdrv_get_aio_context(bs); + s->url = g_strdup(file); + qemu_mutex_lock(&s->mutex); +@@ -844,8 +857,9 @@ static void curl_setup_preadv(BlockDriverState *bs, CURLAIOCB *acb) + if (state) { + break; + } ++ QSIMPLEQ_INSERT_TAIL(&s->free_state_waitq, acb, next); + qemu_mutex_unlock(&s->mutex); +- aio_poll(bdrv_get_aio_context(bs), true); ++ qemu_coroutine_yield(); + qemu_mutex_lock(&s->mutex); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-never-invoke-callbacks-with-s-mutex-held.patch b/SOURCES/kvm-curl-never-invoke-callbacks-with-s-mutex-held.patch new file mode 100644 index 0000000..febedca --- /dev/null +++ b/SOURCES/kvm-curl-never-invoke-callbacks-with-s-mutex-held.patch @@ -0,0 +1,102 @@ +From 96b7b5da2f485e7e9d76b5528f917d6f7e169a64 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:16 +0200 +Subject: [PATCH 10/27] curl: never invoke callbacks with s->mutex held + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-3-pbonzini@redhat.com> +Patchwork-id: 75262 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 2/7] curl: never invoke callbacks with s->mutex held +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +All curl callbacks go through curl_multi_do, and hence are called with +s->mutex held. Note that with comments, and make curl_read_cb drop the +lock before invoking the callback. + +Likewise for curl_find_buf, where the callback can be invoked by the +caller. + +Cc: qemu-stable@nongnu.org +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-3-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 34db05e7ffe8d61ca7288b9532ad6e8300853318) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 12 ++++++++---- + 1 file changed, 8 insertions(+), 4 deletions(-) + +diff --git a/block/curl.c b/block/curl.c +index e77a64b..94a1e16 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -147,6 +147,7 @@ static void curl_multi_do(void *arg); + static void curl_multi_read(void *arg); + + #ifdef NEED_CURL_TIMER_CALLBACK ++/* Called from curl_multi_do_locked, with s->mutex held. */ + static int curl_timer_cb(CURLM *multi, long timeout_ms, void *opaque) + { + BDRVCURLState *s = opaque; +@@ -163,6 +164,7 @@ static int curl_timer_cb(CURLM *multi, long timeout_ms, void *opaque) + } + #endif + ++/* Called from curl_multi_do_locked, with s->mutex held. */ + static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, + void *userp, void *sp) + { +@@ -212,6 +214,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action, + return 0; + } + ++/* Called from curl_multi_do_locked, with s->mutex held. */ + static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + { + BDRVCURLState *s = opaque; +@@ -226,6 +229,7 @@ static size_t curl_header_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + return realsize; + } + ++/* Called from curl_multi_do_locked, with s->mutex held. */ + static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + { + CURLState *s = ((CURLState*)opaque); +@@ -264,7 +268,9 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque) + request_length - offset); + } + ++ qemu_mutex_unlock(&s->s->mutex); + acb->common.cb(acb->common.opaque, 0); ++ qemu_mutex_lock(&s->s->mutex); + qemu_aio_unref(acb); + s->acb[i] = NULL; + } +@@ -305,8 +311,6 @@ static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len, + if (clamped_len < len) { + qemu_iovec_memset(acb->qiov, clamped_len, 0, len - clamped_len); + } +- acb->common.cb(acb->common.opaque, 0); +- + return FIND_RET_OK; + } + +@@ -832,8 +836,8 @@ static void curl_readv_bh_cb(void *p) + // we can just call the callback and be done. + switch (curl_find_buf(s, start, acb->nb_sectors * BDRV_SECTOR_SIZE, acb)) { + case FIND_RET_OK: +- qemu_aio_unref(acb); +- // fall through ++ ret = 0; ++ goto out; + case FIND_RET_WAIT: + goto out; + default: +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-split-curl_find_state-curl_init_state.patch b/SOURCES/kvm-curl-split-curl_find_state-curl_init_state.patch new file mode 100644 index 0000000..6a9d5ff --- /dev/null +++ b/SOURCES/kvm-curl-split-curl_find_state-curl_init_state.patch @@ -0,0 +1,135 @@ +From f7393fe35030ace07ad7d9468a54ca7bae132e3b Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:18 +0200 +Subject: [PATCH 12/27] curl: split curl_find_state/curl_init_state + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-5-pbonzini@redhat.com> +Patchwork-id: 75263 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 4/7] curl: split curl_find_state/curl_init_state +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +If curl_easy_init fails, a CURLState is left with s->in_use = 1. Split +curl_init_state in two, so that we can distinguish the two failures and +call curl_clean_state if needed. + +While at it, simplify curl_find_state, removing a dummy loop. The +aio_poll loop is moved to the sole caller that needs it. + +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-5-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 3ce6a729b5d78b13283ddc6c529811f67519a62d) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 52 ++++++++++++++++++++++++++++++---------------------- + 1 file changed, 30 insertions(+), 22 deletions(-) + +diff --git a/block/curl.c b/block/curl.c +index 7001476..75e63d3 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -455,34 +455,27 @@ static void curl_multi_timeout_do(void *arg) + } + + /* Called with s->mutex held. */ +-static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) ++static CURLState *curl_find_state(BDRVCURLState *s) + { + CURLState *state = NULL; +- int i, j; +- +- do { +- for (i=0; istates[i].acb[j]) +- continue; +- if (s->states[i].in_use) +- continue; ++ int i; + ++ for (i = 0; i < CURL_NUM_STATES; i++) { ++ if (!s->states[i].in_use) { + state = &s->states[i]; + state->in_use = 1; + break; + } +- if (!state) { +- qemu_mutex_unlock(&s->mutex); +- aio_poll(bdrv_get_aio_context(bs), true); +- qemu_mutex_lock(&s->mutex); +- } +- } while(!state); ++ } ++ return state; ++} + ++static int curl_init_state(BDRVCURLState *s, CURLState *state) ++{ + if (!state->curl) { + state->curl = curl_easy_init(); + if (!state->curl) { +- return NULL; ++ return -EIO; + } + curl_easy_setopt(state->curl, CURLOPT_URL, s->url); + curl_easy_setopt(state->curl, CURLOPT_SSL_VERIFYPEER, +@@ -535,7 +528,7 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) + QLIST_INIT(&state->sockets); + state->s = s; + +- return state; ++ return 0; + } + + /* Called with s->mutex held. */ +@@ -756,13 +749,18 @@ static int curl_open(BlockDriverState *bs, QDict *options, int flags, + s->aio_context = bdrv_get_aio_context(bs); + s->url = g_strdup(file); + qemu_mutex_lock(&s->mutex); +- state = curl_init_state(bs, s); ++ state = curl_find_state(s); + qemu_mutex_unlock(&s->mutex); +- if (!state) ++ if (!state) { + goto out_noclean; ++ } + + // Get file size + ++ if (curl_init_state(s, state) < 0) { ++ goto out; ++ } ++ + s->accept_range = false; + curl_easy_setopt(state->curl, CURLOPT_NOBODY, 1); + curl_easy_setopt(state->curl, CURLOPT_HEADERFUNCTION, +@@ -857,8 +855,18 @@ static void curl_readv_bh_cb(void *p) + } + + // No cache found, so let's start a new request +- state = curl_init_state(acb->common.bs, s); +- if (!state) { ++ for (;;) { ++ state = curl_find_state(s); ++ if (state) { ++ break; ++ } ++ qemu_mutex_unlock(&s->mutex); ++ aio_poll(bdrv_get_aio_context(bs), true); ++ qemu_mutex_lock(&s->mutex); ++ } ++ ++ if (curl_init_state(s, state) < 0) { ++ curl_clean_state(state); + ret = -EIO; + goto out; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-curl-strengthen-assertion-in-curl_clean_state.patch b/SOURCES/kvm-curl-strengthen-assertion-in-curl_clean_state.patch new file mode 100644 index 0000000..3876e79 --- /dev/null +++ b/SOURCES/kvm-curl-strengthen-assertion-in-curl_clean_state.patch @@ -0,0 +1,49 @@ +From ded07c48e26d7bdf315b75db482bc03cec4a6464 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Wed, 17 May 2017 13:09:15 +0200 +Subject: [PATCH 09/27] curl: strengthen assertion in curl_clean_state + +RH-Author: Paolo Bonzini +Message-id: <20170517130921.27402-2-pbonzini@redhat.com> +Patchwork-id: 75265 +O-Subject: [RHEL7.4 qemu-kvm PATCH v2 1/7] curl: strengthen assertion in curl_clean_state +Bugzilla: 1437393 +RH-Acked-by: Max Reitz +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Jeffrey Cody + +curl_clean_state should only be called after all AIOCBs have been +completed. This is not so obvious for the call from curl_detach_aio_context, +so assert that. + +Cc: qemu-stable@nongnu.org +Reviewed-by: Jeff Cody +Signed-off-by: Paolo Bonzini +Reviewed-by: Max Reitz +Message-id: 20170515100059.15795-2-pbonzini@redhat.com +Signed-off-by: Jeff Cody +(cherry picked from commit 675a775633e68bf8b426a896fea5b93a4f4ff1cc) +Signed-off-by: Miroslav Rezanina +--- + block/curl.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/block/curl.c b/block/curl.c +index 2708d57..e77a64b 100644 +--- a/block/curl.c ++++ b/block/curl.c +@@ -532,6 +532,11 @@ static CURLState *curl_init_state(BlockDriverState *bs, BDRVCURLState *s) + + static void curl_clean_state(CURLState *s) + { ++ int j; ++ for (j = 0; j < CURL_NUM_ACB; j++) { ++ assert(!s->acb[j]); ++ } ++ + if (s->s->multi) + curl_multi_remove_handle(s->s->multi, s->curl); + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-disable-linuxboot_dma.bin-option-rom-for-7.3-machine.patch b/SOURCES/kvm-disable-linuxboot_dma.bin-option-rom-for-7.3-machine.patch new file mode 100644 index 0000000..f15789f --- /dev/null +++ b/SOURCES/kvm-disable-linuxboot_dma.bin-option-rom-for-7.3-machine.patch @@ -0,0 +1,72 @@ +From eda659afb7bf5b641cf4d9c2c93c681e04f64424 Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Wed, 24 May 2017 07:57:45 +0200 +Subject: [PATCH 3/6] disable linuxboot_dma.bin option rom for 7.3 machine + types + +RH-Author: Igor Mammedov +Message-id: <1495612665-46614-3-git-send-email-imammedo@redhat.com> +Patchwork-id: 75404 +O-Subject: [RHEL7.4 qemu-kvm-rhev v2 2/2] disable linuxboot_dma.bin option rom for 7.3 machine types +Bugzilla: 1441394 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina + +DMA enabled option rom used to be disabled for 7.3 machine types +however with rebase to 2.9 we brought regression it introduced +which loads DMA enabled option rom. + +Upstream commit in 2.10 +98e753a6e (pc/fwcfg: unbreak migration from qemu-2.5 and qemu-2.6 during firmware boot) +tries to fix it upstream and this patch is RHEL conterpart +that keeps legacy linuxboot.bin being loaded on 7.3 machine +types in 7.4 QEMU build. + +This patch complements RHEL only commit: +f5095ba58c62 (re-enable DMA for 7.3 machine type) + +Signed-off-by: Igor Mammedov +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 2 ++ + hw/i386/pc_q35.c | 2 ++ + 2 files changed, 4 insertions(+) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index bbdf2a8..038dda5 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1155,10 +1155,12 @@ static void pc_init_rhel730(MachineState *machine) + + static void pc_machine_rhel730_options(MachineClass *m) + { ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_machine_rhel740_options(m); + m->alias = NULL; + m->is_default = 0; + m->desc = "RHEL 7.3.0 PC (i440FX + PIIX, 1996)"; ++ pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); + } + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index aad1ae7..c2125ca 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -405,10 +405,12 @@ static void pc_q35_init_rhel730(MachineState *machine) + + static void pc_q35_machine_rhel730_options(MachineClass *m) + { ++ PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_machine_rhel740_options(m); + m->alias = NULL; + m->desc = "RHEL-7.3.0 PC (Q35 + ICH9, 2009)"; + m->max_cpus = 255; ++ pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_RHEL7_3_COMPAT); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-dump-Acquire-BQL-around-vm_start-in-dump-thread.patch b/SOURCES/kvm-dump-Acquire-BQL-around-vm_start-in-dump-thread.patch new file mode 100644 index 0000000..401ec50 --- /dev/null +++ b/SOURCES/kvm-dump-Acquire-BQL-around-vm_start-in-dump-thread.patch @@ -0,0 +1,91 @@ +From 63bf34c7598f3c2a8311841d6b7b5f4f6aa0dca7 Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Fri, 12 May 2017 03:34:33 +0200 +Subject: [PATCH 2/5] dump: Acquire BQL around vm_start() in dump thread + +RH-Author: Fam Zheng +Message-id: <20170512033433.1960-1-famz@redhat.com> +Patchwork-id: 75073 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] dump: Acquire BQL around vm_start() in dump thread +Bugzilla: 1445174 +RH-Acked-by: Peter Xu +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Paolo Bonzini + +This fixes an assertion failure in the following backtrace: + + __GI___assert_fail + memory_region_transaction_commit + memory_region_add_eventfd + virtio_pci_ioeventfd_assign + virtio_bus_set_host_notifier + virtio_blk_data_plane_start + virtio_bus_start_ioeventfd + virtio_vmstate_change + vm_state_notify + vm_prepare_start + vm_start + dump_cleanup + dump_process + dump_thread + start_thread + clone + +vm_start need BQL, acquire it if doing cleaning up from main thread. + +Signed-off-by: Fam Zheng +Message-Id: <20170503072819.14462-1-famz@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 6796b4008bd195e6765a1144dc98a8673e69d169) + +Upstream made a typo at the end of commit message: +s/main thread/detached thread/. + +Signed-off-by: Fam Zheng +Signed-off-by: Miroslav Rezanina +--- + dump.c | 7 +++++++ + include/sysemu/dump.h | 1 + + 2 files changed, 8 insertions(+) + +diff --git a/dump.c b/dump.c +index f7b80d8..d9090a2 100644 +--- a/dump.c ++++ b/dump.c +@@ -77,7 +77,13 @@ static int dump_cleanup(DumpState *s) + memory_mapping_list_free(&s->list); + close(s->fd); + if (s->resume) { ++ if (s->detached) { ++ qemu_mutex_lock_iothread(); ++ } + vm_start(); ++ if (s->detached) { ++ qemu_mutex_unlock_iothread(); ++ } + } + + return 0; +@@ -1804,6 +1810,7 @@ void qmp_dump_guest_memory(bool paging, const char *file, + + if (detach_p) { + /* detached dump */ ++ s->detached = true; + qemu_thread_create(&s->dump_thread, "dump_thread", dump_thread, + s, QEMU_THREAD_DETACHED); + } else { +diff --git a/include/sysemu/dump.h b/include/sysemu/dump.h +index ef931be..2672a15 100644 +--- a/include/sysemu/dump.h ++++ b/include/sysemu/dump.h +@@ -157,6 +157,7 @@ typedef struct DumpState { + uint32_t sh_info; + bool have_section; + bool resume; ++ bool detached; + ssize_t note_size; + hwaddr memory_offset; + int fd; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-e1000e-Fix-ICR-Other-causes-clear-logic.patch b/SOURCES/kvm-e1000e-Fix-ICR-Other-causes-clear-logic.patch new file mode 100644 index 0000000..e360026 --- /dev/null +++ b/SOURCES/kvm-e1000e-Fix-ICR-Other-causes-clear-logic.patch @@ -0,0 +1,113 @@ +From fbe69a4c6ee947f375ac5b2572e0fc4ea9763095 Mon Sep 17 00:00:00 2001 +From: "sjubran@redhat.com" +Date: Tue, 23 May 2017 14:35:59 +0200 +Subject: [PATCH 1/6] e1000e: Fix ICR "Other" causes clear logic + +RH-Author: sjubran@redhat.com +Message-id: <20170523143559.28622-1-sjubran@redhat.com> +Patchwork-id: 75399 +O-Subject: [PATCH] e1000e: Fix ICR "Other" causes clear logic +Bugzilla: 1449490 +RH-Acked-by: Dmitry Fleytman +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Xiao Wang + +From: Sameeh Jubran + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1449490 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13256116 +upstream: maintainer's tree + +This commit fixes a bug which causes the guest to hang. The bug was +observed upon a "receive overrun" (bit #6 of the ICR register) +interrupt which could be triggered post migration in a heavy traffic +environment. Even though the "receive overrun" bit (#6) is masked out +by the IMS register (refer to the log below) the driver still receives +an interrupt as the "receive overrun" bit (#6) causes the "Other" - +bit #24 of the ICR register - bit to be set as documented below. The +driver handles the interrupt and clears the "Other" bit (#24) but +doesn't clear the "receive overrun" bit (#6) which leads to an +infinite loop. Apparently the Windows driver expects that the "receive +overrun" bit and other ones - documented below - to be cleared when +the "Other" bit (#24) is cleared. + +So to sum that up: +1. Bit #6 of the ICR register is set by heavy traffic +2. As a results of setting bit #6, bit #24 is set +3. The driver receives an interrupt for bit 24 (it doesn't receieve an + interrupt for bit #6 as it is masked out by IMS) +4. The driver handles and clears the interrupt of bit #24 +5. Bit #6 is still set. +6. 2 happens all over again + +The Interrupt Cause Read - ICR register: + +The ICR has the "Other" bit - bit #24 - that is set when one or more +of the following ICR register's bits are set: + +LSC - bit #2, RXO - bit #6, MDAC - bit #9, SRPD - bit #16, ACK - bit + +This bug can occur with any of these bits depending on the driver's +behaviour and the way it configures the device. However, trying to +reproduce it with any bit other than RX0 is challenging and came to +failure as the drivers don't implement most of these bits, trying to +reproduce it with LSC (Link Status Change - bit #2) bit didn't succeed +too as it seems that Windows handles this bit differently. + +Log sample of the storm: + +27563@1494850819.411877:e1000e_irq_pending_interrupts ICR PENDING: 0x1000000 (ICR: 0x815000c2, IMS: 0x1a00004) +27563@1494850819.411900:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.411915:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.412380:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.412395:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.412436:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.412441:e1000e_irq_pending_interrupts ICR PENDING: 0x0 (ICR: 0x815000c2, IMS: 0xa00004) +27563@1494850819.412998:e1000e_irq_pending_interrupts ICR PENDING: 0x1000000 (ICR: 0x815000c2, IMS: 0x1a00004) + +* This bug behaviour wasn't observed with the Linux driver. + +This commit solves: +https://bugzilla.redhat.com/show_bug.cgi?id=1447935 +https://bugzilla.redhat.com/show_bug.cgi?id=1449490 + +Cc: qemu-stable@nongnu.org +Signed-off-by: Sameeh Jubran +Signed-off-by: Jason Wang +(cherry picked from commit 82342e91b60a4a078811df4e1a545e57abffa11d) +Signed-off-by: Sameeh Jubran +Signed-off-by: Miroslav Rezanina +--- + hw/net/e1000e_core.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c +index 28c5be1..8140564 100644 +--- a/hw/net/e1000e_core.c ++++ b/hw/net/e1000e_core.c +@@ -2454,14 +2454,20 @@ e1000e_set_ics(E1000ECore *core, int index, uint32_t val) + static void + e1000e_set_icr(E1000ECore *core, int index, uint32_t val) + { ++ uint32_t icr = 0; + if ((core->mac[ICR] & E1000_ICR_ASSERTED) && + (core->mac[CTRL_EXT] & E1000_CTRL_EXT_IAME)) { + trace_e1000e_irq_icr_process_iame(); + e1000e_clear_ims_bits(core, core->mac[IAM]); + } + +- trace_e1000e_irq_icr_write(val, core->mac[ICR], core->mac[ICR] & ~val); +- core->mac[ICR] &= ~val; ++ icr = core->mac[ICR] & ~val; ++ /* Windows driver expects that the "receive overrun" bit and other ++ * ones to be cleared when the "Other" bit (#24) is cleared. ++ */ ++ icr = (val & E1000_ICR_OTHER) ? (icr & ~E1000_ICR_OTHER_CAUSES) : icr; ++ trace_e1000e_irq_icr_write(val, core->mac[ICR], icr); ++ core->mac[ICR] = icr; + e1000e_update_interrupt_state(core); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-ehci-fix-frame-timer-invocation.patch b/SOURCES/kvm-ehci-fix-frame-timer-invocation.patch new file mode 100644 index 0000000..4e11c15 --- /dev/null +++ b/SOURCES/kvm-ehci-fix-frame-timer-invocation.patch @@ -0,0 +1,71 @@ +From 6b86a8553b77e506de0529cb4e4aa0bd1db88322 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 6 Jun 2017 15:43:53 +0200 +Subject: [PATCH 17/17] ehci: fix frame timer invocation. + +RH-Author: Gerd Hoffmann +Message-id: <20170606154353.31670-3-kraxel@redhat.com> +Patchwork-id: 75505 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 2/2] ehci: fix frame timer invocation. +Bugzilla: 1449609 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Thomas Huth + +ehci registers ehci_frame_timer as both timer and bottom half, which +turned out to be a bad idea as it can be called as bottom half then +while it is running as timer, and it isn't prepared to handle recursive +calls. + +Change the timer func to just schedule the bottom half to avoid this. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1449609 +Signed-off-by: Gerd Hoffmann +Message-id: 20170519120428.25981-1-kraxel@redhat.com +(cherry picked from commit 3bfecee2cb71f21cd39d6183f18b446c01917573) +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-ehci.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c +index d7361e5..17c572c 100644 +--- a/hw/usb/hcd-ehci.c ++++ b/hw/usb/hcd-ehci.c +@@ -2232,7 +2232,7 @@ static void ehci_update_frindex(EHCIState *ehci, int uframes) + ehci->frindex = (ehci->frindex + uframes) % 0x4000; + } + +-static void ehci_frame_timer(void *opaque) ++static void ehci_work_bh(void *opaque) + { + EHCIState *ehci = opaque; + int need_timer = 0; +@@ -2324,6 +2324,13 @@ static void ehci_frame_timer(void *opaque) + } + } + ++static void ehci_work_timer(void *opaque) ++{ ++ EHCIState *ehci = opaque; ++ ++ qemu_bh_schedule(ehci->async_bh); ++} ++ + static const MemoryRegionOps ehci_mmio_caps_ops = { + .read = ehci_caps_read, + .write = ehci_caps_write, +@@ -2478,8 +2485,8 @@ void usb_ehci_realize(EHCIState *s, DeviceState *dev, Error **errp) + s->ports[i].dev = 0; + } + +- s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_frame_timer, s); +- s->async_bh = qemu_bh_new(ehci_frame_timer, s); ++ s->frame_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, ehci_work_timer, s); ++ s->async_bh = qemu_bh_new(ehci_work_bh, s); + s->device = dev; + + s->vmstate = qemu_add_vm_change_state_handler(usb_ehci_vm_state_change, s); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-ehci-fix-overflow-in-frame-timer-code.patch b/SOURCES/kvm-ehci-fix-overflow-in-frame-timer-code.patch new file mode 100644 index 0000000..e20345f --- /dev/null +++ b/SOURCES/kvm-ehci-fix-overflow-in-frame-timer-code.patch @@ -0,0 +1,48 @@ +From 22b59e7290b2649efc03fe800859c48e2fd90763 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 6 Jun 2017 15:43:52 +0200 +Subject: [PATCH 16/17] ehci: fix overflow in frame timer code +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Gerd Hoffmann +Message-id: <20170606154353.31670-2-kraxel@redhat.com> +Patchwork-id: 75506 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/2] ehci: fix overflow in frame timer code +Bugzilla: 1449609 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Thomas Huth + +In case the frame timer doesn't run for a while due to the host being +busy skipped_uframes can become big enough that UFRAME_TIMER_NS * +skipped_uframes overflows. Which in turn throws off all subsequent +ehci frame timer calculations. + +Reported-by: 李林 <8610_28@163.com> +Signed-off-by: Gerd Hoffmann +Reviewed-by: Philippe Mathieu-Daudé +Message-id: 20170515104543.32044-1-kraxel@redhat.com +(cherry picked from commit 3ae7eb88c472799f17beb653f4bc3fb8b124c72e) +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-ehci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c +index 50ef817..d7361e5 100644 +--- a/hw/usb/hcd-ehci.c ++++ b/hw/usb/hcd-ehci.c +@@ -2238,7 +2238,7 @@ static void ehci_frame_timer(void *opaque) + int need_timer = 0; + int64_t expire_time, t_now; + uint64_t ns_elapsed; +- int uframes, skipped_uframes; ++ uint64_t uframes, skipped_uframes; + int i; + + t_now = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-gluster-add-support-for-PREALLOC_MODE_FALLOC.patch b/SOURCES/kvm-gluster-add-support-for-PREALLOC_MODE_FALLOC.patch new file mode 100644 index 0000000..d3e0415 --- /dev/null +++ b/SOURCES/kvm-gluster-add-support-for-PREALLOC_MODE_FALLOC.patch @@ -0,0 +1,193 @@ +From 50cca99ecdaeb3dd64ff8af220915dc15a2692ec Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 5 Jun 2017 16:12:29 +0200 +Subject: [PATCH 10/13] gluster: add support for PREALLOC_MODE_FALLOC + +RH-Author: Jeffrey Cody +Message-id: <2e9189b1b1d970dc78a6ad2bcf2fabb3955172d4.1496678872.git.jcody@redhat.com> +Patchwork-id: 75484 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH] gluster: add support for PREALLOC_MODE_FALLOC +Bugzilla: 1450759 +RH-Acked-by: John Snow +RH-Acked-by: Niels de Vos +RH-Acked-by: Miroslav Rezanina + +From: Niels de Vos + +Add missing support for "preallocation=falloc" to the Gluster block +driver. This change bases its logic on that of block/file-posix.c and +removed the gluster_supports_zerofill() and qemu_gluster_zerofill() +functions in favour of #ifdef checks in an easy to read +switch-statement. + +Both glfs_zerofill() and glfs_fallocate() have been introduced with +GlusterFS 3.5.0 (pkg-config glusterfs-api = 6). A #define for the +availability of glfs_fallocate() has been added to ./configure. + +Reported-by: Satheesaran Sundaramoorthi +Signed-off-by: Niels de Vos +Message-id: 20170528063114.28691-1-ndevos@redhat.com +URL: https://bugzilla.redhat.com/1450759 +Signed-off-by: Niels de Vos +Signed-off-by: Jeff Cody +(cherry picked from commit df3a429ae82c0f45becdfab105617701d75e0f05) +Signed-off-by: Miroslav Rezanina +--- + block/gluster.c | 76 ++++++++++++++++++++++++++++++--------------------------- + configure | 6 +++++ + 2 files changed, 46 insertions(+), 36 deletions(-) + +diff --git a/block/gluster.c b/block/gluster.c +index 6ea91ef..52a1c1d 100644 +--- a/block/gluster.c ++++ b/block/gluster.c +@@ -964,29 +964,6 @@ static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs, + qemu_coroutine_yield(); + return acb.ret; + } +- +-static inline bool gluster_supports_zerofill(void) +-{ +- return 1; +-} +- +-static inline int qemu_gluster_zerofill(struct glfs_fd *fd, int64_t offset, +- int64_t size) +-{ +- return glfs_zerofill(fd, offset, size); +-} +- +-#else +-static inline bool gluster_supports_zerofill(void) +-{ +- return 0; +-} +- +-static inline int qemu_gluster_zerofill(struct glfs_fd *fd, int64_t offset, +- int64_t size) +-{ +- return 0; +-} + #endif + + static int qemu_gluster_create(const char *filename, +@@ -996,9 +973,10 @@ static int qemu_gluster_create(const char *filename, + struct glfs *glfs; + struct glfs_fd *fd; + int ret = 0; +- int prealloc = 0; ++ PreallocMode prealloc; + int64_t total_size = 0; + char *tmp = NULL; ++ Error *local_err = NULL; + + gconf = g_new0(BlockdevOptionsGluster, 1); + gconf->debug = qemu_opt_get_number_del(opts, GLUSTER_OPT_DEBUG, +@@ -1026,13 +1004,12 @@ static int qemu_gluster_create(const char *filename, + BDRV_SECTOR_SIZE); + + tmp = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC); +- if (!tmp || !strcmp(tmp, "off")) { +- prealloc = 0; +- } else if (!strcmp(tmp, "full") && gluster_supports_zerofill()) { +- prealloc = 1; +- } else { +- error_setg(errp, "Invalid preallocation mode: '%s'" +- " or GlusterFS doesn't support zerofill API", tmp); ++ prealloc = qapi_enum_parse(PreallocMode_lookup, tmp, ++ PREALLOC_MODE__MAX, PREALLOC_MODE_OFF, ++ &local_err); ++ g_free(tmp); ++ if (local_err) { ++ error_propagate(errp, local_err); + ret = -EINVAL; + goto out; + } +@@ -1041,21 +1018,48 @@ static int qemu_gluster_create(const char *filename, + O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR | S_IWUSR); + if (!fd) { + ret = -errno; +- } else { ++ goto out; ++ } ++ ++ switch (prealloc) { ++#ifdef CONFIG_GLUSTERFS_FALLOCATE ++ case PREALLOC_MODE_FALLOC: ++ if (glfs_fallocate(fd, 0, 0, total_size)) { ++ error_setg(errp, "Could not preallocate data for the new file"); ++ ret = -errno; ++ } ++ break; ++#endif /* CONFIG_GLUSTERFS_FALLOCATE */ ++#ifdef CONFIG_GLUSTERFS_ZEROFILL ++ case PREALLOC_MODE_FULL: + if (!glfs_ftruncate(fd, total_size)) { +- if (prealloc && qemu_gluster_zerofill(fd, 0, total_size)) { ++ if (glfs_zerofill(fd, 0, total_size)) { ++ error_setg(errp, "Could not zerofill the new file"); + ret = -errno; + } + } else { ++ error_setg(errp, "Could not resize file"); + ret = -errno; + } +- +- if (glfs_close(fd) != 0) { ++ break; ++#endif /* CONFIG_GLUSTERFS_ZEROFILL */ ++ case PREALLOC_MODE_OFF: ++ if (glfs_ftruncate(fd, total_size) != 0) { + ret = -errno; ++ error_setg(errp, "Could not resize file"); + } ++ break; ++ default: ++ ret = -EINVAL; ++ error_setg(errp, "Unsupported preallocation mode: %s", ++ PreallocMode_lookup[prealloc]); ++ break; ++ } ++ ++ if (glfs_close(fd) != 0) { ++ ret = -errno; + } + out: +- g_free(tmp); + qapi_free_BlockdevOptionsGluster(gconf); + glfs_clear_preopened(glfs); + return ret; +diff --git a/configure b/configure +index 2ca95f4..b019b33 100755 +--- a/configure ++++ b/configure +@@ -300,6 +300,7 @@ seccomp="" + glusterfs="" + glusterfs_xlator_opt="no" + glusterfs_discard="no" ++glusterfs_fallocate="no" + glusterfs_zerofill="no" + gtk="" + gtkabi="" +@@ -3543,6 +3544,7 @@ if test "$glusterfs" != "no" ; then + glusterfs_discard="yes" + fi + if $pkg_config --atleast-version=6 glusterfs-api; then ++ glusterfs_fallocate="yes" + glusterfs_zerofill="yes" + fi + else +@@ -5707,6 +5709,10 @@ if test "$glusterfs_discard" = "yes" ; then + echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak + fi + ++if test "$glusterfs_fallocate" = "yes" ; then ++ echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak ++fi ++ + if test "$glusterfs_zerofill" = "yes" ; then + echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak + fi +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hmp-gpa2hva-and-gpa2hpa-hostaddr-command.patch b/SOURCES/kvm-hmp-gpa2hva-and-gpa2hpa-hostaddr-command.patch new file mode 100644 index 0000000..e8b65d9 --- /dev/null +++ b/SOURCES/kvm-hmp-gpa2hva-and-gpa2hpa-hostaddr-command.patch @@ -0,0 +1,186 @@ +From 74e6cfa9bd85097641f64c4c1621dc312bd2815a Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Thu, 20 Apr 2017 14:51:33 +0200 +Subject: [PATCH 05/23] hmp: gpa2hva and gpa2hpa hostaddr command + +RH-Author: Paolo Bonzini +Message-id: <20170420145133.24785-1-pbonzini@redhat.com> +Patchwork-id: 74808 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] hmp: gpa2hva and gpa2hpa hostaddr command +Bugzilla: 1432295 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Markus Armbruster + +These commands are useful when testing machine-check passthrough. +gpa2hva is useful to inject a MADV_HWPOISON madvise from gdb, while +gpa2hpa is useful to inject an error with the mce-inject kernel +module. + +Signed-off-by: Paolo Bonzini +(cherry-picked from e9628441df3a7aa0ee83601a0cc9111b91e2319a) + +Signed-off-by: Miroslav Rezanina +--- + hmp-commands.hx | 32 ++++++++++++++++++ + monitor.c | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 133 insertions(+) + +diff --git a/hmp-commands.hx b/hmp-commands.hx +index 9a9ff0f..f8b2b1c 100644 +--- a/hmp-commands.hx ++++ b/hmp-commands.hx +@@ -540,6 +540,38 @@ Dump 80 16 bit values at the start of the video memory. + ETEXI + + { ++ .name = "gpa2hva", ++ .args_type = "addr:l", ++ .params = "addr", ++ .help = "print the host virtual address corresponding to a guest physical address", ++ .cmd = hmp_gpa2hva, ++ }, ++ ++STEXI ++@item gpa2hva @var{addr} ++@findex gpa2hva ++Print the host virtual address at which the guest's physical address @var{addr} ++is mapped. ++ETEXI ++ ++#ifdef CONFIG_LINUX ++ { ++ .name = "gpa2hpa", ++ .args_type = "addr:l", ++ .params = "addr", ++ .help = "print the host physical address corresponding to a guest physical address", ++ .cmd = hmp_gpa2hpa, ++ }, ++#endif ++ ++STEXI ++@item gpa2hpa @var{addr} ++@findex gpa2hpa ++Print the host physical address at which the guest's physical address @var{addr} ++is mapped. ++ETEXI ++ ++ { + .name = "p|print", + .args_type = "fmt:/,val:l", + .params = "/fmt expr", +diff --git a/monitor.c b/monitor.c +index fbcd058..896d669 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -1423,6 +1423,107 @@ static void hmp_physical_memory_dump(Monitor *mon, const QDict *qdict) + memory_dump(mon, count, format, size, addr, 1); + } + ++static void *gpa2hva(MemoryRegion **p_mr, hwaddr addr, Error **errp) ++{ ++ MemoryRegionSection mrs = memory_region_find(get_system_memory(), ++ addr, 1); ++ ++ if (!mrs.mr) { ++ error_setg(errp, "No memory is mapped at address 0x%" HWADDR_PRIx, addr); ++ return NULL; ++ } ++ ++ if (!memory_region_is_ram(mrs.mr) && !memory_region_is_romd(mrs.mr)) { ++ error_setg(errp, "Memory at address 0x%" HWADDR_PRIx "is not RAM", addr); ++ memory_region_unref(mrs.mr); ++ return NULL; ++ } ++ ++ *p_mr = mrs.mr; ++ return qemu_map_ram_ptr(mrs.mr->ram_block, mrs.offset_within_region); ++} ++ ++static void hmp_gpa2hva(Monitor *mon, const QDict *qdict) ++{ ++ hwaddr addr = qdict_get_int(qdict, "addr"); ++ Error *local_err = NULL; ++ MemoryRegion *mr = NULL; ++ void *ptr; ++ ++ ptr = gpa2hva(&mr, addr, &local_err); ++ if (local_err) { ++ error_report_err(local_err); ++ return; ++ } ++ ++ monitor_printf(mon, "Host virtual address for 0x%" HWADDR_PRIx ++ " (%s) is %p\n", ++ addr, mr->name, ptr); ++ ++ memory_region_unref(mr); ++} ++ ++#ifdef CONFIG_LINUX ++static uint64_t vtop(void *ptr, Error **errp) ++{ ++ uint64_t pinfo; ++ uint64_t ret = -1; ++ uintptr_t addr = (uintptr_t) ptr; ++ uintptr_t pagesize = getpagesize(); ++ off_t offset = addr / pagesize * sizeof(pinfo); ++ int fd; ++ ++ fd = open("/proc/self/pagemap", O_RDONLY); ++ if (fd == -1) { ++ error_setg_errno(errp, errno, "Cannot open /proc/self/pagemap"); ++ return -1; ++ } ++ ++ /* Force copy-on-write if necessary. */ ++ atomic_add((uint8_t *)ptr, 0); ++ ++ if (pread(fd, &pinfo, sizeof(pinfo), offset) != sizeof(pinfo)) { ++ error_setg_errno(errp, errno, "Cannot read pagemap"); ++ goto out; ++ } ++ if ((pinfo & (1ull << 63)) == 0) { ++ error_setg(errp, "Page not present"); ++ goto out; ++ } ++ ret = ((pinfo & 0x007fffffffffffffull) * pagesize) | (addr & (pagesize - 1)); ++ ++out: ++ close(fd); ++ return ret; ++} ++ ++static void hmp_gpa2hpa(Monitor *mon, const QDict *qdict) ++{ ++ hwaddr addr = qdict_get_int(qdict, "addr"); ++ Error *local_err = NULL; ++ MemoryRegion *mr = NULL; ++ void *ptr; ++ uint64_t physaddr; ++ ++ ptr = gpa2hva(&mr, addr, &local_err); ++ if (local_err) { ++ error_report_err(local_err); ++ return; ++ } ++ ++ physaddr = vtop(ptr, &local_err); ++ if (local_err) { ++ error_report_err(local_err); ++ } else { ++ monitor_printf(mon, "Host physical address for 0x%" HWADDR_PRIx ++ " (%s) is 0x%" PRIx64 "\n", ++ addr, mr->name, (uint64_t) physaddr); ++ } ++ ++ memory_region_unref(mr); ++} ++#endif ++ + static void do_print(Monitor *mon, const QDict *qdict) + { + int format = qdict_get_int(qdict, "format"); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-intc-arm_gicv3_its-Allow-save-restore.patch b/SOURCES/kvm-hw-intc-arm_gicv3_its-Allow-save-restore.patch new file mode 100644 index 0000000..22c6d5a --- /dev/null +++ b/SOURCES/kvm-hw-intc-arm_gicv3_its-Allow-save-restore.patch @@ -0,0 +1,115 @@ +From 88f3005a6fb5f44406a25229a302261ad1a6f8d9 Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Fri, 16 Jun 2017 15:17:56 +0200 +Subject: [PATCH 5/5] hw/intc/arm_gicv3_its: Allow save/restore + +RH-Author: Auger Eric +Message-id: <1497626276-18221-6-git-send-email-eric.auger@redhat.com> +Patchwork-id: 75636 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 5/5] hw/intc/arm_gicv3_its: Allow save/restore +Bugzilla: 1462061 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina + +We change the restoration priority of both the GICv3 and ITS. The +GICv3 must be restored before the ITS and the ITS needs to be restored +before PCIe devices since it translates their MSI transactions. + +Signed-off-by: Eric Auger +Reviewed-by: Juan Quintela +Message-id: 1497023553-18411-5-git-send-email-eric.auger@redhat.com +Signed-off-by: Peter Maydell +(cherry picked from commit 252a7a6a968c279a4636a86b0559ba3a930a90b5) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/intc/arm_gicv3_common.c | 1 + + hw/intc/arm_gicv3_its_common.c | 2 +- + hw/intc/arm_gicv3_its_kvm.c | 24 ++++++++++++------------ + include/migration/vmstate.h | 2 ++ + 4 files changed, 16 insertions(+), 13 deletions(-) + +diff --git a/hw/intc/arm_gicv3_common.c b/hw/intc/arm_gicv3_common.c +index c6493d6..4228b7c 100644 +--- a/hw/intc/arm_gicv3_common.c ++++ b/hw/intc/arm_gicv3_common.c +@@ -145,6 +145,7 @@ static const VMStateDescription vmstate_gicv3 = { + .minimum_version_id = 1, + .pre_save = gicv3_pre_save, + .post_load = gicv3_post_load, ++ .priority = MIG_PRI_GICV3, + .fields = (VMStateField[]) { + VMSTATE_UINT32(gicd_ctlr, GICv3State), + VMSTATE_UINT32_ARRAY(gicd_statusr, GICv3State, 2), +diff --git a/hw/intc/arm_gicv3_its_common.c b/hw/intc/arm_gicv3_its_common.c +index 696c11c..68b20fc 100644 +--- a/hw/intc/arm_gicv3_its_common.c ++++ b/hw/intc/arm_gicv3_its_common.c +@@ -48,7 +48,7 @@ static const VMStateDescription vmstate_its = { + .name = "arm_gicv3_its", + .pre_save = gicv3_its_pre_save, + .post_load = gicv3_its_post_load, +- .unmigratable = true, ++ .priority = MIG_PRI_GICV3_ITS, + .fields = (VMStateField[]) { + VMSTATE_UINT32(ctlr, GICv3ITSState), + VMSTATE_UINT32(iidr, GICv3ITSState), +diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c +index 3c7c28c..04a51cf 100644 +--- a/hw/intc/arm_gicv3_its_kvm.c ++++ b/hw/intc/arm_gicv3_its_kvm.c +@@ -85,18 +85,6 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp) + GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev); + Error *local_err = NULL; + +- /* +- * Block migration of a KVM GICv3 ITS device: the API for saving and +- * restoring the state in the kernel is not yet available +- */ +- error_setg(&s->migration_blocker, "vITS migration is not implemented"); +- migrate_add_blocker(s->migration_blocker, &local_err); +- if (local_err) { +- error_propagate(errp, local_err); +- error_free(s->migration_blocker); +- return; +- } +- + s->dev_fd = kvm_create_device(kvm_state, KVM_DEV_TYPE_ARM_VGIC_ITS, false); + if (s->dev_fd < 0) { + error_setg_errno(errp, -s->dev_fd, "error creating in-kernel ITS"); +@@ -113,6 +101,18 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp) + + gicv3_its_init_mmio(s, NULL); + ++ if (!kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CTLR)) { ++ error_setg(&s->migration_blocker, "This operating system kernel " ++ "does not support vITS migration"); ++ migrate_add_blocker(s->migration_blocker, &local_err); ++ if (local_err) { ++ error_propagate(errp, local_err); ++ error_free(s->migration_blocker); ++ return; ++ } ++ } ++ + kvm_msi_use_devid = true; + kvm_gsi_direct_mapping = false; + kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled(); +diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h +index f2dbf84..8dab9c7 100644 +--- a/include/migration/vmstate.h ++++ b/include/migration/vmstate.h +@@ -198,6 +198,8 @@ enum VMStateFlags { + typedef enum { + MIG_PRI_DEFAULT = 0, + MIG_PRI_IOMMU, /* Must happen before PCI devices */ ++ MIG_PRI_GICV3_ITS, /* Must happen before PCI devices */ ++ MIG_PRI_GICV3, /* Must happen before the ITS */ + MIG_PRI_MAX, + } MigrationPriority; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-intc-arm_gicv3_its-Implement-state-save-restore.patch b/SOURCES/kvm-hw-intc-arm_gicv3_its-Implement-state-save-restore.patch new file mode 100644 index 0000000..232191f --- /dev/null +++ b/SOURCES/kvm-hw-intc-arm_gicv3_its-Implement-state-save-restore.patch @@ -0,0 +1,238 @@ +From 3d589a2d3dbe2a376122713cb67be0e3b64d8f3f Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Fri, 16 Jun 2017 15:17:54 +0200 +Subject: [PATCH 3/5] hw/intc/arm_gicv3_its: Implement state save/restore + +RH-Author: Auger Eric +Message-id: <1497626276-18221-4-git-send-email-eric.auger@redhat.com> +Patchwork-id: 75634 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 3/5] hw/intc/arm_gicv3_its: Implement state save/restore +Bugzilla: 1462061 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina + +We need to handle both registers and ITS tables. While +register handling is standard, ITS table handling is more +challenging since the kernel API is devised so that the +tables are flushed into guest RAM and not in vmstate buffers. + +Flushing the ITS tables on device pre_save() is too late +since the guest RAM is already saved at this point. + +Table flushing needs to happen when we are sure the vcpus +are stopped and before the last dirty page saving. The +right point is RUN_STATE_FINISH_MIGRATE but sometimes the +VM gets stopped before migration launch so let's simply +flush the tables each time the VM gets stopped. + +For regular ITS registers we just can use vmstate pre_save() +and post_load() callbacks. + +Signed-off-by: Eric Auger +Message-id: 1497023553-18411-3-git-send-email-eric.auger@redhat.com +Reviewed-by: Peter Maydell +Signed-off-by: Peter Maydell +(cherry picked from commit cddafd8f353d2d251b1a5c6c948a577a85838582) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/intc/arm_gicv3_its_common.c | 10 ++++ + hw/intc/arm_gicv3_its_kvm.c | 105 +++++++++++++++++++++++++++++++++ + include/hw/intc/arm_gicv3_its_common.h | 8 +++ + 3 files changed, 123 insertions(+) + +diff --git a/hw/intc/arm_gicv3_its_common.c b/hw/intc/arm_gicv3_its_common.c +index 9d67c5c..696c11c 100644 +--- a/hw/intc/arm_gicv3_its_common.c ++++ b/hw/intc/arm_gicv3_its_common.c +@@ -49,6 +49,15 @@ static const VMStateDescription vmstate_its = { + .pre_save = gicv3_its_pre_save, + .post_load = gicv3_its_post_load, + .unmigratable = true, ++ .fields = (VMStateField[]) { ++ VMSTATE_UINT32(ctlr, GICv3ITSState), ++ VMSTATE_UINT32(iidr, GICv3ITSState), ++ VMSTATE_UINT64(cbaser, GICv3ITSState), ++ VMSTATE_UINT64(cwriter, GICv3ITSState), ++ VMSTATE_UINT64(creadr, GICv3ITSState), ++ VMSTATE_UINT64_ARRAY(baser, GICv3ITSState, 8), ++ VMSTATE_END_OF_LIST() ++ }, + }; + + static MemTxResult gicv3_its_trans_read(void *opaque, hwaddr offset, +@@ -118,6 +127,7 @@ static void gicv3_its_common_reset(DeviceState *dev) + s->cbaser = 0; + s->cwriter = 0; + s->creadr = 0; ++ s->iidr = 0; + memset(&s->baser, 0, sizeof(s->baser)); + + gicv3_its_post_load(s, 0); +diff --git a/hw/intc/arm_gicv3_its_kvm.c b/hw/intc/arm_gicv3_its_kvm.c +index ad2a1db..3c7c28c 100644 +--- a/hw/intc/arm_gicv3_its_kvm.c ++++ b/hw/intc/arm_gicv3_its_kvm.c +@@ -53,6 +53,33 @@ static int kvm_its_send_msi(GICv3ITSState *s, uint32_t value, uint16_t devid) + return kvm_vm_ioctl(kvm_state, KVM_SIGNAL_MSI, &msi); + } + ++/** ++ * vm_change_state_handler - VM change state callback aiming at flushing ++ * ITS tables into guest RAM ++ * ++ * The tables get flushed to guest RAM whenever the VM gets stopped. ++ */ ++static void vm_change_state_handler(void *opaque, int running, ++ RunState state) ++{ ++ GICv3ITSState *s = (GICv3ITSState *)opaque; ++ Error *err = NULL; ++ int ret; ++ ++ if (running) { ++ return; ++ } ++ ++ ret = kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, ++ KVM_DEV_ARM_ITS_SAVE_TABLES, NULL, true, &err); ++ if (err) { ++ error_report_err(err); ++ } ++ if (ret < 0 && ret != -EFAULT) { ++ abort(); ++ } ++} ++ + static void kvm_arm_its_realize(DeviceState *dev, Error **errp) + { + GICv3ITSState *s = ARM_GICV3_ITS_COMMON(dev); +@@ -89,6 +116,8 @@ static void kvm_arm_its_realize(DeviceState *dev, Error **errp) + kvm_msi_use_devid = true; + kvm_gsi_direct_mapping = false; + kvm_msi_via_irqfd_allowed = kvm_irqfds_enabled(); ++ ++ qemu_add_vm_change_state_handler(vm_change_state_handler, s); + } + + static void kvm_arm_its_init(Object *obj) +@@ -102,6 +131,80 @@ static void kvm_arm_its_init(Object *obj) + &error_abort); + } + ++/** ++ * kvm_arm_its_pre_save - handles the saving of ITS registers. ++ * ITS tables are flushed into guest RAM separately and earlier, ++ * through the VM change state handler, since at the moment pre_save() ++ * is called, the guest RAM has already been saved. ++ */ ++static void kvm_arm_its_pre_save(GICv3ITSState *s) ++{ ++ int i; ++ ++ for (i = 0; i < 8; i++) { ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_BASER + i * 8, &s->baser[i], false, ++ &error_abort); ++ } ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CTLR, &s->ctlr, false, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CBASER, &s->cbaser, false, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CREADR, &s->creadr, false, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CWRITER, &s->cwriter, false, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_IIDR, &s->iidr, false, &error_abort); ++} ++ ++/** ++ * kvm_arm_its_post_load - Restore both the ITS registers and tables ++ */ ++static void kvm_arm_its_post_load(GICv3ITSState *s) ++{ ++ int i; ++ ++ if (!s->iidr) { ++ return; ++ } ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_IIDR, &s->iidr, true, &error_abort); ++ ++ /* ++ * must be written before GITS_CREADR since GITS_CBASER write ++ * access resets GITS_CREADR. ++ */ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CBASER, &s->cbaser, true, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CREADR, &s->creadr, true, &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CWRITER, &s->cwriter, true, &error_abort); ++ ++ ++ for (i = 0; i < 8; i++) { ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_BASER + i * 8, &s->baser[i], true, ++ &error_abort); ++ } ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, ++ KVM_DEV_ARM_ITS_RESTORE_TABLES, NULL, true, ++ &error_abort); ++ ++ kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_ITS_REGS, ++ GITS_CTLR, &s->ctlr, true, &error_abort); ++} ++ + static void kvm_arm_its_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); +@@ -109,6 +212,8 @@ static void kvm_arm_its_class_init(ObjectClass *klass, void *data) + + dc->realize = kvm_arm_its_realize; + icc->send_msi = kvm_its_send_msi; ++ icc->pre_save = kvm_arm_its_pre_save; ++ icc->post_load = kvm_arm_its_post_load; + } + + static const TypeInfo kvm_arm_its_info = { +diff --git a/include/hw/intc/arm_gicv3_its_common.h b/include/hw/intc/arm_gicv3_its_common.h +index 1ba1894..fd1fe64 100644 +--- a/include/hw/intc/arm_gicv3_its_common.h ++++ b/include/hw/intc/arm_gicv3_its_common.h +@@ -28,6 +28,13 @@ + #define ITS_TRANS_SIZE 0x10000 + #define ITS_SIZE (ITS_CONTROL_SIZE + ITS_TRANS_SIZE) + ++#define GITS_CTLR 0x0 ++#define GITS_IIDR 0x4 ++#define GITS_CBASER 0x80 ++#define GITS_CWRITER 0x88 ++#define GITS_CREADR 0x90 ++#define GITS_BASER 0x100 ++ + struct GICv3ITSState { + SysBusDevice parent_obj; + +@@ -43,6 +50,7 @@ struct GICv3ITSState { + + /* Registers */ + uint32_t ctlr; ++ uint32_t iidr; + uint64_t cbaser; + uint64_t cwriter; + uint64_t creadr; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-intc-arm_gicv3_kvm-Implement-pending-table-save.patch b/SOURCES/kvm-hw-intc-arm_gicv3_kvm-Implement-pending-table-save.patch new file mode 100644 index 0000000..1a765dc --- /dev/null +++ b/SOURCES/kvm-hw-intc-arm_gicv3_kvm-Implement-pending-table-save.patch @@ -0,0 +1,93 @@ +From 81165ace09e10cf550ebdf2b88241a8b0d405196 Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Fri, 16 Jun 2017 15:17:55 +0200 +Subject: [PATCH 4/5] hw/intc/arm_gicv3_kvm: Implement pending table save + +RH-Author: Auger Eric +Message-id: <1497626276-18221-5-git-send-email-eric.auger@redhat.com> +Patchwork-id: 75637 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 4/5] hw/intc/arm_gicv3_kvm: Implement pending table save +Bugzilla: 1462061 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina + +This patch adds the flush of the LPI pending bits into the +redistributor pending tables. This happens on VM stop. + +There is no explicit restore as the tables are implicitly sync'ed +on ITS table restore and on LPI enable at redistributor level. + +Signed-off-by: Eric Auger +Message-id: 1497023553-18411-4-git-send-email-eric.auger@redhat.com +Reviewed-by: Peter Maydell +Signed-off-by: Peter Maydell +(cherry picked from commit d5aa0c229ab5d46c1a4ff497553671cd46486749) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + hw/intc/arm_gicv3_kvm.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/hw/intc/arm_gicv3_kvm.c b/hw/intc/arm_gicv3_kvm.c +index 824475f..2df4870 100644 +--- a/hw/intc/arm_gicv3_kvm.c ++++ b/hw/intc/arm_gicv3_kvm.c +@@ -25,6 +25,7 @@ + #include "hw/sysbus.h" + #include "qemu/error-report.h" + #include "sysemu/kvm.h" ++#include "sysemu/sysemu.h" + #include "kvm_arm.h" + #include "gicv3_internal.h" + #include "vgic_common.h" +@@ -680,6 +681,35 @@ static const ARMCPRegInfo gicv3_cpuif_reginfo[] = { + REGINFO_SENTINEL + }; + ++/** ++ * vm_change_state_handler - VM change state callback aiming at flushing ++ * RDIST pending tables into guest RAM ++ * ++ * The tables get flushed to guest RAM whenever the VM gets stopped. ++ */ ++static void vm_change_state_handler(void *opaque, int running, ++ RunState state) ++{ ++ GICv3State *s = (GICv3State *)opaque; ++ Error *err = NULL; ++ int ret; ++ ++ if (running) { ++ return; ++ } ++ ++ ret = kvm_device_access(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, ++ KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES, ++ NULL, true, &err); ++ if (err) { ++ error_report_err(err); ++ } ++ if (ret < 0 && ret != -EFAULT) { ++ abort(); ++ } ++} ++ ++ + static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) + { + GICv3State *s = KVM_ARM_GICV3(dev); +@@ -751,6 +781,10 @@ static void kvm_arm_gicv3_realize(DeviceState *dev, Error **errp) + return; + } + } ++ if (kvm_device_check_attr(s->dev_fd, KVM_DEV_ARM_VGIC_GRP_CTRL, ++ KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES)) { ++ qemu_add_vm_change_state_handler(vm_change_state_handler, s); ++ } + } + + static void kvm_arm_gicv3_class_init(ObjectClass *klass, void *data) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-pcie-fix-the-generic-pcie-root-port-to-support-mi.patch b/SOURCES/kvm-hw-pcie-fix-the-generic-pcie-root-port-to-support-mi.patch new file mode 100644 index 0000000..61d330c --- /dev/null +++ b/SOURCES/kvm-hw-pcie-fix-the-generic-pcie-root-port-to-support-mi.patch @@ -0,0 +1,109 @@ +From b131cb258ae051a74bfa4566b62322fea5268c93 Mon Sep 17 00:00:00 2001 +From: Marcel Apfelbaum +Date: Sun, 18 Jun 2017 14:41:05 +0200 +Subject: [PATCH 8/8] hw/pcie: fix the generic pcie root port to support + migration + +RH-Author: Marcel Apfelbaum +Message-id: <20170618144105.52277-1-marcel@redhat.com> +Patchwork-id: 75639 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] hw/pcie: fix the generic pcie root port to support migration +Bugzilla: 1455150 +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Laurent Vivier +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Auger Eric + +Upstream: merged +Tests: migration + hot-unplug on private laptop + +Add msix state to pcie-root-ports's vmstate +in order to support migration. + +Signed-off-by: Miroslav Rezanina + +Conflicts: + include/hw/compat.h + - no need for 2.9 "x-migrate-msix" compat prop. + +Signed-off-by: Marcel Apfelbaum +Reviewed-by: Dr. David Alan Gilbert +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit bc277a52fbea1532d1adf30ba0edf15ab3dcdead) +Signed-off-by: Marcel Apfelbaum +--- + hw/pci-bridge/gen_pcie_root_port.c | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/hw/pci-bridge/gen_pcie_root_port.c b/hw/pci-bridge/gen_pcie_root_port.c +index 8ebffa8..cb694d6 100644 +--- a/hw/pci-bridge/gen_pcie_root_port.c ++++ b/hw/pci-bridge/gen_pcie_root_port.c +@@ -20,6 +20,14 @@ + #define GEN_PCIE_ROOT_PORT_AER_OFFSET 0x100 + #define GEN_PCIE_ROOT_PORT_MSIX_NR_VECTOR 1 + ++typedef struct GenPCIERootPort { ++ /*< private >*/ ++ PCIESlot parent_obj; ++ /*< public >*/ ++ ++ bool migrate_msix; ++} GenPCIERootPort; ++ + static uint8_t gen_rp_aer_vector(const PCIDevice *d) + { + return 0; +@@ -45,6 +53,13 @@ static void gen_rp_interrupts_uninit(PCIDevice *d) + msix_uninit_exclusive_bar(d); + } + ++static bool gen_rp_test_migrate_msix(void *opaque, int version_id) ++{ ++ GenPCIERootPort *rp = opaque; ++ ++ return rp->migrate_msix; ++} ++ + static const VMStateDescription vmstate_rp_dev = { + .name = "pcie-root-port", + .version_id = 1, +@@ -54,10 +69,18 @@ static const VMStateDescription vmstate_rp_dev = { + VMSTATE_PCI_DEVICE(parent_obj.parent_obj.parent_obj, PCIESlot), + VMSTATE_STRUCT(parent_obj.parent_obj.parent_obj.exp.aer_log, + PCIESlot, 0, vmstate_pcie_aer_log, PCIEAERLog), ++ VMSTATE_MSIX_TEST(parent_obj.parent_obj.parent_obj.parent_obj, ++ GenPCIERootPort, ++ gen_rp_test_migrate_msix), + VMSTATE_END_OF_LIST() + } + }; + ++static Property gen_rp_props[] = { ++ DEFINE_PROP_BOOL("x-migrate-msix", GenPCIERootPort, migrate_msix, true), ++ DEFINE_PROP_END_OF_LIST() ++}; ++ + static void gen_rp_dev_class_init(ObjectClass *klass, void *data) + { + DeviceClass *dc = DEVICE_CLASS(klass); +@@ -68,6 +91,7 @@ static void gen_rp_dev_class_init(ObjectClass *klass, void *data) + k->device_id = PCI_DEVICE_ID_REDHAT_PCIE_RP; + dc->desc = "PCI Express Root Port"; + dc->vmsd = &vmstate_rp_dev; ++ dc->props = gen_rp_props; + rpc->aer_vector = gen_rp_aer_vector; + rpc->interrupts_init = gen_rp_interrupts_init; + rpc->interrupts_uninit = gen_rp_interrupts_uninit; +@@ -77,6 +101,7 @@ static void gen_rp_dev_class_init(ObjectClass *klass, void *data) + static const TypeInfo gen_rp_dev_info = { + .name = TYPE_GEN_PCIE_ROOT_PORT, + .parent = TYPE_PCIE_ROOT_PORT, ++ .instance_size = sizeof(GenPCIERootPort), + .class_init = gen_rp_dev_class_init, + }; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-ppc-spapr-Adjust-firmware-name-for-PCI-bridges.patch b/SOURCES/kvm-hw-ppc-spapr-Adjust-firmware-name-for-PCI-bridges.patch new file mode 100644 index 0000000..4f81190 --- /dev/null +++ b/SOURCES/kvm-hw-ppc-spapr-Adjust-firmware-name-for-PCI-bridges.patch @@ -0,0 +1,53 @@ +From 9c591e6f1c691fcd8ed9e7294e8220e1e3b22572 Mon Sep 17 00:00:00 2001 +From: Thomas Huth +Date: Mon, 26 Jun 2017 07:48:24 +0200 +Subject: [PATCH] hw/ppc/spapr: Adjust firmware name for PCI bridges + +RH-Author: Thomas Huth +Message-id: <1498463304-23230-2-git-send-email-thuth@redhat.com> +Patchwork-id: 75682 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 1/1] hw/ppc/spapr: Adjust firmware name for PCI bridges +Bugzilla: 1459170 +RH-Acked-by: Laurent Vivier +RH-Acked-by: David Hildenbrand +RH-Acked-by: Laszlo Ersek + +SLOF uses "pci" as name for PCI bridges nodes in the device tree instead +of "pci-bridges", so booting via bootindex from a device behind a PCI +bridge currently does not work since QEMU passes the wrong name in the +"qemu,boot-list" property. Fix it by changing the name of the PCI bridge +nodes to "pci" instead. + +Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1459170 +Signed-off-by: Thomas Huth +Signed-off-by: David Gibson +(cherry picked from commit 4871dd4c3f70f528147f426fe42676b4193cb3b7) +Signed-off-by: Miroslav Rezanina + +Conflicts: + hw/ppc/spapr.c + (contextual conflict due to missing commit c4e13492afad2c49) +--- + hw/ppc/spapr.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 62e2696..aadb562 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -2454,6 +2454,12 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus, + return g_strdup_printf("pci@%"PRIX64, phb->buid); + } + ++ if (g_str_equal("pci-bridge", qdev_fw_name(dev))) { ++ /* SLOF uses "pci" instead of "pci-bridge" for PCI bridges */ ++ PCIDevice *pcidev = CAST(PCIDevice, dev, TYPE_PCI_DEVICE); ++ return g_strdup_printf("pci@%x", PCI_SLOT(pcidev->devfn)); ++ } ++ + return NULL; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-hw-virtio-fix-vhost-user-fails-to-startup-when-MQ.patch b/SOURCES/kvm-hw-virtio-fix-vhost-user-fails-to-startup-when-MQ.patch new file mode 100644 index 0000000..2e1f698 --- /dev/null +++ b/SOURCES/kvm-hw-virtio-fix-vhost-user-fails-to-startup-when-MQ.patch @@ -0,0 +1,116 @@ +From 15a523d06dc0977624c6574825152a6c5d25ae2a Mon Sep 17 00:00:00 2001 +From: Jens Freimann +Date: Thu, 18 May 2017 14:06:46 +0200 +Subject: [PATCH 21/27] hw/virtio: fix vhost user fails to startup when MQ +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jens Freimann +Message-id: <20170518140646.19126-2-jfreiman@redhat.com> +Patchwork-id: 75329 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] hw/virtio: fix vhost user fails to startup when MQ +Bugzilla: 1447592 +RH-Acked-by: wexu@redhat.com +RH-Acked-by: Laurent Vivier +RH-Acked-by: Maxime Coquelin + +From: Zhiyong Yang + + Qemu2.7~2.9 and vhost user for dpdk 17.02 release work together +to cause failures of new connection when negotiating to set MQ. +(one queue pair works well). + Because there exist some bugs in qemu code when introducing +VHOST_USER_PROTOCOL_F_REPLY_ACK to qemu. When vhost_user_set_mem_table +is invoked to deal with the vhost message VHOST_USER_SET_MEM_TABLE +for the second time, qemu indeed doesn't send the messge (The message +needs to be sent only once)but still will be waiting for dpdk's reply +ack, then, qemu is always freezing, while DPDK is always waiting for +next vhost message from qemu. + The patch aims to fix the bug, MQ can work well. + The same bug is found in function vhost_user_net_set_mtu, it is fixed +at the same time. + DPDK related patch is as following: + http://www.dpdk.org/dev/patchwork/patch/23955/ + +Signed-off-by: Zhiyong Yang +Cc: qemu-stable@nongnu.org +Fixes: ca525ce5618b ("vhost-user: Introduce a new protocol feature REPLY_ACK.") +Reviewed-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Tested-by: Jens Freimann +Reviewed-by: Marc-André Lureau +(cherry picked from commit 60cd11024f41cc73175e651a2dfe09a3cade56bb) +Signed-off-by: Jens Freimann +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost-user.c | 21 +++++++++++++-------- + 1 file changed, 13 insertions(+), 8 deletions(-) + +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 9334a8a..32a95a8 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -163,22 +163,26 @@ fail: + } + + static int process_message_reply(struct vhost_dev *dev, +- VhostUserRequest request) ++ VhostUserMsg msg) + { +- VhostUserMsg msg; ++ VhostUserMsg msg_reply; + +- if (vhost_user_read(dev, &msg) < 0) { ++ if ((msg.flags & VHOST_USER_NEED_REPLY_MASK) == 0) { ++ return 0; ++ } ++ ++ if (vhost_user_read(dev, &msg_reply) < 0) { + return -1; + } + +- if (msg.request != request) { ++ if (msg_reply.request != msg.request) { + error_report("Received unexpected msg type." + "Expected %d received %d", +- request, msg.request); ++ msg.request, msg_reply.request); + return -1; + } + +- return msg.payload.u64 ? -1 : 0; ++ return msg_reply.payload.u64 ? -1 : 0; + } + + static bool vhost_user_one_time_request(VhostUserRequest request) +@@ -208,6 +212,7 @@ static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg, + * request, we just ignore it. + */ + if (vhost_user_one_time_request(msg->request) && dev->vq_index != 0) { ++ msg->flags &= ~VHOST_USER_NEED_REPLY_MASK; + return 0; + } + +@@ -320,7 +325,7 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev, + } + + if (reply_supported) { +- return process_message_reply(dev, msg.request); ++ return process_message_reply(dev, msg); + } + + return 0; +@@ -712,7 +717,7 @@ static int vhost_user_net_set_mtu(struct vhost_dev *dev, uint16_t mtu) + + /* If reply_ack supported, slave has to ack specified MTU is valid */ + if (reply_supported) { +- return process_message_reply(dev, msg.request); ++ return process_message_reply(dev, msg); + } + + return 0; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-input-don-t-queue-delay-if-paused.patch b/SOURCES/kvm-input-don-t-queue-delay-if-paused.patch new file mode 100644 index 0000000..b7e413b --- /dev/null +++ b/SOURCES/kvm-input-don-t-queue-delay-if-paused.patch @@ -0,0 +1,60 @@ +From 411289538c4bf8b948152211c7f0f84865084c52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Fri, 26 May 2017 07:44:56 +0200 +Subject: [PATCH 01/13] input: don't queue delay if paused +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Marc-André Lureau +Message-id: <20170526074456.19599-1-marcandre.lureau@redhat.com> +Patchwork-id: 75419 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] input: don't queue delay if paused +Bugzilla: 1444326 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Vlad Yasevich + +qemu_input_event_send() discards key event when the guest is paused, +but not the delay. + +The delay ends up in the input queue, and qemu_input_event_send_key() +will further fill the queue with upcoming events. + +VNC uses qemu_input_event_send_key_delay(), not SPICE, which results +in a different input behaviour on pause: VNC will queue the events +(except the first that is discarded), SPICE will discard all events. + +Don't queue delay if paused, and provide same behaviour on SPICE and +VNC clients on resume (and potentially avoid over-allocating the +buffer queue) + +Signed-off-by: Marc-André Lureau +Message-id: 20170425130520.31819-1-marcandre.lureau@redhat.com +Signed-off-by: Gerd Hoffmann + +(cherry picked from commit 05c6638b203fd7d8bbfa88ac6e6198e32ed0506f) +Signed-off-by: Marc-André Lureau +Signed-off-by: Miroslav Rezanina +--- + ui/input.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/ui/input.c b/ui/input.c +index ed88cda..383158b 100644 +--- a/ui/input.c ++++ b/ui/input.c +@@ -405,6 +405,10 @@ void qemu_input_event_send_key_qcode(QemuConsole *src, QKeyCode q, bool down) + + void qemu_input_event_send_key_delay(uint32_t delay_ms) + { ++ if (!runstate_is_running() && !runstate_check(RUN_STATE_SUSPENDED)) { ++ return; ++ } ++ + if (!kbd_timer) { + kbd_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, qemu_input_queue_process, + &kbd_queue); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-intel_iommu-allow-dynamic-switch-of-IOMMU-region.patch b/SOURCES/kvm-intel_iommu-allow-dynamic-switch-of-IOMMU-region.patch new file mode 100644 index 0000000..9d79efd --- /dev/null +++ b/SOURCES/kvm-intel_iommu-allow-dynamic-switch-of-IOMMU-region.patch @@ -0,0 +1,208 @@ +From 00c6524796e9fcbcf21804f24f84b835fd667498 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:52 +0200 +Subject: [PATCH 13/23] intel_iommu: allow dynamic switch of IOMMU region + +RH-Author: Peter Xu +Message-id: <1493002373-13010-9-git-send-email-peterx@redhat.com> +Patchwork-id: 74856 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 8/9] intel_iommu: allow dynamic switch of IOMMU region +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +This is preparation work to finally enabled dynamic switching ON/OFF for +VT-d protection. The old VT-d codes is using static IOMMU address space, +and that won't satisfy vfio-pci device listeners. + +Let me explain. + +vfio-pci devices depend on the memory region listener and IOMMU replay +mechanism to make sure the device mapping is coherent with the guest +even if there are domain switches. And there are two kinds of domain +switches: + + (1) switch from domain A -> B + (2) switch from domain A -> no domain (e.g., turn DMAR off) + +Case (1) is handled by the context entry invalidation handling by the +VT-d replay logic. What the replay function should do here is to replay +the existing page mappings in domain B. + +However for case (2), we don't want to replay any domain mappings - we +just need the default GPA->HPA mappings (the address_space_memory +mapping). And this patch helps on case (2) to build up the mapping +automatically by leveraging the vfio-pci memory listeners. + +Another important thing that this patch does is to seperate +IR (Interrupt Remapping) from DMAR (DMA Remapping). IR region should not +depend on the DMAR region (like before this patch). It should be a +standalone region, and it should be able to be activated without +DMAR (which is a common behavior of Linux kernel - by default it enables +IR while disabled DMAR). + +Reviewed-by: Jason Wang +Reviewed-by: David Gibson +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-9-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 558e0024a428a8f21605dc8aa026612ccc0f14cd) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/i386/intel_iommu.c | 81 ++++++++++++++++++++++++++++++++++++++++--- + hw/i386/trace-events | 2 +- + include/hw/i386/intel_iommu.h | 2 ++ + 3 files changed, 79 insertions(+), 6 deletions(-) + +diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c +index 7af4e22..f7dec82 100644 +--- a/hw/i386/intel_iommu.c ++++ b/hw/i386/intel_iommu.c +@@ -1291,9 +1291,49 @@ static void vtd_handle_gcmd_sirtp(IntelIOMMUState *s) + vtd_set_clear_mask_long(s, DMAR_GSTS_REG, 0, VTD_GSTS_IRTPS); + } + ++static void vtd_switch_address_space(VTDAddressSpace *as) ++{ ++ assert(as); ++ ++ trace_vtd_switch_address_space(pci_bus_num(as->bus), ++ VTD_PCI_SLOT(as->devfn), ++ VTD_PCI_FUNC(as->devfn), ++ as->iommu_state->dmar_enabled); ++ ++ /* Turn off first then on the other */ ++ if (as->iommu_state->dmar_enabled) { ++ memory_region_set_enabled(&as->sys_alias, false); ++ memory_region_set_enabled(&as->iommu, true); ++ } else { ++ memory_region_set_enabled(&as->iommu, false); ++ memory_region_set_enabled(&as->sys_alias, true); ++ } ++} ++ ++static void vtd_switch_address_space_all(IntelIOMMUState *s) ++{ ++ GHashTableIter iter; ++ VTDBus *vtd_bus; ++ int i; ++ ++ g_hash_table_iter_init(&iter, s->vtd_as_by_busptr); ++ while (g_hash_table_iter_next(&iter, NULL, (void **)&vtd_bus)) { ++ for (i = 0; i < X86_IOMMU_PCI_DEVFN_MAX; i++) { ++ if (!vtd_bus->dev_as[i]) { ++ continue; ++ } ++ vtd_switch_address_space(vtd_bus->dev_as[i]); ++ } ++ } ++} ++ + /* Handle Translation Enable/Disable */ + static void vtd_handle_gcmd_te(IntelIOMMUState *s, bool en) + { ++ if (s->dmar_enabled == en) { ++ return; ++ } ++ + VTD_DPRINTF(CSR, "Translation Enable %s", (en ? "on" : "off")); + + if (en) { +@@ -1308,6 +1348,8 @@ static void vtd_handle_gcmd_te(IntelIOMMUState *s, bool en) + /* Ok - report back to driver */ + vtd_set_clear_mask_long(s, DMAR_GSTS_REG, VTD_GSTS_TES, 0); + } ++ ++ vtd_switch_address_space_all(s); + } + + /* Handle Interrupt Remap Enable/Disable */ +@@ -2529,15 +2571,44 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn) + vtd_dev_as->devfn = (uint8_t)devfn; + vtd_dev_as->iommu_state = s; + vtd_dev_as->context_cache_entry.context_cache_gen = 0; ++ ++ /* ++ * Memory region relationships looks like (Address range shows ++ * only lower 32 bits to make it short in length...): ++ * ++ * |-----------------+-------------------+----------| ++ * | Name | Address range | Priority | ++ * |-----------------+-------------------+----------+ ++ * | vtd_root | 00000000-ffffffff | 0 | ++ * | intel_iommu | 00000000-ffffffff | 1 | ++ * | vtd_sys_alias | 00000000-ffffffff | 1 | ++ * | intel_iommu_ir | fee00000-feefffff | 64 | ++ * |-----------------+-------------------+----------| ++ * ++ * We enable/disable DMAR by switching enablement for ++ * vtd_sys_alias and intel_iommu regions. IR region is always ++ * enabled. ++ */ + memory_region_init_iommu(&vtd_dev_as->iommu, OBJECT(s), +- &s->iommu_ops, "intel_iommu", UINT64_MAX); ++ &s->iommu_ops, "intel_iommu_dmar", ++ UINT64_MAX); ++ memory_region_init_alias(&vtd_dev_as->sys_alias, OBJECT(s), ++ "vtd_sys_alias", get_system_memory(), ++ 0, memory_region_size(get_system_memory())); + memory_region_init_io(&vtd_dev_as->iommu_ir, OBJECT(s), + &vtd_mem_ir_ops, s, "intel_iommu_ir", + VTD_INTERRUPT_ADDR_SIZE); +- memory_region_add_subregion(&vtd_dev_as->iommu, VTD_INTERRUPT_ADDR_FIRST, +- &vtd_dev_as->iommu_ir); +- address_space_init(&vtd_dev_as->as, +- &vtd_dev_as->iommu, name); ++ memory_region_init(&vtd_dev_as->root, OBJECT(s), ++ "vtd_root", UINT64_MAX); ++ memory_region_add_subregion_overlap(&vtd_dev_as->root, ++ VTD_INTERRUPT_ADDR_FIRST, ++ &vtd_dev_as->iommu_ir, 64); ++ address_space_init(&vtd_dev_as->as, &vtd_dev_as->root, name); ++ memory_region_add_subregion_overlap(&vtd_dev_as->root, 0, ++ &vtd_dev_as->sys_alias, 1); ++ memory_region_add_subregion_overlap(&vtd_dev_as->root, 0, ++ &vtd_dev_as->iommu, 1); ++ vtd_switch_address_space(vtd_dev_as); + } + return vtd_dev_as; + } +diff --git a/hw/i386/trace-events b/hw/i386/trace-events +index f725bca..3c3a167 100644 +--- a/hw/i386/trace-events ++++ b/hw/i386/trace-events +@@ -4,7 +4,6 @@ + x86_iommu_iec_notify(bool global, uint32_t index, uint32_t mask) "Notify IEC invalidation: global=%d index=%" PRIu32 " mask=%" PRIu32 + + # hw/i386/intel_iommu.c +-vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)" + vtd_inv_desc(const char *type, uint64_t hi, uint64_t lo) "invalidate desc type %s high 0x%"PRIx64" low 0x%"PRIx64 + vtd_inv_desc_invalid(uint64_t hi, uint64_t lo) "invalid inv desc hi 0x%"PRIx64" lo 0x%"PRIx64 + vtd_inv_desc_cc_domain(uint16_t domain) "context invalidate domain 0x%"PRIx16 +@@ -37,6 +36,7 @@ vtd_page_walk_one(uint32_t level, uint64_t iova, uint64_t gpa, uint64_t mask, in + vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to unable to read" + vtd_page_walk_skip_perm(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to perm empty" + vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set" ++vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)" + + # hw/i386/amd_iommu.c + amdvi_evntlog_fail(uint64_t addr, uint32_t head) "error: fail to write at addr 0x%"PRIx64" + offset 0x%"PRIx32 +diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h +index fe645aa..8f212a1 100644 +--- a/include/hw/i386/intel_iommu.h ++++ b/include/hw/i386/intel_iommu.h +@@ -83,6 +83,8 @@ struct VTDAddressSpace { + uint8_t devfn; + AddressSpace as; + MemoryRegion iommu; ++ MemoryRegion root; ++ MemoryRegion sys_alias; + MemoryRegion iommu_ir; /* Interrupt region: 0xfeeXXXXX */ + IntelIOMMUState *iommu_state; + VTDContextCacheEntry context_cache_entry; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-intel_iommu-enable-remote-IOTLB.patch b/SOURCES/kvm-intel_iommu-enable-remote-IOTLB.patch new file mode 100644 index 0000000..826930b --- /dev/null +++ b/SOURCES/kvm-intel_iommu-enable-remote-IOTLB.patch @@ -0,0 +1,401 @@ +From e229f18722e7b141ca06b3323114989e9a7355b4 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:53 +0200 +Subject: [PATCH 14/23] intel_iommu: enable remote IOTLB + +RH-Author: Peter Xu +Message-id: <1493002373-13010-10-git-send-email-peterx@redhat.com> +Patchwork-id: 74857 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 9/9] intel_iommu: enable remote IOTLB +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +This patch is based on Aviv Ben-David ()'s patch +upstream: + + "IOMMU: enable intel_iommu map and unmap notifiers" + https://lists.gnu.org/archive/html/qemu-devel/2016-11/msg01453.html + +However I removed/fixed some content, and added my own codes. + +Instead of translate() every page for iotlb invalidations (which is +slower), we walk the pages when needed and notify in a hook function. + +This patch enables vfio devices for VT-d emulation. + +And, since we already have vhost DMAR support via device-iotlb, a +natural benefit that this patch brings is that vt-d enabled vhost can +live even without ATS capability now. Though more tests are needed. + +Signed-off-by: Aviv Ben-David +Reviewed-by: Jason Wang +Reviewed-by: David Gibson +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-10-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit dd4d607e40dcd2cb7646b510504880a70939d91b) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/i386/intel_iommu.c | 191 ++++++++++++++++++++++++++++++++++++++--- + hw/i386/intel_iommu_internal.h | 1 + + hw/i386/trace-events | 1 + + include/hw/i386/intel_iommu.h | 8 ++ + 4 files changed, 188 insertions(+), 13 deletions(-) + +diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c +index f7dec82..02f047c 100644 +--- a/hw/i386/intel_iommu.c ++++ b/hw/i386/intel_iommu.c +@@ -806,7 +806,8 @@ next: + * @private: private data for the hook function + */ + static int vtd_page_walk(VTDContextEntry *ce, uint64_t start, uint64_t end, +- vtd_page_walk_hook hook_fn, void *private) ++ vtd_page_walk_hook hook_fn, void *private, ++ bool notify_unmap) + { + dma_addr_t addr = vtd_get_slpt_base_from_context(ce); + uint32_t level = vtd_get_level_from_context_entry(ce); +@@ -821,7 +822,7 @@ static int vtd_page_walk(VTDContextEntry *ce, uint64_t start, uint64_t end, + } + + return vtd_page_walk_level(addr, start, end, hook_fn, private, +- level, true, true, false); ++ level, true, true, notify_unmap); + } + + /* Map a device to its corresponding domain (context-entry) */ +@@ -1038,6 +1039,15 @@ static void vtd_interrupt_remap_table_setup(IntelIOMMUState *s) + s->intr_root, s->intr_size); + } + ++static void vtd_iommu_replay_all(IntelIOMMUState *s) ++{ ++ IntelIOMMUNotifierNode *node; ++ ++ QLIST_FOREACH(node, &s->notifiers_list, next) { ++ memory_region_iommu_replay_all(&node->vtd_as->iommu); ++ } ++} ++ + static void vtd_context_global_invalidate(IntelIOMMUState *s) + { + trace_vtd_inv_desc_cc_global(); +@@ -1045,6 +1055,14 @@ static void vtd_context_global_invalidate(IntelIOMMUState *s) + if (s->context_cache_gen == VTD_CONTEXT_CACHE_GEN_MAX) { + vtd_reset_context_cache(s); + } ++ /* ++ * From VT-d spec 6.5.2.1, a global context entry invalidation ++ * should be followed by a IOTLB global invalidation, so we should ++ * be safe even without this. Hoewever, let's replay the region as ++ * well to be safer, and go back here when we need finer tunes for ++ * VT-d emulation codes. ++ */ ++ vtd_iommu_replay_all(s); + } + + +@@ -1111,6 +1129,16 @@ static void vtd_context_device_invalidate(IntelIOMMUState *s, + trace_vtd_inv_desc_cc_device(bus_n, VTD_PCI_SLOT(devfn_it), + VTD_PCI_FUNC(devfn_it)); + vtd_as->context_cache_entry.context_cache_gen = 0; ++ /* ++ * So a device is moving out of (or moving into) a ++ * domain, a replay() suites here to notify all the ++ * IOMMU_NOTIFIER_MAP registers about this change. ++ * This won't bring bad even if we have no such ++ * notifier registered - the IOMMU notification ++ * framework will skip MAP notifications if that ++ * happened. ++ */ ++ memory_region_iommu_replay_all(&vtd_as->iommu); + } + } + } +@@ -1152,12 +1180,53 @@ static void vtd_iotlb_global_invalidate(IntelIOMMUState *s) + { + trace_vtd_iotlb_reset("global invalidation recved"); + vtd_reset_iotlb(s); ++ vtd_iommu_replay_all(s); + } + + static void vtd_iotlb_domain_invalidate(IntelIOMMUState *s, uint16_t domain_id) + { ++ IntelIOMMUNotifierNode *node; ++ VTDContextEntry ce; ++ VTDAddressSpace *vtd_as; ++ + g_hash_table_foreach_remove(s->iotlb, vtd_hash_remove_by_domain, + &domain_id); ++ ++ QLIST_FOREACH(node, &s->notifiers_list, next) { ++ vtd_as = node->vtd_as; ++ if (!vtd_dev_to_context_entry(s, pci_bus_num(vtd_as->bus), ++ vtd_as->devfn, &ce) && ++ domain_id == VTD_CONTEXT_ENTRY_DID(ce.hi)) { ++ memory_region_iommu_replay_all(&vtd_as->iommu); ++ } ++ } ++} ++ ++static int vtd_page_invalidate_notify_hook(IOMMUTLBEntry *entry, ++ void *private) ++{ ++ memory_region_notify_iommu((MemoryRegion *)private, *entry); ++ return 0; ++} ++ ++static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s, ++ uint16_t domain_id, hwaddr addr, ++ uint8_t am) ++{ ++ IntelIOMMUNotifierNode *node; ++ VTDContextEntry ce; ++ int ret; ++ ++ QLIST_FOREACH(node, &(s->notifiers_list), next) { ++ VTDAddressSpace *vtd_as = node->vtd_as; ++ ret = vtd_dev_to_context_entry(s, pci_bus_num(vtd_as->bus), ++ vtd_as->devfn, &ce); ++ if (!ret && domain_id == VTD_CONTEXT_ENTRY_DID(ce.hi)) { ++ vtd_page_walk(&ce, addr, addr + (1 << am) * VTD_PAGE_SIZE, ++ vtd_page_invalidate_notify_hook, ++ (void *)&vtd_as->iommu, true); ++ } ++ } + } + + static void vtd_iotlb_page_invalidate(IntelIOMMUState *s, uint16_t domain_id, +@@ -1170,6 +1239,7 @@ static void vtd_iotlb_page_invalidate(IntelIOMMUState *s, uint16_t domain_id, + info.addr = addr; + info.mask = ~((1 << am) - 1); + g_hash_table_foreach_remove(s->iotlb, vtd_hash_remove_by_page, &info); ++ vtd_iotlb_page_invalidate_notify(s, domain_id, addr, am); + } + + /* Flush IOTLB +@@ -2187,15 +2257,33 @@ static void vtd_iommu_notify_flag_changed(MemoryRegion *iommu, + IOMMUNotifierFlag new) + { + VTDAddressSpace *vtd_as = container_of(iommu, VTDAddressSpace, iommu); ++ IntelIOMMUState *s = vtd_as->iommu_state; ++ IntelIOMMUNotifierNode *node = NULL; ++ IntelIOMMUNotifierNode *next_node = NULL; + +- if (new & IOMMU_NOTIFIER_MAP) { +- error_report("Device at bus %s addr %02x.%d requires iommu " +- "notifier which is currently not supported by " +- "intel-iommu emulation", +- vtd_as->bus->qbus.name, PCI_SLOT(vtd_as->devfn), +- PCI_FUNC(vtd_as->devfn)); ++ if (!s->caching_mode && new & IOMMU_NOTIFIER_MAP) { ++ error_report("We need to set cache_mode=1 for intel-iommu to enable " ++ "device assignment with IOMMU protection."); + exit(1); + } ++ ++ if (old == IOMMU_NOTIFIER_NONE) { ++ node = g_malloc0(sizeof(*node)); ++ node->vtd_as = vtd_as; ++ QLIST_INSERT_HEAD(&s->notifiers_list, node, next); ++ return; ++ } ++ ++ /* update notifier node with new flags */ ++ QLIST_FOREACH_SAFE(node, &s->notifiers_list, next, next_node) { ++ if (node->vtd_as == vtd_as) { ++ if (new == IOMMU_NOTIFIER_NONE) { ++ QLIST_REMOVE(node, next); ++ g_free(node); ++ } ++ return; ++ } ++ } + } + + static const VMStateDescription vtd_vmstate = { +@@ -2613,6 +2701,74 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn) + return vtd_dev_as; + } + ++/* Unmap the whole range in the notifier's scope. */ ++static void vtd_address_space_unmap(VTDAddressSpace *as, IOMMUNotifier *n) ++{ ++ IOMMUTLBEntry entry; ++ hwaddr size; ++ hwaddr start = n->start; ++ hwaddr end = n->end; ++ ++ /* ++ * Note: all the codes in this function has a assumption that IOVA ++ * bits are no more than VTD_MGAW bits (which is restricted by ++ * VT-d spec), otherwise we need to consider overflow of 64 bits. ++ */ ++ ++ if (end > VTD_ADDRESS_SIZE) { ++ /* ++ * Don't need to unmap regions that is bigger than the whole ++ * VT-d supported address space size ++ */ ++ end = VTD_ADDRESS_SIZE; ++ } ++ ++ assert(start <= end); ++ size = end - start; ++ ++ if (ctpop64(size) != 1) { ++ /* ++ * This size cannot format a correct mask. Let's enlarge it to ++ * suite the minimum available mask. ++ */ ++ int n = 64 - clz64(size); ++ if (n > VTD_MGAW) { ++ /* should not happen, but in case it happens, limit it */ ++ n = VTD_MGAW; ++ } ++ size = 1ULL << n; ++ } ++ ++ entry.target_as = &address_space_memory; ++ /* Adjust iova for the size */ ++ entry.iova = n->start & ~(size - 1); ++ /* This field is meaningless for unmap */ ++ entry.translated_addr = 0; ++ entry.perm = IOMMU_NONE; ++ entry.addr_mask = size - 1; ++ ++ trace_vtd_as_unmap_whole(pci_bus_num(as->bus), ++ VTD_PCI_SLOT(as->devfn), ++ VTD_PCI_FUNC(as->devfn), ++ entry.iova, size); ++ ++ memory_region_notify_one(n, &entry); ++} ++ ++static void vtd_address_space_unmap_all(IntelIOMMUState *s) ++{ ++ IntelIOMMUNotifierNode *node; ++ VTDAddressSpace *vtd_as; ++ IOMMUNotifier *n; ++ ++ QLIST_FOREACH(node, &s->notifiers_list, next) { ++ vtd_as = node->vtd_as; ++ IOMMU_NOTIFIER_FOREACH(n, &vtd_as->iommu) { ++ vtd_address_space_unmap(vtd_as, n); ++ } ++ } ++} ++ + static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) + { + memory_region_notify_one((IOMMUNotifier *)private, entry); +@@ -2626,16 +2782,19 @@ static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n) + uint8_t bus_n = pci_bus_num(vtd_as->bus); + VTDContextEntry ce; + ++ /* ++ * The replay can be triggered by either a invalidation or a newly ++ * created entry. No matter what, we release existing mappings ++ * (it means flushing caches for UNMAP-only registers). ++ */ ++ vtd_address_space_unmap(vtd_as, n); ++ + if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) == 0) { +- /* +- * Scanned a valid context entry, walk over the pages and +- * notify when needed. +- */ + trace_vtd_replay_ce_valid(bus_n, PCI_SLOT(vtd_as->devfn), + PCI_FUNC(vtd_as->devfn), + VTD_CONTEXT_ENTRY_DID(ce.hi), + ce.hi, ce.lo); +- vtd_page_walk(&ce, 0, ~0ULL, vtd_replay_hook, (void *)n); ++ vtd_page_walk(&ce, 0, ~0ULL, vtd_replay_hook, (void *)n, false); + } else { + trace_vtd_replay_ce_invalid(bus_n, PCI_SLOT(vtd_as->devfn), + PCI_FUNC(vtd_as->devfn)); +@@ -2754,6 +2913,11 @@ static void vtd_reset(DeviceState *dev) + + VTD_DPRINTF(GENERAL, ""); + vtd_init(s); ++ ++ /* ++ * When device reset, throw away all mappings and external caches ++ */ ++ vtd_address_space_unmap_all(s); + } + + static AddressSpace *vtd_host_dma_iommu(PCIBus *bus, void *opaque, int devfn) +@@ -2817,6 +2981,7 @@ static void vtd_realize(DeviceState *dev, Error **errp) + return; + } + ++ QLIST_INIT(&s->notifiers_list); + memset(s->vtd_as_by_bus_num, 0, sizeof(s->vtd_as_by_bus_num)); + memory_region_init_io(&s->csrmem, OBJECT(s), &vtd_mem_ops, s, + "intel_iommu", DMAR_REG_SIZE); +diff --git a/hw/i386/intel_iommu_internal.h b/hw/i386/intel_iommu_internal.h +index 4104121..29d6707 100644 +--- a/hw/i386/intel_iommu_internal.h ++++ b/hw/i386/intel_iommu_internal.h +@@ -197,6 +197,7 @@ + #define VTD_DOMAIN_ID_MASK ((1UL << VTD_DOMAIN_ID_SHIFT) - 1) + #define VTD_CAP_ND (((VTD_DOMAIN_ID_SHIFT - 4) / 2) & 7ULL) + #define VTD_MGAW 39 /* Maximum Guest Address Width */ ++#define VTD_ADDRESS_SIZE (1ULL << VTD_MGAW) + #define VTD_CAP_MGAW (((VTD_MGAW - 1) & 0x3fULL) << 16) + #define VTD_MAMV 18ULL + #define VTD_CAP_MAMV (VTD_MAMV << 48) +diff --git a/hw/i386/trace-events b/hw/i386/trace-events +index 3c3a167..04a6980 100644 +--- a/hw/i386/trace-events ++++ b/hw/i386/trace-events +@@ -37,6 +37,7 @@ vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"P + vtd_page_walk_skip_perm(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to perm empty" + vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set" + vtd_switch_address_space(uint8_t bus, uint8_t slot, uint8_t fn, bool on) "Device %02x:%02x.%x switching address space (iommu enabled=%d)" ++vtd_as_unmap_whole(uint8_t bus, uint8_t slot, uint8_t fn, uint64_t iova, uint64_t size) "Device %02x:%02x.%x start 0x%"PRIx64" size 0x%"PRIx64 + + # hw/i386/amd_iommu.c + amdvi_evntlog_fail(uint64_t addr, uint32_t head) "error: fail to write at addr 0x%"PRIx64" + offset 0x%"PRIx32 +diff --git a/include/hw/i386/intel_iommu.h b/include/hw/i386/intel_iommu.h +index 8f212a1..3e51876 100644 +--- a/include/hw/i386/intel_iommu.h ++++ b/include/hw/i386/intel_iommu.h +@@ -63,6 +63,7 @@ typedef union VTD_IR_TableEntry VTD_IR_TableEntry; + typedef union VTD_IR_MSIAddress VTD_IR_MSIAddress; + typedef struct VTDIrq VTDIrq; + typedef struct VTD_MSIMessage VTD_MSIMessage; ++typedef struct IntelIOMMUNotifierNode IntelIOMMUNotifierNode; + + /* Context-Entry */ + struct VTDContextEntry { +@@ -249,6 +250,11 @@ struct VTD_MSIMessage { + /* When IR is enabled, all MSI/MSI-X data bits should be zero */ + #define VTD_IR_MSI_DATA (0) + ++struct IntelIOMMUNotifierNode { ++ VTDAddressSpace *vtd_as; ++ QLIST_ENTRY(IntelIOMMUNotifierNode) next; ++}; ++ + /* The iommu (DMAR) device state struct */ + struct IntelIOMMUState { + X86IOMMUState x86_iommu; +@@ -286,6 +292,8 @@ struct IntelIOMMUState { + MemoryRegionIOMMUOps iommu_ops; + GHashTable *vtd_as_by_busptr; /* VTDBus objects indexed by PCIBus* reference */ + VTDBus *vtd_as_by_bus_num[VTD_PCI_BUS_MAX]; /* VTDBus objects indexed by bus number */ ++ /* list of registered notifiers */ ++ QLIST_HEAD(, IntelIOMMUNotifierNode) notifiers_list; + + /* interrupt remapping */ + bool intr_enabled; /* Whether guest enabled IR */ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-intel_iommu-provide-its-own-replay-callback.patch b/SOURCES/kvm-intel_iommu-provide-its-own-replay-callback.patch new file mode 100644 index 0000000..3a1bfd3 --- /dev/null +++ b/SOURCES/kvm-intel_iommu-provide-its-own-replay-callback.patch @@ -0,0 +1,300 @@ +From ddc12e82e90ec51a5e3323058e52da090fae81cc Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:51 +0200 +Subject: [PATCH 12/23] intel_iommu: provide its own replay() callback + +RH-Author: Peter Xu +Message-id: <1493002373-13010-8-git-send-email-peterx@redhat.com> +Patchwork-id: 74855 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 7/9] intel_iommu: provide its own replay() callback +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +The default replay() don't work for VT-d since vt-d will have a huge +default memory region which covers address range 0-(2^64-1). This will +normally consumes a lot of time (which looks like a dead loop). + +The solution is simple - we don't walk over all the regions. Instead, we +jump over the regions when we found that the page directories are empty. +It'll greatly reduce the time to walk the whole region. + +To achieve this, we provided a page walk helper to do that, invoking +corresponding hook function when we found an page we are interested in. +vtd_page_walk_level() is the core logic for the page walking. It's +interface is designed to suite further use case, e.g., to invalidate a +range of addresses. + +Reviewed-by: Jason Wang +Reviewed-by: David Gibson +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-8-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit f06a696dc958dd80f7eaf5be66fdefac77741ee0) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/i386/intel_iommu.c | 182 ++++++++++++++++++++++++++++++++++++++++++++++++-- + hw/i386/trace-events | 7 ++ + include/exec/memory.h | 2 + + 3 files changed, 186 insertions(+), 5 deletions(-) + +diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c +index 2412df4..7af4e22 100644 +--- a/hw/i386/intel_iommu.c ++++ b/hw/i386/intel_iommu.c +@@ -595,6 +595,22 @@ static inline uint32_t vtd_get_agaw_from_context_entry(VTDContextEntry *ce) + return 30 + (ce->hi & VTD_CONTEXT_ENTRY_AW) * 9; + } + ++static inline uint64_t vtd_iova_limit(VTDContextEntry *ce) ++{ ++ uint32_t ce_agaw = vtd_get_agaw_from_context_entry(ce); ++ return 1ULL << MIN(ce_agaw, VTD_MGAW); ++} ++ ++/* Return true if IOVA passes range check, otherwise false. */ ++static inline bool vtd_iova_range_check(uint64_t iova, VTDContextEntry *ce) ++{ ++ /* ++ * Check if @iova is above 2^X-1, where X is the minimum of MGAW ++ * in CAP_REG and AW in context-entry. ++ */ ++ return !(iova & ~(vtd_iova_limit(ce) - 1)); ++} ++ + static const uint64_t vtd_paging_entry_rsvd_field[] = { + [0] = ~0ULL, + /* For not large page */ +@@ -630,13 +646,9 @@ static int vtd_iova_to_slpte(VTDContextEntry *ce, uint64_t iova, bool is_write, + uint32_t level = vtd_get_level_from_context_entry(ce); + uint32_t offset; + uint64_t slpte; +- uint32_t ce_agaw = vtd_get_agaw_from_context_entry(ce); + uint64_t access_right_check; + +- /* Check if @iova is above 2^X-1, where X is the minimum of MGAW +- * in CAP_REG and AW in context-entry. +- */ +- if (iova & ~((1ULL << MIN(ce_agaw, VTD_MGAW)) - 1)) { ++ if (!vtd_iova_range_check(iova, ce)) { + VTD_DPRINTF(GENERAL, "error: iova 0x%"PRIx64 " exceeds limits", iova); + return -VTD_FR_ADDR_BEYOND_MGAW; + } +@@ -684,6 +696,134 @@ static int vtd_iova_to_slpte(VTDContextEntry *ce, uint64_t iova, bool is_write, + } + } + ++typedef int (*vtd_page_walk_hook)(IOMMUTLBEntry *entry, void *private); ++ ++/** ++ * vtd_page_walk_level - walk over specific level for IOVA range ++ * ++ * @addr: base GPA addr to start the walk ++ * @start: IOVA range start address ++ * @end: IOVA range end address (start <= addr < end) ++ * @hook_fn: hook func to be called when detected page ++ * @private: private data to be passed into hook func ++ * @read: whether parent level has read permission ++ * @write: whether parent level has write permission ++ * @notify_unmap: whether we should notify invalid entries ++ */ ++static int vtd_page_walk_level(dma_addr_t addr, uint64_t start, ++ uint64_t end, vtd_page_walk_hook hook_fn, ++ void *private, uint32_t level, ++ bool read, bool write, bool notify_unmap) ++{ ++ bool read_cur, write_cur, entry_valid; ++ uint32_t offset; ++ uint64_t slpte; ++ uint64_t subpage_size, subpage_mask; ++ IOMMUTLBEntry entry; ++ uint64_t iova = start; ++ uint64_t iova_next; ++ int ret = 0; ++ ++ trace_vtd_page_walk_level(addr, level, start, end); ++ ++ subpage_size = 1ULL << vtd_slpt_level_shift(level); ++ subpage_mask = vtd_slpt_level_page_mask(level); ++ ++ while (iova < end) { ++ iova_next = (iova & subpage_mask) + subpage_size; ++ ++ offset = vtd_iova_level_offset(iova, level); ++ slpte = vtd_get_slpte(addr, offset); ++ ++ if (slpte == (uint64_t)-1) { ++ trace_vtd_page_walk_skip_read(iova, iova_next); ++ goto next; ++ } ++ ++ if (vtd_slpte_nonzero_rsvd(slpte, level)) { ++ trace_vtd_page_walk_skip_reserve(iova, iova_next); ++ goto next; ++ } ++ ++ /* Permissions are stacked with parents' */ ++ read_cur = read && (slpte & VTD_SL_R); ++ write_cur = write && (slpte & VTD_SL_W); ++ ++ /* ++ * As long as we have either read/write permission, this is a ++ * valid entry. The rule works for both page entries and page ++ * table entries. ++ */ ++ entry_valid = read_cur | write_cur; ++ ++ if (vtd_is_last_slpte(slpte, level)) { ++ entry.target_as = &address_space_memory; ++ entry.iova = iova & subpage_mask; ++ /* NOTE: this is only meaningful if entry_valid == true */ ++ entry.translated_addr = vtd_get_slpte_addr(slpte); ++ entry.addr_mask = ~subpage_mask; ++ entry.perm = IOMMU_ACCESS_FLAG(read_cur, write_cur); ++ if (!entry_valid && !notify_unmap) { ++ trace_vtd_page_walk_skip_perm(iova, iova_next); ++ goto next; ++ } ++ trace_vtd_page_walk_one(level, entry.iova, entry.translated_addr, ++ entry.addr_mask, entry.perm); ++ if (hook_fn) { ++ ret = hook_fn(&entry, private); ++ if (ret < 0) { ++ return ret; ++ } ++ } ++ } else { ++ if (!entry_valid) { ++ trace_vtd_page_walk_skip_perm(iova, iova_next); ++ goto next; ++ } ++ ret = vtd_page_walk_level(vtd_get_slpte_addr(slpte), iova, ++ MIN(iova_next, end), hook_fn, private, ++ level - 1, read_cur, write_cur, ++ notify_unmap); ++ if (ret < 0) { ++ return ret; ++ } ++ } ++ ++next: ++ iova = iova_next; ++ } ++ ++ return 0; ++} ++ ++/** ++ * vtd_page_walk - walk specific IOVA range, and call the hook ++ * ++ * @ce: context entry to walk upon ++ * @start: IOVA address to start the walk ++ * @end: IOVA range end address (start <= addr < end) ++ * @hook_fn: the hook that to be called for each detected area ++ * @private: private data for the hook function ++ */ ++static int vtd_page_walk(VTDContextEntry *ce, uint64_t start, uint64_t end, ++ vtd_page_walk_hook hook_fn, void *private) ++{ ++ dma_addr_t addr = vtd_get_slpt_base_from_context(ce); ++ uint32_t level = vtd_get_level_from_context_entry(ce); ++ ++ if (!vtd_iova_range_check(start, ce)) { ++ return -VTD_FR_ADDR_BEYOND_MGAW; ++ } ++ ++ if (!vtd_iova_range_check(end, ce)) { ++ /* Fix end so that it reaches the maximum */ ++ end = vtd_iova_limit(ce); ++ } ++ ++ return vtd_page_walk_level(addr, start, end, hook_fn, private, ++ level, true, true, false); ++} ++ + /* Map a device to its corresponding domain (context-entry) */ + static int vtd_dev_to_context_entry(IntelIOMMUState *s, uint8_t bus_num, + uint8_t devfn, VTDContextEntry *ce) +@@ -2402,6 +2542,37 @@ VTDAddressSpace *vtd_find_add_as(IntelIOMMUState *s, PCIBus *bus, int devfn) + return vtd_dev_as; + } + ++static int vtd_replay_hook(IOMMUTLBEntry *entry, void *private) ++{ ++ memory_region_notify_one((IOMMUNotifier *)private, entry); ++ return 0; ++} ++ ++static void vtd_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n) ++{ ++ VTDAddressSpace *vtd_as = container_of(mr, VTDAddressSpace, iommu); ++ IntelIOMMUState *s = vtd_as->iommu_state; ++ uint8_t bus_n = pci_bus_num(vtd_as->bus); ++ VTDContextEntry ce; ++ ++ if (vtd_dev_to_context_entry(s, bus_n, vtd_as->devfn, &ce) == 0) { ++ /* ++ * Scanned a valid context entry, walk over the pages and ++ * notify when needed. ++ */ ++ trace_vtd_replay_ce_valid(bus_n, PCI_SLOT(vtd_as->devfn), ++ PCI_FUNC(vtd_as->devfn), ++ VTD_CONTEXT_ENTRY_DID(ce.hi), ++ ce.hi, ce.lo); ++ vtd_page_walk(&ce, 0, ~0ULL, vtd_replay_hook, (void *)n); ++ } else { ++ trace_vtd_replay_ce_invalid(bus_n, PCI_SLOT(vtd_as->devfn), ++ PCI_FUNC(vtd_as->devfn)); ++ } ++ ++ return; ++} ++ + /* Do the initialization. It will also be called when reset, so pay + * attention when adding new initialization stuff. + */ +@@ -2416,6 +2587,7 @@ static void vtd_init(IntelIOMMUState *s) + + s->iommu_ops.translate = vtd_iommu_translate; + s->iommu_ops.notify_flag_changed = vtd_iommu_notify_flag_changed; ++ s->iommu_ops.replay = vtd_iommu_replay; + s->root = 0; + s->root_extended = false; + s->dmar_enabled = false; +diff --git a/hw/i386/trace-events b/hw/i386/trace-events +index baed874..f725bca 100644 +--- a/hw/i386/trace-events ++++ b/hw/i386/trace-events +@@ -30,6 +30,13 @@ vtd_iotlb_cc_hit(uint8_t bus, uint8_t devfn, uint64_t high, uint64_t low, uint32 + vtd_iotlb_cc_update(uint8_t bus, uint8_t devfn, uint64_t high, uint64_t low, uint32_t gen1, uint32_t gen2) "IOTLB context update bus 0x%"PRIx8" devfn 0x%"PRIx8" high 0x%"PRIx64" low 0x%"PRIx64" gen %"PRIu32" -> gen %"PRIu32 + vtd_iotlb_reset(const char *reason) "IOTLB reset (reason: %s)" + vtd_fault_disabled(void) "Fault processing disabled for context entry" ++vtd_replay_ce_valid(uint8_t bus, uint8_t dev, uint8_t fn, uint16_t domain, uint64_t hi, uint64_t lo) "replay valid context device %02"PRIx8":%02"PRIx8".%02"PRIx8" domain 0x%"PRIx16" hi 0x%"PRIx64" lo 0x%"PRIx64 ++vtd_replay_ce_invalid(uint8_t bus, uint8_t dev, uint8_t fn) "replay invalid context device %02"PRIx8":%02"PRIx8".%02"PRIx8 ++vtd_page_walk_level(uint64_t addr, uint32_t level, uint64_t start, uint64_t end) "walk (base=0x%"PRIx64", level=%"PRIu32") iova range 0x%"PRIx64" - 0x%"PRIx64 ++vtd_page_walk_one(uint32_t level, uint64_t iova, uint64_t gpa, uint64_t mask, int perm) "detected page level 0x%"PRIx32" iova 0x%"PRIx64" -> gpa 0x%"PRIx64" mask 0x%"PRIx64" perm %d" ++vtd_page_walk_skip_read(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to unable to read" ++vtd_page_walk_skip_perm(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to perm empty" ++vtd_page_walk_skip_reserve(uint64_t iova, uint64_t next) "Page walk skip iova 0x%"PRIx64" - 0x%"PRIx64" due to rsrv set" + + # hw/i386/amd_iommu.c + amdvi_evntlog_fail(uint64_t addr, uint32_t head) "error: fail to write at addr 0x%"PRIx64" + offset 0x%"PRIx32 +diff --git a/include/exec/memory.h b/include/exec/memory.h +index c0280b7..c4fc94d 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -55,6 +55,8 @@ typedef enum { + IOMMU_RW = 3, + } IOMMUAccessFlags; + ++#define IOMMU_ACCESS_FLAG(r, w) (((r) ? IOMMU_RO : 0) | ((w) ? IOMMU_WO : 0)) ++ + struct IOMMUTLBEntry { + AddressSpace *target_as; + hwaddr iova; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-intel_iommu-use-the-correct-memory-region-for-device.patch b/SOURCES/kvm-intel_iommu-use-the-correct-memory-region-for-device.patch new file mode 100644 index 0000000..b71b044 --- /dev/null +++ b/SOURCES/kvm-intel_iommu-use-the-correct-memory-region-for-device.patch @@ -0,0 +1,53 @@ +From 328695863c6a7de16529044f85f6821811e0cf33 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:50 +0200 +Subject: [PATCH 11/23] intel_iommu: use the correct memory region for device + IOTLB notification + +RH-Author: Peter Xu +Message-id: <1493002373-13010-7-git-send-email-peterx@redhat.com> +Patchwork-id: 74854 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 6/9] intel_iommu: use the correct memory region for device IOTLB notification +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +From: Jason Wang + +We have a specific memory region for DMAR now, so it's wrong to +trigger the notifier with the root region. + +Cc: Michael S. Tsirkin +Cc: Paolo Bonzini +Cc: Richard Henderson +Cc: Eduardo Habkost +Signed-off-by: Jason Wang +Reviewed-by: Peter Xu +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-7-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 10315b9b28c28655ce64500281f4a028d0f8c5ff) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/i386/intel_iommu.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c +index 22d8226..2412df4 100644 +--- a/hw/i386/intel_iommu.c ++++ b/hw/i386/intel_iommu.c +@@ -1457,7 +1457,7 @@ static bool vtd_process_device_iotlb_desc(IntelIOMMUState *s, + entry.iova = addr; + entry.perm = IOMMU_NONE; + entry.translated_addr = 0; +- memory_region_notify_iommu(entry.target_as->root, entry); ++ memory_region_notify_iommu(&vtd_dev_as->iommu, entry); + + done: + return true; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-iommu-Don-t-crash-if-machine-is-not-PC_MACHINE.patch b/SOURCES/kvm-iommu-Don-t-crash-if-machine-is-not-PC_MACHINE.patch new file mode 100644 index 0000000..8f14129 --- /dev/null +++ b/SOURCES/kvm-iommu-Don-t-crash-if-machine-is-not-PC_MACHINE.patch @@ -0,0 +1,110 @@ +From c10d3ce55f7e0adfceb61559c5b37984ca7010e5 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Thu, 18 May 2017 17:57:08 +0200 +Subject: [PATCH 22/27] iommu: Don't crash if machine is not PC_MACHINE + +RH-Author: Eduardo Habkost +Message-id: <20170518175708.22623-1-ehabkost@redhat.com> +Patchwork-id: 75335 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] iommu: Don't crash if machine is not PC_MACHINE +Bugzilla: 1451483 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth +RH-Acked-by: Marcel Apfelbaum + +Currently it's possible to crash QEMU using "-device *-iommu" and +"-machine none": + + $ qemu-system-x86_64 -machine none -device amd-iommu + qemu/hw/i386/amd_iommu.c:1140:amdvi_realize: Object 0x55627dafbc90 is not an instance of type generic-pc-machine + Aborted (core dumped) + $ qemu-system-x86_64 -machine none -device intel-iommu + qemu/hw/i386/intel_iommu.c:2972:vtd_realize: Object 0x56292ec0bc90 is not an instance of type generic-pc-machine + Aborted (core dumped) + +Fix amd-iommu and intel-iommu to ensure the current machine is really a +TYPE_PC_MACHINE instance at their realize methods. + +Resulting error messages: + + $ qemu-system-x86_64 -machine none -device amd-iommu + qemu-system-x86_64: -device amd-iommu: Machine-type 'none' not supported by amd-iommu + $ qemu-system-x86_64 -machine none -device intel-iommu + qemu-system-x86_64: -device intel-iommu: Machine-type 'none' not supported by intel-iommu + +Signed-off-by: Eduardo Habkost +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit ef0e8fc768a561dd13a86420b3268f6f3d5d0621) +Signed-off-by: Eduardo Habkost +Signed-off-by: Miroslav Rezanina +--- + hw/i386/amd_iommu.c | 15 ++++++++++++++- + hw/i386/intel_iommu.c | 14 ++++++++++++-- + 2 files changed, 26 insertions(+), 3 deletions(-) + +diff --git a/hw/i386/amd_iommu.c b/hw/i386/amd_iommu.c +index f86a40a..516ebae 100644 +--- a/hw/i386/amd_iommu.c ++++ b/hw/i386/amd_iommu.c +@@ -21,6 +21,7 @@ + */ + #include "qemu/osdep.h" + #include "hw/i386/amd_iommu.h" ++#include "qapi/error.h" + #include "qemu/error-report.h" + #include "trace.h" + +@@ -1137,7 +1138,19 @@ static void amdvi_realize(DeviceState *dev, Error **err) + int ret = 0; + AMDVIState *s = AMD_IOMMU_DEVICE(dev); + X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); +- PCIBus *bus = PC_MACHINE(qdev_get_machine())->bus; ++ MachineState *ms = MACHINE(qdev_get_machine()); ++ MachineClass *mc = MACHINE_GET_CLASS(ms); ++ PCMachineState *pcms = ++ PC_MACHINE(object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE)); ++ PCIBus *bus; ++ ++ if (!pcms) { ++ error_setg(err, "Machine-type '%s' not supported by amd-iommu", ++ mc->name); ++ return; ++ } ++ ++ bus = pcms->bus; + s->iotlb = g_hash_table_new_full(amdvi_uint64_hash, + amdvi_uint64_equal, g_free, g_free); + +diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c +index 02f047c..a12b176 100644 +--- a/hw/i386/intel_iommu.c ++++ b/hw/i386/intel_iommu.c +@@ -2969,11 +2969,21 @@ static bool vtd_decide_config(IntelIOMMUState *s, Error **errp) + + static void vtd_realize(DeviceState *dev, Error **errp) + { +- PCMachineState *pcms = PC_MACHINE(qdev_get_machine()); +- PCIBus *bus = pcms->bus; ++ MachineState *ms = MACHINE(qdev_get_machine()); ++ MachineClass *mc = MACHINE_GET_CLASS(ms); ++ PCMachineState *pcms = ++ PC_MACHINE(object_dynamic_cast(OBJECT(ms), TYPE_PC_MACHINE)); ++ PCIBus *bus; + IntelIOMMUState *s = INTEL_IOMMU_DEVICE(dev); + X86IOMMUState *x86_iommu = X86_IOMMU_DEVICE(dev); + ++ if (!pcms) { ++ error_setg(errp, "Machine-type '%s' not supported by intel-iommu", ++ mc->name); ++ return; ++ } ++ ++ bus = pcms->bus; + VTD_DPRINTF(GENERAL, ""); + x86_iommu->type = TYPE_INTEL; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-irqchip-skip-update-msi-when-disabled.patch b/SOURCES/kvm-irqchip-skip-update-msi-when-disabled.patch new file mode 100644 index 0000000..3d88905 --- /dev/null +++ b/SOURCES/kvm-irqchip-skip-update-msi-when-disabled.patch @@ -0,0 +1,83 @@ +From c4a89076814a915d3db4680df7138930d8d12ffb Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 6 Jun 2017 06:57:31 +0200 +Subject: [PATCH 08/17] kvm: irqchip: skip update msi when disabled + +RH-Author: Peter Xu +Message-id: <1496732251-27935-4-git-send-email-peterx@redhat.com> +Patchwork-id: 75490 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH 3/3] kvm: irqchip: skip update msi when disabled +Bugzilla: 1448813 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Xiao Wang +RH-Acked-by: Michael S. Tsirkin + +It's possible that one device kept its irqfd/virq there even when +MSI/MSIX was disabled globally for that device. One example is +virtio-net-pci (see commit f1d0f15a6 and virtio_pci_vq_vector_mask()). +It is used as a fast path to avoid allocate/release irqfd/virq +frequently when guest enables/disables MSIX. + +However, this fast path brought a problem to msi_route_list, that the +device MSIRouteEntry is still dangling there even if MSIX disabled - +then we cannot know which message to fetch, even if we can, the messages +are meaningless. In this case, we can just simply ignore this entry. + +It's safe, since when MSIX is enabled again, we'll rebuild them no +matter what. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1448813 + +Signed-off-by: Peter Xu +Message-Id: <1494309644-18743-4-git-send-email-peterx@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 207aa6d44ce2cbd2444eac9cea0d853a4265303e) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina + +Conflicts: + target/i386/kvm.c + +The conflict is caused by missing of upstream commit 795c40b8 +("migration: Create migration/blocker.h"), which removed the include of +"migration/migration.h" but introduced "migration/blocker.h". +--- + target/i386/kvm.c | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +diff --git a/target/i386/kvm.c b/target/i386/kvm.c +index cfd7695..c3fae53 100644 +--- a/target/i386/kvm.c ++++ b/target/i386/kvm.c +@@ -43,6 +43,7 @@ + #include "standard-headers/asm-x86/hyperv.h" + #include "hw/pci/pci.h" + #include "hw/pci/msi.h" ++#include "hw/pci/msix.h" + #include "migration/migration.h" + #include "exec/memattrs.h" + #include "trace.h" +@@ -3510,12 +3511,17 @@ static void kvm_update_msi_routes_all(void *private, bool global, + int cnt = 0; + MSIRouteEntry *entry; + MSIMessage msg; ++ PCIDevice *dev; ++ + /* TODO: explicit route update */ + QLIST_FOREACH(entry, &msi_route_list, list) { + cnt++; +- msg = pci_get_msi_message(entry->dev, entry->vector); +- kvm_irqchip_update_msi_route(kvm_state, entry->virq, +- msg, entry->dev); ++ dev = entry->dev; ++ if (!msix_enabled(dev) && !msi_enabled(dev)) { ++ continue; ++ } ++ msg = pci_get_msi_message(dev, entry->vector); ++ kvm_irqchip_update_msi_route(kvm_state, entry->virq, msg, dev); + } + kvm_irqchip_commit_routes(kvm_state); + trace_kvm_x86_update_msi_routes(cnt); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-irqchip-trace-changes-on-msi-add-remove.patch b/SOURCES/kvm-irqchip-trace-changes-on-msi-add-remove.patch new file mode 100644 index 0000000..859b9f1 --- /dev/null +++ b/SOURCES/kvm-irqchip-trace-changes-on-msi-add-remove.patch @@ -0,0 +1,74 @@ +From 01a019025bbd959bc685c7f74c0d4a5a29073c5c Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 6 Jun 2017 06:57:29 +0200 +Subject: [PATCH 06/17] kvm: irqchip: trace changes on msi add/remove +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +Message-id: <1496732251-27935-2-git-send-email-peterx@redhat.com> +Patchwork-id: 75491 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH 1/3] kvm: irqchip: trace changes on msi add/remove +Bugzilla: 1448813 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Xiao Wang +RH-Acked-by: Michael S. Tsirkin + +It'll be nice to know which virq belongs to which device/vector when +adding msi routes, so adding two more parameters for the add trace. + +Meanwhile, releasing virq has no tracing before. Add one for it. + +Signed-off-by: Peter Xu +Message-Id: <1494309644-18743-2-git-send-email-peterx@redhat.com> +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: Paolo Bonzini +(cherry picked from commit 9fa1e6b19866d0ff8a6ec5e7b54fead055256970) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + kvm-all.c | 4 +++- + trace-events | 3 ++- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/kvm-all.c b/kvm-all.c +index 4322aa3..128f5c8 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -1144,6 +1144,7 @@ void kvm_irqchip_release_virq(KVMState *s, int virq) + } + clear_gsi(s, virq); + kvm_arch_release_virq_post(virq); ++ trace_kvm_irqchip_release_virq(virq); + } + + static unsigned int kvm_hash_msi(uint32_t data) +@@ -1287,7 +1288,8 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector, PCIDevice *dev) + return -EINVAL; + } + +- trace_kvm_irqchip_add_msi_route(virq); ++ trace_kvm_irqchip_add_msi_route(dev ? dev->name : (char *)"N/A", ++ vector, virq); + + kvm_add_routing_entry(s, &kroute); + kvm_arch_add_msi_route_post(&kroute, vector, dev); +diff --git a/trace-events b/trace-events +index 4db44d0..bd54701 100644 +--- a/trace-events ++++ b/trace-events +@@ -85,8 +85,9 @@ kvm_device_ioctl(int fd, int type, void *arg) "dev fd %d, type 0x%x, arg %p" + kvm_failed_reg_get(uint64_t id, const char *msg) "Warning: Unable to retrieve ONEREG %" PRIu64 " from KVM: %s" + kvm_failed_reg_set(uint64_t id, const char *msg) "Warning: Unable to set ONEREG %" PRIu64 " to KVM: %s" + kvm_irqchip_commit_routes(void) "" +-kvm_irqchip_add_msi_route(int virq) "Adding MSI route virq=%d" ++kvm_irqchip_add_msi_route(char *name, int vector, int virq) "dev %s vector %d virq %d" + kvm_irqchip_update_msi_route(int virq) "Updating MSI route virq=%d" ++kvm_irqchip_release_virq(int virq) "virq %d" + + # TCG related tracing (mostly disabled by default) + # cpu-exec.c +-- +1.8.3.1 + diff --git a/SOURCES/kvm-linux-headers-update.patch b/SOURCES/kvm-linux-headers-update.patch new file mode 100644 index 0000000..8882599 --- /dev/null +++ b/SOURCES/kvm-linux-headers-update.patch @@ -0,0 +1,582 @@ +From b198c479d7a97c2400a7eebf73581707323e0e7e Mon Sep 17 00:00:00 2001 +From: Auger Eric +Date: Fri, 16 Jun 2017 15:17:52 +0200 +Subject: [PATCH 1/5] linux-headers: update + +RH-Author: Auger Eric +Message-id: <1497626276-18221-2-git-send-email-eric.auger@redhat.com> +Patchwork-id: 75633 +O-Subject: [Pegas-1.0 qemu-kvm PATCH v2 1/5] linux-headers: update +Bugzilla: 1462061 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Peter Xu +RH-Acked-by: Miroslav Rezanina + +From: Cornelia Huck + +Update against Linux v4.12-rc1. + +Also include the new vfio_ccw.h header. + +Signed-off-by: Cornelia Huck +(cherry picked from commit 74c98e20a604b9db58284b8727688df70e9bf643) +Signed-off-by: Eric Auger +Signed-off-by: Miroslav Rezanina +--- + include/standard-headers/asm-x86/hyperv.h | 7 +++++- + include/standard-headers/linux/input-event-codes.h | 1 + + include/standard-headers/linux/input.h | 11 +++++--- + include/standard-headers/linux/pci_regs.h | 3 ++- + linux-headers/asm-arm/kvm.h | 10 +++++++- + linux-headers/asm-arm/unistd-common.h | 1 + + linux-headers/asm-arm64/kvm.h | 10 +++++++- + linux-headers/asm-powerpc/kvm.h | 3 +++ + linux-headers/asm-powerpc/unistd.h | 1 + + linux-headers/asm-s390/kvm.h | 29 +++++++++++++++++++--- + linux-headers/asm-s390/unistd.h | 4 ++- + linux-headers/asm-x86/kvm.h | 3 +++ + linux-headers/asm-x86/unistd_32.h | 2 ++ + linux-headers/asm-x86/unistd_64.h | 1 + + linux-headers/asm-x86/unistd_x32.h | 1 + + linux-headers/linux/kvm.h | 25 +++++++++++++++++++ + linux-headers/linux/userfaultfd.h | 11 +++++--- + linux-headers/linux/vfio.h | 18 ++++++++++++++ + linux-headers/linux/vfio_ccw.h | 24 ++++++++++++++++++ + scripts/update-linux-headers.sh | 2 +- + 20 files changed, 151 insertions(+), 16 deletions(-) + create mode 100644 linux-headers/linux/vfio_ccw.h + +diff --git a/include/standard-headers/asm-x86/hyperv.h b/include/standard-headers/asm-x86/hyperv.h +index eca9a2c..d0c6e0a 100644 +--- a/include/standard-headers/asm-x86/hyperv.h ++++ b/include/standard-headers/asm-x86/hyperv.h +@@ -124,7 +124,7 @@ + * Recommend using hypercall for address space switches rather + * than MOV to CR3 instruction + */ +-#define HV_X64_MWAIT_RECOMMENDED (1 << 0) ++#define HV_X64_AS_SWITCH_RECOMMENDED (1 << 0) + /* Recommend using hypercall for local TLB flushes rather + * than INVLPG or MOV to CR3 instructions */ + #define HV_X64_LOCAL_TLB_FLUSH_RECOMMENDED (1 << 1) +@@ -148,6 +148,11 @@ + #define HV_X64_RELAXED_TIMING_RECOMMENDED (1 << 5) + + /* ++ * Virtual APIC support ++ */ ++#define HV_X64_DEPRECATING_AEOI_RECOMMENDED (1 << 9) ++ ++/* + * Crash notification flag. + */ + #define HV_CRASH_CTL_CRASH_NOTIFY (1ULL << 63) +diff --git a/include/standard-headers/linux/input-event-codes.h b/include/standard-headers/linux/input-event-codes.h +index c8b3338..29d463a 100644 +--- a/include/standard-headers/linux/input-event-codes.h ++++ b/include/standard-headers/linux/input-event-codes.h +@@ -641,6 +641,7 @@ + * e.g. teletext or data broadcast application (MHEG, MHP, HbbTV, etc.) + */ + #define KEY_DATA 0x277 ++#define KEY_ONSCREEN_KEYBOARD 0x278 + + #define BTN_TRIGGER_HAPPY 0x2c0 + #define BTN_TRIGGER_HAPPY1 0x2c0 +diff --git a/include/standard-headers/linux/input.h b/include/standard-headers/linux/input.h +index b472b85..666e201 100644 +--- a/include/standard-headers/linux/input.h ++++ b/include/standard-headers/linux/input.h +@@ -58,9 +58,14 @@ struct input_id { + * Note that input core does not clamp reported values to the + * [minimum, maximum] limits, such task is left to userspace. + * +- * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in +- * units per millimeter (units/mm), resolution for rotational axes +- * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian. ++ * The default resolution for main axes (ABS_X, ABS_Y, ABS_Z) ++ * is reported in units per millimeter (units/mm), resolution ++ * for rotational axes (ABS_RX, ABS_RY, ABS_RZ) is reported ++ * 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/deg/s) for rotational axes (ABS_RX, ABS_RY, ABS_RZ). + */ + struct input_absinfo { + int32_t value; +diff --git a/include/standard-headers/linux/pci_regs.h b/include/standard-headers/linux/pci_regs.h +index 634c9c4..d56bb00 100644 +--- a/include/standard-headers/linux/pci_regs.h ++++ b/include/standard-headers/linux/pci_regs.h +@@ -114,7 +114,7 @@ + #define PCI_SUBSYSTEM_ID 0x2e + #define PCI_ROM_ADDRESS 0x30 /* Bits 31..11 are address, 10..1 reserved */ + #define PCI_ROM_ADDRESS_ENABLE 0x01 +-#define PCI_ROM_ADDRESS_MASK (~0x7ffUL) ++#define PCI_ROM_ADDRESS_MASK (~0x7ffU) + + #define PCI_CAPABILITY_LIST 0x34 /* Offset of first capability list entry */ + +@@ -630,6 +630,7 @@ + #define PCI_EXP_DEVCTL2_COMP_TIMEOUT 0x000f /* Completion Timeout Value */ + #define PCI_EXP_DEVCTL2_ARI 0x0020 /* Alternative Routing-ID */ + #define PCI_EXP_DEVCTL2_ATOMIC_REQ 0x0040 /* Set Atomic requests */ ++#define PCI_EXP_DEVCTL2_ATOMIC_EGRESS_BLOCK 0x0080 /* Block atomic egress */ + #define PCI_EXP_DEVCTL2_IDO_REQ_EN 0x0100 /* Allow IDO for requests */ + #define PCI_EXP_DEVCTL2_IDO_CMP_EN 0x0200 /* Allow IDO for completions */ + #define PCI_EXP_DEVCTL2_LTR_EN 0x0400 /* Enable LTR mechanism */ +diff --git a/linux-headers/asm-arm/kvm.h b/linux-headers/asm-arm/kvm.h +index 1101d55..7258a00 100644 +--- a/linux-headers/asm-arm/kvm.h ++++ b/linux-headers/asm-arm/kvm.h +@@ -27,6 +27,8 @@ + #define __KVM_HAVE_IRQ_LINE + #define __KVM_HAVE_READONLY_MEM + ++#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 ++ + #define KVM_REG_SIZE(id) \ + (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT)) + +@@ -114,6 +116,8 @@ struct kvm_debug_exit_arch { + }; + + struct kvm_sync_regs { ++ /* Used with KVM_CAP_ARM_USER_IRQ */ ++ __u64 device_irq_level; + }; + + struct kvm_arch_memory_slot { +@@ -192,13 +196,17 @@ struct kvm_arch_memory_slot { + #define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5 + #define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6 + #define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7 ++#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8 + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10 + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \ + (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT) + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff + #define VGIC_LEVEL_INFO_LINE_LEVEL 0 + +-#define KVM_DEV_ARM_VGIC_CTRL_INIT 0 ++#define KVM_DEV_ARM_VGIC_CTRL_INIT 0 ++#define KVM_DEV_ARM_ITS_SAVE_TABLES 1 ++#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2 ++#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3 + + /* KVM_IRQ_LINE irq field index values */ + #define KVM_ARM_IRQ_TYPE_SHIFT 24 +diff --git a/linux-headers/asm-arm/unistd-common.h b/linux-headers/asm-arm/unistd-common.h +index 13a74af..8d5ceae 100644 +--- a/linux-headers/asm-arm/unistd-common.h ++++ b/linux-headers/asm-arm/unistd-common.h +@@ -353,5 +353,6 @@ + #define __NR_pkey_mprotect (__NR_SYSCALL_BASE + 394) + #define __NR_pkey_alloc (__NR_SYSCALL_BASE + 395) + #define __NR_pkey_free (__NR_SYSCALL_BASE + 396) ++#define __NR_statx (__NR_SYSCALL_BASE + 397) + + #endif /* _ASM_ARM_UNISTD_COMMON_H */ +diff --git a/linux-headers/asm-arm64/kvm.h b/linux-headers/asm-arm64/kvm.h +index 651ec30..31bb1dd 100644 +--- a/linux-headers/asm-arm64/kvm.h ++++ b/linux-headers/asm-arm64/kvm.h +@@ -39,6 +39,8 @@ + #define __KVM_HAVE_IRQ_LINE + #define __KVM_HAVE_READONLY_MEM + ++#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 ++ + #define KVM_REG_SIZE(id) \ + (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT)) + +@@ -143,6 +145,8 @@ struct kvm_debug_exit_arch { + #define KVM_GUESTDBG_USE_HW (1 << 17) + + struct kvm_sync_regs { ++ /* Used with KVM_CAP_ARM_USER_IRQ */ ++ __u64 device_irq_level; + }; + + struct kvm_arch_memory_slot { +@@ -212,13 +216,17 @@ struct kvm_arch_memory_slot { + #define KVM_DEV_ARM_VGIC_GRP_REDIST_REGS 5 + #define KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS 6 + #define KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO 7 ++#define KVM_DEV_ARM_VGIC_GRP_ITS_REGS 8 + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT 10 + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_MASK \ + (0x3fffffULL << KVM_DEV_ARM_VGIC_LINE_LEVEL_INFO_SHIFT) + #define KVM_DEV_ARM_VGIC_LINE_LEVEL_INTID_MASK 0x3ff + #define VGIC_LEVEL_INFO_LINE_LEVEL 0 + +-#define KVM_DEV_ARM_VGIC_CTRL_INIT 0 ++#define KVM_DEV_ARM_VGIC_CTRL_INIT 0 ++#define KVM_DEV_ARM_ITS_SAVE_TABLES 1 ++#define KVM_DEV_ARM_ITS_RESTORE_TABLES 2 ++#define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3 + + /* Device Control API on vcpu fd */ + #define KVM_ARM_VCPU_PMU_V3_CTRL 0 +diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h +index 4edbe4b..07fbeb9 100644 +--- a/linux-headers/asm-powerpc/kvm.h ++++ b/linux-headers/asm-powerpc/kvm.h +@@ -29,6 +29,9 @@ + #define __KVM_HAVE_IRQ_LINE + #define __KVM_HAVE_GUEST_DEBUG + ++/* Not always available, but if it is, this is the correct offset. */ ++#define KVM_COALESCED_MMIO_PAGE_OFFSET 1 ++ + struct kvm_regs { + __u64 pc; + __u64 cr; +diff --git a/linux-headers/asm-powerpc/unistd.h b/linux-headers/asm-powerpc/unistd.h +index 598043c..a178634 100644 +--- a/linux-headers/asm-powerpc/unistd.h ++++ b/linux-headers/asm-powerpc/unistd.h +@@ -393,5 +393,6 @@ + #define __NR_preadv2 380 + #define __NR_pwritev2 381 + #define __NR_kexec_file_load 382 ++#define __NR_statx 383 + + #endif /* _ASM_POWERPC_UNISTD_H_ */ +diff --git a/linux-headers/asm-s390/kvm.h b/linux-headers/asm-s390/kvm.h +index ac63ca6..243f195 100644 +--- a/linux-headers/asm-s390/kvm.h ++++ b/linux-headers/asm-s390/kvm.h +@@ -26,6 +26,8 @@ + #define KVM_DEV_FLIC_ADAPTER_REGISTER 6 + #define KVM_DEV_FLIC_ADAPTER_MODIFY 7 + #define KVM_DEV_FLIC_CLEAR_IO_IRQ 8 ++#define KVM_DEV_FLIC_AISM 9 ++#define KVM_DEV_FLIC_AIRQ_INJECT 10 + /* + * We can have up to 4*64k pending subchannels + 8 adapter interrupts, + * as well as up to ASYNC_PF_PER_VCPU*KVM_MAX_VCPUS pfault done interrupts. +@@ -41,7 +43,14 @@ struct kvm_s390_io_adapter { + __u8 isc; + __u8 maskable; + __u8 swap; +- __u8 pad; ++ __u8 flags; ++}; ++ ++#define KVM_S390_ADAPTER_SUPPRESSIBLE 0x01 ++ ++struct kvm_s390_ais_req { ++ __u8 isc; ++ __u16 mode; + }; + + #define KVM_S390_IO_ADAPTER_MASK 1 +@@ -110,6 +119,7 @@ struct kvm_s390_vm_cpu_machine { + #define KVM_S390_VM_CPU_FEAT_CMMA 10 + #define KVM_S390_VM_CPU_FEAT_PFMFI 11 + #define KVM_S390_VM_CPU_FEAT_SIGPIF 12 ++#define KVM_S390_VM_CPU_FEAT_KSS 13 + struct kvm_s390_vm_cpu_feat { + __u64 feat[16]; + }; +@@ -131,7 +141,8 @@ struct kvm_s390_vm_cpu_subfunc { + __u8 kmo[16]; /* with MSA4 */ + __u8 pcc[16]; /* with MSA4 */ + __u8 ppno[16]; /* with MSA5 */ +- __u8 reserved[1824]; ++ __u8 kma[16]; /* with MSA8 */ ++ __u8 reserved[1808]; + }; + + /* kvm attributes for crypto */ +@@ -197,6 +208,10 @@ struct kvm_guest_debug_arch { + #define KVM_SYNC_VRS (1UL << 6) + #define KVM_SYNC_RICCB (1UL << 7) + #define KVM_SYNC_FPRS (1UL << 8) ++#define KVM_SYNC_GSCB (1UL << 9) ++/* length and alignment of the sdnx as a power of two */ ++#define SDNXC 8 ++#define SDNXL (1UL << SDNXC) + /* definition of registers in kvm_run */ + struct kvm_sync_regs { + __u64 prefix; /* prefix register */ +@@ -217,8 +232,16 @@ struct kvm_sync_regs { + }; + __u8 reserved[512]; /* for future vector expansion */ + __u32 fpc; /* valid on KVM_SYNC_VRS or KVM_SYNC_FPRS */ +- __u8 padding[52]; /* riccb needs to be 64byte aligned */ ++ __u8 padding1[52]; /* riccb needs to be 64byte aligned */ + __u8 riccb[64]; /* runtime instrumentation controls block */ ++ __u8 padding2[192]; /* sdnx needs to be 256byte aligned */ ++ union { ++ __u8 sdnx[SDNXL]; /* state description annex */ ++ struct { ++ __u64 reserved1[2]; ++ __u64 gscb[4]; ++ }; ++ }; + }; + + #define KVM_REG_S390_TODPR (KVM_REG_S390 | KVM_REG_SIZE_U32 | 0x1) +diff --git a/linux-headers/asm-s390/unistd.h b/linux-headers/asm-s390/unistd.h +index 8a404fd..65e7e59 100644 +--- a/linux-headers/asm-s390/unistd.h ++++ b/linux-headers/asm-s390/unistd.h +@@ -313,7 +313,9 @@ + #define __NR_copy_file_range 375 + #define __NR_preadv2 376 + #define __NR_pwritev2 377 +-#define NR_syscalls 378 ++#define __NR_s390_guarded_storage 378 ++#define __NR_statx 379 ++#define NR_syscalls 380 + + /* + * There are some system calls that are not present on 64 bit, some +diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h +index 739c0c5..c2824d0 100644 +--- a/linux-headers/asm-x86/kvm.h ++++ b/linux-headers/asm-x86/kvm.h +@@ -9,6 +9,9 @@ + #include + #include + ++#define KVM_PIO_PAGE_OFFSET 1 ++#define KVM_COALESCED_MMIO_PAGE_OFFSET 2 ++ + #define DE_VECTOR 0 + #define DB_VECTOR 1 + #define BP_VECTOR 3 +diff --git a/linux-headers/asm-x86/unistd_32.h b/linux-headers/asm-x86/unistd_32.h +index d45ea28..8a206df 100644 +--- a/linux-headers/asm-x86/unistd_32.h ++++ b/linux-headers/asm-x86/unistd_32.h +@@ -380,5 +380,7 @@ + #define __NR_pkey_mprotect 380 + #define __NR_pkey_alloc 381 + #define __NR_pkey_free 382 ++#define __NR_statx 383 ++#define __NR_arch_prctl 384 + + #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 e22db91..336c2e4 100644 +--- a/linux-headers/asm-x86/unistd_64.h ++++ b/linux-headers/asm-x86/unistd_64.h +@@ -333,5 +333,6 @@ + #define __NR_pkey_mprotect 329 + #define __NR_pkey_alloc 330 + #define __NR_pkey_free 331 ++#define __NR_statx 332 + + #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 84e58b2..cb98a52 100644 +--- a/linux-headers/asm-x86/unistd_x32.h ++++ b/linux-headers/asm-x86/unistd_x32.h +@@ -286,6 +286,7 @@ + #define __NR_pkey_mprotect (__X32_SYSCALL_BIT + 329) + #define __NR_pkey_alloc (__X32_SYSCALL_BIT + 330) + #define __NR_pkey_free (__X32_SYSCALL_BIT + 331) ++#define __NR_statx (__X32_SYSCALL_BIT + 332) + #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 4e082a8..d2892da 100644 +--- a/linux-headers/linux/kvm.h ++++ b/linux-headers/linux/kvm.h +@@ -702,6 +702,10 @@ struct kvm_ppc_resize_hpt { + #define KVM_VM_PPC_HV 1 + #define KVM_VM_PPC_PR 2 + ++/* on MIPS, 0 forces trap & emulate, 1 forces VZ ASE */ ++#define KVM_VM_MIPS_TE 0 ++#define KVM_VM_MIPS_VZ 1 ++ + #define KVM_S390_SIE_PAGE_OFFSET 1 + + /* +@@ -883,6 +887,14 @@ struct kvm_ppc_resize_hpt { + #define KVM_CAP_PPC_MMU_RADIX 134 + #define KVM_CAP_PPC_MMU_HASH_V3 135 + #define KVM_CAP_IMMEDIATE_EXIT 136 ++#define KVM_CAP_MIPS_VZ 137 ++#define KVM_CAP_MIPS_TE 138 ++#define KVM_CAP_MIPS_64BIT 139 ++#define KVM_CAP_S390_GS 140 ++#define KVM_CAP_S390_AIS 141 ++#define KVM_CAP_SPAPR_TCE_VFIO 142 ++#define KVM_CAP_X86_GUEST_MWAIT 143 ++#define KVM_CAP_ARM_USER_IRQ 144 + + #ifdef KVM_CAP_IRQ_ROUTING + +@@ -1087,6 +1099,7 @@ struct kvm_device_attr { + #define KVM_DEV_VFIO_GROUP 1 + #define KVM_DEV_VFIO_GROUP_ADD 1 + #define KVM_DEV_VFIO_GROUP_DEL 2 ++#define KVM_DEV_VFIO_GROUP_SET_SPAPR_TCE 3 + + enum kvm_device_type { + KVM_DEV_TYPE_FSL_MPIC_20 = 1, +@@ -1108,6 +1121,11 @@ enum kvm_device_type { + KVM_DEV_TYPE_MAX, + }; + ++struct kvm_vfio_spapr_tce { ++ __s32 groupfd; ++ __s32 tablefd; ++}; ++ + /* + * ioctls for VM fds + */ +@@ -1354,4 +1372,11 @@ struct kvm_assigned_msix_entry { + #define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0) + #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1) + ++/* Available with KVM_CAP_ARM_USER_IRQ */ ++ ++/* Bits for run->s.regs.device_irq_level */ ++#define KVM_ARM_DEV_EL1_VTIMER (1 << 0) ++#define KVM_ARM_DEV_EL1_PTIMER (1 << 1) ++#define KVM_ARM_DEV_PMU (1 << 2) ++ + #endif /* __LINUX_KVM_H */ +diff --git a/linux-headers/linux/userfaultfd.h b/linux-headers/linux/userfaultfd.h +index 2ed5dc3..9701772 100644 +--- a/linux-headers/linux/userfaultfd.h ++++ b/linux-headers/linux/userfaultfd.h +@@ -20,7 +20,8 @@ + #define UFFD_API ((__u64)0xAA) + #define UFFD_API_FEATURES (UFFD_FEATURE_EVENT_FORK | \ + UFFD_FEATURE_EVENT_REMAP | \ +- UFFD_FEATURE_EVENT_MADVDONTNEED | \ ++ UFFD_FEATURE_EVENT_REMOVE | \ ++ UFFD_FEATURE_EVENT_UNMAP | \ + UFFD_FEATURE_MISSING_HUGETLBFS | \ + UFFD_FEATURE_MISSING_SHMEM) + #define UFFD_API_IOCTLS \ +@@ -92,7 +93,7 @@ struct uffd_msg { + struct { + __u64 start; + __u64 end; +- } madv_dn; ++ } remove; + + struct { + /* unused reserved fields */ +@@ -109,7 +110,8 @@ struct uffd_msg { + #define UFFD_EVENT_PAGEFAULT 0x12 + #define UFFD_EVENT_FORK 0x13 + #define UFFD_EVENT_REMAP 0x14 +-#define UFFD_EVENT_MADVDONTNEED 0x15 ++#define UFFD_EVENT_REMOVE 0x15 ++#define UFFD_EVENT_UNMAP 0x16 + + /* flags for UFFD_EVENT_PAGEFAULT */ + #define UFFD_PAGEFAULT_FLAG_WRITE (1<<0) /* If this was a write fault */ +@@ -155,9 +157,10 @@ struct uffdio_api { + #define UFFD_FEATURE_PAGEFAULT_FLAG_WP (1<<0) + #define UFFD_FEATURE_EVENT_FORK (1<<1) + #define UFFD_FEATURE_EVENT_REMAP (1<<2) +-#define UFFD_FEATURE_EVENT_MADVDONTNEED (1<<3) ++#define UFFD_FEATURE_EVENT_REMOVE (1<<3) + #define UFFD_FEATURE_MISSING_HUGETLBFS (1<<4) + #define UFFD_FEATURE_MISSING_SHMEM (1<<5) ++#define UFFD_FEATURE_EVENT_UNMAP (1<<6) + __u64 features; + + __u64 ioctls; +diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h +index 531cb2e..4e7ab4c 100644 +--- a/linux-headers/linux/vfio.h ++++ b/linux-headers/linux/vfio.h +@@ -198,6 +198,7 @@ struct vfio_device_info { + #define VFIO_DEVICE_FLAGS_PCI (1 << 1) /* vfio-pci device */ + #define VFIO_DEVICE_FLAGS_PLATFORM (1 << 2) /* vfio-platform device */ + #define VFIO_DEVICE_FLAGS_AMBA (1 << 3) /* vfio-amba device */ ++#define VFIO_DEVICE_FLAGS_CCW (1 << 4) /* vfio-ccw device */ + __u32 num_regions; /* Max region index + 1 */ + __u32 num_irqs; /* Max IRQ index + 1 */ + }; +@@ -212,6 +213,7 @@ struct vfio_device_info { + #define VFIO_DEVICE_API_PCI_STRING "vfio-pci" + #define VFIO_DEVICE_API_PLATFORM_STRING "vfio-platform" + #define VFIO_DEVICE_API_AMBA_STRING "vfio-amba" ++#define VFIO_DEVICE_API_CCW_STRING "vfio-ccw" + + /** + * VFIO_DEVICE_GET_REGION_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 8, +@@ -446,6 +448,22 @@ enum { + VFIO_PCI_NUM_IRQS + }; + ++/* ++ * The vfio-ccw bus driver makes use of the following fixed region and ++ * IRQ index mapping. Unimplemented regions return a size of zero. ++ * Unimplemented IRQ types return a count of zero. ++ */ ++ ++enum { ++ VFIO_CCW_CONFIG_REGION_INDEX, ++ VFIO_CCW_NUM_REGIONS ++}; ++ ++enum { ++ VFIO_CCW_IO_IRQ_INDEX, ++ VFIO_CCW_NUM_IRQS ++}; ++ + /** + * VFIO_DEVICE_GET_PCI_HOT_RESET_INFO - _IORW(VFIO_TYPE, VFIO_BASE + 12, + * struct vfio_pci_hot_reset_info) +diff --git a/linux-headers/linux/vfio_ccw.h b/linux-headers/linux/vfio_ccw.h +new file mode 100644 +index 0000000..3a56551 +--- /dev/null ++++ b/linux-headers/linux/vfio_ccw.h +@@ -0,0 +1,24 @@ ++/* ++ * Interfaces for vfio-ccw ++ * ++ * Copyright IBM Corp. 2017 ++ * ++ * Author(s): Dong Jia Shi ++ */ ++ ++#ifndef _VFIO_CCW_H_ ++#define _VFIO_CCW_H_ ++ ++#include ++ ++struct ccw_io_region { ++#define ORB_AREA_SIZE 12 ++ __u8 orb_area[ORB_AREA_SIZE]; ++#define SCSW_AREA_SIZE 12 ++ __u8 scsw_area[SCSW_AREA_SIZE]; ++#define IRB_AREA_SIZE 96 ++ __u8 irb_area[IRB_AREA_SIZE]; ++ __u32 ret_code; ++} __attribute__((packed)); ++ ++#endif +diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh +index 6a370a8..2f906c4 100755 +--- a/scripts/update-linux-headers.sh ++++ b/scripts/update-linux-headers.sh +@@ -113,7 +113,7 @@ done + + rm -rf "$output/linux-headers/linux" + mkdir -p "$output/linux-headers/linux" +-for header in kvm.h kvm_para.h vfio.h vhost.h \ ++for header in kvm.h kvm_para.h vfio.h vfio_ccw.h vhost.h \ + psci.h userfaultfd.h; do + cp "$tmpdir/include/linux/$header" "$output/linux-headers/linux" + done +-- +1.8.3.1 + diff --git a/SOURCES/kvm-memory-add-MemoryRegionIOMMUOps.replay-callback.patch b/SOURCES/kvm-memory-add-MemoryRegionIOMMUOps.replay-callback.patch new file mode 100644 index 0000000..ff7657f --- /dev/null +++ b/SOURCES/kvm-memory-add-MemoryRegionIOMMUOps.replay-callback.patch @@ -0,0 +1,67 @@ +From e7b7a1c3047a40085acd97756d12750b06c2d8ad Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:49 +0200 +Subject: [PATCH 10/23] memory: add MemoryRegionIOMMUOps.replay() callback + +RH-Author: Peter Xu +Message-id: <1493002373-13010-6-git-send-email-peterx@redhat.com> +Patchwork-id: 74853 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 5/9] memory: add MemoryRegionIOMMUOps.replay() callback +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +Originally we have one memory_region_iommu_replay() function, which is +the default behavior to replay the translations of the whole IOMMU +region. However, on some platform like x86, we may want our own replay +logic for IOMMU regions. This patch adds one more hook for IOMMUOps for +the callback, and it'll override the default if set. + +Reviewed-by: David Gibson +Reviewed-by: Eric Auger +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-6-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit faa362e3cc94bf739a89b457693e3fbd7a4b95c4) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + include/exec/memory.h | 2 ++ + memory.c | 6 ++++++ + 2 files changed, 8 insertions(+) + +diff --git a/include/exec/memory.h b/include/exec/memory.h +index 055b3a8..c0280b7 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -191,6 +191,8 @@ struct MemoryRegionIOMMUOps { + void (*notify_flag_changed)(MemoryRegion *iommu, + IOMMUNotifierFlag old_flags, + IOMMUNotifierFlag new_flags); ++ /* Set this up to provide customized IOMMU replay function */ ++ void (*replay)(MemoryRegion *iommu, IOMMUNotifier *notifier); + }; + + typedef struct CoalescedMemoryRange CoalescedMemoryRange; +diff --git a/memory.c b/memory.c +index ded4bf1..b782d5b 100644 +--- a/memory.c ++++ b/memory.c +@@ -1626,6 +1626,12 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n, + hwaddr addr, granularity; + IOMMUTLBEntry iotlb; + ++ /* If the IOMMU has its own replay callback, override */ ++ if (mr->iommu_ops->replay) { ++ mr->iommu_ops->replay(mr, n); ++ return; ++ } ++ + granularity = memory_region_iommu_get_min_page_size(mr); + + for (addr = 0; addr < memory_region_size(mr); addr += granularity) { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-memory-add-section-range-info-for-IOMMU-notifier.patch b/SOURCES/kvm-memory-add-section-range-info-for-IOMMU-notifier.patch new file mode 100644 index 0000000..d8a43a0 --- /dev/null +++ b/SOURCES/kvm-memory-add-section-range-info-for-IOMMU-notifier.patch @@ -0,0 +1,185 @@ +From 03b074fce3bc0aa09fb2f9c4a464c898c6277559 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:45 +0200 +Subject: [PATCH 06/23] memory: add section range info for IOMMU notifier + +RH-Author: Peter Xu +Message-id: <1493002373-13010-2-git-send-email-peterx@redhat.com> +Patchwork-id: 74849 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 1/9] memory: add section range info for IOMMU notifier +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +In this patch, IOMMUNotifier.{start|end} are introduced to store section +information for a specific notifier. When notification occurs, we not +only check the notification type (MAP|UNMAP), but also check whether the +notified iova range overlaps with the range of specific IOMMU notifier, +and skip those notifiers if not in the listened range. + +When removing an region, we need to make sure we removed the correct +VFIOGuestIOMMU by checking the IOMMUNotifier.start address as well. + +This patch is solving the problem that vfio-pci devices receive +duplicated UNMAP notification on x86 platform when vIOMMU is there. The +issue is that x86 IOMMU has a (0, 2^64-1) IOMMU region, which is +splitted by the (0xfee00000, 0xfeefffff) IRQ region. AFAIK +this (splitted IOMMU region) is only happening on x86. + +This patch also helps vhost to leverage the new interface as well, so +that vhost won't get duplicated cache flushes. In that sense, it's an +slight performance improvement. + +Suggested-by: David Gibson +Reviewed-by: Eric Auger +Reviewed-by: Michael S. Tsirkin +Acked-by: Alex Williamson +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-2-git-send-email-peterx@redhat.com> +[ehabkost: included extra vhost_iommu_region_del() change from Peter Xu] +Signed-off-by: Eduardo Habkost + +(cherry picked from commit 698feb5e13a2d763369909ce33f2bd7a7c1c11c0) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/vfio/common.c | 12 +++++++++--- + hw/virtio/vhost.c | 13 ++++++++++--- + include/exec/memory.h | 19 ++++++++++++++++++- + memory.c | 9 +++++++++ + 4 files changed, 46 insertions(+), 7 deletions(-) + +diff --git a/hw/vfio/common.c b/hw/vfio/common.c +index f3ba9b9..6b33b9f 100644 +--- a/hw/vfio/common.c ++++ b/hw/vfio/common.c +@@ -478,8 +478,13 @@ static void vfio_listener_region_add(MemoryListener *listener, + giommu->iommu_offset = section->offset_within_address_space - + section->offset_within_region; + giommu->container = container; +- giommu->n.notify = vfio_iommu_map_notify; +- giommu->n.notifier_flags = IOMMU_NOTIFIER_ALL; ++ llend = int128_add(int128_make64(section->offset_within_region), ++ section->size); ++ llend = int128_sub(llend, int128_one()); ++ iommu_notifier_init(&giommu->n, vfio_iommu_map_notify, ++ IOMMU_NOTIFIER_ALL, ++ section->offset_within_region, ++ int128_get64(llend)); + QLIST_INSERT_HEAD(&container->giommu_list, giommu, giommu_next); + + memory_region_register_iommu_notifier(giommu->iommu, &giommu->n); +@@ -550,7 +555,8 @@ static void vfio_listener_region_del(MemoryListener *listener, + VFIOGuestIOMMU *giommu; + + QLIST_FOREACH(giommu, &container->giommu_list, giommu_next) { +- if (giommu->iommu == section->mr) { ++ if (giommu->iommu == section->mr && ++ giommu->n.start == section->offset_within_region) { + memory_region_unregister_iommu_notifier(giommu->iommu, + &giommu->n); + QLIST_REMOVE(giommu, giommu_next); +diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c +index 613494d..0001e60 100644 +--- a/hw/virtio/vhost.c ++++ b/hw/virtio/vhost.c +@@ -736,14 +736,20 @@ static void vhost_iommu_region_add(MemoryListener *listener, + struct vhost_dev *dev = container_of(listener, struct vhost_dev, + iommu_listener); + struct vhost_iommu *iommu; ++ Int128 end; + + if (!memory_region_is_iommu(section->mr)) { + return; + } + + iommu = g_malloc0(sizeof(*iommu)); +- iommu->n.notify = vhost_iommu_unmap_notify; +- iommu->n.notifier_flags = IOMMU_NOTIFIER_UNMAP; ++ end = int128_add(int128_make64(section->offset_within_region), ++ section->size); ++ end = int128_sub(end, int128_one()); ++ iommu_notifier_init(&iommu->n, vhost_iommu_unmap_notify, ++ IOMMU_NOTIFIER_UNMAP, ++ section->offset_within_region, ++ int128_get64(end)); + iommu->mr = section->mr; + iommu->iommu_offset = section->offset_within_address_space - + section->offset_within_region; +@@ -765,7 +771,8 @@ static void vhost_iommu_region_del(MemoryListener *listener, + } + + QLIST_FOREACH(iommu, &dev->iommu_list, iommu_next) { +- if (iommu->mr == section->mr) { ++ if (iommu->mr == section->mr && ++ iommu->n.start == section->offset_within_region) { + memory_region_unregister_iommu_notifier(iommu->mr, + &iommu->n); + QLIST_REMOVE(iommu, iommu_next); +diff --git a/include/exec/memory.h b/include/exec/memory.h +index f20b191..0840c89 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -77,13 +77,30 @@ typedef enum { + + #define IOMMU_NOTIFIER_ALL (IOMMU_NOTIFIER_MAP | IOMMU_NOTIFIER_UNMAP) + ++struct IOMMUNotifier; ++typedef void (*IOMMUNotify)(struct IOMMUNotifier *notifier, ++ IOMMUTLBEntry *data); ++ + struct IOMMUNotifier { +- void (*notify)(struct IOMMUNotifier *notifier, IOMMUTLBEntry *data); ++ IOMMUNotify notify; + IOMMUNotifierFlag notifier_flags; ++ /* Notify for address space range start <= addr <= end */ ++ hwaddr start; ++ hwaddr end; + QLIST_ENTRY(IOMMUNotifier) node; + }; + typedef struct IOMMUNotifier IOMMUNotifier; + ++static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn, ++ IOMMUNotifierFlag flags, ++ hwaddr start, hwaddr end) ++{ ++ n->notify = fn; ++ n->notifier_flags = flags; ++ n->start = start; ++ n->end = end; ++} ++ + /* New-style MMIO accessors can indicate that the transaction failed. + * A zero (MEMTX_OK) response means success; anything else is a failure + * of some kind. The memory subsystem will bitwise-OR together results +diff --git a/memory.c b/memory.c +index 4c95aaf..75ac595 100644 +--- a/memory.c ++++ b/memory.c +@@ -1606,6 +1606,7 @@ void memory_region_register_iommu_notifier(MemoryRegion *mr, + + /* We need to register for at least one bitfield */ + assert(n->notifier_flags != IOMMU_NOTIFIER_NONE); ++ assert(n->start <= n->end); + QLIST_INSERT_HEAD(&mr->iommu_notify, n, node); + memory_region_update_iommu_notify_flags(mr); + } +@@ -1667,6 +1668,14 @@ void memory_region_notify_iommu(MemoryRegion *mr, + } + + QLIST_FOREACH(iommu_notifier, &mr->iommu_notify, node) { ++ /* ++ * Skip the notification if the notification does not overlap ++ * with registered range. ++ */ ++ if (iommu_notifier->start > entry.iova + entry.addr_mask + 1 || ++ iommu_notifier->end < entry.iova) { ++ continue; ++ } + if (iommu_notifier->notifier_flags & request_flags) { + iommu_notifier->notify(iommu_notifier, &entry); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-memory-introduce-memory_region_notify_one.patch b/SOURCES/kvm-memory-introduce-memory_region_notify_one.patch new file mode 100644 index 0000000..94d44c3 --- /dev/null +++ b/SOURCES/kvm-memory-introduce-memory_region_notify_one.patch @@ -0,0 +1,122 @@ +From 2bf16e1b643f9aeb9230206cb3cc1f599ab0a3f0 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:48 +0200 +Subject: [PATCH 09/23] memory: introduce memory_region_notify_one() + +RH-Author: Peter Xu +Message-id: <1493002373-13010-5-git-send-email-peterx@redhat.com> +Patchwork-id: 74852 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 4/9] memory: introduce memory_region_notify_one() +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +Generalizing the notify logic in memory_region_notify_iommu() into a +single function. This can be further used in customized replay() +functions for IOMMUs. + +Reviewed-by: David Gibson +Reviewed-by: Eric Auger +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-5-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit bd2bfa4c52e5f4dc6dbaa5be0521aedc31cb53d9) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + include/exec/memory.h | 15 +++++++++++++++ + memory.c | 40 ++++++++++++++++++++++++---------------- + 2 files changed, 39 insertions(+), 16 deletions(-) + +diff --git a/include/exec/memory.h b/include/exec/memory.h +index fb7dff3..055b3a8 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -688,6 +688,21 @@ void memory_region_notify_iommu(MemoryRegion *mr, + IOMMUTLBEntry entry); + + /** ++ * memory_region_notify_one: notify a change in an IOMMU translation ++ * entry to a single notifier ++ * ++ * This works just like memory_region_notify_iommu(), but it only ++ * notifies a specific notifier, not all of them. ++ * ++ * @notifier: the notifier to be notified ++ * @entry: the new entry in the IOMMU translation table. The entry ++ * replaces all old entries for the same virtual I/O address range. ++ * Deleted entries have .@perm == 0. ++ */ ++void memory_region_notify_one(IOMMUNotifier *notifier, ++ IOMMUTLBEntry *entry); ++ ++/** + * memory_region_register_iommu_notifier: register a notifier for changes to + * IOMMU translation entries. + * +diff --git a/memory.c b/memory.c +index b4ed67b..ded4bf1 100644 +--- a/memory.c ++++ b/memory.c +@@ -1662,32 +1662,40 @@ void memory_region_unregister_iommu_notifier(MemoryRegion *mr, + memory_region_update_iommu_notify_flags(mr); + } + +-void memory_region_notify_iommu(MemoryRegion *mr, +- IOMMUTLBEntry entry) ++void memory_region_notify_one(IOMMUNotifier *notifier, ++ IOMMUTLBEntry *entry) + { +- IOMMUNotifier *iommu_notifier; + IOMMUNotifierFlag request_flags; + +- assert(memory_region_is_iommu(mr)); ++ /* ++ * Skip the notification if the notification does not overlap ++ * with registered range. ++ */ ++ if (notifier->start > entry->iova + entry->addr_mask + 1 || ++ notifier->end < entry->iova) { ++ return; ++ } + +- if (entry.perm & IOMMU_RW) { ++ if (entry->perm & IOMMU_RW) { + request_flags = IOMMU_NOTIFIER_MAP; + } else { + request_flags = IOMMU_NOTIFIER_UNMAP; + } + ++ if (notifier->notifier_flags & request_flags) { ++ notifier->notify(notifier, entry); ++ } ++} ++ ++void memory_region_notify_iommu(MemoryRegion *mr, ++ IOMMUTLBEntry entry) ++{ ++ IOMMUNotifier *iommu_notifier; ++ ++ assert(memory_region_is_iommu(mr)); ++ + IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) { +- /* +- * Skip the notification if the notification does not overlap +- * with registered range. +- */ +- if (iommu_notifier->start > entry.iova + entry.addr_mask + 1 || +- iommu_notifier->end < entry.iova) { +- continue; +- } +- if (iommu_notifier->notifier_flags & request_flags) { +- iommu_notifier->notify(iommu_notifier, &entry); +- } ++ memory_region_notify_one(iommu_notifier, &entry); + } + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-memory-provide-IOMMU_NOTIFIER_FOREACH-macro.patch b/SOURCES/kvm-memory-provide-IOMMU_NOTIFIER_FOREACH-macro.patch new file mode 100644 index 0000000..ba9ffc7 --- /dev/null +++ b/SOURCES/kvm-memory-provide-IOMMU_NOTIFIER_FOREACH-macro.patch @@ -0,0 +1,70 @@ +From b4cb4dbce403eecae8765d1b6bcf13fdf361cec3 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:46 +0200 +Subject: [PATCH 07/23] memory: provide IOMMU_NOTIFIER_FOREACH macro + +RH-Author: Peter Xu +Message-id: <1493002373-13010-3-git-send-email-peterx@redhat.com> +Patchwork-id: 74850 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 2/9] memory: provide IOMMU_NOTIFIER_FOREACH macro +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +A new macro is provided to iterate all the IOMMU notifiers hooked +under specific IOMMU memory region. + +Reviewed-by: David Gibson +Reviewed-by: Eric Auger +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-3-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit 512fa40867e6118568756a81ddaf476a0fef0f32) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + include/exec/memory.h | 3 +++ + memory.c | 4 ++-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/include/exec/memory.h b/include/exec/memory.h +index 0840c89..07e43da 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -239,6 +239,9 @@ struct MemoryRegion { + IOMMUNotifierFlag iommu_notify_flags; + }; + ++#define IOMMU_NOTIFIER_FOREACH(n, mr) \ ++ QLIST_FOREACH((n), &(mr)->iommu_notify, node) ++ + /** + * MemoryListener: callbacks structure for updates to the physical memory map + * +diff --git a/memory.c b/memory.c +index 75ac595..7496b3d 100644 +--- a/memory.c ++++ b/memory.c +@@ -1583,7 +1583,7 @@ static void memory_region_update_iommu_notify_flags(MemoryRegion *mr) + IOMMUNotifierFlag flags = IOMMU_NOTIFIER_NONE; + IOMMUNotifier *iommu_notifier; + +- QLIST_FOREACH(iommu_notifier, &mr->iommu_notify, node) { ++ IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) { + flags |= iommu_notifier->notifier_flags; + } + +@@ -1667,7 +1667,7 @@ void memory_region_notify_iommu(MemoryRegion *mr, + request_flags = IOMMU_NOTIFIER_UNMAP; + } + +- QLIST_FOREACH(iommu_notifier, &mr->iommu_notify, node) { ++ IOMMU_NOTIFIER_FOREACH(iommu_notifier, mr) { + /* + * Skip the notification if the notification does not overlap + * with registered range. +-- +1.8.3.1 + diff --git a/SOURCES/kvm-memory-provide-iommu_replay_all.patch b/SOURCES/kvm-memory-provide-iommu_replay_all.patch new file mode 100644 index 0000000..53e1e22 --- /dev/null +++ b/SOURCES/kvm-memory-provide-iommu_replay_all.patch @@ -0,0 +1,73 @@ +From 7517822d39e8eac1fe4423f29e5dc57c4b85c19e Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Mon, 24 Apr 2017 02:52:47 +0200 +Subject: [PATCH 08/23] memory: provide iommu_replay_all() + +RH-Author: Peter Xu +Message-id: <1493002373-13010-4-git-send-email-peterx@redhat.com> +Patchwork-id: 74851 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2 3/9] memory: provide iommu_replay_all() +Bugzilla: 1335808 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang + +This is an "global" version of existing memory_region_iommu_replay() - +we announce the translations to all the registered notifiers, instead of +a specific one. + +Reviewed-by: David Gibson +Reviewed-by: \"Michael S. Tsirkin\" +Signed-off-by: Peter Xu +Message-Id: <1491562755-23867-4-git-send-email-peterx@redhat.com> +Signed-off-by: Eduardo Habkost +(cherry picked from commit de472e4a92f780d02b894001e004f4b4a350ec38) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + include/exec/memory.h | 8 ++++++++ + memory.c | 9 +++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/include/exec/memory.h b/include/exec/memory.h +index 07e43da..fb7dff3 100644 +--- a/include/exec/memory.h ++++ b/include/exec/memory.h +@@ -713,6 +713,14 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n, + bool is_write); + + /** ++ * memory_region_iommu_replay_all: replay existing IOMMU translations ++ * to all the notifiers registered. ++ * ++ * @mr: the memory region to observe ++ */ ++void memory_region_iommu_replay_all(MemoryRegion *mr); ++ ++/** + * memory_region_unregister_iommu_notifier: unregister a notifier for + * changes to IOMMU translation entries. + * +diff --git a/memory.c b/memory.c +index 7496b3d..b4ed67b 100644 +--- a/memory.c ++++ b/memory.c +@@ -1642,6 +1642,15 @@ void memory_region_iommu_replay(MemoryRegion *mr, IOMMUNotifier *n, + } + } + ++void memory_region_iommu_replay_all(MemoryRegion *mr) ++{ ++ IOMMUNotifier *notifier; ++ ++ IOMMU_NOTIFIER_FOREACH(notifier, mr) { ++ memory_region_iommu_replay(mr, notifier, false); ++ } ++} ++ + void memory_region_unregister_iommu_notifier(MemoryRegion *mr, + IOMMUNotifier *n) + { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-Call-blk_resume_after_migration-for-postco.patch b/SOURCES/kvm-migration-Call-blk_resume_after_migration-for-postco.patch new file mode 100644 index 0000000..308b3c0 --- /dev/null +++ b/SOURCES/kvm-migration-Call-blk_resume_after_migration-for-postco.patch @@ -0,0 +1,53 @@ +From b735f14ca7fe2adb349d95e7f79c22e794e14b5b Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 19 May 2017 09:38:58 +0200 +Subject: [PATCH 23/27] migration: Call blk_resume_after_migration() for + postcopy + +RH-Author: Kevin Wolf +Message-id: <1495186739-13659-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75375 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/2] migration: Call blk_resume_after_migration() for postcopy +Bugzilla: 1452148 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Laurent Vivier +RH-Acked-by: Max Reitz + +Commit d35ff5e6 ('block: Ignore guest dev permissions during incoming +migration') added blk_resume_after_migration() to the precopy migration +path, but neglected to add it to the duplicated code that is used for +postcopy migration. This means that the guest device doesn't request the +necessary permissions, which ultimately led to failing assertions. + +Add the missing blk_resume_after_migration() to the postcopy path. + +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +(cherry picked from commit 0042fd3663662c848aaff5c65b6880e545d94b18) +Signed-off-by: Miroslav Rezanina +--- + migration/savevm.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/migration/savevm.c b/migration/savevm.c +index 8e05383..21d7985 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -1626,6 +1626,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaque) + error_report_err(local_err); + } + ++ /* If we get an error here, just don't restart the VM yet. */ ++ blk_resume_after_migration(&local_err); ++ if (local_err) { ++ error_free(local_err); ++ local_err = NULL; ++ autostart = false; ++ } ++ + trace_loadvm_postcopy_handle_run_cpu_sync(); + cpu_synchronize_all_post_init(); + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-Fix-non-multiple-of-page-size-migration.patch b/SOURCES/kvm-migration-Fix-non-multiple-of-page-size-migration.patch new file mode 100644 index 0000000..aa7e310 --- /dev/null +++ b/SOURCES/kvm-migration-Fix-non-multiple-of-page-size-migration.patch @@ -0,0 +1,75 @@ +From d05a64ddd01fa11fed479a2e249ed46c93207f9e Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 18 May 2017 11:17:26 +0200 +Subject: [PATCH 19/27] migration: Fix non-multiple of page size migration + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170518111727.7433-2-dgilbert@redhat.com> +Patchwork-id: 75314 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/2] migration: Fix non-multiple of page size migration +Bugzilla: 1449037 +RH-Acked-by: Juan Quintela +RH-Acked-by: Peter Xu +RH-Acked-by: Laszlo Ersek + +From: "Dr. David Alan Gilbert" + +Unfortunately it's legal to create a VM with a RAM size that's +not a multiple of the underlying host page or huge page size. +Recently I'd changed things to always send host sized pages, +and that breaks if we have say a 1025MB guest on 2MB hugepages. + +Unfortunately we can't just make that illegal since it would break +migration from/to existing oddly configured VMs. + +Symptom: qemu-system-x86_64: Illegal RAM offset 40100000 + as it transmits the fraction of the hugepage after the end + of the RAMBlock (may also cause a crash on the source + - possibly due to clearing bits after the bitmap) + +Reported-by: Yumei Huang +Signed-off-by: Dr. David Alan Gilbert +Conflicts + Cleanup in HEAD got rid of pss->offset; so use pss->offset + in our 2.9 world + +Upstream URL: +http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg04392.html +Upstream Message-Id: <20170518172453.32599-2-quintela@redhat.com> + +Signed-off-by: Miroslav Rezanina +--- + migration/ram.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/migration/ram.c b/migration/ram.c +index de1e0a3..3661bc8 100644 +--- a/migration/ram.c ++++ b/migration/ram.c +@@ -1304,6 +1304,13 @@ static int ram_save_target_page(MigrationState *ms, QEMUFile *f, + * block. + * + * Returns: Number of pages written. ++ * Starting at *offset send pages up to the end of the current host ++ * page. It's valid for the initial offset to point into the middle of ++ * a host page in which case the remainder of the hostpage is sent. ++ * Only dirty target pages are sent. Note that the host page size may ++ * be a huge page for this block. ++ * The saving stops at the boundary of the used_length of the block ++ * if the RAMBlock isn't a multiple of the host page size. + * + * @f: QEMUFile where to send the data + * @block: pointer to block that contains the page we want to send +@@ -1332,7 +1339,8 @@ static int ram_save_host_page(MigrationState *ms, QEMUFile *f, + pages += tmppages; + pss->offset += TARGET_PAGE_SIZE; + dirty_ram_abs += TARGET_PAGE_SIZE; +- } while (pss->offset & (pagesize - 1)); ++ } while ((pss->offset & (pagesize - 1)) && ++ offset_in_ramblock(pss->block, pss->offset)); + + /* The offset we leave with is the last one we looked at */ + pss->offset -= TARGET_PAGE_SIZE; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-Unify-block-node-activation-error-handling.patch b/SOURCES/kvm-migration-Unify-block-node-activation-error-handling.patch new file mode 100644 index 0000000..4ec019e --- /dev/null +++ b/SOURCES/kvm-migration-Unify-block-node-activation-error-handling.patch @@ -0,0 +1,122 @@ +From 149b5fe290b6d8f52b87993d3d27fe5fca806173 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 19 May 2017 09:38:59 +0200 +Subject: [PATCH 24/27] migration: Unify block node activation error handling + +RH-Author: Kevin Wolf +Message-id: <1495186739-13659-3-git-send-email-kwolf@redhat.com> +Patchwork-id: 75377 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 2/2] migration: Unify block node activation error handling +Bugzilla: 1452148 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Laurent Vivier +RH-Acked-by: Max Reitz + +Migration code activates all block driver nodes on the destination when +the migration completes. It does so by calling +bdrv_invalidate_cache_all() and blk_resume_after_migration(). There is +one code path for precopy and one for postcopy migration, resulting in +four function calls, which used to have three different failure modes. + +This patch unifies the behaviour so that failure to activate all block +nodes is non-fatal, but the error message is logged and the VM isn't +automatically started. 'cont' will retry activating the block nodes. + +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +(cherry picked from commit ace21a58751824f9a3d399e332317233e880de3a) +Signed-off-by: Miroslav Rezanina +--- + migration/migration.c | 16 +++++----------- + migration/savevm.c | 12 +++++------- + qmp.c | 18 +++++++++--------- + 3 files changed, 19 insertions(+), 27 deletions(-) + +diff --git a/migration/migration.c b/migration/migration.c +index fdc17bc..7a2ee01 100644 +--- a/migration/migration.c ++++ b/migration/migration.c +@@ -340,20 +340,14 @@ static void process_incoming_migration_bh(void *opaque) + Error *local_err = NULL; + MigrationIncomingState *mis = opaque; + +- /* Make sure all file formats flush their mutable metadata */ ++ /* Make sure all file formats flush their mutable metadata. ++ * If we get an error here, just don't restart the VM yet. */ + bdrv_invalidate_cache_all(&local_err); +- if (local_err) { +- migrate_set_state(&mis->state, MIGRATION_STATUS_ACTIVE, +- MIGRATION_STATUS_FAILED); +- error_report_err(local_err); +- migrate_decompress_threads_join(); +- exit(EXIT_FAILURE); ++ if (!local_err) { ++ blk_resume_after_migration(&local_err); + } +- +- /* If we get an error here, just don't restart the VM yet. */ +- blk_resume_after_migration(&local_err); + if (local_err) { +- error_free(local_err); ++ error_report_err(local_err); + local_err = NULL; + autostart = false; + } +diff --git a/migration/savevm.c b/migration/savevm.c +index 21d7985..6e2f9e7 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -1620,16 +1620,14 @@ static void loadvm_postcopy_handle_run_bh(void *opaque) + + qemu_announce_self(); + +- /* Make sure all file formats flush their mutable metadata */ ++ /* Make sure all file formats flush their mutable metadata. ++ * If we get an error here, just don't restart the VM yet. */ + bdrv_invalidate_cache_all(&local_err); +- if (local_err) { +- error_report_err(local_err); ++ if (!local_err) { ++ blk_resume_after_migration(&local_err); + } +- +- /* If we get an error here, just don't restart the VM yet. */ +- blk_resume_after_migration(&local_err); + if (local_err) { +- error_free(local_err); ++ error_report_err(local_err); + local_err = NULL; + autostart = false; + } +diff --git a/qmp.c b/qmp.c +index a744e44..847b13f 100644 +--- a/qmp.c ++++ b/qmp.c +@@ -196,15 +196,15 @@ void qmp_cont(Error **errp) + } + + /* Continuing after completed migration. Images have been inactivated to +- * allow the destination to take control. Need to get control back now. */ +- if (runstate_check(RUN_STATE_FINISH_MIGRATE) || +- runstate_check(RUN_STATE_POSTMIGRATE)) +- { +- bdrv_invalidate_cache_all(&local_err); +- if (local_err) { +- error_propagate(errp, local_err); +- return; +- } ++ * allow the destination to take control. Need to get control back now. ++ * ++ * If there are no inactive block nodes (e.g. because the VM was just ++ * paused rather than completing a migration), bdrv_inactivate_all() simply ++ * doesn't do anything. */ ++ bdrv_invalidate_cache_all(&local_err); ++ if (local_err) { ++ error_propagate(errp, local_err); ++ return; + } + + blk_resume_after_migration(&local_err); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-rdma-Allow-cancelling-while-waiting-for-wr.patch b/SOURCES/kvm-migration-rdma-Allow-cancelling-while-waiting-for-wr.patch new file mode 100644 index 0000000..b9d0500 --- /dev/null +++ b/SOURCES/kvm-migration-rdma-Allow-cancelling-while-waiting-for-wr.patch @@ -0,0 +1,111 @@ +From b6f11743278aeb3889ff42c98176b3e265654587 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 27 Jul 2017 12:06:57 +0200 +Subject: [PATCH 09/17] migration/rdma: Allow cancelling while waiting for wrid + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170727120659.8640-4-dgilbert@redhat.com> +Patchwork-id: 75857 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 3/5] migration/rdma: Allow cancelling while waiting for wrid +Bugzilla: 1475751 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +When waiting for a WRID, if the other side dies we end up waiting +for ever with no way to cancel the migration. +Cure this by poll()ing the fd first with a timeout and checking +error flags and migration state. + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Peter Xu +Message-Id: <20170717110936.23314-5-dgilbert@redhat.com> +Signed-off-by: Juan Quintela +(cherry picked from commit 9c98cfbe72b21d9d84b9ea8d231bde103b9fb7ae) +Signed-off-by: Miroslav Rezanina +--- + migration/rdma.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++------ + 1 file changed, 53 insertions(+), 6 deletions(-) + +diff --git a/migration/rdma.c b/migration/rdma.c +index 44a174f..666c84f 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -1464,6 +1464,56 @@ static uint64_t qemu_rdma_poll(RDMAContext *rdma, uint64_t *wr_id_out, + return 0; + } + ++/* Wait for activity on the completion channel. ++ * Returns 0 on success, none-0 on error. ++ */ ++static int qemu_rdma_wait_comp_channel(RDMAContext *rdma) ++{ ++ /* ++ * Coroutine doesn't start until migration_fd_process_incoming() ++ * so don't yield unless we know we're running inside of a coroutine. ++ */ ++ if (rdma->migration_started_on_destination) { ++ yield_until_fd_readable(rdma->comp_channel->fd); ++ } else { ++ /* This is the source side, we're in a separate thread ++ * or destination prior to migration_fd_process_incoming() ++ * we can't yield; so we have to poll the fd. ++ * But we need to be able to handle 'cancel' or an error ++ * without hanging forever. ++ */ ++ while (!rdma->error_state && !rdma->received_error) { ++ GPollFD pfds[1]; ++ pfds[0].fd = rdma->comp_channel->fd; ++ pfds[0].events = G_IO_IN | G_IO_HUP | G_IO_ERR; ++ /* 0.1s timeout, should be fine for a 'cancel' */ ++ switch (qemu_poll_ns(pfds, 1, 100 * 1000 * 1000)) { ++ case 1: /* fd active */ ++ return 0; ++ ++ case 0: /* Timeout, go around again */ ++ break; ++ ++ default: /* Error of some type - ++ * I don't trust errno from qemu_poll_ns ++ */ ++ error_report("%s: poll failed", __func__); ++ return -EPIPE; ++ } ++ ++ if (migrate_get_current()->state == MIGRATION_STATUS_CANCELLING) { ++ /* Bail out and let the cancellation happen */ ++ return -EPIPE; ++ } ++ } ++ } ++ ++ if (rdma->received_error) { ++ return -EPIPE; ++ } ++ return rdma->error_state; ++} ++ + /* + * Block until the next work request has completed. + * +@@ -1511,12 +1561,9 @@ static int qemu_rdma_block_for_wrid(RDMAContext *rdma, int wrid_requested, + } + + while (1) { +- /* +- * Coroutine doesn't start until migration_fd_process_incoming() +- * so don't yield unless we know we're running inside of a coroutine. +- */ +- if (rdma->migration_started_on_destination) { +- yield_until_fd_readable(rdma->comp_channel->fd); ++ ret = qemu_rdma_wait_comp_channel(rdma); ++ if (ret) { ++ goto err_block_for_wrid; + } + + ret = ibv_get_cq_event(rdma->comp_channel, &cq, &cq_ctx); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-rdma-Fix-race-on-source.patch b/SOURCES/kvm-migration-rdma-Fix-race-on-source.patch new file mode 100644 index 0000000..3065525 --- /dev/null +++ b/SOURCES/kvm-migration-rdma-Fix-race-on-source.patch @@ -0,0 +1,73 @@ +From 721a55126f8143f86c73868bde460a3304c85c81 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 27 Jul 2017 12:06:55 +0200 +Subject: [PATCH 07/17] migration/rdma: Fix race on source + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170727120659.8640-2-dgilbert@redhat.com> +Patchwork-id: 75859 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 1/5] migration/rdma: Fix race on source +Bugzilla: 1475751 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +Fix a race where the destination might try and send the source a +WRID_READY before the source has done a post-recv for it. + +rdma_post_recv has to happen after the qp exists, and we're +OK since we've already called qemu_rdma_source_init that calls +qemu_alloc_qp. + +This corresponds to: +https://bugzilla.redhat.com/show_bug.cgi?id=1285044 + +The race can be triggered by adding a few ms wait before this +post_recv_control (which was originally due to me turning on loads of +debug). + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Peter Xu +Message-Id: <20170717110936.23314-2-dgilbert@redhat.com> +Signed-off-by: Juan Quintela +(cherry picked from commit 9cf2bab2edca1e651eef49f2417f8f67bdfe49bb) +Signed-off-by: Miroslav Rezanina +--- + migration/rdma.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/migration/rdma.c b/migration/rdma.c +index 674ccab..0f6669e 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -2363,6 +2363,12 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp) + + caps_to_network(&cap); + ++ ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY); ++ if (ret) { ++ ERROR(errp, "posting second control recv"); ++ goto err_rdma_source_connect; ++ } ++ + ret = rdma_connect(rdma->cm_id, &conn_param); + if (ret) { + perror("rdma_connect"); +@@ -2403,12 +2409,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp) + + rdma_ack_cm_event(cm_event); + +- ret = qemu_rdma_post_recv_control(rdma, RDMA_WRID_READY); +- if (ret) { +- ERROR(errp, "posting second control recv!"); +- goto err_rdma_source_connect; +- } +- + rdma->control_ready_expected = 1; + rdma->nb_sent = 0; + return 0; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-rdma-Safely-convert-control-types.patch b/SOURCES/kvm-migration-rdma-Safely-convert-control-types.patch new file mode 100644 index 0000000..c7f4643 --- /dev/null +++ b/SOURCES/kvm-migration-rdma-Safely-convert-control-types.patch @@ -0,0 +1,150 @@ +From cecb1f8cba3d5e15f6f16e7156dfc4e5bbfd36c0 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 27 Jul 2017 12:06:58 +0200 +Subject: [PATCH 10/17] migration/rdma: Safely convert control types + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170727120659.8640-5-dgilbert@redhat.com> +Patchwork-id: 75860 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 4/5] migration/rdma: Safely convert control types +Bugzilla: 1475751 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +control_desc[] is an array of strings that correspond to a +series of message types; they're used only for error messages, but if +the message type is seriously broken then we could go off the end of +the array. + +Convert the array to a function control_desc() that bound checks. + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Peter Xu +Reviewed-by: Juan Quintela +Message-Id: <20170717110936.23314-6-dgilbert@redhat.com> +Signed-off-by: Juan Quintela +(cherry picked from commit 482a33c53cbc9d2b0c47d4df03b659bf50258c21) +Signed-off-by: Miroslav Rezanina +--- + migration/rdma.c | 54 ++++++++++++++++++++++++++++++++---------------------- + 1 file changed, 32 insertions(+), 22 deletions(-) + +diff --git a/migration/rdma.c b/migration/rdma.c +index 666c84f..fa88ccf 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -163,20 +163,6 @@ enum { + RDMA_CONTROL_UNREGISTER_FINISHED, /* unpinning finished */ + }; + +-static const char *control_desc[] = { +- [RDMA_CONTROL_NONE] = "NONE", +- [RDMA_CONTROL_ERROR] = "ERROR", +- [RDMA_CONTROL_READY] = "READY", +- [RDMA_CONTROL_QEMU_FILE] = "QEMU FILE", +- [RDMA_CONTROL_RAM_BLOCKS_REQUEST] = "RAM BLOCKS REQUEST", +- [RDMA_CONTROL_RAM_BLOCKS_RESULT] = "RAM BLOCKS RESULT", +- [RDMA_CONTROL_COMPRESS] = "COMPRESS", +- [RDMA_CONTROL_REGISTER_REQUEST] = "REGISTER REQUEST", +- [RDMA_CONTROL_REGISTER_RESULT] = "REGISTER RESULT", +- [RDMA_CONTROL_REGISTER_FINISHED] = "REGISTER FINISHED", +- [RDMA_CONTROL_UNREGISTER_REQUEST] = "UNREGISTER REQUEST", +- [RDMA_CONTROL_UNREGISTER_FINISHED] = "UNREGISTER FINISHED", +-}; + + /* + * Memory and MR structures used to represent an IB Send/Recv work request. +@@ -249,6 +235,30 @@ typedef struct QEMU_PACKED RDMADestBlock { + uint32_t padding; + } RDMADestBlock; + ++static const char *control_desc(unsigned int rdma_control) ++{ ++ static const char *strs[] = { ++ [RDMA_CONTROL_NONE] = "NONE", ++ [RDMA_CONTROL_ERROR] = "ERROR", ++ [RDMA_CONTROL_READY] = "READY", ++ [RDMA_CONTROL_QEMU_FILE] = "QEMU FILE", ++ [RDMA_CONTROL_RAM_BLOCKS_REQUEST] = "RAM BLOCKS REQUEST", ++ [RDMA_CONTROL_RAM_BLOCKS_RESULT] = "RAM BLOCKS RESULT", ++ [RDMA_CONTROL_COMPRESS] = "COMPRESS", ++ [RDMA_CONTROL_REGISTER_REQUEST] = "REGISTER REQUEST", ++ [RDMA_CONTROL_REGISTER_RESULT] = "REGISTER RESULT", ++ [RDMA_CONTROL_REGISTER_FINISHED] = "REGISTER FINISHED", ++ [RDMA_CONTROL_UNREGISTER_REQUEST] = "UNREGISTER REQUEST", ++ [RDMA_CONTROL_UNREGISTER_FINISHED] = "UNREGISTER FINISHED", ++ }; ++ ++ if (rdma_control > RDMA_CONTROL_UNREGISTER_FINISHED) { ++ return "??BAD CONTROL VALUE??"; ++ } ++ ++ return strs[rdma_control]; ++} ++ + static uint64_t htonll(uint64_t v) + { + union { uint32_t lv[2]; uint64_t llv; } u; +@@ -1639,7 +1649,7 @@ static int qemu_rdma_post_send_control(RDMAContext *rdma, uint8_t *buf, + .num_sge = 1, + }; + +- trace_qemu_rdma_post_send_control(control_desc[head->type]); ++ trace_qemu_rdma_post_send_control(control_desc(head->type)); + + /* + * We don't actually need to do a memcpy() in here if we used +@@ -1718,16 +1728,16 @@ static int qemu_rdma_exchange_get_response(RDMAContext *rdma, + network_to_control((void *) rdma->wr_data[idx].control); + memcpy(head, rdma->wr_data[idx].control, sizeof(RDMAControlHeader)); + +- trace_qemu_rdma_exchange_get_response_start(control_desc[expecting]); ++ trace_qemu_rdma_exchange_get_response_start(control_desc(expecting)); + + if (expecting == RDMA_CONTROL_NONE) { +- trace_qemu_rdma_exchange_get_response_none(control_desc[head->type], ++ trace_qemu_rdma_exchange_get_response_none(control_desc(head->type), + head->type); + } else if (head->type != expecting || head->type == RDMA_CONTROL_ERROR) { + error_report("Was expecting a %s (%d) control message" + ", but got: %s (%d), length: %d", +- control_desc[expecting], expecting, +- control_desc[head->type], head->type, head->len); ++ control_desc(expecting), expecting, ++ control_desc(head->type), head->type, head->len); + if (head->type == RDMA_CONTROL_ERROR) { + rdma->received_error = true; + } +@@ -1837,7 +1847,7 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma, RDMAControlHeader *head, + } + } + +- trace_qemu_rdma_exchange_send_waiting(control_desc[resp->type]); ++ trace_qemu_rdma_exchange_send_waiting(control_desc(resp->type)); + ret = qemu_rdma_exchange_get_response(rdma, resp, + resp->type, RDMA_WRID_DATA); + +@@ -1849,7 +1859,7 @@ static int qemu_rdma_exchange_send(RDMAContext *rdma, RDMAControlHeader *head, + if (resp_idx) { + *resp_idx = RDMA_WRID_DATA; + } +- trace_qemu_rdma_exchange_send_received(control_desc[resp->type]); ++ trace_qemu_rdma_exchange_send_received(control_desc(resp->type)); + } + + rdma->control_ready_expected = 1; +@@ -3399,7 +3409,7 @@ static int qemu_rdma_registration_handle(QEMUFile *f, void *opaque) + ret = -EIO; + goto out; + default: +- error_report("Unknown control message %s", control_desc[head.type]); ++ error_report("Unknown control message %s", control_desc(head.type)); + ret = -EIO; + goto out; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-rdma-Send-error-during-cancelling.patch b/SOURCES/kvm-migration-rdma-Send-error-during-cancelling.patch new file mode 100644 index 0000000..ca09d20 --- /dev/null +++ b/SOURCES/kvm-migration-rdma-Send-error-during-cancelling.patch @@ -0,0 +1,57 @@ +From 645b33dbf1c58f184b4b7a1f78f8540fa46e5df7 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 27 Jul 2017 12:06:59 +0200 +Subject: [PATCH 11/17] migration/rdma: Send error during cancelling + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170727120659.8640-6-dgilbert@redhat.com> +Patchwork-id: 75861 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 5/5] migration/rdma: Send error during cancelling +Bugzilla: 1475751 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +When we issue a cancel and clean up the RDMA channel +send a CONTROL_ERROR to get the destination to quit. + +The rdma_cleanup code waits for the event to come back +from the rdma_disconnect; but that wont happen until the +destination quits and there's currently nothing to force +it. + +Note this makes the case of a cancel work while the destination +is alive, and it already works if the destination is +truly dead. Note it doesn't fix the case where the destination +is hung (we get stuck waiting for the rdma_disconnect event). + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Peter Xu +Message-Id: <20170717110936.23314-7-dgilbert@redhat.com> +Signed-off-by: Juan Quintela +(cherry picked from commit 32bce196344772df8d68ab40e2dd1dd57be1aa7c) +Signed-off-by: Miroslav Rezanina +--- + migration/rdma.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/migration/rdma.c b/migration/rdma.c +index fa88ccf..cc319a1 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -2267,7 +2267,9 @@ static void qemu_rdma_cleanup(RDMAContext *rdma) + int ret, idx; + + if (rdma->cm_id && rdma->connected) { +- if (rdma->error_state && !rdma->received_error) { ++ if ((rdma->error_state || ++ migrate_get_current()->state == MIGRATION_STATUS_CANCELLING) && ++ !rdma->received_error) { + RDMAControlHeader head = { .len = 0, + .type = RDMA_CONTROL_ERROR, + .repeat = 1, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-rdma-fix-qemu_rdma_block_for_wrid-error-pa.patch b/SOURCES/kvm-migration-rdma-fix-qemu_rdma_block_for_wrid-error-pa.patch new file mode 100644 index 0000000..5186437 --- /dev/null +++ b/SOURCES/kvm-migration-rdma-fix-qemu_rdma_block_for_wrid-error-pa.patch @@ -0,0 +1,65 @@ +From efbb3025bc242760ac4294d5f636490811b2f612 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 27 Jul 2017 12:06:56 +0200 +Subject: [PATCH 08/17] migration/rdma: fix qemu_rdma_block_for_wrid error + paths + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170727120659.8640-3-dgilbert@redhat.com> +Patchwork-id: 75858 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 2/5] migration/rdma: fix qemu_rdma_block_for_wrid error paths +Bugzilla: 1475751 +RH-Acked-by: Peter Xu +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: "Dr. David Alan Gilbert" + +The two places that 'goto err_block_for_wrid' weren't setting ret +and so would end up returning 0 even though we've failed. + +Signed-off-by: Dr. David Alan Gilbert +Reviewed-by: Peter Xu +Message-Id: <20170717110936.23314-4-dgilbert@redhat.com> +Signed-off-by: Juan Quintela +(cherry picked from commit 0b3c15f09715acd78063e720444cc86ac357bab4) +Signed-off-by: Miroslav Rezanina +--- + migration/rdma.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/migration/rdma.c b/migration/rdma.c +index 0f6669e..44a174f 100644 +--- a/migration/rdma.c ++++ b/migration/rdma.c +@@ -1519,14 +1519,16 @@ static int qemu_rdma_block_for_wrid(RDMAContext *rdma, int wrid_requested, + yield_until_fd_readable(rdma->comp_channel->fd); + } + +- if (ibv_get_cq_event(rdma->comp_channel, &cq, &cq_ctx)) { ++ ret = ibv_get_cq_event(rdma->comp_channel, &cq, &cq_ctx); ++ if (ret) { + perror("ibv_get_cq_event"); + goto err_block_for_wrid; + } + + num_cq_events++; + +- if (ibv_req_notify_cq(cq, 0)) { ++ ret = -ibv_req_notify_cq(cq, 0); ++ if (ret) { + goto err_block_for_wrid; + } + +@@ -1562,6 +1564,8 @@ err_block_for_wrid: + if (num_cq_events) { + ibv_ack_cq_events(cq, num_cq_events); + } ++ ++ rdma->error_state = ret; + return ret; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-migration-setup-bi-directional-I-O-channel-for-exec-.patch b/SOURCES/kvm-migration-setup-bi-directional-I-O-channel-for-exec-.patch new file mode 100644 index 0000000..07c5d35 --- /dev/null +++ b/SOURCES/kvm-migration-setup-bi-directional-I-O-channel-for-exec-.patch @@ -0,0 +1,59 @@ +From 5fbe336ba7f9dd12f9eeafec136b15a4f6e02807 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Wed, 17 May 2017 12:42:07 +0200 +Subject: [PATCH 17/27] migration: setup bi-directional I/O channel for exec: + protocol + +RH-Author: Daniel P. Berrange +Message-id: <20170517124207.14063-1-berrange@redhat.com> +Patchwork-id: 75260 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] migration: setup bi-directional I/O channel for exec: protocol +Bugzilla: 1430620 +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Juan Quintela +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Laurent Vivier + +Historically the migration data channel has only needed to be +unidirectional. Thus the 'exec:' protocol was requesting an +I/O channel with O_RDONLY on incoming side, and O_WRONLY on +the outgoing side. + +This is fine for classic migration, but if you then try to run +TLS over it, this fails because the TLS handshake requires a +bi-directional channel. + +Signed-off-by: Daniel P. Berrange +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit 062d81f0e968fe1597474735f3ea038065027372) +Signed-off-by: Miroslav Rezanina +--- + migration/exec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/migration/exec.c b/migration/exec.c +index 9157721..aba9089 100644 +--- a/migration/exec.c ++++ b/migration/exec.c +@@ -32,7 +32,7 @@ void exec_start_outgoing_migration(MigrationState *s, const char *command, Error + + trace_migration_exec_outgoing(command); + ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, +- O_WRONLY, ++ O_RDWR, + errp)); + if (!ioc) { + return; +@@ -59,7 +59,7 @@ void exec_start_incoming_migration(const char *command, Error **errp) + + trace_migration_exec_incoming(command); + ioc = QIO_CHANNEL(qio_channel_command_new_spawn(argv, +- O_RDONLY, ++ O_RDWR, + errp)); + if (!ioc) { + return; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-mirror-Drop-permissions-on-s-target-on-completion.patch b/SOURCES/kvm-mirror-Drop-permissions-on-s-target-on-completion.patch new file mode 100644 index 0000000..b1bbc9d --- /dev/null +++ b/SOURCES/kvm-mirror-Drop-permissions-on-s-target-on-completion.patch @@ -0,0 +1,69 @@ +From e6ae3c4666f35c30ac171e9994b5116d9594c8ce Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 31 May 2017 10:55:21 +0200 +Subject: [PATCH 03/13] mirror: Drop permissions on s->target on completion + +RH-Author: Kevin Wolf +Message-id: <1496228121-28770-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75443 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] mirror: Drop permissions on s->target on completion +Bugzilla: 1456456 +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Fam Zheng +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +This fixes an assertion failure that was triggered by qemu-iotests 129 +on some CI host, while the same test case didn't seem to fail on other +hosts. + +Essentially the problem is that the blk_unref(s->target) in +mirror_exit() doesn't necessarily mean that the BlockBackend goes away +immediately. It is possible that the job completion was triggered nested +in mirror_drain(), which looks like this: + + BlockBackend *target = s->target; + blk_ref(target); + blk_drain(target); + blk_unref(target); + +In this case, the write permissions for s->target are retained until +after blk_drain(), which makes removing mirror_top_bs fail for the +active commit case (can't have a writable backing file in the chain +without the filter driver). + +Explicitly dropping the permissions first means that the additional +reference doesn't hurt and the job can complete successfully even if +called from the nested blk_drain(). + +Cc: qemu-stable@nongnu.org +Signed-off-by: Kevin Wolf +Acked-by: Paolo Bonzini +Reviewed-by: Max Reitz +(cherry picked from commit 63c8ef289087a225d445319d047501d4fe593687) +Signed-off-by: Miroslav Rezanina +--- + block/mirror.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/block/mirror.c b/block/mirror.c +index 2173a2f..4e8f124 100644 +--- a/block/mirror.c ++++ b/block/mirror.c +@@ -514,7 +514,12 @@ static void mirror_exit(BlockJob *job, void *opaque) + + /* Remove target parent that still uses BLK_PERM_WRITE/RESIZE before + * inserting target_bs at s->to_replace, where we might not be able to get +- * these permissions. */ ++ * these permissions. ++ * ++ * Note that blk_unref() alone doesn't necessarily drop permissions because ++ * we might be running nested inside mirror_drain(), which takes an extra ++ * reference, so use an explicit blk_set_perm() first. */ ++ blk_set_perm(s->target, 0, BLK_PERM_ALL, &error_abort); + blk_unref(s->target); + s->target = NULL; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-monitor-Use-numa_get_node_for_cpu-on-info-numa.patch b/SOURCES/kvm-monitor-Use-numa_get_node_for_cpu-on-info-numa.patch new file mode 100644 index 0000000..a0eab3e --- /dev/null +++ b/SOURCES/kvm-monitor-Use-numa_get_node_for_cpu-on-info-numa.patch @@ -0,0 +1,56 @@ +From a819425d0eb5135ea434625cdf7b41f0f05fd805 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Wed, 31 May 2017 19:27:23 +0200 +Subject: [PATCH 06/13] monitor: Use numa_get_node_for_cpu() on "info numa" + +RH-Author: Eduardo Habkost +Message-id: <20170531192723.19512-1-ehabkost@redhat.com> +Patchwork-id: 75448 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] monitor: Use numa_get_node_for_cpu() on "info numa" +Bugzilla: 1274567 +RH-Acked-by: David Gibson +RH-Acked-by: Igor Mammedov +RH-Acked-by: Andrew Jones + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1274567 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13317591 +Equivalent upstream commits: + * 0b8497f08c spapr: add node-id property to sPAPR core + * bd4c1bfe3e virt-arm: add node-id property to CPU + * 93b2a8cb0b pc: add node-id property to CPU + +This is a downstream-only fix for the "info numa" bug that was +accidentally fixed by the above upstream commits. I believe this +one-line fix is safer than backporting those commits, and it can be +easily reverted if we decide to backport them one day. + +Signed-off-by: Eduardo Habkost +Signed-off-by: Miroslav Rezanina +--- + monitor.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/monitor.c b/monitor.c +index d4fbc07..d23f2eb 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -1704,7 +1704,15 @@ static void hmp_info_numa(Monitor *mon, const QDict *qdict) + for (i = 0; i < nb_numa_nodes; i++) { + monitor_printf(mon, "node %d cpus:", i); + CPU_FOREACH(cpu) { +- if (cpu->numa_node == i) { ++ /* ++ * Here, numa_get_node_for_cpu(cpu->cpu_index) ++ * can be replaced by cpu->numa_node, if we backport ++ * the following upstream commits: ++ * - 0b8497f08c spapr: add node-id property to sPAPR core ++ * - bd4c1bfe3e virt-arm: add node-id property to CPU ++ * - 93b2a8cb0b pc: add node-id property to CPU ++ */ ++ if (numa_get_node_for_cpu(cpu->cpu_index) == i) { + monitor_printf(mon, " %d", cpu->cpu_index); + } + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-monitor-add-handle_hmp_command-trace-event.patch b/SOURCES/kvm-monitor-add-handle_hmp_command-trace-event.patch new file mode 100644 index 0000000..4d6d657 --- /dev/null +++ b/SOURCES/kvm-monitor-add-handle_hmp_command-trace-event.patch @@ -0,0 +1,57 @@ +From 27bb458a2f95113b8c0e180ffcd43b618d165e0e Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Fri, 16 Jun 2017 13:09:46 +0200 +Subject: [PATCH 6/8] monitor: add handle_hmp_command trace event + +RH-Author: Stefan Hajnoczi +Message-id: <20170616130947.6577-2-stefanha@redhat.com> +Patchwork-id: 75624 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/2] monitor: add handle_hmp_command trace event +Bugzilla: 1457740 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Markus Armbruster + +It is often useful to correlate QEMU-internal events with monitor +commands that caused them. Trace the full HMP command being executed. + +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Eric Blake +Message-id: 20170605104216.22429-2-stefanha@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 79cad8b46ba79116ded5690ea2e265585bb9cb53) +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Miroslav Rezanina +--- + monitor.c | 2 ++ + trace-events | 1 + + 2 files changed, 3 insertions(+) + +diff --git a/monitor.c b/monitor.c +index d23f2eb..65b663e 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -3104,6 +3104,8 @@ static void handle_hmp_command(Monitor *mon, const char *cmdline) + QDict *qdict; + const mon_cmd_t *cmd; + ++ trace_handle_hmp_command(mon, cmdline); ++ + cmd = monitor_parse_command(mon, &cmdline, mon->cmd_table); + if (!cmd) { + return; +diff --git a/trace-events b/trace-events +index bd54701..54e5301 100644 +--- a/trace-events ++++ b/trace-events +@@ -68,6 +68,7 @@ xen_map_cache_return(void* ptr) "%p" + monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p" + monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p" + monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64 ++handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s" + + # dma-helpers.c + dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d" +-- +1.8.3.1 + diff --git a/SOURCES/kvm-monitor-resurrect-handle_qmp_command-trace-event.patch b/SOURCES/kvm-monitor-resurrect-handle_qmp_command-trace-event.patch new file mode 100644 index 0000000..7618f44 --- /dev/null +++ b/SOURCES/kvm-monitor-resurrect-handle_qmp_command-trace-event.patch @@ -0,0 +1,71 @@ +From 8d39c106cf84b8d9ba4a2241b07bf9541502d9df Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Fri, 16 Jun 2017 13:09:47 +0200 +Subject: [PATCH 7/8] monitor: resurrect handle_qmp_command trace event + +RH-Author: Stefan Hajnoczi +Message-id: <20170616130947.6577-3-stefanha@redhat.com> +Patchwork-id: 75625 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 2/2] monitor: resurrect handle_qmp_command trace event +Bugzilla: 1457740 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Markus Armbruster + +Commit 104fc3027960dd2aa9d310936a6cb201c60e1088 ("qmp: Drop duplicated +QMP command object checks") removed the call to +trace_handle_qmp_command() while eliminating code duplication. + +This patch brings the trace event back so QEMU-internal trace events can +be correlated with the QMP commands that caused them. + +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Eric Blake +Message-id: 20170605104216.22429-3-stefanha@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit b097efc0027e36fd15a4fc2e415e780611024757) +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Miroslav Rezanina +--- + monitor.c | 5 +++++ + trace-events | 1 + + 2 files changed, 6 insertions(+) + +diff --git a/monitor.c b/monitor.c +index 65b663e..715995f 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -3825,6 +3825,7 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens) + QDict *qdict = NULL; + Monitor *mon = cur_mon; + Error *err = NULL; ++ QString *req_json; + + req = json_parser_parse_err(tokens, NULL, &err); + if (!req && !err) { +@@ -3842,6 +3843,10 @@ static void handle_qmp_command(JSONMessageParser *parser, GQueue *tokens) + qdict_del(qdict, "id"); + } /* else will fail qmp_dispatch() */ + ++ req_json = qobject_to_json(req); ++ trace_handle_qmp_command(mon, qstring_get_str(req_json)); ++ qobject_decref(QOBJECT(req_json)); ++ + rsp = qmp_dispatch(cur_mon->qmp.commands, req); + + if (mon->qmp.commands == &qmp_cap_negotiation_commands) { +diff --git a/trace-events b/trace-events +index 54e5301..24a5b91 100644 +--- a/trace-events ++++ b/trace-events +@@ -69,6 +69,7 @@ monitor_protocol_event_handler(uint32_t event, void *qdict) "event=%d data=%p" + monitor_protocol_event_emit(uint32_t event, void *data) "event=%d data=%p" + monitor_protocol_event_queue(uint32_t event, void *qdict, uint64_t rate) "event=%d data=%p rate=%" PRId64 + handle_hmp_command(void *mon, const char *cmdline) "mon %p cmdline: %s" ++handle_qmp_command(void *mon, const char *req) "mon %p req: %s" + + # dma-helpers.c + dma_blk_io(void *dbs, void *bs, int64_t offset, bool to_dev) "dbs=%p bs=%p offset=%" PRId64 " to_dev=%d" +-- +1.8.3.1 + diff --git a/SOURCES/kvm-msix-trace-control-bit-write-op.patch b/SOURCES/kvm-msix-trace-control-bit-write-op.patch new file mode 100644 index 0000000..2bac85a --- /dev/null +++ b/SOURCES/kvm-msix-trace-control-bit-write-op.patch @@ -0,0 +1,85 @@ +From 38ee1508c565a3bc78e6505f4839b964cc39d060 Mon Sep 17 00:00:00 2001 +From: Peter Xu +Date: Tue, 6 Jun 2017 06:57:30 +0200 +Subject: [PATCH 07/17] msix: trace control bit write op +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Peter Xu +Message-id: <1496732251-27935-3-git-send-email-peterx@redhat.com> +Patchwork-id: 75492 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH 2/3] msix: trace control bit write op +Bugzilla: 1448813 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Xiao Wang +RH-Acked-by: Michael S. Tsirkin + +Meanwhile, abstract a function to detect msix masked bit. + +Signed-off-by: Peter Xu +Message-Id: <1494309644-18743-3-git-send-email-peterx@redhat.com> +Acked-by: Michael S. Tsirkin +Reviewed-by: Michael S. Tsirkin +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: Paolo Bonzini +(cherry picked from commit a226e71aadec51d639528fdefd020428eeab2cc2) +Signed-off-by: Peter Xu +Signed-off-by: Miroslav Rezanina +--- + hw/pci/msix.c | 11 +++++++++-- + hw/pci/trace-events | 3 +++ + 2 files changed, 12 insertions(+), 2 deletions(-) + +diff --git a/hw/pci/msix.c b/hw/pci/msix.c +index bb54e8b..fc5fe51 100644 +--- a/hw/pci/msix.c ++++ b/hw/pci/msix.c +@@ -22,6 +22,7 @@ + #include "hw/xen/xen.h" + #include "qemu/range.h" + #include "qapi/error.h" ++#include "trace.h" + + #define MSIX_CAP_LENGTH 12 + +@@ -130,10 +131,14 @@ static void msix_handle_mask_update(PCIDevice *dev, int vector, bool was_masked) + } + } + ++static bool msix_masked(PCIDevice *dev) ++{ ++ return dev->config[dev->msix_cap + MSIX_CONTROL_OFFSET] & MSIX_MASKALL_MASK; ++} ++ + static void msix_update_function_masked(PCIDevice *dev) + { +- dev->msix_function_masked = !msix_enabled(dev) || +- (dev->config[dev->msix_cap + MSIX_CONTROL_OFFSET] & MSIX_MASKALL_MASK); ++ dev->msix_function_masked = !msix_enabled(dev) || msix_masked(dev); + } + + /* Handle MSI-X capability config write. */ +@@ -148,6 +153,8 @@ void msix_write_config(PCIDevice *dev, uint32_t addr, + return; + } + ++ trace_msix_write_config(dev->name, msix_enabled(dev), msix_masked(dev)); ++ + was_masked = dev->msix_function_masked; + msix_update_function_masked(dev); + +diff --git a/hw/pci/trace-events b/hw/pci/trace-events +index 2b9cf24..83c8f5a 100644 +--- a/hw/pci/trace-events ++++ b/hw/pci/trace-events +@@ -7,3 +7,6 @@ pci_update_mappings_add(void *d, uint32_t bus, uint32_t slot, uint32_t func, int + # hw/pci/pci_host.c + pci_cfg_read(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x -> 0x%x" + pci_cfg_write(const char *dev, unsigned devid, unsigned fnid, unsigned offs, unsigned val) "%s %02u:%u @0x%x <- 0x%x" ++ ++# hw/pci/msix.c ++msix_write_config(char *name, bool enabled, bool masked) "dev %s enabled %d masked %d" +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-Fix-regression-on-resiliency-to-port-scan.patch b/SOURCES/kvm-nbd-Fix-regression-on-resiliency-to-port-scan.patch new file mode 100644 index 0000000..8d8da32 --- /dev/null +++ b/SOURCES/kvm-nbd-Fix-regression-on-resiliency-to-port-scan.patch @@ -0,0 +1,208 @@ +From 41adc9eecf696d607037b330b02991e7a80d8321 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 9 Jun 2017 21:56:08 +0200 +Subject: [PATCH 03/13] nbd: Fix regression on resiliency to port scan + +RH-Author: Eric Blake +Message-id: <20170609215608.27053-3-eblake@redhat.com> +Patchwork-id: 75569 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH 2/2] nbd: Fix regression on resiliency to port scan +Bugzilla: 1447948 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Thomas Huth +RH-Acked-by: Laszlo Ersek + +Back in qemu 2.5, qemu-nbd was immune to port probes (a transient +server would not quit, regardless of how many probe connections +came and went, until a connection actually negotiated). But we +broke that in commit ee7d7aa when removing the return value to +nbd_client_new(), although that patch also introduced a bug causing +an assertion failure on a client that fails negotiation. We then +made it worse during refactoring in commit 1a6245a (a segfault +before we could even assert); the (masked) assertion was cleaned +up in d3780c2 (still in 2.6), and just recently we finally fixed +the segfault ("nbd: Fully intialize client in case of failed +negotiation"). But that still means that ever since we added +TLS support to qemu-nbd, we have been vulnerable to an ill-timed +port-scan being able to cause a denial of service by taking down +qemu-nbd before a real client has a chance to connect. + +Since negotiation is now handled asynchronously via coroutines, +we no longer have a synchronous point of return by re-adding a +return value to nbd_client_new(). So this patch instead wires +things up to pass the negotiation status through the close_fn +callback function. + +Simple test across two terminals: +$ qemu-nbd -f raw -p 30001 file +$ nmap 127.0.0.1 -p 30001 && \ + qemu-io -c 'r 0 512' -f raw nbd://localhost:30001 + +Note that this patch does not change what constitutes successful +negotiation (thus, a client must enter transmission phase before +that client can be considered as a reason to terminate the server +when the connection ends). Perhaps we may want to tweak things +in a later patch to also treat a client that uses NBD_OPT_ABORT +as being a 'successful' negotiation (the client correctly talked +the NBD protocol, and informed us it was not going to use our +export after all), but that's a discussion for another day. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451614 + +Signed-off-by: Eric Blake +Message-Id: <20170608222617.20376-1-eblake@redhat.com> +(cherry picked from commit ???) +https://bugzilla.redhat.com/show_bug.cgi?id=1447948 +Signed-off-by: Miroslav Rezanina +--- + blockdev-nbd.c | 6 +++++- + include/block/nbd.h | 2 +- + nbd/server.c | 24 +++++++++++++++--------- + qemu-nbd.c | 4 ++-- + 4 files changed, 23 insertions(+), 13 deletions(-) + +diff --git a/blockdev-nbd.c b/blockdev-nbd.c +index 8a11807..8d7284a 100644 +--- a/blockdev-nbd.c ++++ b/blockdev-nbd.c +@@ -27,6 +27,10 @@ typedef struct NBDServerData { + + static NBDServerData *nbd_server; + ++static void nbd_blockdev_client_closed(NBDClient *client, bool ignored) ++{ ++ nbd_client_put(client); ++} + + static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, + gpointer opaque) +@@ -46,7 +50,7 @@ static gboolean nbd_accept(QIOChannel *ioc, GIOCondition condition, + qio_channel_set_name(QIO_CHANNEL(cioc), "nbd-server"); + nbd_client_new(NULL, cioc, + nbd_server->tlscreds, NULL, +- nbd_client_put); ++ nbd_blockdev_client_closed); + object_unref(OBJECT(cioc)); + return TRUE; + } +diff --git a/include/block/nbd.h b/include/block/nbd.h +index 3e373f0..b69c30d 100644 +--- a/include/block/nbd.h ++++ b/include/block/nbd.h +@@ -160,7 +160,7 @@ void nbd_client_new(NBDExport *exp, + QIOChannelSocket *sioc, + QCryptoTLSCreds *tlscreds, + const char *tlsaclname, +- void (*close)(NBDClient *)); ++ void (*close_fn)(NBDClient *, bool)); + void nbd_client_get(NBDClient *client); + void nbd_client_put(NBDClient *client); + +diff --git a/nbd/server.c b/nbd/server.c +index edfda84..a98bb21 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -81,7 +81,7 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); + + struct NBDClient { + int refcount; +- void (*close)(NBDClient *client); ++ void (*close_fn)(NBDClient *client, bool negotiated); + + bool no_zeroes; + NBDExport *exp; +@@ -796,7 +796,7 @@ void nbd_client_put(NBDClient *client) + } + } + +-static void client_close(NBDClient *client) ++static void client_close(NBDClient *client, bool negotiated) + { + if (client->closing) { + return; +@@ -811,8 +811,8 @@ static void client_close(NBDClient *client) + NULL); + + /* Also tell the client, so that they release their reference. */ +- if (client->close) { +- client->close(client); ++ if (client->close_fn) { ++ client->close_fn(client, negotiated); + } + } + +@@ -993,7 +993,7 @@ void nbd_export_close(NBDExport *exp) + + nbd_export_get(exp); + QTAILQ_FOREACH_SAFE(client, &exp->clients, next, next) { +- client_close(client); ++ client_close(client, true); + } + nbd_export_set_name(exp, NULL); + nbd_export_set_description(exp, NULL); +@@ -1355,7 +1355,7 @@ done: + + out: + nbd_request_put(req); +- client_close(client); ++ client_close(client, true); + nbd_client_put(client); + } + +@@ -1381,7 +1381,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque) + qemu_co_mutex_init(&client->send_lock); + + if (nbd_negotiate(data)) { +- client_close(client); ++ client_close(client, false); + goto out; + } + +@@ -1391,11 +1391,17 @@ out: + g_free(data); + } + ++/* ++ * Create a new client listener on the given export @exp, using the ++ * given channel @sioc. Begin servicing it in a coroutine. When the ++ * connection closes, call @close_fn with an indication of whether the ++ * client completed negotiation. ++ */ + void nbd_client_new(NBDExport *exp, + QIOChannelSocket *sioc, + QCryptoTLSCreds *tlscreds, + const char *tlsaclname, +- void (*close_fn)(NBDClient *)) ++ void (*close_fn)(NBDClient *, bool)) + { + NBDClient *client; + NBDClientNewData *data = g_new(NBDClientNewData, 1); +@@ -1412,7 +1418,7 @@ void nbd_client_new(NBDExport *exp, + object_ref(OBJECT(client->sioc)); + client->ioc = QIO_CHANNEL(sioc); + object_ref(OBJECT(client->ioc)); +- client->close = close_fn; ++ client->close_fn = close_fn; + + data->client = client; + data->co = qemu_coroutine_create(nbd_co_client_start, data); +diff --git a/qemu-nbd.c b/qemu-nbd.c +index b44764e..483dd77 100644 +--- a/qemu-nbd.c ++++ b/qemu-nbd.c +@@ -335,10 +335,10 @@ static void nbd_export_closed(NBDExport *exp) + + static void nbd_update_server_watch(void); + +-static void nbd_client_closed(NBDClient *client) ++static void nbd_client_closed(NBDClient *client, bool negotiated) + { + nb_fds--; +- if (nb_fds == 0 && !persistent && state == RUNNING) { ++ if (negotiated && nb_fds == 0 && !persistent && state == RUNNING) { + state = TERMINATE; + } + nbd_update_server_watch(); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-Fully-initialize-client-in-case-of-failed-negoti.patch b/SOURCES/kvm-nbd-Fully-initialize-client-in-case-of-failed-negoti.patch new file mode 100644 index 0000000..43e3e34 --- /dev/null +++ b/SOURCES/kvm-nbd-Fully-initialize-client-in-case-of-failed-negoti.patch @@ -0,0 +1,93 @@ +From 7c2ce59d5622187490728e29a91710a470d1c5b4 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Fri, 9 Jun 2017 21:56:07 +0200 +Subject: [PATCH 02/13] nbd: Fully initialize client in case of failed + negotiation + +RH-Author: Eric Blake +Message-id: <20170609215608.27053-2-eblake@redhat.com> +Patchwork-id: 75571 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH 1/2] nbd: Fully initialize client in case of failed negotiation +Bugzilla: 1447948 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Thomas Huth +RH-Acked-by: Laszlo Ersek + +If a non-NBD client connects to qemu-nbd, we would end up with +a SIGSEGV in nbd_client_put() because we were trying to +unregister the client's association to the export, even though +we skipped inserting the client into that list. Easy trigger +in two terminals: + +$ qemu-nbd -p 30001 --format=raw file +$ nmap 127.0.0.1 -p 30001 + +nmap claims that it thinks it connected to a pago-services1 +server (which probably means nmap could be updated to learn the +NBD protocol and give a more accurate diagnosis of the open +port - but that's not our problem), then terminates immediately, +so our call to nbd_negotiate() fails. The fix is to reorder +nbd_co_client_start() to ensure that all initialization occurs +before we ever try talking to a client in nbd_negotiate(), so +that the teardown sequence on negotiation failure doesn't fault +while dereferencing a half-initialized object. + +While debugging this, I also noticed that nbd_update_server_watch() +called by nbd_client_closed() was still adding a channel to accept +the next client, even when the state was no longer RUNNING. That +is fixed by making nbd_can_accept() pay attention to the current +state. + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451614 + +Signed-off-by: Eric Blake +Message-Id: <20170527030421.28366-1-eblake@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit ???) +https://bugzilla.redhat.com/show_bug.cgi?id=1447948 +Signed-off-by: Miroslav Rezanina +--- + nbd/server.c | 8 +++----- + qemu-nbd.c | 2 +- + 2 files changed, 4 insertions(+), 6 deletions(-) + +diff --git a/nbd/server.c b/nbd/server.c +index 924a1fe..edfda84 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -1376,16 +1376,14 @@ static coroutine_fn void nbd_co_client_start(void *opaque) + + if (exp) { + nbd_export_get(exp); ++ QTAILQ_INSERT_TAIL(&exp->clients, client, next); + } ++ qemu_co_mutex_init(&client->send_lock); ++ + if (nbd_negotiate(data)) { + client_close(client); + goto out; + } +- qemu_co_mutex_init(&client->send_lock); +- +- if (exp) { +- QTAILQ_INSERT_TAIL(&exp->clients, client, next); +- } + + nbd_client_receive_next_request(client); + +diff --git a/qemu-nbd.c b/qemu-nbd.c +index e080fb7..b44764e 100644 +--- a/qemu-nbd.c ++++ b/qemu-nbd.c +@@ -324,7 +324,7 @@ out: + + static int nbd_can_accept(void) + { +- return nb_fds < shared; ++ return state == RUNNING && nb_fds < shared; + } + + static void nbd_export_closed(NBDExport *exp) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-fix-NBD-over-TLS-bz1461827.patch b/SOURCES/kvm-nbd-fix-NBD-over-TLS-bz1461827.patch new file mode 100644 index 0000000..c084757 --- /dev/null +++ b/SOURCES/kvm-nbd-fix-NBD-over-TLS-bz1461827.patch @@ -0,0 +1,56 @@ +From 3e2c0369fc46cd052a4f97cda57d879796bce790 Mon Sep 17 00:00:00 2001 +From: Paolo Bonzini +Date: Fri, 16 Jun 2017 10:28:42 +0200 +Subject: [PATCH 5/8] nbd: fix NBD over TLS (bz1461827) + +RH-Author: Paolo Bonzini +Message-id: <20170616102842.16984-1-pbonzini@redhat.com> +Patchwork-id: 75621 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH] nbd: fix NBD over TLS (bz1461827) +Bugzilla: 1461827 +RH-Acked-by: Daniel P. Berrange +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Stefan Hajnoczi + +Upstream status: queued in my NBD tree, reviewed and tested (see below) + +When attaching the NBD QIOChannel to an AioContext, the TLS channel should +be used, not the underlying socket channel. This is because, trivially, +the TLS channel will be the one that we read/write to and thus the one +that will get the qio_channel_yield() call. + +Fixes: ff82911cd3f69f028f2537825c9720ff78bc3f19 +Cc: qemu-stable@nongnu.org +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Daniel P. Berrange +Tested-by: Daniel P. Berrange +Signed-off-by: Paolo Bonzini +Signed-off-by: Miroslav Rezanina +--- + block/nbd-client.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/block/nbd-client.c b/block/nbd-client.c +index 43e0292..282679b 100644 +--- a/block/nbd-client.c ++++ b/block/nbd-client.c +@@ -340,14 +340,14 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) + void nbd_client_detach_aio_context(BlockDriverState *bs) + { + NBDClientSession *client = nbd_get_client_session(bs); +- qio_channel_detach_aio_context(QIO_CHANNEL(client->sioc)); ++ qio_channel_detach_aio_context(QIO_CHANNEL(client->ioc)); + } + + void nbd_client_attach_aio_context(BlockDriverState *bs, + AioContext *new_context) + { + NBDClientSession *client = nbd_get_client_session(bs); +- qio_channel_attach_aio_context(QIO_CHANNEL(client->sioc), new_context); ++ qio_channel_attach_aio_context(QIO_CHANNEL(client->ioc), new_context); + aio_co_schedule(new_context, client->read_reply_co); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch b/SOURCES/kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch new file mode 100644 index 0000000..6b9df0d --- /dev/null +++ b/SOURCES/kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch @@ -0,0 +1,136 @@ +From 689e11115170df5dedec420d78d375e780f3968e Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Sun, 11 Jun 2017 03:30:07 +0200 +Subject: [PATCH 04/13] nbd: make it thread-safe, fix qcow2 over nbd + +RH-Author: Eric Blake +Message-id: <20170611033007.399-1-eblake@redhat.com> +Patchwork-id: 75581 +O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH] nbd: make it thread-safe, fix qcow2 over nbd +Bugzilla: 1454582 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Max Reitz +RH-Acked-by: Jeffrey Cody + +From: Paolo Bonzini + +NBD is not thread safe, because it accesses s->in_flight without +a CoMutex. Fixing this will be required for multiqueue. +CoQueue doesn't have spurious wakeups but, when another coroutine can +run between qemu_co_queue_next's wakeup and qemu_co_queue_wait's +re-locking of the mutex, the wait condition can become false and +a loop is necessary. + +In fact, it turns out that the loop is necessary even without this +multi-threaded scenario. A particular sequence of coroutine wakeups +is happening ~80% of the time when starting a guest with qcow2 image +served over NBD (i.e. qemu-nbd --format=raw, and QEMU's -drive option +has -format=qcow2). This patch fixes that issue too. + +Signed-off-by: Paolo Bonzini +(cherry picked from commit 6bdcc018a6ed760b9dfe43539124e420aed83092) +Signed-off-by: Eric Blake +Upstream-status: v6 pull request https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg01841.html +Signed-off-by: Miroslav Rezanina +--- + block/nbd-client.c | 30 +++++++++--------------------- + 1 file changed, 9 insertions(+), 21 deletions(-) + +diff --git a/block/nbd-client.c b/block/nbd-client.c +index 1e2952f..43e0292 100644 +--- a/block/nbd-client.c ++++ b/block/nbd-client.c +@@ -114,6 +114,10 @@ static int nbd_co_send_request(BlockDriverState *bs, + int rc, ret, i; + + qemu_co_mutex_lock(&s->send_mutex); ++ while (s->in_flight == MAX_NBD_REQUESTS) { ++ qemu_co_queue_wait(&s->free_sema, &s->send_mutex); ++ } ++ s->in_flight++; + + for (i = 0; i < MAX_NBD_REQUESTS; i++) { + if (s->recv_coroutine[i] == NULL) { +@@ -176,20 +180,6 @@ static void nbd_co_receive_reply(NBDClientSession *s, + } + } + +-static void nbd_coroutine_start(NBDClientSession *s, +- NBDRequest *request) +-{ +- /* Poor man semaphore. The free_sema is locked when no other request +- * can be accepted, and unlocked after receiving one reply. */ +- if (s->in_flight == MAX_NBD_REQUESTS) { +- qemu_co_queue_wait(&s->free_sema, NULL); +- assert(s->in_flight < MAX_NBD_REQUESTS); +- } +- s->in_flight++; +- +- /* s->recv_coroutine[i] is set as soon as we get the send_lock. */ +-} +- + static void nbd_coroutine_end(BlockDriverState *bs, + NBDRequest *request) + { +@@ -197,13 +187,16 @@ static void nbd_coroutine_end(BlockDriverState *bs, + int i = HANDLE_TO_INDEX(s, request->handle); + + s->recv_coroutine[i] = NULL; +- s->in_flight--; +- qemu_co_queue_next(&s->free_sema); + + /* Kick the read_reply_co to get the next reply. */ + if (s->read_reply_co) { + aio_co_wake(s->read_reply_co); + } ++ ++ qemu_co_mutex_lock(&s->send_mutex); ++ s->in_flight--; ++ qemu_co_queue_next(&s->free_sema); ++ qemu_co_mutex_unlock(&s->send_mutex); + } + + int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, +@@ -221,7 +214,6 @@ int nbd_client_co_preadv(BlockDriverState *bs, uint64_t offset, + assert(bytes <= NBD_MAX_BUFFER_SIZE); + assert(!flags); + +- nbd_coroutine_start(client, &request); + ret = nbd_co_send_request(bs, &request, NULL); + if (ret < 0) { + reply.error = -ret; +@@ -251,7 +243,6 @@ int nbd_client_co_pwritev(BlockDriverState *bs, uint64_t offset, + + assert(bytes <= NBD_MAX_BUFFER_SIZE); + +- nbd_coroutine_start(client, &request); + ret = nbd_co_send_request(bs, &request, qiov); + if (ret < 0) { + reply.error = -ret; +@@ -286,7 +277,6 @@ int nbd_client_co_pwrite_zeroes(BlockDriverState *bs, int64_t offset, + request.flags |= NBD_CMD_FLAG_NO_HOLE; + } + +- nbd_coroutine_start(client, &request); + ret = nbd_co_send_request(bs, &request, NULL); + if (ret < 0) { + reply.error = -ret; +@@ -311,7 +301,6 @@ int nbd_client_co_flush(BlockDriverState *bs) + request.from = 0; + request.len = 0; + +- nbd_coroutine_start(client, &request); + ret = nbd_co_send_request(bs, &request, NULL); + if (ret < 0) { + reply.error = -ret; +@@ -337,7 +326,6 @@ int nbd_client_co_pdiscard(BlockDriverState *bs, int64_t offset, int count) + return 0; + } + +- nbd_coroutine_start(client, &request); + ret = nbd_co_send_request(bs, &request, NULL); + if (ret < 0) { + reply.error = -ret; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-make-nbd_drop-public.patch b/SOURCES/kvm-nbd-make-nbd_drop-public.patch new file mode 100644 index 0000000..8cda4bd --- /dev/null +++ b/SOURCES/kvm-nbd-make-nbd_drop-public.patch @@ -0,0 +1,151 @@ +From 7d557c2a53a5baa7d566e5d8ffa467dd1bc382db Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Wed, 19 Jul 2017 18:02:01 +0200 +Subject: [PATCH 04/17] nbd: make nbd_drop public + +RH-Author: Eric Blake +Message-id: <20170719180202.23329-4-eblake@redhat.com> +Patchwork-id: 75814 +O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 3/4] nbd: make nbd_drop public +Bugzilla: 1473638 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Jeffrey Cody + +From: Vladimir Sementsov-Ogievskiy + +Following commit will reuse it for nbd server too. + +Reviewed-by: Eric Blake +Signed-off-by: Vladimir Sementsov-Ogievskiy +Message-Id: <20170602150150.258222-3-vsementsov@virtuozzo.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 44298024d30ad36439707b89715a76333f58791b) + + Conflicts: + nbd/client.c, nbd/nbd_internal.h, nbd/common.c - missing errp + addition (e44ed99) and bulk rename (d1fdf25) + +Signed-off-by: Eric Blake +Signed-off-by: Miroslav Rezanina +--- + nbd/client.c | 32 +++----------------------------- + nbd/common.c | 26 ++++++++++++++++++++++++++ + nbd/nbd-internal.h | 2 ++ + 3 files changed, 31 insertions(+), 29 deletions(-) + +diff --git a/nbd/client.c b/nbd/client.c +index 6b74a62..1652f28 100644 +--- a/nbd/client.c ++++ b/nbd/client.c +@@ -86,32 +86,6 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); + + */ + +-/* Discard length bytes from channel. Return -errno on failure and 0 on +- * success*/ +-static int drop_sync(QIOChannel *ioc, size_t size) +-{ +- ssize_t ret = 0; +- char small[1024]; +- char *buffer; +- +- buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size)); +- while (size > 0) { +- ssize_t count = MIN(65536, size); +- ret = read_sync(ioc, buffer, MIN(65536, size)); +- +- if (ret < 0) { +- goto cleanup; +- } +- size -= count; +- } +- +- cleanup: +- if (buffer != small) { +- g_free(buffer); +- } +- return ret; +-} +- + /* Send an option request. + * + * The request is for option @opt, with @data containing @len bytes of +@@ -333,7 +307,7 @@ static int nbd_receive_list(QIOChannel *ioc, const char *want, bool *match, + return -1; + } + if (namelen != strlen(want)) { +- if (drop_sync(ioc, len) < 0) { ++ if (nbd_drop(ioc, len) < 0) { + error_setg(errp, "failed to skip export name with wrong length"); + nbd_send_opt_abort(ioc); + return -1; +@@ -349,7 +323,7 @@ static int nbd_receive_list(QIOChannel *ioc, const char *want, bool *match, + } + name[namelen] = '\0'; + len -= namelen; +- if (drop_sync(ioc, len) < 0) { ++ if (nbd_drop(ioc, len) < 0) { + error_setg(errp, "failed to read export description"); + nbd_send_opt_abort(ioc); + return -1; +@@ -616,7 +590,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + } + + TRACE("Size is %" PRIu64 ", export flags %" PRIx16, *size, *flags); +- if (zeroes && drop_sync(ioc, 124) < 0) { ++ if (zeroes && nbd_drop(ioc, 124) < 0) { + error_setg(errp, "Failed to read reserved block"); + goto fail; + } +diff --git a/nbd/common.c b/nbd/common.c +index 4db45b3..9a54010 100644 +--- a/nbd/common.c ++++ b/nbd/common.c +@@ -71,6 +71,32 @@ ssize_t nbd_wr_syncv(QIOChannel *ioc, + return done; + } + ++/* Discard length bytes from channel. Return -errno on failure and 0 on ++ * success */ ++int nbd_drop(QIOChannel *ioc, size_t size) ++{ ++ ssize_t ret = 0; ++ char small[1024]; ++ char *buffer; ++ ++ buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size)); ++ while (size > 0) { ++ ssize_t count = MIN(65536, size); ++ ret = read_sync(ioc, buffer, MIN(65536, size)); ++ ++ if (ret < 0) { ++ goto cleanup; ++ } ++ size -= count; ++ } ++ ++ cleanup: ++ if (buffer != small) { ++ g_free(buffer); ++ } ++ return ret; ++} ++ + + void nbd_tls_handshake(QIOTask *task, + void *opaque) +diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h +index e6bbc7c..c02378c 100644 +--- a/nbd/nbd-internal.h ++++ b/nbd/nbd-internal.h +@@ -149,4 +149,6 @@ struct NBDTLSHandshakeData { + void nbd_tls_handshake(QIOTask *task, + void *opaque); + ++int nbd_drop(QIOChannel *ioc, size_t size); ++ + #endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-read_sync-and-friends-return-0-on-success.patch b/SOURCES/kvm-nbd-read_sync-and-friends-return-0-on-success.patch new file mode 100644 index 0000000..4b370a5 --- /dev/null +++ b/SOURCES/kvm-nbd-read_sync-and-friends-return-0-on-success.patch @@ -0,0 +1,620 @@ +From 32813ec88e7b8868dd7474d01d8c5e4faa9fe290 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Wed, 19 Jul 2017 18:02:00 +0200 +Subject: [PATCH 03/17] nbd: read_sync and friends: return 0 on success + +RH-Author: Eric Blake +Message-id: <20170719180202.23329-3-eblake@redhat.com> +Patchwork-id: 75818 +O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 2/4] nbd: read_sync and friends: return 0 on success +Bugzilla: 1473638 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Jeffrey Cody + +From: Vladimir Sementsov-Ogievskiy + +functions read_sync, drop_sync, write_sync, and also +nbd_negotiate_write, nbd_negotiate_read, nbd_negotiate_drop_sync +returns number of processed bytes. But what this number can be, +except requested number of bytes? + +Actually, underlying nbd_wr_syncv function returns a value >= 0 and +!= requested_bytes only on eof on read operation. So, firstly, it is +impossible on write (let's add an assert) and on read it actually +means, that communication is broken (except nbd_receive_reply, see +below). + +Most of callers operate like this: + if (func(..., size) != size) { + /* error path */ + } +, i.e.: + 1. They are not interested in partial success + 2. Extra duplications in code (especially bad are duplications of + magic numbers) + 3. User doesn't see actual error message, as return code is lost. + (this patch doesn't fix this point, but it makes fixing easier) + +Several callers handles ret >= 0 and != requested-size separately, by +just returning EINVAL in this case. This patch makes read_sync and +friends return EINVAL in this case, so final behavior is the same. + +And only one caller - nbd_receive_reply() does something not so +obvious. It returns EINVAL for ret > 0 and != requested-size, like +previous group, but for ret == 0 it returns 0. The only caller of +nbd_receive_reply() - nbd_read_reply_entry() handles ret == 0 in the +same way as ret < 0, so for now it doesn't matter. However, in +following commits error path handling will be improved and we'll need +to distinguish success from fail in this case too. So, this patch adds +separate helper for this case - read_sync_eof. + +Signed-off-by: Vladimir Sementsov-Ogievskiy +Message-Id: <20170516094533.6160-3-vsementsov@virtuozzo.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit f5d406fe86bb28da85824b6581e58980cc1a07f3) +Signed-off-by: Eric Blake +Signed-off-by: Miroslav Rezanina +--- + nbd/client.c | 63 ++++++++++++++++------------------------ + nbd/nbd-internal.h | 34 +++++++++++++++++++--- + nbd/server.c | 84 +++++++++++++++++++++--------------------------------- + 3 files changed, 88 insertions(+), 93 deletions(-) + +diff --git a/nbd/client.c b/nbd/client.c +index a58fb02..6b74a62 100644 +--- a/nbd/client.c ++++ b/nbd/client.c +@@ -86,9 +86,9 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); + + */ + +-/* Discard length bytes from channel. Return -errno on failure, or +- * the amount of bytes consumed. */ +-static ssize_t drop_sync(QIOChannel *ioc, size_t size) ++/* Discard length bytes from channel. Return -errno on failure and 0 on ++ * success*/ ++static int drop_sync(QIOChannel *ioc, size_t size) + { + ssize_t ret = 0; + char small[1024]; +@@ -96,14 +96,13 @@ static ssize_t drop_sync(QIOChannel *ioc, size_t size) + + buffer = sizeof(small) >= size ? small : g_malloc(MIN(65536, size)); + while (size > 0) { +- ssize_t count = read_sync(ioc, buffer, MIN(65536, size)); ++ ssize_t count = MIN(65536, size); ++ ret = read_sync(ioc, buffer, MIN(65536, size)); + +- if (count <= 0) { ++ if (ret < 0) { + goto cleanup; + } +- assert(count <= size); + size -= count; +- ret += count; + } + + cleanup: +@@ -136,12 +135,12 @@ static int nbd_send_option_request(QIOChannel *ioc, uint32_t opt, + stl_be_p(&req.option, opt); + stl_be_p(&req.length, len); + +- if (write_sync(ioc, &req, sizeof(req)) != sizeof(req)) { ++ if (write_sync(ioc, &req, sizeof(req)) < 0) { + error_setg(errp, "Failed to send option request header"); + return -1; + } + +- if (len && write_sync(ioc, (char *) data, len) != len) { ++ if (len && write_sync(ioc, (char *) data, len) < 0) { + error_setg(errp, "Failed to send option request data"); + return -1; + } +@@ -170,7 +169,7 @@ static int nbd_receive_option_reply(QIOChannel *ioc, uint32_t opt, + nbd_opt_reply *reply, Error **errp) + { + QEMU_BUILD_BUG_ON(sizeof(*reply) != 20); +- if (read_sync(ioc, reply, sizeof(*reply)) != sizeof(*reply)) { ++ if (read_sync(ioc, reply, sizeof(*reply)) < 0) { + error_setg(errp, "failed to read option reply"); + nbd_send_opt_abort(ioc); + return -1; +@@ -219,7 +218,7 @@ static int nbd_handle_reply_err(QIOChannel *ioc, nbd_opt_reply *reply, + goto cleanup; + } + msg = g_malloc(reply->length + 1); +- if (read_sync(ioc, msg, reply->length) != reply->length) { ++ if (read_sync(ioc, msg, reply->length) < 0) { + error_setg(errp, "failed to read option error message"); + goto cleanup; + } +@@ -321,7 +320,7 @@ static int nbd_receive_list(QIOChannel *ioc, const char *want, bool *match, + nbd_send_opt_abort(ioc); + return -1; + } +- if (read_sync(ioc, &namelen, sizeof(namelen)) != sizeof(namelen)) { ++ if (read_sync(ioc, &namelen, sizeof(namelen)) < 0) { + error_setg(errp, "failed to read option name length"); + nbd_send_opt_abort(ioc); + return -1; +@@ -334,7 +333,7 @@ static int nbd_receive_list(QIOChannel *ioc, const char *want, bool *match, + return -1; + } + if (namelen != strlen(want)) { +- if (drop_sync(ioc, len) != len) { ++ if (drop_sync(ioc, len) < 0) { + error_setg(errp, "failed to skip export name with wrong length"); + nbd_send_opt_abort(ioc); + return -1; +@@ -343,14 +342,14 @@ static int nbd_receive_list(QIOChannel *ioc, const char *want, bool *match, + } + + assert(namelen < sizeof(name)); +- if (read_sync(ioc, name, namelen) != namelen) { ++ if (read_sync(ioc, name, namelen) < 0) { + error_setg(errp, "failed to read export name"); + nbd_send_opt_abort(ioc); + return -1; + } + name[namelen] = '\0'; + len -= namelen; +- if (drop_sync(ioc, len) != len) { ++ if (drop_sync(ioc, len) < 0) { + error_setg(errp, "failed to read export description"); + nbd_send_opt_abort(ioc); + return -1; +@@ -477,7 +476,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + goto fail; + } + +- if (read_sync(ioc, buf, 8) != 8) { ++ if (read_sync(ioc, buf, 8) < 0) { + error_setg(errp, "Failed to read data"); + goto fail; + } +@@ -503,7 +502,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + goto fail; + } + +- if (read_sync(ioc, &magic, sizeof(magic)) != sizeof(magic)) { ++ if (read_sync(ioc, &magic, sizeof(magic)) < 0) { + error_setg(errp, "Failed to read magic"); + goto fail; + } +@@ -515,8 +514,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + uint16_t globalflags; + bool fixedNewStyle = false; + +- if (read_sync(ioc, &globalflags, sizeof(globalflags)) != +- sizeof(globalflags)) { ++ if (read_sync(ioc, &globalflags, sizeof(globalflags)) < 0) { + error_setg(errp, "Failed to read server flags"); + goto fail; + } +@@ -534,8 +532,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + } + /* client requested flags */ + clientflags = cpu_to_be32(clientflags); +- if (write_sync(ioc, &clientflags, sizeof(clientflags)) != +- sizeof(clientflags)) { ++ if (write_sync(ioc, &clientflags, sizeof(clientflags)) < 0) { + error_setg(errp, "Failed to send clientflags field"); + goto fail; + } +@@ -573,13 +570,13 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + } + + /* Read the response */ +- if (read_sync(ioc, &s, sizeof(s)) != sizeof(s)) { ++ if (read_sync(ioc, &s, sizeof(s)) < 0) { + error_setg(errp, "Failed to read export length"); + goto fail; + } + *size = be64_to_cpu(s); + +- if (read_sync(ioc, flags, sizeof(*flags)) != sizeof(*flags)) { ++ if (read_sync(ioc, flags, sizeof(*flags)) < 0) { + error_setg(errp, "Failed to read export flags"); + goto fail; + } +@@ -596,14 +593,14 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + goto fail; + } + +- if (read_sync(ioc, &s, sizeof(s)) != sizeof(s)) { ++ if (read_sync(ioc, &s, sizeof(s)) < 0) { + error_setg(errp, "Failed to read export length"); + goto fail; + } + *size = be64_to_cpu(s); + TRACE("Size is %" PRIu64, *size); + +- if (read_sync(ioc, &oldflags, sizeof(oldflags)) != sizeof(oldflags)) { ++ if (read_sync(ioc, &oldflags, sizeof(oldflags)) < 0) { + error_setg(errp, "Failed to read export flags"); + goto fail; + } +@@ -619,7 +616,7 @@ int nbd_receive_negotiate(QIOChannel *ioc, const char *name, uint16_t *flags, + } + + TRACE("Size is %" PRIu64 ", export flags %" PRIx16, *size, *flags); +- if (zeroes && drop_sync(ioc, 124) != 124) { ++ if (zeroes && drop_sync(ioc, 124) < 0) { + error_setg(errp, "Failed to read reserved block"); + goto fail; + } +@@ -744,7 +741,6 @@ int nbd_disconnect(int fd) + ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request) + { + uint8_t buf[NBD_REQUEST_SIZE]; +- ssize_t ret; + + TRACE("Sending request to server: " + "{ .from = %" PRIu64", .len = %" PRIu32 ", .handle = %" PRIu64 +@@ -759,16 +755,7 @@ ssize_t nbd_send_request(QIOChannel *ioc, NBDRequest *request) + stq_be_p(buf + 16, request->from); + stl_be_p(buf + 24, request->len); + +- ret = write_sync(ioc, buf, sizeof(buf)); +- if (ret < 0) { +- return ret; +- } +- +- if (ret != sizeof(buf)) { +- LOG("writing to socket failed"); +- return -EINVAL; +- } +- return 0; ++ return write_sync(ioc, buf, sizeof(buf)); + } + + ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply) +@@ -777,7 +764,7 @@ ssize_t nbd_receive_reply(QIOChannel *ioc, NBDReply *reply) + uint32_t magic; + ssize_t ret; + +- ret = read_sync(ioc, buf, sizeof(buf)); ++ ret = read_sync_eof(ioc, buf, sizeof(buf)); + if (ret <= 0) { + return ret; + } +diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h +index f43d990..e6bbc7c 100644 +--- a/nbd/nbd-internal.h ++++ b/nbd/nbd-internal.h +@@ -94,7 +94,13 @@ + #define NBD_ENOSPC 28 + #define NBD_ESHUTDOWN 108 + +-static inline ssize_t read_sync(QIOChannel *ioc, void *buffer, size_t size) ++/* read_sync_eof ++ * Tries to read @size bytes from @ioc. Returns number of bytes actually read. ++ * May return a value >= 0 and < size only on EOF, i.e. when iteratively called ++ * qio_channel_readv() returns 0. So, there are no needs to call read_sync_eof ++ * iteratively. ++ */ ++static inline ssize_t read_sync_eof(QIOChannel *ioc, void *buffer, size_t size) + { + struct iovec iov = { .iov_base = buffer, .iov_len = size }; + /* Sockets are kept in blocking mode in the negotiation phase. After +@@ -105,12 +111,32 @@ static inline ssize_t read_sync(QIOChannel *ioc, void *buffer, size_t size) + return nbd_wr_syncv(ioc, &iov, 1, size, true); + } + +-static inline ssize_t write_sync(QIOChannel *ioc, const void *buffer, +- size_t size) ++/* read_sync ++ * Reads @size bytes from @ioc. Returns 0 on success. ++ */ ++static inline int read_sync(QIOChannel *ioc, void *buffer, size_t size) ++{ ++ ssize_t ret = read_sync_eof(ioc, buffer, size); ++ ++ if (ret >= 0 && ret != size) { ++ ret = -EINVAL; ++ } ++ ++ return ret < 0 ? ret : 0; ++} ++ ++/* write_sync ++ * Writes @size bytes to @ioc. Returns 0 on success. ++ */ ++static inline int write_sync(QIOChannel *ioc, const void *buffer, size_t size) + { + struct iovec iov = { .iov_base = (void *) buffer, .iov_len = size }; + +- return nbd_wr_syncv(ioc, &iov, 1, size, false); ++ ssize_t ret = nbd_wr_syncv(ioc, &iov, 1, size, false); ++ ++ assert(ret < 0 || ret == size); ++ ++ return ret < 0 ? ret : 0; + } + + struct NBDTLSHandshakeData { +diff --git a/nbd/server.c b/nbd/server.c +index a98bb21..b44cbe6 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -112,7 +112,7 @@ static gboolean nbd_negotiate_continue(QIOChannel *ioc, + return TRUE; + } + +-static ssize_t nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) ++static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) + { + ssize_t ret; + guint watch; +@@ -130,8 +130,7 @@ static ssize_t nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) + + } + +-static ssize_t nbd_negotiate_write(QIOChannel *ioc, const void *buffer, +- size_t size) ++static int nbd_negotiate_write(QIOChannel *ioc, const void *buffer, size_t size) + { + ssize_t ret; + guint watch; +@@ -148,24 +147,24 @@ static ssize_t nbd_negotiate_write(QIOChannel *ioc, const void *buffer, + return ret; + } + +-static ssize_t nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size) ++static int nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size) + { +- ssize_t ret, dropped = size; ++ ssize_t ret; + uint8_t *buffer = g_malloc(MIN(65536, size)); + + while (size > 0) { +- ret = nbd_negotiate_read(ioc, buffer, MIN(65536, size)); ++ size_t count = MIN(65536, size); ++ ret = nbd_negotiate_read(ioc, buffer, count); + if (ret < 0) { + g_free(buffer); + return ret; + } + +- assert(ret <= size); +- size -= ret; ++ size -= count; + } + + g_free(buffer); +- return dropped; ++ return 0; + } + + /* Basic flow for negotiation +@@ -206,22 +205,22 @@ static int nbd_negotiate_send_rep_len(QIOChannel *ioc, uint32_t type, + type, opt, len); + + magic = cpu_to_be64(NBD_REP_MAGIC); +- if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) != sizeof(magic)) { ++ if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) < 0) { + LOG("write failed (rep magic)"); + return -EINVAL; + } + opt = cpu_to_be32(opt); +- if (nbd_negotiate_write(ioc, &opt, sizeof(opt)) != sizeof(opt)) { ++ if (nbd_negotiate_write(ioc, &opt, sizeof(opt)) < 0) { + LOG("write failed (rep opt)"); + return -EINVAL; + } + type = cpu_to_be32(type); +- if (nbd_negotiate_write(ioc, &type, sizeof(type)) != sizeof(type)) { ++ if (nbd_negotiate_write(ioc, &type, sizeof(type)) < 0) { + LOG("write failed (rep type)"); + return -EINVAL; + } + len = cpu_to_be32(len); +- if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) { ++ if (nbd_negotiate_write(ioc, &len, sizeof(len)) < 0) { + LOG("write failed (rep data length)"); + return -EINVAL; + } +@@ -256,7 +255,7 @@ nbd_negotiate_send_rep_err(QIOChannel *ioc, uint32_t type, + if (ret < 0) { + goto out; + } +- if (nbd_negotiate_write(ioc, msg, len) != len) { ++ if (nbd_negotiate_write(ioc, msg, len) < 0) { + LOG("write failed (error message)"); + ret = -EIO; + } else { +@@ -287,15 +286,15 @@ static int nbd_negotiate_send_rep_list(QIOChannel *ioc, NBDExport *exp) + } + + len = cpu_to_be32(name_len); +- if (nbd_negotiate_write(ioc, &len, sizeof(len)) != sizeof(len)) { ++ if (nbd_negotiate_write(ioc, &len, sizeof(len)) < 0) { + LOG("write failed (name length)"); + return -EINVAL; + } +- if (nbd_negotiate_write(ioc, name, name_len) != name_len) { ++ if (nbd_negotiate_write(ioc, name, name_len) < 0) { + LOG("write failed (name buffer)"); + return -EINVAL; + } +- if (nbd_negotiate_write(ioc, desc, desc_len) != desc_len) { ++ if (nbd_negotiate_write(ioc, desc, desc_len) < 0) { + LOG("write failed (description buffer)"); + return -EINVAL; + } +@@ -309,7 +308,7 @@ static int nbd_negotiate_handle_list(NBDClient *client, uint32_t length) + NBDExport *exp; + + if (length) { +- if (nbd_negotiate_drop_sync(client->ioc, length) != length) { ++ if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { + return -EIO; + } + return nbd_negotiate_send_rep_err(client->ioc, +@@ -340,7 +339,7 @@ static int nbd_negotiate_handle_export_name(NBDClient *client, uint32_t length) + LOG("Bad length received"); + goto fail; + } +- if (nbd_negotiate_read(client->ioc, name, length) != length) { ++ if (nbd_negotiate_read(client->ioc, name, length) < 0) { + LOG("read failed"); + goto fail; + } +@@ -373,7 +372,7 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client, + TRACE("Setting up TLS"); + ioc = client->ioc; + if (length) { +- if (nbd_negotiate_drop_sync(ioc, length) != length) { ++ if (nbd_negotiate_drop_sync(ioc, length) < 0) { + return NULL; + } + nbd_negotiate_send_rep_err(ioc, NBD_REP_ERR_INVALID, NBD_OPT_STARTTLS, +@@ -437,8 +436,7 @@ static int nbd_negotiate_options(NBDClient *client) + ... Rest of request + */ + +- if (nbd_negotiate_read(client->ioc, &flags, sizeof(flags)) != +- sizeof(flags)) { ++ if (nbd_negotiate_read(client->ioc, &flags, sizeof(flags)) < 0) { + LOG("read failed"); + return -EIO; + } +@@ -464,8 +462,7 @@ static int nbd_negotiate_options(NBDClient *client) + uint32_t clientflags, length; + uint64_t magic; + +- if (nbd_negotiate_read(client->ioc, &magic, sizeof(magic)) != +- sizeof(magic)) { ++ if (nbd_negotiate_read(client->ioc, &magic, sizeof(magic)) < 0) { + LOG("read failed"); + return -EINVAL; + } +@@ -476,14 +473,14 @@ static int nbd_negotiate_options(NBDClient *client) + } + + if (nbd_negotiate_read(client->ioc, &clientflags, +- sizeof(clientflags)) != sizeof(clientflags)) { ++ sizeof(clientflags)) < 0) ++ { + LOG("read failed"); + return -EINVAL; + } + clientflags = be32_to_cpu(clientflags); + +- if (nbd_negotiate_read(client->ioc, &length, sizeof(length)) != +- sizeof(length)) { ++ if (nbd_negotiate_read(client->ioc, &length, sizeof(length)) < 0) { + LOG("read failed"); + return -EINVAL; + } +@@ -513,7 +510,7 @@ static int nbd_negotiate_options(NBDClient *client) + return -EINVAL; + + default: +- if (nbd_negotiate_drop_sync(client->ioc, length) != length) { ++ if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { + return -EIO; + } + ret = nbd_negotiate_send_rep_err(client->ioc, +@@ -551,7 +548,7 @@ static int nbd_negotiate_options(NBDClient *client) + return nbd_negotiate_handle_export_name(client, length); + + case NBD_OPT_STARTTLS: +- if (nbd_negotiate_drop_sync(client->ioc, length) != length) { ++ if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { + return -EIO; + } + if (client->tlscreds) { +@@ -570,7 +567,7 @@ static int nbd_negotiate_options(NBDClient *client) + } + break; + default: +- if (nbd_negotiate_drop_sync(client->ioc, length) != length) { ++ if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { + return -EIO; + } + ret = nbd_negotiate_send_rep_err(client->ioc, +@@ -659,12 +656,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) + TRACE("TLS cannot be enabled with oldstyle protocol"); + goto fail; + } +- if (nbd_negotiate_write(client->ioc, buf, sizeof(buf)) != sizeof(buf)) { ++ if (nbd_negotiate_write(client->ioc, buf, sizeof(buf)) < 0) { + LOG("write failed"); + goto fail; + } + } else { +- if (nbd_negotiate_write(client->ioc, buf, 18) != 18) { ++ if (nbd_negotiate_write(client->ioc, buf, 18) < 0) { + LOG("write failed"); + goto fail; + } +@@ -679,7 +676,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) + stq_be_p(buf + 18, client->exp->size); + stw_be_p(buf + 26, client->exp->nbdflags | myflags); + len = client->no_zeroes ? 10 : sizeof(buf) - 18; +- if (nbd_negotiate_write(client->ioc, buf + 18, len) != len) { ++ if (nbd_negotiate_write(client->ioc, buf + 18, len) < 0) { + LOG("write failed"); + goto fail; + } +@@ -702,11 +699,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) + return ret; + } + +- if (ret != sizeof(buf)) { +- LOG("read failed"); +- return -EINVAL; +- } +- + /* Request + [ 0 .. 3] magic (NBD_REQUEST_MAGIC) + [ 4 .. 5] flags (NBD_CMD_FLAG_FUA, ...) +@@ -737,7 +729,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) + static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply) + { + uint8_t buf[NBD_REPLY_SIZE]; +- ssize_t ret; + + reply->error = system_errno_to_nbd_errno(reply->error); + +@@ -754,16 +745,7 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply) + stl_be_p(buf + 4, reply->error); + stq_be_p(buf + 8, reply->handle); + +- ret = write_sync(ioc, buf, sizeof(buf)); +- if (ret < 0) { +- return ret; +- } +- +- if (ret != sizeof(buf)) { +- LOG("writing to socket failed"); +- return -EINVAL; +- } +- return 0; ++ return write_sync(ioc, buf, sizeof(buf)); + } + + #define MAX_NBD_REQUESTS 16 +@@ -1067,7 +1049,7 @@ static ssize_t nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, + rc = nbd_send_reply(client->ioc, reply); + if (rc >= 0) { + ret = write_sync(client->ioc, req->data, len); +- if (ret != len) { ++ if (ret < 0) { + rc = -EIO; + } + } +@@ -1141,7 +1123,7 @@ static ssize_t nbd_co_receive_request(NBDRequestData *req, + if (request->type == NBD_CMD_WRITE) { + TRACE("Reading %" PRIu32 " byte(s)", request->len); + +- if (read_sync(client->ioc, req->data, request->len) != request->len) { ++ if (read_sync(client->ioc, req->data, request->len) < 0) { + LOG("reading from socket failed"); + rc = -EIO; + goto out; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch b/SOURCES/kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch new file mode 100644 index 0000000..cbe2940 --- /dev/null +++ b/SOURCES/kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch @@ -0,0 +1,292 @@ +From b202cbe30ea881c40defe4e7dde664e0b99e8c06 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Wed, 19 Jul 2017 18:02:02 +0200 +Subject: [PATCH 05/17] nbd/server: get rid of nbd_negotiate_read and friends + +RH-Author: Eric Blake +Message-id: <20170719180202.23329-5-eblake@redhat.com> +Patchwork-id: 75816 +O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 4/4] nbd/server: get rid of nbd_negotiate_read and friends +Bugzilla: 1473638 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Jeffrey Cody + +From: Vladimir Sementsov-Ogievskiy + +Functions nbd_negotiate_{read,write,drop_sync} were introduced in +1a6245a5b, when nbd_rwv (was nbd_wr_sync) was working through +qemu_co_sendv_recvv (the path is nbd_wr_sync -> qemu_co_{recv/send} -> +qemu_co_send_recv -> qemu_co_sendv_recvv), which just yields, without +setting any handlers. But starting from ff82911cd nbd_rwv (was +nbd_wr_syncv) works through qio_channel_yield() which sets handlers, so +watchers are redundant in nbd_negotiate_{read,write,drop_sync}, then, +let's just use nbd_{read,write,drop} functions. + +Functions nbd_{read,write,drop} has errp parameter, which is unused in +this patch. This will be fixed later. + +Signed-off-by: Vladimir Sementsov-Ogievskiy +Reviewed-by: Eric Blake +Message-Id: <20170602150150.258222-4-vsementsov@virtuozzo.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 2b0bbc4f8809c972bad134bc1a2570dbb01dea0b) + +Signed-off-by: Miroslav Rezanina + +Conflicts: + nbd/server.c - missing errp addition (e44ed99) and bulk + rename (d1fdf25) +Fixes CVE-2017-7539 + +Signed-off-by: Eric Blake +--- + nbd/server.c | 106 ++++++++++++----------------------------------------------- + 1 file changed, 21 insertions(+), 85 deletions(-) + +diff --git a/nbd/server.c b/nbd/server.c +index b44cbe6..8e3b8e5 100644 +--- a/nbd/server.c ++++ b/nbd/server.c +@@ -104,69 +104,6 @@ struct NBDClient { + + static void nbd_client_receive_next_request(NBDClient *client); + +-static gboolean nbd_negotiate_continue(QIOChannel *ioc, +- GIOCondition condition, +- void *opaque) +-{ +- qemu_coroutine_enter(opaque); +- return TRUE; +-} +- +-static int nbd_negotiate_read(QIOChannel *ioc, void *buffer, size_t size) +-{ +- ssize_t ret; +- guint watch; +- +- assert(qemu_in_coroutine()); +- /* Negotiation are always in main loop. */ +- watch = qio_channel_add_watch(ioc, +- G_IO_IN, +- nbd_negotiate_continue, +- qemu_coroutine_self(), +- NULL); +- ret = read_sync(ioc, buffer, size); +- g_source_remove(watch); +- return ret; +- +-} +- +-static int nbd_negotiate_write(QIOChannel *ioc, const void *buffer, size_t size) +-{ +- ssize_t ret; +- guint watch; +- +- assert(qemu_in_coroutine()); +- /* Negotiation are always in main loop. */ +- watch = qio_channel_add_watch(ioc, +- G_IO_OUT, +- nbd_negotiate_continue, +- qemu_coroutine_self(), +- NULL); +- ret = write_sync(ioc, buffer, size); +- g_source_remove(watch); +- return ret; +-} +- +-static int nbd_negotiate_drop_sync(QIOChannel *ioc, size_t size) +-{ +- ssize_t ret; +- uint8_t *buffer = g_malloc(MIN(65536, size)); +- +- while (size > 0) { +- size_t count = MIN(65536, size); +- ret = nbd_negotiate_read(ioc, buffer, count); +- if (ret < 0) { +- g_free(buffer); +- return ret; +- } +- +- size -= count; +- } +- +- g_free(buffer); +- return 0; +-} +- + /* Basic flow for negotiation + + Server Client +@@ -205,22 +142,22 @@ static int nbd_negotiate_send_rep_len(QIOChannel *ioc, uint32_t type, + type, opt, len); + + magic = cpu_to_be64(NBD_REP_MAGIC); +- if (nbd_negotiate_write(ioc, &magic, sizeof(magic)) < 0) { ++ if (write_sync(ioc, &magic, sizeof(magic)) < 0) { + LOG("write failed (rep magic)"); + return -EINVAL; + } + opt = cpu_to_be32(opt); +- if (nbd_negotiate_write(ioc, &opt, sizeof(opt)) < 0) { ++ if (write_sync(ioc, &opt, sizeof(opt)) < 0) { + LOG("write failed (rep opt)"); + return -EINVAL; + } + type = cpu_to_be32(type); +- if (nbd_negotiate_write(ioc, &type, sizeof(type)) < 0) { ++ if (write_sync(ioc, &type, sizeof(type)) < 0) { + LOG("write failed (rep type)"); + return -EINVAL; + } + len = cpu_to_be32(len); +- if (nbd_negotiate_write(ioc, &len, sizeof(len)) < 0) { ++ if (write_sync(ioc, &len, sizeof(len)) < 0) { + LOG("write failed (rep data length)"); + return -EINVAL; + } +@@ -255,7 +192,7 @@ nbd_negotiate_send_rep_err(QIOChannel *ioc, uint32_t type, + if (ret < 0) { + goto out; + } +- if (nbd_negotiate_write(ioc, msg, len) < 0) { ++ if (write_sync(ioc, msg, len) < 0) { + LOG("write failed (error message)"); + ret = -EIO; + } else { +@@ -286,15 +223,15 @@ static int nbd_negotiate_send_rep_list(QIOChannel *ioc, NBDExport *exp) + } + + len = cpu_to_be32(name_len); +- if (nbd_negotiate_write(ioc, &len, sizeof(len)) < 0) { ++ if (write_sync(ioc, &len, sizeof(len)) < 0) { + LOG("write failed (name length)"); + return -EINVAL; + } +- if (nbd_negotiate_write(ioc, name, name_len) < 0) { ++ if (write_sync(ioc, name, name_len) < 0) { + LOG("write failed (name buffer)"); + return -EINVAL; + } +- if (nbd_negotiate_write(ioc, desc, desc_len) < 0) { ++ if (write_sync(ioc, desc, desc_len) < 0) { + LOG("write failed (description buffer)"); + return -EINVAL; + } +@@ -308,7 +245,7 @@ static int nbd_negotiate_handle_list(NBDClient *client, uint32_t length) + NBDExport *exp; + + if (length) { +- if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { ++ if (nbd_drop(client->ioc, length) < 0) { + return -EIO; + } + return nbd_negotiate_send_rep_err(client->ioc, +@@ -339,7 +276,7 @@ static int nbd_negotiate_handle_export_name(NBDClient *client, uint32_t length) + LOG("Bad length received"); + goto fail; + } +- if (nbd_negotiate_read(client->ioc, name, length) < 0) { ++ if (read_sync(client->ioc, name, length) < 0) { + LOG("read failed"); + goto fail; + } +@@ -372,7 +309,7 @@ static QIOChannel *nbd_negotiate_handle_starttls(NBDClient *client, + TRACE("Setting up TLS"); + ioc = client->ioc; + if (length) { +- if (nbd_negotiate_drop_sync(ioc, length) < 0) { ++ if (nbd_drop(ioc, length) < 0) { + return NULL; + } + nbd_negotiate_send_rep_err(ioc, NBD_REP_ERR_INVALID, NBD_OPT_STARTTLS, +@@ -436,7 +373,7 @@ static int nbd_negotiate_options(NBDClient *client) + ... Rest of request + */ + +- if (nbd_negotiate_read(client->ioc, &flags, sizeof(flags)) < 0) { ++ if (read_sync(client->ioc, &flags, sizeof(flags)) < 0) { + LOG("read failed"); + return -EIO; + } +@@ -462,7 +399,7 @@ static int nbd_negotiate_options(NBDClient *client) + uint32_t clientflags, length; + uint64_t magic; + +- if (nbd_negotiate_read(client->ioc, &magic, sizeof(magic)) < 0) { ++ if (read_sync(client->ioc, &magic, sizeof(magic)) < 0) { + LOG("read failed"); + return -EINVAL; + } +@@ -472,15 +409,14 @@ static int nbd_negotiate_options(NBDClient *client) + return -EINVAL; + } + +- if (nbd_negotiate_read(client->ioc, &clientflags, +- sizeof(clientflags)) < 0) ++ if (read_sync(client->ioc, &clientflags, sizeof(clientflags)) < 0) + { + LOG("read failed"); + return -EINVAL; + } + clientflags = be32_to_cpu(clientflags); + +- if (nbd_negotiate_read(client->ioc, &length, sizeof(length)) < 0) { ++ if (read_sync(client->ioc, &length, sizeof(length)) < 0) { + LOG("read failed"); + return -EINVAL; + } +@@ -510,7 +446,7 @@ static int nbd_negotiate_options(NBDClient *client) + return -EINVAL; + + default: +- if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { ++ if (nbd_drop(client->ioc, length) < 0) { + return -EIO; + } + ret = nbd_negotiate_send_rep_err(client->ioc, +@@ -548,7 +484,7 @@ static int nbd_negotiate_options(NBDClient *client) + return nbd_negotiate_handle_export_name(client, length); + + case NBD_OPT_STARTTLS: +- if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { ++ if (nbd_drop(client->ioc, length) < 0) { + return -EIO; + } + if (client->tlscreds) { +@@ -567,7 +503,7 @@ static int nbd_negotiate_options(NBDClient *client) + } + break; + default: +- if (nbd_negotiate_drop_sync(client->ioc, length) < 0) { ++ if (nbd_drop(client->ioc, length) < 0) { + return -EIO; + } + ret = nbd_negotiate_send_rep_err(client->ioc, +@@ -656,12 +592,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) + TRACE("TLS cannot be enabled with oldstyle protocol"); + goto fail; + } +- if (nbd_negotiate_write(client->ioc, buf, sizeof(buf)) < 0) { ++ if (write_sync(client->ioc, buf, sizeof(buf)) < 0) { + LOG("write failed"); + goto fail; + } + } else { +- if (nbd_negotiate_write(client->ioc, buf, 18) < 0) { ++ if (write_sync(client->ioc, buf, 18) < 0) { + LOG("write failed"); + goto fail; + } +@@ -676,7 +612,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) + stq_be_p(buf + 18, client->exp->size); + stw_be_p(buf + 26, client->exp->nbdflags | myflags); + len = client->no_zeroes ? 10 : sizeof(buf) - 18; +- if (nbd_negotiate_write(client->ioc, buf + 18, len) < 0) { ++ if (write_sync(client->ioc, buf + 18, len) < 0) { + LOG("write failed"); + goto fail; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-nbd-strict-nbd_wr_syncv.patch b/SOURCES/kvm-nbd-strict-nbd_wr_syncv.patch new file mode 100644 index 0000000..0217532 --- /dev/null +++ b/SOURCES/kvm-nbd-strict-nbd_wr_syncv.patch @@ -0,0 +1,66 @@ +From 0fc0a6c7d5492e109a852542ec665567eeefbf34 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Wed, 19 Jul 2017 18:01:59 +0200 +Subject: [PATCH 02/17] nbd: strict nbd_wr_syncv + +RH-Author: Eric Blake +Message-id: <20170719180202.23329-2-eblake@redhat.com> +Patchwork-id: 75817 +O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 1/4] nbd: strict nbd_wr_syncv +Bugzilla: 1473638 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Jeffrey Cody + +From: Vladimir Sementsov-Ogievskiy + +nbd_wr_syncv is called either from coroutine or from client negotiation +code, when socket is in blocking mode. So, -EAGAIN is impossible. + +Furthermore, EAGAIN is confusing, as, what to read/write again? With +EAGAIN as a return code we don't know how much data is already +read or written by the function, so in case of EAGAIN the whole +communication is broken. + +Signed-off-by: Vladimir Sementsov-Ogievskiy +Message-Id: <20170516094533.6160-2-vsementsov@virtuozzo.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit f250a42ddaee042ad2eb02022a3ebd18fcf987de) +Signed-off-by: Eric Blake +Signed-off-by: Miroslav Rezanina +--- + nbd/common.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/nbd/common.c b/nbd/common.c +index dccbb8e..4db45b3 100644 +--- a/nbd/common.c ++++ b/nbd/common.c +@@ -20,6 +20,10 @@ + #include "qapi/error.h" + #include "nbd-internal.h" + ++/* nbd_wr_syncv ++ * The function may be called from coroutine or from non-coroutine context. ++ * When called from non-coroutine context @ioc must be in blocking mode. ++ */ + ssize_t nbd_wr_syncv(QIOChannel *ioc, + struct iovec *iov, + size_t niov, +@@ -42,11 +46,8 @@ ssize_t nbd_wr_syncv(QIOChannel *ioc, + len = qio_channel_writev(ioc, local_iov, nlocal_iov, &local_err); + } + if (len == QIO_CHANNEL_ERR_BLOCK) { +- if (qemu_in_coroutine()) { +- qio_channel_yield(ioc, do_read ? G_IO_IN : G_IO_OUT); +- } else { +- return -EAGAIN; +- } ++ assert(qemu_in_coroutine()); ++ qio_channel_yield(ioc, do_read ? G_IO_IN : G_IO_OUT); + continue; + } + if (len < 0) { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-numa-Allow-setting-NUMA-distance-for-different-NUMA-.patch b/SOURCES/kvm-numa-Allow-setting-NUMA-distance-for-different-NUMA-.patch new file mode 100644 index 0000000..5ec2003 --- /dev/null +++ b/SOURCES/kvm-numa-Allow-setting-NUMA-distance-for-different-NUMA-.patch @@ -0,0 +1,449 @@ +From e803b7229ed6f1d31d2892ad545be259c2b61004 Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Mon, 29 May 2017 07:52:54 +0200 +Subject: [PATCH 11/13] numa: Allow setting NUMA distance for different NUMA + nodes + +RH-Author: Igor Mammedov +Message-id: <1496044376-228722-2-git-send-email-imammedo@redhat.com> +Patchwork-id: 75427 +O-Subject: [RHEL7.4 qemu-kvm-rhev 1/3] numa: Allow setting NUMA distance for different NUMA nodes +Bugzilla: 1395339 +RH-Acked-by: Andrew Jones +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Marcel Apfelbaum + +From: He Chen + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1395339 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13293161 + +This patch is going to add SLIT table support in QEMU, and provides +additional option `dist` for command `-numa` to allow user set vNUMA +distance by QEMU command. + +With this patch, when a user wants to create a guest that contains +several vNUMA nodes and also wants to set distance among those nodes, +the QEMU command would like: + +``` +-numa node,nodeid=0,cpus=0 \ +-numa node,nodeid=1,cpus=1 \ +-numa node,nodeid=2,cpus=2 \ +-numa node,nodeid=3,cpus=3 \ +-numa dist,src=0,dst=1,val=21 \ +-numa dist,src=0,dst=2,val=31 \ +-numa dist,src=0,dst=3,val=41 \ +-numa dist,src=1,dst=2,val=21 \ +-numa dist,src=1,dst=3,val=31 \ +-numa dist,src=2,dst=3,val=21 \ +``` + +Signed-off-by: He Chen +Message-Id: <1493260558-20728-1-git-send-email-he.chen@linux.intel.com> +Reviewed-by: Igor Mammedov +Reviewed-by: Andrew Jones +Signed-off-by: Eduardo Habkost +(cherry picked from commit 0f203430dd88cc6270310956ace58aca639edb59) +Signed-off-by: Igor Mammedov +Signed-off-by: Miroslav Rezanina +--- + hw/acpi/aml-build.c | 26 +++++++++ + hw/i386/acpi-build.c | 4 ++ + include/hw/acpi/aml-build.h | 1 + + include/sysemu/numa.h | 2 + + include/sysemu/sysemu.h | 4 ++ + numa.c | 137 +++++++++++++++++++++++++++++++++++++++++++- + qapi-schema.json | 30 +++++++++- + qemu-options.hx | 16 +++++- + 8 files changed, 215 insertions(+), 5 deletions(-) + +diff --git a/hw/acpi/aml-build.c b/hw/acpi/aml-build.c +index c6f2032..be496c8 100644 +--- a/hw/acpi/aml-build.c ++++ b/hw/acpi/aml-build.c +@@ -24,6 +24,7 @@ + #include "hw/acpi/aml-build.h" + #include "qemu/bswap.h" + #include "qemu/bitops.h" ++#include "sysemu/numa.h" + + static GArray *build_alloc_array(void) + { +@@ -1609,3 +1610,28 @@ void build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, + numamem->base_addr = cpu_to_le64(base); + numamem->range_length = cpu_to_le64(len); + } ++ ++/* ++ * ACPI spec 5.2.17 System Locality Distance Information Table ++ * (Revision 2.0 or later) ++ */ ++void build_slit(GArray *table_data, BIOSLinker *linker) ++{ ++ int slit_start, i, j; ++ slit_start = table_data->len; ++ ++ acpi_data_push(table_data, sizeof(AcpiTableHeader)); ++ ++ build_append_int_noprefix(table_data, nb_numa_nodes, 8); ++ for (i = 0; i < nb_numa_nodes; i++) { ++ for (j = 0; j < nb_numa_nodes; j++) { ++ assert(numa_info[i].distance[j]); ++ build_append_int_noprefix(table_data, numa_info[i].distance[j], 1); ++ } ++ } ++ ++ build_header(linker, table_data, ++ (void *)(table_data->data + slit_start), ++ "SLIT", ++ table_data->len - slit_start, 1, NULL, NULL); ++} +diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c +index 2073108..2458ebc 100644 +--- a/hw/i386/acpi-build.c ++++ b/hw/i386/acpi-build.c +@@ -2678,6 +2678,10 @@ void acpi_build(AcpiBuildTables *tables, MachineState *machine) + if (pcms->numa_nodes) { + acpi_add_table(table_offsets, tables_blob); + build_srat(tables_blob, tables->linker, machine); ++ if (have_numa_distance) { ++ acpi_add_table(table_offsets, tables_blob); ++ build_slit(tables_blob, tables->linker); ++ } + } + if (acpi_get_mcfg(&mcfg)) { + acpi_add_table(table_offsets, tables_blob); +diff --git a/include/hw/acpi/aml-build.h b/include/hw/acpi/aml-build.h +index 00c21f1..329a0d0 100644 +--- a/include/hw/acpi/aml-build.h ++++ b/include/hw/acpi/aml-build.h +@@ -389,4 +389,5 @@ GCC_FMT_ATTR(2, 3); + void build_srat_memory(AcpiSratMemoryAffinity *numamem, uint64_t base, + uint64_t len, int node, MemoryAffinityFlags flags); + ++void build_slit(GArray *table_data, BIOSLinker *linker); + #endif +diff --git a/include/sysemu/numa.h b/include/sysemu/numa.h +index 8f09dcf..0ea1bc0 100644 +--- a/include/sysemu/numa.h ++++ b/include/sysemu/numa.h +@@ -8,6 +8,7 @@ + #include "hw/boards.h" + + extern int nb_numa_nodes; /* Number of NUMA nodes */ ++extern bool have_numa_distance; + + struct numa_addr_range { + ram_addr_t mem_start; +@@ -21,6 +22,7 @@ typedef struct node_info { + struct HostMemoryBackend *node_memdev; + bool present; + QLIST_HEAD(, numa_addr_range) addr; /* List to store address ranges */ ++ uint8_t distance[MAX_NODES]; + } NodeInfo; + + extern NodeInfo numa_info[MAX_NODES]; +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 22c0460..1fd51a8 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -170,6 +170,10 @@ extern int mem_prealloc; + + #define MAX_NODES 128 + #define NUMA_NODE_UNASSIGNED MAX_NODES ++#define NUMA_DISTANCE_MIN 10 ++#define NUMA_DISTANCE_DEFAULT 20 ++#define NUMA_DISTANCE_MAX 254 ++#define NUMA_DISTANCE_UNREACHABLE 255 + + #define MAX_OPTION_ROMS 16 + typedef struct QEMUOptionRom { +diff --git a/numa.c b/numa.c +index 80d9029..1ca2a11 100644 +--- a/numa.c ++++ b/numa.c +@@ -51,6 +51,7 @@ static int max_numa_nodeid; /* Highest specified NUMA node ID, plus one. + * For all nodes, nodeid < max_numa_nodeid + */ + int nb_numa_nodes; ++bool have_numa_distance; + NodeInfo numa_info[MAX_NODES]; + + void numa_set_mem_node_id(ram_addr_t addr, uint64_t size, uint32_t node) +@@ -140,7 +141,7 @@ uint32_t numa_get_node(ram_addr_t addr, Error **errp) + return -1; + } + +-static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp) ++static void parse_numa_node(NumaNodeOptions *node, QemuOpts *opts, Error **errp) + { + uint16_t nodenr; + uint16List *cpus = NULL; +@@ -212,6 +213,43 @@ static void numa_node_parse(NumaNodeOptions *node, QemuOpts *opts, Error **errp) + max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1); + } + ++static void parse_numa_distance(NumaDistOptions *dist, Error **errp) ++{ ++ uint16_t src = dist->src; ++ uint16_t dst = dist->dst; ++ uint8_t val = dist->val; ++ ++ if (src >= MAX_NODES || dst >= MAX_NODES) { ++ error_setg(errp, ++ "Invalid node %" PRIu16 ++ ", max possible could be %" PRIu16, ++ MAX(src, dst), MAX_NODES); ++ return; ++ } ++ ++ if (!numa_info[src].present || !numa_info[dst].present) { ++ error_setg(errp, "Source/Destination NUMA node is missing. " ++ "Please use '-numa node' option to declare it first."); ++ return; ++ } ++ ++ if (val < NUMA_DISTANCE_MIN) { ++ error_setg(errp, "NUMA distance (%" PRIu8 ") is invalid, " ++ "it shouldn't be less than %d.", ++ val, NUMA_DISTANCE_MIN); ++ return; ++ } ++ ++ if (src == dst && val != NUMA_DISTANCE_MIN) { ++ error_setg(errp, "Local distance of node %d should be %d.", ++ src, NUMA_DISTANCE_MIN); ++ return; ++ } ++ ++ numa_info[src].distance[dst] = val; ++ have_numa_distance = true; ++} ++ + static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) + { + NumaOptions *object = NULL; +@@ -229,12 +267,18 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp) + + switch (object->type) { + case NUMA_OPTIONS_TYPE_NODE: +- numa_node_parse(&object->u.node, opts, &err); ++ parse_numa_node(&object->u.node, opts, &err); + if (err) { + goto end; + } + nb_numa_nodes++; + break; ++ case NUMA_OPTIONS_TYPE_DIST: ++ parse_numa_distance(&object->u.dist, &err); ++ if (err) { ++ goto end; ++ } ++ break; + default: + abort(); + } +@@ -294,6 +338,75 @@ static void validate_numa_cpus(void) + g_free(seen_cpus); + } + ++/* If all node pair distances are symmetric, then only distances ++ * in one direction are enough. If there is even one asymmetric ++ * pair, though, then all distances must be provided. The ++ * distance from a node to itself is always NUMA_DISTANCE_MIN, ++ * so providing it is never necessary. ++ */ ++static void validate_numa_distance(void) ++{ ++ int src, dst; ++ bool is_asymmetrical = false; ++ ++ for (src = 0; src < nb_numa_nodes; src++) { ++ for (dst = src; dst < nb_numa_nodes; dst++) { ++ if (numa_info[src].distance[dst] == 0 && ++ numa_info[dst].distance[src] == 0) { ++ if (src != dst) { ++ error_report("The distance between node %d and %d is " ++ "missing, at least one distance value " ++ "between each nodes should be provided.", ++ src, dst); ++ exit(EXIT_FAILURE); ++ } ++ } ++ ++ if (numa_info[src].distance[dst] != 0 && ++ numa_info[dst].distance[src] != 0 && ++ numa_info[src].distance[dst] != ++ numa_info[dst].distance[src]) { ++ is_asymmetrical = true; ++ } ++ } ++ } ++ ++ if (is_asymmetrical) { ++ for (src = 0; src < nb_numa_nodes; src++) { ++ for (dst = 0; dst < nb_numa_nodes; dst++) { ++ if (src != dst && numa_info[src].distance[dst] == 0) { ++ error_report("At least one asymmetrical pair of " ++ "distances is given, please provide distances " ++ "for both directions of all node pairs."); ++ exit(EXIT_FAILURE); ++ } ++ } ++ } ++ } ++} ++ ++static void complete_init_numa_distance(void) ++{ ++ int src, dst; ++ ++ /* Fixup NUMA distance by symmetric policy because if it is an ++ * asymmetric distance table, it should be a complete table and ++ * there would not be any missing distance except local node, which ++ * is verified by validate_numa_distance above. ++ */ ++ for (src = 0; src < nb_numa_nodes; src++) { ++ for (dst = 0; dst < nb_numa_nodes; dst++) { ++ if (numa_info[src].distance[dst] == 0) { ++ if (src == dst) { ++ numa_info[src].distance[dst] = NUMA_DISTANCE_MIN; ++ } else { ++ numa_info[src].distance[dst] = numa_info[dst].distance[src]; ++ } ++ } ++ } ++ } ++} ++ + void parse_numa_opts(MachineClass *mc) + { + int i; +@@ -390,6 +503,26 @@ void parse_numa_opts(MachineClass *mc) + } + + validate_numa_cpus(); ++ ++ /* QEMU needs at least all unique node pair distances to build ++ * the whole NUMA distance table. QEMU treats the distance table ++ * as symmetric by default, i.e. distance A->B == distance B->A. ++ * Thus, QEMU is able to complete the distance table ++ * initialization even though only distance A->B is provided and ++ * distance B->A is not. QEMU knows the distance of a node to ++ * itself is always 10, so A->A distances may be omitted. When ++ * the distances of two nodes of a pair differ, i.e. distance ++ * A->B != distance B->A, then that means the distance table is ++ * asymmetric. In this case, the distances for both directions ++ * of all node pairs are required. ++ */ ++ if (have_numa_distance) { ++ /* Validate enough NUMA distance information was provided. */ ++ validate_numa_distance(); ++ ++ /* Validation succeeded, now fill in any missing distances. */ ++ complete_init_numa_distance(); ++ } + } else { + numa_set_mem_node_id(0, ram_size, 0); + } +diff --git a/qapi-schema.json b/qapi-schema.json +index cefbaf5..fa71429 100644 +--- a/qapi-schema.json ++++ b/qapi-schema.json +@@ -5695,10 +5695,14 @@ + ## + # @NumaOptionsType: + # ++# @node: NUMA nodes configuration ++# ++# @dist: NUMA distance configuration (since 2.10) ++# + # Since: 2.1 + ## + { 'enum': 'NumaOptionsType', +- 'data': [ 'node' ] } ++ 'data': [ 'node', 'dist' ] } + + ## + # @NumaOptions: +@@ -5711,7 +5715,8 @@ + 'base': { 'type': 'NumaOptionsType' }, + 'discriminator': 'type', + 'data': { +- 'node': 'NumaNodeOptions' }} ++ 'node': 'NumaNodeOptions', ++ 'dist': 'NumaDistOptions' }} + + ## + # @NumaNodeOptions: +@@ -5740,6 +5745,27 @@ + '*memdev': 'str' }} + + ## ++# @NumaDistOptions: ++# ++# Set the distance between 2 NUMA nodes. ++# ++# @src: source NUMA node. ++# ++# @dst: destination NUMA node. ++# ++# @val: NUMA distance from source node to destination node. ++# When a node is unreachable from another node, set the distance ++# between them to 255. ++# ++# Since: 2.10 ++## ++{ 'struct': 'NumaDistOptions', ++ 'data': { ++ 'src': 'uint16', ++ 'dst': 'uint16', ++ 'val': 'uint8' }} ++ ++## + # @HostMemPolicy: + # + # Host memory policy types +diff --git a/qemu-options.hx b/qemu-options.hx +index b5544ac..2f25547 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -139,12 +139,15 @@ ETEXI + + DEF("numa", HAS_ARG, QEMU_OPTION_numa, + "-numa node[,mem=size][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n" +- "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n", QEMU_ARCH_ALL) ++ "-numa node[,memdev=id][,cpus=firstcpu[-lastcpu]][,nodeid=node]\n" ++ "-numa dist,src=source,dst=destination,val=distance\n", QEMU_ARCH_ALL) + STEXI + @item -numa node[,mem=@var{size}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}] + @itemx -numa node[,memdev=@var{id}][,cpus=@var{firstcpu}[-@var{lastcpu}]][,nodeid=@var{node}] ++@itemx -numa dist,src=@var{source},dst=@var{destination},val=@var{distance} + @findex -numa + Define a NUMA node and assign RAM and VCPUs to it. ++Set the NUMA distance from a source node to a destination node. + + @var{firstcpu} and @var{lastcpu} are CPU indexes. Each + @samp{cpus} option represent a contiguous range of CPU indexes +@@ -167,6 +170,17 @@ split equally between them. + @samp{mem} and @samp{memdev} are mutually exclusive. Furthermore, + if one node uses @samp{memdev}, all of them have to use it. + ++@var{source} and @var{destination} are NUMA node IDs. ++@var{distance} is the NUMA distance from @var{source} to @var{destination}. ++The distance from a node to itself is always 10. If any pair of nodes is ++given a distance, then all pairs must be given distances. Although, when ++distances are only given in one direction for each pair of nodes, then ++the distances in the opposite directions are assumed to be the same. If, ++however, an asymmetrical pair of distances is given for even one node ++pair, then all node pairs must be provided distance values for both ++directions, even when they are symmetrical. When a node is unreachable ++from another node, set the pair's distance to 255. ++ + Note that the -@option{numa} option doesn't allocate any of the + specified resources, it just assigns existing resources to NUMA + nodes. This means that one still has to use the @option{-m}, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pc-Use-min-x-level-on-compat_props-on-RHEL-machine-t.patch b/SOURCES/kvm-pc-Use-min-x-level-on-compat_props-on-RHEL-machine-t.patch new file mode 100644 index 0000000..27c7110 --- /dev/null +++ b/SOURCES/kvm-pc-Use-min-x-level-on-compat_props-on-RHEL-machine-t.patch @@ -0,0 +1,189 @@ +From b4307873bd68ead49bdccdde06c079dcc6a7e3ca Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 6 Jun 2017 13:03:15 +0200 +Subject: [PATCH 14/17] pc: Use "min[x]level" on compat_props on RHEL + machine-types + +RH-Author: Eduardo Habkost +Message-id: <20170606130315.14990-1-ehabkost@redhat.com> +Patchwork-id: 75501 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] pc: Use "min[x]level" on compat_props on RHEL machine-types +Bugzilla: 1454641 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Igor Mammedov + +Since the automatic cpuid-level code was introduced in commit +c39c0edf9bb3b968ba95484465a50c7b19f4aa3a ("target-i386: Automatically +set level/xlevel/xlevel2 when needed"), the CPU model tables just define +the default CPUID level code (set using "min-level"). Setting +"[x]level" forces CPUID level to a specific value and disable the +automatic-level logic. + +However, the PC compat code was not updated and the existing "[x]level" +compat properties broke compatibility for people using features that +triggered the auto-level code. To keep previous behavior, we should set +"min-[x]level" instead of "[x]level" on compat_props. + +This was not a problem for most cases, because old machine-types don't +have full-cpuid-auto-level enabled. The only common use case it broke +was the CPUID[7] auto-level code, that was already enabled since the +first CPUID[7] feature was introduced (in QEMU 1.4.0). + +This causes the regression reported at: +https://bugzilla.redhat.com/show_bug.cgi?id=1454641 + +Change the RHEL compat code to use "min-[x]level" instead of "[x]level" +on compat_props. + +Upstream notes: + +There's an upstream patch in a pending pull request already (1f43571604 +"pc: Use "min-[x]level" on compat_props"), but we don't need it to be +backported because it only touches the upstream machine-types. + +Signed-off-by: Eduardo Habkost +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc_piix.c | 10 +++++----- + include/hw/i386/pc.h | 36 ++++++++++++++++++------------------ + 2 files changed, 23 insertions(+), 23 deletions(-) + +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index 038dda5..a9d4769 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -1354,11 +1354,11 @@ DEFINE_PC_MACHINE(rhel700, "pc-i440fx-rhel7.0.0", pc_init_rhel700, + .value = "off",\ + },{\ + .driver = "qemu32-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0),\ + },{\ + .driver = "486-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(0),\ + },{\ + .driver = "qemu32-" TYPE_X86_CPU,\ +@@ -1684,15 +1684,15 @@ DEFINE_PC_MACHINE(rhel640, "rhel6.4.0", pc_init_rhel640, + #define PC_RHEL6_3_COMPAT \ + {\ + .driver = "Conroe-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(2),\ + },{\ + .driver = "Penryn-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(2),\ + },{\ + .driver = "Nehalem-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(2),\ + },{\ + .driver = "e1000",\ +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index e05d838..3944e40 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -1237,75 +1237,75 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + },\ + { /* PC_RHEL7_1_COMPAT */ \ + .driver = "qemu64" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "kvm64" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(5),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "pentium3" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(2),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "n270" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(5),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Conroe" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Penryn" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ +- .property = "level",\ ++ .property = "min-level",\ + .value = stringify(4),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "n270" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Penryn" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Conroe" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Nehalem" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Westmere" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "SandyBridge" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "IvyBridge" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Haswell" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Haswell-noTSX" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Broadwell" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + },{ /* PC_RHEL7_1_COMPAT */ \ + .driver = "Broadwell-noTSX" "-" TYPE_X86_CPU,\ +- .property = "xlevel",\ ++ .property = "min-xlevel",\ + .value = stringify(0x8000000a),\ + }, + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pc-fwcfg-unbreak-migration-from-qemu-2.5-and-qemu-2..patch b/SOURCES/kvm-pc-fwcfg-unbreak-migration-from-qemu-2.5-and-qemu-2..patch new file mode 100644 index 0000000..757756a --- /dev/null +++ b/SOURCES/kvm-pc-fwcfg-unbreak-migration-from-qemu-2.5-and-qemu-2..patch @@ -0,0 +1,146 @@ +From 3e0f343e05796e009c0cf2b31cf12c59282bcd63 Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Wed, 24 May 2017 07:57:44 +0200 +Subject: [PATCH 2/6] pc/fwcfg: unbreak migration from qemu-2.5 and qemu-2.6 + during firmware boot + +RH-Author: Igor Mammedov +Message-id: <1495612665-46614-2-git-send-email-imammedo@redhat.com> +Patchwork-id: 75405 +O-Subject: [RHEL7.4 qemu-kvm-rhev v2 1/2] pc/fwcfg: unbreak migration from qemu-2.5 and qemu-2.6 during firmware boot +Bugzilla: 1441394 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina + +Since 2.7 commit (b2a575a Add optionrom compatible with fw_cfg DMA version) +regressed migration during firmware exection time by +abusing fwcfg.dma_enabled property to decide loading +dma version of option rom AND by mistake disabling DMA +for 2.6 and earlier globally instead of only for option rom. + +so 2.6 machine type guest is broken when it already runs +firmware in DMA mode but migrated to qemu-2.7(pc-2.6) +at that time; + +a) qemu-2.6:pc2.6 (fwcfg.dma=on,firmware=dma,oprom=ioport) +b) qemu-2.7:pc2.6 (fwcfg.dma=off,firmware=ioport,oprom=ioport) + + to: a b +from +a OK FAIL +b OK OK + +So we currently have broken forward migration from +qemu-2.6 to qemu-2.[789] that however could be fixed +for 2.10 by re-enabling DMA for 2.[56] machine types +and allowing dma capable option rom only since 2.7. +As result qemu should end up with: + +c) qemu-2.10:pc2.6 (fwcfg.dma=on,firmware=dma,oprom=ioport) + + to: a b c +from +a OK FAIL OK +b OK OK OK +c OK FAIL OK + +where forward migration from qemu-2.6 to qemu-2.10 should +work again leaving only qemu-2.[789]:pc-2.6 broken. + +Reported-by: Eduardo Habkost +Analyzed-by: Laszlo Ersek +Signed-off-by: Igor Mammedov +Reviewed-by: Laszlo Ersek +Reviewed-by: Eduardo Habkost +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 98e753a6e51b255d474c4db5e7af8b01633b6a4c) +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc.c | 9 ++++----- + hw/i386/pc_piix.c | 1 + + hw/i386/pc_q35.c | 1 + + include/hw/i386/pc.h | 7 +++---- + 4 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 1a0e672..3596de0 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -1048,12 +1048,10 @@ static void load_linux(PCMachineState *pcms, + fw_cfg_add_i32(fw_cfg, FW_CFG_SETUP_SIZE, setup_size); + fw_cfg_add_bytes(fw_cfg, FW_CFG_SETUP_DATA, setup, setup_size); + +- if (fw_cfg_dma_enabled(fw_cfg)) { ++ option_rom[nb_option_roms].bootindex = 0; ++ option_rom[nb_option_roms].name = "linuxboot.bin"; ++ if (pcmc->linuxboot_dma_enabled && fw_cfg_dma_enabled(fw_cfg)) { + option_rom[nb_option_roms].name = "linuxboot_dma.bin"; +- option_rom[nb_option_roms].bootindex = 0; +- } else { +- option_rom[nb_option_roms].name = "linuxboot.bin"; +- option_rom[nb_option_roms].bootindex = 0; + } + nb_option_roms++; + } +@@ -2327,6 +2325,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data) + * to be used at the moment, 32K should be enough for a while. */ + pcmc->acpi_data_size = 0x20000 + 0x8000; + pcmc->save_tsc_khz = true; ++ pcmc->linuxboot_dma_enabled = true; + mc->get_hotplug_handler = pc_get_hotpug_handler; + mc->cpu_index_to_socket_id = pc_cpu_index_to_socket_id; + mc->possible_cpu_arch_ids = pc_possible_cpu_arch_ids; +diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c +index fa41189..bbdf2a8 100644 +--- a/hw/i386/pc_piix.c ++++ b/hw/i386/pc_piix.c +@@ -476,6 +476,7 @@ static void pc_i440fx_2_6_machine_options(MachineClass *m) + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_i440fx_2_7_machine_options(m); + pcmc->legacy_cpu_hotplug = true; ++ pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_COMPAT_2_6); + } + +diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c +index 23d5f6b..aad1ae7 100644 +--- a/hw/i386/pc_q35.c ++++ b/hw/i386/pc_q35.c +@@ -337,6 +337,7 @@ static void pc_q35_2_6_machine_options(MachineClass *m) + PCMachineClass *pcmc = PC_MACHINE_CLASS(m); + pc_q35_2_7_machine_options(m); + pcmc->legacy_cpu_hotplug = true; ++ pcmc->linuxboot_dma_enabled = false; + SET_MACHINE_COMPAT(m, PC_COMPAT_2_6); + } + +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 62ac914..e05d838 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -151,6 +151,9 @@ struct PCMachineClass { + bool save_tsc_khz; + /* generate legacy CPU hotplug AML */ + bool legacy_cpu_hotplug; ++ ++ /* use DMA capable linuxboot option rom */ ++ bool linuxboot_dma_enabled; + }; + + #define TYPE_PC_MACHINE "generic-pc-machine" +@@ -432,10 +435,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); + #define PC_COMPAT_2_6 \ + HW_COMPAT_2_6 \ + {\ +- .driver = "fw_cfg_io",\ +- .property = "dma_enabled",\ +- .value = "off",\ +- },{\ + .driver = TYPE_X86_CPU,\ + .property = "cpuid-0xb",\ + .value = "off",\ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pegas-add-disable-vhost-user.patch b/SOURCES/kvm-pegas-add-disable-vhost-user.patch new file mode 100644 index 0000000..cab67a6 --- /dev/null +++ b/SOURCES/kvm-pegas-add-disable-vhost-user.patch @@ -0,0 +1,298 @@ +From 398bebe1d3c1feea6e4578b1ce40366ac39f933e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= +Date: Wed, 2 Aug 2017 15:13:18 +0200 +Subject: [PATCH 3/4] pegas: add --disable-vhost-user +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Marc-André Lureau +Message-id: <20170802151319.16790-2-marcandre.lureau@redhat.com> +Patchwork-id: 75884 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH v2 1/2] pegas: add --disable-vhost-user +Bugzilla: 1455269 +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Miroslav Rezanina + +Learn to disable vhost-user for Pegas builds. + +When trying to make a vhost-user netdev, it gives the following error: + +-netdev vhost-user,id=foo,chardev=chr-test: Parameter 'type' expects a netdev backend type + +And similar error with the HMP/QMP monitors. + +Upstream-status: +https://lists.nongnu.org/archive/html/qemu-devel/2017-07/msg09016.html + +Signed-off-by: Marc-André Lureau +Signed-off-by: Miroslav Rezanina +--- + configure | 14 +++++++++++++- + hw/net/vhost_net.c | 10 ++++++++-- + hw/net/virtio-net.c | 4 ++++ + net/Makefile.objs | 3 ++- + net/hub.c | 2 ++ + net/net.c | 4 +++- + qemu-options.hx | 4 ++++ + tests/Makefile.include | 6 +++--- + 8 files changed, 39 insertions(+), 8 deletions(-) + +diff --git a/configure b/configure +index 9f200c2..ca82854 100755 +--- a/configure ++++ b/configure +@@ -227,6 +227,7 @@ xfs="" + vhost_net="no" + vhost_scsi="no" + vhost_vsock="no" ++vhost_user="yes" + kvm="no" + hax="no" + rdma="" +@@ -1204,6 +1205,10 @@ for opt do + ;; + --enable-vtd) vtd="yes" + ;; ++ --disable-vhost-user) vhost_user="no" ++ ;; ++ --enable-vhost-user) vhost_user="yes" ++ ;; + *) + echo "ERROR: unknown option $opt" + echo "Try '$0 --help' for more information" +@@ -1452,6 +1457,7 @@ disabled with --disable-FEATURE, default is enabled if available: + tools build qemu-io, qemu-nbd and qemu-image tools + vxhs Veritas HyperScale vDisk backend support + vtd Emulated VT-d support (only affects x86 targets) ++ vhost-user vhost-user support + + NOTE: The object files are built at the place where configure is launched + EOF +@@ -5135,6 +5141,7 @@ echo "libcap-ng support $cap_ng" + echo "vhost-net support $vhost_net" + echo "vhost-scsi support $vhost_scsi" + echo "vhost-vsock support $vhost_vsock" ++echo "vhost-user support $vhost_user" + echo "Trace backends $trace_backends" + if have_backend "simple"; then + echo "Trace output file $trace_file-" +@@ -5557,6 +5564,9 @@ fi + if test "$vhost_vsock" = "yes" ; then + echo "CONFIG_VHOST_VSOCK=y" >> $config_host_mak + fi ++if test "$vhost_user" = "yes" ; then ++ echo "CONFIG_VHOST_USER=y" >> $config_host_mak ++fi + if test "$blobs" = "yes" ; then + echo "INSTALL_BLOBS=yes" >> $config_host_mak + fi +@@ -6159,7 +6169,9 @@ case "$target_name" in + echo "CONFIG_KVM=y" >> $config_target_mak + if test "$vhost_net" = "yes" ; then + echo "CONFIG_VHOST_NET=y" >> $config_target_mak +- echo "CONFIG_VHOST_NET_TEST_$target_name=y" >> $config_host_mak ++ if test "$vhost_user" = "yes" ; then ++ echo "CONFIG_VHOST_USER_TEST_$target_name=y" >> $config_host_mak ++ fi + fi + fi + esac +diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c +index e037db6..40438a8 100644 +--- a/hw/net/vhost_net.c ++++ b/hw/net/vhost_net.c +@@ -95,9 +95,11 @@ static const int *vhost_net_get_feature_bits(struct vhost_net *net) + case NET_CLIENT_DRIVER_TAP: + feature_bits = kernel_feature_bits; + break; ++#ifdef CONFIG_VHOST_USER + case NET_CLIENT_DRIVER_VHOST_USER: + feature_bits = user_feature_bits; + break; ++#endif + default: + error_report("Feature bits not defined for this type: %d", + net->nc->info->type); +@@ -193,6 +195,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) + } + } + ++#ifdef CONFIG_VHOST_USER + /* Set sane init value. Override when guest acks. */ + if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) { + features = vhost_user_get_acked_features(net->nc); +@@ -203,7 +206,7 @@ struct vhost_net *vhost_net_init(VhostNetOptions *options) + goto fail; + } + } +- ++#endif + vhost_net_ack_features(net, features); + + return net; +@@ -309,6 +312,7 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, + net = get_vhost_net(ncs[i].peer); + vhost_net_set_vq_index(net, i * 2); + ++#ifdef CONFIG_VHOST_USER + /* Suppress the masking guest notifiers on vhost user + * because vhost user doesn't interrupt masking/unmasking + * properly. +@@ -316,8 +320,8 @@ int vhost_net_start(VirtIODevice *dev, NetClientState *ncs, + if (net->nc->info->type == NET_CLIENT_DRIVER_VHOST_USER) { + dev->use_guest_notifier_mask = false; + } ++#endif + } +- + r = k->set_guest_notifiers(qbus->parent, total_queues * 2, true); + if (r < 0) { + error_report("Error binding guest notifier: %d", -r); +@@ -414,10 +418,12 @@ VHostNetState *get_vhost_net(NetClientState *nc) + case NET_CLIENT_DRIVER_TAP: + vhost_net = tap_get_vhost_net(nc); + break; ++#ifdef CONFIG_VHOST_USER + case NET_CLIENT_DRIVER_VHOST_USER: + vhost_net = vhost_user_get_vhost_net(nc); + assert(vhost_net); + break; ++#endif + default: + break; + } +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 39c336e..9f61432 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -502,9 +502,11 @@ static int peer_attach(VirtIONet *n, int index) + return 0; + } + ++#ifdef CONFIG_VHOST_USER + if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER) { + vhost_set_vring_enable(nc->peer, 1); + } ++#endif + + if (nc->peer->info->type != NET_CLIENT_DRIVER_TAP) { + return 0; +@@ -525,9 +527,11 @@ static int peer_detach(VirtIONet *n, int index) + return 0; + } + ++#ifdef CONFIG_VHOST_USER + if (nc->peer->info->type == NET_CLIENT_DRIVER_VHOST_USER) { + vhost_set_vring_enable(nc->peer, 0); + } ++#endif + + if (nc->peer->info->type != NET_CLIENT_DRIVER_TAP) { + return 0; +diff --git a/net/Makefile.objs b/net/Makefile.objs +index 2e2fd43..a8f6556 100644 +--- a/net/Makefile.objs ++++ b/net/Makefile.objs +@@ -3,7 +3,8 @@ common-obj-y += socket.o + common-obj-y += dump.o + common-obj-y += eth.o + common-obj-$(CONFIG_L2TPV3) += l2tpv3.o +-common-obj-$(CONFIG_POSIX) += tap.o vhost-user.o ++common-obj-$(CONFIG_POSIX) += tap.o ++common-obj-$(CONFIG_VHOST_USER) += vhost-user.o + common-obj-$(CONFIG_LINUX) += tap-linux.o + common-obj-$(CONFIG_WIN32) += tap-win32.o + common-obj-$(CONFIG_BSD) += tap-bsd.o +diff --git a/net/hub.c b/net/hub.c +index 32d8cf5..ec06275 100644 +--- a/net/hub.c ++++ b/net/hub.c +@@ -322,7 +322,9 @@ void net_hub_check_clients(void) + case NET_CLIENT_DRIVER_TAP: + case NET_CLIENT_DRIVER_SOCKET: + case NET_CLIENT_DRIVER_VDE: ++#ifdef CONFIG_VHOST_USER + case NET_CLIENT_DRIVER_VHOST_USER: ++#endif + has_host_dev = 1; + break; + default: +diff --git a/net/net.c b/net/net.c +index 0ac3b9e..4da90c1 100644 +--- a/net/net.c ++++ b/net/net.c +@@ -955,7 +955,7 @@ static int (* const net_client_init_fun[NET_CLIENT_DRIVER__MAX])( + [NET_CLIENT_DRIVER_BRIDGE] = net_init_bridge, + #endif + [NET_CLIENT_DRIVER_HUBPORT] = net_init_hubport, +-#ifdef CONFIG_VHOST_NET_USED ++#if defined(CONFIG_VHOST_NET_USED) && defined(CONFIG_VHOST_USER) + [NET_CLIENT_DRIVER_VHOST_USER] = net_init_vhost_user, + #endif + #ifdef CONFIG_L2TPV3 +@@ -1031,10 +1031,12 @@ static int net_client_init1(const void *object, bool is_netdev, Error **errp) + legacy.type = NET_CLIENT_DRIVER_NETMAP; + legacy.u.netmap = opts->u.netmap; + break; ++#ifdef CONFIG_VHOST_USER + case NET_LEGACY_OPTIONS_TYPE_VHOST_USER: + legacy.type = NET_CLIENT_DRIVER_VHOST_USER; + legacy.u.vhost_user = opts->u.vhost_user; + break; ++#endif + default: + abort(); + } +diff --git a/qemu-options.hx b/qemu-options.hx +index 2f25547..30b6256 100644 +--- a/qemu-options.hx ++++ b/qemu-options.hx +@@ -1741,8 +1741,10 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev, + " VALE port (created on the fly) called 'name' ('nmname' is name of the \n" + " netmap device, defaults to '/dev/netmap')\n" + #endif ++#ifdef CONFIG_VHOST_USER + "-netdev vhost-user,id=str,chardev=dev[,vhostforce=on|off]\n" + " configure a vhost-user network, backed by a chardev 'dev'\n" ++#endif + "-netdev hubport,id=str,hubid=n\n" + " configure a hub port on QEMU VLAN 'n'\n", QEMU_ARCH_ALL) + DEF("net", HAS_ARG, QEMU_OPTION_net, +@@ -2175,6 +2177,7 @@ The hubport netdev lets you connect a NIC to a QEMU "vlan" instead of a single + netdev. @code{-net} and @code{-device} with parameter @option{vlan} create the + required hub automatically. + ++#ifdef CONFIG_VHOST_USER + @item -netdev vhost-user,chardev=@var{id}[,vhostforce=on|off][,queues=n] + + Establish a vhost-user netdev, backed by a chardev @var{id}. The chardev should +@@ -2192,6 +2195,7 @@ qemu-kvm -m 512 -object memory-backend-file,id=mem,size=512M,mem-path=/hugetlbfs + -netdev type=vhost-user,id=net0,chardev=chr0 \ + -device virtio-net-pci,netdev=net0 + @end example ++#endif + + @item -net dump[,vlan=@var{n}][,file=@var{file}][,len=@var{len}] + Dump network traffic on VLAN @var{n} to file @var{file} (@file{qemu-vlan0.pcap} by default). +diff --git a/tests/Makefile.include b/tests/Makefile.include +index 0b94a20..3e3870f 100644 +--- a/tests/Makefile.include ++++ b/tests/Makefile.include +@@ -230,9 +230,9 @@ gcov-files-i386-y += hw/usb/hcd-xhci.c + check-qtest-i386-y += tests/pc-cpu-test$(EXESUF) + check-qtest-i386-y += tests/q35-test$(EXESUF) + gcov-files-i386-y += hw/pci-host/q35.c +-check-qtest-i386-$(CONFIG_VHOST_NET_TEST_i386) += tests/vhost-user-test$(EXESUF) +-ifeq ($(CONFIG_VHOST_NET_TEST_i386),) +-check-qtest-x86_64-$(CONFIG_VHOST_NET_TEST_x86_64) += tests/vhost-user-test$(EXESUF) ++check-qtest-i386-$(CONFIG_VHOST_USER_TEST_i386) += tests/vhost-user-test$(EXESUF) ++ifeq ($(CONFIG_VHOST_USER_TEST_i386),) ++check-qtest-x86_64-$(CONFIG_VHOST_USER_TEST_x86_64) += tests/vhost-user-test$(EXESUF) + endif + check-qtest-i386-y += tests/test-netfilter$(EXESUF) + check-qtest-i386-y += tests/test-filter-mirror$(EXESUF) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-postcopy-Require-RAMBlocks-that-are-whole-pages.patch b/SOURCES/kvm-postcopy-Require-RAMBlocks-that-are-whole-pages.patch new file mode 100644 index 0000000..b7d5137 --- /dev/null +++ b/SOURCES/kvm-postcopy-Require-RAMBlocks-that-are-whole-pages.patch @@ -0,0 +1,75 @@ +From 79e13ab8c86fc0a78ad396f0b88635d88e8ce103 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Thu, 18 May 2017 11:17:27 +0200 +Subject: [PATCH 20/27] postcopy: Require RAMBlocks that are whole pages + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170518111727.7433-3-dgilbert@redhat.com> +Patchwork-id: 75315 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 2/2] postcopy: Require RAMBlocks that are whole pages +Bugzilla: 1449037 +RH-Acked-by: Juan Quintela +RH-Acked-by: Peter Xu +RH-Acked-by: Laszlo Ersek + +From: "Dr. David Alan Gilbert" + +It turns out that it's legal to create a VM with RAMBlocks that aren't +a multiple of the pagesize in use; e.g. a 1025M main memory using +2M host pages. That breaks postcopy's atomic placement of pages, +so disallow it. + +Signed-off-by: Dr. David Alan Gilbert + +Upstream URL: +http://lists.nongnu.org/archive/html/qemu-devel/2017-05/msg04393.html +Upstream Message-Id: <20170518172453.32599-3-quintela@redhat.com> + +Signed-off-by: Miroslav Rezanina +--- + migration/postcopy-ram.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c +index dc80dbb..46d5a83 100644 +--- a/migration/postcopy-ram.c ++++ b/migration/postcopy-ram.c +@@ -97,14 +97,24 @@ static bool ufd_version_check(int ufd) + + /* Callback from postcopy_ram_supported_by_host block iterator. + */ +-static int test_range_shared(const char *block_name, void *host_addr, ++static int test_ramblock_postcopiable(const char *block_name, void *host_addr, + ram_addr_t offset, ram_addr_t length, void *opaque) + { +- if (qemu_ram_is_shared(qemu_ram_block_by_name(block_name))) { ++ RAMBlock *rb = qemu_ram_block_by_name(block_name); ++ size_t pagesize = qemu_ram_pagesize(rb); ++ ++ if (qemu_ram_is_shared(rb)) { + error_report("Postcopy on shared RAM (%s) is not yet supported", + block_name); + return 1; + } ++ ++ if (length % pagesize) { ++ error_report("Postcopy requires RAM blocks to be a page size multiple," ++ " block %s is 0x" RAM_ADDR_FMT " bytes with a " ++ "page size of 0x%zx", block_name, length, pagesize); ++ return 1; ++ } + return 0; + } + +@@ -141,7 +151,7 @@ bool postcopy_ram_supported_by_host(void) + } + + /* We don't support postcopy with shared RAM yet */ +- if (qemu_ram_foreach_block(test_range_shared, NULL)) { ++ if (qemu_ram_foreach_block(test_ramblock_postcopiable, NULL)) { + goto out; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-ppc-kvm-have-the-family-CPU-alias-to-point-to-TYPE_H.patch b/SOURCES/kvm-ppc-kvm-have-the-family-CPU-alias-to-point-to-TYPE_H.patch new file mode 100644 index 0000000..9cb0e6c --- /dev/null +++ b/SOURCES/kvm-ppc-kvm-have-the-family-CPU-alias-to-point-to-TYPE_H.patch @@ -0,0 +1,79 @@ +From cc60fde1ea12ad942713d0c78f8b7c94df64229b Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Wed, 12 Jul 2017 07:45:34 +0200 +Subject: [PATCH 1/6] ppc/kvm: have the "family" CPU alias to point to + TYPE_HOST_POWERPC_CPU + +RH-Author: Laurent Vivier +Message-id: <20170712074534.19224-1-lvivier@redhat.com> +Patchwork-id: 75735 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] ppc/kvm: have the "family" CPU alias to point to TYPE_HOST_POWERPC_CPU +Bugzilla: 1460908 +RH-Acked-by: Thomas Huth +RH-Acked-by: David Gibson +RH-Acked-by: Miroslav Rezanina + +From: Greg Kurz + +When running KVM on POWER, we allow the user to pass "-cpu POWERx" instead +of "-cpu host". This is achieved by patching the ppc_cpu_aliases[] array +so that "POWERx" points to the CPU class with the same PVR as the host CPU. +This causes CPUs to be instantiated from this CPU class instead of the +TYPE_HOST_POWERPC_CPU class which is used with "-cpu host". These CPUs thus +miss all the KVM specific tuning from kvmppc_host_cpu_class_init(). + +This currently causes QEMU with "-cpu POWER9" to fail when running KVM on a +POWER9 DD1 host: + +qemu-system-ppc64: Register sync failed... If you're using kvm-hv.ko, only + "-cpu host" is possible +kvm_init_vcpu failed: Invalid argument + +Let's have the "POWERx" alias to point to TYPE_HOST_POWERPC_CPU directly, +so that "-cpu POWERx" instantiates CPUs from the same class as "-cpu host". + +Signed-off-by: Greg Kurz +Tested-by: Laurent Vivier +Reviewed-by: Laurent Vivier +Reviewed-by: Thomas Huth +Signed-off-by: David Gibson +(cherry picked from commit 92e926e1e37aea7e1632535b6611ed4f62414af1) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + target/ppc/kvm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 1765204..9eb85ae 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -2448,6 +2448,7 @@ static int kvm_ppc_register_host_cpu_type(void) + .class_init = kvmppc_host_cpu_class_init, + }; + PowerPCCPUClass *pvr_pcc; ++ ObjectClass *oc; + DeviceClass *dc; + int i; + +@@ -2458,6 +2459,9 @@ static int kvm_ppc_register_host_cpu_type(void) + type_info.parent = object_class_get_name(OBJECT_CLASS(pvr_pcc)); + type_register(&type_info); + ++ oc = object_class_by_name(type_info.name); ++ g_assert(oc); ++ + #if defined(TARGET_PPC64) + type_info.name = g_strdup_printf("%s-"TYPE_SPAPR_CPU_CORE, "host"); + type_info.parent = TYPE_SPAPR_CPU_CORE, +@@ -2477,7 +2481,6 @@ static int kvm_ppc_register_host_cpu_type(void) + dc = DEVICE_CLASS(ppc_cpu_get_family_class(pvr_pcc)); + for (i = 0; ppc_cpu_aliases[i].alias != NULL; i++) { + if (strcmp(ppc_cpu_aliases[i].alias, dc->desc) == 0) { +- ObjectClass *oc = OBJECT_CLASS(pvr_pcc); + char *suffix; + + ppc_cpu_aliases[i].model = g_strdup(object_class_get_name(oc)); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-ppc64le-Remove-isabus-bridge-device.patch b/SOURCES/kvm-ppc64le-Remove-isabus-bridge-device.patch new file mode 100644 index 0000000..749bac5 --- /dev/null +++ b/SOURCES/kvm-ppc64le-Remove-isabus-bridge-device.patch @@ -0,0 +1,39 @@ +From 2a11896e90f34233860d9345c7e1ec27618a0c57 Mon Sep 17 00:00:00 2001 +From: Miroslav Rezanina +Date: Thu, 27 Apr 2017 03:53:30 +0200 +Subject: [PATCH 04/23] ppc64le: Remove isabus-bridge device + +RH-Author: Miroslav Rezanina +Message-id: <20170427035330.6956-1-mrezanin@redhat.com> +Patchwork-id: 74921 +O-Subject: [RHV 7.4 qemu-kvm-rhev PATCH 4/3] ppc64le: Remove isabus-bridge device +Bugzilla: 1443029 +RH-Acked-by: Markus Armbruster +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth + +From: Miroslav Rezanina + +We miss isabus-bridge on one of our previews rebase for RHEL 7.4. This device +is not used by our supported machine types so we are going to disable it. + +Signed-off-by: Miroslav Rezanina +--- + default-configs/ppc64-softmmu.mak | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-softmmu.mak +index f711f44..9f95653 100644 +--- a/default-configs/ppc64-softmmu.mak ++++ b/default-configs/ppc64-softmmu.mak +@@ -7,7 +7,6 @@ CONFIG_VIRTIO=y + CONFIG_USB_XHCI=y + CONFIG_WDT_IB6300ESB=y + CONFIG_PCI_TESTDEV=y +-CONFIG_ISA_BUS=y + + include sound.mak + include usb.mak +-- +1.8.3.1 + diff --git a/SOURCES/kvm-pseries-Correct-panic-behaviour-for-pseries-machine-.patch b/SOURCES/kvm-pseries-Correct-panic-behaviour-for-pseries-machine-.patch new file mode 100644 index 0000000..c86c699 --- /dev/null +++ b/SOURCES/kvm-pseries-Correct-panic-behaviour-for-pseries-machine-.patch @@ -0,0 +1,63 @@ +From a905024791a3cece2edfe84e99944cd3b7226bae Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 14 Jun 2017 02:59:50 +0200 +Subject: [PATCH 1/8] pseries: Correct panic behaviour for pseries machine type + +RH-Author: David Gibson +Message-id: <20170614025950.24275-1-dgibson@redhat.com> +Patchwork-id: 75601 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] pseries: Correct panic behaviour for pseries machine type +Bugzilla: 1458705 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth +RH-Acked-by: Laszlo Ersek + +From: David Gibson + +The pseries machine type doesn't usually use the 'pvpanic' device as such, +because it has a firmware/hypervisor facility with roughly the same +purpose. The 'ibm,os-term' RTAS call notifies the hypervisor that the +guest has crashed. + +Our implementation of this call was sending a GUEST_PANICKED qmp event; +however, it was not doing the other usual panic actions, making its +behaviour different from pvpanic for no good reason. + +To correct this, we should call qemu_system_guest_panicked() rather than +directly sending the panic event. + +Signed-off-by: David Gibson +Reviewed-by: Thomas Huth +(cherry picked from commit 2c5534776b375bbaff3896420e41cb981d40e2bc) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1458705 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13420539 + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_rtas.c | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c +index 128d993..fb56ca6 100644 +--- a/hw/ppc/spapr_rtas.c ++++ b/hw/ppc/spapr_rtas.c +@@ -332,12 +332,9 @@ static void rtas_ibm_os_term(PowerPCCPU *cpu, + target_ulong args, + uint32_t nret, target_ulong rets) + { +- target_ulong ret = 0; ++ qemu_system_guest_panicked(NULL); + +- qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_PAUSE, false, NULL, +- &error_abort); +- +- rtas_st(rets, 0, ret); ++ rtas_st(rets, 0, RTAS_OUT_SUCCESS); + } + + static void rtas_set_power_level(PowerPCCPU *cpu, sPAPRMachineState *spapr, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-img-wait-for-convert-coroutines-to-complete.patch b/SOURCES/kvm-qemu-img-wait-for-convert-coroutines-to-complete.patch new file mode 100644 index 0000000..dd4eee2 --- /dev/null +++ b/SOURCES/kvm-qemu-img-wait-for-convert-coroutines-to-complete.patch @@ -0,0 +1,111 @@ +From 02e6c183afd2203aaf1910a0150e54cf1c8efa3e Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Fri, 26 May 2017 15:28:54 +0200 +Subject: [PATCH 5/6] qemu-img: wait for convert coroutines to complete + +RH-Author: Kevin Wolf +Message-id: <1495812534-25595-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75425 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] qemu-img: wait for convert coroutines to complete +Bugzilla: 1451849 +RH-Acked-by: Max Reitz +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Paolo Bonzini + +From: Anton Nefedov + +On error path (like i/o error in one of the coroutines), it's required to + - wait for coroutines completion before cleaning the common structures + - reenter dependent coroutines so they ever finish + +Introduced in 2d9187bc65. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Anton Nefedov +Reviewed-by: Peter Lieven +Signed-off-by: Kevin Wolf +(cherry picked from commit b91127edd0ff96f27f1e58e47f4e9f9d6a0fed02) +Signed-off-by: Miroslav Rezanina +--- + qemu-img.c | 26 +++++++++++--------------- + 1 file changed, 11 insertions(+), 15 deletions(-) + +diff --git a/qemu-img.c b/qemu-img.c +index 37c2894..53d0bf1 100644 +--- a/qemu-img.c ++++ b/qemu-img.c +@@ -1761,13 +1761,13 @@ static void coroutine_fn convert_co_do_copy(void *opaque) + qemu_co_mutex_lock(&s->lock); + if (s->ret != -EINPROGRESS || s->sector_num >= s->total_sectors) { + qemu_co_mutex_unlock(&s->lock); +- goto out; ++ break; + } + n = convert_iteration_sectors(s, s->sector_num); + if (n < 0) { + qemu_co_mutex_unlock(&s->lock); + s->ret = n; +- goto out; ++ break; + } + /* save current sector and allocation status to local variables */ + sector_num = s->sector_num; +@@ -1792,7 +1792,6 @@ static void coroutine_fn convert_co_do_copy(void *opaque) + error_report("error while reading sector %" PRId64 + ": %s", sector_num, strerror(-ret)); + s->ret = ret; +- goto out; + } + } else if (!s->min_sparse && status == BLK_ZERO) { + status = BLK_DATA; +@@ -1801,22 +1800,20 @@ static void coroutine_fn convert_co_do_copy(void *opaque) + + if (s->wr_in_order) { + /* keep writes in order */ +- while (s->wr_offs != sector_num) { +- if (s->ret != -EINPROGRESS) { +- goto out; +- } ++ while (s->wr_offs != sector_num && s->ret == -EINPROGRESS) { + s->wait_sector_num[index] = sector_num; + qemu_coroutine_yield(); + } + s->wait_sector_num[index] = -1; + } + +- ret = convert_co_write(s, sector_num, n, buf, status); +- if (ret < 0) { +- error_report("error while writing sector %" PRId64 +- ": %s", sector_num, strerror(-ret)); +- s->ret = ret; +- goto out; ++ if (s->ret == -EINPROGRESS) { ++ ret = convert_co_write(s, sector_num, n, buf, status); ++ if (ret < 0) { ++ error_report("error while writing sector %" PRId64 ++ ": %s", sector_num, strerror(-ret)); ++ s->ret = ret; ++ } + } + + if (s->wr_in_order) { +@@ -1837,7 +1834,6 @@ static void coroutine_fn convert_co_do_copy(void *opaque) + } + } + +-out: + qemu_vfree(buf); + s->co[index] = NULL; + s->running_coroutines--; +@@ -1899,7 +1895,7 @@ static int convert_do_copy(ImgConvertState *s) + qemu_coroutine_enter(s->co[i]); + } + +- while (s->ret == -EINPROGRESS) { ++ while (s->running_coroutines) { + main_loop_wait(false); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-Allow-starting-new-qemu-after-cleanup.patch b/SOURCES/kvm-qemu-iotests-Allow-starting-new-qemu-after-cleanup.patch new file mode 100644 index 0000000..1f27961 --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-Allow-starting-new-qemu-after-cleanup.patch @@ -0,0 +1,46 @@ +From d827ddd72436b79c2fcc437020de2024a2fa2508 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jun 2017 13:33:34 +0200 +Subject: [PATCH 08/13] qemu-iotests: Allow starting new qemu after cleanup + +RH-Author: Kevin Wolf +Message-id: <1497274415-4884-3-git-send-email-kwolf@redhat.com> +Patchwork-id: 75587 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 2/3] qemu-iotests: Allow starting new qemu after cleanup +Bugzilla: 1453169 +RH-Acked-by: Max Reitz +RH-Acked-by: Jeffrey Cody +RH-Acked-by: John Snow + +After _cleanup_qemu(), test cases should be able to start the next qemu +process and call _cleanup_qemu() for that one as well. For this to work +cleanly, we need to improve the cleanup so that the second invocation +doesn't try to kill the qemu instances from the first invocation a +second time (which would result in error messages). + +Upstream status: Applied to git://repo.or.cz/qemu/kevin.git block +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake +Reviewed-by: Max Reitz + +Signed-off-by: Miroslav Rezanina +--- + tests/qemu-iotests/common.qemu | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/tests/qemu-iotests/common.qemu b/tests/qemu-iotests/common.qemu +index 4278789..44a2c19 100644 +--- a/tests/qemu-iotests/common.qemu ++++ b/tests/qemu-iotests/common.qemu +@@ -222,5 +222,8 @@ function _cleanup_qemu() + rm -f "${QEMU_FIFO_IN}_${i}" "${QEMU_FIFO_OUT}_${i}" + eval "exec ${QEMU_IN[$i]}<&-" # close file descriptors + eval "exec ${QEMU_OUT[$i]}<&-" ++ ++ unset QEMU_IN[$i] ++ unset QEMU_OUT[$i] + done + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-Test-automatic-commit-job-cancel-on-hot.patch b/SOURCES/kvm-qemu-iotests-Test-automatic-commit-job-cancel-on-hot.patch new file mode 100644 index 0000000..c8de6f4 --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-Test-automatic-commit-job-cancel-on-hot.patch @@ -0,0 +1,99 @@ +From 40370c5bbdba27f7926e9cd7a55270249c06162b Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jun 2017 13:03:42 +0200 +Subject: [PATCH 06/13] qemu-iotests: Test automatic commit job cancel on hot + unplug + +RH-Author: Kevin Wolf +Message-id: <1497272622-32221-3-git-send-email-kwolf@redhat.com> +Patchwork-id: 75584 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 2/2] qemu-iotests: Test automatic commit job cancel on hot unplug +Bugzilla: 1452048 +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +Signed-off-by: Kevin Wolf +Reviewed-by: John Snow +(cherry picked from commit c3971b883a596abc6af45f53d2f43fb2f59ccd3b) +Signed-off-by: Miroslav Rezanina +--- + tests/qemu-iotests/040 | 35 +++++++++++++++++++++++++++++++++-- + tests/qemu-iotests/040.out | 4 ++-- + 2 files changed, 35 insertions(+), 4 deletions(-) + +diff --git a/tests/qemu-iotests/040 b/tests/qemu-iotests/040 +index 5bdaf3d..9d381d9 100755 +--- a/tests/qemu-iotests/040 ++++ b/tests/qemu-iotests/040 +@@ -70,7 +70,9 @@ class ImageCommitTestCase(iotests.QMPTestCase): + self.wait_for_complete() + + class TestSingleDrive(ImageCommitTestCase): +- image_len = 1 * 1024 * 1024 ++ # Need some space after the copied data so that throttling is effective in ++ # tests that use it rather than just completing the job immediately ++ image_len = 2 * 1024 * 1024 + test_len = 1 * 1024 * 256 + + def setUp(self): +@@ -79,7 +81,9 @@ class TestSingleDrive(ImageCommitTestCase): + qemu_img('create', '-f', iotests.imgfmt, '-o', 'backing_file=%s' % mid_img, test_img) + qemu_io('-f', 'raw', '-c', 'write -P 0xab 0 524288', backing_img) + qemu_io('-f', iotests.imgfmt, '-c', 'write -P 0xef 524288 524288', mid_img) +- self.vm = iotests.VM().add_drive(test_img) ++ self.vm = iotests.VM().add_drive(test_img, interface="none") ++ self.vm.add_device("virtio-scsi-pci") ++ self.vm.add_device("scsi-hd,id=scsi0,drive=drive0") + self.vm.launch() + + def tearDown(self): +@@ -131,6 +135,33 @@ class TestSingleDrive(ImageCommitTestCase): + self.assert_qmp(result, 'error/class', 'GenericError') + self.assert_qmp(result, 'error/desc', 'Base \'%s\' not found' % mid_img) + ++ # When the job is running on a BB that is automatically deleted on hot ++ # unplug, the job is cancelled when the device disappears ++ def test_hot_unplug(self): ++ if self.image_len == 0: ++ return ++ ++ self.assert_no_active_block_jobs() ++ result = self.vm.qmp('block-commit', device='drive0', top=mid_img, ++ base=backing_img, speed=(self.image_len / 4)) ++ self.assert_qmp(result, 'return', {}) ++ result = self.vm.qmp('device_del', id='scsi0') ++ self.assert_qmp(result, 'return', {}) ++ ++ cancelled = False ++ deleted = False ++ while not cancelled or not deleted: ++ for event in self.vm.get_qmp_events(wait=True): ++ if event['event'] == 'DEVICE_DELETED': ++ self.assert_qmp(event, 'data/device', 'scsi0') ++ deleted = True ++ elif event['event'] == 'BLOCK_JOB_CANCELLED': ++ self.assert_qmp(event, 'data/device', 'drive0') ++ cancelled = True ++ else: ++ self.fail("Unexpected event %s" % (event['event'])) ++ ++ self.assert_no_active_block_jobs() + + class TestRelativePaths(ImageCommitTestCase): + image_len = 1 * 1024 * 1024 +diff --git a/tests/qemu-iotests/040.out b/tests/qemu-iotests/040.out +index 4fd1c2d..6d9bee1 100644 +--- a/tests/qemu-iotests/040.out ++++ b/tests/qemu-iotests/040.out +@@ -1,5 +1,5 @@ +-......................... ++........................... + ---------------------------------------------------------------------- +-Ran 25 tests ++Ran 27 tests + + OK +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-Test-exiting-qemu-with-running-job.patch b/SOURCES/kvm-qemu-iotests-Test-exiting-qemu-with-running-job.patch new file mode 100644 index 0000000..ff32100 --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-Test-exiting-qemu-with-running-job.patch @@ -0,0 +1,323 @@ +From 5fbd54010b1e735b762e315c6817fb46e45611b2 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Mon, 12 Jun 2017 13:33:35 +0200 +Subject: [PATCH 09/13] qemu-iotests: Test exiting qemu with running job + +RH-Author: Kevin Wolf +Message-id: <1497274415-4884-4-git-send-email-kwolf@redhat.com> +Patchwork-id: 75589 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 3/3] qemu-iotests: Test exiting qemu with running job +Bugzilla: 1453169 +RH-Acked-by: Max Reitz +RH-Acked-by: Jeffrey Cody +RH-Acked-by: John Snow + +When qemu is exited, all running jobs should be cancelled successfully. +This adds a test for this for all types of block jobs that currently +exist in qemu. + +Upstream status: Applied to git://repo.or.cz/qemu/kevin.git block +Signed-off-by: Kevin Wolf +Reviewed-by: Eric Blake + +Signed-off-by: Miroslav Rezanina + +Conflicts: + tests/qemu-iotests/group +--- + tests/qemu-iotests/185 | 206 +++++++++++++++++++++++++++++++++++++++++++++ + tests/qemu-iotests/185.out | 59 +++++++++++++ + tests/qemu-iotests/group | 1 + + 3 files changed, 266 insertions(+) + create mode 100755 tests/qemu-iotests/185 + create mode 100644 tests/qemu-iotests/185.out + +diff --git a/tests/qemu-iotests/185 b/tests/qemu-iotests/185 +new file mode 100755 +index 0000000..0eda371 +--- /dev/null ++++ b/tests/qemu-iotests/185 +@@ -0,0 +1,206 @@ ++#!/bin/bash ++# ++# Test exiting qemu while jobs are still running ++# ++# Copyright (C) 2017 Red Hat, Inc. ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++# ++ ++# creator ++owner=kwolf@redhat.com ++ ++seq=`basename $0` ++echo "QA output created by $seq" ++ ++here=`pwd` ++status=1 # failure is the default! ++ ++MIG_SOCKET="${TEST_DIR}/migrate" ++ ++_cleanup() ++{ ++ rm -f "${TEST_IMG}.mid" ++ rm -f "${TEST_IMG}.copy" ++ _cleanup_test_img ++ _cleanup_qemu ++} ++trap "_cleanup; exit \$status" 0 1 2 3 15 ++ ++# get standard environment, filters and checks ++. ./common.rc ++. ./common.filter ++. ./common.qemu ++ ++_supported_fmt qcow2 ++_supported_proto file ++_supported_os Linux ++ ++size=64M ++TEST_IMG="${TEST_IMG}.base" _make_test_img $size ++ ++echo ++echo === Starting VM === ++echo ++ ++qemu_comm_method="qmp" ++ ++_launch_qemu \ ++ -drive file="${TEST_IMG}.base",cache=$CACHEMODE,driver=$IMGFMT,id=disk ++h=$QEMU_HANDLE ++_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return' ++ ++echo ++echo === Creating backing chain === ++echo ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'blockdev-snapshot-sync', ++ 'arguments': { 'device': 'disk', ++ 'snapshot-file': '$TEST_IMG.mid', ++ 'format': '$IMGFMT', ++ 'mode': 'absolute-paths' } }" \ ++ "return" ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'human-monitor-command', ++ 'arguments': { 'command-line': ++ 'qemu-io disk \"write 0 4M\"' } }" \ ++ "return" ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'blockdev-snapshot-sync', ++ 'arguments': { 'device': 'disk', ++ 'snapshot-file': '$TEST_IMG', ++ 'format': '$IMGFMT', ++ 'mode': 'absolute-paths' } }" \ ++ "return" ++ ++echo ++echo === Start commit job and exit qemu === ++echo ++ ++# Note that the reference output intentionally includes the 'offset' field in ++# BLOCK_JOB_CANCELLED events for all of the following block jobs. They are ++# predictable and any change in the offsets would hint at a bug in the job ++# throttling code. ++# ++# In order to achieve these predictable offsets, all of the following tests ++# use speed=65536. Each job will perform exactly one iteration before it has ++# to sleep at least for a second, which is plenty of time for the 'quit' QMP ++# command to be received (after receiving the command, the rest runs ++# synchronously, so jobs can arbitrarily continue or complete). ++# ++# The buffer size for commit and streaming is 512k (waiting for 8 seconds after ++# the first request), for active commit and mirror it's large enough to cover ++# the full 4M, and for backup it's the qcow2 cluster size, which we know is ++# 64k. As all of these are at least as large as the speed, we are sure that the ++# offset doesn't advance after the first iteration before qemu exits. ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'block-commit', ++ 'arguments': { 'device': 'disk', ++ 'base':'$TEST_IMG.base', ++ 'top': '$TEST_IMG.mid', ++ 'speed': 65536 } }" \ ++ "return" ++ ++_send_qemu_cmd $h "{ 'execute': 'quit' }" "return" ++wait=1 _cleanup_qemu ++ ++echo ++echo === Start active commit job and exit qemu === ++echo ++ ++_launch_qemu \ ++ -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk ++h=$QEMU_HANDLE ++_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return' ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'block-commit', ++ 'arguments': { 'device': 'disk', ++ 'base':'$TEST_IMG.base', ++ 'speed': 65536 } }" \ ++ "return" ++ ++_send_qemu_cmd $h "{ 'execute': 'quit' }" "return" ++wait=1 _cleanup_qemu ++ ++echo ++echo === Start mirror job and exit qemu === ++echo ++ ++_launch_qemu \ ++ -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk ++h=$QEMU_HANDLE ++_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return' ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'drive-mirror', ++ 'arguments': { 'device': 'disk', ++ 'target': '$TEST_IMG.copy', ++ 'format': '$IMGFMT', ++ 'sync': 'full', ++ 'speed': 65536 } }" \ ++ "return" ++ ++_send_qemu_cmd $h "{ 'execute': 'quit' }" "return" ++wait=1 _cleanup_qemu ++ ++echo ++echo === Start backup job and exit qemu === ++echo ++ ++_launch_qemu \ ++ -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk ++h=$QEMU_HANDLE ++_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return' ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'drive-backup', ++ 'arguments': { 'device': 'disk', ++ 'target': '$TEST_IMG.copy', ++ 'format': '$IMGFMT', ++ 'sync': 'full', ++ 'speed': 65536 } }" \ ++ "return" ++ ++_send_qemu_cmd $h "{ 'execute': 'quit' }" "return" ++wait=1 _cleanup_qemu ++ ++echo ++echo === Start streaming job and exit qemu === ++echo ++ ++_launch_qemu \ ++ -drive file="${TEST_IMG}",cache=$CACHEMODE,driver=$IMGFMT,id=disk ++h=$QEMU_HANDLE ++_send_qemu_cmd $h "{ 'execute': 'qmp_capabilities' }" 'return' ++ ++_send_qemu_cmd $h \ ++ "{ 'execute': 'block-stream', ++ 'arguments': { 'device': 'disk', ++ 'speed': 65536 } }" \ ++ "return" ++ ++_send_qemu_cmd $h "{ 'execute': 'quit' }" "return" ++wait=1 _cleanup_qemu ++ ++_check_test_img ++ ++# success, all done ++echo "*** done" ++rm -f $seq.full ++status=0 +diff --git a/tests/qemu-iotests/185.out b/tests/qemu-iotests/185.out +new file mode 100644 +index 0000000..45bc7cb +--- /dev/null ++++ b/tests/qemu-iotests/185.out +@@ -0,0 +1,59 @@ ++QA output created by 185 ++Formatting 'TEST_DIR/t.IMGFMT.base', fmt=IMGFMT size=67108864 ++ ++=== Starting VM === ++ ++{"return": {}} ++ ++=== Creating backing chain === ++ ++Formatting 'TEST_DIR/t.qcow2.mid', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.base backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 ++{"return": {}} ++wrote 4194304/4194304 bytes at offset 0 ++4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) ++{"return": ""} ++Formatting 'TEST_DIR/t.qcow2', fmt=qcow2 size=67108864 backing_file=TEST_DIR/t.qcow2.mid backing_fmt=qcow2 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 ++{"return": {}} ++ ++=== Start commit job and exit qemu === ++ ++{"return": {}} ++{"return": {}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 524288, "speed": 65536, "type": "commit"}} ++ ++=== Start active commit job and exit qemu === ++ ++{"return": {}} ++{"return": {}} ++{"return": {}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "commit"}} ++ ++=== Start mirror job and exit qemu === ++ ++{"return": {}} ++Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 ++{"return": {}} ++{"return": {}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 4194304, "offset": 4194304, "speed": 65536, "type": "mirror"}} ++ ++=== Start backup job and exit qemu === ++ ++{"return": {}} ++Formatting 'TEST_DIR/t.qcow2.copy', fmt=qcow2 size=67108864 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16 ++{"return": {}} ++{"return": {}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 65536, "speed": 65536, "type": "backup"}} ++ ++=== Start streaming job and exit qemu === ++ ++{"return": {}} ++{"return": {}} ++{"return": {}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_CANCELLED", "data": {"device": "disk", "len": 67108864, "offset": 524288, "speed": 65536, "type": "stream"}} ++No errors were found on the image. ++*** done +diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group +index 5618034..1c04a18 100644 +--- a/tests/qemu-iotests/group ++++ b/tests/qemu-iotests/group +@@ -169,3 +169,4 @@ + 174 auto + 175 auto quick + 176 rw auto backing ++185 rw auto +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-Test-streaming-with-missing-job-ID.patch b/SOURCES/kvm-qemu-iotests-Test-streaming-with-missing-job-ID.patch new file mode 100644 index 0000000..77d010c --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-Test-streaming-with-missing-job-ID.patch @@ -0,0 +1,61 @@ +From bbd4931e233557c34ec216ed4784282a16b4f3e4 Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 31 May 2017 11:15:12 +0200 +Subject: [PATCH 05/13] qemu-iotests: Test streaming with missing job ID + +RH-Author: Kevin Wolf +Message-id: <1496229312-8649-3-git-send-email-kwolf@redhat.com> +Patchwork-id: 75444 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 2/2] qemu-iotests: Test streaming with missing job ID +Bugzilla: 1456424 +RH-Acked-by: Fam Zheng +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +This adds a small test for the image streaming error path for failing +block_job_create(), which would have found the null pointer dereference +in commit a170a91f. + +Signed-off-by: Kevin Wolf +Reviewed-by: Alberto Garcia +Reviewed-by: Kashyap Chamarthy +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Jeff Cody +(cherry picked from commit 0bb0aea4bac2332389a9b481f650a2a9df80ea0c) +Signed-off-by: Miroslav Rezanina +--- + tests/qemu-iotests/030 | 4 ++++ + tests/qemu-iotests/030.out | 4 ++-- + 2 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030 +index 0d472d5..e59bee2 100755 +--- a/tests/qemu-iotests/030 ++++ b/tests/qemu-iotests/030 +@@ -147,6 +147,10 @@ class TestSingleDrive(iotests.QMPTestCase): + result = self.vm.qmp('block-stream', device='nonexistent') + self.assert_qmp(result, 'error/class', 'GenericError') + ++ def test_job_id_missing(self): ++ result = self.vm.qmp('block-stream', device='mid') ++ self.assert_qmp(result, 'error/class', 'GenericError') ++ + + class TestParallelOps(iotests.QMPTestCase): + num_ops = 4 # Number of parallel block-stream operations +diff --git a/tests/qemu-iotests/030.out b/tests/qemu-iotests/030.out +index 84bfd63..391c857 100644 +--- a/tests/qemu-iotests/030.out ++++ b/tests/qemu-iotests/030.out +@@ -1,5 +1,5 @@ +-...................... ++....................... + ---------------------------------------------------------------------- +-Ran 22 tests ++Ran 23 tests + + OK +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-iotests-exclude-vxhs-from-image-creation-via-pr.patch b/SOURCES/kvm-qemu-iotests-exclude-vxhs-from-image-creation-via-pr.patch new file mode 100644 index 0000000..ff50ce6 --- /dev/null +++ b/SOURCES/kvm-qemu-iotests-exclude-vxhs-from-image-creation-via-pr.patch @@ -0,0 +1,145 @@ +From ccbfd8b91d5ec11175259b441d1e059cc2467b0a Mon Sep 17 00:00:00 2001 +From: Jeffrey Cody +Date: Mon, 8 May 2017 22:11:15 +0200 +Subject: [PATCH 5/7] qemu-iotests: exclude vxhs from image creation via + protocol + +RH-Author: Jeffrey Cody +Message-id: <0a01e88aa5e64a728be5072fc5294649ebebf455.1494281291.git.jcody@redhat.com> +Patchwork-id: 75048 +O-Subject: [RHEV-7.4 qemu-kvm-rhev 3/4] qemu-iotests: exclude vxhs from image creation via protocol +Bugzilla: 1265869 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +The protocol VXHS does not support image creation. Some tests expect +to be able to create images through the protocol. Exclude VXHS from +these tests. + +Signed-off-by: Jeff Cody +(cherry picked from commit a98f49f46abb2034277633405479a4ab790c381e) +Signed-off-by: Miroslav Rezanina +--- + tests/qemu-iotests/017 | 1 + + tests/qemu-iotests/020 | 1 + + tests/qemu-iotests/029 | 1 + + tests/qemu-iotests/073 | 1 + + tests/qemu-iotests/114 | 1 + + tests/qemu-iotests/130 | 1 + + tests/qemu-iotests/134 | 1 + + tests/qemu-iotests/156 | 1 + + tests/qemu-iotests/158 | 1 + + 9 files changed, 9 insertions(+) + +diff --git a/tests/qemu-iotests/017 b/tests/qemu-iotests/017 +index e3f9e75..4f9302d 100755 +--- a/tests/qemu-iotests/017 ++++ b/tests/qemu-iotests/017 +@@ -41,6 +41,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + # Any format supporting backing files + _supported_fmt qcow qcow2 vmdk qed + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + _unsupported_imgopts "subformat=monolithicFlat" "subformat=twoGbMaxExtentFlat" + +diff --git a/tests/qemu-iotests/020 b/tests/qemu-iotests/020 +index 9c4a68c..7a11110 100755 +--- a/tests/qemu-iotests/020 ++++ b/tests/qemu-iotests/020 +@@ -43,6 +43,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + # Any format supporting backing files + _supported_fmt qcow qcow2 vmdk qed + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + _unsupported_imgopts "subformat=monolithicFlat" \ + "subformat=twoGbMaxExtentFlat" \ +diff --git a/tests/qemu-iotests/029 b/tests/qemu-iotests/029 +index e639ac0..30bab24 100755 +--- a/tests/qemu-iotests/029 ++++ b/tests/qemu-iotests/029 +@@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + # Any format supporting intenal snapshots + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + # Internal snapshots are (currently) impossible with refcount_bits=1 + _unsupported_imgopts 'refcount_bits=1[^0-9]' +diff --git a/tests/qemu-iotests/073 b/tests/qemu-iotests/073 +index ad37a61..40f85b1 100755 +--- a/tests/qemu-iotests/073 ++++ b/tests/qemu-iotests/073 +@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + CLUSTER_SIZE=64k +diff --git a/tests/qemu-iotests/114 b/tests/qemu-iotests/114 +index f110d4f..5b7dc54 100755 +--- a/tests/qemu-iotests/114 ++++ b/tests/qemu-iotests/114 +@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + +diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130 +index ecc8a5b..f941fc9 100755 +--- a/tests/qemu-iotests/130 ++++ b/tests/qemu-iotests/130 +@@ -42,6 +42,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + qemu_comm_method="monitor" +diff --git a/tests/qemu-iotests/134 b/tests/qemu-iotests/134 +index af618b8..acce946 100755 +--- a/tests/qemu-iotests/134 ++++ b/tests/qemu-iotests/134 +@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + +diff --git a/tests/qemu-iotests/156 b/tests/qemu-iotests/156 +index cc95ff1..78deaff 100755 +--- a/tests/qemu-iotests/156 ++++ b/tests/qemu-iotests/156 +@@ -48,6 +48,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 qed + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + # Create source disk +diff --git a/tests/qemu-iotests/158 b/tests/qemu-iotests/158 +index a6cdd6d..ef8d70f 100755 +--- a/tests/qemu-iotests/158 ++++ b/tests/qemu-iotests/158 +@@ -39,6 +39,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 + + _supported_fmt qcow2 + _supported_proto generic ++_unsupported_proto vxhs + _supported_os Linux + + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-qemu-nbd-Ignore-SIGPIPE.patch b/SOURCES/kvm-qemu-nbd-Ignore-SIGPIPE.patch new file mode 100644 index 0000000..27a4477 --- /dev/null +++ b/SOURCES/kvm-qemu-nbd-Ignore-SIGPIPE.patch @@ -0,0 +1,63 @@ +From 5813402bce6119ed5241d72e6000584a12a490ea Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Mon, 10 Jul 2017 16:28:19 +0200 +Subject: [PATCH 4/4] qemu-nbd: Ignore SIGPIPE + +RH-Author: Eric Blake +Message-id: <20170710162819.24843-1-eblake@redhat.com> +Patchwork-id: 75717 +O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH] qemu-nbd: Ignore SIGPIPE +Bugzilla: 1469463 +RH-Acked-by: John Snow +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Miroslav Rezanina + +From: Max Reitz + +qemu proper has done so for 13 years +(8a7ddc38a60648257dc0645ab4a05b33d6040063), qemu-img and qemu-io have +done so for four years (526eda14a68d5b3596be715505289b541288ef2a). +Ignoring this signal is especially important in qemu-nbd because +otherwise a client can easily take down the qemu-nbd server by dropping +the connection when the server wants to send something, for example: + +$ qemu-nbd -x foo -f raw -t null-co:// & +[1] 12726 +$ qemu-io -c quit nbd://localhost/bar +can't open device nbd://localhost/bar: No export with name 'bar' available +[1] + 12726 broken pipe qemu-nbd -x foo -f raw -t null-co:// + +In this case, the client sends an NBD_OPT_ABORT and closes the +connection (because it is not required to wait for a reply), but the +server replies with an NBD_REP_ACK (because it is required to reply). + +Signed-off-by: Max Reitz +Message-Id: <20170611123714.31292-1-mreitz@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 041e32b8d9d076980b4e35317c0339e57ab888f1) +Fixes CVE-2017-10664 +Signed-off-by: Eric Blake + +Signed-off-by: Miroslav Rezanina +--- + qemu-nbd.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/qemu-nbd.c b/qemu-nbd.c +index 483dd77..5deb37e 100644 +--- a/qemu-nbd.c ++++ b/qemu-nbd.c +@@ -581,6 +581,10 @@ int main(int argc, char **argv) + sa_sigterm.sa_handler = termsig_handler; + sigaction(SIGTERM, &sa_sigterm, NULL); + ++#ifdef CONFIG_POSIX ++ signal(SIGPIPE, SIG_IGN); ++#endif ++ + module_call_init(MODULE_INIT_TRACE); + qcrypto_init(&error_fatal); + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-replication-Make-disable-replication-compile-again.patch b/SOURCES/kvm-replication-Make-disable-replication-compile-again.patch new file mode 100644 index 0000000..7710c7a --- /dev/null +++ b/SOURCES/kvm-replication-Make-disable-replication-compile-again.patch @@ -0,0 +1,94 @@ +From 6001217743cc106f781ef7b4c6ca14be0c15fd91 Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Fri, 5 May 2017 08:46:53 +0200 +Subject: [PATCH 10/11] replication: Make --disable-replication compile again + +RH-Author: Markus Armbruster +Message-id: <1493974015-21314-2-git-send-email-armbru@redhat.com> +Patchwork-id: 75021 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/2] replication: Make --disable-replication compile again +Bugzilla: 1422846 +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Miroslav Rezanina +RH-Acked-by: Thomas Huth + +Broken in commit daa33c5. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Markus Armbruster +Reviewed-by: Eric Blake +Reviewed-by: Zhang Chen +Message-id: 1493298053-17140-1-git-send-email-armbru@redhat.com +Signed-off-by: Stefan Hajnoczi +(cherry picked from commit 38bb54f323bf7c83496b6a044cfd28896e997a00) +Signed-off-by: Miroslav Rezanina +--- + migration/colo.c | 12 ++++++++++++ + monitor.c | 5 +++++ + 2 files changed, 17 insertions(+) + +diff --git a/migration/colo.c b/migration/colo.c +index c19eb3f..963c802 100644 +--- a/migration/colo.c ++++ b/migration/colo.c +@@ -153,6 +153,7 @@ void qmp_xen_set_replication(bool enable, bool primary, + bool has_failover, bool failover, + Error **errp) + { ++#ifdef CONFIG_REPLICATION + ReplicationMode mode = primary ? + REPLICATION_MODE_PRIMARY : + REPLICATION_MODE_SECONDARY; +@@ -171,10 +172,14 @@ void qmp_xen_set_replication(bool enable, bool primary, + } + replication_stop_all(failover, failover ? NULL : errp); + } ++#else ++ abort(); ++#endif + } + + ReplicationStatus *qmp_query_xen_replication_status(Error **errp) + { ++#ifdef CONFIG_REPLICATION + Error *err = NULL; + ReplicationStatus *s = g_new0(ReplicationStatus, 1); + +@@ -189,11 +194,18 @@ ReplicationStatus *qmp_query_xen_replication_status(Error **errp) + + error_free(err); + return s; ++#else ++ abort(); ++#endif + } + + void qmp_xen_colo_do_checkpoint(Error **errp) + { ++#ifdef CONFIG_REPLICATION + replication_do_checkpoint_all(errp); ++#else ++ abort(); ++#endif + } + + static void colo_send_message(QEMUFile *f, COLOMessage msg, +diff --git a/monitor.c b/monitor.c +index 896d669..d4fbc07 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -974,6 +974,11 @@ static void qmp_unregister_commands_hack(void) + #ifndef CONFIG_SPICE + qmp_unregister_command(&qmp_commands, "query-spice"); + #endif ++#ifndef CONFIG_REPLICATION ++ qmp_unregister_command(&qmp_commands, "xen-set-replication"); ++ qmp_unregister_command(&qmp_commands, "query-xen-replication-status"); ++ qmp_unregister_command(&qmp_commands, "xen-colo-do-checkpoint"); ++#endif + #ifndef TARGET_I386 + qmp_unregister_command(&qmp_commands, "rtc-reset-reinjection"); + #endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-scsi-Disable-deprecated-implicit-SCSI-HBA-creation-m.patch b/SOURCES/kvm-scsi-Disable-deprecated-implicit-SCSI-HBA-creation-m.patch new file mode 100644 index 0000000..959d18c --- /dev/null +++ b/SOURCES/kvm-scsi-Disable-deprecated-implicit-SCSI-HBA-creation-m.patch @@ -0,0 +1,122 @@ +From 7977e603169c92da4b0ecd656c3346500a93897b Mon Sep 17 00:00:00 2001 +From: Markus Armbruster +Date: Fri, 28 Apr 2017 12:22:27 +0200 +Subject: [PATCH 02/27] scsi: Disable deprecated implicit SCSI HBA creation + more cleanly + +RH-Author: Markus Armbruster +Message-id: <1493382147-23057-2-git-send-email-armbru@redhat.com> +Patchwork-id: 74946 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] scsi: Disable deprecated implicit SCSI HBA creation more cleanly +Bugzilla: 971799 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: John Snow +RH-Acked-by: Jeffrey Cody + +The PC machines (pc-q35-* pc-i440fx-* pc-* isapc xenfv) automatically +create lsi53c895a SCSI HBAs and SCSI devices to honor -drive if=scsi. +Deprecated upstream since commit f778a82, v2.9.0, not supported at all +in RHEL. The way it fails is rather ugly, though: + + $ qemu-kvm -nodefaults -S -drive if=scsi,media=cdrom + qemu-kvm: Unknown device 'lsi53c895a' for bus 'PCI' + Aborted (core dumped) + +Recent upstream work permit us to make this fail cleanly by commenting +out the code that tries to create lsi53c895a SCSI HBAs in +pc_pci_device_init(): + + qemu-kvm: -drive if=scsi,media=cdrom: machine type does not support if=scsi,bus=0,unit=0 + +However, by itself this would make another deprecated feature +available in RHEL: drives defined with if=scsi get picked up by SCSI +HBAs added with -device, unlike other interface types. Deprecated +upstream since commit a64aa57, v2.9.0. Comment out that code, too. +Bonus: that code can be rather slow with a large number of drives, so +good riddance. + +Signed-off-by: Markus Armbruster +Signed-off-by: Miroslav Rezanina +--- + hw/i386/pc.c | 2 ++ + hw/scsi/scsi-bus.c | 7 +++++++ + vl.c | 2 ++ + 3 files changed, 11 insertions(+) + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 6ed4d23..1a0e672 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -1648,6 +1648,7 @@ void pc_nic_init(ISABus *isa_bus, PCIBus *pci_bus) + + void pc_pci_device_init(PCIBus *pci_bus) + { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + int max_bus; + int bus; + +@@ -1661,6 +1662,7 @@ void pc_pci_device_init(PCIBus *pci_bus) + * this usage is deprecated. + */ + } ++#endif + } + + void ioapic_init_gsi(GSIState *gsi_state, const char *parent_name) +diff --git a/hw/scsi/scsi-bus.c b/hw/scsi/scsi-bus.c +index f557446..bc984f4 100644 +--- a/hw/scsi/scsi-bus.c ++++ b/hw/scsi/scsi-bus.c +@@ -265,6 +265,8 @@ SCSIDevice *scsi_bus_legacy_add_drive(SCSIBus *bus, BlockBackend *blk, + + void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated) + { ++#if 0 /* Disabled for Red Hat Enterprise Linux */ ++ + Location loc; + DriveInfo *dinfo; + int unit; +@@ -291,8 +293,11 @@ void scsi_bus_legacy_handle_cmdline(SCSIBus *bus, bool deprecated) + unit, false, -1, NULL, &error_fatal); + } + loc_pop(&loc); ++#endif + } + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ ++ + static bool is_scsi_hba_with_legacy_magic(Object *obj) + { + static const char *magic[] = { +@@ -329,6 +334,8 @@ void scsi_legacy_handle_cmdline(void) + scsi_legacy_handle_cmdline_cb, NULL); + } + ++#endif ++ + static int32_t scsi_invalid_field(SCSIRequest *req, uint8_t *buf) + { + scsi_req_build_sense(req, SENSE_CODE(INVALID_FIELD)); +diff --git a/vl.c b/vl.c +index 8a5df00..183f070 100644 +--- a/vl.c ++++ b/vl.c +@@ -4602,6 +4602,7 @@ int main(int argc, char **argv, char **envp) + + rom_reset_order_override(); + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* + * Create frontends for -drive if=scsi leftovers. + * Normally, frontends for -drive get created by machine +@@ -4610,6 +4611,7 @@ int main(int argc, char **argv, char **envp) + * implementation accident, and deprecated. + */ + scsi_legacy_handle_cmdline(); ++#endif + + /* Did we create any drives that we failed to create a device for? */ + drive_check_orphaned(); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-setup b/SOURCES/kvm-setup new file mode 100644 index 0000000..abbd587 --- /dev/null +++ b/SOURCES/kvm-setup @@ -0,0 +1,40 @@ +#! /bin/bash + +kvm_setup_powerpc () { + if grep '^platform[[:space:]]*:[[:space:]]*PowerNV' /proc/cpuinfo > /dev/null; then + # PowerNV platform, which is KVM HV capable + + if [ -z "$SUBCORES" ]; then + SUBCORES=1 + fi + + # Step 1. Load the KVM HVmodule + if ! modprobe -b kvm_hv; then + return + fi + + # On POWER8 a host core can only run threads of a single + # guest, meaning that SMT must be disabled on the host in + # order to run KVM guests. (Also applieds to POWER7, but we + # don't support that). + # + # POWER9 doesn't have this limitation (though it will for hash + # guests on radix host when that's implemented). So, only set + # up subcores and disable SMT for POWER*. + if grep '^cpu[[:space:]]*:[[:space:]]*POWER8' /proc/cpuinfo > /dev/null; then + # Step 2. Configure subcore mode + /usr/sbin/ppc64_cpu --subcores-per-core=$SUBCORES + + # Step 3. Disable SMT (multithreading) + /usr/sbin/ppc64_cpu --smt=off + fi + fi +} + +case $(uname -m) in + ppc64|ppc64le) + kvm_setup_powerpc + ;; +esac + +exit 0 diff --git a/SOURCES/kvm-setup.service b/SOURCES/kvm-setup.service new file mode 100644 index 0000000..9c4bf97 --- /dev/null +++ b/SOURCES/kvm-setup.service @@ -0,0 +1,14 @@ +[Unit] +Description=Perform system configuration to prepare system to run KVM guests +# Offlining CPUs can cause irqbalance to throw warnings if it's running +Before=irqbalance.service +# libvirtd reads CPU topology at startup, so change it before +Before=libvirtd.service + +[Service] +Type=oneshot +EnvironmentFile=-/etc/sysconfig/kvm +ExecStart=/usr/lib/systemd/kvm-setup + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/kvm-shutdown-Add-source-information-to-SHUTDOWN-and-RESE.patch b/SOURCES/kvm-shutdown-Add-source-information-to-SHUTDOWN-and-RESE.patch new file mode 100644 index 0000000..c11e4de --- /dev/null +++ b/SOURCES/kvm-shutdown-Add-source-information-to-SHUTDOWN-and-RESE.patch @@ -0,0 +1,1128 @@ +From 3ab1c8abe9f08c363752b8aa6204038895a72a51 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 1 Jun 2017 16:58:20 +0200 +Subject: [PATCH 04/17] shutdown: Add source information to SHUTDOWN and RESET + +RH-Author: Eric Blake +Message-id: <20170601165821.26810-5-eblake@redhat.com> +Patchwork-id: 75467 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 4/5] shutdown: Add source information to SHUTDOWN and RESET +Bugzilla: 1418927 +RH-Acked-by: John Snow +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth + +Time to wire up all the call sites that request a shutdown or +reset to use the enum added in the previous patch. + +It would have been less churn to keep the common case with no +arguments as meaning guest-triggered, and only modified the +host-triggered code paths, via a wrapper function, but then we'd +still have to audit that I didn't miss any host-triggered spots; +changing the signature forces us to double-check that I correctly +categorized all callers. + +Since command line options can change whether a guest reset request +causes an actual reset vs. a shutdown, it's easy to also add the +information to reset requests. + +Signed-off-by: Eric Blake +Acked-by: David Gibson [ppc parts] +Reviewed-by: Mark Cave-Ayland [SPARC part] +Reviewed-by: Cornelia Huck [s390x parts] +Message-Id: <20170515214114.15442-5-eblake@redhat.com> +Reviewed-by: Markus Armbruster +Signed-off-by: Markus Armbruster +(cherry picked from commit cf83f140059f21d4629ae4b61d468c3baef2bb4c) +Signed-off-by: Miroslav Rezanina +--- + hw/acpi/core.c | 4 ++-- + hw/arm/highbank.c | 4 ++-- + hw/arm/integratorcp.c | 2 +- + hw/arm/musicpal.c | 2 +- + hw/arm/omap1.c | 10 ++++++---- + hw/arm/omap2.c | 2 +- + hw/arm/spitz.c | 2 +- + hw/arm/stellaris.c | 2 +- + hw/arm/tosa.c | 2 +- + hw/i386/pc.c | 2 +- + hw/input/pckbd.c | 4 ++-- + hw/ipmi/ipmi.c | 4 ++-- + hw/isa/lpc_ich9.c | 2 +- + hw/mips/boston.c | 2 +- + hw/mips/mips_malta.c | 2 +- + hw/mips/mips_r4k.c | 4 ++-- + hw/misc/arm_sysctl.c | 8 ++++---- + hw/misc/cbus.c | 2 +- + hw/misc/macio/cuda.c | 4 ++-- + hw/misc/slavio_misc.c | 4 ++-- + hw/misc/zynq_slcr.c | 2 +- + hw/pci-host/apb.c | 4 ++-- + hw/pci-host/bonito.c | 2 +- + hw/pci-host/piix.c | 2 +- + hw/ppc/e500.c | 2 +- + hw/ppc/mpc8544_guts.c | 2 +- + hw/ppc/ppc.c | 2 +- + hw/ppc/ppc405_uc.c | 2 +- + hw/ppc/spapr_hcall.c | 2 +- + hw/ppc/spapr_rtas.c | 4 ++-- + hw/s390x/ipl.c | 2 +- + hw/sh4/r2d.c | 2 +- + hw/timer/etraxfs_timer.c | 2 +- + hw/timer/m48t59.c | 4 ++-- + hw/timer/milkymist-sysctl.c | 4 ++-- + hw/timer/pxa2xx_timer.c | 2 +- + hw/watchdog/watchdog.c | 2 +- + hw/xenpv/xen_domainbuild.c | 2 +- + hw/xtensa/xtfpga.c | 2 +- + include/sysemu/sysemu.h | 4 ++-- + kvm-all.c | 6 +++--- + os-win32.c | 2 +- + qmp.c | 4 ++-- + replay/replay.c | 4 ++-- + target/alpha/sys_helper.c | 4 ++-- + target/arm/psci.c | 4 ++-- + target/i386/excp_helper.c | 2 +- + target/i386/hax-all.c | 6 +++--- + target/i386/helper.c | 2 +- + target/i386/kvm.c | 2 +- + target/s390x/helper.c | 2 +- + target/s390x/kvm.c | 4 ++-- + target/s390x/misc_helper.c | 4 ++-- + target/sparc/int32_helper.c | 2 +- + trace-events | 2 +- + ui/cocoa.m | 2 +- + ui/sdl.c | 2 +- + ui/sdl2.c | 4 ++-- + vl.c | 18 ++++++++---------- + xen-hvm.c | 2 +- + 60 files changed, 98 insertions(+), 98 deletions(-) + +diff --git a/hw/acpi/core.c b/hw/acpi/core.c +index e890a5d..95fcac9 100644 +--- a/hw/acpi/core.c ++++ b/hw/acpi/core.c +@@ -561,7 +561,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val) + uint16_t sus_typ = (val >> 10) & 7; + switch(sus_typ) { + case 0: /* soft power off */ +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + break; + case 1: + qemu_system_suspend_request(); +@@ -569,7 +569,7 @@ static void acpi_pm1_cnt_write(ACPIREGS *ar, uint16_t val) + default: + if (sus_typ == ar->pm1.cnt.s4_val) { /* S4 request */ + qapi_event_send_suspend_disk(&error_abort); +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + break; + } +diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c +index 0a4508c..d209b97 100644 +--- a/hw/arm/highbank.c ++++ b/hw/arm/highbank.c +@@ -108,9 +108,9 @@ static void hb_regs_write(void *opaque, hwaddr offset, + + if (offset == 0xf00) { + if (value == 1 || value == 2) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } else if (value == 3) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + } + +diff --git a/hw/arm/integratorcp.c b/hw/arm/integratorcp.c +index 5610ffc..ca3eca1 100644 +--- a/hw/arm/integratorcp.c ++++ b/hw/arm/integratorcp.c +@@ -158,7 +158,7 @@ static void integratorcm_do_remap(IntegratorCMState *s) + static void integratorcm_set_ctrl(IntegratorCMState *s, uint32_t value) + { + if (value & 8) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + if ((s->cm_ctrl ^ value) & 1) { + /* (value & 1) != 0 means the green "MISC LED" is lit. +diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c +index cbbca4e..9c710f7 100644 +--- a/hw/arm/musicpal.c ++++ b/hw/arm/musicpal.c +@@ -898,7 +898,7 @@ static void mv88w8618_pit_write(void *opaque, hwaddr offset, + + case MP_BOARD_RESET: + if (value == MP_BOARD_RESET_MAGIC) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + } +diff --git a/hw/arm/omap1.c b/hw/arm/omap1.c +index b3cf0ec..54582bd 100644 +--- a/hw/arm/omap1.c ++++ b/hw/arm/omap1.c +@@ -355,7 +355,7 @@ static void omap_wd_timer_write(void *opaque, hwaddr addr, + /* XXX: on T|E hardware somehow this has no effect, + * on Zire 71 it works as specified. */ + s->reset = 1; +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + s->last_wr = value & 0xff; +@@ -1545,8 +1545,10 @@ static inline void omap_clkm_idlect1_update(struct omap_mpu_state_s *s, + if (value & (1 << 11)) { /* SETARM_IDLE */ + cpu_interrupt(CPU(s->cpu), CPU_INTERRUPT_HALT); + } +- if (!(value & (1 << 10))) /* WKUP_MODE */ +- qemu_system_shutdown_request(); /* XXX: disable wakeup from IRQ */ ++ if (!(value & (1 << 10))) { /* WKUP_MODE */ ++ /* XXX: disable wakeup from IRQ */ ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); ++ } + + #define SET_CANIDLE(clock, bit) \ + if (diff & (1 << bit)) { \ +@@ -1693,7 +1695,7 @@ static void omap_clkm_write(void *opaque, hwaddr addr, + diff = s->clkm.arm_rstct1 ^ value; + s->clkm.arm_rstct1 = value & 0x0007; + if (value & 9) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + s->clkm.cold_start = 0xa; + } + if (diff & ~value & 4) { /* DSP_RST */ +diff --git a/hw/arm/omap2.c b/hw/arm/omap2.c +index cf1b4ba..8afb854 100644 +--- a/hw/arm/omap2.c ++++ b/hw/arm/omap2.c +@@ -1610,7 +1610,7 @@ static void omap_prcm_write(void *opaque, hwaddr addr, + case 0x450: /* RM_RSTCTRL_WKUP */ + /* TODO: reset */ + if (value & 2) +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + break; + case 0x454: /* RM_RSTTIME_WKUP */ + s->rsttime_wkup = value & 0x1fff; +diff --git a/hw/arm/spitz.c b/hw/arm/spitz.c +index fe2d5a7..7e9f579 100644 +--- a/hw/arm/spitz.c ++++ b/hw/arm/spitz.c +@@ -848,7 +848,7 @@ static void spitz_lcd_hsync_handler(void *opaque, int line, int level) + static void spitz_reset(void *opaque, int line, int level) + { + if (level) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c +index 9edcd49..c35f684 100644 +--- a/hw/arm/stellaris.c ++++ b/hw/arm/stellaris.c +@@ -1183,7 +1183,7 @@ static + void do_sys_reset(void *opaque, int n, int level) + { + if (level) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +diff --git a/hw/arm/tosa.c b/hw/arm/tosa.c +index 9f58a23..2421b81 100644 +--- a/hw/arm/tosa.c ++++ b/hw/arm/tosa.c +@@ -90,7 +90,7 @@ static void tosa_out_switch(void *opaque, int line, int level) + static void tosa_reset(void *opaque, int line, int level) + { + if (level) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +diff --git a/hw/i386/pc.c b/hw/i386/pc.c +index 3596de0..f0d09d9 100644 +--- a/hw/i386/pc.c ++++ b/hw/i386/pc.c +@@ -520,7 +520,7 @@ static void port92_write(void *opaque, hwaddr addr, uint64_t val, + s->outport = val; + qemu_set_irq(s->a20_out, (val >> 1) & 1); + if ((val & 1) && !(oldval & 1)) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c +index f475f33..a7676bc 100644 +--- a/hw/input/pckbd.c ++++ b/hw/input/pckbd.c +@@ -227,7 +227,7 @@ static void outport_write(KBDState *s, uint32_t val) + s->outport = val; + qemu_set_irq(s->a20_out, (val >> 1) & 1); + if (!(val & 1)) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +@@ -302,7 +302,7 @@ static void kbd_write_command(void *opaque, hwaddr addr, + s->outport &= ~KBD_OUT_A20; + break; + case KBD_CCMD_RESET: +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + break; + case KBD_CCMD_NO_OP: + /* ignore that */ +diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c +index 5cf1caa..afafe14 100644 +--- a/hw/ipmi/ipmi.c ++++ b/hw/ipmi/ipmi.c +@@ -44,14 +44,14 @@ static int ipmi_do_hw_op(IPMIInterface *s, enum ipmi_op op, int checkonly) + if (checkonly) { + return 0; + } +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return 0; + + case IPMI_POWEROFF_CHASSIS: + if (checkonly) { + return 0; + } +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + return 0; + + case IPMI_SEND_NMI: +diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c +index a0866c3..2b09354 100644 +--- a/hw/isa/lpc_ich9.c ++++ b/hw/isa/lpc_ich9.c +@@ -606,7 +606,7 @@ static void ich9_rst_cnt_write(void *opaque, hwaddr addr, uint64_t val, + ICH9LPCState *lpc = opaque; + + if (val & 4) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + lpc->rst_cnt = val & 0xA; /* keep FULL_RST (bit 3) and SYS_RST (bit 1) */ +diff --git a/hw/mips/boston.c b/hw/mips/boston.c +index 83f7b82..53d1e0c 100644 +--- a/hw/mips/boston.c ++++ b/hw/mips/boston.c +@@ -232,7 +232,7 @@ static void boston_platreg_write(void *opaque, hwaddr addr, + break; + case PLAT_SOFTRST_CTL: + if (val & PLAT_SOFTRST_CTL_SYSRESET) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + default: +diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c +index 5dd177e..7814c39 100644 +--- a/hw/mips/mips_malta.c ++++ b/hw/mips/mips_malta.c +@@ -470,7 +470,7 @@ static void malta_fpga_write(void *opaque, hwaddr addr, + /* SOFTRES Register */ + case 0x00500: + if (val == 0x42) +- qemu_system_reset_request (); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + break; + + /* BRKRES Register */ +diff --git a/hw/mips/mips_r4k.c b/hw/mips/mips_r4k.c +index 748586e..f4de9fc 100644 +--- a/hw/mips/mips_r4k.c ++++ b/hw/mips/mips_r4k.c +@@ -53,9 +53,9 @@ static void mips_qemu_write (void *opaque, hwaddr addr, + uint64_t val, unsigned size) + { + if ((addr & 0xffff) == 0 && val == 42) +- qemu_system_reset_request (); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + else if ((addr & 0xffff) == 4 && val == 42) +- qemu_system_shutdown_request (); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + + static uint64_t mips_qemu_read (void *opaque, hwaddr addr, +diff --git a/hw/misc/arm_sysctl.c b/hw/misc/arm_sysctl.c +index 8524008..b20b44e 100644 +--- a/hw/misc/arm_sysctl.c ++++ b/hw/misc/arm_sysctl.c +@@ -351,13 +351,13 @@ static bool vexpress_cfgctrl_write(arm_sysctl_state *s, unsigned int dcc, + break; + case SYS_CFG_SHUTDOWN: + if (site == SYS_CFG_SITE_MB && device == 0) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + return true; + } + break; + case SYS_CFG_REBOOT: + if (site == SYS_CFG_SITE_MB && device == 0) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return true; + } + break; +@@ -429,7 +429,7 @@ static void arm_sysctl_write(void *opaque, hwaddr offset, + if (s->lockval == LOCK_VALUE) { + s->resetlevel = val; + if (val & 0x100) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + break; +@@ -438,7 +438,7 @@ static void arm_sysctl_write(void *opaque, hwaddr offset, + if (s->lockval == LOCK_VALUE) { + s->resetlevel = val; + if (val & 0x04) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + break; +diff --git a/hw/misc/cbus.c b/hw/misc/cbus.c +index 0c207e3..677274c 100644 +--- a/hw/misc/cbus.c ++++ b/hw/misc/cbus.c +@@ -356,7 +356,7 @@ static inline void retu_write(CBusRetu *s, int reg, uint16_t val) + + case RETU_REG_WATCHDOG: + if (val == 0 && (s->cc[0] & 2)) +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + break; + + case RETU_REG_TXCR: +diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c +index 05c02fb..008d8bd 100644 +--- a/hw/misc/macio/cuda.c ++++ b/hw/misc/macio/cuda.c +@@ -612,7 +612,7 @@ static bool cuda_cmd_powerdown(CUDAState *s, + return false; + } + +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + return true; + } + +@@ -624,7 +624,7 @@ static bool cuda_cmd_reset_system(CUDAState *s, + return false; + } + +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return true; + } + +diff --git a/hw/misc/slavio_misc.c b/hw/misc/slavio_misc.c +index edd5de0..18ff677 100644 +--- a/hw/misc/slavio_misc.c ++++ b/hw/misc/slavio_misc.c +@@ -258,7 +258,7 @@ static void slavio_aux2_mem_writeb(void *opaque, hwaddr addr, + val &= AUX2_PWROFF; + s->aux2 = val; + if (val & AUX2_PWROFF) +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + slavio_misc_update_irq(s); + } + +@@ -338,7 +338,7 @@ static void slavio_sysctrl_mem_writel(void *opaque, hwaddr addr, + case 0: + if (val & SYS_RESET) { + s->sysctrl = SYS_RESETSTAT; +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + default: +diff --git a/hw/misc/zynq_slcr.c b/hw/misc/zynq_slcr.c +index 7891219..44304d4 100644 +--- a/hw/misc/zynq_slcr.c ++++ b/hw/misc/zynq_slcr.c +@@ -405,7 +405,7 @@ static void zynq_slcr_write(void *opaque, hwaddr offset, + switch (offset) { + case PSS_RST_CTRL: + if (val & R_PSS_RST_CTRL_SOFT_RST) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + } +diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c +index 653e711..83fc6a9 100644 +--- a/hw/pci-host/apb.c ++++ b/hw/pci-host/apb.c +@@ -482,9 +482,9 @@ static void apb_config_writel (void *opaque, hwaddr addr, + s->reset_control |= val & RESET_WMASK; + if (val & SOFT_POR) { + s->nr_resets = 0; +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } else if (val & SOFT_XIR) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + break; +diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c +index 1999ece..b1d41d0 100644 +--- a/hw/pci-host/bonito.c ++++ b/hw/pci-host/bonito.c +@@ -269,7 +269,7 @@ static void bonito_writel(void *opaque, hwaddr addr, + } + s->regs[saddr] = val; + if (reset) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + case BONITO_INTENSET: +diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c +index 7c3b7c1..f6d1ebc 100644 +--- a/hw/pci-host/piix.c ++++ b/hw/pci-host/piix.c +@@ -638,7 +638,7 @@ static void rcr_write(void *opaque, hwaddr addr, uint64_t val, unsigned len) + PIIX3State *d = opaque; + + if (val & 4) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + d->rcr = val & 2; /* keep System Reset type only */ +diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c +index f7df238..62f1857 100644 +--- a/hw/ppc/e500.c ++++ b/hw/ppc/e500.c +@@ -774,7 +774,7 @@ static qemu_irq *ppce500_init_mpic(MachineState *machine, PPCE500Params *params, + static void ppce500_power_off(void *opaque, int line, int on) + { + if (on) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + } + +diff --git a/hw/ppc/mpc8544_guts.c b/hw/ppc/mpc8544_guts.c +index ba69178..ce1254b 100644 +--- a/hw/ppc/mpc8544_guts.c ++++ b/hw/ppc/mpc8544_guts.c +@@ -98,7 +98,7 @@ static void mpc8544_guts_write(void *opaque, hwaddr addr, + switch (addr) { + case MPC8544_GUTS_ADDR_RSTCR: + if (value & MPC8544_GUTS_RSTCR_RESET) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + default: +diff --git a/hw/ppc/ppc.c b/hw/ppc/ppc.c +index 5f93083..224184d 100644 +--- a/hw/ppc/ppc.c ++++ b/hw/ppc/ppc.c +@@ -412,7 +412,7 @@ static void ppce500_set_irq(void *opaque, int pin, int level) + if (level) { + LOG_IRQ("%s: reset the PowerPC system\n", + __func__); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + case PPCE500_INPUT_RESET_CORE: +diff --git a/hw/ppc/ppc405_uc.c b/hw/ppc/ppc405_uc.c +index d5df94a..fc32e96 100644 +--- a/hw/ppc/ppc405_uc.c ++++ b/hw/ppc/ppc405_uc.c +@@ -1807,7 +1807,7 @@ void ppc40x_chip_reset(PowerPCCPU *cpu) + void ppc40x_system_reset(PowerPCCPU *cpu) + { + printf("Reset PowerPC system\n"); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + + void store_40x_dbcr0 (CPUPPCState *env, uint32_t val) +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index 9f18f75..2735fe9 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -1166,7 +1166,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + spapr_ovec_cleanup(ov5_updates); + + if (spapr->cas_reboot) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } else { + /* If ppc_spapr_reset() did not set up a HPT but one is necessary + * (because the guest isn't going to use radix) then set it up here. */ +diff --git a/hw/ppc/spapr_rtas.c b/hw/ppc/spapr_rtas.c +index 619f32c..128d993 100644 +--- a/hw/ppc/spapr_rtas.c ++++ b/hw/ppc/spapr_rtas.c +@@ -110,7 +110,7 @@ static void rtas_power_off(PowerPCCPU *cpu, sPAPRMachineState *spapr, + rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); + return; + } +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + cpu_stop_current(); + rtas_st(rets, 0, RTAS_OUT_SUCCESS); + } +@@ -124,7 +124,7 @@ static void rtas_system_reboot(PowerPCCPU *cpu, sPAPRMachineState *spapr, + rtas_st(rets, 0, RTAS_OUT_PARAM_ERROR); + return; + } +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + rtas_st(rets, 0, RTAS_OUT_SUCCESS); + } + +diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c +index 7978c7d..e5ab0ad 100644 +--- a/hw/s390x/ipl.c ++++ b/hw/s390x/ipl.c +@@ -363,7 +363,7 @@ void s390_reipl_request(void) + S390IPLState *ipl = get_ipl_device(); + + ipl->reipl_requested = true; +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + + void s390_ipl_prepare_cpu(S390CPU *cpu) +diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c +index 6d06968..117ba9f 100644 +--- a/hw/sh4/r2d.c ++++ b/hw/sh4/r2d.c +@@ -164,7 +164,7 @@ r2d_fpga_write(void *opaque, hwaddr addr, uint64_t value, unsigned int size) + break; + case PA_POWOFF: + if (value & 1) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + break; + case PA_VERREG: +diff --git a/hw/timer/etraxfs_timer.c b/hw/timer/etraxfs_timer.c +index 8e18236..d13bc30 100644 +--- a/hw/timer/etraxfs_timer.c ++++ b/hw/timer/etraxfs_timer.c +@@ -207,7 +207,7 @@ static void watchdog_hit(void *opaque) + qemu_irq_raise(t->nmi); + } + else +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + + t->wd_hits++; + } +diff --git a/hw/timer/m48t59.c b/hw/timer/m48t59.c +index 474981a..4a064fb 100644 +--- a/hw/timer/m48t59.c ++++ b/hw/timer/m48t59.c +@@ -1,7 +1,7 @@ + /* + * QEMU M48T59 and M48T08 NVRAM emulation for PPC PREP and Sparc platforms + * +- * Copyright (c) 2003-2005, 2007 Jocelyn Mayer ++ * Copyright (c) 2003-2005, 2007, 2017 Jocelyn Mayer + * Copyright (c) 2013 Hervé Poussineau + * + * Permission is hereby granted, free of charge, to any person obtaining a copy +@@ -159,7 +159,7 @@ static void watchdog_cb (void *opaque) + NVRAM->buffer[0x1FF7] = 0x00; + NVRAM->buffer[0x1FFC] &= ~0x40; + /* May it be a hw CPU Reset instead ? */ +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } else { + qemu_set_irq(NVRAM->IRQ, 1); + qemu_set_irq(NVRAM->IRQ, 0); +diff --git a/hw/timer/milkymist-sysctl.c b/hw/timer/milkymist-sysctl.c +index 4488590..93bc6e17 100644 +--- a/hw/timer/milkymist-sysctl.c ++++ b/hw/timer/milkymist-sysctl.c +@@ -90,7 +90,7 @@ static void sysctl_icap_write(MilkymistSysctlState *s, uint32_t value) + trace_milkymist_sysctl_icap_write(value); + switch (value & 0xffff) { + case 0x000e: +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + break; + } + } +@@ -195,7 +195,7 @@ static void sysctl_write(void *opaque, hwaddr addr, uint64_t value, + s->regs[addr] = 1; + break; + case R_SYSTEM_ID: +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + break; + + case R_GPIO_IN: +diff --git a/hw/timer/pxa2xx_timer.c b/hw/timer/pxa2xx_timer.c +index 59002b4..68ba5a7 100644 +--- a/hw/timer/pxa2xx_timer.c ++++ b/hw/timer/pxa2xx_timer.c +@@ -401,7 +401,7 @@ static void pxa2xx_timer_tick(void *opaque) + if (t->num == 3) + if (i->reset3 & 1) { + i->reset3 = 0; +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + } + +diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c +index 2aeaf1f..0c5c9cd 100644 +--- a/hw/watchdog/watchdog.c ++++ b/hw/watchdog/watchdog.c +@@ -110,7 +110,7 @@ void watchdog_perform_action(void) + switch (watchdog_action) { + case WDT_RESET: /* same as 'system_reset' in monitor */ + qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, &error_abort); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + break; + + case WDT_SHUTDOWN: /* same as 'system_powerdown' in monitor */ +diff --git a/hw/xenpv/xen_domainbuild.c b/hw/xenpv/xen_domainbuild.c +index 457a897..c89ced2 100644 +--- a/hw/xenpv/xen_domainbuild.c ++++ b/hw/xenpv/xen_domainbuild.c +@@ -148,7 +148,7 @@ static void xen_domain_poll(void *opaque) + return; + + quit: +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + + static int xen_domain_watcher(void) +diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c +index 11176e2..4636f8e 100644 +--- a/hw/xtensa/xtfpga.c ++++ b/hw/xtensa/xtfpga.c +@@ -100,7 +100,7 @@ static void lx60_fpga_write(void *opaque, hwaddr addr, + + case 0x10: /*board reset*/ + if (val == 0xdead) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } + break; + } +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index f942562..01a2c67 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -62,13 +62,13 @@ typedef enum WakeupReason { + QEMU_WAKEUP_REASON_OTHER, + } WakeupReason; + +-void qemu_system_reset_request(void); ++void qemu_system_reset_request(ShutdownCause reason); + void qemu_system_suspend_request(void); + void qemu_register_suspend_notifier(Notifier *notifier); + void qemu_system_wakeup_request(WakeupReason reason); + void qemu_system_wakeup_enable(WakeupReason reason, bool enabled); + void qemu_register_wakeup_notifier(Notifier *notifier); +-void qemu_system_shutdown_request(void); ++void qemu_system_shutdown_request(ShutdownCause reason); + void qemu_system_powerdown_request(void); + void qemu_register_powerdown_notifier(Notifier *notifier); + void qemu_system_debug_request(void); +diff --git a/kvm-all.c b/kvm-all.c +index cc86415..4322aa3 100644 +--- a/kvm-all.c ++++ b/kvm-all.c +@@ -2074,7 +2074,7 @@ int kvm_cpu_exec(CPUState *cpu) + break; + case KVM_EXIT_SHUTDOWN: + DPRINTF("shutdown\n"); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + ret = EXCP_INTERRUPT; + break; + case KVM_EXIT_UNKNOWN: +@@ -2088,11 +2088,11 @@ int kvm_cpu_exec(CPUState *cpu) + case KVM_EXIT_SYSTEM_EVENT: + switch (run->system_event.type) { + case KVM_SYSTEM_EVENT_SHUTDOWN: +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + ret = EXCP_INTERRUPT; + break; + case KVM_SYSTEM_EVENT_RESET: +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + ret = EXCP_INTERRUPT; + break; + case KVM_SYSTEM_EVENT_CRASH: +diff --git a/os-win32.c b/os-win32.c +index ae98574..586a7c7 100644 +--- a/os-win32.c ++++ b/os-win32.c +@@ -52,7 +52,7 @@ int setenv(const char *name, const char *value, int overwrite) + + static BOOL WINAPI qemu_ctrl_handler(DWORD type) + { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_SIGNAL); + /* Windows 7 kills application when the function returns. + Sleep here to give QEMU a try for closing. + Sleep period is 10000ms because Windows kills the program +diff --git a/qmp.c b/qmp.c +index 847b13f..e00359e 100644 +--- a/qmp.c ++++ b/qmp.c +@@ -84,7 +84,7 @@ UuidInfo *qmp_query_uuid(Error **errp) + void qmp_quit(Error **errp) + { + no_shutdown = 0; +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_QMP); + } + + void qmp_stop(Error **errp) +@@ -105,7 +105,7 @@ void qmp_stop(Error **errp) + + void qmp_system_reset(Error **errp) + { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_HOST_QMP); + } + + void qmp_system_powerdown(Error **erp) +diff --git a/replay/replay.c b/replay/replay.c +index bf94e81..ff58a5a 100644 +--- a/replay/replay.c ++++ b/replay/replay.c +@@ -51,8 +51,8 @@ bool replay_next_event_is(int event) + switch (replay_state.data_kind) { + case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST: + replay_finish_event(); +- /* TODO - pass replay_state.data_kind - EVENT_SHUTDOWN as cause */ +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(replay_state.data_kind - ++ EVENT_SHUTDOWN); + break; + default: + /* clock, time_t, checkpoint and other events */ +diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c +index 652195d..ac22323 100644 +--- a/target/alpha/sys_helper.c ++++ b/target/alpha/sys_helper.c +@@ -60,9 +60,9 @@ void helper_tb_flush(CPUAlphaState *env) + void helper_halt(uint64_t restart) + { + if (restart) { +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + } else { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + } + +diff --git a/target/arm/psci.c b/target/arm/psci.c +index ade9fe2..fc34b26 100644 +--- a/target/arm/psci.c ++++ b/target/arm/psci.c +@@ -137,7 +137,7 @@ void arm_handle_psci_call(ARMCPU *cpu) + } + break; + case QEMU_PSCI_0_2_FN_SYSTEM_RESET: +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + /* QEMU reset and shutdown are async requests, but PSCI + * mandates that we never return from the reset/shutdown + * call, so power the CPU off now so it doesn't execute +@@ -145,7 +145,7 @@ void arm_handle_psci_call(ARMCPU *cpu) + */ + goto cpu_off; + case QEMU_PSCI_0_2_FN_SYSTEM_OFF: +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + goto cpu_off; + case QEMU_PSCI_0_1_FN_CPU_ON: + case QEMU_PSCI_0_2_FN_CPU_ON: +diff --git a/target/i386/excp_helper.c b/target/i386/excp_helper.c +index ee596c6..b769772 100644 +--- a/target/i386/excp_helper.c ++++ b/target/i386/excp_helper.c +@@ -59,7 +59,7 @@ static int check_exception(CPUX86State *env, int intno, int *error_code, + + qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); + +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return EXCP_HLT; + } + #endif +diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c +index ef13015..7346931 100644 +--- a/target/i386/hax-all.c ++++ b/target/i386/hax-all.c +@@ -540,14 +540,14 @@ static int hax_vcpu_hax_exec(CPUArchState *env) + /* Guest state changed, currently only for shutdown */ + case HAX_EXIT_STATECHANGE: + fprintf(stdout, "VCPU shutdown request\n"); +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + hax_vcpu_sync_state(env, 0); + ret = 1; + break; + case HAX_EXIT_UNKNOWN_VMEXIT: + fprintf(stderr, "Unknown VMX exit %x from guest\n", + ht->_exit_reason); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + hax_vcpu_sync_state(env, 0); + cpu_dump_state(cpu, stderr, fprintf, 0); + ret = -1; +@@ -578,7 +578,7 @@ static int hax_vcpu_hax_exec(CPUArchState *env) + break; + default: + fprintf(stderr, "Unknown exit %x from HAX\n", ht->_exit_status); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + hax_vcpu_sync_state(env, 0); + cpu_dump_state(cpu, stderr, fprintf, 0); + ret = 1; +diff --git a/target/i386/helper.c b/target/i386/helper.c +index f11cac6..ee7eff2 100644 +--- a/target/i386/helper.c ++++ b/target/i386/helper.c +@@ -1212,7 +1212,7 @@ static void do_inject_x86_mce(CPUState *cs, run_on_cpu_data data) + " triple fault\n", + cs->cpu_index); + qemu_log_mask(CPU_LOG_RESET, "Triple fault\n"); +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + return; + } + if (banks[1] & MCI_STATUS_VAL) { +diff --git a/target/i386/kvm.c b/target/i386/kvm.c +index 55865db..cfd7695 100644 +--- a/target/i386/kvm.c ++++ b/target/i386/kvm.c +@@ -2930,7 +2930,7 @@ int kvm_arch_process_async_events(CPUState *cs) + + if (env->exception_injected == EXCP08_DBLE) { + /* this means triple fault */ +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + cs->exit_request = 1; + return 0; + } +diff --git a/target/s390x/helper.c b/target/s390x/helper.c +index 68bd2f9..d2bb9aa 100644 +--- a/target/s390x/helper.c ++++ b/target/s390x/helper.c +@@ -266,7 +266,7 @@ void load_psw(CPUS390XState *env, uint64_t mask, uint64_t addr) + S390CPU *cpu = s390_env_get_cpu(env); + if (s390_cpu_halt(cpu) == 0) { + #ifndef CONFIG_USER_ONLY +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + #endif + } + } +diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c +index ac47154..c2ffcd6 100644 +--- a/target/s390x/kvm.c ++++ b/target/s390x/kvm.c +@@ -1929,7 +1929,7 @@ static int handle_intercept(S390CPU *cpu) + cpu_synchronize_state(cs); + if (s390_cpu_halt(cpu) == 0) { + if (is_special_wait_psw(cs)) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } else { + qemu_system_guest_panicked(NULL); + } +@@ -1938,7 +1938,7 @@ static int handle_intercept(S390CPU *cpu) + break; + case ICPT_CPU_STOP: + if (s390_cpu_set_state(CPU_STATE_STOPPED, cpu) == 0) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } + if (cpu->env.sigp_order == SIGP_STOP_STORE_STATUS) { + kvm_s390_store_status(cpu, KVM_S390_STORE_STATUS_DEF_ADDR, +diff --git a/target/s390x/misc_helper.c b/target/s390x/misc_helper.c +index 93b0e61..0473fab 100644 +--- a/target/s390x/misc_helper.c ++++ b/target/s390x/misc_helper.c +@@ -530,11 +530,11 @@ uint32_t HELPER(sigp)(CPUS390XState *env, uint64_t order_code, uint32_t r1, + break; + #if !defined(CONFIG_USER_ONLY) + case SIGP_RESTART: +- qemu_system_reset_request(); ++ qemu_system_reset_request(SHUTDOWN_CAUSE_GUEST_RESET); + cpu_loop_exit(CPU(s390_env_get_cpu(env))); + break; + case SIGP_STOP: +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + cpu_loop_exit(CPU(s390_env_get_cpu(env))); + break; + #endif +diff --git a/target/sparc/int32_helper.c b/target/sparc/int32_helper.c +index 09afe13..eec9a4d 100644 +--- a/target/sparc/int32_helper.c ++++ b/target/sparc/int32_helper.c +@@ -109,7 +109,7 @@ void sparc_cpu_do_interrupt(CPUState *cs) + if (env->psret == 0) { + if (cs->exception_index == 0x80 && + env->def->features & CPU_FEATURE_TA0_SHUTDOWN) { +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); + } else { + cpu_abort(cs, "Trap 0x%02x while interrupts disabled, Error state", + cs->exception_index); +diff --git a/trace-events b/trace-events +index b07a09b..4db44d0 100644 +--- a/trace-events ++++ b/trace-events +@@ -38,7 +38,7 @@ vm_state_notify(int running, int reason) "running %d reason %d" + load_file(const char *name, const char *path) "name %s location %s" + runstate_set(int new_state) "new state %d" + system_wakeup_request(int reason) "reason=%d" +-qemu_system_shutdown_request(void) "" ++qemu_system_shutdown_request(int reason) "reason=%d" + qemu_system_powerdown_request(void) "" + + # spice-qemu-char.c +diff --git a/ui/cocoa.m b/ui/cocoa.m +index c81f7b6..ff29e48 100644 +--- a/ui/cocoa.m ++++ b/ui/cocoa.m +@@ -905,7 +905,7 @@ QemuCocoaView *cocoaView; + { + COCOA_DEBUG("QemuCocoaAppController: applicationWillTerminate\n"); + +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); + exit(0); + } + +diff --git a/ui/sdl.c b/ui/sdl.c +index 37c21a0..bd51ffd 100644 +--- a/ui/sdl.c ++++ b/ui/sdl.c +@@ -837,7 +837,7 @@ static void sdl_refresh(DisplayChangeListener *dcl) + case SDL_QUIT: + if (!no_quit) { + no_shutdown = 0; +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); + } + break; + case SDL_MOUSEMOTION: +diff --git a/ui/sdl2.c b/ui/sdl2.c +index faf9bdf..e092636 100644 +--- a/ui/sdl2.c ++++ b/ui/sdl2.c +@@ -568,7 +568,7 @@ static void handle_windowevent(SDL_Event *ev) + case SDL_WINDOWEVENT_CLOSE: + if (!no_quit) { + no_shutdown = 0; +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); + } + break; + case SDL_WINDOWEVENT_SHOWN: +@@ -611,7 +611,7 @@ void sdl2_poll_events(struct sdl2_console *scon) + case SDL_QUIT: + if (!no_quit) { + no_shutdown = 0; +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI); + } + break; + case SDL_MOUSEMOTION: +diff --git a/vl.c b/vl.c +index 18fdef2..76d7708 100644 +--- a/vl.c ++++ b/vl.c +@@ -1723,7 +1723,7 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) + if (!no_shutdown) { + qapi_event_send_guest_panicked(GUEST_PANIC_ACTION_POWEROFF, + !!info, info, &error_abort); +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_PANIC); + } + + if (info) { +@@ -1740,13 +1740,12 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) + } + } + +-void qemu_system_reset_request(void) ++void qemu_system_reset_request(ShutdownCause reason) + { + if (no_reboot) { +- /* TODO - add a parameter to allow callers to specify reason */ +- shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR; ++ shutdown_requested = reason; + } else { +- reset_requested = SHUTDOWN_CAUSE_HOST_ERROR; ++ reset_requested = reason; + } + cpu_stop_current(); + qemu_notify_event(); +@@ -1817,12 +1816,11 @@ void qemu_system_killed(int signal, pid_t pid) + qemu_notify_event(); + } + +-void qemu_system_shutdown_request(void) ++void qemu_system_shutdown_request(ShutdownCause reason) + { +- trace_qemu_system_shutdown_request(); +- /* TODO - add a parameter to allow callers to specify reason */ +- replay_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); +- shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR; ++ trace_qemu_system_shutdown_request(reason); ++ replay_shutdown_request(reason); ++ shutdown_requested = reason; + qemu_notify_event(); + } + +diff --git a/xen-hvm.c b/xen-hvm.c +index 858e934..09d3190 100644 +--- a/xen-hvm.c ++++ b/xen-hvm.c +@@ -1391,7 +1391,7 @@ void xen_shutdown_fatal_error(const char *fmt, ...) + va_end(ap); + fprintf(stderr, "Will destroy the domain.\n"); + /* destroy the domain */ +- qemu_system_shutdown_request(); ++ qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); + } + + void xen_modified_memory(ram_addr_t start, ram_addr_t length) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-shutdown-Expose-bool-cause-in-SHUTDOWN-and-RESET-eve.patch b/SOURCES/kvm-shutdown-Expose-bool-cause-in-SHUTDOWN-and-RESET-eve.patch new file mode 100644 index 0000000..76edffc --- /dev/null +++ b/SOURCES/kvm-shutdown-Expose-bool-cause-in-SHUTDOWN-and-RESET-eve.patch @@ -0,0 +1,352 @@ +From 769222403cfbd340ea3358eb1322907c550e5911 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 1 Jun 2017 16:58:21 +0200 +Subject: [PATCH 05/17] shutdown: Expose bool cause in SHUTDOWN and RESET + events + +RH-Author: Eric Blake +Message-id: <20170601165821.26810-6-eblake@redhat.com> +Patchwork-id: 75466 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 5/5] shutdown: Expose bool cause in SHUTDOWN and RESET events +Bugzilla: 1418927 +RH-Acked-by: John Snow +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth + +Libvirt would like to be able to distinguish between a SHUTDOWN +event triggered solely by guest request and one triggered by a +SIGTERM or other action on the host. While qemu_kill_report() was +already able to give different output to stderr based on whether a +shutdown was triggered by a host signal (but NOT by a host UI event, +such as clicking the X on the window), that information was then +lost to management. The previous patches improved things to use an +enum throughout all callsites, so now we have something ready to +expose through QMP. + +Note that for now, the decision was to expose ONLY a boolean, +rather than promoting ShutdownCause to a QAPI enum; this is because +libvirt has not expressed an interest in anything finer-grained. +We can still add additional details, in a backwards-compatible +manner, if a need later arises (if the addition happens before 2.10, +we can replace the bool with an enum; otherwise, the enum will have +to be in addition to the bool); this patch merely adds a helper +shutdown_caused_by_guest() to map the internal enum into the +external boolean. + +Update expected iotest outputs to match the new data (complete +coverage of the affected tests is obtained by -raw, -qcow2, and -nbd). + +Here is output from 'virsh qemu-monitor-event --loop' with the +patch installed: + +event SHUTDOWN at 1492639680.731251 for domain fedora_13: {"guest":true} +event STOP at 1492639680.732116 for domain fedora_13: +event SHUTDOWN at 1492639680.732830 for domain fedora_13: {"guest":false} + +Note that libvirt runs qemu with -no-shutdown: the first SHUTDOWN event +was triggered by an action I took directly in the guest (shutdown -h), +at which point qemu stops the vcpus and waits for libvirt to do any +final cleanups; the second SHUTDOWN event is the result of libvirt +sending SIGTERM now that it has completed cleanup. Libvirt is already +smart enough to only feed the first qemu SHUTDOWN event to the end user +(remember, virsh qemu-monitor-event is a low-level debugging interface +that is explicitly unsupported by libvirt, so it sees things that normal +end users do not); changing qemu to emit SHUTDOWN only once is outside +the scope of this series. + +See also https://bugzilla.redhat.com/1384007 + +Signed-off-by: Eric Blake +Message-Id: <20170515214114.15442-6-eblake@redhat.com> +Reviewed-by: Markus Armbruster +Signed-off-by: Markus Armbruster +(cherry picked from commit 08fba7ac9b618516a5f1d096f78a7e2837fe0594) +Signed-off-by: Miroslav Rezanina +--- + include/sysemu/sysemu.h | 5 +++++ + qapi/event.json | 17 +++++++++++++---- + tests/qemu-iotests/071.out | 4 ++-- + tests/qemu-iotests/081.out | 2 +- + tests/qemu-iotests/087.out | 12 ++++++------ + tests/qemu-iotests/094.out | 2 +- + tests/qemu-iotests/117.out | 2 +- + tests/qemu-iotests/119.out | 2 +- + tests/qemu-iotests/120.out | 2 +- + tests/qemu-iotests/140.out | 2 +- + tests/qemu-iotests/143.out | 2 +- + tests/qemu-iotests/156.out | 2 +- + vl.c | 8 ++++---- + 13 files changed, 38 insertions(+), 24 deletions(-) + +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 01a2c67..9e6f174 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -49,6 +49,11 @@ typedef enum ShutdownCause { + SHUTDOWN_CAUSE__MAX, + } ShutdownCause; + ++static inline bool shutdown_caused_by_guest(ShutdownCause cause) ++{ ++ return cause >= SHUTDOWN_CAUSE_GUEST_SHUTDOWN; ++} ++ + void vm_start(void); + int vm_prepare_start(void); + int vm_stop(RunState state); +diff --git a/qapi/event.json b/qapi/event.json +index e80f3f4..6d22b02 100644 +--- a/qapi/event.json ++++ b/qapi/event.json +@@ -10,6 +10,10 @@ + # Emitted when the virtual machine has shut down, indicating that qemu is + # about to exit. + # ++# @guest: If true, the shutdown was triggered by a guest request (such as ++# a guest-initiated ACPI shutdown request or other hardware-specific action) ++# rather than a host request (such as sending qemu a SIGINT). (since 2.10) ++# + # Note: If the command-line option "-no-shutdown" has been specified, qemu will + # not exit, and a STOP event will eventually follow the SHUTDOWN event + # +@@ -17,11 +21,11 @@ + # + # Example: + # +-# <- { "event": "SHUTDOWN", ++# <- { "event": "SHUTDOWN", "data": { "guest": true }, + # "timestamp": { "seconds": 1267040730, "microseconds": 682951 } } + # + ## +-{ 'event': 'SHUTDOWN' } ++{ 'event': 'SHUTDOWN', 'data': { 'guest': 'bool' } } + + ## + # @POWERDOWN: +@@ -44,15 +48,20 @@ + # + # Emitted when the virtual machine is reset + # ++# @guest: If true, the reset was triggered by a guest request (such as ++# a guest-initiated ACPI reboot request or other hardware-specific action) ++# rather than a host request (such as the QMP command system_reset). ++# (since 2.10) ++# + # Since: 0.12.0 + # + # Example: + # +-# <- { "event": "RESET", ++# <- { "event": "RESET", "data": { "guest": false }, + # "timestamp": { "seconds": 1267041653, "microseconds": 9518 } } + # + ## +-{ 'event': 'RESET' } ++{ 'event': 'RESET', 'data': { 'guest': 'bool' } } + + ## + # @STOP: +diff --git a/tests/qemu-iotests/071.out b/tests/qemu-iotests/071.out +index dd879f1..1d5e28d 100644 +--- a/tests/qemu-iotests/071.out ++++ b/tests/qemu-iotests/071.out +@@ -46,7 +46,7 @@ QMP_VERSION + read failed: Input/output error + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + === Testing blkverify on existing block device === +@@ -85,7 +85,7 @@ wrote 512/512 bytes at offset 0 + read failed: Input/output error + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + QEMU_PROG: Failed to flush the L2 table cache: Input/output error + QEMU_PROG: Failed to flush the refcount block cache: Input/output error + +diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out +index 97df69d..2533c31 100644 +--- a/tests/qemu-iotests/081.out ++++ b/tests/qemu-iotests/081.out +@@ -36,7 +36,7 @@ read 10485760/10485760 bytes at offset 0 + 10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + == using quorum rewrite corrupted mode == +diff --git a/tests/qemu-iotests/087.out b/tests/qemu-iotests/087.out +index dc6baf9..59c5208 100644 +--- a/tests/qemu-iotests/087.out ++++ b/tests/qemu-iotests/087.out +@@ -8,7 +8,7 @@ QMP_VERSION + {"return": {}} + {"error": {"class": "GenericError", "desc": "'node-name' must be specified for the root node"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + === Duplicate ID === +@@ -19,7 +19,7 @@ QMP_VERSION + {"error": {"class": "GenericError", "desc": "node-name=disk is conflicting with a device id"}} + {"error": {"class": "GenericError", "desc": "Duplicate node name"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + === aio=native without O_DIRECT === +@@ -29,7 +29,7 @@ QMP_VERSION + {"return": {}} + {"error": {"class": "GenericError", "desc": "aio=native was specified, but it requires cache.direct=on, which was not specified."}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + === Encrypted image === +@@ -40,14 +40,14 @@ QMP_VERSION + {"return": {}} + {"error": {"class": "GenericError", "desc": "Use of AES-CBC encrypted IMGFMT images is no longer supported in system emulators"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + Testing: + QMP_VERSION + {"return": {}} + {"error": {"class": "GenericError", "desc": "Use of AES-CBC encrypted IMGFMT images is no longer supported in system emulators"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + + === Missing driver === +@@ -58,6 +58,6 @@ QMP_VERSION + {"return": {}} + {"error": {"class": "GenericError", "desc": "Parameter 'driver' is missing"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + *** done +diff --git a/tests/qemu-iotests/094.out b/tests/qemu-iotests/094.out +index b66dc07..f52baff 100644 +--- a/tests/qemu-iotests/094.out ++++ b/tests/qemu-iotests/094.out +@@ -7,5 +7,5 @@ Formatting 'TEST_DIR/source.IMGFMT', fmt=IMGFMT size=67108864 + {"return": {}} + {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "src", "len": 67108864, "offset": 67108864, "speed": 0, "type": "mirror"}} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + *** done +diff --git a/tests/qemu-iotests/117.out b/tests/qemu-iotests/117.out +index f52dc1a..851e214 100644 +--- a/tests/qemu-iotests/117.out ++++ b/tests/qemu-iotests/117.out +@@ -7,7 +7,7 @@ wrote 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + No errors were found on the image. + read 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +diff --git a/tests/qemu-iotests/119.out b/tests/qemu-iotests/119.out +index 58e7114..a8743b8 100644 +--- a/tests/qemu-iotests/119.out ++++ b/tests/qemu-iotests/119.out +@@ -6,6 +6,6 @@ read 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + *** done +diff --git a/tests/qemu-iotests/120.out b/tests/qemu-iotests/120.out +index 9131b1b..1af1aeb 100644 +--- a/tests/qemu-iotests/120.out ++++ b/tests/qemu-iotests/120.out +@@ -6,7 +6,7 @@ wrote 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + {"return": ""} + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + read 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + read 65536/65536 bytes at offset 0 +diff --git a/tests/qemu-iotests/140.out b/tests/qemu-iotests/140.out +index 6c04456..0689b2b 100644 +--- a/tests/qemu-iotests/140.out ++++ b/tests/qemu-iotests/140.out +@@ -10,5 +10,5 @@ read 65536/65536 bytes at offset 0 + {"return": {}} + can't open device nbd+unix:///drv?socket=TEST_DIR/nbd: No export with name 'drv' available + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + *** done +diff --git a/tests/qemu-iotests/143.out b/tests/qemu-iotests/143.out +index d24ad20..0978b89 100644 +--- a/tests/qemu-iotests/143.out ++++ b/tests/qemu-iotests/143.out +@@ -3,5 +3,5 @@ QA output created by 143 + {"return": {}} + can't open device nbd+unix:///no_such_export?socket=TEST_DIR/nbd: No export with name 'no_such_export' available + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + *** done +diff --git a/tests/qemu-iotests/156.out b/tests/qemu-iotests/156.out +index 3af82ae..f96a564 100644 +--- a/tests/qemu-iotests/156.out ++++ b/tests/qemu-iotests/156.out +@@ -34,7 +34,7 @@ read 65536/65536 bytes at offset 196608 + {"return": ""} + + {"return": {}} +-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"} ++{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}} + + read 65536/65536 bytes at offset 0 + 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +diff --git a/vl.c b/vl.c +index 76d7708..518b3cb 100644 +--- a/vl.c ++++ b/vl.c +@@ -1704,8 +1704,8 @@ void qemu_system_reset(ShutdownCause reason) + qemu_devices_reset(); + } + if (reason) { +- /* TODO update event based on reason */ +- qapi_event_send_reset(&error_abort); ++ qapi_event_send_reset(shutdown_caused_by_guest(reason), ++ &error_abort); + } + cpu_synchronize_all_post_reset(); + } +@@ -1862,8 +1862,8 @@ static bool main_loop_should_exit(void) + request = qemu_shutdown_requested(); + if (request) { + qemu_kill_report(); +- /* TODO update event based on request */ +- qapi_event_send_shutdown(&error_abort); ++ qapi_event_send_shutdown(shutdown_caused_by_guest(request), ++ &error_abort); + if (no_shutdown) { + vm_stop(RUN_STATE_SHUTDOWN); + } else { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-shutdown-Prepare-for-use-of-an-enum-in-reset-shutdow.patch b/SOURCES/kvm-shutdown-Prepare-for-use-of-an-enum-in-reset-shutdow.patch new file mode 100644 index 0000000..0e7fc3e --- /dev/null +++ b/SOURCES/kvm-shutdown-Prepare-for-use-of-an-enum-in-reset-shutdow.patch @@ -0,0 +1,315 @@ +From 2b77727b356747ab6b91af0400f4a6f1a7d36a40 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 1 Jun 2017 16:58:18 +0200 +Subject: [PATCH 02/17] shutdown: Prepare for use of an enum in + reset/shutdown_request + +RH-Author: Eric Blake +Message-id: <20170601165821.26810-3-eblake@redhat.com> +Patchwork-id: 75465 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 2/5] shutdown: Prepare for use of an enum in reset/shutdown_request +Bugzilla: 1418927 +RH-Acked-by: John Snow +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth + +We want to track why a guest was shutdown; in particular, being able +to tell the difference between a guest request (such as ACPI request) +and host request (such as SIGINT) will prove useful to libvirt. +Since all requests eventually end up changing shutdown_requested in +vl.c, the logical change is to make that value track the reason, +rather than its current 0/1 contents. + +Since command-line options control whether a reset request is turned +into a shutdown request instead, the same treatment is given to +reset_requested. + +This patch adds an internal enum ShutdownCause that describes reasons +that a shutdown can be requested, and changes qemu_system_reset() to +pass the reason through, although for now nothing is actually changed +with regards to what gets reported. The enum could be exported via +QAPI at a later date, if deemed necessary, but for now, there has not +been a request to expose that much detail to end clients. + +For the most part, we turn 0 into SHUTDOWN_CAUSE_NONE, and 1 into +SHUTDOWN_CAUSE_HOST_ERROR; the only specific case where we have enough +information right now to use a different value is when we are reacting +to a host signal. It will take a further patch to edit all call-sites +that can trigger a reset or shutdown request to properly pass in any +other reasons; this patch includes TODOs to point such places out. + +qemu_system_reset() trades its 'bool report' parameter for a +'ShutdownCause reason', with all non-zero values having the same +effect; this lets us get rid of the weird #defines for VMRESET_* +as synonyms for bools. + +Signed-off-by: Eric Blake +Message-Id: <20170515214114.15442-3-eblake@redhat.com> +Reviewed-by: Markus Armbruster +Signed-off-by: Markus Armbruster +(cherry picked from commit aedbe19297907143f17b733a7ff0e0534377bed1) +Signed-off-by: Miroslav Rezanina +--- + include/sysemu/sysemu.h | 23 ++++++++++++++++----- + migration/colo.c | 2 +- + migration/savevm.c | 2 +- + vl.c | 53 ++++++++++++++++++++++++++++++------------------- + xen-hvm.c | 7 +++++-- + 5 files changed, 58 insertions(+), 29 deletions(-) + +diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h +index 1fd51a8..f942562 100644 +--- a/include/sysemu/sysemu.h ++++ b/include/sysemu/sysemu.h +@@ -33,8 +33,21 @@ VMChangeStateEntry *qemu_add_vm_change_state_handler(VMChangeStateHandler *cb, + void qemu_del_vm_change_state_handler(VMChangeStateEntry *e); + void vm_state_notify(int running, RunState state); + +-#define VMRESET_SILENT false +-#define VMRESET_REPORT true ++/* Enumeration of various causes for shutdown. */ ++typedef enum ShutdownCause { ++ SHUTDOWN_CAUSE_NONE, /* No shutdown request pending */ ++ SHUTDOWN_CAUSE_HOST_ERROR, /* An error prevents further use of guest */ ++ SHUTDOWN_CAUSE_HOST_QMP, /* Reaction to a QMP command, like 'quit' */ ++ SHUTDOWN_CAUSE_HOST_SIGNAL, /* Reaction to a signal, such as SIGINT */ ++ SHUTDOWN_CAUSE_HOST_UI, /* Reaction to UI event, like window close */ ++ SHUTDOWN_CAUSE_GUEST_SHUTDOWN,/* Guest shutdown/suspend request, via ++ ACPI or other hardware-specific means */ ++ SHUTDOWN_CAUSE_GUEST_RESET, /* Guest reset request, and command line ++ turns that into a shutdown */ ++ SHUTDOWN_CAUSE_GUEST_PANIC, /* Guest panicked, and command line turns ++ that into a shutdown */ ++ SHUTDOWN_CAUSE__MAX, ++} ShutdownCause; + + void vm_start(void); + int vm_prepare_start(void); +@@ -62,10 +75,10 @@ void qemu_system_debug_request(void); + void qemu_system_vmstop_request(RunState reason); + void qemu_system_vmstop_request_prepare(void); + bool qemu_vmstop_requested(RunState *r); +-int qemu_shutdown_requested_get(void); +-int qemu_reset_requested_get(void); ++ShutdownCause qemu_shutdown_requested_get(void); ++ShutdownCause qemu_reset_requested_get(void); + void qemu_system_killed(int signal, pid_t pid); +-void qemu_system_reset(bool report); ++void qemu_system_reset(ShutdownCause reason); + void qemu_system_guest_panicked(GuestPanicInformation *info); + size_t qemu_target_page_bits(void); + +diff --git a/migration/colo.c b/migration/colo.c +index 963c802..12d355a 100644 +--- a/migration/colo.c ++++ b/migration/colo.c +@@ -623,7 +623,7 @@ void *colo_process_incoming_thread(void *opaque) + } + + qemu_mutex_lock_iothread(); +- qemu_system_reset(VMRESET_SILENT); ++ qemu_system_reset(SHUTDOWN_CAUSE_NONE); + vmstate_loading = true; + if (qemu_loadvm_state(fb) < 0) { + error_report("COLO: loadvm failed"); +diff --git a/migration/savevm.c b/migration/savevm.c +index 6e2f9e7..483c05f 100644 +--- a/migration/savevm.c ++++ b/migration/savevm.c +@@ -2368,7 +2368,7 @@ int load_vmstate(const char *name) + return -EINVAL; + } + +- qemu_system_reset(VMRESET_SILENT); ++ qemu_system_reset(SHUTDOWN_CAUSE_NONE); + mis->from_src_file = f; + + aio_context_acquire(aio_context); +diff --git a/vl.c b/vl.c +index f5dea2c..ea181c6 100644 +--- a/vl.c ++++ b/vl.c +@@ -1596,8 +1596,9 @@ void vm_state_notify(int running, RunState state) + } + } + +-static int reset_requested; +-static int shutdown_requested, shutdown_signal; ++static ShutdownCause reset_requested; ++static ShutdownCause shutdown_requested; ++static int shutdown_signal; + static pid_t shutdown_pid; + static int powerdown_requested; + static int debug_requested; +@@ -1611,19 +1612,19 @@ static NotifierList wakeup_notifiers = + NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); + static uint32_t wakeup_reason_mask = ~(1 << QEMU_WAKEUP_REASON_NONE); + +-int qemu_shutdown_requested_get(void) ++ShutdownCause qemu_shutdown_requested_get(void) + { + return shutdown_requested; + } + +-int qemu_reset_requested_get(void) ++ShutdownCause qemu_reset_requested_get(void) + { + return reset_requested; + } + + static int qemu_shutdown_requested(void) + { +- return atomic_xchg(&shutdown_requested, 0); ++ return atomic_xchg(&shutdown_requested, SHUTDOWN_CAUSE_NONE); + } + + static void qemu_kill_report(void) +@@ -1646,14 +1647,15 @@ static void qemu_kill_report(void) + } + } + +-static int qemu_reset_requested(void) ++static ShutdownCause qemu_reset_requested(void) + { +- int r = reset_requested; ++ ShutdownCause r = reset_requested; ++ + if (r && replay_checkpoint(CHECKPOINT_RESET_REQUESTED)) { +- reset_requested = 0; ++ reset_requested = SHUTDOWN_CAUSE_NONE; + return r; + } +- return false; ++ return SHUTDOWN_CAUSE_NONE; + } + + static int qemu_suspend_requested(void) +@@ -1685,7 +1687,10 @@ static int qemu_debug_requested(void) + return r; + } + +-void qemu_system_reset(bool report) ++/* ++ * Reset the VM. Issue an event unless @reason is SHUTDOWN_CAUSE_NONE. ++ */ ++void qemu_system_reset(ShutdownCause reason) + { + MachineClass *mc; + +@@ -1698,7 +1703,8 @@ void qemu_system_reset(bool report) + } else { + qemu_devices_reset(); + } +- if (report) { ++ if (reason) { ++ /* TODO update event based on reason */ + qapi_event_send_reset(&error_abort); + } + cpu_synchronize_all_post_reset(); +@@ -1737,9 +1743,10 @@ void qemu_system_guest_panicked(GuestPanicInformation *info) + void qemu_system_reset_request(void) + { + if (no_reboot) { +- shutdown_requested = 1; ++ /* TODO - add a parameter to allow callers to specify reason */ ++ shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR; + } else { +- reset_requested = 1; ++ reset_requested = SHUTDOWN_CAUSE_HOST_ERROR; + } + cpu_stop_current(); + qemu_notify_event(); +@@ -1806,7 +1813,7 @@ void qemu_system_killed(int signal, pid_t pid) + /* Cannot call qemu_system_shutdown_request directly because + * we are in a signal handler. + */ +- shutdown_requested = 1; ++ shutdown_requested = SHUTDOWN_CAUSE_HOST_SIGNAL; + qemu_notify_event(); + } + +@@ -1814,7 +1821,8 @@ void qemu_system_shutdown_request(void) + { + trace_qemu_system_shutdown_request(); + replay_shutdown_request(); +- shutdown_requested = 1; ++ /* TODO - add a parameter to allow callers to specify reason */ ++ shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR; + qemu_notify_event(); + } + +@@ -1845,14 +1853,18 @@ void qemu_system_debug_request(void) + static bool main_loop_should_exit(void) + { + RunState r; ++ ShutdownCause request; ++ + if (qemu_debug_requested()) { + vm_stop(RUN_STATE_DEBUG); + } + if (qemu_suspend_requested()) { + qemu_system_suspend(); + } +- if (qemu_shutdown_requested()) { ++ request = qemu_shutdown_requested(); ++ if (request) { + qemu_kill_report(); ++ /* TODO update event based on request */ + qapi_event_send_shutdown(&error_abort); + if (no_shutdown) { + vm_stop(RUN_STATE_SHUTDOWN); +@@ -1860,9 +1872,10 @@ static bool main_loop_should_exit(void) + return true; + } + } +- if (qemu_reset_requested()) { ++ request = qemu_reset_requested(); ++ if (request) { + pause_all_vcpus(); +- qemu_system_reset(VMRESET_REPORT); ++ qemu_system_reset(request); + resume_all_vcpus(); + if (!runstate_check(RUN_STATE_RUNNING) && + !runstate_check(RUN_STATE_INMIGRATE)) { +@@ -1871,7 +1884,7 @@ static bool main_loop_should_exit(void) + } + if (qemu_wakeup_requested()) { + pause_all_vcpus(); +- qemu_system_reset(VMRESET_SILENT); ++ qemu_system_reset(SHUTDOWN_CAUSE_NONE); + notifier_list_notify(&wakeup_notifiers, &wakeup_reason); + wakeup_reason = QEMU_WAKEUP_REASON_NONE; + resume_all_vcpus(); +@@ -4689,7 +4702,7 @@ int main(int argc, char **argv, char **envp) + reading from the other reads, because timer polling functions query + clock values from the log. */ + replay_checkpoint(CHECKPOINT_RESET); +- qemu_system_reset(VMRESET_SILENT); ++ qemu_system_reset(SHUTDOWN_CAUSE_NONE); + register_global_state(); + if (replay_mode != REPLAY_MODE_NONE) { + replay_vmstate_init(); +diff --git a/xen-hvm.c b/xen-hvm.c +index 5043beb..858e934 100644 +--- a/xen-hvm.c ++++ b/xen-hvm.c +@@ -1090,11 +1090,14 @@ static void cpu_handle_ioreq(void *opaque) + * causes Xen to powerdown the domain. + */ + if (runstate_is_running()) { ++ ShutdownCause request; ++ + if (qemu_shutdown_requested_get()) { + destroy_hvm_domain(false); + } +- if (qemu_reset_requested_get()) { +- qemu_system_reset(VMRESET_REPORT); ++ request = qemu_reset_requested_get(); ++ if (request) { ++ qemu_system_reset(request); + destroy_hvm_domain(true); + } + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-shutdown-Preserve-shutdown-cause-through-replay.patch b/SOURCES/kvm-shutdown-Preserve-shutdown-cause-through-replay.patch new file mode 100644 index 0000000..8b8c0bc --- /dev/null +++ b/SOURCES/kvm-shutdown-Preserve-shutdown-cause-through-replay.patch @@ -0,0 +1,126 @@ +From 42b5017297d569a4b1e015b5398488bec24f09da Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 1 Jun 2017 16:58:19 +0200 +Subject: [PATCH 03/17] shutdown: Preserve shutdown cause through replay + +RH-Author: Eric Blake +Message-id: <20170601165821.26810-4-eblake@redhat.com> +Patchwork-id: 75468 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 3/5] shutdown: Preserve shutdown cause through replay +Bugzilla: 1418927 +RH-Acked-by: John Snow +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth + +With the recent addition of ShutdownCause, we want to be able to pass +a cause through any shutdown request, and then faithfully replay that +cause when later replaying the same sequence. The easiest way is to +expand the reply event mechanism to track a series of values for +EVENT_SHUTDOWN, one corresponding to each value of ShutdownCause. + +We are free to change the replay stream as needed, since there are +already no guarantees about being able to use a replay stream by +any other version of qemu than the one that generated it. + +The cause is not actually fed back until the next patch changes the +signature for requesting a shutdown; a TODO marks that upcoming change. + +Yes, this uses the gcc/clang extension of a ranged case label, +but this is not the first time we've used non-C99 constructs. + +Signed-off-by: Eric Blake +Reviewed-by: Pavel Dovgalyuk +Message-Id: <20170515214114.15442-4-eblake@redhat.com> +Reviewed-by: Markus Armbruster +Signed-off-by: Markus Armbruster +(cherry picked from commit 802f045a5f61b781df55e4492d896b4d20503ba7) +Signed-off-by: Miroslav Rezanina +--- + include/sysemu/replay.h | 3 ++- + replay/replay-internal.h | 3 ++- + replay/replay.c | 7 ++++--- + vl.c | 2 +- + 4 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/include/sysemu/replay.h b/include/sysemu/replay.h +index f1c0712..fa14d0e 100644 +--- a/include/sysemu/replay.h ++++ b/include/sysemu/replay.h +@@ -13,6 +13,7 @@ + */ + + #include "qapi-types.h" ++#include "sysemu.h" + + /* replay clock kinds */ + enum ReplayClockKind { +@@ -98,7 +99,7 @@ int64_t replay_read_clock(ReplayClockKind kind); + /* Events */ + + /*! Called when qemu shutdown is requested. */ +-void replay_shutdown_request(void); ++void replay_shutdown_request(ShutdownCause cause); + /*! Should be called at check points in the execution. + These check points are skipped, if they were not met. + Saves checkpoint in the SAVE mode and validates in the PLAY mode. +diff --git a/replay/replay-internal.h b/replay/replay-internal.h +index ed66ed8..3ebb199 100644 +--- a/replay/replay-internal.h ++++ b/replay/replay-internal.h +@@ -22,8 +22,9 @@ enum ReplayEvents { + EVENT_EXCEPTION, + /* for async events */ + EVENT_ASYNC, +- /* for shutdown request */ ++ /* for shutdown requests, range allows recovery of ShutdownCause */ + EVENT_SHUTDOWN, ++ EVENT_SHUTDOWN_LAST = EVENT_SHUTDOWN + SHUTDOWN_CAUSE__MAX, + /* for character device write event */ + EVENT_CHAR_WRITE, + /* for character device read all event */ +diff --git a/replay/replay.c b/replay/replay.c +index f810628..bf94e81 100644 +--- a/replay/replay.c ++++ b/replay/replay.c +@@ -49,8 +49,9 @@ bool replay_next_event_is(int event) + res = true; + } + switch (replay_state.data_kind) { +- case EVENT_SHUTDOWN: ++ case EVENT_SHUTDOWN ... EVENT_SHUTDOWN_LAST: + replay_finish_event(); ++ /* TODO - pass replay_state.data_kind - EVENT_SHUTDOWN as cause */ + qemu_system_shutdown_request(); + break; + default: +@@ -170,11 +171,11 @@ bool replay_has_interrupt(void) + return res; + } + +-void replay_shutdown_request(void) ++void replay_shutdown_request(ShutdownCause cause) + { + if (replay_mode == REPLAY_MODE_RECORD) { + replay_mutex_lock(); +- replay_put_event(EVENT_SHUTDOWN); ++ replay_put_event(EVENT_SHUTDOWN + cause); + replay_mutex_unlock(); + } + } +diff --git a/vl.c b/vl.c +index ea181c6..18fdef2 100644 +--- a/vl.c ++++ b/vl.c +@@ -1820,8 +1820,8 @@ void qemu_system_killed(int signal, pid_t pid) + void qemu_system_shutdown_request(void) + { + trace_qemu_system_shutdown_request(); +- replay_shutdown_request(); + /* TODO - add a parameter to allow callers to specify reason */ ++ replay_shutdown_request(SHUTDOWN_CAUSE_HOST_ERROR); + shutdown_requested = SHUTDOWN_CAUSE_HOST_ERROR; + qemu_notify_event(); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-shutdown-Simplify-shutdown_signal.patch b/SOURCES/kvm-shutdown-Simplify-shutdown_signal.patch new file mode 100644 index 0000000..af78fe9 --- /dev/null +++ b/SOURCES/kvm-shutdown-Simplify-shutdown_signal.patch @@ -0,0 +1,65 @@ +From f6a5bfe48ac9cddf5baa2de1e7ae9ca119251079 Mon Sep 17 00:00:00 2001 +From: Eric Blake +Date: Thu, 1 Jun 2017 16:58:17 +0200 +Subject: [PATCH 01/17] shutdown: Simplify shutdown_signal + +RH-Author: Eric Blake +Message-id: <20170601165821.26810-2-eblake@redhat.com> +Patchwork-id: 75464 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2 1/5] shutdown: Simplify shutdown_signal +Bugzilla: 1418927 +RH-Acked-by: John Snow +RH-Acked-by: Markus Armbruster +RH-Acked-by: Thomas Huth + +There is no signal 0 (kill(pid, 0) has special semantics to probe whether +a process is alive), rather than actually sending a signal 0). So we +can use the simpler 0, instead of -1, for our sentinel of whether a +shutdown request due to a signal has happened. + +Suggested-by: Markus Armbruster +Signed-off-by: Eric Blake +Reviewed-by: Markus Armbruster +Reviewed-by: Alistair Francis +Message-Id: <20170515214114.15442-2-eblake@redhat.com> +Signed-off-by: Markus Armbruster +(cherry picked from commit 7af88279e4972dd6bf735b620876d54b7a355c4d) +Signed-off-by: Miroslav Rezanina +--- + vl.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/vl.c b/vl.c +index 183f070..f5dea2c 100644 +--- a/vl.c ++++ b/vl.c +@@ -1597,7 +1597,7 @@ void vm_state_notify(int running, RunState state) + } + + static int reset_requested; +-static int shutdown_requested, shutdown_signal = -1; ++static int shutdown_requested, shutdown_signal; + static pid_t shutdown_pid; + static int powerdown_requested; + static int debug_requested; +@@ -1628,7 +1628,7 @@ static int qemu_shutdown_requested(void) + + static void qemu_kill_report(void) + { +- if (!qtest_driver() && shutdown_signal != -1) { ++ if (!qtest_driver() && shutdown_signal) { + if (shutdown_pid == 0) { + /* This happens for eg ^C at the terminal, so it's worth + * avoiding printing an odd message in that case. +@@ -1642,7 +1642,7 @@ static void qemu_kill_report(void) + shutdown_cmd ? shutdown_cmd : ""); + g_free(shutdown_cmd); + } +- shutdown_signal = -1; ++ shutdown_signal = 0; + } + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-sockets-ensure-we-can-bind-to-both-ipv4-ipv6-separat.patch b/SOURCES/kvm-sockets-ensure-we-can-bind-to-both-ipv4-ipv6-separat.patch new file mode 100644 index 0000000..1793b97 --- /dev/null +++ b/SOURCES/kvm-sockets-ensure-we-can-bind-to-both-ipv4-ipv6-separat.patch @@ -0,0 +1,112 @@ +From 469e40bd297c29f28c8ff84105c8c2ea68b6d2b1 Mon Sep 17 00:00:00 2001 +From: "Daniel P. Berrange" +Date: Thu, 22 Jun 2017 12:07:21 +0200 +Subject: [PATCH] sockets: ensure we can bind to both ipv4 & ipv6 separately +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Daniel P. Berrange +Message-id: <20170622120721.7553-1-berrange@redhat.com> +Patchwork-id: 75672 +O-Subject: [RHEL7.4 qemu-kvm-rhev PATCH v2] sockets: ensure we can bind to both ipv4 & ipv6 separately +Bugzilla: 1446003 +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Markus Armbruster +RH-Acked-by: Laszlo Ersek + +When binding to an IPv6 socket we currently force the +IPV6_V6ONLY flag to off. This means that the IPv6 socket +will accept both IPv4 & IPv6 sockets when QEMU is launched +with something like + + -vnc :::1 + +While this is good for that case, it is bad for other +cases. For example if an empty hostname is given, +getaddrinfo resolves it to 2 addresses 0.0.0.0 and ::, +in that order. We will thus bind to 0.0.0.0 first, and +then fail to bind to :: on the same port. The same +problem can happen if any other hostname lookup causes +the IPv4 address to be reported before the IPv6 address. + +When we get an IPv6 bind failure, we should re-try the +same port, but with IPV6_V6ONLY turned on again, to +avoid clash with any IPv4 listener. + +This ensures that + + -vnc :1 + +will bind successfully to both 0.0.0.0 and ::, and also +avoid + + -vnc :1,to=2 + +from mistakenly using a 2nd port for the :: listener. + +This is a regression due to commit 396f935 "ui: add ability to +specify multiple VNC listen addresses". + +Acked-by: Gerd Hoffmann +Reviewed-by: Eric Blake +Reviewed-by: Philippe Mathieu-Daudé +Signed-off-by: Daniel P. Berrange +Signed-off-by: Miroslav Rezanina +--- + util/qemu-sockets.c | 31 +++++++++++++++++++++++-------- + 1 file changed, 23 insertions(+), 8 deletions(-) + +diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c +index 21442c30..11b5c6f 100644 +--- a/util/qemu-sockets.c ++++ b/util/qemu-sockets.c +@@ -207,22 +207,37 @@ static int inet_listen_saddr(InetSocketAddress *saddr, + } + + socket_set_fast_reuse(slisten); +-#ifdef IPV6_V6ONLY +- if (e->ai_family == PF_INET6) { +- /* listen on both ipv4 and ipv6 */ +- const int off = 0; +- qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &off, +- sizeof(off)); +- } +-#endif + + port_min = inet_getport(e); + port_max = saddr->has_to ? saddr->to + port_offset : port_min; + for (p = port_min; p <= port_max; p++) { ++#ifdef IPV6_V6ONLY ++ /* listen on both ipv4 and ipv6 */ ++ int v6only = 0; ++#endif + inet_setport(e, p); ++#ifdef IPV6_V6ONLY ++ rebind: ++ if (e->ai_family == PF_INET6) { ++ qemu_setsockopt(slisten, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, ++ sizeof(v6only)); ++ } ++#endif + if (bind(slisten, e->ai_addr, e->ai_addrlen) == 0) { + goto listen; + } ++ ++#ifdef IPV6_V6ONLY ++ /* If we got EADDRINUSE from an IPv6 bind & V6ONLY is unset, ++ * it could be that the IPv4 port is already claimed, so retry ++ * with V6ONLY set ++ */ ++ if (e->ai_family == PF_INET6 && errno == EADDRINUSE && !v6only) { ++ v6only = 1; ++ goto rebind; ++ } ++#endif ++ + if (p == port_max) { + if (!e->ai_next) { + error_setg_errno(errp, errno, "Failed to bind socket"); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Add-a-no-HPT-encoding-to-HTAB-migration-stream.patch b/SOURCES/kvm-spapr-Add-a-no-HPT-encoding-to-HTAB-migration-stream.patch new file mode 100644 index 0000000..b195d71 --- /dev/null +++ b/SOURCES/kvm-spapr-Add-a-no-HPT-encoding-to-HTAB-migration-stream.patch @@ -0,0 +1,100 @@ +From 34e2297e813de18018e4b50e29f8491c78cafe39 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Tue, 4 Jul 2017 16:32:57 +0200 +Subject: [PATCH 2/4] spapr: Add a "no HPT" encoding to HTAB migration stream + +RH-Author: Laurent Vivier +Message-id: <20170704163258.9846-3-lvivier@redhat.com> +Patchwork-id: 75705 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 2/3] spapr: Add a "no HPT" encoding to HTAB migration stream +Bugzilla: 1456287 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +From: Bharata B Rao + +Add a "no HPT" encoding (using value -1) to the HTAB migration +stream (in the place of HPT size) when the guest doesn't allocate HPT. +This will help the target side to match target HPT with the source HPT +and thus enable successful migration. + +Suggested-by: David Gibson +Signed-off-by: Bharata B Rao +Signed-off-by: David Gibson +(cherry picked from commit 3a38429748aa4f74abaecf16c4c087e8a325e12a) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 29 +++++++++++++++++++++++++---- + 1 file changed, 25 insertions(+), 4 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 2bee3d9..c322666 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1576,13 +1576,19 @@ static int htab_save_setup(QEMUFile *f, void *opaque) + sPAPRMachineState *spapr = opaque; + + /* "Iteration" header */ +- qemu_put_be32(f, spapr->htab_shift); ++ if (!spapr->htab_shift) { ++ qemu_put_be32(f, -1); ++ } else { ++ qemu_put_be32(f, spapr->htab_shift); ++ } + + if (spapr->htab) { + spapr->htab_save_index = 0; + spapr->htab_first_pass = true; + } else { +- assert(kvm_enabled()); ++ if (spapr->htab_shift) { ++ assert(kvm_enabled()); ++ } + } + + +@@ -1728,7 +1734,12 @@ static int htab_save_iterate(QEMUFile *f, void *opaque) + int rc = 0; + + /* Iteration header */ +- qemu_put_be32(f, 0); ++ if (!spapr->htab_shift) { ++ qemu_put_be32(f, -1); ++ return 0; ++ } else { ++ qemu_put_be32(f, 0); ++ } + + if (!spapr->htab) { + assert(kvm_enabled()); +@@ -1762,7 +1773,12 @@ static int htab_save_complete(QEMUFile *f, void *opaque) + int fd; + + /* Iteration header */ +- qemu_put_be32(f, 0); ++ if (!spapr->htab_shift) { ++ qemu_put_be32(f, -1); ++ return 0; ++ } else { ++ qemu_put_be32(f, 0); ++ } + + if (!spapr->htab) { + int rc; +@@ -1806,6 +1822,11 @@ static int htab_load(QEMUFile *f, void *opaque, int version_id) + + section_hdr = qemu_get_be32(f); + ++ if (section_hdr == -1) { ++ spapr_free_hpt(spapr); ++ return 0; ++ } ++ + if (section_hdr) { + Error *local_err = NULL; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Add-ibm-processor-radix-AP-encodings-to-the-de.patch b/SOURCES/kvm-spapr-Add-ibm-processor-radix-AP-encodings-to-the-de.patch new file mode 100644 index 0000000..7cbfa70 --- /dev/null +++ b/SOURCES/kvm-spapr-Add-ibm-processor-radix-AP-encodings-to-the-de.patch @@ -0,0 +1,169 @@ +From cae70bb94adb235e8143c9deea7bd28e90bc5b1c Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:52 +0200 +Subject: [PATCH 17/23] spapr: Add ibm, processor-radix-AP-encodings to the + device tree + +RH-Author: David Gibson +Message-id: <20170427021558.4884-2-dgibson@redhat.com> +Patchwork-id: 74915 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 1/7] spapr: Add ibm, processor-radix-AP-encodings to the device tree +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Sam Bobroff + +Use the new ioctl, KVM_PPC_GET_RMMU_INFO, to fetch radix MMU +information from KVM and present the page encodings in the device tree +under ibm,processor-radix-AP-encodings. This provides page size +information to the guest which is necessary for it to use radix mode. + +Signed-off-by: Sam Bobroff +[dwg: Compile fix for 32-bit targets, style nit fix] +Signed-off-by: David Gibson + +(cherry picked from commit c64abd1f9c732f58181d0a46a0da72168759e77b) +Signed-off-by: Miroslav Rezanina + +Conflicts: + target/ppc/kvm.c + +Simple contextual conflicts. + +Siged-off-by: David Gibson +--- + hw/ppc/spapr.c | 13 +++++++++++++ + include/sysemu/kvm.h | 1 + + target/ppc/cpu-qom.h | 1 + + target/ppc/cpu.h | 4 ++++ + target/ppc/kvm.c | 29 +++++++++++++++++++++++++++++ + 5 files changed, 48 insertions(+) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 51766af..6995c7a 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -459,6 +459,8 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, + sPAPRDRConnector *drc; + sPAPRDRConnectorClass *drck; + int drc_index; ++ uint32_t radix_AP_encodings[PPC_PAGE_SIZES_MAX_SZ]; ++ int i; + + drc = spapr_dr_connector_by_id(SPAPR_DR_CONNECTOR_TYPE_CPU, index); + if (drc) { +@@ -544,6 +546,17 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, + _FDT(spapr_fixup_cpu_numa_dt(fdt, offset, cs)); + + _FDT(spapr_fixup_cpu_smt_dt(fdt, offset, cpu, compat_smt)); ++ ++ if (pcc->radix_page_info) { ++ for (i = 0; i < pcc->radix_page_info->count; i++) { ++ radix_AP_encodings[i] = ++ cpu_to_be32(pcc->radix_page_info->entries[i]); ++ } ++ _FDT((fdt_setprop(fdt, offset, "ibm,processor-radix-AP-encodings", ++ radix_AP_encodings, ++ pcc->radix_page_info->count * ++ sizeof(radix_AP_encodings[0])))); ++ } + } + + static void spapr_populate_cpus_dt_node(void *fdt, sPAPRMachineState *spapr) +diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h +index 24281fc..5cc83f2 100644 +--- a/include/sysemu/kvm.h ++++ b/include/sysemu/kvm.h +@@ -527,5 +527,6 @@ int kvm_set_one_reg(CPUState *cs, uint64_t id, void *source); + * Returns: 0 on success, or a negative errno on failure. + */ + int kvm_get_one_reg(CPUState *cs, uint64_t id, void *target); ++struct ppc_radix_page_info *kvm_get_radix_page_info(void); + int kvm_get_max_memslots(void); + #endif +diff --git a/target/ppc/cpu-qom.h b/target/ppc/cpu-qom.h +index 81500e5..d0cf6ca 100644 +--- a/target/ppc/cpu-qom.h ++++ b/target/ppc/cpu-qom.h +@@ -197,6 +197,7 @@ typedef struct PowerPCCPUClass { + int bfd_mach; + uint32_t l1_dcache_size, l1_icache_size; + const struct ppc_segment_page_sizes *sps; ++ struct ppc_radix_page_info *radix_page_info; + void (*init_proc)(CPUPPCState *env); + int (*check_pow)(CPUPPCState *env); + int (*handle_mmu_fault)(PowerPCCPU *cpu, vaddr eaddr, int rwx, int mmu_idx); +diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h +index 5ee33b3..cacdd0a 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -943,6 +943,10 @@ struct ppc_segment_page_sizes { + struct ppc_one_seg_page_size sps[PPC_PAGE_SIZES_MAX_SZ]; + }; + ++struct ppc_radix_page_info { ++ uint32_t count; ++ uint32_t entries[PPC_PAGE_SIZES_MAX_SZ]; ++}; + + /*****************************************************************************/ + /* The whole PowerPC CPU context */ +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 031d31f..9c355ce 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -49,6 +49,7 @@ + #if defined(TARGET_PPC64) + #include "hw/ppc/spapr_cpu_core.h" + #endif ++#include "sysemu/kvm_int.h" + + //#define DEBUG_KVM + +@@ -332,6 +333,30 @@ static void kvm_get_smmu_info(PowerPCCPU *cpu, struct kvm_ppc_smmu_info *info) + kvm_get_fallback_smmu_info(cpu, info); + } + ++struct ppc_radix_page_info *kvm_get_radix_page_info(void) ++{ ++ KVMState *s = KVM_STATE(current_machine->accelerator); ++ struct ppc_radix_page_info *radix_page_info; ++ struct kvm_ppc_rmmu_info rmmu_info; ++ int i; ++ ++ if (!kvm_check_extension(s, KVM_CAP_PPC_MMU_RADIX)) { ++ return NULL; ++ } ++ if (kvm_vm_ioctl(s, KVM_PPC_GET_RMMU_INFO, &rmmu_info)) { ++ return NULL; ++ } ++ radix_page_info = g_malloc0(sizeof(*radix_page_info)); ++ radix_page_info->count = 0; ++ for (i = 0; i < PPC_PAGE_SIZES_MAX_SZ; i++) { ++ if (rmmu_info.ap_encodings[i]) { ++ radix_page_info->entries[i] = rmmu_info.ap_encodings[i]; ++ radix_page_info->count++; ++ } ++ } ++ return radix_page_info; ++} ++ + static bool kvm_valid_page_size(uint32_t flags, long rampgsize, uint32_t shift) + { + if (!(flags & KVM_PPC_PAGE_SIZES_REAL)) { +@@ -2308,6 +2333,10 @@ static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data) + + /* Reason: kvmppc_host_cpu_initfn() dies when !kvm_enabled() */ + dc->cannot_destroy_with_object_finalize_yet = true; ++ ++#if defined(TARGET_PPC64) ++ pcc->radix_page_info = kvm_get_radix_page_info(); ++#endif /* defined(TARGET_PPC64) */ + } + + bool kvmppc_has_cap_epr(void) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Consolidate-HPT-freeing-code-into-a-routine.patch b/SOURCES/kvm-spapr-Consolidate-HPT-freeing-code-into-a-routine.patch new file mode 100644 index 0000000..beba9b6 --- /dev/null +++ b/SOURCES/kvm-spapr-Consolidate-HPT-freeing-code-into-a-routine.patch @@ -0,0 +1,91 @@ +From 66281117075279667d06ba78709be47e0ac75b2c Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Tue, 4 Jul 2017 16:32:56 +0200 +Subject: [PATCH 1/4] spapr: Consolidate HPT freeing code into a routine + +RH-Author: Laurent Vivier +Message-id: <20170704163258.9846-2-lvivier@redhat.com> +Patchwork-id: 75706 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 1/3] spapr: Consolidate HPT freeing code into a routine +Bugzilla: 1456287 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +From: Bharata B Rao + +Consolidate the code that frees HPT into a separate routine +spapr_free_hpt() as the same chunk of code is called from two places. + +Signed-off-by: Bharata B Rao +Signed-off-by: David Gibson +(cherry picked from commit 06ec79e865a4a496e762a83126d00d0ed39205f5) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 13 +++++++++---- + hw/ppc/spapr_hcall.c | 5 +---- + include/hw/ppc/spapr.h | 1 + + 3 files changed, 11 insertions(+), 8 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index aadb562..2bee3d9 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1243,16 +1243,21 @@ static int spapr_hpt_shift_for_ramsize(uint64_t ramsize) + return shift; + } + ++void spapr_free_hpt(sPAPRMachineState *spapr) ++{ ++ g_free(spapr->htab); ++ spapr->htab = NULL; ++ spapr->htab_shift = 0; ++ close_htab_fd(spapr); ++} ++ + static void spapr_reallocate_hpt(sPAPRMachineState *spapr, int shift, + Error **errp) + { + long rc; + + /* Clean up any HPT info from a previous boot */ +- g_free(spapr->htab); +- spapr->htab = NULL; +- spapr->htab_shift = 0; +- close_htab_fd(spapr); ++ spapr_free_hpt(spapr); + + rc = kvmppc_reset_htab(shift); + if (rc < 0) { +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index 2735fe9..79f3e0c 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -913,10 +913,7 @@ static void spapr_check_setup_free_hpt(sPAPRMachineState *spapr, + /* We assume RADIX, so this catches all the "Do Nothing" cases */ + } else if (!(patbe_old & PATBE1_GR)) { + /* HASH->RADIX : Free HPT */ +- g_free(spapr->htab); +- spapr->htab = NULL; +- spapr->htab_shift = 0; +- close_htab_fd(spapr); ++ spapr_free_hpt(spapr); + } else if (!(patbe_new & PATBE1_GR)) { + /* RADIX->HASH || NOTHING->HASH : Allocate HPT */ + spapr_setup_hpt_and_vrma(spapr); +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index a6ef8cb..901f27b 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -599,6 +599,7 @@ int spapr_h_cas_compose_response(sPAPRMachineState *sm, + sPAPROptionVector *ov5_updates); + void close_htab_fd(sPAPRMachineState *spapr); + void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr); ++void spapr_free_hpt(sPAPRMachineState *spapr); + sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn); + void spapr_tce_table_enable(sPAPRTCETable *tcet, + uint32_t page_shift, uint64_t bus_offset, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Don-t-accidentally-advertise-HTM-support-on-PO.patch b/SOURCES/kvm-spapr-Don-t-accidentally-advertise-HTM-support-on-PO.patch new file mode 100644 index 0000000..54d2cbc --- /dev/null +++ b/SOURCES/kvm-spapr-Don-t-accidentally-advertise-HTM-support-on-PO.patch @@ -0,0 +1,55 @@ +From 405143faadc36ff92b11eaae1e1f36a16e4375c2 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 17 May 2017 02:23:22 +0200 +Subject: [PATCH 06/27] spapr: Don't accidentally advertise HTM support on + POWER9 + +RH-Author: David Gibson +Message-id: <20170517022323.16930-2-dgibson@redhat.com> +Patchwork-id: 75201 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 1/2] spapr: Don't accidentally advertise HTM support on POWER9 +Bugzilla: 1449007 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Laszlo Ersek + +From: David Gibson + +Logic in spapr_populate_pa_features() enables the bit advertising +Hardware Transactional Memory (HTM) in the guest's device tree only when +KVM advertises its availability with the KVM_CAP_PPC_HTM feature. + +However, this assumes that the HTM bit is off in the base template used for +the device tree value. That is true for POWER8, but not for POWER9. + +It looks like that was accidentally changed in 9fb4541 "spapr: Enable ISA +3.0 MMU mode selection via CAS". + +Fixes: 9fb4541f5803f8d2ba116b12113386e26482ba30 + +Signed-off-by: David Gibson +Reviewed-by: Thomas Huth +(cherry picked from commit 9bf502fe127f04e393cacae9f2666e0c98c6df4f) + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index cc3ccc1..62e2696 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -247,7 +247,7 @@ static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset, + /* 16: Vector */ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* 12 - 17 */ + /* 18: Vec. Scalar, 20: Vec. XOR, 22: HTM */ +- 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 18 - 23 */ ++ 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */ + /* 24: Ext. Dec, 26: 64 bit ftrs, 28: PM ftrs */ + 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 24 - 29 */ + /* 30: MMR, 32: LE atomic, 34: EBB + ext EBB */ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Enable-ISA-3.0-MMU-mode-selection-via-CAS.patch b/SOURCES/kvm-spapr-Enable-ISA-3.0-MMU-mode-selection-via-CAS.patch new file mode 100644 index 0000000..cf7ba71 --- /dev/null +++ b/SOURCES/kvm-spapr-Enable-ISA-3.0-MMU-mode-selection-via-CAS.patch @@ -0,0 +1,239 @@ +From f836e519f8b9d62104838b164a13a13667771c50 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:57 +0200 +Subject: [PATCH 22/23] spapr: Enable ISA 3.0 MMU mode selection via CAS + +RH-Author: David Gibson +Message-id: <20170427021558.4884-7-dgibson@redhat.com> +Patchwork-id: 74919 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 6/7] spapr: Enable ISA 3.0 MMU mode selection via CAS +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Sam Bobroff + +Add the new node, /chosen/ibm,arch-vec-5-platform-support to the +device tree. This allows the guest to determine which modes are +supported by the hypervisor. + +Update the option vector processing in h_client_architecture_support() +to handle the new MMU bits. This allows guests to request hash or +radix mode and QEMU to create the guest's HPT at this time if it is +necessary but hasn't yet been done. QEMU will terminate the guest if +it requests an unavailable mode, as required by the architecture. + +Extend the ibm,pa-features node with the new ISA 3.0 values +and set the radix bit if KVM supports radix mode. This probably won't +be used directly by guests to determine the availability of radix mode +(that is indicated by the new node added above) but the architecture +requires that it be set when the hardware supports it. + +If QEMU is using KVM, and KVM is capable of running in radix mode, +guests can be run in real-mode without allocating a HPT (because KVM +will use a minimal RPT). So in this case, we avoid creating the HPT +at reset time and later (during CAS) create it if it is necessary. + +ISA 3.0 guests will now begin to call h_register_process_table(), +which has been added previously. + +Signed-off-by: Sam Bobroff +[dwg: Strip some unneeded prefix from error messages] +Signed-off-by: David Gibson + +(cherry picked from commit 9fb4541f5803f8d2ba116b12113386e26482ba30) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 71 ++++++++++++++++++++++++++++++++++++--------- + hw/ppc/spapr_hcall.c | 30 +++++++++++++++++++ + include/hw/ppc/spapr_ovec.h | 5 ++++ + 3 files changed, 93 insertions(+), 13 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 7376bb5..5a5196a 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -237,20 +237,31 @@ static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset) + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, + 0x80, 0x00, 0x80, 0x00, 0x00, 0x00 }; +- /* Currently we don't advertise any of the "new" ISAv3.00 functionality */ +- uint8_t pa_features_300[] = { 64, 0, +- 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, /* 0 - 5 */ +- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 - 11 */ ++ uint8_t pa_features_300[] = { 66, 0, ++ /* 0: MMU|FPU|SLB|RUN|DABR|NX, 1: fri[nzpm]|DABRX|SPRG3|SLB0|PP110 */ ++ /* 2: VPM|DS205|PPR|DS202|DS206, 3: LSD|URG, SSO, 5: LE|CFAR|EB|LSQ */ ++ 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, /* 0 - 5 */ ++ /* 6: DS207 */ ++ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 - 11 */ ++ /* 16: Vector */ + 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* 12 - 17 */ +- 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 24 - 29 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 - 35 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 36 - 41 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 42 - 47 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 48 - 53 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 54 - 59 */ +- 0x00, 0x00, 0x00, 0x00 }; /* 60 - 63 */ +- ++ /* 18: Vec. Scalar, 20: Vec. XOR, 22: HTM */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 18 - 23 */ ++ /* 24: Ext. Dec, 26: 64 bit ftrs, 28: PM ftrs */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 24 - 29 */ ++ /* 30: MMR, 32: LE atomic, 34: EBB + ext EBB */ ++ 0x80, 0x00, 0x80, 0x00, 0xC0, 0x00, /* 30 - 35 */ ++ /* 36: SPR SO, 38: Copy/Paste, 40: Radix MMU */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 36 - 41 */ ++ /* 42: PM, 44: PC RA, 46: SC vec'd */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 42 - 47 */ ++ /* 48: SIMD, 50: QP BFP, 52: String */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 48 - 53 */ ++ /* 54: DecFP, 56: DecI, 58: SHA */ ++ 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, /* 54 - 59 */ ++ /* 60: NM atomic, 62: RNG */ ++ 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 60 - 65 */ ++ }; + uint8_t *pa_features; + size_t pa_size; + +@@ -856,6 +867,33 @@ static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt) + spapr_dt_rtas_tokens(fdt, rtas); + } + ++/* Prepare ibm,arch-vec-5-platform-support, which indicates the MMU features ++ * that the guest may request and thus the valid values for bytes 24..26 of ++ * option vector 5: */ ++static void spapr_dt_ov5_platform_support(void *fdt, int chosen) ++{ ++ char val[2 * 3] = { ++ 24, 0x00, /* Hash/Radix, filled in below. */ ++ 25, 0x00, /* Hash options: Segment Tables == no, GTSE == no. */ ++ 26, 0x40, /* Radix options: GTSE == yes. */ ++ }; ++ ++ if (kvm_enabled()) { ++ if (kvmppc_has_cap_mmu_radix() && kvmppc_has_cap_mmu_hash_v3()) { ++ val[1] = 0x80; /* OV5_MMU_BOTH */ ++ } else if (kvmppc_has_cap_mmu_radix()) { ++ val[1] = 0x40; /* OV5_MMU_RADIX_300 */ ++ } else { ++ val[1] = 0x00; /* Hash */ ++ } ++ } else { ++ /* TODO: TCG case, hash */ ++ val[1] = 0x00; ++ } ++ _FDT(fdt_setprop(fdt, chosen, "ibm,arch-vec-5-platform-support", ++ val, sizeof(val))); ++} ++ + static void spapr_dt_chosen(sPAPRMachineState *spapr, void *fdt) + { + MachineState *machine = MACHINE(spapr); +@@ -909,6 +947,8 @@ static void spapr_dt_chosen(sPAPRMachineState *spapr, void *fdt) + _FDT(fdt_setprop_string(fdt, chosen, "linux,stdout-path", stdout_path)); + } + ++ spapr_dt_ov5_platform_support(fdt, chosen); ++ + g_free(stdout_path); + g_free(bootlist); + } +@@ -2079,6 +2119,11 @@ static void ppc_spapr_init(MachineState *machine) + } + + spapr_ovec_set(spapr->ov5, OV5_FORM1_AFFINITY); ++ if (kvmppc_has_cap_mmu_radix()) { ++ /* KVM always allows GTSE with radix... */ ++ spapr_ovec_set(spapr->ov5, OV5_MMU_RADIX_GTSE); ++ } ++ /* ... but not with hash (currently). */ + + /* advertise support for dedicated HP event source to guests */ + if (spapr->use_hotplug_event_source) { +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index a958fee..cbd1f29 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -1063,6 +1063,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + uint32_t best_compat = 0; + int i; + sPAPROptionVector *ov5_guest, *ov5_cas_old, *ov5_updates; ++ bool guest_radix; + + /* + * We scan the supplied table of PVRs looking for two things +@@ -1114,6 +1115,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + ov_table = list; + + ov5_guest = spapr_ovec_parse_vector(ov_table, 5); ++ if (spapr_ovec_test(ov5_guest, OV5_MMU_BOTH)) { ++ error_report("guest requested hash and radix MMU, which is invalid."); ++ exit(EXIT_FAILURE); ++ } ++ /* The radix/hash bit in byte 24 requires special handling: */ ++ guest_radix = spapr_ovec_test(ov5_guest, OV5_MMU_RADIX_300); ++ spapr_ovec_clear(ov5_guest, OV5_MMU_RADIX_300); + + /* NOTE: there are actually a number of ov5 bits where input from the + * guest is always zero, and the platform/QEMU enables them independently +@@ -1132,6 +1140,21 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + ov5_updates = spapr_ovec_new(); + spapr->cas_reboot = spapr_ovec_diff(ov5_updates, + ov5_cas_old, spapr->ov5_cas); ++ /* Now that processing is finished, set the radix/hash bit for the ++ * guest if it requested a valid mode; otherwise terminate the boot. */ ++ if (guest_radix) { ++ if (kvm_enabled() && !kvmppc_has_cap_mmu_radix()) { ++ error_report("Guest requested unavailable MMU mode (radix)."); ++ exit(EXIT_FAILURE); ++ } ++ spapr_ovec_set(spapr->ov5_cas, OV5_MMU_RADIX_300); ++ } else { ++ if (kvm_enabled() && kvmppc_has_cap_mmu_radix() ++ && !kvmppc_has_cap_mmu_hash_v3()) { ++ error_report("Guest requested unavailable MMU mode (hash)."); ++ exit(EXIT_FAILURE); ++ } ++ } + + if (!spapr->cas_reboot) { + spapr->cas_reboot = +@@ -1142,6 +1165,13 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + + if (spapr->cas_reboot) { + qemu_system_reset_request(); ++ } else { ++ /* If ppc_spapr_reset() did not set up a HPT but one is necessary ++ * (because the guest isn't going to use radix) then set it up here. */ ++ if ((spapr->patb_entry & PATBE1_GR) && !guest_radix) { ++ /* legacy hash or new hash: */ ++ spapr_setup_hpt_and_vrma(spapr); ++ } + } + + return H_SUCCESS; +diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h +index 355a344..f7f2abe 100644 +--- a/include/hw/ppc/spapr_ovec.h ++++ b/include/hw/ppc/spapr_ovec.h +@@ -48,6 +48,11 @@ typedef struct sPAPROptionVector sPAPROptionVector; + #define OV5_FORM1_AFFINITY OV_BIT(5, 0) + #define OV5_HP_EVT OV_BIT(6, 5) + ++/* ISA 3.00 MMU features: */ ++#define OV5_MMU_BOTH OV_BIT(24, 0) /* Radix and hash */ ++#define OV5_MMU_RADIX_300 OV_BIT(24, 1) /* 1=Radix only, 0=Hash only */ ++#define OV5_MMU_RADIX_GTSE OV_BIT(26, 1) /* Radix GTSE */ ++ + /* interfaces */ + sPAPROptionVector *spapr_ovec_new(void); + sPAPROptionVector *spapr_ovec_clone(sPAPROptionVector *ov_orig); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Fix-migration-of-Radix-guests.patch b/SOURCES/kvm-spapr-Fix-migration-of-Radix-guests.patch new file mode 100644 index 0000000..6e3634b --- /dev/null +++ b/SOURCES/kvm-spapr-Fix-migration-of-Radix-guests.patch @@ -0,0 +1,56 @@ +From bd40310ce834bf1d80f7dbc254fd6a341b45866b Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Tue, 4 Jul 2017 16:32:58 +0200 +Subject: [PATCH 3/4] spapr: Fix migration of Radix guests + +RH-Author: Laurent Vivier +Message-id: <20170704163258.9846-4-lvivier@redhat.com> +Patchwork-id: 75707 +O-Subject: [Pegas-1.0 qemu-kvm PATCH 3/3] spapr: Fix migration of Radix guests +Bugzilla: 1456287 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Miroslav Rezanina + +From: Bharata B Rao + +Fix migration of radix guests by ensuring that we issue +KVM_PPC_CONFIGURE_V3_MMU for radix case post migration. + +Reported-by: Nageswara R Sastry +Signed-off-by: Bharata B Rao +Reviewed-by: Suraj Jitindar Singh +Signed-off-by: David Gibson +(cherry picked from commit d39c90f5f3ae23a6c8202eb6e1204ea84991e7f5) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index c322666..07c28d4 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1461,6 +1461,18 @@ static int spapr_post_load(void *opaque, int version_id) + err = spapr_rtc_import_offset(spapr->rtc, spapr->rtc_offset); + } + ++ if (spapr->patb_entry) { ++ PowerPCCPU *cpu = POWERPC_CPU(first_cpu); ++ bool radix = !!(spapr->patb_entry & PATBE1_GR); ++ bool gtse = !!(cpu->env.spr[SPR_LPCR] & LPCR_GTSE); ++ ++ err = kvmppc_configure_v3_mmu(cpu, radix, gtse, spapr->patb_entry); ++ if (err) { ++ error_report("Process table config unsupported by the host"); ++ return -EINVAL; ++ } ++ } ++ + return err; + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-Workaround-for-broken-radix-guests.patch b/SOURCES/kvm-spapr-Workaround-for-broken-radix-guests.patch new file mode 100644 index 0000000..bc7c39a --- /dev/null +++ b/SOURCES/kvm-spapr-Workaround-for-broken-radix-guests.patch @@ -0,0 +1,155 @@ +From c0af45c7da067bc9679b0b491971b026e5722876 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:58 +0200 +Subject: [PATCH 23/23] spapr: Workaround for broken radix guests + +RH-Author: David Gibson +Message-id: <20170427021558.4884-8-dgibson@redhat.com> +Patchwork-id: 74920 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 7/7] spapr: Workaround for broken radix guests +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Sam Bobroff + +For a little while around 4.9, Linux kernels that saw the radix bit in +ibm,pa-features would attempt to set up the MMU as if they were a +hypervisor, even if they were a guest, which would cause them to +crash. + +Work around this by detecting pre-ISA 3.0 guests by their lack of that +bit in option vector 1, and then removing the radix bit from +ibm,pa-features. Note: This now requires regeneration of that node +after CAS negotiation. + +Signed-off-by: Sam Bobroff +[dwg: Fix style nits] +Signed-off-by: David Gibson + +(cherry picked from commit e957f6a9b92439a222ecd4ff1c8cdc9700710c72) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 15 +++++++++++++-- + hw/ppc/spapr_hcall.c | 6 ++++-- + include/hw/ppc/spapr.h | 1 + + include/hw/ppc/spapr_ovec.h | 3 +++ + 4 files changed, 21 insertions(+), 4 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 5a5196a..cc3ccc1 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -228,7 +228,8 @@ static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, CPUState *cs) + } + + /* Populate the "ibm,pa-features" property */ +-static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset) ++static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset, ++ bool legacy_guest) + { + uint8_t pa_features_206[] = { 6, 0, + 0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 }; +@@ -295,6 +296,12 @@ static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset) + if (kvmppc_has_cap_htm() && pa_size > 24) { + pa_features[24] |= 0x80; /* Transactional memory support */ + } ++ if (legacy_guest && pa_size > 40) { ++ /* Workaround for broken kernels that attempt (guest) radix ++ * mode when they can't handle it, if they see the radix bit set ++ * in pa-features. So hide it from them. */ ++ pa_features[40 + 2] &= ~0x80; /* Radix MMU */ ++ } + + _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size))); + } +@@ -309,6 +316,7 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) + + CPU_FOREACH(cs) { + PowerPCCPU *cpu = POWERPC_CPU(cs); ++ CPUPPCState *env = &cpu->env; + DeviceClass *dc = DEVICE_GET_CLASS(cs); + int index = ppc_get_vcpu_dt_id(cpu); + int compat_smt = MIN(smp_threads, ppc_compat_max_threads(cpu)); +@@ -350,6 +358,9 @@ static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) + if (ret < 0) { + return ret; + } ++ ++ spapr_populate_pa_features(env, fdt, offset, ++ spapr->cas_legacy_guest_workaround); + } + return ret; + } +@@ -547,7 +558,7 @@ static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, + page_sizes_prop, page_sizes_prop_size))); + } + +- spapr_populate_pa_features(env, fdt, offset); ++ spapr_populate_pa_features(env, fdt, offset, false); + + _FDT((fdt_setprop_cell(fdt, offset, "ibm,chip-id", + cs->cpu_index / vcpus_per_socket))); +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index cbd1f29..9f18f75 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -1062,7 +1062,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + uint32_t max_compat = cpu->max_compat; + uint32_t best_compat = 0; + int i; +- sPAPROptionVector *ov5_guest, *ov5_cas_old, *ov5_updates; ++ sPAPROptionVector *ov1_guest, *ov5_guest, *ov5_cas_old, *ov5_updates; + bool guest_radix; + + /* +@@ -1114,6 +1114,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + /* For the future use: here @ov_table points to the first option vector */ + ov_table = list; + ++ ov1_guest = spapr_ovec_parse_vector(ov_table, 1); + ov5_guest = spapr_ovec_parse_vector(ov_table, 5); + if (spapr_ovec_test(ov5_guest, OV5_MMU_BOTH)) { + error_report("guest requested hash and radix MMU, which is invalid."); +@@ -1155,7 +1156,8 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, + exit(EXIT_FAILURE); + } + } +- ++ spapr->cas_legacy_guest_workaround = !spapr_ovec_test(ov1_guest, ++ OV1_PPC_3_00); + if (!spapr->cas_reboot) { + spapr->cas_reboot = + (spapr_h_cas_compose_response(spapr, args[1], args[2], +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index 247c969..a6ef8cb 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -77,6 +77,7 @@ struct sPAPRMachineState { + sPAPROptionVector *ov5; /* QEMU-supported option vectors */ + sPAPROptionVector *ov5_cas; /* negotiated (via CAS) option vectors */ + bool cas_reboot; ++ bool cas_legacy_guest_workaround; + + Notifier epow_notifier; + QTAILQ_HEAD(, sPAPREventLogEntry) pending_events; +diff --git a/include/hw/ppc/spapr_ovec.h b/include/hw/ppc/spapr_ovec.h +index f7f2abe..f088833 100644 +--- a/include/hw/ppc/spapr_ovec.h ++++ b/include/hw/ppc/spapr_ovec.h +@@ -43,6 +43,9 @@ typedef struct sPAPROptionVector sPAPROptionVector; + + #define OV_BIT(byte, bit) ((byte - 1) * BITS_PER_BYTE + bit) + ++/* option vector 1 */ ++#define OV1_PPC_3_00 OV_BIT(3, 0) /* guest supports PowerPC 3.00? */ ++ + /* option vector 5 */ + #define OV5_DRCONF_MEMORY OV_BIT(2, 2) + #define OV5_FORM1_AFFINITY OV_BIT(5, 0) +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-htab-fix-savevm.patch b/SOURCES/kvm-spapr-htab-fix-savevm.patch new file mode 100644 index 0000000..aada6f9 --- /dev/null +++ b/SOURCES/kvm-spapr-htab-fix-savevm.patch @@ -0,0 +1,54 @@ +From 20a48b7b71a2aa56797026c4ffaac6fed113d897 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Tue, 25 Jul 2017 14:32:33 +0200 +Subject: [PATCH 06/17] spapr/htab: fix savevm + +RH-Author: Laurent Vivier +Message-id: <20170725143233.6306-1-lvivier@redhat.com> +Patchwork-id: 75837 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] spapr/htab: fix savevm +Bugzilla: 1470035 +RH-Acked-by: Thomas Huth +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: David Gibson + +Commit 3a38429 ("spapr: Add a "no HPT" encoding to HTAB migration stream") +allows to migrate an empty HPT, but doesn't mark correctly the +end of the migration stream. + +The end condition (value returned by htab_save_iterate()) +should be 1, whereas in 3a38429 it returns 0. + +The problem can be reproduced with QEMU monitor command "savevm": +the command never stops and the disk image grows without limit. + +Fixes: 3a38429748aa4f74abaecf16c4c087e8a325e12a +Signed-off-by: Laurent Vivier +Reviewed-by: Thomas Huth +Signed-off-by: David Gibson +(cherry picked from commit e8cd4247e96bb2158ef0ae0ff20e72746b9dd32d) +Signed-off-by: Laurent Vivier + +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13717506 +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1470035 +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 07c28d4..0c401bf 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -1748,7 +1748,7 @@ static int htab_save_iterate(QEMUFile *f, void *opaque) + /* Iteration header */ + if (!spapr->htab_shift) { + qemu_put_be32(f, -1); +- return 0; ++ return 1; + } else { + qemu_put_be32(f, 0); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spapr-move-spapr_populate_pa_features.patch b/SOURCES/kvm-spapr-move-spapr_populate_pa_features.patch new file mode 100644 index 0000000..745c45a --- /dev/null +++ b/SOURCES/kvm-spapr-move-spapr_populate_pa_features.patch @@ -0,0 +1,173 @@ +From c68660ddc515651cf5eb21c4fbc8d4c4643921e1 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:56 +0200 +Subject: [PATCH 21/23] spapr: move spapr_populate_pa_features() + +RH-Author: David Gibson +Message-id: <20170427021558.4884-6-dgibson@redhat.com> +Patchwork-id: 74918 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 5/7] spapr: move spapr_populate_pa_features() +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Sam Bobroff + +In the next patch, spapr_fixup_cpu_dt() will need to call +spapr_populate_pa_features() so move it's definition up without making +any other changes. + +Signed-off-by: Sam Bobroff +Signed-off-by: David Gibson +(cherry picked from commit 86d5771a5ab67b72a0d830f0ac8c0420e18b48d8) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 122 ++++++++++++++++++++++++++++----------------------------- + 1 file changed, 61 insertions(+), 61 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 8b9f877..7376bb5 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -227,6 +227,67 @@ static int spapr_fixup_cpu_numa_dt(void *fdt, int offset, CPUState *cs) + return ret; + } + ++/* Populate the "ibm,pa-features" property */ ++static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset) ++{ ++ uint8_t pa_features_206[] = { 6, 0, ++ 0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 }; ++ uint8_t pa_features_207[] = { 24, 0, ++ 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, ++ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, ++ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, ++ 0x80, 0x00, 0x80, 0x00, 0x00, 0x00 }; ++ /* Currently we don't advertise any of the "new" ISAv3.00 functionality */ ++ uint8_t pa_features_300[] = { 64, 0, ++ 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, /* 0 - 5 */ ++ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 - 11 */ ++ 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* 12 - 17 */ ++ 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 24 - 29 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 - 35 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 36 - 41 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 42 - 47 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 48 - 53 */ ++ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 54 - 59 */ ++ 0x00, 0x00, 0x00, 0x00 }; /* 60 - 63 */ ++ ++ uint8_t *pa_features; ++ size_t pa_size; ++ ++ switch (POWERPC_MMU_VER(env->mmu_model)) { ++ case POWERPC_MMU_VER_2_06: ++ pa_features = pa_features_206; ++ pa_size = sizeof(pa_features_206); ++ break; ++ case POWERPC_MMU_VER_2_07: ++ pa_features = pa_features_207; ++ pa_size = sizeof(pa_features_207); ++ break; ++ case POWERPC_MMU_VER_3_00: ++ pa_features = pa_features_300; ++ pa_size = sizeof(pa_features_300); ++ break; ++ default: ++ return; ++ } ++ ++ if (env->ci_large_pages) { ++ /* ++ * Note: we keep CI large pages off by default because a 64K capable ++ * guest provisioned with large pages might otherwise try to map a qemu ++ * framebuffer (or other kind of memory mapped PCI BAR) using 64K pages ++ * even if that qemu runs on a 4k host. ++ * We dd this bit back here if we are confident this is not an issue ++ */ ++ pa_features[3] |= 0x20; ++ } ++ if (kvmppc_has_cap_htm() && pa_size > 24) { ++ pa_features[24] |= 0x80; /* Transactional memory support */ ++ } ++ ++ _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size))); ++} ++ + static int spapr_fixup_cpu_dt(void *fdt, sPAPRMachineState *spapr) + { + int ret = 0, offset, cpus_offset; +@@ -379,67 +440,6 @@ static int spapr_populate_memory(sPAPRMachineState *spapr, void *fdt) + return 0; + } + +-/* Populate the "ibm,pa-features" property */ +-static void spapr_populate_pa_features(CPUPPCState *env, void *fdt, int offset) +-{ +- uint8_t pa_features_206[] = { 6, 0, +- 0xf6, 0x1f, 0xc7, 0x00, 0x80, 0xc0 }; +- uint8_t pa_features_207[] = { 24, 0, +- 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, +- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, +- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, +- 0x80, 0x00, 0x80, 0x00, 0x00, 0x00 }; +- /* Currently we don't advertise any of the "new" ISAv3.00 functionality */ +- uint8_t pa_features_300[] = { 64, 0, +- 0xf6, 0x1f, 0xc7, 0xc0, 0x80, 0xf0, /* 0 - 5 */ +- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, /* 6 - 11 */ +- 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, /* 12 - 17 */ +- 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, /* 18 - 23 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 24 - 29 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 30 - 35 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 36 - 41 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 42 - 47 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 48 - 53 */ +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 54 - 59 */ +- 0x00, 0x00, 0x00, 0x00 }; /* 60 - 63 */ +- +- uint8_t *pa_features; +- size_t pa_size; +- +- switch (POWERPC_MMU_VER(env->mmu_model)) { +- case POWERPC_MMU_VER_2_06: +- pa_features = pa_features_206; +- pa_size = sizeof(pa_features_206); +- break; +- case POWERPC_MMU_VER_2_07: +- pa_features = pa_features_207; +- pa_size = sizeof(pa_features_207); +- break; +- case POWERPC_MMU_VER_3_00: +- pa_features = pa_features_300; +- pa_size = sizeof(pa_features_300); +- break; +- default: +- return; +- } +- +- if (env->ci_large_pages) { +- /* +- * Note: we keep CI large pages off by default because a 64K capable +- * guest provisioned with large pages might otherwise try to map a qemu +- * framebuffer (or other kind of memory mapped PCI BAR) using 64K pages +- * even if that qemu runs on a 4k host. +- * We dd this bit back here if we are confident this is not an issue +- */ +- pa_features[3] |= 0x20; +- } +- if (kvmppc_has_cap_htm() && pa_size > 24) { +- pa_features[24] |= 0x80; /* Transactional memory support */ +- } +- +- _FDT((fdt_setprop(fdt, offset, "ibm,pa-features", pa_features, pa_size))); +-} +- + static void spapr_populate_cpu_dt(CPUState *cs, void *fdt, int offset, + sPAPRMachineState *spapr) + { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-spec-vhost-user-spec-Add-IOMMU-support.patch b/SOURCES/kvm-spec-vhost-user-spec-Add-IOMMU-support.patch new file mode 100644 index 0000000..4bb9b5c --- /dev/null +++ b/SOURCES/kvm-spec-vhost-user-spec-Add-IOMMU-support.patch @@ -0,0 +1,281 @@ +From 03c5ff306ec5657a91c17cee12ff710025921190 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Tue, 6 Jun 2017 12:05:24 +0200 +Subject: [PATCH 13/17] spec/vhost-user spec: Add IOMMU support + +RH-Author: Maxime Coquelin +Message-id: <20170606120524.3050-6-maxime.coquelin@redhat.com> +Patchwork-id: 75498 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 5/5] spec/vhost-user spec: Add IOMMU support +Bugzilla: 1451862 +RH-Acked-by: Peter Xu +RH-Acked-by: Xiao Wang +RH-Acked-by: Jens Freimann + +This patch specifies and implements the master/slave communication +to support device IOTLB in slave. + +The vhost_iotlb_msg structure introduced for kernel backends is +re-used, making the design close between the two backends. + +An exception is the use of the secondary channel to enable the +slave to send IOTLB miss requests to the master. + +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 6dcdd06e3b0d0c5651219013ec975348e2050041) +Signed-off-by: Maxime Coquelin +Signed-off-by: Miroslav Rezanina +--- + docs/specs/vhost-user.txt | 84 +++++++++++++++++++++++++++++++++++++++++++++++ + hw/net/vhost_net.c | 1 + + hw/virtio/vhost-user.c | 48 +++++++++++++++++++++++++-- + 3 files changed, 130 insertions(+), 3 deletions(-) + +diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt +index 5fa7016..481ab56 100644 +--- a/docs/specs/vhost-user.txt ++++ b/docs/specs/vhost-user.txt +@@ -97,6 +97,25 @@ Depending on the request type, payload can be: + log offset: offset from start of supplied file descriptor + where logging starts (i.e. where guest address 0 would be logged) + ++ * An IOTLB message ++ --------------------------------------------------------- ++ | iova | size | user address | permissions flags | type | ++ --------------------------------------------------------- ++ ++ IOVA: a 64-bit I/O virtual address programmed by the guest ++ Size: a 64-bit size ++ User address: a 64-bit user address ++ Permissions: a 8-bit value: ++ - 0: No access ++ - 1: Read access ++ - 2: Write access ++ - 3: Read/Write access ++ Type: a 8-bit IOTLB message type: ++ - 1: IOTLB miss ++ - 2: IOTLB update ++ - 3: IOTLB invalidate ++ - 4: IOTLB access fail ++ + In QEMU the vhost-user message is implemented with the following struct: + + typedef struct VhostUserMsg { +@@ -109,6 +128,7 @@ typedef struct VhostUserMsg { + struct vhost_vring_addr addr; + VhostUserMemory memory; + VhostUserLog log; ++ struct vhost_iotlb_msg iotlb; + }; + } QEMU_PACKED VhostUserMsg; + +@@ -253,6 +273,38 @@ Once the source has finished migration, rings will be stopped by + the source. No further update must be done before rings are + restarted. + ++IOMMU support ++------------- ++ ++When the VIRTIO_F_IOMMU_PLATFORM feature has been negotiated, the master ++sends IOTLB entries update & invalidation by sending VHOST_USER_IOTLB_MSG ++requests to the slave with a struct vhost_iotlb_msg as payload. For update ++events, the iotlb payload has to be filled with the update message type (2), ++the I/O virtual address, the size, the user virtual address, and the ++permissions flags. Addresses and size must be within vhost memory regions set ++via the VHOST_USER_SET_MEM_TABLE request. For invalidation events, the iotlb ++payload has to be filled with the invalidation message type (3), the I/O virtual ++address and the size. On success, the slave is expected to reply with a zero ++payload, non-zero otherwise. ++ ++The slave relies on the slave communcation channel (see "Slave communication" ++section below) to send IOTLB miss and access failure events, by sending ++VHOST_USER_SLAVE_IOTLB_MSG requests to the master with a struct vhost_iotlb_msg ++as payload. For miss events, the iotlb payload has to be filled with the miss ++message type (1), the I/O virtual address and the permissions flags. For access ++failure event, the iotlb payload has to be filled with the access failure ++message type (4), the I/O virtual address and the permissions flags. ++For synchronization purpose, the slave may rely on the reply-ack feature, ++so the master may send a reply when operation is completed if the reply-ack ++feature is negotiated and slaves requests a reply. For miss events, completed ++operation means either master sent an update message containing the IOTLB entry ++containing requested address and permission, or master sent nothing if the IOTLB ++miss message is invalid (invalid IOVA or permission). ++ ++The master isn't expected to take the initiative to send IOTLB update messages, ++as the slave sends IOTLB miss messages for the guest virtual memory areas it ++needs to access. ++ + Slave communication + ------------------- + +@@ -514,6 +566,38 @@ Master message types + If VHOST_USER_PROTOCOL_F_REPLY_ACK is negotiated, slave must respond + with zero for success, non-zero otherwise. + ++ * VHOST_USER_IOTLB_MSG ++ ++ Id: 22 ++ Equivalent ioctl: N/A (equivalent to VHOST_IOTLB_MSG message type) ++ Master payload: struct vhost_iotlb_msg ++ Slave payload: u64 ++ ++ Send IOTLB messages with struct vhost_iotlb_msg as payload. ++ Master sends such requests to update and invalidate entries in the device ++ IOTLB. The slave has to acknowledge the request with sending zero as u64 ++ payload for success, non-zero otherwise. ++ This request should be send only when VIRTIO_F_IOMMU_PLATFORM feature ++ has been successfully negotiated. ++ ++Slave message types ++------------------- ++ ++ * VHOST_USER_SLAVE_IOTLB_MSG ++ ++ Id: 1 ++ Equivalent ioctl: N/A (equivalent to VHOST_IOTLB_MSG message type) ++ Slave payload: struct vhost_iotlb_msg ++ Master payload: N/A ++ ++ Send IOTLB messages with struct vhost_iotlb_msg as payload. ++ Slave sends such requests to notify of an IOTLB miss, or an IOTLB ++ access failure. If VHOST_USER_PROTOCOL_F_REPLY_ACK is negotiated, ++ and slave set the VHOST_USER_NEED_REPLY flag, master must respond with ++ zero when operation is successfully completed, or non-zero otherwise. ++ This request should be send only when VIRTIO_F_IOMMU_PLATFORM feature ++ has been successfully negotiated. ++ + VHOST_USER_PROTOCOL_F_REPLY_ACK: + ------------------------------- + The original vhost-user specification only demands replies for certain +diff --git a/hw/net/vhost_net.c b/hw/net/vhost_net.c +index 22874a9..e037db6 100644 +--- a/hw/net/vhost_net.c ++++ b/hw/net/vhost_net.c +@@ -77,6 +77,7 @@ static const int user_feature_bits[] = { + VIRTIO_NET_F_HOST_UFO, + VIRTIO_NET_F_MRG_RXBUF, + VIRTIO_NET_F_MTU, ++ VIRTIO_F_IOMMU_PLATFORM, + + /* This bit implies RARP isn't sent by QEMU out of band */ + VIRTIO_NET_F_GUEST_ANNOUNCE, +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 0faf5df..c44bbad 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -63,11 +63,13 @@ typedef enum VhostUserRequest { + VHOST_USER_SEND_RARP = 19, + VHOST_USER_NET_SET_MTU = 20, + VHOST_USER_SET_SLAVE_REQ_FD = 21, ++ VHOST_USER_IOTLB_MSG = 22, + VHOST_USER_MAX + } VhostUserRequest; + + typedef enum VhostUserSlaveRequest { + VHOST_USER_SLAVE_NONE = 0, ++ VHOST_USER_SLAVE_IOTLB_MSG = 1, + VHOST_USER_SLAVE_MAX + } VhostUserSlaveRequest; + +@@ -105,6 +107,7 @@ typedef struct VhostUserMsg { + struct vhost_vring_addr addr; + VhostUserMemory memory; + VhostUserLog log; ++ struct vhost_iotlb_msg iotlb; + } payload; + } QEMU_PACKED VhostUserMsg; + +@@ -616,6 +619,9 @@ static void slave_read(void *opaque) + } + + switch (msg.request) { ++ case VHOST_USER_SLAVE_IOTLB_MSG: ++ ret = vhost_backend_handle_iotlb_msg(dev, &msg.payload.iotlb); ++ break; + default: + error_report("Received unexpected msg type."); + ret = -EINVAL; +@@ -698,7 +704,7 @@ out: + + static int vhost_user_init(struct vhost_dev *dev, void *opaque) + { +- uint64_t features; ++ uint64_t features, protocol_features; + struct vhost_user *u; + int err; + +@@ -718,12 +724,13 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) + dev->backend_features |= 1ULL << VHOST_USER_F_PROTOCOL_FEATURES; + + err = vhost_user_get_u64(dev, VHOST_USER_GET_PROTOCOL_FEATURES, +- &features); ++ &protocol_features); + if (err < 0) { + return err; + } + +- dev->protocol_features = features & VHOST_USER_PROTOCOL_FEATURE_MASK; ++ dev->protocol_features = ++ protocol_features & VHOST_USER_PROTOCOL_FEATURE_MASK; + err = vhost_user_set_protocol_features(dev, dev->protocol_features); + if (err < 0) { + return err; +@@ -737,6 +744,16 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) + return err; + } + } ++ ++ if (virtio_has_feature(features, VIRTIO_F_IOMMU_PLATFORM) && ++ !(virtio_has_feature(dev->protocol_features, ++ VHOST_USER_PROTOCOL_F_SLAVE_REQ) && ++ virtio_has_feature(dev->protocol_features, ++ VHOST_USER_PROTOCOL_F_REPLY_ACK))) { ++ error_report("IOMMU support requires reply-ack and " ++ "slave-req protocol features."); ++ return -1; ++ } + } + + if (dev->migration_blocker == NULL && +@@ -863,6 +880,29 @@ static int vhost_user_net_set_mtu(struct vhost_dev *dev, uint16_t mtu) + return 0; + } + ++static int vhost_user_send_device_iotlb_msg(struct vhost_dev *dev, ++ struct vhost_iotlb_msg *imsg) ++{ ++ VhostUserMsg msg = { ++ .request = VHOST_USER_IOTLB_MSG, ++ .size = sizeof(msg.payload.iotlb), ++ .flags = VHOST_USER_VERSION | VHOST_USER_NEED_REPLY_MASK, ++ .payload.iotlb = *imsg, ++ }; ++ ++ if (vhost_user_write(dev, &msg, NULL, 0) < 0) { ++ return -EFAULT; ++ } ++ ++ return process_message_reply(dev, &msg); ++} ++ ++ ++static void vhost_user_set_iotlb_callback(struct vhost_dev *dev, int enabled) ++{ ++ /* No-op as the receive channel is not dedicated to IOTLB messages. */ ++} ++ + const VhostOps user_ops = { + .backend_type = VHOST_BACKEND_TYPE_USER, + .vhost_backend_init = vhost_user_init, +@@ -887,4 +927,6 @@ const VhostOps user_ops = { + .vhost_migration_done = vhost_user_migration_done, + .vhost_backend_can_merge = vhost_user_can_merge, + .vhost_net_set_mtu = vhost_user_net_set_mtu, ++ .vhost_set_iotlb_callback = vhost_user_set_iotlb_callback, ++ .vhost_send_device_iotlb_msg = vhost_user_send_device_iotlb_msg, + }; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-stream-fix-crash-in-stream_start-when-block_job_crea.patch b/SOURCES/kvm-stream-fix-crash-in-stream_start-when-block_job_crea.patch new file mode 100644 index 0000000..c7bb5b7 --- /dev/null +++ b/SOURCES/kvm-stream-fix-crash-in-stream_start-when-block_job_crea.patch @@ -0,0 +1,51 @@ +From 1cfd511f5d532854018b671d7ba880a41b8fd51c Mon Sep 17 00:00:00 2001 +From: Kevin Wolf +Date: Wed, 31 May 2017 11:15:11 +0200 +Subject: [PATCH 04/13] stream: fix crash in stream_start() when + block_job_create() fails + +RH-Author: Kevin Wolf +Message-id: <1496229312-8649-2-git-send-email-kwolf@redhat.com> +Patchwork-id: 75446 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/2] stream: fix crash in stream_start() when block_job_create() fails +Bugzilla: 1456424 +RH-Acked-by: Fam Zheng +RH-Acked-by: Jeffrey Cody +RH-Acked-by: Max Reitz +RH-Acked-by: John Snow + +From: Alberto Garcia + +The code that tries to reopen a BlockDriverState in stream_start() +when the creation of a new block job fails crashes because it attempts +to dereference a pointer that is known to be NULL. + +This is a regression introduced in a170a91fd3eab6155da39e740381867e, +likely because the code was copied from stream_complete(). + +Cc: qemu-stable@nongnu.org +Reported-by: Kashyap Chamarthy +Signed-off-by: Alberto Garcia +Tested-by: Kashyap Chamarthy +Signed-off-by: Kevin Wolf +(cherry picked from commit 525989a50a70ea0ffa2b1cdf56279765bb2b7de0) +Signed-off-by: Miroslav Rezanina +--- + block/stream.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/block/stream.c b/block/stream.c +index 0113710..52d329f 100644 +--- a/block/stream.c ++++ b/block/stream.c +@@ -280,6 +280,6 @@ void stream_start(const char *job_id, BlockDriverState *bs, + + fail: + if (orig_bs_flags != bdrv_get_flags(bs)) { +- bdrv_reopen(bs, s->bs_flags, NULL); ++ bdrv_reopen(bs, orig_bs_flags, NULL); + } + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Add-debug-function-for-radix-mmu-translat.patch b/SOURCES/kvm-target-ppc-Add-debug-function-for-radix-mmu-translat.patch new file mode 100644 index 0000000..5ce2ac1 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Add-debug-function-for-radix-mmu-translat.patch @@ -0,0 +1,136 @@ +From d5da2921f38e85ea27932a26764156df5ebdaad9 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Thu, 13 Jul 2017 16:36:30 +0200 +Subject: [PATCH 6/6] target/ppc: Add debug function for radix mmu translation + +RH-Author: Laurent Vivier +Message-id: <20170713163630.24848-5-lvivier@redhat.com> +Patchwork-id: 75766 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH 4/4] target/ppc: Add debug function for radix mmu translation +Bugzilla: 1470558 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Suraj Jitindar Singh + +From: Suraj Jitindar Singh + +In target/ppc/mmu-hash64.c there already exists the function +ppc_hash64_get_phys_page_debug() to get the physical (real) address for +a given effective address in hash mode. + +Implement the function ppc_radix64_get_phys_page_debug() to allow a real +address to be obtained for a given effective address in radix mode. +This is used when a debugger is attached to qemu. + +Previously we just had a comment saying this is unimplemented which then +fell through to the default case and caused an abort due to +unrecognised mmu model as the default had no case for the V3 mmu, which +was misleading at best. + +We reuse ppc_radix64_walk_tree() which is used by the radix fault +handler since the process of walking the radix tree is identical. + +Reported-by: Balbir Singh +Signed-off-by: Suraj Jitindar Singh +Signed-off-by: David Gibson +(cherry picked from commit 95cb0657766a495ca54caa15ab9feb5681c20f15) +Signed-off-by: Laurent Vivier + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1470558 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13654102 +Signed-off-by: Miroslav Rezanina +--- + target/ppc/mmu-radix64.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ + target/ppc/mmu-radix64.h | 1 + + target/ppc/mmu_helper.c | 3 ++- + 3 files changed, 48 insertions(+), 1 deletion(-) + +diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c +index 1a650fd..bbd37e3 100644 +--- a/target/ppc/mmu-radix64.c ++++ b/target/ppc/mmu-radix64.c +@@ -251,3 +251,48 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, + prot, mmu_idx, 1UL << page_size); + return 0; + } ++ ++hwaddr ppc_radix64_get_phys_page_debug(PowerPCCPU *cpu, target_ulong eaddr) ++{ ++ CPUState *cs = CPU(cpu); ++ CPUPPCState *env = &cpu->env; ++ PPCVirtualHypervisorClass *vhc = ++ PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp); ++ hwaddr raddr, pte_addr; ++ uint64_t lpid = 0, pid = 0, offset, size, patbe, prtbe0, pte; ++ int page_size, fault_cause = 0; ++ ++ /* Handle Real Mode */ ++ if (msr_dr == 0) { ++ /* In real mode top 4 effective addr bits (mostly) ignored */ ++ return eaddr & 0x0FFFFFFFFFFFFFFFULL; ++ } ++ ++ /* Virtual Mode Access - get the fully qualified address */ ++ if (!ppc_radix64_get_fully_qualified_addr(env, eaddr, &lpid, &pid)) { ++ return -1; ++ } ++ ++ /* Get Process Table */ ++ patbe = vhc->get_patbe(cpu->vhyp); ++ ++ /* Index Process Table by PID to Find Corresponding Process Table Entry */ ++ offset = pid * sizeof(struct prtb_entry); ++ size = 1ULL << ((patbe & PATBE1_R_PRTS) + 12); ++ if (offset >= size) { ++ /* offset exceeds size of the process table */ ++ return -1; ++ } ++ prtbe0 = ldq_phys(cs->as, (patbe & PATBE1_R_PRTB) + offset); ++ ++ /* Walk Radix Tree from Process Table Entry to Convert EA to RA */ ++ page_size = PRTBE_R_GET_RTS(prtbe0); ++ pte = ppc_radix64_walk_tree(cpu, eaddr & R_EADDR_MASK, ++ prtbe0 & PRTBE_R_RPDB, prtbe0 & PRTBE_R_RPDS, ++ &raddr, &page_size, &fault_cause, &pte_addr); ++ if (!pte) { ++ return -1; ++ } ++ ++ return raddr & TARGET_PAGE_MASK; ++} +diff --git a/target/ppc/mmu-radix64.h b/target/ppc/mmu-radix64.h +index 1d5c7cf..0ecf063 100644 +--- a/target/ppc/mmu-radix64.h ++++ b/target/ppc/mmu-radix64.h +@@ -46,6 +46,7 @@ + + int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, + int mmu_idx); ++hwaddr ppc_radix64_get_phys_page_debug(PowerPCCPU *cpu, target_ulong addr); + + static inline int ppc_radix64_get_prot_eaa(uint64_t pte) + { +diff --git a/target/ppc/mmu_helper.c b/target/ppc/mmu_helper.c +index 65d1c86..b7b9088 100644 +--- a/target/ppc/mmu_helper.c ++++ b/target/ppc/mmu_helper.c +@@ -30,6 +30,7 @@ + #include "helper_regs.h" + #include "qemu/error-report.h" + #include "mmu-book3s-v3.h" ++#include "mmu-radix64.h" + + //#define DEBUG_MMU + //#define DEBUG_BATS +@@ -1432,7 +1433,7 @@ hwaddr ppc_cpu_get_phys_page_debug(CPUState *cs, vaddr addr) + return ppc_hash64_get_phys_page_debug(cpu, addr); + case POWERPC_MMU_VER_3_00: + if (ppc64_radix_guest(ppc_env_get_cpu(env))) { +- /* TODO - Unsupported */ ++ return ppc_radix64_get_phys_page_debug(cpu, addr); + } else { + return ppc_hash64_get_phys_page_debug(cpu, addr); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch b/SOURCES/kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch new file mode 100644 index 0000000..27c3ca0 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch @@ -0,0 +1,103 @@ +From 0efa66da9c8638270ac03a02d184473b7a049fe8 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:54 +0200 +Subject: [PATCH 19/23] target/ppc: Add new H-CALL shells for in memory table + translation + +RH-Author: David Gibson +Message-id: <20170427021558.4884-4-dgibson@redhat.com> +Patchwork-id: 74914 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 3/7] target/ppc: Add new H-CALL shells for in memory table translation +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Suraj Jitindar Singh + +The use of the new in memory tables introduced in ISAv3.00 for translation, +also referred to as process tables, requires the introduction of 3 new +H-CALLs; H_REGISTER_PROCESS_TABLE, H_CLEAN_SLB, and H_INVALIDATE_PID. + +Add shells for each of these and register them as the hypercall handlers. +Currently they all log an unimplemented hypercall and return H_FUNCTION. + +Signed-off-by: Suraj Jitindar Singh +[dwg: Fix style nits] +Signed-off-by: David Gibson + +(cherry picked from commit d77a98b01575bbbeff87a83f6e7f5ca0ce3aefdb) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_hcall.c | 31 +++++++++++++++++++++++++++++++ + include/hw/ppc/spapr.h | 3 +++ + 2 files changed, 34 insertions(+) + +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index f05a90e..7952129 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -878,6 +878,32 @@ static target_ulong h_set_mode(PowerPCCPU *cpu, sPAPRMachineState *spapr, + return ret; + } + ++static target_ulong h_clean_slb(PowerPCCPU *cpu, sPAPRMachineState *spapr, ++ target_ulong opcode, target_ulong *args) ++{ ++ qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n", ++ opcode, " (H_CLEAN_SLB)"); ++ return H_FUNCTION; ++} ++ ++static target_ulong h_invalidate_pid(PowerPCCPU *cpu, sPAPRMachineState *spapr, ++ target_ulong opcode, target_ulong *args) ++{ ++ qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n", ++ opcode, " (H_INVALIDATE_PID)"); ++ return H_FUNCTION; ++} ++ ++static target_ulong h_register_process_table(PowerPCCPU *cpu, ++ sPAPRMachineState *spapr, ++ target_ulong opcode, ++ target_ulong *args) ++{ ++ qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n", ++ opcode, " (H_REGISTER_PROC_TBL)"); ++ return H_FUNCTION; ++} ++ + #define H_SIGNAL_SYS_RESET_ALL -1 + #define H_SIGNAL_SYS_RESET_ALLBUTSELF -2 + +@@ -1084,6 +1110,11 @@ static void hypercall_register_types(void) + spapr_register_hypercall(H_PAGE_INIT, h_page_init); + spapr_register_hypercall(H_SET_MODE, h_set_mode); + ++ /* In Memory Table MMU h-calls */ ++ spapr_register_hypercall(H_CLEAN_SLB, h_clean_slb); ++ spapr_register_hypercall(H_INVALIDATE_PID, h_invalidate_pid); ++ spapr_register_hypercall(H_REGISTER_PROC_TBL, h_register_process_table); ++ + /* "debugger" hcalls (also used by SLOF). Note: We do -not- differenciate + * here between the "CI" and the "CACHE" variants, they will use whatever + * mapping attributes qemu is using. When using KVM, the kernel will +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index 808aac8..9db6bbe 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -349,6 +349,9 @@ struct sPAPRMachineState { + #define H_XIRR_X 0x2FC + #define H_RANDOM 0x300 + #define H_SET_MODE 0x31C ++#define H_CLEAN_SLB 0x374 ++#define H_INVALIDATE_PID 0x378 ++#define H_REGISTER_PROC_TBL 0x37C + #define H_SIGNAL_SYS_RESET 0x380 + #define MAX_HCALL_OPCODE H_SIGNAL_SYS_RESET + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Add-stub-implementation-of-the-PSSCR.patch b/SOURCES/kvm-target-ppc-Add-stub-implementation-of-the-PSSCR.patch new file mode 100644 index 0000000..37f4544 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Add-stub-implementation-of-the-PSSCR.patch @@ -0,0 +1,74 @@ +From ad017413736e51417a4b67e965ad1e968518a957 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Fri, 11 Aug 2017 06:09:09 +0200 +Subject: [PATCH 2/3] target/ppc: Add stub implementation of the PSSCR +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: David Gibson +Message-id: <20170811060909.31369-3-dgibson@redhat.com> +Patchwork-id: 75934 +O-Subject: [RHEL-7.4-ALT qemu-kvm PATCH 2/2] target/ppc: Add stub implementation of the PSSCR +Bugzilla: 1478822 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: David Gibson + +The PSSCR register added in POWER9 controls certain power saving mode +behaviours. Mostly, it's not relevant to TCG, however because qemu +doesn't know about it yet, it doesn't synchronize the state with KVM, +and thus it doesn't get migrated. + +To fix that, this adds a minimal stub implementation of the register. +This isn't complete, even to the extent that an implementation is +possible in TCG, just enough to get migration working. We need to +come back later and at least properly filter the various fields in the +register based on privilege level. + +Signed-off-by: David Gibson +Reviewed-by: Cédric Le Goater +Reviewed-by: Greg Kurz +Reviewed-by: Thomas Huth +(cherry picked from commit b8af5b2d5f67b0e1b274f8532f42a47bfe46ea3b) + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + target/ppc/cpu.h | 1 + + target/ppc/translate_init.c | 5 +++++ + 2 files changed, 6 insertions(+) + +diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h +index a2d7b6f..5fc8eca 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -1764,6 +1764,7 @@ int ppc_compat_max_threads(PowerPCCPU *cpu); + #define SPR_IC (0x350) + #define SPR_VTB (0x351) + #define SPR_MMCRC (0x353) ++#define SPR_PSSCR (0x357) + #define SPR_440_INV0 (0x370) + #define SPR_440_INV1 (0x371) + #define SPR_440_INV2 (0x372) +diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c +index 624bc1c..968717d 100644 +--- a/target/ppc/translate_init.c ++++ b/target/ppc/translate_init.c +@@ -8842,6 +8842,11 @@ static void init_proc_POWER9(CPUPPCState *env) + spr_read_generic, spr_write_generic, + KVM_REG_PPC_TIDR, 0); + ++ /* FIXME: Filter fields properly based on privilege level */ ++ spr_register_kvm_hv(env, SPR_PSSCR, "PSSCR", NULL, NULL, NULL, NULL, ++ spr_read_generic, spr_write_generic, ++ KVM_REG_PPC_PSSCR, 0); ++ + /* env variables */ + #if !defined(CONFIG_USER_ONLY) + env->slb_nr = 32; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Allow-workarounds-for-POWER9-DD1.patch b/SOURCES/kvm-target-ppc-Allow-workarounds-for-POWER9-DD1.patch new file mode 100644 index 0000000..1585777 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Allow-workarounds-for-POWER9-DD1.patch @@ -0,0 +1,80 @@ +From 4fbb9c18f0a43c8dea773ef3a115f43492e3a971 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Wed, 17 May 2017 02:23:23 +0200 +Subject: [PATCH 07/27] target/ppc: Allow workarounds for POWER9 DD1 + +RH-Author: David Gibson +Message-id: <20170517022323.16930-3-dgibson@redhat.com> +Patchwork-id: 75202 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 2/2] target/ppc: Allow workarounds for POWER9 DD1 +Bugzilla: 1443289 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Laszlo Ersek + +From: David Gibson + +POWER9 DD1 silicon has some bugs which mean it a) isn't really compliant +with the ISA v3.00 and b) require a number of special workarounds in the +kernel. + +At the moment, qemu isn't aware of DD1. For TCG we don't really want it to +be (why bother emulating buggy silicon). But with KVM, the guest does need +to be aware of DD1 so it can apply the necessary workarounds. + +Meanwhile, the feature negotiation between qemu and the guest strongly +favours architected compatibility modes to "raw" CPU modes. In combination +with the above, this means the guest sees architected POWER9 mode, and +doesn't apply the DD1 workarounds. Well, unless it has yet another +workaround to partially ignore what qemu tells it. + +This patch addresses this by disabling support for compatibility modes when +using KVM on a POWER9 DD1 host. + +Signed-off-by: David Gibson +(cherry picked from commit 5f3066d8b1063b364cd42d64bc011a56fae9c086) + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + target/ppc/cpu-models.h | 1 + + target/ppc/kvm.c | 11 +++++++++++ + 2 files changed, 12 insertions(+) + +diff --git a/target/ppc/cpu-models.h b/target/ppc/cpu-models.h +index d587e69..b563c45 100644 +--- a/target/ppc/cpu-models.h ++++ b/target/ppc/cpu-models.h +@@ -561,6 +561,7 @@ enum { + CPU_POWERPC_POWER8NVL_BASE = 0x004C0000, + CPU_POWERPC_POWER8NVL_v10 = 0x004C0100, + CPU_POWERPC_POWER9_BASE = 0x004E0000, ++ CPU_POWERPC_POWER9_DD1 = 0x004E0100, + CPU_POWERPC_970_v22 = 0x00390202, + CPU_POWERPC_970FX_v10 = 0x00391100, + CPU_POWERPC_970FX_v20 = 0x003C0200, +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 43afa4e..1765204 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -2371,6 +2371,17 @@ static void kvmppc_host_cpu_class_init(ObjectClass *oc, void *data) + + #if defined(TARGET_PPC64) + pcc->radix_page_info = kvm_get_radix_page_info(); ++ ++ if ((pcc->pvr & 0xffffff00) == CPU_POWERPC_POWER9_DD1) { ++ /* ++ * POWER9 DD1 has some bugs which make it not really ISA 3.00 ++ * compliant. More importantly, advertising ISA 3.00 ++ * architected mode may prevent guests from activating ++ * necessary DD1 workarounds. ++ */ ++ pcc->pcr_supported &= ~(PCR_COMPAT_3_00 | PCR_COMPAT_2_07 ++ | PCR_COMPAT_2_06 | PCR_COMPAT_2_05); ++ } + #endif /* defined(TARGET_PPC64) */ + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Fix-return-value-in-tcg-radix-mmu-fault-h.patch b/SOURCES/kvm-target-ppc-Fix-return-value-in-tcg-radix-mmu-fault-h.patch new file mode 100644 index 0000000..265b340 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Fix-return-value-in-tcg-radix-mmu-fault-h.patch @@ -0,0 +1,55 @@ +From c6e422e04d86a18085677e03439f9f0c0f4548a0 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Thu, 13 Jul 2017 16:36:28 +0200 +Subject: [PATCH 4/6] target/ppc: Fix return value in tcg radix mmu fault + handler + +RH-Author: Laurent Vivier +Message-id: <20170713163630.24848-3-lvivier@redhat.com> +Patchwork-id: 75764 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH 2/4] target/ppc: Fix return value in tcg radix mmu fault handler +Bugzilla: 1470558 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Suraj Jitindar Singh + +From: Suraj Jitindar Singh + +The mmu fault handler should return 0 if it was able to successfully +handle the fault and a positive value otherwise. + +Currently the tcg radix mmu fault handler will return 1 after +successfully handling a fault in virtual mode. This is incorrect +so fix it so that it returns 0 in this case. + +The handler already correctly returns 0 when a fault was handled +in real mode and 1 if an interrupt was generated. + +Fixes: d5fee0bbe68d ("target/ppc: Implement ISA V3.00 radix page fault handler") + +Signed-off-by: Suraj Jitindar Singh +Signed-off-by: David Gibson +(cherry picked from commit 35068bd15eec80844699173b9e7d5ccb09a6bb87) +Signed-off-by: Laurent Vivier + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1470558 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13654102 +Signed-off-by: Miroslav Rezanina +--- + target/ppc/mmu-radix64.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c +index de18c0b..69fde65 100644 +--- a/target/ppc/mmu-radix64.c ++++ b/target/ppc/mmu-radix64.c +@@ -255,5 +255,5 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, + + tlb_set_page(cs, eaddr & TARGET_PAGE_MASK, raddr & TARGET_PAGE_MASK, + prot, mmu_idx, 1UL << page_size); +- return 1; ++ return 0; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Fix-size-of-struct-PPCElfPrstatus.patch b/SOURCES/kvm-target-ppc-Fix-size-of-struct-PPCElfPrstatus.patch new file mode 100644 index 0000000..99d36a1 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Fix-size-of-struct-PPCElfPrstatus.patch @@ -0,0 +1,45 @@ +From 53657d9a25ad6de011e8897a51be399b3970e4dc Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Fri, 11 Aug 2017 15:47:22 +0200 +Subject: [PATCH 3/3] target/ppc: Fix size of struct PPCElfPrstatus + +RH-Author: Laurent Vivier +Message-id: <20170811154722.4240-1-lvivier@redhat.com> +Patchwork-id: 75942 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH] target/ppc: Fix size of struct PPCElfPrstatus +Bugzilla: 1480418 +RH-Acked-by: Thomas Huth +RH-Acked-by: David Gibson +RH-Acked-by: Miroslav Rezanina + +From: Anton Blanchard + +gdb refuses to parse QEMU memory dumps because struct PPCElfPrstatus +is the wrong size. Fix it. + +Signed-off-by: Anton Blanchard +Fixes: e62fbc54d459 ("target-ppc: dump-guest-memory support") +Signed-off-by: David Gibson +(cherry picked from commit b88290cd9ea474fea38c4733f365a3cd2519723e) +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + target/ppc/arch_dump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/target/ppc/arch_dump.c b/target/ppc/arch_dump.c +index 28d9cc7..8e9397a 100644 +--- a/target/ppc/arch_dump.c ++++ b/target/ppc/arch_dump.c +@@ -50,7 +50,7 @@ struct PPCUserRegStruct { + struct PPCElfPrstatus { + char pad1[112]; + struct PPCUserRegStruct pr_reg; +- reg_t pad2[4]; ++ char pad2[40]; + } QEMU_PACKED; + + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Implement-H_REGISTER_PROCESS_TABLE-H_CALL.patch b/SOURCES/kvm-target-ppc-Implement-H_REGISTER_PROCESS_TABLE-H_CALL.patch new file mode 100644 index 0000000..6c1b28e --- /dev/null +++ b/SOURCES/kvm-target-ppc-Implement-H_REGISTER_PROCESS_TABLE-H_CALL.patch @@ -0,0 +1,335 @@ +From 3486821cd193da11753933c645883f96c8b035de Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:55 +0200 +Subject: [PATCH 20/23] target/ppc: Implement H_REGISTER_PROCESS_TABLE H_CALL + +RH-Author: David Gibson +Message-id: <20170427021558.4884-5-dgibson@redhat.com> +Patchwork-id: 74917 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 4/7] target/ppc: Implement H_REGISTER_PROCESS_TABLE H_CALL +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Suraj Jitindar Singh + +The H_REGISTER_PROCESS_TABLE H_CALL is used by a guest to indicate to the +hypervisor where in memory its process table is and how translation should +be performed using this process table. + +Provide the implementation of this H_CALL for a guest. + +We first check for invalid flags, then parse the flags to determine the +operation, and then check the other parameters for valid values based on +the operation (register new table/deregister table/maintain registration). +The process table is then stored in the appropriate location and registered +with the hypervisor (if running under KVM), and the LPCR_[UPRT/GTSE] bits +are updated as required. + +Signed-off-by: Suraj Jitindar Singh +Signed-off-by: Sam Bobroff +[dwg: Correct missing prototype and uninitialized variable] +Signed-off-by: David Gibson + +(cherry picked from commit b4db54132ffeadafa9516cc553ba9548e42d42ad) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr.c | 35 +++++++++------ + hw/ppc/spapr_hcall.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++-- + include/hw/ppc/spapr.h | 2 + + target/ppc/kvm.c | 31 ++++++++++++++ + target/ppc/kvm_ppc.h | 10 +++++ + 5 files changed, 176 insertions(+), 15 deletions(-) + +diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c +index 6995c7a..8b9f877 100644 +--- a/hw/ppc/spapr.c ++++ b/hw/ppc/spapr.c +@@ -40,6 +40,7 @@ + #include "kvm_ppc.h" + #include "migration/migration.h" + #include "mmu-hash64.h" ++#include "mmu-book3s-v3.h" + #include "qom/cpu.h" + + #include "hw/boards.h" +@@ -1114,7 +1115,7 @@ static int get_htab_fd(sPAPRMachineState *spapr) + return spapr->htab_fd; + } + +-static void close_htab_fd(sPAPRMachineState *spapr) ++void close_htab_fd(sPAPRMachineState *spapr) + { + if (spapr->htab_fd >= 0) { + close(spapr->htab_fd); +@@ -1241,6 +1242,19 @@ static void spapr_reallocate_hpt(sPAPRMachineState *spapr, int shift, + } + } + ++void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr) ++{ ++ spapr_reallocate_hpt(spapr, ++ spapr_hpt_shift_for_ramsize(MACHINE(spapr)->maxram_size), ++ &error_fatal); ++ if (spapr->vrma_adjust) { ++ spapr->rma_size = kvmppc_rma_size(spapr_node0_size(), ++ spapr->htab_shift); ++ } ++ /* We're setting up a hash table, so that means we're not radix */ ++ spapr->patb_entry = 0; ++} ++ + static void find_unknown_sysbus_device(SysBusDevice *sbdev, void *opaque) + { + bool matched = false; +@@ -1269,17 +1283,14 @@ static void ppc_spapr_reset(void) + /* Check for unknown sysbus devices */ + foreach_dynamic_sysbus_device(find_unknown_sysbus_device, NULL); + +- spapr->patb_entry = 0; +- +- /* Allocate and/or reset the hash page table */ +- spapr_reallocate_hpt(spapr, +- spapr_hpt_shift_for_ramsize(machine->maxram_size), +- &error_fatal); +- +- /* Update the RMA size if necessary */ +- if (spapr->vrma_adjust) { +- spapr->rma_size = kvmppc_rma_size(spapr_node0_size(), +- spapr->htab_shift); ++ if (kvm_enabled() && kvmppc_has_cap_mmu_radix()) { ++ /* If using KVM with radix mode available, VCPUs can be started ++ * without a HPT because KVM will start them in radix mode. ++ * Set the GR bit in PATB so that we know there is no HPT. */ ++ spapr->patb_entry = PATBE1_GR; ++ } else { ++ spapr->patb_entry = 0; ++ spapr_setup_hpt_and_vrma(spapr); + } + + qemu_devices_reset(); +diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c +index 7952129..a958fee 100644 +--- a/hw/ppc/spapr_hcall.c ++++ b/hw/ppc/spapr_hcall.c +@@ -12,6 +12,8 @@ + #include "trace.h" + #include "kvm_ppc.h" + #include "hw/ppc/spapr_ovec.h" ++#include "qemu/error-report.h" ++#include "mmu-book3s-v3.h" + + struct SPRSyncState { + int spr; +@@ -894,14 +896,119 @@ static target_ulong h_invalidate_pid(PowerPCCPU *cpu, sPAPRMachineState *spapr, + return H_FUNCTION; + } + ++static void spapr_check_setup_free_hpt(sPAPRMachineState *spapr, ++ uint64_t patbe_old, uint64_t patbe_new) ++{ ++ /* ++ * We have 4 Options: ++ * HASH->HASH || RADIX->RADIX || NOTHING->RADIX : Do Nothing ++ * HASH->RADIX : Free HPT ++ * RADIX->HASH : Allocate HPT ++ * NOTHING->HASH : Allocate HPT ++ * Note: NOTHING implies the case where we said the guest could choose ++ * later and so assumed radix and now it's called H_REG_PROC_TBL ++ */ ++ ++ if ((patbe_old & PATBE1_GR) == (patbe_new & PATBE1_GR)) { ++ /* We assume RADIX, so this catches all the "Do Nothing" cases */ ++ } else if (!(patbe_old & PATBE1_GR)) { ++ /* HASH->RADIX : Free HPT */ ++ g_free(spapr->htab); ++ spapr->htab = NULL; ++ spapr->htab_shift = 0; ++ close_htab_fd(spapr); ++ } else if (!(patbe_new & PATBE1_GR)) { ++ /* RADIX->HASH || NOTHING->HASH : Allocate HPT */ ++ spapr_setup_hpt_and_vrma(spapr); ++ } ++ return; ++} ++ ++#define FLAGS_MASK 0x01FULL ++#define FLAG_MODIFY 0x10 ++#define FLAG_REGISTER 0x08 ++#define FLAG_RADIX 0x04 ++#define FLAG_HASH_PROC_TBL 0x02 ++#define FLAG_GTSE 0x01 ++ + static target_ulong h_register_process_table(PowerPCCPU *cpu, + sPAPRMachineState *spapr, + target_ulong opcode, + target_ulong *args) + { +- qemu_log_mask(LOG_UNIMP, "Unimplemented SPAPR hcall 0x"TARGET_FMT_lx"%s\n", +- opcode, " (H_REGISTER_PROC_TBL)"); +- return H_FUNCTION; ++ CPUPPCState *env = &cpu->env; ++ target_ulong flags = args[0]; ++ target_ulong proc_tbl = args[1]; ++ target_ulong page_size = args[2]; ++ target_ulong table_size = args[3]; ++ uint64_t cproc; ++ ++ if (flags & ~FLAGS_MASK) { /* Check no reserved bits are set */ ++ return H_PARAMETER; ++ } ++ if (flags & FLAG_MODIFY) { ++ if (flags & FLAG_REGISTER) { ++ if (flags & FLAG_RADIX) { /* Register new RADIX process table */ ++ if (proc_tbl & 0xfff || proc_tbl >> 60) { ++ return H_P2; ++ } else if (page_size) { ++ return H_P3; ++ } else if (table_size > 24) { ++ return H_P4; ++ } ++ cproc = PATBE1_GR | proc_tbl | table_size; ++ } else { /* Register new HPT process table */ ++ if (flags & FLAG_HASH_PROC_TBL) { /* Hash with Segment Tables */ ++ /* TODO - Not Supported */ ++ /* Technically caused by flag bits => H_PARAMETER */ ++ return H_PARAMETER; ++ } else { /* Hash with SLB */ ++ if (proc_tbl >> 38) { ++ return H_P2; ++ } else if (page_size & ~0x7) { ++ return H_P3; ++ } else if (table_size > 24) { ++ return H_P4; ++ } ++ } ++ cproc = (proc_tbl << 25) | page_size << 5 | table_size; ++ } ++ ++ } else { /* Deregister current process table */ ++ /* Set to benign value: (current GR) | 0. This allows ++ * deregistration in KVM to succeed even if the radix bit in flags ++ * doesn't match the radix bit in the old PATB. */ ++ cproc = spapr->patb_entry & PATBE1_GR; ++ } ++ } else { /* Maintain current registration */ ++ if (!(flags & FLAG_RADIX) != !(spapr->patb_entry & PATBE1_GR)) { ++ /* Technically caused by flag bits => H_PARAMETER */ ++ return H_PARAMETER; /* Existing Process Table Mismatch */ ++ } ++ cproc = spapr->patb_entry; ++ } ++ ++ /* Check if we need to setup OR free the hpt */ ++ spapr_check_setup_free_hpt(spapr, spapr->patb_entry, cproc); ++ ++ spapr->patb_entry = cproc; /* Save new process table */ ++ if ((flags & FLAG_RADIX) || (flags & FLAG_HASH_PROC_TBL)) { ++ /* Use Process TBL */ ++ env->spr[SPR_LPCR] |= LPCR_UPRT; ++ } else { ++ env->spr[SPR_LPCR] &= ~LPCR_UPRT; ++ } ++ if (flags & FLAG_GTSE) { /* Partition Uses Guest Translation Shootdwn */ ++ env->spr[SPR_LPCR] |= LPCR_GTSE; ++ } else { ++ env->spr[SPR_LPCR] &= ~LPCR_GTSE; ++ } ++ ++ if (kvm_enabled()) { ++ return kvmppc_configure_v3_mmu(cpu, flags & FLAG_RADIX, ++ flags & FLAG_GTSE, cproc); ++ } ++ return H_SUCCESS; + } + + #define H_SIGNAL_SYS_RESET_ALL -1 +diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h +index 9db6bbe..247c969 100644 +--- a/include/hw/ppc/spapr.h ++++ b/include/hw/ppc/spapr.h +@@ -596,6 +596,8 @@ void spapr_dt_events(sPAPRMachineState *sm, void *fdt); + int spapr_h_cas_compose_response(sPAPRMachineState *sm, + target_ulong addr, target_ulong size, + sPAPROptionVector *ov5_updates); ++void close_htab_fd(sPAPRMachineState *spapr); ++void spapr_setup_hpt_and_vrma(sPAPRMachineState *spapr); + sPAPRTCETable *spapr_tce_new_table(DeviceState *owner, uint32_t liobn); + void spapr_tce_table_enable(sPAPRTCETable *tcet, + uint32_t page_shift, uint64_t bus_offset, +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index b733578..43afa4e 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -361,6 +361,37 @@ struct ppc_radix_page_info *kvm_get_radix_page_info(void) + return radix_page_info; + } + ++target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, ++ bool radix, bool gtse, ++ uint64_t proc_tbl) ++{ ++ CPUState *cs = CPU(cpu); ++ int ret; ++ uint64_t flags = 0; ++ struct kvm_ppc_mmuv3_cfg cfg = { ++ .process_table = proc_tbl, ++ }; ++ ++ if (radix) { ++ flags |= KVM_PPC_MMUV3_RADIX; ++ } ++ if (gtse) { ++ flags |= KVM_PPC_MMUV3_GTSE; ++ } ++ cfg.flags = flags; ++ ret = kvm_vm_ioctl(cs->kvm_state, KVM_PPC_CONFIGURE_V3_MMU, &cfg); ++ switch (ret) { ++ case 0: ++ return H_SUCCESS; ++ case -EINVAL: ++ return H_PARAMETER; ++ case -ENODEV: ++ return H_NOT_AVAILABLE; ++ default: ++ return H_HARDWARE; ++ } ++} ++ + static bool kvm_valid_page_size(uint32_t flags, long rampgsize, uint32_t shift) + { + if (!(flags & KVM_PPC_PAGE_SIZES_REAL)) { +diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h +index 64189a4..4b2fd9a 100644 +--- a/target/ppc/kvm_ppc.h ++++ b/target/ppc/kvm_ppc.h +@@ -33,6 +33,9 @@ int kvmppc_clear_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits); + int kvmppc_or_tsr_bits(PowerPCCPU *cpu, uint32_t tsr_bits); + int kvmppc_set_tcr(PowerPCCPU *cpu); + int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu); ++target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, ++ bool radix, bool gtse, ++ uint64_t proc_tbl); + #ifndef CONFIG_USER_ONLY + off_t kvmppc_alloc_rma(void **rma); + bool kvmppc_spapr_use_multitce(void); +@@ -159,6 +162,13 @@ static inline int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu) + return -1; + } + ++static inline target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, ++ bool radix, bool gtse, ++ uint64_t proc_tbl) ++{ ++ return 0; ++} ++ + #ifndef CONFIG_USER_ONLY + static inline off_t kvmppc_alloc_rma(void **rma) + { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Implement-ISA-V3.00-radix-page-fault-hand.patch b/SOURCES/kvm-target-ppc-Implement-ISA-V3.00-radix-page-fault-hand.patch new file mode 100644 index 0000000..9b14217 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Implement-ISA-V3.00-radix-page-fault-hand.patch @@ -0,0 +1,497 @@ +From 5eb7572177f7cd58bbd8556707fe6546ec46c1d2 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Thu, 13 Jul 2017 16:36:27 +0200 +Subject: [PATCH 3/6] target/ppc: Implement ISA V3.00 radix page fault handler + +RH-Author: Laurent Vivier +Message-id: <20170713163630.24848-2-lvivier@redhat.com> +Patchwork-id: 75768 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH 1/4] target/ppc: Implement ISA V3.00 radix page fault handler +Bugzilla: 1470558 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Suraj Jitindar Singh + +From: Suraj Jitindar Singh + +ISA V3.00 introduced a new radix mmu model. Implement the page fault +handler for this so we can run a tcg guest in radix mode and perform +address translation correctly. + +In real mode (mmu turned off) addresses are masked to remove the top +4 bits and then are subject to partition scoped translation, since we only +support pseries at this stage it is only necessary to perform the masking +and then we're done. + +In virtual mode (mmu turned on) address translation if performed as +follows: + +1. Use the quadrant to determine the fully qualified address. + +The fully qualified address is defined as the combination of the effective +address, the effective logical partition id (LPID) and the effective +process id (PID). Based on the quadrant (EA63:62) we set the pid and lpid +like so: + +quadrant 0: lpid = LPIDR, pid = PIDR +quadrant 1: HV only (not allowed in pseries) +quadrant 2: HV only (not allowed in pseries) +quadrant 3: lpid = LPIDR, pid = 0 + +If we can't get the fully qualified address we raise a segment interrupt. + +2. Find the guest radix tree + +We ask the virtual hypervisor for the partition table which was registered +with H_REGISTER_PROC_TBL which points us to the process table in guest +memory. We then index this table by pid to get the process table entry +which points us to the appropriate radix tree to translate the address. + +If the process table isn't big enough to contain an entry for the current +pid then we raise a storage interrupt. + +3. Walk the radix tree + +Next we walk the radix tree where each level is a table of page directory +entries indexed by some number of bits from the effective address, where +the number of bits is determined by the table size. We continue to walk +the tree (while entries are valid and the table is of minimum size) until +we reach a table of page table entries, indicated by having the leaf bit +set. The appropriate pte is then checked for sufficient access permissions, +the reference and change bits are updated and the real address is +calculated from the real page number bits of the pte and the low bits of +the effective address. + +If we can't find an entry or can't access the entry bacause of permissions +then we raise a storage interrupt. + +Signed-off-by: Suraj Jitindar Singh +[dwg: Add missing parentheses to macro] +Signed-off-by: David Gibson + +(cherry picked from commit d5fee0bbe68d5e61e2d2beb5ff6de0b9c1cfd182) +Signed-off-by: Laurent Vivier + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1470558 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13654102 +Signed-off-by: Miroslav Rezanina +--- + target/ppc/Makefile.objs | 1 + + target/ppc/cpu.h | 2 + + target/ppc/mmu-book3s-v3.c | 6 +- + target/ppc/mmu-book3s-v3.h | 5 + + target/ppc/mmu-radix64.c | 259 +++++++++++++++++++++++++++++++++++++++++++++ + target/ppc/mmu-radix64.h | 72 +++++++++++++ + 6 files changed, 341 insertions(+), 4 deletions(-) + create mode 100644 target/ppc/mmu-radix64.c + create mode 100644 target/ppc/mmu-radix64.h + +diff --git a/target/ppc/Makefile.objs b/target/ppc/Makefile.objs +index f963777..f92ba67 100644 +--- a/target/ppc/Makefile.objs ++++ b/target/ppc/Makefile.objs +@@ -4,6 +4,7 @@ obj-y += translate.o + ifeq ($(CONFIG_SOFTMMU),y) + obj-y += machine.o mmu_helper.o mmu-hash32.o monitor.o arch_dump.o + obj-$(TARGET_PPC64) += mmu-hash64.o mmu-book3s-v3.o compat.o ++obj-$(TARGET_PPC64) += mmu-radix64.o + endif + obj-$(CONFIG_KVM) += kvm.o + obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o +diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h +index cacdd0a..43bd257 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -480,6 +480,8 @@ struct ppc_slb_t { + #define DSISR_ISSTORE 0x02000000 + /* Not permitted by virtual page class key protection */ + #define DSISR_AMR 0x00200000 ++/* Unsupported Radix Tree Configuration */ ++#define DSISR_R_BADCONFIG 0x00080000 + + /* SRR1 error code fields */ + +diff --git a/target/ppc/mmu-book3s-v3.c b/target/ppc/mmu-book3s-v3.c +index 005c963..e7798b3 100644 +--- a/target/ppc/mmu-book3s-v3.c ++++ b/target/ppc/mmu-book3s-v3.c +@@ -22,15 +22,13 @@ + #include "cpu.h" + #include "mmu-hash64.h" + #include "mmu-book3s-v3.h" +-#include "qemu/error-report.h" ++#include "mmu-radix64.h" + + int ppc64_v3_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, + int mmu_idx) + { + if (ppc64_radix_guest(cpu)) { /* Guest uses radix */ +- /* TODO - Unsupported */ +- error_report("Guest Radix Support Unimplemented"); +- exit(1); ++ return ppc_radix64_handle_mmu_fault(cpu, eaddr, rwx, mmu_idx); + } else { /* Guest uses hash */ + return ppc_hash64_handle_mmu_fault(cpu, eaddr, rwx, mmu_idx); + } +diff --git a/target/ppc/mmu-book3s-v3.h b/target/ppc/mmu-book3s-v3.h +index 636f6ab..56095da 100644 +--- a/target/ppc/mmu-book3s-v3.h ++++ b/target/ppc/mmu-book3s-v3.h +@@ -25,6 +25,11 @@ + /* Partition Table Entry Fields */ + #define PATBE1_GR 0x8000000000000000 + ++/* Process Table Entry */ ++struct prtb_entry { ++ uint64_t prtbe0, prtbe1; ++}; ++ + #ifdef TARGET_PPC64 + + static inline bool ppc64_use_proc_tbl(PowerPCCPU *cpu) +diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c +new file mode 100644 +index 0000000..de18c0b +--- /dev/null ++++ b/target/ppc/mmu-radix64.c +@@ -0,0 +1,259 @@ ++/* ++ * PowerPC Radix MMU mulation helpers for QEMU. ++ * ++ * Copyright (c) 2016 Suraj Jitindar Singh, IBM Corporation ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, see . ++ */ ++ ++#include "qemu/osdep.h" ++#include "qapi/error.h" ++#include "cpu.h" ++#include "exec/exec-all.h" ++#include "exec/helper-proto.h" ++#include "qemu/error-report.h" ++#include "sysemu/kvm.h" ++#include "kvm_ppc.h" ++#include "exec/log.h" ++#include "mmu-radix64.h" ++#include "mmu-book3s-v3.h" ++ ++static bool ppc_radix64_get_fully_qualified_addr(CPUPPCState *env, vaddr eaddr, ++ uint64_t *lpid, uint64_t *pid) ++{ ++ /* We don't have HV support yet and shouldn't get here with it set anyway */ ++ assert(!msr_hv); ++ ++ if (!msr_hv) { /* !MSR[HV] -> Guest */ ++ switch (eaddr & R_EADDR_QUADRANT) { ++ case R_EADDR_QUADRANT0: /* Guest application */ ++ *lpid = env->spr[SPR_LPIDR]; ++ *pid = env->spr[SPR_BOOKS_PID]; ++ break; ++ case R_EADDR_QUADRANT1: /* Illegal */ ++ case R_EADDR_QUADRANT2: ++ return false; ++ case R_EADDR_QUADRANT3: /* Guest OS */ ++ *lpid = env->spr[SPR_LPIDR]; ++ *pid = 0; /* pid set to 0 -> addresses guest operating system */ ++ break; ++ } ++ } ++ ++ return true; ++} ++ ++static void ppc_radix64_raise_segi(PowerPCCPU *cpu, int rwx, vaddr eaddr) ++{ ++ CPUState *cs = CPU(cpu); ++ CPUPPCState *env = &cpu->env; ++ ++ if (rwx == 2) { /* Instruction Segment Interrupt */ ++ cs->exception_index = POWERPC_EXCP_ISEG; ++ } else { /* Data Segment Interrupt */ ++ cs->exception_index = POWERPC_EXCP_DSEG; ++ env->spr[SPR_DAR] = eaddr; ++ } ++ env->error_code = 0; ++} ++ ++static void ppc_radix64_raise_si(PowerPCCPU *cpu, int rwx, vaddr eaddr, ++ uint32_t cause) ++{ ++ CPUState *cs = CPU(cpu); ++ CPUPPCState *env = &cpu->env; ++ ++ if (rwx == 2) { /* Instruction Storage Interrupt */ ++ cs->exception_index = POWERPC_EXCP_ISI; ++ env->error_code = cause; ++ } else { /* Data Storage Interrupt */ ++ cs->exception_index = POWERPC_EXCP_DSI; ++ if (rwx == 1) { /* Write -> Store */ ++ cause |= DSISR_ISSTORE; ++ } ++ env->spr[SPR_DSISR] = cause; ++ env->spr[SPR_DAR] = eaddr; ++ env->error_code = 0; ++ } ++} ++ ++ ++static bool ppc_radix64_check_prot(PowerPCCPU *cpu, int rwx, uint64_t pte, ++ int *fault_cause, int *prot) ++{ ++ CPUPPCState *env = &cpu->env; ++ const int need_prot[] = { PAGE_READ, PAGE_WRITE, PAGE_EXEC }; ++ ++ /* Check Page Attributes (pte58:59) */ ++ if (((pte & R_PTE_ATT) == R_PTE_ATT_NI_IO) && (rwx == 2)) { ++ /* ++ * Radix PTE entries with the non-idempotent I/O attribute are treated ++ * as guarded storage ++ */ ++ *fault_cause |= SRR1_NOEXEC_GUARD; ++ return true; ++ } ++ ++ /* Determine permissions allowed by Encoded Access Authority */ ++ if ((pte & R_PTE_EAA_PRIV) && msr_pr) { /* Insufficient Privilege */ ++ *prot = 0; ++ } else if (msr_pr || (pte & R_PTE_EAA_PRIV)) { ++ *prot = ppc_radix64_get_prot_eaa(pte); ++ } else { /* !msr_pr && !(pte & R_PTE_EAA_PRIV) */ ++ *prot = ppc_radix64_get_prot_eaa(pte); ++ *prot &= ppc_radix64_get_prot_amr(cpu); /* Least combined permissions */ ++ } ++ ++ /* Check if requested access type is allowed */ ++ if (need_prot[rwx] & ~(*prot)) { /* Page Protected for that Access */ ++ *fault_cause |= DSISR_PROTFAULT; ++ return true; ++ } ++ ++ return false; ++} ++ ++static void ppc_radix64_set_rc(PowerPCCPU *cpu, int rwx, uint64_t pte, ++ hwaddr pte_addr, int *prot) ++{ ++ CPUState *cs = CPU(cpu); ++ uint64_t npte; ++ ++ npte = pte | R_PTE_R; /* Always set reference bit */ ++ ++ if (rwx == 1) { /* Store/Write */ ++ npte |= R_PTE_C; /* Set change bit */ ++ } else { ++ /* ++ * Treat the page as read-only for now, so that a later write ++ * will pass through this function again to set the C bit. ++ */ ++ *prot &= ~PAGE_WRITE; ++ } ++ ++ if (pte ^ npte) { /* If pte has changed then write it back */ ++ stq_phys(cs->as, pte_addr, npte); ++ } ++} ++ ++static uint64_t ppc_radix64_walk_tree(PowerPCCPU *cpu, int rwx, vaddr eaddr, ++ uint64_t base_addr, uint64_t nls, ++ hwaddr *raddr, int *psize, ++ int *fault_cause, int *prot, ++ hwaddr *pte_addr) ++{ ++ CPUState *cs = CPU(cpu); ++ uint64_t index, pde; ++ ++ if (nls < 5) { /* Directory maps less than 2**5 entries */ ++ *fault_cause |= DSISR_R_BADCONFIG; ++ return 0; ++ } ++ ++ /* Read page entry from guest address space */ ++ index = eaddr >> (*psize - nls); /* Shift */ ++ index &= ((1UL << nls) - 1); /* Mask */ ++ pde = ldq_phys(cs->as, base_addr + (index * sizeof(pde))); ++ if (!(pde & R_PTE_VALID)) { /* Invalid Entry */ ++ *fault_cause |= DSISR_NOPTE; ++ return 0; ++ } ++ ++ *psize -= nls; ++ ++ /* Check if Leaf Entry -> Page Table Entry -> Stop the Search */ ++ if (pde & R_PTE_LEAF) { ++ uint64_t rpn = pde & R_PTE_RPN; ++ uint64_t mask = (1UL << *psize) - 1; ++ ++ if (ppc_radix64_check_prot(cpu, rwx, pde, fault_cause, prot)) { ++ return 0; /* Protection Denied Access */ ++ } ++ ++ /* Or high bits of rpn and low bits to ea to form whole real addr */ ++ *raddr = (rpn & ~mask) | (eaddr & mask); ++ *pte_addr = base_addr + (index * sizeof(pde)); ++ return pde; ++ } ++ ++ /* Next Level of Radix Tree */ ++ return ppc_radix64_walk_tree(cpu, rwx, eaddr, pde & R_PDE_NLB, ++ pde & R_PDE_NLS, raddr, psize, ++ fault_cause, prot, pte_addr); ++} ++ ++int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, ++ int mmu_idx) ++{ ++ CPUState *cs = CPU(cpu); ++ CPUPPCState *env = &cpu->env; ++ PPCVirtualHypervisorClass *vhc = ++ PPC_VIRTUAL_HYPERVISOR_GET_CLASS(cpu->vhyp); ++ hwaddr raddr, pte_addr; ++ uint64_t lpid = 0, pid = 0, offset, size, patbe, prtbe0, pte; ++ int page_size, prot, fault_cause = 0; ++ ++ assert((rwx == 0) || (rwx == 1) || (rwx == 2)); ++ assert(!msr_hv); /* For now there is no Radix PowerNV Support */ ++ assert(cpu->vhyp); ++ assert(ppc64_use_proc_tbl(cpu)); ++ ++ /* Real Mode Access */ ++ if (((rwx == 2) && (msr_ir == 0)) || ((rwx != 2) && (msr_dr == 0))) { ++ /* In real mode top 4 effective addr bits (mostly) ignored */ ++ raddr = eaddr & 0x0FFFFFFFFFFFFFFFULL; ++ ++ tlb_set_page(cs, eaddr & TARGET_PAGE_MASK, raddr & TARGET_PAGE_MASK, ++ PAGE_READ | PAGE_WRITE | PAGE_EXEC, mmu_idx, ++ TARGET_PAGE_SIZE); ++ return 0; ++ } ++ ++ /* Virtual Mode Access - get the fully qualified address */ ++ if (!ppc_radix64_get_fully_qualified_addr(env, eaddr, &lpid, &pid)) { ++ ppc_radix64_raise_segi(cpu, rwx, eaddr); ++ return 1; ++ } ++ ++ /* Get Process Table */ ++ patbe = vhc->get_patbe(cpu->vhyp); ++ ++ /* Index Process Table by PID to Find Corresponding Process Table Entry */ ++ offset = pid * sizeof(struct prtb_entry); ++ size = 1ULL << ((patbe & PATBE1_R_PRTS) + 12); ++ if (offset >= size) { ++ /* offset exceeds size of the process table */ ++ ppc_radix64_raise_si(cpu, rwx, eaddr, DSISR_NOPTE); ++ return 1; ++ } ++ prtbe0 = ldq_phys(cs->as, (patbe & PATBE1_R_PRTB) + offset); ++ ++ /* Walk Radix Tree from Process Table Entry to Convert EA to RA */ ++ page_size = PRTBE_R_GET_RTS(prtbe0); ++ pte = ppc_radix64_walk_tree(cpu, rwx, eaddr & R_EADDR_MASK, ++ prtbe0 & PRTBE_R_RPDB, prtbe0 & PRTBE_R_RPDS, ++ &raddr, &page_size, &fault_cause, &prot, ++ &pte_addr); ++ if (!pte) { ++ ppc_radix64_raise_si(cpu, rwx, eaddr, fault_cause); ++ return 1; ++ } ++ ++ /* Update Reference and Change Bits */ ++ ppc_radix64_set_rc(cpu, rwx, pte, pte_addr, &prot); ++ ++ tlb_set_page(cs, eaddr & TARGET_PAGE_MASK, raddr & TARGET_PAGE_MASK, ++ prot, mmu_idx, 1UL << page_size); ++ return 1; ++} +diff --git a/target/ppc/mmu-radix64.h b/target/ppc/mmu-radix64.h +new file mode 100644 +index 0000000..1d5c7cf +--- /dev/null ++++ b/target/ppc/mmu-radix64.h +@@ -0,0 +1,72 @@ ++#ifndef MMU_RADIX64_H ++#define MMU_RADIX64_H ++ ++#ifndef CONFIG_USER_ONLY ++ ++/* Radix Quadrants */ ++#define R_EADDR_MASK 0x3FFFFFFFFFFFFFFF ++#define R_EADDR_QUADRANT 0xC000000000000000 ++#define R_EADDR_QUADRANT0 0x0000000000000000 ++#define R_EADDR_QUADRANT1 0x4000000000000000 ++#define R_EADDR_QUADRANT2 0x8000000000000000 ++#define R_EADDR_QUADRANT3 0xC000000000000000 ++ ++/* Radix Partition Table Entry Fields */ ++#define PATBE1_R_PRTB 0x0FFFFFFFFFFFF000 ++#define PATBE1_R_PRTS 0x000000000000001F ++ ++/* Radix Process Table Entry Fields */ ++#define PRTBE_R_GET_RTS(rts) \ ++ ((((rts >> 58) & 0x18) | ((rts >> 5) & 0x7)) + 31) ++#define PRTBE_R_RPDB 0x0FFFFFFFFFFFFF00 ++#define PRTBE_R_RPDS 0x000000000000001F ++ ++/* Radix Page Directory/Table Entry Fields */ ++#define R_PTE_VALID 0x8000000000000000 ++#define R_PTE_LEAF 0x4000000000000000 ++#define R_PTE_SW0 0x2000000000000000 ++#define R_PTE_RPN 0x01FFFFFFFFFFF000 ++#define R_PTE_SW1 0x0000000000000E00 ++#define R_GET_SW(sw) (((sw >> 58) & 0x8) | ((sw >> 9) & 0x7)) ++#define R_PTE_R 0x0000000000000100 ++#define R_PTE_C 0x0000000000000080 ++#define R_PTE_ATT 0x0000000000000030 ++#define R_PTE_ATT_NORMAL 0x0000000000000000 ++#define R_PTE_ATT_SAO 0x0000000000000010 ++#define R_PTE_ATT_NI_IO 0x0000000000000020 ++#define R_PTE_ATT_TOLERANT_IO 0x0000000000000030 ++#define R_PTE_EAA_PRIV 0x0000000000000008 ++#define R_PTE_EAA_R 0x0000000000000004 ++#define R_PTE_EAA_RW 0x0000000000000002 ++#define R_PTE_EAA_X 0x0000000000000001 ++#define R_PDE_NLB PRTBE_R_RPDB ++#define R_PDE_NLS PRTBE_R_RPDS ++ ++#ifdef TARGET_PPC64 ++ ++int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, ++ int mmu_idx); ++ ++static inline int ppc_radix64_get_prot_eaa(uint64_t pte) ++{ ++ return (pte & R_PTE_EAA_R ? PAGE_READ : 0) | ++ (pte & R_PTE_EAA_RW ? PAGE_READ | PAGE_WRITE : 0) | ++ (pte & R_PTE_EAA_X ? PAGE_EXEC : 0); ++} ++ ++static inline int ppc_radix64_get_prot_amr(PowerPCCPU *cpu) ++{ ++ CPUPPCState *env = &cpu->env; ++ int amr = env->spr[SPR_AMR] >> 62; /* We only care about key0 AMR63:62 */ ++ int iamr = env->spr[SPR_IAMR] >> 62; /* We only care about key0 IAMR63:62 */ ++ ++ return (amr & 0x2 ? 0 : PAGE_WRITE) | /* Access denied if bit is set */ ++ (amr & 0x1 ? 0 : PAGE_READ) | ++ (iamr & 0x1 ? 0 : PAGE_EXEC); ++} ++ ++#endif /* TARGET_PPC64 */ ++ ++#endif /* CONFIG_USER_ONLY */ ++ ++#endif /* MMU_RADIX64_H */ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Implement-TIDR.patch b/SOURCES/kvm-target-ppc-Implement-TIDR.patch new file mode 100644 index 0000000..a89d46f --- /dev/null +++ b/SOURCES/kvm-target-ppc-Implement-TIDR.patch @@ -0,0 +1,70 @@ +From ae9b87b57aa0cfc52f49960888c5d7d8060fa28c Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Fri, 11 Aug 2017 06:09:08 +0200 +Subject: [PATCH 1/3] target/ppc: Implement TIDR +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: David Gibson +Message-id: <20170811060909.31369-2-dgibson@redhat.com> +Patchwork-id: 75935 +O-Subject: [RHEL-7.4-ALT qemu-kvm PATCH 1/2] target/ppc: Implement TIDR +Bugzilla: 1478822 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: David Gibson + +This adds a trivial implementation of the TIDR register added in +POWER9. This isn't particularly important to qemu directly - it's +used by accelerator modules that we don't emulate. + +However, since qemu isn't aware of it, its state is not synchronized +with KVM and therefore not migrated, which can be a problem. + +Signed-off-by: David Gibson +Reviewed-by: Cédric Le Goater +Reviewed-by: Greg Kurz +Reviewed-by: Thomas Huth +(cherry picked from commit 650f3287abb7c6124b7fb0f4a2330246fe2d4da2) + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + target/ppc/cpu.h | 1 + + target/ppc/translate_init.c | 5 +++++ + 2 files changed, 6 insertions(+) + +diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h +index 43bd257..a2d7b6f 100644 +--- a/target/ppc/cpu.h ++++ b/target/ppc/cpu.h +@@ -1444,6 +1444,7 @@ int ppc_compat_max_threads(PowerPCCPU *cpu); + #define SPR_TEXASR (0x082) + #define SPR_TEXASRU (0x083) + #define SPR_UCTRL (0x088) ++#define SPR_TIDR (0x090) + #define SPR_MPC_CMPA (0x090) + #define SPR_MPC_CMPB (0x091) + #define SPR_MPC_CMPC (0x092) +diff --git a/target/ppc/translate_init.c b/target/ppc/translate_init.c +index c1a9014..624bc1c 100644 +--- a/target/ppc/translate_init.c ++++ b/target/ppc/translate_init.c +@@ -8837,6 +8837,11 @@ static void init_proc_POWER9(CPUPPCState *env) + gen_spr_power8_book4(env); + gen_spr_power8_rpr(env); + ++ /* POWER9 Specific registers */ ++ spr_register_kvm(env, SPR_TIDR, "TIDR", NULL, NULL, ++ spr_read_generic, spr_write_generic, ++ KVM_REG_PPC_TIDR, 0); ++ + /* env variables */ + #if !defined(CONFIG_USER_ONLY) + env->slb_nr = 32; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Refactor-tcg-radix-mmu-code.patch b/SOURCES/kvm-target-ppc-Refactor-tcg-radix-mmu-code.patch new file mode 100644 index 0000000..1e25c67 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Refactor-tcg-radix-mmu-code.patch @@ -0,0 +1,99 @@ +From e5b6053e3055a79d9275e1cc4b48f12beaa851dc Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Thu, 13 Jul 2017 16:36:29 +0200 +Subject: [PATCH 5/6] target/ppc: Refactor tcg radix mmu code + +RH-Author: Laurent Vivier +Message-id: <20170713163630.24848-4-lvivier@redhat.com> +Patchwork-id: 75765 +O-Subject: [RHEL-ALT-7.4 qemu-kvm PATCH 3/4] target/ppc: Refactor tcg radix mmu code +Bugzilla: 1470558 +RH-Acked-by: David Gibson +RH-Acked-by: Thomas Huth +RH-Acked-by: Suraj Jitindar Singh + +From: Suraj Jitindar Singh + +The mmu-radix64.c file implements functions to enable the radix mmu +emulation in tcg mode. There is a function ppc_radix64_walk_tree() which +performs the radix tree walk and also implicitly checks the pte +protection. + +Move the protection checking of the pte from the ppc_radix64_walk_tree() +function into the caller. This means the ppc_radix64_walk_tree() function +can be used without protection checking which is useful for debugging. + +ppc_radix64_walk_tree() no longer needs to take the rwx and prot variables. + +Signed-off-by: Suraj Jitindar Singh +Signed-off-by: David Gibson +(cherry picked from commit 6a042827b638dc73da6a72c72596f5be80bd4581) +Signed-off-by: Laurent Vivier + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1470558 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13654102 +Signed-off-by: Miroslav Rezanina +--- + target/ppc/mmu-radix64.c | 22 ++++++++-------------- + 1 file changed, 8 insertions(+), 14 deletions(-) + +diff --git a/target/ppc/mmu-radix64.c b/target/ppc/mmu-radix64.c +index 69fde65..1a650fd 100644 +--- a/target/ppc/mmu-radix64.c ++++ b/target/ppc/mmu-radix64.c +@@ -147,11 +147,10 @@ static void ppc_radix64_set_rc(PowerPCCPU *cpu, int rwx, uint64_t pte, + } + } + +-static uint64_t ppc_radix64_walk_tree(PowerPCCPU *cpu, int rwx, vaddr eaddr, ++static uint64_t ppc_radix64_walk_tree(PowerPCCPU *cpu, vaddr eaddr, + uint64_t base_addr, uint64_t nls, + hwaddr *raddr, int *psize, +- int *fault_cause, int *prot, +- hwaddr *pte_addr) ++ int *fault_cause, hwaddr *pte_addr) + { + CPUState *cs = CPU(cpu); + uint64_t index, pde; +@@ -177,10 +176,6 @@ static uint64_t ppc_radix64_walk_tree(PowerPCCPU *cpu, int rwx, vaddr eaddr, + uint64_t rpn = pde & R_PTE_RPN; + uint64_t mask = (1UL << *psize) - 1; + +- if (ppc_radix64_check_prot(cpu, rwx, pde, fault_cause, prot)) { +- return 0; /* Protection Denied Access */ +- } +- + /* Or high bits of rpn and low bits to ea to form whole real addr */ + *raddr = (rpn & ~mask) | (eaddr & mask); + *pte_addr = base_addr + (index * sizeof(pde)); +@@ -188,9 +183,8 @@ static uint64_t ppc_radix64_walk_tree(PowerPCCPU *cpu, int rwx, vaddr eaddr, + } + + /* Next Level of Radix Tree */ +- return ppc_radix64_walk_tree(cpu, rwx, eaddr, pde & R_PDE_NLB, +- pde & R_PDE_NLS, raddr, psize, +- fault_cause, prot, pte_addr); ++ return ppc_radix64_walk_tree(cpu, eaddr, pde & R_PDE_NLB, pde & R_PDE_NLS, ++ raddr, psize, fault_cause, pte_addr); + } + + int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, +@@ -241,11 +235,11 @@ int ppc_radix64_handle_mmu_fault(PowerPCCPU *cpu, vaddr eaddr, int rwx, + + /* Walk Radix Tree from Process Table Entry to Convert EA to RA */ + page_size = PRTBE_R_GET_RTS(prtbe0); +- pte = ppc_radix64_walk_tree(cpu, rwx, eaddr & R_EADDR_MASK, ++ pte = ppc_radix64_walk_tree(cpu, eaddr & R_EADDR_MASK, + prtbe0 & PRTBE_R_RPDB, prtbe0 & PRTBE_R_RPDS, +- &raddr, &page_size, &fault_cause, &prot, +- &pte_addr); +- if (!pte) { ++ &raddr, &page_size, &fault_cause, &pte_addr); ++ if (!pte || ppc_radix64_check_prot(cpu, rwx, pte, &fault_cause, &prot)) { ++ /* Couldn't get pte or access denied due to protection */ + ppc_radix64_raise_si(cpu, rwx, eaddr, fault_cause); + return 1; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-Show-POWER9-in-cpu-help.patch b/SOURCES/kvm-target-ppc-Show-POWER9-in-cpu-help.patch new file mode 100644 index 0000000..f826cf7 --- /dev/null +++ b/SOURCES/kvm-target-ppc-Show-POWER9-in-cpu-help.patch @@ -0,0 +1,70 @@ +From bf5f6365e183197fc56c7b15f738e798897a47c9 Mon Sep 17 00:00:00 2001 +From: Sam Bobroff +Date: Mon, 29 May 2017 05:29:50 +0200 +Subject: [PATCH 6/6] target/ppc: Show POWER9 in -cpu help + +RH-Author: Sam Bobroff +Message-id: <2135250737.13601356.1496035790922.JavaMail.zimbra@redhat.com> +Patchwork-id: 75426 +O-Subject: [RHEL-7.4 qemu-kvm PATCH] target/ppc: Show POWER9 in -cpu help +Bugzilla: 1449969 +RH-Acked-by: David Gibson +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth + +Allow the entry for POWER9 to be shown in the list of CPUs displayed by +'-cpu help' on the command line. The entry was removed due to a +downstream patch so there is no upstream associated with this change. + +Signed-off-by: Sam Bobroff +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_cpu_core.c | 2 -- + target/ppc/cpu-models.c | 4 +++- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/hw/ppc/spapr_cpu_core.c b/hw/ppc/spapr_cpu_core.c +index 0bc7c6d..fd29e9c 100644 +--- a/hw/ppc/spapr_cpu_core.c ++++ b/hw/ppc/spapr_cpu_core.c +@@ -248,10 +248,8 @@ static const char *spapr_core_models[] = { + + /* POWER8NVL */ + "POWER8NVL_v1.0", +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + /* POWER9 */ + "POWER9_v1.0", +-#endif + }; + + void spapr_cpu_core_class_init(ObjectClass *oc, void *data) +diff --git a/target/ppc/cpu-models.c b/target/ppc/cpu-models.c +index 7861276..08a1f59 100644 +--- a/target/ppc/cpu-models.c ++++ b/target/ppc/cpu-models.c +@@ -1148,10 +1148,12 @@ + #if 0 /* Disabled for Red Hat Enterprise Linux */ + POWERPC_DEF("970_v2.2", CPU_POWERPC_970_v22, 970, + "PowerPC 970 v2.2") ++#endif + + POWERPC_DEF("POWER9_v1.0", CPU_POWERPC_POWER9_BASE, POWER9, + "POWER9 v1.0") + ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + POWERPC_DEF("970fx_v1.0", CPU_POWERPC_970FX_v10, 970, + "PowerPC 970FX v1.0 (G5)") + POWERPC_DEF("970fx_v2.0", CPU_POWERPC_970FX_v20, 970, +@@ -1401,8 +1403,8 @@ PowerPCCPUAlias ppc_cpu_aliases[] = { + { "POWER8E", "POWER8E_v2.1" }, + { "POWER8", "POWER8_v2.0" }, + { "POWER8NVL", "POWER8NVL_v1.0" }, +-#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "POWER9", "POWER9_v1.0" }, ++#if 0 /* Disabled for Red Hat Enterprise Linux */ + { "970", "970_v2.2" }, + { "970fx", "970fx_v3.1" }, + { "970mp", "970mp_v1.1" }, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-kvm-make-use-of-KVM_CREATE_SPAPR_TCE_64.patch b/SOURCES/kvm-target-ppc-kvm-make-use-of-KVM_CREATE_SPAPR_TCE_64.patch new file mode 100644 index 0000000..9c27089 --- /dev/null +++ b/SOURCES/kvm-target-ppc-kvm-make-use-of-KVM_CREATE_SPAPR_TCE_64.patch @@ -0,0 +1,190 @@ +From 2882a6b553093b8018f0a14175cf8d7a5fcdb633 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 01:16:30 +0200 +Subject: [PATCH 16/23] target-ppc: kvm: make use of KVM_CREATE_SPAPR_TCE_64 + +RH-Author: David Gibson +Message-id: <20170427011630.389-1-dgibson@redhat.com> +Patchwork-id: 74912 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] target-ppc: kvm: make use of KVM_CREATE_SPAPR_TCE_64 +Bugzilla: 1440619 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Eduardo Habkost + +From: Alexey Kardashevskiy + +KVM_CAP_SPAPR_TCE capability allows creating TCE tables in KVM which +allows having in-kernel acceleration for H_PUT_TCE_xxx hypercalls. +However it only supports 32bit DMA windows at zero bus offset. + +There is a new KVM_CAP_SPAPR_TCE_64 capability which supports 64bit +window size, variable page size and bus offset. + +This makes use of the new capability. The kernel headers are already +updated as the kernel support went in to v4.6. + +Signed-off-by: Alexey Kardashevskiy +Signed-off-by: David Gibson +(cherry picked from commit d6ee2a7c85088d587fb0e0376fba1fa20d59c9f3) + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1440619 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13095246 + +Signed-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + hw/ppc/spapr_iommu.c | 8 +++++--- + target/ppc/kvm.c | 48 +++++++++++++++++++++++++++++++++++++----------- + target/ppc/kvm_ppc.h | 12 +++++++----- + 3 files changed, 49 insertions(+), 19 deletions(-) + +diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c +index ae30bbe..29c80bb 100644 +--- a/hw/ppc/spapr_iommu.c ++++ b/hw/ppc/spapr_iommu.c +@@ -79,15 +79,16 @@ static IOMMUAccessFlags spapr_tce_iommu_access_flags(uint64_t tce) + + static uint64_t *spapr_tce_alloc_table(uint32_t liobn, + uint32_t page_shift, ++ uint64_t bus_offset, + uint32_t nb_table, + int *fd, + bool need_vfio) + { + uint64_t *table = NULL; +- uint64_t window_size = (uint64_t)nb_table << page_shift; + +- if (kvm_enabled() && !(window_size >> 32)) { +- table = kvmppc_create_spapr_tce(liobn, window_size, fd, need_vfio); ++ if (kvm_enabled()) { ++ table = kvmppc_create_spapr_tce(liobn, page_shift, bus_offset, nb_table, ++ fd, need_vfio); + } + + if (!table) { +@@ -342,6 +343,7 @@ void spapr_tce_table_enable(sPAPRTCETable *tcet, + tcet->nb_table = nb_table; + tcet->table = spapr_tce_alloc_table(tcet->liobn, + tcet->page_shift, ++ tcet->bus_offset, + tcet->nb_table, + &tcet->fd, + tcet->need_vfio); +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 9f1f132..031d31f 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -73,6 +73,7 @@ static int cap_booke_sregs; + static int cap_ppc_smt; + static int cap_ppc_rma; + static int cap_spapr_tce; ++static int cap_spapr_tce_64; + static int cap_spapr_multitce; + static int cap_spapr_vfio; + static int cap_hior; +@@ -125,6 +126,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) + cap_ppc_smt = kvm_check_extension(s, KVM_CAP_PPC_SMT); + cap_ppc_rma = kvm_check_extension(s, KVM_CAP_PPC_RMA); + cap_spapr_tce = kvm_check_extension(s, KVM_CAP_SPAPR_TCE); ++ cap_spapr_tce_64 = kvm_check_extension(s, KVM_CAP_SPAPR_TCE_64); + cap_spapr_multitce = kvm_check_extension(s, KVM_CAP_SPAPR_MULTITCE); + cap_spapr_vfio = false; + cap_one_reg = kvm_check_extension(s, KVM_CAP_ONE_REG); +@@ -2132,13 +2134,10 @@ bool kvmppc_spapr_use_multitce(void) + return cap_spapr_multitce; + } + +-void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd, +- bool need_vfio) ++void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, ++ uint64_t bus_offset, uint32_t nb_table, ++ int *pfd, bool need_vfio) + { +- struct kvm_create_spapr_tce args = { +- .liobn = liobn, +- .window_size = window_size, +- }; + long len; + int fd; + void *table; +@@ -2151,14 +2150,41 @@ void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd, + return NULL; + } + +- fd = kvm_vm_ioctl(kvm_state, KVM_CREATE_SPAPR_TCE, &args); +- if (fd < 0) { +- fprintf(stderr, "KVM: Failed to create TCE table for liobn 0x%x\n", +- liobn); ++ if (cap_spapr_tce_64) { ++ struct kvm_create_spapr_tce_64 args = { ++ .liobn = liobn, ++ .page_shift = page_shift, ++ .offset = bus_offset >> page_shift, ++ .size = nb_table, ++ .flags = 0 ++ }; ++ fd = kvm_vm_ioctl(kvm_state, KVM_CREATE_SPAPR_TCE_64, &args); ++ if (fd < 0) { ++ fprintf(stderr, ++ "KVM: Failed to create TCE64 table for liobn 0x%x\n", ++ liobn); ++ return NULL; ++ } ++ } else if (cap_spapr_tce) { ++ uint64_t window_size = (uint64_t) nb_table << page_shift; ++ struct kvm_create_spapr_tce args = { ++ .liobn = liobn, ++ .window_size = window_size, ++ }; ++ if ((window_size != args.window_size) || bus_offset) { ++ return NULL; ++ } ++ fd = kvm_vm_ioctl(kvm_state, KVM_CREATE_SPAPR_TCE, &args); ++ if (fd < 0) { ++ fprintf(stderr, "KVM: Failed to create TCE table for liobn 0x%x\n", ++ liobn); ++ return NULL; ++ } ++ } else { + return NULL; + } + +- len = (window_size / SPAPR_TCE_PAGE_SIZE) * sizeof(uint64_t); ++ len = nb_table * sizeof(uint64_t); + /* FIXME: round this up to page size */ + + table = mmap(NULL, len, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0); +diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h +index 8e9f42d..08ecf75 100644 +--- a/target/ppc/kvm_ppc.h ++++ b/target/ppc/kvm_ppc.h +@@ -36,8 +36,9 @@ int kvmppc_booke_watchdog_enable(PowerPCCPU *cpu); + #ifndef CONFIG_USER_ONLY + off_t kvmppc_alloc_rma(void **rma); + bool kvmppc_spapr_use_multitce(void); +-void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t window_size, int *pfd, +- bool need_vfio); ++void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, ++ uint64_t bus_offset, uint32_t nb_table, ++ int *pfd, bool need_vfio); + int kvmppc_remove_spapr_tce(void *table, int pfd, uint32_t window_size); + int kvmppc_reset_htab(int shift_hint); + uint64_t kvmppc_rma_size(uint64_t current_size, unsigned int hash_shift); +@@ -167,9 +168,10 @@ static inline bool kvmppc_spapr_use_multitce(void) + return false; + } + +-static inline void *kvmppc_create_spapr_tce(uint32_t liobn, +- uint32_t window_size, int *fd, +- bool need_vfio) ++static inline void *kvmppc_create_spapr_tce(uint32_t liobn, uint32_t page_shift, ++ uint64_t bus_offset, ++ uint32_t nb_table, ++ int *pfd, bool need_vfio) + { + return NULL; + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-target-ppc-support-KVM_CAP_PPC_MMU_RADIX-KVM_CAP_PPC.patch b/SOURCES/kvm-target-ppc-support-KVM_CAP_PPC_MMU_RADIX-KVM_CAP_PPC.patch new file mode 100644 index 0000000..d26394e --- /dev/null +++ b/SOURCES/kvm-target-ppc-support-KVM_CAP_PPC_MMU_RADIX-KVM_CAP_PPC.patch @@ -0,0 +1,103 @@ +From e749a6716ee069a5c91bdabb094080419ef0dcda Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Thu, 27 Apr 2017 02:15:53 +0200 +Subject: [PATCH 18/23] target-ppc: support KVM_CAP_PPC_MMU_RADIX, + KVM_CAP_PPC_MMU_HASH_V3 + +RH-Author: David Gibson +Message-id: <20170427021558.4884-3-dgibson@redhat.com> +Patchwork-id: 74916 +O-Subject: [Pegas-1.0 qemu-kvm-rhev PATCH 2/7] target-ppc: support KVM_CAP_PPC_MMU_RADIX, KVM_CAP_PPC_MMU_HASH_V3 +Bugzilla: 1368786 +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier +RH-Acked-by: Miroslav Rezanina + +From: Sam Bobroff + +Query and cache the value of two new KVM capabilities that indicate +KVM's support for new radix and hash modes of the MMU. + +Signed-off-by: Sam Bobroff +Signed-off-by: David Gibson +(cherry picked from commit cf1c4cce7c0d53d2a778a4b124d02ea3a84f1663) + +Siged-off-by: David Gibson +Signed-off-by: Miroslav Rezanina +--- + target/ppc/kvm.c | 14 ++++++++++++++ + target/ppc/kvm_ppc.h | 12 ++++++++++++ + 2 files changed, 26 insertions(+) + +diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c +index 9c355ce..b733578 100644 +--- a/target/ppc/kvm.c ++++ b/target/ppc/kvm.c +@@ -85,6 +85,8 @@ static int cap_papr; + static int cap_htab_fd; + static int cap_fixup_hcalls; + static int cap_htm; /* Hardware transactional memory support */ ++static int cap_mmu_radix; ++static int cap_mmu_hash_v3; + + static uint32_t debug_inst_opcode; + +@@ -139,6 +141,8 @@ int kvm_arch_init(MachineState *ms, KVMState *s) + cap_htab_fd = kvm_check_extension(s, KVM_CAP_PPC_HTAB_FD); + cap_fixup_hcalls = kvm_check_extension(s, KVM_CAP_PPC_FIXUP_HCALL); + cap_htm = kvm_vm_check_extension(s, KVM_CAP_PPC_HTM); ++ cap_mmu_radix = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_RADIX); ++ cap_mmu_hash_v3 = kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_HASH_V3); + + if (!cap_interrupt_level) { + fprintf(stderr, "KVM: Couldn't find level irq capability. Expect the " +@@ -2359,6 +2363,16 @@ bool kvmppc_has_cap_htm(void) + return cap_htm; + } + ++bool kvmppc_has_cap_mmu_radix(void) ++{ ++ return cap_mmu_radix; ++} ++ ++bool kvmppc_has_cap_mmu_hash_v3(void) ++{ ++ return cap_mmu_hash_v3; ++} ++ + static PowerPCCPUClass *ppc_cpu_get_family_class(PowerPCCPUClass *pcc) + { + ObjectClass *oc = OBJECT_CLASS(pcc); +diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h +index 08ecf75..64189a4 100644 +--- a/target/ppc/kvm_ppc.h ++++ b/target/ppc/kvm_ppc.h +@@ -54,6 +54,8 @@ void kvmppc_read_hptes(ppc_hash_pte64_t *hptes, hwaddr ptex, int n); + void kvmppc_write_hpte(hwaddr ptex, uint64_t pte0, uint64_t pte1); + bool kvmppc_has_cap_fixup_hcalls(void); + bool kvmppc_has_cap_htm(void); ++bool kvmppc_has_cap_mmu_radix(void); ++bool kvmppc_has_cap_mmu_hash_v3(void); + int kvmppc_enable_hwrng(void); + int kvmppc_put_books_sregs(PowerPCCPU *cpu); + PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void); +@@ -254,6 +256,16 @@ static inline bool kvmppc_has_cap_htm(void) + return false; + } + ++static inline bool kvmppc_has_cap_mmu_radix(void) ++{ ++ return false; ++} ++ ++static inline bool kvmppc_has_cap_mmu_hash_v3(void) ++{ ++ return false; ++} ++ + static inline int kvmppc_enable_hwrng(void) + { + return -1; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-tests-acpi-extend-cphp-and-memhp-testcase-with-numa-.patch b/SOURCES/kvm-tests-acpi-extend-cphp-and-memhp-testcase-with-numa-.patch new file mode 100644 index 0000000..8d3f48b --- /dev/null +++ b/SOURCES/kvm-tests-acpi-extend-cphp-and-memhp-testcase-with-numa-.patch @@ -0,0 +1,84 @@ +From b7a86e71325abec33b8e3b46aa20bc5924fb269c Mon Sep 17 00:00:00 2001 +From: Igor Mammedov +Date: Mon, 29 May 2017 07:52:55 +0200 +Subject: [PATCH 12/13] tests: acpi: extend cphp and memhp testcase with numa + distance check + +RH-Author: Igor Mammedov +Message-id: <1496044376-228722-3-git-send-email-imammedo@redhat.com> +Patchwork-id: 75429 +O-Subject: [RHEL7.4 qemu-kvm-rhev 2/3] tests: acpi: extend cphp and memhp testcase with numa distance check +Bugzilla: 1395339 +RH-Acked-by: Andrew Jones +RH-Acked-by: Eduardo Habkost +RH-Acked-by: Marcel Apfelbaum + +From: He Chen + +Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1395339 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13293161 + +Signed-off-by: He Chen +Message-Id: <1493803036-4048-1-git-send-email-he.chen@linux.intel.com> +Reviewed-by: Igor Mammedov +[ehabkost: regenerated tests/acpi-tst-data, included SLIT table] +Signed-off-by: Eduardo Habkost + +(cherry picked from commit fda4096fca83dcdc72e0fc0e4a1ae6e7724fb5e0) +Signed-off-by: Igor Mammedov +Signed-off-by: Miroslav Rezanina +--- + tests/bios-tables-test.c | 16 ++++++++++++---- + 1 file changed, 12 insertions(+), 4 deletions(-) + +diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c +index d361b6f..d3d6d00 100644 +--- a/tests/bios-tables-test.c ++++ b/tests/bios-tables-test.c +@@ -710,7 +710,8 @@ static void test_acpi_piix4_tcg_cphp(void) + data.machine = MACHINE_PC; + data.variant = ".cphp"; + test_acpi_one("-smp 2,cores=3,sockets=2,maxcpus=6" +- " -numa node -numa node", ++ " -numa node -numa node" ++ " -numa dist,src=0,dst=1,val=21", + &data); + free_test_data(&data); + } +@@ -723,7 +724,8 @@ static void test_acpi_q35_tcg_cphp(void) + data.machine = MACHINE_Q35; + data.variant = ".cphp"; + test_acpi_one(" -smp 2,cores=3,sockets=2,maxcpus=6" +- " -numa node -numa node", ++ " -numa node -numa node" ++ " -numa dist,src=0,dst=1,val=21", + &data); + free_test_data(&data); + } +@@ -774,7 +776,10 @@ static void test_acpi_q35_tcg_memhp(void) + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_Q35; + data.variant = ".memhp"; +- test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data); ++ test_acpi_one(" -m 128,slots=3,maxmem=1G" ++ " -numa node -numa node" ++ " -numa dist,src=0,dst=1,val=21", ++ &data); + free_test_data(&data); + } + +@@ -785,7 +790,10 @@ static void test_acpi_piix4_tcg_memhp(void) + memset(&data, 0, sizeof(data)); + data.machine = MACHINE_PC; + data.variant = ".memhp"; +- test_acpi_one(" -m 128,slots=3,maxmem=1G -numa node", &data); ++ test_acpi_one(" -m 128,slots=3,maxmem=1G" ++ " -numa node -numa node" ++ " -numa dist,src=0,dst=1,val=21", ++ &data); + free_test_data(&data); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-usb-don-t-wakeup-during-coldplug.patch b/SOURCES/kvm-usb-don-t-wakeup-during-coldplug.patch new file mode 100644 index 0000000..3514452 --- /dev/null +++ b/SOURCES/kvm-usb-don-t-wakeup-during-coldplug.patch @@ -0,0 +1,45 @@ +From aca95f3fddc84f304d9da49e79bf4715243f0fa3 Mon Sep 17 00:00:00 2001 +From: Gerd Hoffmann +Date: Tue, 6 Jun 2017 15:23:03 +0200 +Subject: [PATCH 15/17] usb: don't wakeup during coldplug + +RH-Author: Gerd Hoffmann +Message-id: <20170606152303.28066-2-kraxel@redhat.com> +Patchwork-id: 75503 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/1] usb: don't wakeup during coldplug +Bugzilla: 1452512 +RH-Acked-by: Marcel Apfelbaum +RH-Acked-by: Stefan Hajnoczi +RH-Acked-by: Dr. David Alan Gilbert + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1452512 +Signed-off-by: Gerd Hoffmann +Message-id: 20170523084635.20062-1-kraxel@redhat.com +(cherry picked from commit 26022652c6fd067b9fa09280f5a6d6284a21c73f) +Signed-off-by: Miroslav Rezanina +--- + hw/usb/core.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/hw/usb/core.c b/hw/usb/core.c +index 45fa00c..241ae66 100644 +--- a/hw/usb/core.c ++++ b/hw/usb/core.c +@@ -98,6 +98,14 @@ void usb_wakeup(USBEndpoint *ep, unsigned int stream) + USBDevice *dev = ep->dev; + USBBus *bus = usb_bus_from_device(dev); + ++ if (!qdev_hotplug) { ++ /* ++ * This is machine init cold plug. No need to wakeup anyone, ++ * all devices will be reset anyway. And trying to wakeup can ++ * cause problems due to hitting uninitialized devices. ++ */ ++ return; ++ } + if (dev->remote_wakeup && dev->port && dev->port->ops->wakeup) { + dev->port->ops->wakeup(dev->port); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-usb-hub-clear-PORT_STAT_SUSPEND-on-wakeup.patch b/SOURCES/kvm-usb-hub-clear-PORT_STAT_SUSPEND-on-wakeup.patch new file mode 100644 index 0000000..d21f0e8 --- /dev/null +++ b/SOURCES/kvm-usb-hub-clear-PORT_STAT_SUSPEND-on-wakeup.patch @@ -0,0 +1,59 @@ +From 94b8b48edfdcfdd24553028efaae2f817a70cc96 Mon Sep 17 00:00:00 2001 +From: Ladi Prosek +Date: Wed, 17 May 2017 12:36:15 +0200 +Subject: [PATCH 16/27] usb-hub: clear PORT_STAT_SUSPEND on wakeup + +RH-Author: Ladi Prosek +Message-id: <20170517123615.9871-2-lprosek@redhat.com> +Patchwork-id: 75259 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] usb-hub: clear PORT_STAT_SUSPEND on wakeup +Bugzilla: 1447581 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Laurent Vivier +RH-Acked-by: Thomas Huth + +The spec says: + + Suspend: (PORT_SUSPEND) This field indicates whether or not the device + on this port is suspended. Setting this field causes the device to + suspend by not propagating bus traffic downstream. This field may be + reset by a request or by resume signaling from the device attached to + the port. + +I can't find any specific statement like "the PORT_SUSPEND field is reset +automatically on remote wakeup", but without this patch, the only way to +reset it is via the ClearPortFeature request so the ".. or by resume +signaling from the device" clause is clearly not implemented on the remote +wakeup path. + +The default xhci Windows driver does not issue the ClearPortFeature request +and suspended devices attached to a hub don't properly get out of the +suspended state. Interestingly, the default uhci Windows driver *does* +issue the ClearPortFeature request and does not exhibit this problem. + +Signed-off-by: Ladi Prosek +Message-id: 20170511125314.24549-3-lprosek@redhat.com +Signed-off-by: Gerd Hoffmann +(cherry-picked from commit 66849dcfbed4be2ba012fd55631558c623c43f89) +Signed-off-by: Ladi Prosek + +Signed-off-by: Miroslav Rezanina +--- + hw/usb/dev-hub.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c +index 9fe7333..47b7519 100644 +--- a/hw/usb/dev-hub.c ++++ b/hw/usb/dev-hub.c +@@ -208,6 +208,7 @@ static void usb_hub_wakeup(USBPort *port1) + USBHubPort *port = &s->ports[port1->index]; + + if (port->wPortStatus & PORT_STAT_SUSPEND) { ++ port->wPortStatus &= ~PORT_STAT_SUSPEND; + port->wPortChange |= PORT_STAT_C_SUSPEND; + usb_wakeup(s->intr, 0); + } +-- +1.8.3.1 + diff --git a/SOURCES/kvm-usb-xhci-Fix-PCI-capability-order.patch b/SOURCES/kvm-usb-xhci-Fix-PCI-capability-order.patch new file mode 100644 index 0000000..73b7b33 --- /dev/null +++ b/SOURCES/kvm-usb-xhci-Fix-PCI-capability-order.patch @@ -0,0 +1,86 @@ +From aad727a5ecde1ad4935eb8427604d4df5a1f1f35 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Fri, 5 May 2017 19:06:14 +0200 +Subject: [PATCH 2/7] usb-xhci: Fix PCI capability order + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170505190614.15987-2-dgilbert@redhat.com> +Patchwork-id: 75038 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH 1/1] usb-xhci: Fix PCI capability order +Bugzilla: 1447874 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Juan Quintela + +From: "Dr. David Alan Gilbert" + +bz: https://bugzilla.redhat.com/show_bug.cgi?id=1447874 +brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13141090 +upstream: No, see below + +Upstream commit 1108b2f8a9 in 2.7.0 changed the order +of the PCI capability chain in the XHCI pci device in the case +where the device has the PCIe endpoint capability (i.e. only +older machine types, pc-i440fx-2.0 upstream, pc-i440fx-rhel7.0.0 +apparently for us). + +Changing the order breaks migration compatibility; fixing this +upstream would mean breaking the same case going from 2.7.0->current +that currently works 2.7.0->2.9.0 - so upstream it's a choice +of two breakages. + +Since we never released 2.7.0/2.8.0 we can fix this downstream. + +This reverts the order so that we create the capabilities in the +order: + PCIe + MSI + MSI-X + +The symptom is: +qemu-kvm: get_pci_config_device: Bad config data: i=0x71 read: a0 device: 0 cmask: ff wmask: 0 w1cmask:0 +qemu-kvm: Failed to load PCIDevice:config +qemu-kvm: Failed to load xhci:parent_obj +qemu-kvm: error while loading state for instance 0x0 of device '0000:00:0d.0/xhci' +qemu-kvm: load of migration failed: Invalid argument + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-xhci.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index c38594c..1555aa4 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -3575,6 +3575,12 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp) + xhci->max_pstreams_mask = 0; + } + ++ if (pci_bus_is_express(dev->bus) || ++ xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) { ++ ret = pcie_endpoint_cap_init(dev, 0xa0); ++ assert(ret >= 0); ++ } ++ + if (xhci->msi != ON_OFF_AUTO_OFF) { + ret = msi_init(dev, 0x70, xhci->numintrs, true, false, &err); + /* Any error other than -ENOTSUP(board's MSI support is broken) +@@ -3623,12 +3629,6 @@ static void usb_xhci_realize(struct PCIDevice *dev, Error **errp) + PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64, + &xhci->mem); + +- if (pci_bus_is_express(dev->bus) || +- xhci_get_flag(xhci, XHCI_FLAG_FORCE_PCIE_ENDCAP)) { +- ret = pcie_endpoint_cap_init(dev, 0xa0); +- assert(ret >= 0); +- } +- + if (xhci->msix != ON_OFF_AUTO_OFF) { + /* TODO check for errors, and should fail when msix=on */ + msix_init(dev, xhci->numintrs, +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vfio-spapr-Fix-levels-calculation.patch b/SOURCES/kvm-vfio-spapr-Fix-levels-calculation.patch new file mode 100644 index 0000000..17eb0d8 --- /dev/null +++ b/SOURCES/kvm-vfio-spapr-Fix-levels-calculation.patch @@ -0,0 +1,50 @@ +From b83a6ae1492fa004c6e0e34cfb3ac8efe21e7bd2 Mon Sep 17 00:00:00 2001 +From: David Gibson +Date: Mon, 18 Sep 2017 00:20:08 +0100 +Subject: [PATCH] vfio, spapr: Fix levels calculation + +RH-Author: David Gibson +Message-id: <20170918002008.24430-1-dgibson@redhat.com> +Patchwork-id: 76404 +O-Subject: [Pegas-1.0 qemu-kvm PATCH] vfio, spapr: Fix levels calculation +Bugzilla: 1491749 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Suraj Jitindar Singh +RH-Acked-by: Sam Bobroff + +From: Alexey Kardashevskiy + +The existing tries to round up the number of pages but @pages is always +calculated as the rounded up value minus one which makes ctz64() always +return 0 and have create.levels always set 1. + +This removes wrong "-1" and allows having more than 1 levels. This becomes +handy for >128GB guests with standard 64K pages as this requires blocks +with zone order 9 and the popular limit of CONFIG_FORCE_MAX_ZONEORDER=9 +means that only blocks up to order 8 are allowed. + +Signed-off-by: Alexey Kardashevskiy +Signed-off-by: David Gibson +(cherry picked from commit e100161b69f8cf56dae866912dfffe7dcd7140af) +Signed-off-by: David Gibson +Signed-off-by: Danilo C. L. de Paula +--- + hw/vfio/spapr.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/vfio/spapr.c b/hw/vfio/spapr.c +index 4409bcc..4b85ba3 100644 +--- a/hw/vfio/spapr.c ++++ b/hw/vfio/spapr.c +@@ -162,7 +162,7 @@ int vfio_spapr_create_window(VFIOContainer *container, + */ + entries = create.window_size >> create.page_shift; + pages = MAX((entries * sizeof(uint64_t)) / getpagesize(), 1); +- pages = MAX(pow2ceil(pages) - 1, 1); /* Round up */ ++ pages = MAX(pow2ceil(pages), 1); /* Round up */ + create.levels = ctz64(pages) / 6 + 1; + + ret = ioctl(container->fd, VFIO_IOMMU_SPAPR_TCE_CREATE, &create); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vhost-propagate-errors-in-vhost_device_iotlb_miss.patch b/SOURCES/kvm-vhost-propagate-errors-in-vhost_device_iotlb_miss.patch new file mode 100644 index 0000000..a222025 --- /dev/null +++ b/SOURCES/kvm-vhost-propagate-errors-in-vhost_device_iotlb_miss.patch @@ -0,0 +1,89 @@ +From 8c404f6379951c3a9d3023d4c82ceae168cb0305 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Tue, 6 Jun 2017 12:05:20 +0200 +Subject: [PATCH 09/17] vhost: propagate errors in vhost_device_iotlb_miss() + +RH-Author: Maxime Coquelin +Message-id: <20170606120524.3050-2-maxime.coquelin@redhat.com> +Patchwork-id: 75496 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/5] vhost: propagate errors in vhost_device_iotlb_miss() +Bugzilla: 1451862 +RH-Acked-by: Peter Xu +RH-Acked-by: Xiao Wang +RH-Acked-by: Jens Freimann + +Some backends might want to know when things went wrong. + +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit fc58bd0d97c41dc3257001c86b2f802ae7255dff) +Signed-off-by: Maxime Coquelin +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost.c | 15 ++++++++++----- + include/hw/virtio/vhost.h | 2 +- + 2 files changed, 11 insertions(+), 6 deletions(-) + +diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c +index 0001e60..369373a 100644 +--- a/hw/virtio/vhost.c ++++ b/hw/virtio/vhost.c +@@ -971,18 +971,20 @@ static int vhost_memory_region_lookup(struct vhost_dev *hdev, + return -EFAULT; + } + +-void vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) ++int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) + { + IOMMUTLBEntry iotlb; + uint64_t uaddr, len; ++ int ret = -EFAULT; + + rcu_read_lock(); + + iotlb = address_space_get_iotlb_entry(dev->vdev->dma_as, + iova, write); + if (iotlb.target_as != NULL) { +- if (vhost_memory_region_lookup(dev, iotlb.translated_addr, +- &uaddr, &len)) { ++ ret = vhost_memory_region_lookup(dev, iotlb.translated_addr, ++ &uaddr, &len); ++ if (ret) { + error_report("Fail to lookup the translated address " + "%"PRIx64, iotlb.translated_addr); + goto out; +@@ -991,14 +993,17 @@ void vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) + len = MIN(iotlb.addr_mask + 1, len); + iova = iova & ~iotlb.addr_mask; + +- if (dev->vhost_ops->vhost_update_device_iotlb(dev, iova, uaddr, +- len, iotlb.perm)) { ++ ret = dev->vhost_ops->vhost_update_device_iotlb(dev, iova, uaddr, ++ len, iotlb.perm); ++ if (ret) { + error_report("Fail to update device iotlb"); + goto out; + } + } + out: + rcu_read_unlock(); ++ ++ return ret; + } + + static int vhost_virtqueue_start(struct vhost_dev *dev, +diff --git a/include/hw/virtio/vhost.h b/include/hw/virtio/vhost.h +index a450321..467dc77 100644 +--- a/include/hw/virtio/vhost.h ++++ b/include/hw/virtio/vhost.h +@@ -105,5 +105,5 @@ bool vhost_has_free_slot(void); + int vhost_net_set_backend(struct vhost_dev *hdev, + struct vhost_vring_file *file); + +-void vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write); ++int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write); + #endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vhost-rework-IOTLB-messaging.patch b/SOURCES/kvm-vhost-rework-IOTLB-messaging.patch new file mode 100644 index 0000000..bd26a5c --- /dev/null +++ b/SOURCES/kvm-vhost-rework-IOTLB-messaging.patch @@ -0,0 +1,283 @@ +From 252e1d70fd15578a8ed365ee2c0face8f12bc149 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Tue, 6 Jun 2017 12:05:21 +0200 +Subject: [PATCH 10/17] vhost: rework IOTLB messaging + +RH-Author: Maxime Coquelin +Message-id: <20170606120524.3050-3-maxime.coquelin@redhat.com> +Patchwork-id: 75497 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 2/5] vhost: rework IOTLB messaging +Bugzilla: 1451862 +RH-Acked-by: Peter Xu +RH-Acked-by: Xiao Wang +RH-Acked-by: Jens Freimann + +This patch reworks IOTLB messaging to prepare for vhost-user +device IOTLB support. + +IOTLB messages handling is extracted from vhost-kernel backend, +so that only the messages transport remains backend specifics. + +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 020e571b8bf90e022bbb78346e189f0f26e4675f) +Signed-off-by: Maxime Coquelin +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost-backend.c | 130 +++++++++++++++++++++----------------- + hw/virtio/vhost.c | 8 +-- + include/hw/virtio/vhost-backend.h | 23 ++++--- + 3 files changed, 92 insertions(+), 69 deletions(-) + +diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c +index be927b8..4e31de1 100644 +--- a/hw/virtio/vhost-backend.c ++++ b/hw/virtio/vhost-backend.c +@@ -192,7 +192,6 @@ static void vhost_kernel_iotlb_read(void *opaque) + ssize_t len; + + while ((len = read((uintptr_t)dev->opaque, &msg, sizeof msg)) > 0) { +- struct vhost_iotlb_msg *imsg = &msg.iotlb; + if (len < sizeof msg) { + error_report("Wrong vhost message len: %d", (int)len); + break; +@@ -201,70 +200,21 @@ static void vhost_kernel_iotlb_read(void *opaque) + error_report("Unknown vhost iotlb message type"); + break; + } +- switch (imsg->type) { +- case VHOST_IOTLB_MISS: +- vhost_device_iotlb_miss(dev, imsg->iova, +- imsg->perm != VHOST_ACCESS_RO); +- break; +- case VHOST_IOTLB_UPDATE: +- case VHOST_IOTLB_INVALIDATE: +- error_report("Unexpected IOTLB message type"); +- break; +- case VHOST_IOTLB_ACCESS_FAIL: +- /* FIXME: report device iotlb error */ +- break; +- default: +- break; +- } +- } +-} + +-static int vhost_kernel_update_device_iotlb(struct vhost_dev *dev, +- uint64_t iova, uint64_t uaddr, +- uint64_t len, +- IOMMUAccessFlags perm) +-{ +- struct vhost_msg msg; +- msg.type = VHOST_IOTLB_MSG; +- msg.iotlb.iova = iova; +- msg.iotlb.uaddr = uaddr; +- msg.iotlb.size = len; +- msg.iotlb.type = VHOST_IOTLB_UPDATE; +- +- switch (perm) { +- case IOMMU_RO: +- msg.iotlb.perm = VHOST_ACCESS_RO; +- break; +- case IOMMU_WO: +- msg.iotlb.perm = VHOST_ACCESS_WO; +- break; +- case IOMMU_RW: +- msg.iotlb.perm = VHOST_ACCESS_RW; +- break; +- default: +- g_assert_not_reached(); +- } +- +- if (write((uintptr_t)dev->opaque, &msg, sizeof msg) != sizeof msg) { +- error_report("Fail to update device iotlb"); +- return -EFAULT; ++ vhost_backend_handle_iotlb_msg(dev, &msg.iotlb); + } +- +- return 0; + } + +-static int vhost_kernel_invalidate_device_iotlb(struct vhost_dev *dev, +- uint64_t iova, uint64_t len) ++static int vhost_kernel_send_device_iotlb_msg(struct vhost_dev *dev, ++ struct vhost_iotlb_msg *imsg) + { + struct vhost_msg msg; + + msg.type = VHOST_IOTLB_MSG; +- msg.iotlb.iova = iova; +- msg.iotlb.size = len; +- msg.iotlb.type = VHOST_IOTLB_INVALIDATE; ++ msg.iotlb = *imsg; + + if (write((uintptr_t)dev->opaque, &msg, sizeof msg) != sizeof msg) { +- error_report("Fail to invalidate device iotlb"); ++ error_report("Fail to update device iotlb"); + return -EFAULT; + } + +@@ -311,8 +261,7 @@ static const VhostOps kernel_ops = { + .vhost_vsock_set_running = vhost_kernel_vsock_set_running, + #endif /* CONFIG_VHOST_VSOCK */ + .vhost_set_iotlb_callback = vhost_kernel_set_iotlb_callback, +- .vhost_update_device_iotlb = vhost_kernel_update_device_iotlb, +- .vhost_invalidate_device_iotlb = vhost_kernel_invalidate_device_iotlb, ++ .vhost_send_device_iotlb_msg = vhost_kernel_send_device_iotlb_msg, + }; + + int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend_type) +@@ -333,3 +282,70 @@ int vhost_set_backend_type(struct vhost_dev *dev, VhostBackendType backend_type) + + return r; + } ++ ++int vhost_backend_update_device_iotlb(struct vhost_dev *dev, ++ uint64_t iova, uint64_t uaddr, ++ uint64_t len, ++ IOMMUAccessFlags perm) ++{ ++ struct vhost_iotlb_msg imsg; ++ ++ imsg.iova = iova; ++ imsg.uaddr = uaddr; ++ imsg.size = len; ++ imsg.type = VHOST_IOTLB_UPDATE; ++ ++ switch (perm) { ++ case IOMMU_RO: ++ imsg.perm = VHOST_ACCESS_RO; ++ break; ++ case IOMMU_WO: ++ imsg.perm = VHOST_ACCESS_WO; ++ break; ++ case IOMMU_RW: ++ imsg.perm = VHOST_ACCESS_RW; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg); ++} ++ ++int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev, ++ uint64_t iova, uint64_t len) ++{ ++ struct vhost_iotlb_msg imsg; ++ ++ imsg.iova = iova; ++ imsg.size = len; ++ imsg.type = VHOST_IOTLB_INVALIDATE; ++ ++ return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg); ++} ++ ++int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev, ++ struct vhost_iotlb_msg *imsg) ++{ ++ int ret = 0; ++ ++ switch (imsg->type) { ++ case VHOST_IOTLB_MISS: ++ ret = vhost_device_iotlb_miss(dev, imsg->iova, ++ imsg->perm != VHOST_ACCESS_RO); ++ break; ++ case VHOST_IOTLB_ACCESS_FAIL: ++ /* FIXME: report device iotlb error */ ++ error_report("Access failure IOTLB message type not supported"); ++ ret = -ENOTSUP; ++ break; ++ case VHOST_IOTLB_UPDATE: ++ case VHOST_IOTLB_INVALIDATE: ++ default: ++ error_report("Unexpected IOTLB message type"); ++ ret = -EINVAL; ++ break; ++ } ++ ++ return ret; ++} +diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c +index 369373a..748e331 100644 +--- a/hw/virtio/vhost.c ++++ b/hw/virtio/vhost.c +@@ -724,8 +724,8 @@ static void vhost_iommu_unmap_notify(IOMMUNotifier *n, IOMMUTLBEntry *iotlb) + struct vhost_dev *hdev = iommu->hdev; + hwaddr iova = iotlb->iova + iommu->iommu_offset; + +- if (hdev->vhost_ops->vhost_invalidate_device_iotlb(hdev, iova, +- iotlb->addr_mask + 1)) { ++ if (vhost_backend_invalidate_device_iotlb(hdev, iova, ++ iotlb->addr_mask + 1)) { + error_report("Fail to invalidate device iotlb"); + } + } +@@ -993,8 +993,8 @@ int vhost_device_iotlb_miss(struct vhost_dev *dev, uint64_t iova, int write) + len = MIN(iotlb.addr_mask + 1, len); + iova = iova & ~iotlb.addr_mask; + +- ret = dev->vhost_ops->vhost_update_device_iotlb(dev, iova, uaddr, +- len, iotlb.perm); ++ ret = vhost_backend_update_device_iotlb(dev, iova, uaddr, ++ len, iotlb.perm); + if (ret) { + error_report("Fail to update device iotlb"); + goto out; +diff --git a/include/hw/virtio/vhost-backend.h b/include/hw/virtio/vhost-backend.h +index c3cf4a7..a7a5f22 100644 +--- a/include/hw/virtio/vhost-backend.h ++++ b/include/hw/virtio/vhost-backend.h +@@ -27,6 +27,7 @@ struct vhost_vring_file; + struct vhost_vring_state; + struct vhost_vring_addr; + struct vhost_scsi_target; ++struct vhost_iotlb_msg; + + typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque); + typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev); +@@ -81,12 +82,8 @@ typedef int (*vhost_vsock_set_guest_cid_op)(struct vhost_dev *dev, + typedef int (*vhost_vsock_set_running_op)(struct vhost_dev *dev, int start); + typedef void (*vhost_set_iotlb_callback_op)(struct vhost_dev *dev, + int enabled); +-typedef int (*vhost_update_device_iotlb_op)(struct vhost_dev *dev, +- uint64_t iova, uint64_t uaddr, +- uint64_t len, +- IOMMUAccessFlags perm); +-typedef int (*vhost_invalidate_device_iotlb_op)(struct vhost_dev *dev, +- uint64_t iova, uint64_t len); ++typedef int (*vhost_send_device_iotlb_msg_op)(struct vhost_dev *dev, ++ struct vhost_iotlb_msg *imsg); + + typedef struct VhostOps { + VhostBackendType backend_type; +@@ -120,8 +117,7 @@ typedef struct VhostOps { + vhost_vsock_set_guest_cid_op vhost_vsock_set_guest_cid; + vhost_vsock_set_running_op vhost_vsock_set_running; + vhost_set_iotlb_callback_op vhost_set_iotlb_callback; +- vhost_update_device_iotlb_op vhost_update_device_iotlb; +- vhost_invalidate_device_iotlb_op vhost_invalidate_device_iotlb; ++ vhost_send_device_iotlb_msg_op vhost_send_device_iotlb_msg; + } VhostOps; + + extern const VhostOps user_ops; +@@ -129,4 +125,15 @@ extern const VhostOps user_ops; + int vhost_set_backend_type(struct vhost_dev *dev, + VhostBackendType backend_type); + ++int vhost_backend_update_device_iotlb(struct vhost_dev *dev, ++ uint64_t iova, uint64_t uaddr, ++ uint64_t len, ++ IOMMUAccessFlags perm); ++ ++int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev, ++ uint64_t iova, uint64_t len); ++ ++int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev, ++ struct vhost_iotlb_msg *imsg); ++ + #endif /* VHOST_BACKEND_H */ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vhost-user-add-slave-req-fd-support.patch b/SOURCES/kvm-vhost-user-add-slave-req-fd-support.patch new file mode 100644 index 0000000..218ea03 --- /dev/null +++ b/SOURCES/kvm-vhost-user-add-slave-req-fd-support.patch @@ -0,0 +1,285 @@ +From f2ef472de8d94edcb42b419116611d3ffc51d099 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Tue, 6 Jun 2017 12:05:23 +0200 +Subject: [PATCH 12/17] vhost-user: add slave-req-fd support +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Maxime Coquelin +Message-id: <20170606120524.3050-5-maxime.coquelin@redhat.com> +Patchwork-id: 75500 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 4/5] vhost-user: add slave-req-fd support +Bugzilla: 1451862 +RH-Acked-by: Peter Xu +RH-Acked-by: Xiao Wang +RH-Acked-by: Jens Freimann + +From: Marc-André Lureau + +Learn to give a socket to the slave to let him make requests to the +master. + +Signed-off-by: Marc-André Lureau +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 4bbeeba023f22c117d7a4c561354b91a0bf62e42) +Signed-off-by: Maxime Coquelin +Signed-off-by: Miroslav Rezanina +--- + docs/specs/vhost-user.txt | 32 +++++++++++- + hw/virtio/vhost-user.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 157 insertions(+), 2 deletions(-) + +diff --git a/docs/specs/vhost-user.txt b/docs/specs/vhost-user.txt +index 036890f..5fa7016 100644 +--- a/docs/specs/vhost-user.txt ++++ b/docs/specs/vhost-user.txt +@@ -139,6 +139,7 @@ in the ancillary data: + * VHOST_USER_SET_VRING_KICK + * VHOST_USER_SET_VRING_CALL + * VHOST_USER_SET_VRING_ERR ++ * VHOST_USER_SET_SLAVE_REQ_FD + + If Master is unable to send the full message or receives a wrong reply it will + close the connection. An optional reconnection mechanism can be implemented. +@@ -252,6 +253,18 @@ Once the source has finished migration, rings will be stopped by + the source. No further update must be done before rings are + restarted. + ++Slave communication ++------------------- ++ ++An optional communication channel is provided if the slave declares ++VHOST_USER_PROTOCOL_F_SLAVE_REQ protocol feature, to allow the slave to make ++requests to the master. ++ ++The fd is provided via VHOST_USER_SET_SLAVE_REQ_FD ancillary data. ++ ++A slave may then send VHOST_USER_SLAVE_* messages to the master ++using this fd communication channel. ++ + Protocol features + ----------------- + +@@ -260,9 +273,10 @@ Protocol features + #define VHOST_USER_PROTOCOL_F_RARP 2 + #define VHOST_USER_PROTOCOL_F_REPLY_ACK 3 + #define VHOST_USER_PROTOCOL_F_MTU 4 ++#define VHOST_USER_PROTOCOL_F_SLAVE_REQ 5 + +-Message types +-------------- ++Master message types ++-------------------- + + * VHOST_USER_GET_FEATURES + +@@ -486,6 +500,20 @@ Message types + If VHOST_USER_PROTOCOL_F_REPLY_ACK is negotiated, slave must respond + with zero in case the specified MTU is valid, or non-zero otherwise. + ++ * VHOST_USER_SET_SLAVE_REQ_FD ++ ++ Id: 21 ++ Equivalent ioctl: N/A ++ Master payload: N/A ++ ++ Set the socket file descriptor for slave initiated requests. It is passed ++ in the ancillary data. ++ This request should be sent only when VHOST_USER_F_PROTOCOL_FEATURES ++ has been negotiated, and protocol feature bit VHOST_USER_PROTOCOL_F_SLAVE_REQ ++ bit is present in VHOST_USER_GET_PROTOCOL_FEATURES. ++ If VHOST_USER_PROTOCOL_F_REPLY_ACK is negotiated, slave must respond ++ with zero for success, non-zero otherwise. ++ + VHOST_USER_PROTOCOL_F_REPLY_ACK: + ------------------------------- + The original vhost-user specification only demands replies for certain +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 325319f..0faf5df 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -33,6 +33,7 @@ enum VhostUserProtocolFeature { + VHOST_USER_PROTOCOL_F_RARP = 2, + VHOST_USER_PROTOCOL_F_REPLY_ACK = 3, + VHOST_USER_PROTOCOL_F_NET_MTU = 4, ++ VHOST_USER_PROTOCOL_F_SLAVE_REQ = 5, + + VHOST_USER_PROTOCOL_F_MAX + }; +@@ -61,9 +62,15 @@ typedef enum VhostUserRequest { + VHOST_USER_SET_VRING_ENABLE = 18, + VHOST_USER_SEND_RARP = 19, + VHOST_USER_NET_SET_MTU = 20, ++ VHOST_USER_SET_SLAVE_REQ_FD = 21, + VHOST_USER_MAX + } VhostUserRequest; + ++typedef enum VhostUserSlaveRequest { ++ VHOST_USER_SLAVE_NONE = 0, ++ VHOST_USER_SLAVE_MAX ++} VhostUserSlaveRequest; ++ + typedef struct VhostUserMemoryRegion { + uint64_t guest_phys_addr; + uint64_t memory_size; +@@ -113,6 +120,7 @@ static VhostUserMsg m __attribute__ ((unused)); + + struct vhost_user { + CharBackend *chr; ++ int slave_fd; + }; + + static bool ioeventfd_enabled(void) +@@ -579,6 +587,115 @@ static int vhost_user_reset_device(struct vhost_dev *dev) + return 0; + } + ++static void slave_read(void *opaque) ++{ ++ struct vhost_dev *dev = opaque; ++ struct vhost_user *u = dev->opaque; ++ VhostUserMsg msg = { 0, }; ++ int size, ret = 0; ++ ++ /* Read header */ ++ size = read(u->slave_fd, &msg, VHOST_USER_HDR_SIZE); ++ if (size != VHOST_USER_HDR_SIZE) { ++ error_report("Failed to read from slave."); ++ goto err; ++ } ++ ++ if (msg.size > VHOST_USER_PAYLOAD_SIZE) { ++ error_report("Failed to read msg header." ++ " Size %d exceeds the maximum %zu.", msg.size, ++ VHOST_USER_PAYLOAD_SIZE); ++ goto err; ++ } ++ ++ /* Read payload */ ++ size = read(u->slave_fd, &msg.payload, msg.size); ++ if (size != msg.size) { ++ error_report("Failed to read payload from slave."); ++ goto err; ++ } ++ ++ switch (msg.request) { ++ default: ++ error_report("Received unexpected msg type."); ++ ret = -EINVAL; ++ } ++ ++ /* ++ * REPLY_ACK feature handling. Other reply types has to be managed ++ * directly in their request handlers. ++ */ ++ if (msg.flags & VHOST_USER_NEED_REPLY_MASK) { ++ msg.flags &= ~VHOST_USER_NEED_REPLY_MASK; ++ msg.flags |= VHOST_USER_REPLY_MASK; ++ ++ msg.payload.u64 = !!ret; ++ msg.size = sizeof(msg.payload.u64); ++ ++ size = write(u->slave_fd, &msg, VHOST_USER_HDR_SIZE + msg.size); ++ if (size != VHOST_USER_HDR_SIZE + msg.size) { ++ error_report("Failed to send msg reply to slave."); ++ goto err; ++ } ++ } ++ ++ return; ++ ++err: ++ qemu_set_fd_handler(u->slave_fd, NULL, NULL, NULL); ++ close(u->slave_fd); ++ u->slave_fd = -1; ++ return; ++} ++ ++static int vhost_setup_slave_channel(struct vhost_dev *dev) ++{ ++ VhostUserMsg msg = { ++ .request = VHOST_USER_SET_SLAVE_REQ_FD, ++ .flags = VHOST_USER_VERSION, ++ }; ++ struct vhost_user *u = dev->opaque; ++ int sv[2], ret = 0; ++ bool reply_supported = virtio_has_feature(dev->protocol_features, ++ VHOST_USER_PROTOCOL_F_REPLY_ACK); ++ ++ if (!virtio_has_feature(dev->protocol_features, ++ VHOST_USER_PROTOCOL_F_SLAVE_REQ)) { ++ return 0; ++ } ++ ++ if (socketpair(PF_UNIX, SOCK_STREAM, 0, sv) == -1) { ++ error_report("socketpair() failed"); ++ return -1; ++ } ++ ++ u->slave_fd = sv[0]; ++ qemu_set_fd_handler(u->slave_fd, slave_read, NULL, dev); ++ ++ if (reply_supported) { ++ msg.flags |= VHOST_USER_NEED_REPLY_MASK; ++ } ++ ++ ret = vhost_user_write(dev, &msg, &sv[1], 1); ++ if (ret) { ++ goto out; ++ } ++ ++ if (reply_supported) { ++ ret = process_message_reply(dev, &msg); ++ } ++ ++out: ++ close(sv[1]); ++ if (ret) { ++ qemu_set_fd_handler(u->slave_fd, NULL, NULL, NULL); ++ close(u->slave_fd); ++ u->slave_fd = -1; ++ } ++ ++ return ret; ++} ++ + static int vhost_user_init(struct vhost_dev *dev, void *opaque) + { + uint64_t features; +@@ -589,6 +706,7 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) + + u = g_new0(struct vhost_user, 1); + u->chr = opaque; ++ u->slave_fd = -1; + dev->opaque = u; + + err = vhost_user_get_features(dev, &features); +@@ -629,6 +747,11 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) + "VHOST_USER_PROTOCOL_F_LOG_SHMFD feature."); + } + ++ err = vhost_setup_slave_channel(dev); ++ if (err < 0) { ++ return err; ++ } ++ + return 0; + } + +@@ -639,6 +762,10 @@ static int vhost_user_cleanup(struct vhost_dev *dev) + assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER); + + u = dev->opaque; ++ if (u->slave_fd >= 0) { ++ close(u->slave_fd); ++ u->slave_fd = -1; ++ } + g_free(u); + dev->opaque = 0; + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vhost-user-add-vhost_user-to-hold-the-chr.patch b/SOURCES/kvm-vhost-user-add-vhost_user-to-hold-the-chr.patch new file mode 100644 index 0000000..68868ac --- /dev/null +++ b/SOURCES/kvm-vhost-user-add-vhost_user-to-hold-the-chr.patch @@ -0,0 +1,99 @@ +From a9adfd803bc1a101c3229b5ad20da533fa2d51f1 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Tue, 6 Jun 2017 12:05:22 +0200 +Subject: [PATCH 11/17] vhost-user: add vhost_user to hold the chr +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Maxime Coquelin +Message-id: <20170606120524.3050-4-maxime.coquelin@redhat.com> +Patchwork-id: 75499 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 3/5] vhost-user: add vhost_user to hold the chr +Bugzilla: 1451862 +RH-Acked-by: Peter Xu +RH-Acked-by: Xiao Wang +RH-Acked-by: Jens Freimann + +From: Marc-André Lureau + +Next patches will add more fields to the structure + +Signed-off-by: Marc-André Lureau +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 2152f3fead5ddaf7bdbe370f9b87713eae683b75) +Signed-off-by: Maxime Coquelin +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost-user.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 24ca863..325319f 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -111,6 +111,10 @@ static VhostUserMsg m __attribute__ ((unused)); + /* The version of the protocol we support */ + #define VHOST_USER_VERSION (0x1) + ++struct vhost_user { ++ CharBackend *chr; ++}; ++ + static bool ioeventfd_enabled(void) + { + return kvm_enabled() && kvm_eventfds_enabled(); +@@ -118,7 +122,8 @@ static bool ioeventfd_enabled(void) + + static int vhost_user_read(struct vhost_dev *dev, VhostUserMsg *msg) + { +- CharBackend *chr = dev->opaque; ++ struct vhost_user *u = dev->opaque; ++ CharBackend *chr = u->chr; + uint8_t *p = (uint8_t *) msg; + int r, size = VHOST_USER_HDR_SIZE; + +@@ -203,7 +208,8 @@ static bool vhost_user_one_time_request(VhostUserRequest request) + static int vhost_user_write(struct vhost_dev *dev, VhostUserMsg *msg, + int *fds, int fd_num) + { +- CharBackend *chr = dev->opaque; ++ struct vhost_user *u = dev->opaque; ++ CharBackend *chr = u->chr; + int ret, size = VHOST_USER_HDR_SIZE + msg->size; + + /* +@@ -576,11 +582,14 @@ static int vhost_user_reset_device(struct vhost_dev *dev) + static int vhost_user_init(struct vhost_dev *dev, void *opaque) + { + uint64_t features; ++ struct vhost_user *u; + int err; + + assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER); + +- dev->opaque = opaque; ++ u = g_new0(struct vhost_user, 1); ++ u->chr = opaque; ++ dev->opaque = u; + + err = vhost_user_get_features(dev, &features); + if (err < 0) { +@@ -625,8 +634,12 @@ static int vhost_user_init(struct vhost_dev *dev, void *opaque) + + static int vhost_user_cleanup(struct vhost_dev *dev) + { ++ struct vhost_user *u; ++ + assert(dev->vhost_ops->backend_type == VHOST_BACKEND_TYPE_USER); + ++ u = dev->opaque; ++ g_free(u); + dev->opaque = 0; + + return 0; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-vhost-user-pass-message-as-a-pointer-to-process_mess.patch b/SOURCES/kvm-vhost-user-pass-message-as-a-pointer-to-process_mess.patch new file mode 100644 index 0000000..66a5362 --- /dev/null +++ b/SOURCES/kvm-vhost-user-pass-message-as-a-pointer-to-process_mess.patch @@ -0,0 +1,96 @@ +From 966857f341d1e5935546a92c5712b637bf64021d Mon Sep 17 00:00:00 2001 +From: Jens Freimann +Date: Thu, 1 Jun 2017 13:17:31 +0200 +Subject: [PATCH 08/13] vhost-user: pass message as a pointer to + process_message_reply() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +RH-Author: Jens Freimann +Message-id: <20170601131731.17338-2-jfreiman@redhat.com> +Patchwork-id: 75456 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] vhost-user: pass message as a pointer to process_message_reply() +Bugzilla: 1447592 +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Xiao Wang +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Maxime Coquelin + +From: Maxime Coquelin + +process_message_reply() was recently updated to get full message +content instead of only its request field. + +There is no need to copy all the struct content into the stack, +so just pass its pointer as const. + +Reviewed-by: Jens Freimann +Reviewed-by: Zhiyong Yang +Signed-off-by: Maxime Coquelin +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Marc-André Lureau +(cherry-picked from commit 60cd11024f41cc73175e651a2dfe09a3cade56bb) + +This cleans up commit 15a523d +"hw/virtio: fix vhost user fails to startup when MQ" + +Signed-off-by: Jens Freimann +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/vhost-user.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c +index 32a95a8..24ca863 100644 +--- a/hw/virtio/vhost-user.c ++++ b/hw/virtio/vhost-user.c +@@ -163,11 +163,11 @@ fail: + } + + static int process_message_reply(struct vhost_dev *dev, +- VhostUserMsg msg) ++ const VhostUserMsg *msg) + { + VhostUserMsg msg_reply; + +- if ((msg.flags & VHOST_USER_NEED_REPLY_MASK) == 0) { ++ if ((msg->flags & VHOST_USER_NEED_REPLY_MASK) == 0) { + return 0; + } + +@@ -175,10 +175,10 @@ static int process_message_reply(struct vhost_dev *dev, + return -1; + } + +- if (msg_reply.request != msg.request) { ++ if (msg_reply.request != msg->request) { + error_report("Received unexpected msg type." + "Expected %d received %d", +- msg.request, msg_reply.request); ++ msg->request, msg_reply.request); + return -1; + } + +@@ -325,7 +325,7 @@ static int vhost_user_set_mem_table(struct vhost_dev *dev, + } + + if (reply_supported) { +- return process_message_reply(dev, msg); ++ return process_message_reply(dev, &msg); + } + + return 0; +@@ -717,7 +717,7 @@ static int vhost_user_net_set_mtu(struct vhost_dev *dev, uint16_t mtu) + + /* If reply_ack supported, slave has to ack specified MTU is valid */ + if (reply_supported) { +- return process_message_reply(dev, msg); ++ return process_message_reply(dev, &msg); + } + + return 0; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-rng-stop-virtqueue-while-the-CPU-is-stopped.patch b/SOURCES/kvm-virtio-rng-stop-virtqueue-while-the-CPU-is-stopped.patch new file mode 100644 index 0000000..1a3c3a1 --- /dev/null +++ b/SOURCES/kvm-virtio-rng-stop-virtqueue-while-the-CPU-is-stopped.patch @@ -0,0 +1,152 @@ +From 9edf80a5eff51ebc6944876018952dc2505160bd Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Mon, 24 Apr 2017 16:45:25 +0200 +Subject: [PATCH 15/23] virtio-rng: stop virtqueue while the CPU is stopped + +RH-Author: Laurent Vivier +Message-id: <20170424164525.31342-1-lvivier@redhat.com> +Patchwork-id: 74859 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] virtio-rng: stop virtqueue while the CPU is stopped +Bugzilla: 1435521 +RH-Acked-by: Juan Quintela +RH-Acked-by: Dr. David Alan Gilbert +RH-Acked-by: Miroslav Rezanina + +If we modify the virtio-rng virqueue while the +vmstate is already migrated we can have some +inconsistencies between the virtqueue state and +the memory content. + +To avoid this, stop the virtqueue while the CPU +is stopped. + +Signed-off-by: Laurent Vivier +Reviewed-by: Amit Shah +Reviewed-by: Stefan Hajnoczi +Reviewed-by: Juan Quintela +Signed-off-by: Juan Quintela +(cherry picked from commit a23a6d183986ef38b705e85cabdd2af6cdc95276) +Signed-off-by: Laurent Vivier + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1435521 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13071542 +Signed-off-by: Miroslav Rezanina +--- + hw/virtio/trace-events | 3 +++ + hw/virtio/virtio-rng.c | 29 +++++++++++++++++++++++------ + include/hw/virtio/virtio-rng.h | 2 ++ + 3 files changed, 28 insertions(+), 6 deletions(-) + +diff --git a/hw/virtio/trace-events b/hw/virtio/trace-events +index 6926eed..1f7a7c1 100644 +--- a/hw/virtio/trace-events ++++ b/hw/virtio/trace-events +@@ -11,8 +11,11 @@ virtio_set_status(void *vdev, uint8_t val) "vdev %p val %u" + + # hw/virtio/virtio-rng.c + virtio_rng_guest_not_ready(void *rng) "rng %p: guest not ready" ++virtio_rng_cpu_is_stopped(void *rng, int size) "rng %p: cpu is stopped, dropping %d bytes" ++virtio_rng_popped(void *rng) "rng %p: elem popped" + virtio_rng_pushed(void *rng, size_t len) "rng %p: %zd bytes pushed" + virtio_rng_request(void *rng, size_t size, unsigned quota) "rng %p: %zd bytes requested, %u bytes quota left" ++virtio_rng_vm_state_change(void *rng, int running, int state) "rng %p: state change to running %d state %d" + + # hw/virtio/virtio-balloon.c + # +diff --git a/hw/virtio/virtio-rng.c b/hw/virtio/virtio-rng.c +index 9639f4e..a6ee501 100644 +--- a/hw/virtio/virtio-rng.c ++++ b/hw/virtio/virtio-rng.c +@@ -53,6 +53,15 @@ static void chr_read(void *opaque, const void *buf, size_t size) + return; + } + ++ /* we can't modify the virtqueue until ++ * our state is fully synced ++ */ ++ ++ if (!runstate_check(RUN_STATE_RUNNING)) { ++ trace_virtio_rng_cpu_is_stopped(vrng, size); ++ return; ++ } ++ + vrng->quota_remaining -= size; + + offset = 0; +@@ -61,6 +70,7 @@ static void chr_read(void *opaque, const void *buf, size_t size) + if (!elem) { + break; + } ++ trace_virtio_rng_popped(vrng); + len = iov_from_buf(elem->in_sg, elem->in_num, + 0, buf + offset, size - offset); + offset += len; +@@ -120,17 +130,21 @@ static uint64_t get_features(VirtIODevice *vdev, uint64_t f, Error **errp) + return f; + } + +-static int virtio_rng_post_load(void *opaque, int version_id) ++static void virtio_rng_vm_state_change(void *opaque, int running, ++ RunState state) + { + VirtIORNG *vrng = opaque; + ++ trace_virtio_rng_vm_state_change(vrng, running, state); ++ + /* We may have an element ready but couldn't process it due to a quota +- * limit. Make sure to try again after live migration when the quota may +- * have been reset. ++ * limit or because CPU was stopped. Make sure to try again when the ++ * CPU restart. + */ +- virtio_rng_process(vrng); + +- return 0; ++ if (running && is_guest_ready(vrng)) { ++ virtio_rng_process(vrng); ++ } + } + + static void check_rate_limit(void *opaque) +@@ -198,6 +212,9 @@ static void virtio_rng_device_realize(DeviceState *dev, Error **errp) + vrng->rate_limit_timer = timer_new_ms(QEMU_CLOCK_VIRTUAL, + check_rate_limit, vrng); + vrng->activate_timer = true; ++ ++ vrng->vmstate = qemu_add_vm_change_state_handler(virtio_rng_vm_state_change, ++ vrng); + } + + static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp) +@@ -205,6 +222,7 @@ static void virtio_rng_device_unrealize(DeviceState *dev, Error **errp) + VirtIODevice *vdev = VIRTIO_DEVICE(dev); + VirtIORNG *vrng = VIRTIO_RNG(dev); + ++ qemu_del_vm_change_state_handler(vrng->vmstate); + timer_del(vrng->rate_limit_timer); + timer_free(vrng->rate_limit_timer); + virtio_cleanup(vdev); +@@ -218,7 +236,6 @@ static const VMStateDescription vmstate_virtio_rng = { + VMSTATE_VIRTIO_DEVICE, + VMSTATE_END_OF_LIST() + }, +- .post_load = virtio_rng_post_load, + }; + + static Property virtio_rng_properties[] = { +diff --git a/include/hw/virtio/virtio-rng.h b/include/hw/virtio/virtio-rng.h +index 2d40abd..922dce7 100644 +--- a/include/hw/virtio/virtio-rng.h ++++ b/include/hw/virtio/virtio-rng.h +@@ -45,6 +45,8 @@ typedef struct VirtIORNG { + QEMUTimer *rate_limit_timer; + int64_t quota_remaining; + bool activate_timer; ++ ++ VMChangeStateEntry *vmstate; + } VirtIORNG; + + #endif +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch b/SOURCES/kvm-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch new file mode 100644 index 0000000..4ee0dcb --- /dev/null +++ b/SOURCES/kvm-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch @@ -0,0 +1,66 @@ +From b0caf00bbc35c7d89e02999bdce86e1f867728e8 Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Wed, 14 Jun 2017 15:37:01 +0200 +Subject: [PATCH 2/8] 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 +--- + 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 cb1c123..4edf449 100644 +--- a/hw/scsi/virtio-scsi.c ++++ b/hw/scsi/virtio-scsi.c +@@ -789,6 +789,15 @@ static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev, + VirtIOSCSI *s = VIRTIO_SCSI(vdev); + SCSIDevice *sd = SCSI_DEVICE(dev); + ++ /* 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; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-scsi-Unset-hotplug-handler-when-unrealize.patch b/SOURCES/kvm-virtio-scsi-Unset-hotplug-handler-when-unrealize.patch new file mode 100644 index 0000000..8bbbdc4 --- /dev/null +++ b/SOURCES/kvm-virtio-scsi-Unset-hotplug-handler-when-unrealize.patch @@ -0,0 +1,54 @@ +From f9f07bb61d34fb0f05a4072a201f879bc7b97ac3 Mon Sep 17 00:00:00 2001 +From: Fam Zheng +Date: Tue, 13 Jun 2017 06:08:30 +0200 +Subject: [PATCH 13/13] virtio-scsi: Unset hotplug handler when unrealize + +RH-Author: Fam Zheng +Message-id: <20170613060830.4729-1-famz@redhat.com> +Patchwork-id: 75595 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] virtio-scsi: Unset hotplug handler when unrealize +Bugzilla: 1449031 +RH-Acked-by: Paolo Bonzini +RH-Acked-by: Ladi Prosek +RH-Acked-by: Thomas Huth + +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1449031 +Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13409468 + +This matches the qbus_set_hotplug_handler in realize, and it releases +the final reference to the embedded VirtIODevice so that it is +properly finalized. + +A use-after-free is fixed with this patch, indirectly: +virtio_device_instance_finalize wasn't called at hot-unplug, and the +vdev->listener would be a dangling pointer in the global and the per +address space listener list. See also RHBZ 1449031. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Fam Zheng +Message-Id: <20170518102808.30046-1-famz@redhat.com> +Signed-off-by: Paolo Bonzini +(cherry picked from commit 2cbe2de5454cf9af44b620b2b40d56361a12a45f) +Signed-off-by: Fam Zheng +Signed-off-by: Miroslav Rezanina +--- + hw/scsi/virtio-scsi.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c +index bd62d08..cb1c123 100644 +--- a/hw/scsi/virtio-scsi.c ++++ b/hw/scsi/virtio-scsi.c +@@ -915,6 +915,9 @@ void virtio_scsi_common_unrealize(DeviceState *dev, Error **errp) + + static void virtio_scsi_device_unrealize(DeviceState *dev, Error **errp) + { ++ VirtIOSCSI *s = VIRTIO_SCSI(dev); ++ ++ qbus_set_hotplug_handler(BUS(&s->bus), NULL, &error_abort); + virtio_scsi_common_unrealize(dev, errp); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-serial-bus-Unset-hotplug-handler-when-unreali.patch b/SOURCES/kvm-virtio-serial-bus-Unset-hotplug-handler-when-unreali.patch new file mode 100644 index 0000000..9b05428 --- /dev/null +++ b/SOURCES/kvm-virtio-serial-bus-Unset-hotplug-handler-when-unreali.patch @@ -0,0 +1,55 @@ +From 23b4ce3b1ab27196f75bbaa31ef8d00df9eb2597 Mon Sep 17 00:00:00 2001 +From: Ladi Prosek +Date: Mon, 5 Jun 2017 13:24:43 +0200 +Subject: [PATCH 09/13] virtio-serial-bus: Unset hotplug handler when unrealize + +RH-Author: Ladi Prosek +Message-id: <20170605132443.13592-1-lprosek@redhat.com> +Patchwork-id: 75481 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH] virtio-serial-bus: Unset hotplug handler when unrealize +Bugzilla: 1458782 +RH-Acked-by: Fam Zheng +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Miroslav Rezanina + +Virtio serial device controls the lifetime of virtio-serial-bus and +virtio-serial-bus links back to the device via its hotplug-handler +property. This extra ref-count prevents the device from getting +finalized, leaving the VirtIODevice memory listener registered and +leading to use-after-free later on. + +This patch addresses the same issue as Fam Zheng's +"virtio-scsi: Unset hotplug handler when unrealize" +only for a different virtio device. + +Cc: qemu-stable@nongnu.org +Signed-off-by: Ladi Prosek +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +Reviewed-by: Paolo Bonzini +Reviewed-by: Fam Zheng +(cherry-picked from commit f811f97040a48358b456b46ecbc9167f0131034f) +Signed-off-by: Ladi Prosek + +Signed-off-by: Miroslav Rezanina +--- + hw/char/virtio-serial-bus.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index d797a67..aa9c11a 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -1121,6 +1121,9 @@ static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp) + timer_free(vser->post_load->timer); + g_free(vser->post_load); + } ++ ++ qbus_set_hotplug_handler(BUS(&vser->bus), NULL, errp); ++ + virtio_cleanup(vdev); + } + +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio-serial-fix-segfault-on-disconnect.patch b/SOURCES/kvm-virtio-serial-fix-segfault-on-disconnect.patch new file mode 100644 index 0000000..7e7e9cb --- /dev/null +++ b/SOURCES/kvm-virtio-serial-fix-segfault-on-disconnect.patch @@ -0,0 +1,86 @@ +From baae39c2c63098031cd7448b1b1331bcf6140c45 Mon Sep 17 00:00:00 2001 +From: Stefan Hajnoczi +Date: Mon, 12 Jun 2017 14:36:56 +0200 +Subject: [PATCH 10/13] virtio-serial: fix segfault on disconnect + +RH-Author: Stefan Hajnoczi +Message-id: <20170612143656.19554-2-stefanha@redhat.com> +Patchwork-id: 75591 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] virtio-serial: fix segfault on disconnect +Bugzilla: 1447257 +RH-Acked-by: Ladi Prosek +RH-Acked-by: Michael S. Tsirkin +RH-Acked-by: Pankaj Gupta + +Since commit d4c19cdeeb2f1e474bc426a6da261f1d7346eb5b ("virtio-serial: +add missing virtio_detach_element() call") the following commands may +cause QEMU to segfault: + + $ qemu -M accel=kvm -cpu host -m 1G \ + -drive if=virtio,file=test.img,format=raw \ + -device virtio-serial-pci,id=virtio-serial0 \ + -chardev socket,id=channel1,path=/tmp/chardev.sock,server,nowait \ + -device virtserialport,chardev=channel1,bus=virtio-serial0.0,id=port1 + $ nc -U /tmp/chardev.sock + ^C + + (guest)$ cat /dev/zero >/dev/vport0p1 + +The segfault is non-deterministic: if the event loop notices the socket +has been closed then there is no crash. The disconnect has to happen +right before QEMU attempts to write data to the socket. + +The backtrace is as follows: + + Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. + 0x00005555557e0698 in do_flush_queued_data (port=0x5555582cedf0, vq=0x7fffcc854290, vdev=0x55555807b1d0) at hw/char/virtio-serial-bus.c:180 + 180 for (i = port->iov_idx; i < port->elem->out_num; i++) { + #1 0x000055555580d363 in virtio_queue_notify_vq (vq=0x7fffcc854290) at hw/virtio/virtio.c:1524 + #2 0x000055555580d363 in virtio_queue_host_notifier_read (n=0x7fffcc8542f8) at hw/virtio/virtio.c:2430 + #3 0x0000555555b3482c in aio_dispatch_handlers (ctx=ctx@entry=0x5555566b8c80) at util/aio-posix.c:399 + #4 0x0000555555b350d8 in aio_dispatch (ctx=0x5555566b8c80) at util/aio-posix.c:430 + #5 0x0000555555b3212e in aio_ctx_dispatch (source=, callback=, user_data=) at util/async.c:261 + #6 0x00007fffde71de52 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0 + #7 0x0000555555b34353 in glib_pollfds_poll () at util/main-loop.c:213 + #8 0x0000555555b34353 in os_host_main_loop_wait (timeout=) at util/main-loop.c:261 + #9 0x0000555555b34353 in main_loop_wait (nonblocking=) at util/main-loop.c:517 + #10 0x0000555555773207 in main_loop () at vl.c:1917 + #11 0x0000555555773207 in main (argc=, argv=, envp=) at vl.c:4751 + +The do_flush_queued_data() function does not anticipate chardev close +events during vsc->have_data(). It expects port->elem to remain +non-NULL for the duration its for loop. + +The fix is simply to return from do_flush_queued_data() if the port +closes because the close event already frees port->elem and drains the +virtqueue - there is nothing left for do_flush_queued_data() to do. + +Reported-by: Sitong Liu +Reported-by: Min Deng +Signed-off-by: Stefan Hajnoczi +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 46764fe09ca2e0f15c0981a672c166ed8cf57e72) +Signed-off-by: Stefan Hajnoczi +Signed-off-by: Miroslav Rezanina +--- + hw/char/virtio-serial-bus.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c +index aa9c11a..f5bc173 100644 +--- a/hw/char/virtio-serial-bus.c ++++ b/hw/char/virtio-serial-bus.c +@@ -186,6 +186,9 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq, + port->elem->out_sg[i].iov_base + + port->iov_offset, + buf_size); ++ if (!port->elem) { /* bail if we got disconnected */ ++ return; ++ } + if (port->throttled) { + port->iov_idx = i; + if (ret > 0) { +-- +1.8.3.1 + diff --git a/SOURCES/kvm-virtio_net-Bypass-backends-for-MTU-feature-negotiati.patch b/SOURCES/kvm-virtio_net-Bypass-backends-for-MTU-feature-negotiati.patch new file mode 100644 index 0000000..e4e1f55 --- /dev/null +++ b/SOURCES/kvm-virtio_net-Bypass-backends-for-MTU-feature-negotiati.patch @@ -0,0 +1,129 @@ +From 627adfaf4c1b732a1d5694a0510ecda7f6eef998 Mon Sep 17 00:00:00 2001 +From: Maxime Coquelin +Date: Thu, 1 Jun 2017 09:24:15 +0200 +Subject: [PATCH 07/13] virtio_net: Bypass backends for MTU feature negotiation + +RH-Author: Maxime Coquelin +Message-id: <20170601092415.2215-1-maxime.coquelin@redhat.com> +Patchwork-id: 75454 +O-Subject: [RHEL7.4 qemu-kvm-rhev] virtio_net: Bypass backends for MTU feature negotiation +Bugzilla: 1452756 +RH-Acked-by: Laurent Vivier +RH-Acked-by: Jens Freimann +RH-Acked-by: Vlad Yasevich +RH-Acked-by: Michael S. Tsirkin + +This patch adds a new internal "x-mtu-bypass-backend" property +to bypass backends for MTU feature negotiation. + +When this property is set, the MTU feature is negotiated as soon +as supported by the guest and a MTU value is set via the host_mtu +parameter. In case the backend advertises the feature (e.g. DPDK's +vhost-user backend), the feature negotiation is propagated down to +the backend. + +When this property is not set, the backend has to support the MTU +feature for its negotiation to succeed. + +For compatibility purpose, this property is disabled for machine +types RHEL7.3 (vs. v2.9 for upstream) and older. + +Cc: Aaron Conole +Suggested-by: Michael S. Tsirkin +Signed-off-by: Maxime Coquelin +Reviewed-by: Vlad Yasevich +Reviewed-by: Michael S. Tsirkin +Signed-off-by: Michael S. Tsirkin +(cherry picked from commit 75ebec11afe49539f71cc1c494e3010f91c86adb) +Signed-off-by: Miroslav Rezanina +--- + hw/net/virtio-net.c | 17 ++++++++++++++++- + include/hw/compat.h | 4 ++++ + include/hw/virtio/virtio-net.h | 1 + + include/hw/virtio/virtio.h | 1 + + 4 files changed, 22 insertions(+), 1 deletion(-) + +diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c +index 7d091c9..39c336e 100644 +--- a/hw/net/virtio-net.c ++++ b/hw/net/virtio-net.c +@@ -589,7 +589,15 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features, + if (!get_vhost_net(nc->peer)) { + return features; + } +- return vhost_net_get_features(get_vhost_net(nc->peer), features); ++ features = vhost_net_get_features(get_vhost_net(nc->peer), features); ++ vdev->backend_features = features; ++ ++ if (n->mtu_bypass_backend && ++ (n->host_features & 1ULL << VIRTIO_NET_F_MTU)) { ++ features |= (1ULL << VIRTIO_NET_F_MTU); ++ } ++ ++ return features; + } + + static uint64_t virtio_net_bad_features(VirtIODevice *vdev) +@@ -640,6 +648,11 @@ static void virtio_net_set_features(VirtIODevice *vdev, uint64_t features) + VirtIONet *n = VIRTIO_NET(vdev); + int i; + ++ if (n->mtu_bypass_backend && ++ !virtio_has_feature(vdev->backend_features, VIRTIO_NET_F_MTU)) { ++ features &= ~(1ULL << VIRTIO_NET_F_MTU); ++ } ++ + virtio_net_set_multiqueue(n, + virtio_has_feature(features, VIRTIO_NET_F_MQ)); + +@@ -2090,6 +2103,8 @@ static Property virtio_net_properties[] = { + DEFINE_PROP_UINT16("rx_queue_size", VirtIONet, net_conf.rx_queue_size, + VIRTIO_NET_RX_QUEUE_DEFAULT_SIZE), + DEFINE_PROP_UINT16("host_mtu", VirtIONet, net_conf.mtu, 0), ++ DEFINE_PROP_BOOL("x-mtu-bypass-backend", VirtIONet, mtu_bypass_backend, ++ true), + DEFINE_PROP_END_OF_LIST(), + }; + +diff --git a/include/hw/compat.h b/include/hw/compat.h +index 8366acc..843958b 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -360,6 +360,10 @@ + .driver = "e1000e",\ + .property = "__redhat_e1000e_7_3_intr_state",\ + .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_3 */ \ ++ .driver = "virtio-net-device",\ ++ .property = "x-mtu-bypass-backend",\ ++ .value = "off",\ + }, + + #endif /* HW_COMPAT_H */ +diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h +index 1eec9a2..602b486 100644 +--- a/include/hw/virtio/virtio-net.h ++++ b/include/hw/virtio/virtio-net.h +@@ -97,6 +97,7 @@ typedef struct VirtIONet { + QEMUTimer *announce_timer; + int announce_counter; + bool needs_vnet_hdr_swap; ++ bool mtu_bypass_backend; + } VirtIONet; + + void virtio_net_set_netclient_name(VirtIONet *n, const char *name, +diff --git a/include/hw/virtio/virtio.h b/include/hw/virtio/virtio.h +index 7dcb53a..5faa359 100644 +--- a/include/hw/virtio/virtio.h ++++ b/include/hw/virtio/virtio.h +@@ -79,6 +79,7 @@ struct VirtIODevice + uint16_t queue_sel; + uint64_t guest_features; + uint64_t host_features; ++ uint64_t backend_features; + size_t config_len; + void *config; + uint16_t config_vector; +-- +1.8.3.1 + diff --git a/SOURCES/kvm-x86-machine-compat-2.9-stragglers.patch b/SOURCES/kvm-x86-machine-compat-2.9-stragglers.patch new file mode 100644 index 0000000..d18ddfb --- /dev/null +++ b/SOURCES/kvm-x86-machine-compat-2.9-stragglers.patch @@ -0,0 +1,82 @@ +From d6ec65d1f9e766a233288a8ecec62ca757ed11f7 Mon Sep 17 00:00:00 2001 +From: "Dr. David Alan Gilbert" +Date: Wed, 26 Apr 2017 15:48:49 +0200 +Subject: [PATCH 01/11] x86 machine compat: 2.9 stragglers + +RH-Author: Dr. David Alan Gilbert +Message-id: <20170426154849.7273-1-dgilbert@redhat.com> +Patchwork-id: 74894 +O-Subject: [RHEL-7.4 qemu-kvm-rhev PATCH v2] x86 machine compat: 2.9 stragglers +Bugzilla: 1435756 +RH-Acked-by: Laszlo Ersek +RH-Acked-by: Juan Quintela +RH-Acked-by: Markus Armbruster + +From: "Dr. David Alan Gilbert" + +upstream: Yes, various diffs + +Some flag changes came in late in 2.9 and we hadn't picked them up yet + +Signed-off-by: Dr. David Alan Gilbert +Signed-off-by: Miroslav Rezanina +--- + include/hw/compat.h | 4 ++++ + include/hw/i386/pc.h | 19 +++++++++++++++++-- + 2 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/include/hw/compat.h b/include/hw/compat.h +index b0c57ec..f85c1c2 100644 +--- a/include/hw/compat.h ++++ b/include/hw/compat.h +@@ -297,6 +297,10 @@ + .driver = "virtio-pci",\ + .property = "page-per-vq",\ + .value = "on",\ ++ },{ /* HW_COMPAT_RHEL7_2 from HW_COMPAT_2_4 added in 2.9 */ \ ++ .driver = "vmgenid",\ ++ .property = "x-write-pointer-available",\ ++ .value = "off",\ + }, + + /* Mostly like HW_COMPAT_2_6 + HW_COMPAT_2_7 + HW_COMPAT_2_8 except +diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h +index 7cd1719..62ac914 100644 +--- a/include/hw/i386/pc.h ++++ b/include/hw/i386/pc.h +@@ -998,7 +998,7 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + + #define PC_RHEL7_3_COMPAT \ + HW_COMPAT_RHEL7_3 \ +- { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_7 */ \ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ + .driver = "kvmclock",\ + .property = "x-mach-use-reliable-get-clock",\ + .value = "off",\ +@@ -1038,7 +1038,22 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id); + .property = "cpuid-0xb",\ + .value = "off",\ + },\ +- { /* PC_RHEL7_3_COMPAT */ \ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ ++ .driver = "ICH9-LPC",\ ++ .property = "x-smi-broadcast",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ ++ .driver = TYPE_X86_CPU,\ ++ .property = "vmware-cpuid-freq",\ ++ .value = "off",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_8 */ \ ++ .driver = "Haswell-" TYPE_X86_CPU,\ ++ .property = "stepping",\ ++ .value = "1",\ ++ },\ ++ { /* PC_RHEL7_3_COMPAT from PC_COMPAT_2_3 added in 2.9 */ \ + .driver = TYPE_X86_CPU,\ + .property = "kvm-no-smi-migration",\ + .value = "on",\ +-- +1.8.3.1 + diff --git a/SOURCES/kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch b/SOURCES/kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch new file mode 100644 index 0000000..89e8411 --- /dev/null +++ b/SOURCES/kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch @@ -0,0 +1,71 @@ +From 64237adfdb9ed77bba8b7e3b880b3e2b0bee9d83 Mon Sep 17 00:00:00 2001 +From: Laurent Vivier +Date: Mon, 12 Jun 2017 16:08:07 +0200 +Subject: [PATCH 12/13] xhci: only update dequeue ptr on completed transfers + +RH-Author: Laurent Vivier +Message-id: <20170612160807.29491-1-lvivier@redhat.com> +Patchwork-id: 75594 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH] xhci: only update dequeue ptr on completed transfers +Bugzilla: 1451631 +RH-Acked-by: Thomas Huth +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Dr. David Alan Gilbert + +From: Gerd Hoffmann + +The dequeue pointer should only be updated in case the transfer +is actually completed. If we update it for inflight transfers +we will not pick them up again after migration, which easily +triggers with HID devices as they typically have a pending +transfer, waiting for user input to happen. + +Fixes: 243afe858b95765b98d16a1f0dd50dca262858ad +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1451631 +Signed-off-by: Gerd Hoffmann + +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=13406862 +BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1451631 +Upstream: not yet upstream, but in Gerd's tree + git://git.kraxel.org/qemu work/xhci-hid-migration + +Signed-off-by: Laurent Vivier +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-xhci.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index da9ed15..7d31637 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -2121,6 +2121,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) + } + assert(!xfer->running_retry); + if (xfer->complete) { ++ /* update ring dequeue ptr */ ++ xhci_set_ep_state(xhci, epctx, stctx, epctx->state); + xhci_ep_free_xfer(epctx->retry); + } + epctx->retry = NULL; +@@ -2171,6 +2173,8 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) + xhci_fire_transfer(xhci, xfer, epctx); + } + if (xfer->complete) { ++ /* update ring dequeue ptr */ ++ xhci_set_ep_state(xhci, epctx, stctx, epctx->state); + xhci_ep_free_xfer(xfer); + xfer = NULL; + } +@@ -2188,8 +2192,6 @@ static void xhci_kick_epctx(XHCIEPContext *epctx, unsigned int streamid) + break; + } + } +- /* update ring dequeue ptr */ +- xhci_set_ep_state(xhci, epctx, stctx, epctx->state); + epctx->kick_active--; + + ep = xhci_epid_to_usbep(epctx); +-- +1.8.3.1 + diff --git a/SOURCES/kvm-xhci-relax-link-check.patch b/SOURCES/kvm-xhci-relax-link-check.patch new file mode 100644 index 0000000..6da6afb --- /dev/null +++ b/SOURCES/kvm-xhci-relax-link-check.patch @@ -0,0 +1,53 @@ +From d6b8e12c485d6c3e7a6b87cf9e2f5df7cba14246 Mon Sep 17 00:00:00 2001 +From: Ladi Prosek +Date: Wed, 17 May 2017 08:53:02 +0200 +Subject: [PATCH 08/27] xhci: relax link check + +RH-Author: Ladi Prosek +Message-id: <20170517085302.26786-2-lprosek@redhat.com> +Patchwork-id: 75234 +O-Subject: [RHV-7.4 qemu-kvm-rhev PATCH 1/1] xhci: relax link check +Bugzilla: 1444003 +RH-Acked-by: Gerd Hoffmann +RH-Acked-by: Thomas Huth +RH-Acked-by: Laurent Vivier + +The strict td link limit added by commit "05f43d4 xhci: limit the +number of link trbs we are willing to process" causes problems with +Windows guests. Let's raise the limit. + +This change is analogous to: + + commit ab6b1105a2259c7072905887f71caa850ce63190 + Author: Gerd Hoffmann + Date: Tue Mar 7 09:40:18 2017 +0100 + + ohci: relax link check + +Signed-off-by: Ladi Prosek +Message-id: 20170512102100.22675-1-lprosek@redhat.com +Signed-off-by: Gerd Hoffmann +(cherry-picked from commit 99f9aeba5d461f79c9ce73f968ba0feb77fc1f5a) +Signed-off-by: Ladi Prosek + +Signed-off-by: Miroslav Rezanina +--- + hw/usb/hcd-xhci.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c +index 1555aa4..da9ed15 100644 +--- a/hw/usb/hcd-xhci.c ++++ b/hw/usb/hcd-xhci.c +@@ -50,7 +50,7 @@ + /* Very pessimistic, let's hope it's enough for all cases */ + #define EV_QUEUE (((3 * 24) + 16) * MAXSLOTS) + +-#define TRB_LINK_LIMIT 4 ++#define TRB_LINK_LIMIT 32 + #define COMMAND_LIMIT 256 + #define TRANSFER_LIMIT 256 + +-- +1.8.3.1 + diff --git a/SOURCES/kvm.conf b/SOURCES/kvm.conf new file mode 100644 index 0000000..3f7842a --- /dev/null +++ b/SOURCES/kvm.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/pc-slit.cphp b/SOURCES/pc-slit.cphp new file mode 100644 index 0000000..74ec3b4 Binary files /dev/null and b/SOURCES/pc-slit.cphp differ diff --git a/SOURCES/pc-slit.memhp b/SOURCES/pc-slit.memhp new file mode 100644 index 0000000..74ec3b4 Binary files /dev/null and b/SOURCES/pc-slit.memhp differ diff --git a/SOURCES/q35-slit.cphp b/SOURCES/q35-slit.cphp new file mode 100644 index 0000000..74ec3b4 Binary files /dev/null and b/SOURCES/q35-slit.cphp differ diff --git a/SOURCES/q35-slit.memhp b/SOURCES/q35-slit.memhp new file mode 100644 index 0000000..74ec3b4 Binary files /dev/null and b/SOURCES/q35-slit.memhp differ diff --git a/SOURCES/qemu-ga.sysconfig b/SOURCES/qemu-ga.sysconfig new file mode 100644 index 0000000..f54018e --- /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 + +# 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..ab50e75 --- /dev/null +++ b/SOURCES/qemu-guest-agent.service @@ -0,0 +1,21 @@ +[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} +StandardError=syslog +Restart=always +RestartSec=0 + +[Install] +WantedBy=dev-virtio\x2dports-org.qemu.guest_agent.0.device + diff --git a/SOURCES/qemu.binfmt b/SOURCES/qemu.binfmt new file mode 100644 index 0000000..63a58f4 --- /dev/null +++ b/SOURCES/qemu.binfmt @@ -0,0 +1,17 @@ +:qemu-i386:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386: +:qemu-i486:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x06\x00:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-i386: +:qemu-alpha:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x26\x90:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-alpha: +:qemu-arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm: +:qemu-armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb: +:qemu-sparc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x02:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sparc: +:qemu-ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc: +:qemu-m68k:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x04:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-m68k: +:qemu-mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips: +:qemu-mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel: +:qemu-mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32: +:qemu-mipsn32el:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsn32el: +:qemu-mips64:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips64: +:qemu-mips64el:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mips64el: +:qemu-sh4:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a\x00:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-sh4: +:qemu-sh4eb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x2a:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-sh4eb: +:qemu-s390x:M::\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x16:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-s390x: 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..b3875f7 --- /dev/null +++ b/SPECS/qemu-kvm.spec @@ -0,0 +1,6741 @@ +%define rhev 0 + +%global SLOF_gittagdate 20170303 +%global SLOF_gittagcommit 66d250e + +%global have_usbredir 1 +%global have_spice 1 +%global have_fdt 0 +%global have_gluster 1 +%global have_kvm_setup 0 +%global have_seccomp 1 +%global have_memlock_limits 0 +%global have_vxhs 0 +%global have_vtd 0 +%global have_live_block_ops 1 +%global have_vhost_user 1 +%global have_pgste 0 + +%ifarch s390 s390x + %global have_seccomp 0 +%endif + +%ifnarch %{ix86} x86_64 + %global have_usbredir 0 +%endif + +%ifnarch s390 s390x + %global have_librdma 1 + %global have_tcmalloc 1 +%else + %global have_librdma 0 + %global have_tcmalloc 0 +%endif + +%ifarch %{ix86} + %global kvm_target i386 +%endif +%ifarch x86_64 + %global kvm_target x86_64 + %global have_vxhs 1 +%else + %global have_spice 0 + %global have_gluster 0 +%endif +%ifarch %{power64} + %global kvm_target ppc64 + %global have_fdt 1 + %global have_kvm_setup 1 + %global have_memlock_limits 1 +%endif +%ifarch s390x s390 + %global kvm_target s390x + %global have_pgste 1 +%endif +%ifarch ppc + %global kvm_target ppc + %global have_fdt 1 +%endif +%ifarch aarch64 + %global kvm_target aarch64 + %global have_fdt 1 +%endif + +#Versions of various parts: + +%define pkgname qemu-kvm +%define rhel_suffix -rhel +%define rhev_suffix -rhev + +# Setup for RHEL/RHEV package handling +# We need to define tree suffixes: +# - pkgsuffix: used for package name +# - extra_provides_suffix: used for dependency checking of other packages +# - conflicts_suffix: used to prevent installation of both RHEL and RHEV + +%if %{rhev} + %global pkgsuffix %{rhev_suffix} + %global extra_provides_suffix %{nil} + %global conflicts_suffix %{rhel_suffix} + %global obsoletes_version 15:0-0 + %global have_vtd 1 +%else + %global pkgsuffix %{nil} + %global extra_provides_suffix %{rhel_suffix} + %global conflicts_suffix %{rhev_suffix} + %global have_live_block_ops 0 + %global have_vhost_user 0 +%endif +%global pegas_tag .p1 + +# Macro to properly setup RHEL/RHEV conflict handling +%define rhel_rhev_conflicts() \ +Conflicts: %1%{conflicts_suffix} \ +Provides: %1%{extra_provides_suffix} = %{epoch}:%{version}-%{release} \ +%if 0%{?obsoletes_version:1} \ +Obsoletes: %1 < %{obsoletes_version} \ +%endif + +Summary: QEMU is a machine emulator and virtualizer +Name: %{pkgname}%{?pkgsuffix} +Version: 2.9.0 +Release: 23%{?dist} +# Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped +Epoch: 10 +License: GPLv2+ and LGPLv2+ and BSD +Group: Development/Tools +URL: http://www.qemu.org/ +ExclusiveArch: x86_64 %{power64} aarch64 s390x +%ifarch %{ix86} x86_64 +Requires: seabios-bin >= 1.10.2-1 +Requires: sgabios-bin +%endif +%ifnarch aarch64 s390x +Requires: seavgabios-bin >= 1.10.2-1 +Requires: ipxe-roms-qemu >= 20170123-1 +%endif +%ifarch %{power64} +Requires: SLOF >= %{SLOF_gittagdate}-1.git%{SLOF_gittagcommit} +%endif +Requires: %{pkgname}-common%{?pkgsuffix} = %{epoch}:%{version}-%{release} +%if %{have_seccomp} +Requires: libseccomp >= 1.0.0 +%endif +# For compressed guest memory dumps +Requires: lzo snappy +%if %{have_gluster} +Requires: glusterfs-api >= 3.6.0 +%endif +%if %{have_kvm_setup} +Requires(post): systemd-units + %ifarch %{power64} +Requires: powerpc-utils + %endif +%endif +Requires: libusbx >= 1.0.19 +%if %{have_usbredir} +Requires: usbredir >= 0.7.1 +%endif + + +# OOM killer breaks builds with parallel make on s390(x) +%ifarch s390 s390x + %define _smp_mflags %{nil} +%endif + +Source0: http://wiki.qemu.org/download/qemu-2.9.0.tar.xz + +Source1: qemu.binfmt +# Creates /dev/kvm +Source3: 80-kvm.rules +# 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 +Source14: rhel6-virtio.rom +Source15: rhel6-pcnet.rom +Source16: rhel6-rtl8139.rom +Source17: rhel6-ne2k_pci.rom +Source18: bios-256k.bin +Source19: README.rhel6-gpxe-source +Source20: rhel6-e1000.rom +Source21: kvm-setup +Source22: kvm-setup.service +Source23: 85-kvm.preset +Source24: build_configure.sh +Source25: kvm-unit-tests.git-4ea7633.tar.bz2 +Source26: vhost.conf +Source27: kvm.conf +Source28: 95-kvm-memlock.conf +Source29: pxe-e1000e.rom +Source30: pc-slit.cphp +Source31: pc-slit.memhp +Source32: q35-slit.cphp +Source33: q35-slit.memhp +Source34: 50-kvm-pgste.conf + + +Patch0001: 0001-Initial-redhat-build.patch +Patch0002: 0002-Add-RHEL-7-machine-types.patch +Patch0003: 0003-Enable-disable-devices-for-RHEL-7.patch +Patch0004: 0004-Use-kvm-by-default.patch +Patch0005: 0005-add-qxl_screendump-monitor-command.patch +Patch0006: 0006-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch +Patch0007: 0007-monitor-Remove-usb_add-del-commands-for-Red-Hat-Ente.patch +Patch0008: 0008-monitor-Remove-host_net_add-remove-for-Red-Hat-Enter.patch +Patch0009: 0009-vfio-cap-number-of-devices-that-can-be-assigned.patch +Patch0010: 0010-QMP-Forward-port-__com.redhat_drive_del-from-RHEL-6.patch +Patch0011: 0011-QMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch +Patch0012: 0012-HMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch +Patch0013: 0013-Add-support-statement-to-help-output.patch +Patch0014: 0014-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch +Patch0015: 0015-use-recommended-max-vcpu-count.patch +Patch0016: 0016-Add-support-for-simpletrace.patch +Patch0017: 0017-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch +Patch0018: 0018-qmp-add-__com.redhat_reason-to-the-BLOCK_IO_ERROR-ev.patch +Patch0019: 0019-Migration-compat-for-pckbd.patch +Patch0020: 0020-Migration-compat-for-fdc.patch +Patch0021: 0021-RHEL-Set-vcpus-hard-limit-to-240-for-Power.patch +Patch0022: 0022-spapr-Reduce-advertised-max-LUNs-for-spapr_vscsi.patch +Patch0023: 0023-qmp-Report-__com.redhat_drive_add-error-to-monitor.patch +Patch0024: 0024-Add-PCIe-bridge-devices-for-AArch64.patch +Patch0025: 0025-Fix-qemu-kvm-does-not-quit-when-booting-guest-w-241-.patch +Patch0026: 0026-RHEL-only-hw-char-pl011-fix-SBSA-reset.patch +Patch0027: 0027-blockdev-ignore-cache-options-for-empty-CDROM-drives.patch +Patch0028: 0028-Revert-kvm_stat-Remove.patch +Patch0029: 0029-migcompat-e1000e-Work-around-7.3-msi-intr_state-fiel.patch +Patch0030: 0030-migcompat-rtl8139-Work-around-version-bump.patch +Patch0031: 0031-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-2.patch +Patch0032: 0032-x86-Work-around-SMI-breakages.patch +Patch0033: 0033-s390x-virtio-ccw-Disable-crypto-device-in-downstream.patch +Patch0035: 0035-spapr-update-SPAPR_COMPAT_RHEL7_3.patch +Patch0036: 0036-migration-update-HW_COMPAT_RHEL7_3.patch +Patch0038: 0038-x86-bump-maximum-vcpu-count-of-pc-q35-rhel7.4.0-to-3.patch +Patch39: 0039-re-enable-DMA-for-7.3-machine-type.patch +# For bz#1443029 - Disable new devices in qemu 2.9 +Patch40: kvm-Disable-unimplemented-device.patch +# For bz#1443029 - Disable new devices in qemu 2.9 +Patch41: kvm-Disable-serial-isa-for-ppc64.patch +# For bz#1443029 - Disable new devices in qemu 2.9 +Patch42: kvm-Disable-rs6000-mc-device.patch +# For bz#1443029 - Disable new devices in qemu 2.9 +Patch43: kvm-ppc64le-Remove-isabus-bridge-device.patch +# For bz#1432295 - Add gpa2hpa command to qemu hmp +Patch44: kvm-hmp-gpa2hva-and-gpa2hpa-hostaddr-command.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch45: kvm-memory-add-section-range-info-for-IOMMU-notifier.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch46: kvm-memory-provide-IOMMU_NOTIFIER_FOREACH-macro.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch47: kvm-memory-provide-iommu_replay_all.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch48: kvm-memory-introduce-memory_region_notify_one.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch49: kvm-memory-add-MemoryRegionIOMMUOps.replay-callback.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch50: kvm-intel_iommu-use-the-correct-memory-region-for-device.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch51: kvm-intel_iommu-provide-its-own-replay-callback.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch52: kvm-intel_iommu-allow-dynamic-switch-of-IOMMU-region.patch +# For bz#1335808 - [RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present +Patch53: kvm-intel_iommu-enable-remote-IOTLB.patch +# For bz#1435521 - Migration failed with postcopy enabled from rhel7.3.z host to rhel7.4 host "error while loading state for instance 0x0 of device 'pci +Patch54: kvm-virtio-rng-stop-virtqueue-while-the-CPU-is-stopped.patch +# For bz#1440619 - Reboot guest will induce error message - KVM: Failed to create TCE table for liobn 0x80000001 +Patch55: kvm-target-ppc-kvm-make-use-of-KVM_CREATE_SPAPR_TCE_64.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch56: kvm-spapr-Add-ibm-processor-radix-AP-encodings-to-the-de.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch57: kvm-target-ppc-support-KVM_CAP_PPC_MMU_RADIX-KVM_CAP_PPC.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch58: kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch59: kvm-target-ppc-Implement-H_REGISTER_PROCESS_TABLE-H_CALL.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch60: kvm-spapr-move-spapr_populate_pa_features.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch61: kvm-spapr-Enable-ISA-3.0-MMU-mode-selection-via-CAS.patch +# For bz#1368786 - [Pegas1.0 FEAT] POWER9 guest - qemu - base enablement +Patch62: kvm-spapr-Workaround-for-broken-radix-guests.patch +# For bz#1435756 - Backport device/machtype compat settings from v2.8.0..v2.9.0 final +Patch63: kvm-x86-machine-compat-2.9-stragglers.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch64: kvm-block-add-bdrv_set_read_only-helper-function.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch65: kvm-block-do-not-set-BDS-read_only-if-copy_on_read-enabl.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch66: kvm-block-honor-BDRV_O_ALLOW_RDWR-when-clearing-bs-read_.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch67: kvm-block-code-movement.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch68: kvm-block-introduce-bdrv_can_set_read_only.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch69: kvm-block-use-bdrv_can_set_read_only-during-reopen.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch70: kvm-block-rbd-update-variable-names-to-more-apt-names.patch +# For bz#1189998 - Active commit does not support on rbd based disk +Patch71: kvm-block-rbd-Add-support-for-reopen.patch +# For bz#1422846 - Disable replication feature +Patch72: kvm-replication-Make-disable-replication-compile-again.patch +# For bz#1414694 - Reenable edu device for kvm-unit-tests support +Patch73: kvm-Reenable-Educational-device.patch +# For bz#1447874 - Migration failed from rhel7.2.z->rhel7.4 with "-M rhel7.0.0" and "-device nec-usb-xhci" +Patch74: kvm-usb-xhci-Fix-PCI-capability-order.patch +# For bz#1265869 - RFE: Veritas HyperScale VxHS block device support (qemu-kvm-rhev) +Patch75: kvm-block-vxhs.c-Add-support-for-a-new-block-device-type.patch +# For bz#1265869 - RFE: Veritas HyperScale VxHS block device support (qemu-kvm-rhev) +Patch76: kvm-block-vxhs.c-Add-qemu-iotests-for-new-block-device-t.patch +# For bz#1265869 - RFE: Veritas HyperScale VxHS block device support (qemu-kvm-rhev) +Patch77: kvm-qemu-iotests-exclude-vxhs-from-image-creation-via-pr.patch +# For bz#1265869 - RFE: Veritas HyperScale VxHS block device support (qemu-kvm- +Patch78: kvm-block-vxhs-modularize-VXHS-via-g_module.patch +# For bz#1402645 - Required cache.direct=on when set aio=native +Patch79: kvm-blockdev-ignore-aio-native-for-empty-drives.patch +# For bz#1445174 - [RHEV7.4] [guest memory dump]dump-guest-memory QMP command with "detach" param makes qemu-kvm process aborted +Patch80: kvm-dump-Acquire-BQL-around-vm_start-in-dump-thread.patch +# For bz#1446498 - Guest freeze after live snapshot with data-plane +Patch81: kvm-aio-add-missing-aio_notify-to-aio_enable_external.patch +# For bz#1446570 - enable qemu-xhci USB3 controller device model for the aarch64 target +Patch82: kvm-aarch64-Enable-usb-xhci.patch +# For bz#971799 - qemu should not crash when if=scsi although it's unsupportable device +Patch83: kvm-scsi-Disable-deprecated-implicit-SCSI-HBA-creation-m.patch +# For bz#1447551 - qemu hang when do block_resize guest disk during crystal running +Patch84: kvm-block-vhdx-Make-vhdx_create-always-set-errp.patch +# For bz#1447551 - qemu hang when do block_resize guest disk during crystal running +Patch85: kvm-block-Add-errp-to-b-lk-drv-_truncate.patch +# For bz#1447551 - qemu hang when do block_resize guest disk during crystal running +Patch86: kvm-blockdev-use-drained_begin-end-for-qmp_block_resize.patch +# For bz#1449007 - Pegas 1.0: Booting pegas guest on pegas host (POWER9 DD1) panics with signal 4 at userspace entry +Patch87: kvm-spapr-Don-t-accidentally-advertise-HTM-support-on-PO.patch +# For bz#1443289 - [Pegas1.0 04/03 nightly build + 4.10.0-7 kernel] qemu+guest fail to apply POWER9 DD1 workarounds +Patch88: kvm-target-ppc-Allow-workarounds-for-POWER9-DD1.patch +# For bz#1444003 - USB 3.0 flash drive not accessible on Windows guest +Patch89: kvm-xhci-relax-link-check.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch90: kvm-curl-strengthen-assertion-in-curl_clean_state.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch91: kvm-curl-never-invoke-callbacks-with-s-mutex-held.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch92: kvm-curl-avoid-recursive-locking-of-BDRVCURLState-mutex.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch93: kvm-curl-split-curl_find_state-curl_init_state.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch94: kvm-curl-convert-CURLAIOCB-to-byte-values.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch95: kvm-curl-convert-readv-to-coroutines.patch +# For bz#1437393 - snapshot created base on the image in https server will hang during booting +Patch96: kvm-curl-do-not-do-aio_poll-when-waiting-for-a-free-CURL.patch +# For bz#1447581 - [RHEV7.4] [usb-hub] input devices under usb hub don't work on win2016 with xhci +Patch97: kvm-usb-hub-clear-PORT_STAT_SUSPEND-on-wakeup.patch +# For bz#1430620 - TLS encryption migration via exec failed with "TLS handshake failed: The TLS connection was non-properly terminated" +Patch98: kvm-migration-setup-bi-directional-I-O-channel-for-exec-.patch +# For bz#1452066 - Fix backing image referencing in drive-backup sync=none +Patch99: kvm-block-Reuse-bs-as-backing-hd-for-drive-backup-sync-n.patch +# For bz#1449037 - Dst qemu quit when migrate guest with hugepage and total memory is not a multiple of pagesize +Patch100: kvm-migration-Fix-non-multiple-of-page-size-migration.patch +# For bz#1449037 - Dst qemu quit when migrate guest with hugepage and total memory is not a multiple of pagesize +Patch101: kvm-postcopy-Require-RAMBlocks-that-are-whole-pages.patch +# For bz#1447592 - vhost-user/reply-ack: Wait for ack even if no request sent (one-time requests) +Patch102: kvm-hw-virtio-fix-vhost-user-fails-to-startup-when-MQ.patch +# For bz#1451483 - QEMU crashes with "-machine none -device intel-iommu" +Patch103: kvm-iommu-Don-t-crash-if-machine-is-not-PC_MACHINE.patch +# For bz#1452148 - Op blockers don't work after postcopy migration +Patch104: kvm-migration-Call-blk_resume_after_migration-for-postco.patch +# For bz#1452148 - Op blockers don't work after postcopy migration +Patch105: kvm-migration-Unify-block-node-activation-error-handling.patch +# For bz#1452702 - qemu-img aborts on empty filenames +Patch106: kvm-block-An-empty-filename-counts-as-no-filename.patch +# For bz#1452752 - Some block drivers incorrectly close their associated file +Patch107: kvm-block-Do-not-unref-bs-file-on-error-in-BD-s-open.patch +# For bz#1449490 - [q35] guest hang after do migration with virtio-scsi-pci. +Patch108: kvm-e1000e-Fix-ICR-Other-causes-clear-logic.patch +# For bz#1441394 - fw_cfg.dma_enabled value incorrect in pc-i440fx-7.3.0 compat_props +Patch109: kvm-pc-fwcfg-unbreak-migration-from-qemu-2.5-and-qemu-2..patch +# For bz#1441394 - fw_cfg.dma_enabled value incorrect in pc-i440fx-7.3.0 compat_props +Patch110: kvm-disable-linuxboot_dma.bin-option-rom-for-7.3-machine.patch +# For bz#1434706 - [pci-bridge] Hotplug devices to pci-bridge failed +Patch111: kvm-Revert-hw-pci-disable-pci-bridge-s-shpc-by-default.patch +# For bz#1451849 - qemu-img convert crashes on error +Patch112: kvm-qemu-img-wait-for-convert-coroutines-to-complete.patch +# For bz#1449969 - [Pegas1.0] POWER9* cpu model is not listed in /usr/libexec/qemu-kvm -cpu ? +Patch113: kvm-target-ppc-Show-POWER9-in-cpu-help.patch +# For bz#1444326 - Keyboard inputs are buffered when qemu in stop status +Patch114: kvm-input-don-t-queue-delay-if-paused.patch +# For bz#1451191 - qemu-img: block/gluster.c:1307: find_allocation: Assertion `offs >= start' failed. +Patch115: kvm-block-gluster-glfs_lseek-workaround.patch +# For bz#1456456 - qemu crashes on job completion during drain +Patch116: kvm-mirror-Drop-permissions-on-s-target-on-completion.patch +# For bz#1456424 - qemu crash when starting image streaming job fails +Patch117: kvm-stream-fix-crash-in-stream_start-when-block_job_crea.patch +# For bz#1456424 - qemu crash when starting image streaming job fails +Patch118: kvm-qemu-iotests-Test-streaming-with-missing-job-ID.patch +# For bz#1274567 - HMP doesn't reflect the correct numa topology after hot plugging vCPU +Patch119: kvm-monitor-Use-numa_get_node_for_cpu-on-info-numa.patch +# For bz#1452756 - Enable VIRTIO_NET_F_MTU feature in QEMU +Patch120: kvm-virtio_net-Bypass-backends-for-MTU-feature-negotiati.patch +# For bz#1447592 - vhost-user/reply-ack: Wait for ack even if no request sent (one-time requests) +Patch121: kvm-vhost-user-pass-message-as-a-pointer-to-process_mess.patch +# For bz#1458782 - QEMU crashes after hot-unplugging virtio-serial device +Patch122: kvm-virtio-serial-bus-Unset-hotplug-handler-when-unreali.patch +# For bz#1450759 - Creating fallocated image using qemu-img using gfapi fails +Patch123: kvm-gluster-add-support-for-PREALLOC_MODE_FALLOC.patch +# For bz#1395339 - [Intel 7.4 FEAT] Enable configuration of NUMA distance in QEMU +Patch124: kvm-numa-Allow-setting-NUMA-distance-for-different-NUMA-.patch +# For bz#1395339 - [Intel 7.4 FEAT] Enable configuration of NUMA distance in QEMU +Patch125: kvm-tests-acpi-extend-cphp-and-memhp-testcase-with-numa-.patch +# For bz#1418927 - The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM +Patch126: kvm-shutdown-Simplify-shutdown_signal.patch +# For bz#1418927 - The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM +Patch127: kvm-shutdown-Prepare-for-use-of-an-enum-in-reset-shutdow.patch +# For bz#1418927 - The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM +Patch128: kvm-shutdown-Preserve-shutdown-cause-through-replay.patch +# For bz#1418927 - The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM +Patch129: kvm-shutdown-Add-source-information-to-SHUTDOWN-and-RESE.patch +# For bz#1418927 - The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM +Patch130: kvm-shutdown-Expose-bool-cause-in-SHUTDOWN-and-RESET-eve.patch +# For bz#1448813 - qemu crash when shutdown guest with '-device intel-iommu' and '-device vfio-pci' +Patch131: kvm-irqchip-trace-changes-on-msi-add-remove.patch +# For bz#1448813 - qemu crash when shutdown guest with '-device intel-iommu' and '-device vfio-pci' +Patch132: kvm-msix-trace-control-bit-write-op.patch +# For bz#1448813 - qemu crash when shutdown guest with '-device intel-iommu' and '-device vfio-pci' +Patch133: kvm-irqchip-skip-update-msi-when-disabled.patch +# For bz#1451862 - IOMMU support in QEMU for Vhost-user backend +Patch134: kvm-vhost-propagate-errors-in-vhost_device_iotlb_miss.patch +# For bz#1451862 - IOMMU support in QEMU for Vhost-user backend +Patch135: kvm-vhost-rework-IOTLB-messaging.patch +# For bz#1451862 - IOMMU support in QEMU for Vhost-user backend +Patch136: kvm-vhost-user-add-vhost_user-to-hold-the-chr.patch +# For bz#1451862 - IOMMU support in QEMU for Vhost-user backend +Patch137: kvm-vhost-user-add-slave-req-fd-support.patch +# For bz#1451862 - IOMMU support in QEMU for Vhost-user backend +Patch138: kvm-spec-vhost-user-spec-Add-IOMMU-support.patch +# For bz#1454641 - Windows 10 BSOD when using rhel6.4.0/rhel6.5.0/rhel6.6.0 +Patch139: kvm-pc-Use-min-x-level-on-compat_props-on-RHEL-machine-t.patch +# For bz#1452512 - qemu coredump when add more than 12 usb-storage devices to ehci +Patch140: kvm-usb-don-t-wakeup-during-coldplug.patch +# For bz#1449609 - qemu coredump when dd on multiple usb-storage devices concurrently in guest +Patch141: kvm-ehci-fix-overflow-in-frame-timer-code.patch +# For bz#1449609 - qemu coredump when dd on multiple usb-storage devices concurrently in guest +Patch142: kvm-ehci-fix-frame-timer-invocation.patch +# For bz#1451629 - TCP tunnel network: the guest with interface type=client can not start +Patch143: kvm-Revert-Change-net-socket.c-to-use-socket_-functions-.patch +# For bz#1447948 - qemu-nbd segment fault when nmap sweeps its port [rhel-7.4] +Patch144: kvm-nbd-Fully-initialize-client-in-case-of-failed-negoti.patch +# For bz#1447948 - qemu-nbd segment fault when nmap sweeps its port [rhel-7.4] +Patch145: kvm-nbd-Fix-regression-on-resiliency-to-port-scan.patch +# For bz#1454582 - Qemu crashes when start guest with qcow2 nbd image +Patch146: kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch +# For bz#1452048 - qemu abort when hot unplug block device during live commit +Patch147: kvm-commit-Fix-use-after-free-in-completion.patch +# For bz#1452048 - qemu abort when hot unplug block device during live commit +Patch148: kvm-qemu-iotests-Test-automatic-commit-job-cancel-on-hot.patch +# For bz#1453169 - qemu aborts if quit during live commit process +Patch149: kvm-commit-Fix-completion-with-extra-reference.patch +# For bz#1453169 - qemu aborts if quit during live commit process +Patch150: kvm-qemu-iotests-Allow-starting-new-qemu-after-cleanup.patch +# For bz#1453169 - qemu aborts if quit during live commit process +Patch151: kvm-qemu-iotests-Test-exiting-qemu-with-running-job.patch +# For bz#1447257 - QEMU coredump while doing hexdump test onto virtio serial ports +Patch152: kvm-virtio-serial-fix-segfault-on-disconnect.patch +# For bz#1447184 - qemu abort when live snapshot for multiple block device simultaneously with transaction and one is to a non-exist path +Patch153: kvm-block-fix-external-snapshot-abort-permission-error.patch +# For bz#1451631 - Keyboard does not work after migration +Patch154: kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch +# For bz#1449031 - qemu core dump when hot-unplug/hot-plug scsi controller in turns +Patch155: kvm-virtio-scsi-Unset-hotplug-handler-when-unrealize.patch +# For bz#1460010 - USB HID (keyboard and tablet) missing [aarch64] +Patch156: kvm-Enable-USB_CONFIG-for-aarch64.patch +# For bz#1458705 - pvdump: QMP reports "GUEST_PANICKED" event but HMP still shows VM running after guest crashed +Patch157: kvm-pseries-Correct-panic-behaviour-for-pseries-machine-.patch +# For bz#1378816 - Core dump when use "data-plane" and execute change cd +Patch158: kvm-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch +# For bz#1457088 - rbd/iscsi: json: pseudo-protocol format is incompatible with 7.3 +Patch159: kvm-block-rbd-enable-filename-option-and-parsing.patch +# For bz#1457088 - rbd/iscsi: json: pseudo-protocol format is incompatible with 7.3 +Patch160: kvm-block-iscsi-enable-filename-option-and-parsing.patch +# For bz#1461827 - QEMU hangs in aio wait when trying to access NBD volume over TLS +Patch161: kvm-nbd-fix-NBD-over-TLS-bz1461827.patch +# For bz#1457740 - [Tracing] compling qemu-kvm failed through systemtap +Patch162: kvm-monitor-add-handle_hmp_command-trace-event.patch +# For bz#1457740 - [Tracing] compling qemu-kvm failed through systemtap +Patch163: kvm-monitor-resurrect-handle_qmp_command-trace-event.patch +# For bz#1455150 - Unable to detach virtio disk from pcie-root-port after migration +Patch164: kvm-hw-pcie-fix-the-generic-pcie-root-port-to-support-mi.patch +# For bz#1462061 - Backport QEMU ITS migration series +Patch165: kvm-linux-headers-update.patch +# For bz#1462061 - Backport QEMU ITS migration series +Patch166: kvm-all-Pass-an-error-object-to-kvm_device_access.patch +# For bz#1462061 - Backport QEMU ITS migration series +Patch167: kvm-hw-intc-arm_gicv3_its-Implement-state-save-restore.patch +# For bz#1462061 - Backport QEMU ITS migration series +Patch168: kvm-hw-intc-arm_gicv3_kvm-Implement-pending-table-save.patch +# For bz#1462061 - Backport QEMU ITS migration series +Patch169: kvm-hw-intc-arm_gicv3_its-Allow-save-restore.patch +# For bz#1446003 - vnc cannot find a free port to use +Patch170: kvm-sockets-ensure-we-can-bind-to-both-ipv4-ipv6-separat.patch +# For bz#1459170 - SLOF: Can't boot from virtio-scsi disk behind pci-bridge: E3405: No such device +Patch171: kvm-hw-ppc-spapr-Adjust-firmware-name-for-PCI-bridges.patch +# For bz#1465048 - AArch64: Add pci-testdev +Patch172: kvm-AArch64-Add-pci-testdev.patch +# For bz#1456287 - [Pegas1.0 EA2] [qemu-kvm-rhev-2.9] After 'virsh managedsave', domain not starting +Patch173: kvm-spapr-Consolidate-HPT-freeing-code-into-a-routine.patch +# For bz#1456287 - [Pegas1.0 EA2] [qemu-kvm-rhev-2.9] After 'virsh managedsave', domain not starting +Patch174: kvm-spapr-Add-a-no-HPT-encoding-to-HTAB-migration-stream.patch +# For bz#1456287 - [Pegas1.0 EA2] [qemu-kvm-rhev-2.9] After 'virsh managedsave', domain not starting +Patch175: kvm-spapr-Fix-migration-of-Radix-guests.patch +# For bz#1469463 - CVE-2017-10664 qemu-kvm: Qemu: qemu-nbd: server breaks with SIGPIPE upon client abort [rhel-7.4-Alt] +Patch176: kvm-qemu-nbd-Ignore-SIGPIPE.patch +# For bz#1460908 - qemu-kvm: POWER9 CPU model not usable on POWER9 machine +Patch177: kvm-ppc-kvm-have-the-family-CPU-alias-to-point-to-TYPE_H.patch +# For bz#1469000 - Disable virtio-pci devices in qemu-kvm on s390x +Patch178: kvm-Disable-virtio-pci-for-s390x-builds.patch +# For bz#1470558 - [qmp] qemu-kvm process aborted after issuing QMP 'memsave' command on Power9 +Patch179: kvm-target-ppc-Implement-ISA-V3.00-radix-page-fault-hand.patch +# For bz#1470558 - [qmp] qemu-kvm process aborted after issuing QMP 'memsave' command on Power9 +Patch180: kvm-target-ppc-Fix-return-value-in-tcg-radix-mmu-fault-h.patch +# For bz#1470558 - [qmp] qemu-kvm process aborted after issuing QMP 'memsave' command on Power9 +Patch181: kvm-target-ppc-Refactor-tcg-radix-mmu-code.patch +# For bz#1470558 - [qmp] qemu-kvm process aborted after issuing QMP 'memsave' command on Power9 +Patch182: kvm-target-ppc-Add-debug-function-for-radix-mmu-translat.patch +# For bz#1473548 - AArch64: remove 7.3 machine type +Patch183: kvm-AArch64-remove-mach-virt-7.3-machine-type.patch +# For bz#1473638 - CVE-2017-7539 qemu-kvm-rhev: Qemu: qemu-nbd crashes due to undefined I/O coroutine [rhel-alt-7.4] +Patch184: kvm-nbd-strict-nbd_wr_syncv.patch +# For bz#1473638 - CVE-2017-7539 qemu-kvm-rhev: Qemu: qemu-nbd crashes due to undefined I/O coroutine [rhel-alt-7.4] +Patch185: kvm-nbd-read_sync-and-friends-return-0-on-success.patch +# For bz#1473638 - CVE-2017-7539 qemu-kvm-rhev: Qemu: qemu-nbd crashes due to undefined I/O coroutine [rhel-alt-7.4] +Patch186: kvm-nbd-make-nbd_drop-public.patch +# For bz#1473638 - CVE-2017-7539 qemu-kvm-rhev: Qemu: qemu-nbd crashes due to undefined I/O coroutine [rhel-alt-7.4] +Patch187: kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch +# For bz#1470035 - [qmp] Load internal snapshot failed on Power9 +Patch188: kvm-spapr-htab-fix-savevm.patch +# For bz#1475751 - migration/RDMA: backport fixes +Patch189: kvm-migration-rdma-Fix-race-on-source.patch +# For bz#1475751 - migration/RDMA: backport fixes +Patch190: kvm-migration-rdma-fix-qemu_rdma_block_for_wrid-error-pa.patch +# For bz#1475751 - migration/RDMA: backport fixes +Patch191: kvm-migration-rdma-Allow-cancelling-while-waiting-for-wr.patch +# For bz#1475751 - migration/RDMA: backport fixes +Patch192: kvm-migration-rdma-Safely-convert-control-types.patch +# For bz#1475751 - migration/RDMA: backport fixes +Patch193: kvm-migration-rdma-Send-error-during-cancelling.patch +# For bz#1465450 - [Pegas 1.0] qemu-kvm differentiation - vIOMMU +Patch194: kvm-configure-allow-to-disable-VT-d-emulation.patch +# For bz#1418532 - [Pegas 1.0] qemu-kvm differentiation patches for Power9 - block +Patch195: kvm-RHEL-Diff.-Add-option-in-configure-to-disable-live-b.patch +# For bz#1418532 - [Pegas 1.0] qemu-kvm differentiation patches for Power9 - block +Patch196: kvm-RHEL-Diff.-Unregister-live-block-operations.patch +# For bz#1418532 - [Pegas 1.0] qemu-kvm differentiation patches for Power9 - block +Patch197: kvm-RHEL-Diff.-Disable-live-block-operations-in-HMP-moni.patch +# For bz#1473518 - Need to remove (or not?) pseries-rhel7.2.0, pseries-rhel7.3.0 machine types for RHEL-ALT qemu-kvm +Patch198: kvm-Downstream-Update-pseries-machine-types-for-RHEL-ALT.patch +# For bz#1476181 - qemu core dumped after hotplug one cpu core with a negative core id +Patch199: kvm-cpu-don-t-allow-negative-core-id.patch +# For bz#1455269 - [Pegas 1.0] qemu-kvm differentiation patches for Power9 - vhost-user +Patch200: kvm-pegas-add-disable-vhost-user.patch +# For bz#1478822 - The KVM guest SPRs TIDR (144) and PSSCR (823) are currently not migrated right on POWER9 +Patch201: kvm-target-ppc-Implement-TIDR.patch +# For bz#1478822 - The KVM guest SPRs TIDR (144) and PSSCR (823) are currently not migrated right on POWER9 +Patch202: kvm-target-ppc-Add-stub-implementation-of-the-PSSCR.patch +# For bz#1480418 - [guest memory dump] Dump guest's memory to file and GDB fails to process the core file +Patch203: kvm-target-ppc-Fix-size-of-struct-PPCElfPrstatus.patch +# For bz#1491749 - Pegas1.0 - Guest crashes during boot with VF Pass-through and 129GB memory (qemu-kvm) +Patch204: kvm-vfio-spapr-Fix-levels-calculation.patch + +BuildRequires: zlib-devel +BuildRequires: glib2-devel +BuildRequires: which +BuildRequires: gnutls-devel +BuildRequires: cyrus-sasl-devel +BuildRequires: libtool +BuildRequires: libaio-devel +BuildRequires: rsync +BuildRequires: python +BuildRequires: pciutils-devel +BuildRequires: libiscsi-devel +BuildRequires: ncurses-devel +BuildRequires: libattr-devel +BuildRequires: libusbx-devel >= 1.0.19 +%if %{have_usbredir} +BuildRequires: usbredir-devel >= 0.7.1 +%endif +BuildRequires: texinfo +%if %{have_spice} +BuildRequires: spice-protocol >= 0.12.12 +BuildRequires: spice-server-devel >= 0.12.8 +BuildRequires: libcacard-devel +# For smartcard NSS support +BuildRequires: nss-devel +%endif +%if %{have_seccomp} +BuildRequires: libseccomp-devel >= 2.3.0 +%endif +# For network block driver +BuildRequires: libcurl-devel +BuildRequires: libssh2-devel +%ifarch x86_64 +BuildRequires: librados2-devel +BuildRequires: librbd1-devel +%endif +%if %{have_gluster} +# For gluster block driver +BuildRequires: glusterfs-api-devel >= 3.6.0 +BuildRequires: glusterfs-devel +%endif +# We need both because the 'stap' binary is probed for by configure +BuildRequires: systemtap +BuildRequires: systemtap-sdt-devel +# For XFS discard support in raw-posix.c +# For VNC JPEG support +BuildRequires: libjpeg-devel +# For VNC PNG support +BuildRequires: libpng-devel +# For uuid generation +BuildRequires: libuuid-devel +# For BlueZ device support +BuildRequires: bluez-libs-devel +# For Braille device support +BuildRequires: brlapi-devel +# For test suite +BuildRequires: check-devel +# For virtfs +BuildRequires: libcap-devel +# Hard requirement for version >= 1.3 +BuildRequires: pixman-devel +# Documentation requirement +BuildRequires: perl-podlators +BuildRequires: texinfo +# For rdma +%if 0%{?have_librdma} +BuildRequires: rdma-core-devel +%endif +%if 0%{?have_tcmalloc} +BuildRequires: gperftools-devel +%endif +%if %{have_fdt} +BuildRequires: libfdt-devel >= 1.4.3 +%endif +# iasl and cpp for acpi generation (not a hard requirement as we can use +# pre-compiled files, but it's better to use this) +%ifarch %{ix86} x86_64 +BuildRequires: iasl +BuildRequires: cpp +%endif +# For compressed guest memory dumps +BuildRequires: lzo-devel snappy-devel +# For NUMA memory binding +%ifnarch s390x +BuildRequires: numactl-devel +%endif +BuildRequires: libgcrypt-devel + +# For kvm-unit-tests +%ifarch x86_64 +BuildRequires: binutils +BuildRequires: kernel-devel +%endif + +BuildRequires: diffutils + +Requires: qemu-img%{?pkgsuffix} = %{epoch}:%{version}-%{release} + +# RHEV-specific changes: +# We provide special suffix for qemu-kvm so the conflit is easy +# In addition, RHEV version should obsolete all RHEL version in case both +# RHEL and RHEV channels are used +%rhel_rhev_conflicts qemu-kvm + + +%define qemudocdir %{_docdir}/%{pkgname} + +%description +qemu-kvm%{?pkgsuffix} is an open source virtualizer that provides hardware +emulation for the KVM hypervisor. qemu-kvm%{?pkgsuffix} 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 -n qemu-img%{?pkgsuffix} +Summary: QEMU command line tool for manipulating disk images +Group: Development/Tools + +%rhel_rhev_conflicts qemu-img + +%description -n qemu-img%{?pkgsuffix} +This package provides a command line tool for manipulating disk images. + +%package -n qemu-kvm-common%{?pkgsuffix} +Summary: QEMU common files needed by all QEMU targets +Group: Development/Tools +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 + +%rhel_rhev_conflicts qemu-kvm-common + +%description -n qemu-kvm-common%{?pkgsuffix} +qemu-kvm is an open source virtualizer that provides hardware emulation for +the KVM hypervisor. + +This package provides documentation and auxiliary programs used with qemu-kvm. + +%package -n qemu-kvm-tools%{?pkgsuffix} +Summary: KVM debugging and diagnostics tools +Group: Development/Tools + +%rhel_rhev_conflicts qemu-kvm-tools + +%description -n qemu-kvm-tools%{?pkgsuffix} +This package contains some diagnostics and debugging tools for KVM, such as kvm_stat. + +%prep +%setup -q -n qemu-%{version} + +# copy test reference files to allow bios-tables-test pass +# TODO: remove this section on rebase to QEMU-2.10 as +# these files will be included in QEMU source tarball +cp %{SOURCE30} tests/acpi-test-data/pc/SLIT.cphp +cp %{SOURCE31} tests/acpi-test-data/pc/SLIT.memhp +cp %{SOURCE32} tests/acpi-test-data/q35/SLIT.cphp +cp %{SOURCE33} tests/acpi-test-data/q35/SLIT.memhp + +# Copy bios files to allow 'make check' pass +cp %{SOURCE14} pc-bios +cp %{SOURCE15} pc-bios +cp %{SOURCE16} pc-bios +cp %{SOURCE17} pc-bios +cp %{SOURCE18} pc-bios +cp %{SOURCE20} pc-bios +cp %{SOURCE29} pc-bios + +# if patch fuzzy patch applying will be forbidden +%define with_fuzzy_patches 0 +%if %{with_fuzzy_patches} + patch_command='patch -p1 -s' +%else + patch_command='patch -p1 -F1 -s' +%endif + +ApplyPatch() +{ + local patch=$1 + shift + if [ ! -f $RPM_SOURCE_DIR/$patch ]; then + exit 1 + fi + case "$patch" in + *.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; + *.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;; + *) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;; + esac +} + +# don't apply patch if it's empty or does not exist +ApplyOptionalPatch() +{ + local patch=$1 + shift + if [ ! -f $RPM_SOURCE_DIR/$patch ]; then + return 0 + fi + local C=$(wc -l $RPM_SOURCE_DIR/$patch | awk '{print $1}') + if [ "$C" -gt 9 ]; then + ApplyPatch $patch ${1+"$@"} + fi +} + + +%patch0001 -p1 +%patch0002 -p1 +%patch0003 -p1 +%patch0004 -p1 +%patch0005 -p1 +%patch0006 -p1 +%patch0007 -p1 +%patch0008 -p1 +%patch0009 -p1 +%patch0010 -p1 +%patch0011 -p1 +%patch0012 -p1 +%patch0013 -p1 +%patch0014 -p1 +%patch0015 -p1 +%patch0016 -p1 +%patch0017 -p1 +%patch0018 -p1 +%patch0019 -p1 +%patch0020 -p1 +%patch0021 -p1 +%patch0022 -p1 +%patch0023 -p1 +%patch0024 -p1 +%patch0025 -p1 +%patch0026 -p1 +%patch0027 -p1 +%patch0028 -p1 +%patch0029 -p1 +%patch0030 -p1 +%patch0031 -p1 +%patch0032 -p1 +%patch0033 -p1 +%patch0035 -p1 +%patch0036 -p1 +%patch0038 -p1 +%patch39 -p1 +%patch40 -p1 +%patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 +%patch45 -p1 +%patch46 -p1 +%patch47 -p1 +%patch48 -p1 +%patch49 -p1 +%patch50 -p1 +%patch51 -p1 +%patch52 -p1 +%patch53 -p1 +%patch54 -p1 +%patch55 -p1 +%patch56 -p1 +%patch57 -p1 +%patch58 -p1 +%patch59 -p1 +%patch60 -p1 +%patch61 -p1 +%patch62 -p1 +%patch63 -p1 +%patch64 -p1 +%patch65 -p1 +%patch66 -p1 +%patch67 -p1 +%patch68 -p1 +%patch69 -p1 +%patch70 -p1 +%patch71 -p1 +%patch72 -p1 +%patch73 -p1 +%patch74 -p1 +%patch75 -p1 +%patch76 -p1 +%patch77 -p1 +%patch78 -p1 +%patch79 -p1 +%patch80 -p1 +%patch81 -p1 +%patch82 -p1 +%patch83 -p1 +%patch84 -p1 +%patch85 -p1 +%patch86 -p1 +%patch87 -p1 +%patch88 -p1 +%patch89 -p1 +%patch90 -p1 +%patch91 -p1 +%patch92 -p1 +%patch93 -p1 +%patch94 -p1 +%patch95 -p1 +%patch96 -p1 +%patch97 -p1 +%patch98 -p1 +%patch99 -p1 +%patch100 -p1 +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +%patch111 -p1 +%patch112 -p1 +%patch113 -p1 +%patch114 -p1 +%patch115 -p1 +%patch116 -p1 +%patch117 -p1 +%patch118 -p1 +%patch119 -p1 +%patch120 -p1 +%patch121 -p1 +%patch122 -p1 +%patch123 -p1 +%patch124 -p1 +%patch125 -p1 +%patch126 -p1 +%patch127 -p1 +%patch128 -p1 +%patch129 -p1 +%patch130 -p1 +%patch131 -p1 +%patch132 -p1 +%patch133 -p1 +%patch134 -p1 +%patch135 -p1 +%patch136 -p1 +%patch137 -p1 +%patch138 -p1 +%patch139 -p1 +%patch140 -p1 +%patch141 -p1 +%patch142 -p1 +%patch143 -p1 +%patch144 -p1 +%patch145 -p1 +%patch146 -p1 +%patch147 -p1 +%patch148 -p1 +%patch149 -p1 +%patch150 -p1 +%patch151 -p1 +%patch152 -p1 +%patch153 -p1 +%patch154 -p1 +%patch155 -p1 +%patch156 -p1 +%patch157 -p1 +%patch158 -p1 +%patch159 -p1 +%patch160 -p1 +%patch161 -p1 +%patch162 -p1 +%patch163 -p1 +%patch164 -p1 +%patch165 -p1 +%patch166 -p1 +%patch167 -p1 +%patch168 -p1 +%patch169 -p1 +%patch170 -p1 +%patch171 -p1 +%patch172 -p1 +%patch173 -p1 +%patch174 -p1 +%patch175 -p1 +%patch176 -p1 +%patch177 -p1 +%patch178 -p1 +%patch179 -p1 +%patch180 -p1 +%patch181 -p1 +%patch182 -p1 +%patch183 -p1 +%patch184 -p1 +%patch185 -p1 +%patch186 -p1 +%patch187 -p1 +%patch188 -p1 +%patch189 -p1 +%patch190 -p1 +%patch191 -p1 +%patch192 -p1 +%patch193 -p1 +%patch194 -p1 +%patch195 -p1 +%patch196 -p1 +%patch197 -p1 +%patch198 -p1 +%patch199 -p1 +%patch200 -p1 +%patch201 -p1 +%patch202 -p1 +%patch203 -p1 +%patch204 -p1 + +ApplyOptionalPatch qemu-kvm-test.patch + +# for tscdeadline_latency.flat +%ifarch x86_64 + tar -xf %{SOURCE25} +%endif + +%build +buildarch="%{kvm_target}-softmmu" + +# --build-id option is used for giving info to the debug packages. +extraldflags="-Wl,--build-id"; +buildldflags="VL_LDFLAGS=-Wl,--build-id" + +# QEMU already knows how to set _FORTIFY_SOURCE +%global optflags %(echo %{optflags} | sed 's/-Wp,-D_FORTIFY_SOURCE=2//') + +%ifarch s390 + # drop -g flag to prevent memory exhaustion by linker + %global optflags %(echo %{optflags} | sed 's/-g//') + sed -i.debug 's/"-g $CFLAGS"/"$CFLAGS"/g' configure +%endif + +cp %{SOURCE24} build_configure.sh + +./build_configure.sh \ + "%{_prefix}" \ + "%{_libdir}" \ + "%{_sysconfdir}" \ + "%{_localstatedir}" \ + "%{_libexecdir}" \ + "%{qemudocdir}" \ + "%{pkgname}" \ + "%{kvm_target}" \ + "%{name}-%{version}-%{release}" \ + "%{optflags}" \ +%if 0%{have_fdt} + enable \ +%else + disable \ + %endif +%if 0%{have_gluster} + enable \ +%else + disable \ +%endif + disable \ +%ifnarch s390x + enable \ +%else + disable \ +%endif +%ifarch x86_64 + enable \ +%else + disable \ +%endif +%if 0%{have_librdma} + enable \ +%else + disable \ +%endif +%if 0%{have_seccomp} + enable \ +%else + disable \ +%endif +%if 0%{have_spice} + enable \ +%else + disable \ +%endif +%if 0%{have_usbredir} + enable \ +%else + disable \ +%endif +%if 0%{have_tcmalloc} + enable \ +%else + disable \ +%endif +%if 0%{have_vxhs} + enable \ +%else + disable \ +%endif +%if 0%{have_vtd} + enable \ +%else + disable \ +%endif +%if 0%{have_live_block_ops} + enable \ +%else + disable \ +%endif +%if 0%{have_vhost_user} + enable \ +%else + disable \ +%endif + --target-list="$buildarch" + +echo "config-host.mak contents:" +echo "===" +cat config-host.mak +echo "===" + +make V=1 %{?_smp_mflags} $buildldflags + +# Setup back compat qemu-kvm binary +./scripts/tracetool.py --backend dtrace --format stap --group=all \ + --binary %{_libexecdir}/qemu-kvm --target-name %{kvm_target} \ + --target-type system --probe-prefix \ + qemu.kvm trace-events-all > qemu-kvm.stp + +./scripts/tracetool.py --backend dtrace --format simpletrace-stap \ + --group=all --binary %{_libexecdir}/qemu-kvm --target-name %{kvm_target} \ + --target-type system --probe-prefix \ + qemu.kvm trace-events-all > qemu-kvm-simpletrace.stp + +cp -a %{kvm_target}-softmmu/qemu-system-%{kvm_target} qemu-kvm + +gcc %{SOURCE6} -O2 -g -o ksmctl + +# build tscdeadline_latency.flat +%ifarch x86_64 + (cd kvm-unit-tests && ./configure) + make -C kvm-unit-tests +%endif + +%install +%define _udevdir %(pkg-config --variable=udevdir udev)/rules.d + +install -D -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/ksm.service +install -D -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/ksm +install -D -p -m 0755 ksmctl $RPM_BUILD_ROOT%{_libexecdir}/ksmctl + +install -D -p -m 0644 %{SOURCE7} $RPM_BUILD_ROOT%{_unitdir}/ksmtuned.service +install -D -p -m 0755 %{SOURCE8} $RPM_BUILD_ROOT%{_sbindir}/ksmtuned +install -D -p -m 0644 %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/ksmtuned.conf +install -D -p -m 0644 %{SOURCE26} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/vhost.conf +install -D -p -m 0644 %{SOURCE27} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kvm.conf + +mkdir -p $RPM_BUILD_ROOT%{_bindir}/ +mkdir -p $RPM_BUILD_ROOT%{_udevdir} + +install -m 0755 scripts/kvm/kvm_stat $RPM_BUILD_ROOT%{_bindir}/ +mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man1/ +install -m 0644 kvm_stat.1 ${RPM_BUILD_ROOT}%{_mandir}/man1/ +install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT%{_udevdir} + +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{pkgname} +install -m 0644 scripts/dump-guest-memory.py \ + $RPM_BUILD_ROOT%{_datadir}/%{pkgname} +%ifarch x86_64 + install -m 0644 kvm-unit-tests/x86/tscdeadline_latency.flat \ + $RPM_BUILD_ROOT%{_datadir}/%{pkgname} +%endif + +make DESTDIR=$RPM_BUILD_ROOT \ + sharedir="%{_datadir}/%{pkgname}" \ + datadir="%{_datadir}/%{pkgname}" \ + install + +mkdir -p $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset + +# Install compatibility roms +install %{SOURCE14} $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/ +install %{SOURCE15} $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/ +install %{SOURCE16} $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/ +install %{SOURCE17} $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/ +install %{SOURCE20} $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/ + +install -m 0755 qemu-kvm $RPM_BUILD_ROOT%{_libexecdir}/ +install -m 0644 qemu-kvm.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/ +install -m 0644 qemu-kvm-simpletrace.stp $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/ + +rm $RPM_BUILD_ROOT%{_bindir}/qemu-system-%{kvm_target} +rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}.stp +rm $RPM_BUILD_ROOT%{_datadir}/systemtap/tapset/qemu-system-%{kvm_target}-simpletrace.stp + +# Install simpletrace +install -m 0755 scripts/simpletrace.py $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/simpletrace.py +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool +install -m 0644 -t $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool scripts/tracetool/*.py +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool/backend +install -m 0644 -t $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool/backend scripts/tracetool/backend/*.py +mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool/format +install -m 0644 -t $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/tracetool/format scripts/tracetool/format/*.py + +mkdir -p $RPM_BUILD_ROOT%{qemudocdir} +install -p -m 0644 -t ${RPM_BUILD_ROOT}%{qemudocdir} Changelog README README.systemtap COPYING COPYING.LIB LICENSE %{SOURCE19} docs/qmp-spec.txt +chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man1/* +chmod -x ${RPM_BUILD_ROOT}%{_mandir}/man8/* + +install -D -p -m 0644 qemu.sasl $RPM_BUILD_ROOT%{_sysconfdir}/sasl2/%{pkgname}.conf + +# Provided by package openbios +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/openbios-ppc +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/openbios-sparc32 +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/openbios-sparc64 +# Provided by package SLOF +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/slof.bin + +# Remove unpackaged files. +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/palcode-clipper +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/petalogix*.dtb +rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/bamboo.dtb +rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/ppc_rom.bin +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/u-boot.e500 +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/skiboot.lid + +%ifnarch s390x + rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/s390-ccw.img +%endif + +%ifnarch %{power64} + rm -f ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/spapr-rtas.bin +%endif + +%ifnarch x86_64 + rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/acpi-dsdt.aml + rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/kvmvapic.bin + rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/linuxboot.bin + rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/multiboot.bin +%endif + +# Remove sparc files +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/QEMU,tcx.bin +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/QEMU,cgthree.bin + +# Remove ivshmem example programs +rm -rf ${RPM_BUILD_ROOT}%{_bindir}/ivshmem-client +rm -rf ${RPM_BUILD_ROOT}%{_bindir}/ivshmem-server + +# Remove efi roms +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/efi*.rom + +# Provided by package ipxe +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/pxe*rom +# Provided by package vgabios +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/vgabios*bin +# Provided by package seabios +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/bios*.bin +# Provided by package sgabios +rm -rf ${RPM_BUILD_ROOT}%{_datadir}/%{pkgname}/sgabios.bin + +# the pxe gpxe images will be symlinks to the images on +# /usr/share/ipxe, as QEMU doesn't know how to look +# for other paths, yet. +pxe_link() { + ln -s ../ipxe/$2.rom %{buildroot}%{_datadir}/%{pkgname}/pxe-$1.rom +} + +%ifnarch aarch64 s390x +pxe_link e1000 8086100e +pxe_link ne2k_pci 10ec8029 +pxe_link pcnet 10222000 +pxe_link rtl8139 10ec8139 +pxe_link virtio 1af41000 +pxe_link e1000e 808610d3 +%endif + +rom_link() { + ln -s $1 %{buildroot}%{_datadir}/%{pkgname}/$2 +} + +%ifnarch aarch64 s390x + rom_link ../seavgabios/vgabios-isavga.bin vgabios.bin + rom_link ../seavgabios/vgabios-cirrus.bin vgabios-cirrus.bin + rom_link ../seavgabios/vgabios-qxl.bin vgabios-qxl.bin + rom_link ../seavgabios/vgabios-stdvga.bin vgabios-stdvga.bin + rom_link ../seavgabios/vgabios-vmware.bin vgabios-vmware.bin + rom_link ../seavgabios/vgabios-virtio.bin vgabios-virtio.bin +%endif +%ifarch x86_64 + rom_link ../seabios/bios.bin bios.bin + rom_link ../seabios/bios-256k.bin bios-256k.bin + rom_link ../sgabios/sgabios.bin sgabios.bin +%endif + +%if 0%{have_kvm_setup} + install -D -p -m 755 %{SOURCE21} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/kvm-setup + install -D -p -m 644 %{SOURCE22} $RPM_BUILD_ROOT%{_unitdir}/kvm-setup.service + install -D -p -m 644 %{SOURCE23} $RPM_BUILD_ROOT%{_presetdir}/85-kvm.preset +%endif + +%if 0%{have_memlock_limits} + install -D -p -m 644 %{SOURCE28} $RPM_BUILD_ROOT%{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif + +%if 0%{have_pgste} + install -D -p -m 644 %{SOURCE34} $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/50-kvm-pgste.conf +%endif + +# Install rules to use the bridge helper with libvirt's virbr0 +install -D -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_sysconfdir}/%{pkgname}/bridge.conf + +%if 0 +make %{?_smp_mflags} $buildldflags DESTDIR=$RPM_BUILD_ROOT install-libcacard + +find $RPM_BUILD_ROOT -name "libcacard.so*" -exec chmod +x \{\} \; +%endif + +find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f + +%check +export DIFF=diff; make check V=1 + +%post +# load kvm modules now, so we can make sure no reboot is needed. +# If there's already a kvm module installed, we don't mess with it +%udev_rules_update +sh %{_sysconfdir}/sysconfig/modules/kvm.modules &> /dev/null || : + udevadm trigger --subsystem-match=misc --sysname-match=kvm --action=add || : +%if %{have_kvm_setup} + systemctl daemon-reload # Make sure it sees the new presets and unitfile + %systemd_post kvm-setup.service + if systemctl is-enabled kvm-setup.service > /dev/null; then + systemctl start kvm-setup.service + fi +%endif + +# enable pgste now, so no reboot is needed. +%if 0%{have_pgste} + %sysctl_apply 50-kvm-pgste.conf +%endif + +%post -n qemu-kvm-common%{?pkgsuffix} +%systemd_post ksm.service +%systemd_post ksmtuned.service + +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 + +%preun -n qemu-kvm-common%{?pkgsuffix} +%systemd_preun ksm.service +%systemd_preun ksmtuned.service + +%postun -n qemu-kvm-common%{?pkgsuffix} +%systemd_postun_with_restart ksm.service +%systemd_postun_with_restart ksmtuned.service + +%global kvm_files \ +%{_udevdir}/80-kvm.rules + +%global qemu_kvm_files \ +%{_libexecdir}/qemu-kvm \ +%{_datadir}/systemtap/tapset/qemu-kvm.stp \ +%{_datadir}/%{pkgname}/trace-events-all \ +%{_datadir}/systemtap/tapset/qemu-kvm-simpletrace.stp \ +%{_datadir}/%{pkgname}/systemtap/script.d/qemu_kvm.stp \ +%{_datadir}/%{pkgname}/systemtap/conf.d/qemu_kvm.conf + +%files -n qemu-kvm-common%{?pkgsuffix} +%defattr(-,root,root) +%dir %{qemudocdir} +%doc %{qemudocdir}/Changelog +%doc %{qemudocdir}/README +%doc %{qemudocdir}/qemu-doc.html +%doc %{qemudocdir}/COPYING +%doc %{qemudocdir}/COPYING.LIB +%doc %{qemudocdir}/LICENSE +%doc %{qemudocdir}/README.rhel6-gpxe-source +%doc %{qemudocdir}/README.systemtap +%doc %{qemudocdir}/qmp-spec.txt +%doc %{qemudocdir}/qemu-doc.txt +%doc %{qemudocdir}/qemu-qmp-ref.html +%doc %{qemudocdir}/qemu-qmp-ref.txt +%{_mandir}/man7/qemu-qmp-ref.7* + +%dir %{_datadir}/%{pkgname}/ +%{_datadir}/%{pkgname}/keymaps/ +%{_mandir}/man1/%{pkgname}.1* +%attr(4755, -, -) %{_libexecdir}/qemu-bridge-helper +%config(noreplace) %{_sysconfdir}/sasl2/%{pkgname}.conf +%{_unitdir}/ksm.service +%{_libexecdir}/ksmctl +%config(noreplace) %{_sysconfdir}/sysconfig/ksm +%{_unitdir}/ksmtuned.service +%{_sbindir}/ksmtuned +%config(noreplace) %{_sysconfdir}/ksmtuned.conf +%dir %{_sysconfdir}/%{pkgname} +%config(noreplace) %{_sysconfdir}/%{pkgname}/bridge.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/vhost.conf +%config(noreplace) %{_sysconfdir}/modprobe.d/kvm.conf +%{_datadir}/%{pkgname}/simpletrace.py* +%{_datadir}/%{pkgname}/tracetool/*.py* +%{_datadir}/%{pkgname}/tracetool/backend/*.py* +%{_datadir}/%{pkgname}/tracetool/format/*.py* + +%files +%defattr(-,root,root) +%ifarch x86_64 + %{_datadir}/%{pkgname}/acpi-dsdt.aml + %{_datadir}/%{pkgname}/bios.bin + %{_datadir}/%{pkgname}/bios-256k.bin + %{_datadir}/%{pkgname}/linuxboot.bin + %{_datadir}/%{pkgname}/multiboot.bin + %{_datadir}/%{pkgname}/kvmvapic.bin + %{_datadir}/%{pkgname}/sgabios.bin +%endif +%ifarch s390x + %{_datadir}/%{pkgname}/s390-ccw.img +%endif +%ifnarch aarch64 s390x + %{_datadir}/%{pkgname}/vgabios.bin + %{_datadir}/%{pkgname}/vgabios-cirrus.bin + %{_datadir}/%{pkgname}/vgabios-qxl.bin + %{_datadir}/%{pkgname}/vgabios-stdvga.bin + %{_datadir}/%{pkgname}/vgabios-vmware.bin + %{_datadir}/%{pkgname}/vgabios-virtio.bin + %{_datadir}/%{pkgname}/pxe-e1000.rom + %{_datadir}/%{pkgname}/pxe-e1000e.rom + %{_datadir}/%{pkgname}/pxe-virtio.rom + %{_datadir}/%{pkgname}/pxe-pcnet.rom + %{_datadir}/%{pkgname}/pxe-rtl8139.rom + %{_datadir}/%{pkgname}/pxe-ne2k_pci.rom +%endif +%{_datadir}/%{pkgname}/qemu-icon.bmp +%{_datadir}/%{pkgname}/qemu_logo_no_text.svg +%{_datadir}/%{pkgname}/rhel6-virtio.rom +%{_datadir}/%{pkgname}/rhel6-pcnet.rom +%{_datadir}/%{pkgname}/rhel6-rtl8139.rom +%{_datadir}/%{pkgname}/rhel6-ne2k_pci.rom +%{_datadir}/%{pkgname}/rhel6-e1000.rom +%{_datadir}/%{pkgname}/linuxboot_dma.bin +%{_datadir}/%{pkgname}/dump-guest-memory.py* +%ifarch %{power64} + %{_datadir}/%{pkgname}/spapr-rtas.bin +%endif +%{?kvm_files:} +%{?qemu_kvm_files:} +%if 0%{have_kvm_setup} + %{_prefix}/lib/systemd/kvm-setup + %{_unitdir}/kvm-setup.service + %{_presetdir}/85-kvm.preset +%endif +%if 0%{have_memlock_limits} + %{_sysconfdir}/security/limits.d/95-kvm-memlock.conf +%endif +%if 0%{have_pgste} + %{_sysconfdir}/sysctl.d/50-kvm-pgste.conf +%endif + +%files -n qemu-kvm-tools%{?pkgsuffix} +%defattr(-,root,root,-) +%{_bindir}/kvm_stat +%{_mandir}/man1/kvm_stat.1* +%ifarch x86_64 +%{_datadir}/%{pkgname}/tscdeadline_latency.flat +%endif + +%files -n qemu-img%{?pkgsuffix} +%defattr(-,root,root) +%{_bindir}/qemu-img +%{_bindir}/qemu-io +%{_bindir}/qemu-nbd +%{_mandir}/man1/qemu-img.1* +%{_mandir}/man8/qemu-nbd.8* + +%if 0 +%files -n libcacard%{?pkgsuffix} +%defattr(-,root,root,-) +%{_libdir}/libcacard.so.* + +%files -n libcacard-tools%{?pkgsuffix} +%defattr(-,root,root,-) +%{_bindir}/vscclient + +%files -n libcacard-devel%{?pkgsuffix} +%defattr(-,root,root,-) +%{_includedir}/cacard +%{_libdir}/libcacard.so +%{_libdir}/pkgconfig/libcacard.pc +%endif + +%changelog +* Thu Sep 21 2017 Danilo Cesar Lemes de Paula - +- kvm-vfio-spapr-Fix-levels-calculation.patch [bz#1491749] +- Resolves: bz#1491749 + (Pegas1.0 - Guest crashes during boot with VF Pass-through and 129GB memory (qemu-kvm)) + +* Tue Aug 29 2017 Miroslav Rezanina - 2.9.0-22.el7a +- kvm-qemu-kvm.spec-Configure-vm.allocate_pgste-for-s390x.patch [bz#1454281] +- Resolves: bz#1454281 + (Enable vm.allocate_pgste sysctl before running qemu-kvm on s390x) + +* Tue Aug 15 2017 Miroslav Rezanina - 2.9.0-21.el7a +- kvm-target-ppc-Implement-TIDR.patch [bz#1478822] +- kvm-target-ppc-Add-stub-implementation-of-the-PSSCR.patch [bz#1478822] +- kvm-target-ppc-Fix-size-of-struct-PPCElfPrstatus.patch [bz#1480418] +- Resolves: bz#1478822 + (The KVM guest SPRs TIDR (144) and PSSCR (823) are currently not migrated right on POWER9) +- Resolves: bz#1480418 + ([guest memory dump] Dump guest's memory to file and GDB fails to process the core file) + +* Tue Aug 08 2017 Miroslav Rezanina - 2.9.0-20.el7a +- kvm-Downstream-Update-pseries-machine-types-for-RHEL-ALT.patch [bz#1473518] +- kvm-cpu-don-t-allow-negative-core-id.patch [bz#1476181] +- kvm-pegas-add-disable-vhost-user.patch [bz#1455269] +- kvm-pegas-add-rpm-spec-options-for-vhost-user.patch [bz#1455269] +- Resolves: bz#1455269 + ([Pegas 1.0] qemu-kvm differentiation patches for Power9 - vhost-user) +- Resolves: bz#1473518 + (Need to remove (or not?) pseries-rhel7.2.0, pseries-rhel7.3.0 machine types for RHEL-ALT qemu-kvm) +- Resolves: bz#1476181 + (qemu core dumped after hotplug one cpu core with a negative core id) + +* Tue Aug 01 2017 Miroslav Rezanina - 2.9.0-19.el7a +- kvm-AArch64-remove-mach-virt-7.3-machine-type.patch [bz#1473548] +- kvm-nbd-strict-nbd_wr_syncv.patch [bz#1473638] +- kvm-nbd-read_sync-and-friends-return-0-on-success.patch [bz#1473638] +- kvm-nbd-make-nbd_drop-public.patch [bz#1473638] +- kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch [bz#1473638] +- kvm-spapr-htab-fix-savevm.patch [bz#1470035] +- kvm-migration-rdma-Fix-race-on-source.patch [bz#1475751] +- kvm-migration-rdma-fix-qemu_rdma_block_for_wrid-error-pa.patch [bz#1475751] +- kvm-migration-rdma-Allow-cancelling-while-waiting-for-wr.patch [bz#1475751] +- kvm-migration-rdma-Safely-convert-control-types.patch [bz#1475751] +- kvm-migration-rdma-Send-error-during-cancelling.patch [bz#1475751] +- kvm-configure-allow-to-disable-VT-d-emulation.patch [bz#1465450] +- kvm-Disable-VT-d-for-rhel-builds.patch [bz#1465450] +- kvm-RHEL-Diff.-Add-option-in-configure-to-disable-live-b.patch [bz#1418532] +- kvm-RHEL-Diff.-Unregister-live-block-operations.patch [bz#1418532] +- kvm-RHEL-Diff.-Disable-live-block-operations-in-HMP-moni.patch [bz#1418532] +- kvm-RHEL-Diff.-Add-rpm-spec-options-for-live-block-ops.patch [bz#1418532] +- Resolves: bz#1418532 + ([Pegas 1.0] qemu-kvm differentiation patches for Power9 - block) +- Resolves: bz#1465450 + ([Pegas 1.0] qemu-kvm differentiation - vIOMMU) +- Resolves: bz#1470035 + ([qmp] Load internal snapshot failed on Power9) +- Resolves: bz#1473548 + (AArch64: remove 7.3 machine type) +- Resolves: bz#1473638 + (CVE-2017-7539 qemu-kvm-rhev: Qemu: qemu-nbd crashes due to undefined I/O coroutine [rhel-alt-7.4]) +- Resolves: bz#1475751 + (migration/RDMA: backport fixes) + +* Tue Jul 18 2017 Miroslav Rezanina - 2.9.0-18.el7a +- kvm-ppc-kvm-have-the-family-CPU-alias-to-point-to-TYPE_H.patch [bz#1460908] +- kvm-Disable-virtio-pci-for-s390x-builds.patch [bz#1469000] +- kvm-target-ppc-Implement-ISA-V3.00-radix-page-fault-hand.patch [bz#1470558] +- kvm-target-ppc-Fix-return-value-in-tcg-radix-mmu-fault-h.patch [bz#1470558] +- kvm-target-ppc-Refactor-tcg-radix-mmu-code.patch [bz#1470558] +- kvm-target-ppc-Add-debug-function-for-radix-mmu-translat.patch [bz#1470558] +- Resolves: bz#1460908 + (qemu-kvm: POWER9 CPU model not usable on POWER9 machine) +- Resolves: bz#1469000 + (Disable virtio-pci devices in qemu-kvm on s390x) +- Resolves: bz#1470558 + ([qmp] qemu-kvm process aborted after issuing QMP 'memsave' command on Power9) + +* Tue Jul 11 2017 Miroslav Rezanina - 2.9.0-17.el7a +- kvm-spapr-Consolidate-HPT-freeing-code-into-a-routine.patch [bz#1456287] +- kvm-spapr-Add-a-no-HPT-encoding-to-HTAB-migration-stream.patch [bz#1456287] +- kvm-spapr-Fix-migration-of-Radix-guests.patch [bz#1456287] +- kvm-qemu-nbd-Ignore-SIGPIPE.patch [bz#1469463] +- Resolves: bz#1456287 + ([Pegas1.0 EA2] [qemu-kvm-rhev-2.9] After 'virsh managedsave', domain not starting) +- Resolves: bz#1469463 + (CVE-2017-10664 qemu-kvm: Qemu: qemu-nbd: server breaks with SIGPIPE upon client abort [rhel-7.4-Alt]) + +* Tue Jul 04 2017 Miroslav Rezanina - 2.9.0-16.el7a +- kvm-AArch64-Add-pci-testdev.patch [bz#1465048] +- Resolves: bz#1465048 + (AArch64: Add pci-testdev) + +* Tue Jun 27 2017 Miroslav Rezanina - 2.9.0-15.el7a +- kvm-hw-ppc-spapr-Adjust-firmware-name-for-PCI-bridges.patch [bz#1459170] +- Resolves: bz#1459170 + (SLOF: Can't boot from virtio-scsi disk behind pci-bridge: E3405: No such device) + +* Fri Jun 23 2017 Miroslav Rezanina - 2.9.0-14.el7a +- kvm-sockets-ensure-we-can-bind-to-both-ipv4-ipv6-separat.patch [bz#1446003] +- Resolves: bz#1446003 + (vnc cannot find a free port to use) + +* Tue Jun 20 2017 Miroslav Rezanina - 2.9.0-13.el7 +- kvm-linux-headers-update.patch [bz#1462061] +- kvm-all-Pass-an-error-object-to-kvm_device_access.patch [bz#1462061] +- kvm-hw-intc-arm_gicv3_its-Implement-state-save-restore.patch [bz#1462061] +- kvm-hw-intc-arm_gicv3_kvm-Implement-pending-table-save.patch [bz#1462061] +- kvm-hw-intc-arm_gicv3_its-Allow-save-restore.patch [bz#1462061] +- Resolves: bz#1462061 + (Backport QEMU ITS migration series) + +* Tue Jun 20 2017 Miroslav Rezanina - 2.9.0-12.el7 +- kvm-pseries-Correct-panic-behaviour-for-pseries-machine-.patch [bz#1458705] +- kvm-virtio-scsi-Reject-scsi-cd-if-data-plane-enabled-RHE.patch [bz#1378816] +- kvm-block-rbd-enable-filename-option-and-parsing.patch [bz#1457088] +- kvm-block-iscsi-enable-filename-option-and-parsing.patch [bz#1457088] +- kvm-nbd-fix-NBD-over-TLS-bz1461827.patch [bz#1461827] +- kvm-monitor-add-handle_hmp_command-trace-event.patch [bz#1457740] +- kvm-monitor-resurrect-handle_qmp_command-trace-event.patch [bz#1457740] +- kvm-hw-pcie-fix-the-generic-pcie-root-port-to-support-mi.patch [bz#1455150] +- Resolves: bz#1378816 + (Core dump when use "data-plane" and execute change cd) +- Resolves: bz#1455150 + (Unable to detach virtio disk from pcie-root-port after migration) +- Resolves: bz#1457088 + (rbd/iscsi: json: pseudo-protocol format is incompatible with 7.3) +- Resolves: bz#1457740 + ([Tracing] compling qemu-kvm failed through systemtap) +- Resolves: bz#1458705 + (pvdump: QMP reports "GUEST_PANICKED" event but HMP still shows VM running after guest crashed) +- Resolves: bz#1461827 + (QEMU hangs in aio wait when trying to access NBD volume over TLS) + +* Fri Jun 16 2017 Miroslav Rezanina - 2.9.0-11.el7 +- kvm-Enable-USB_CONFIG-for-aarch64.patch [bz#1460010] +- Resolves: bz#1460010 + (USB HID (keyboard and tablet) missing [aarch64]) + +* Tue Jun 13 2017 Miroslav Rezanina - rhev-2.9.0-10.el7 +- kvm-Revert-Change-net-socket.c-to-use-socket_-functions-.patch [bz#1451629] +- kvm-nbd-Fully-initialize-client-in-case-of-failed-negoti.patch [bz#1447948] +- kvm-nbd-Fix-regression-on-resiliency-to-port-scan.patch [bz#1447948] +- kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch [bz#1454582] +- kvm-commit-Fix-use-after-free-in-completion.patch [bz#1452048] +- kvm-qemu-iotests-Test-automatic-commit-job-cancel-on-hot.patch [bz#1452048] +- kvm-commit-Fix-completion-with-extra-reference.patch [bz#1453169] +- kvm-qemu-iotests-Allow-starting-new-qemu-after-cleanup.patch [bz#1453169] +- kvm-qemu-iotests-Test-exiting-qemu-with-running-job.patch [bz#1453169] +- kvm-virtio-serial-fix-segfault-on-disconnect.patch [bz#1447257] +- kvm-block-fix-external-snapshot-abort-permission-error.patch [bz#1447184] +- kvm-xhci-only-update-dequeue-ptr-on-completed-transfers.patch [bz#1451631] +- kvm-virtio-scsi-Unset-hotplug-handler-when-unrealize.patch [bz#1449031] +- Resolves: bz#1447184 + (qemu abort when live snapshot for multiple block device simultaneously with transaction and one is to a non-exist path) +- Resolves: bz#1447257 + (QEMU coredump while doing hexdump test onto virtio serial ports) +- Resolves: bz#1447948 + (qemu-nbd segment fault when nmap sweeps its port [rhel-7.4]) +- Resolves: bz#1449031 + (qemu core dump when hot-unplug/hot-plug scsi controller in turns) +- Resolves: bz#1451629 + (TCP tunnel network: the guest with interface type=client can not start) +- Resolves: bz#1451631 + (Keyboard does not work after migration) +- Resolves: bz#1452048 + (qemu abort when hot unplug block device during live commit) +- Resolves: bz#1453169 + (qemu aborts if quit during live commit process) +- Resolves: bz#1454582 + (Qemu crashes when start guest with qcow2 nbd image) + +* Thu Jun 08 2017 Miroslav Rezanina - rhev-2.9.0-9.el7 +- kvm-shutdown-Simplify-shutdown_signal.patch [bz#1418927] +- kvm-shutdown-Prepare-for-use-of-an-enum-in-reset-shutdow.patch [bz#1418927] +- kvm-shutdown-Preserve-shutdown-cause-through-replay.patch [bz#1418927] +- kvm-shutdown-Add-source-information-to-SHUTDOWN-and-RESE.patch [bz#1418927] +- kvm-shutdown-Expose-bool-cause-in-SHUTDOWN-and-RESET-eve.patch [bz#1418927] +- kvm-irqchip-trace-changes-on-msi-add-remove.patch [bz#1448813] +- kvm-msix-trace-control-bit-write-op.patch [bz#1448813] +- kvm-irqchip-skip-update-msi-when-disabled.patch [bz#1448813] +- kvm-vhost-propagate-errors-in-vhost_device_iotlb_miss.patch [bz#1451862] +- kvm-vhost-rework-IOTLB-messaging.patch [bz#1451862] +- kvm-vhost-user-add-vhost_user-to-hold-the-chr.patch [bz#1451862] +- kvm-vhost-user-add-slave-req-fd-support.patch [bz#1451862] +- kvm-spec-vhost-user-spec-Add-IOMMU-support.patch [bz#1451862] +- kvm-pc-Use-min-x-level-on-compat_props-on-RHEL-machine-t.patch [bz#1454641] +- kvm-usb-don-t-wakeup-during-coldplug.patch [bz#1452512] +- kvm-ehci-fix-overflow-in-frame-timer-code.patch [bz#1449609] +- kvm-ehci-fix-frame-timer-invocation.patch [bz#1449609] +- Resolves: bz#1418927 + (The lifecycle event for Guest OS Shutdown is not distinguishable from a qemu process that was quit with SIG_TERM) +- Resolves: bz#1448813 + (qemu crash when shutdown guest with '-device intel-iommu' and '-device vfio-pci') +- Resolves: bz#1449609 + (qemu coredump when dd on multiple usb-storage devices concurrently in guest) +- Resolves: bz#1451862 + (IOMMU support in QEMU for Vhost-user backend) +- Resolves: bz#1452512 + (qemu coredump when add more than 12 usb-storage devices to ehci) +- Resolves: bz#1454641 + (Windows 10 BSOD when using rhel6.4.0/rhel6.5.0/rhel6.6.0) + +* Tue Jun 06 2017 Miroslav Rezanina - rhev-2.9.0-8.el7 +- kvm-input-don-t-queue-delay-if-paused.patch [bz#1444326] +- kvm-block-gluster-glfs_lseek-workaround.patch [bz#1451191] +- kvm-mirror-Drop-permissions-on-s-target-on-completion.patch [bz#1456456] +- kvm-stream-fix-crash-in-stream_start-when-block_job_crea.patch [bz#1456424] +- kvm-qemu-iotests-Test-streaming-with-missing-job-ID.patch [bz#1456424] +- kvm-monitor-Use-numa_get_node_for_cpu-on-info-numa.patch [bz#1274567] +- kvm-virtio_net-Bypass-backends-for-MTU-feature-negotiati.patch [bz#1452756] +- kvm-vhost-user-pass-message-as-a-pointer-to-process_mess.patch [bz#1447592] +- kvm-virtio-serial-bus-Unset-hotplug-handler-when-unreali.patch [bz#1458782] +- kvm-gluster-add-support-for-PREALLOC_MODE_FALLOC.patch [bz#1450759] +- kvm-numa-Allow-setting-NUMA-distance-for-different-NUMA-.patch [bz#1395339] +- kvm-tests-acpi-extend-cphp-and-memhp-testcase-with-numa-.patch [bz#1395339] +- kvm-copy-SLIT-test-reference-blobs-into-tests-directory.patch [bz#1395339] +- Resolves: bz#1274567 + (HMP doesn't reflect the correct numa topology after hot plugging vCPU) +- Resolves: bz#1395339 + ([Intel 7.4 FEAT] Enable configuration of NUMA distance in QEMU) +- Resolves: bz#1444326 + (Keyboard inputs are buffered when qemu in stop status) +- Resolves: bz#1447592 + (vhost-user/reply-ack: Wait for ack even if no request sent (one-time requests)) +- Resolves: bz#1450759 + (Creating fallocated image using qemu-img using gfapi fails) +- Resolves: bz#1451191 + (qemu-img: block/gluster.c:1307: find_allocation: Assertion `offs >= start' failed.) +- Resolves: bz#1452756 + (Enable VIRTIO_NET_F_MTU feature in QEMU) +- Resolves: bz#1456424 + (qemu crash when starting image streaming job fails) +- Resolves: bz#1456456 + (qemu crashes on job completion during drain) +- Resolves: bz#1458782 + (QEMU crashes after hot-unplugging virtio-serial device) + +* Tue May 30 2017 Miroslav Rezanina - rhev-2.9.0-7.el7 +- kvm-e1000e-Fix-ICR-Other-causes-clear-logic.patch [bz#1449490] +- kvm-pc-fwcfg-unbreak-migration-from-qemu-2.5-and-qemu-2..patch [bz#1441394] +- kvm-disable-linuxboot_dma.bin-option-rom-for-7.3-machine.patch [bz#1441394] +- kvm-Revert-hw-pci-disable-pci-bridge-s-shpc-by-default.patch [bz#1434706] +- kvm-qemu-img-wait-for-convert-coroutines-to-complete.patch [bz#1451849] +- kvm-target-ppc-Show-POWER9-in-cpu-help.patch [bz#1449969] +- Resolves: bz#1434706 + ([pci-bridge] Hotplug devices to pci-bridge failed) +- Resolves: bz#1441394 + (fw_cfg.dma_enabled value incorrect in pc-i440fx-7.3.0 compat_props) +- Resolves: bz#1449490 + ([q35] guest hang after do migration with virtio-scsi-pci.) +- Resolves: bz#1449969 + ([Pegas1.0] POWER9* cpu model is not listed in /usr/libexec/qemu-kvm -cpu ?) +- Resolves: bz#1451849 + (qemu-img convert crashes on error) + +* Tue May 23 2017 Miroslav Rezanina - rhev-2.9.0-6.el7 +- kvm-aarch64-Enable-usb-xhci.patch [bz#1446570] +- kvm-scsi-Disable-deprecated-implicit-SCSI-HBA-creation-m.patch [bz#971799] +- kvm-block-vhdx-Make-vhdx_create-always-set-errp.patch [bz#1447551] +- kvm-block-Add-errp-to-b-lk-drv-_truncate.patch [bz#1447551] +- kvm-blockdev-use-drained_begin-end-for-qmp_block_resize.patch [bz#1447551] +- kvm-spapr-Don-t-accidentally-advertise-HTM-support-on-PO.patch [bz#1449007] +- kvm-target-ppc-Allow-workarounds-for-POWER9-DD1.patch [bz#1443289] +- kvm-xhci-relax-link-check.patch [bz#1444003] +- kvm-curl-strengthen-assertion-in-curl_clean_state.patch [bz#1437393] +- kvm-curl-never-invoke-callbacks-with-s-mutex-held.patch [bz#1437393] +- kvm-curl-avoid-recursive-locking-of-BDRVCURLState-mutex.patch [bz#1437393] +- kvm-curl-split-curl_find_state-curl_init_state.patch [bz#1437393] +- kvm-curl-convert-CURLAIOCB-to-byte-values.patch [bz#1437393] +- kvm-curl-convert-readv-to-coroutines.patch [bz#1437393] +- kvm-curl-do-not-do-aio_poll-when-waiting-for-a-free-CURL.patch [bz#1437393] +- kvm-usb-hub-clear-PORT_STAT_SUSPEND-on-wakeup.patch [bz#1447581] +- kvm-migration-setup-bi-directional-I-O-channel-for-exec-.patch [bz#1430620] +- kvm-block-Reuse-bs-as-backing-hd-for-drive-backup-sync-n.patch [bz#1452066] +- kvm-migration-Fix-non-multiple-of-page-size-migration.patch [bz#1449037] +- kvm-postcopy-Require-RAMBlocks-that-are-whole-pages.patch [bz#1449037] +- kvm-hw-virtio-fix-vhost-user-fails-to-startup-when-MQ.patch [bz#1447592] +- kvm-iommu-Don-t-crash-if-machine-is-not-PC_MACHINE.patch [bz#1451483] +- kvm-migration-Call-blk_resume_after_migration-for-postco.patch [bz#1452148] +- kvm-migration-Unify-block-node-activation-error-handling.patch [bz#1452148] +- kvm-disable-pulseaudio-and-alsa.patch [bz#1452605] +- kvm-block-An-empty-filename-counts-as-no-filename.patch [bz#1452702] +- kvm-block-Do-not-unref-bs-file-on-error-in-BD-s-open.patch [bz#1452752] +- Resolves: bz#1430620 + (TLS encryption migration via exec failed with "TLS handshake failed: The TLS connection was non-properly terminated") +- Resolves: bz#1437393 + (snapshot created base on the image in https server will hang during booting) +- Resolves: bz#1443289 + ([Pegas1.0 04/03 nightly build + 4.10.0-7 kernel] qemu+guest fail to apply POWER9 DD1 workarounds) +- Resolves: bz#1444003 + (USB 3.0 flash drive not accessible on Windows guest) +- Resolves: bz#1446570 + (enable qemu-xhci USB3 controller device model for the aarch64 target) +- Resolves: bz#1447551 + (qemu hang when do block_resize guest disk during crystal running) +- Resolves: bz#1447581 + ([RHEV7.4] [usb-hub] input devices under usb hub don't work on win2016 with xhci) +- Resolves: bz#1447592 + (vhost-user/reply-ack: Wait for ack even if no request sent (one-time requests)) +- Resolves: bz#1449007 + (Pegas 1.0: Booting pegas guest on pegas host (POWER9 DD1) panics with signal 4 at userspace entry) +- Resolves: bz#1449037 + (Dst qemu quit when migrate guest with hugepage and total memory is not a multiple of pagesize) +- Resolves: bz#1451483 + (QEMU crashes with "-machine none -device intel-iommu") +- Resolves: bz#1452066 + (Fix backing image referencing in drive-backup sync=none) +- Resolves: bz#1452148 + (Op blockers don't work after postcopy migration) +- Resolves: bz#1452605 + (disable pulseaudio and alsa support) +- Resolves: bz#1452702 + (qemu-img aborts on empty filenames) +- Resolves: bz#1452752 + (Some block drivers incorrectly close their associated file) +- Resolves: bz#971799 + (qemu should not crash when if=scsi although it's unsupportable device) + +* Tue May 16 2017 Miroslav Rezanina - rhev-2.9.0-5.el7 +- kvm-blockdev-ignore-aio-native-for-empty-drives.patch [bz#1402645] +- kvm-dump-Acquire-BQL-around-vm_start-in-dump-thread.patch [bz#1445174] +- kvm-Downstream-Don-t-disable-SMT-on-POWER9-hosts.patch [bz#1450724] +- kvm-aio-add-missing-aio_notify-to-aio_enable_external.patch [bz#1446498] +- kvm-Update-configuration-for-qemu-2.9.patch [bz#1400962] +- Resolves: bz#1400962 + (Verify configuration coverage for rebased qemu-kvm-rhev) +- Resolves: bz#1402645 + (Required cache.direct=on when set aio=native) +- Resolves: bz#1445174 + ([RHEV7.4] [guest memory dump]dump-guest-memory QMP command with "detach" param makes qemu-kvm process aborted) +- Resolves: bz#1446498 + (Guest freeze after live snapshot with data-plane) +- Resolves: bz#1450724 + ([Pegas 1.0] qemu package scripts should not disable host multi-threading for POWER9) + +* Fri May 12 2017 Miroslav Rezanina - rhev-2.9.0-4.el7 +- kvm-Reenable-Educational-device.patch [bz#1414694] +- kvm-usb-xhci-Fix-PCI-capability-order.patch [bz#1447874] +- kvm-block-vxhs.c-Add-support-for-a-new-block-device-type.patch [bz#1265869] +- kvm-block-vxhs.c-Add-qemu-iotests-for-new-block-device-t.patch [bz#1265869] +- kvm-qemu-iotests-exclude-vxhs-from-image-creation-via-pr.patch [bz#1265869] +- kvm-block-vxhs-modularize-VXHS-via-g_module.patch [bz#1265869] +- kvm-Remove-the-dependencies-to-seavgabios-bin-and-ipxe-r.patch [bz#1449939] +- Resolves: bz#1265869 + (RFE: Veritas HyperScale VxHS block device support (qemu-kvm-rhev)) +- Resolves: bz#1414694 + (Reenable edu device for kvm-unit-tests support) +- Resolves: bz#1447874 + (Migration failed from rhel7.2.z->rhel7.4 with "-M rhel7.0.0" and "-device nec-usb-xhci") +- Resolves: bz#1449939 + (Remove dependency on seavgabios-bin and ipxe-roms-qemu for qemu-kvm-rhev on s390x) + +* Fri May 05 2017 Miroslav Rezanina - rhev-2.9.0-3.el7 +- kvm-x86-machine-compat-2.9-stragglers.patch [bz#1435756] +- kvm-block-add-bdrv_set_read_only-helper-function.patch [bz#1189998] +- kvm-block-do-not-set-BDS-read_only-if-copy_on_read-enabl.patch [bz#1189998] +- kvm-block-honor-BDRV_O_ALLOW_RDWR-when-clearing-bs-read_.patch [bz#1189998] +- kvm-block-code-movement.patch [bz#1189998] +- kvm-block-introduce-bdrv_can_set_read_only.patch [bz#1189998] +- kvm-block-use-bdrv_can_set_read_only-during-reopen.patch [bz#1189998] +- kvm-block-rbd-update-variable-names-to-more-apt-names.patch [bz#1189998] +- kvm-block-rbd-Add-support-for-reopen.patch [bz#1189998] +- kvm-replication-Make-disable-replication-compile-again.patch [bz#1422846] +- kvm-Disable-replication-feature.patch [bz#1422846] +- Resolves: bz#1189998 + (Active commit does not support on rbd based disk) +- Resolves: bz#1422846 + (Disable replication feature) +- Resolves: bz#1435756 + (Backport device/machtype compat settings from v2.8.0..v2.9.0 final) + +* Fri Apr 28 2017 Miroslav Rezanina - rhev-2.9.0-2.el7 +- kvm-Disable-unimplemented-device.patch [bz#1443029] +- kvm-Disable-serial-isa-for-ppc64.patch [bz#1443029] +- kvm-Disable-rs6000-mc-device.patch [bz#1443029] +- kvm-ppc64le-Remove-isabus-bridge-device.patch [bz#1443029] +- kvm-hmp-gpa2hva-and-gpa2hpa-hostaddr-command.patch [bz#1432295] +- kvm-memory-add-section-range-info-for-IOMMU-notifier.patch [bz#1335808] +- kvm-memory-provide-IOMMU_NOTIFIER_FOREACH-macro.patch [bz#1335808] +- kvm-memory-provide-iommu_replay_all.patch [bz#1335808] +- kvm-memory-introduce-memory_region_notify_one.patch [bz#1335808] +- kvm-memory-add-MemoryRegionIOMMUOps.replay-callback.patch [bz#1335808] +- kvm-intel_iommu-use-the-correct-memory-region-for-device.patch [bz#1335808] +- kvm-intel_iommu-provide-its-own-replay-callback.patch [bz#1335808] +- kvm-intel_iommu-allow-dynamic-switch-of-IOMMU-region.patch [bz#1335808] +- kvm-intel_iommu-enable-remote-IOTLB.patch [bz#1335808] +- kvm-virtio-rng-stop-virtqueue-while-the-CPU-is-stopped.patch [bz#1435521] +- kvm-target-ppc-kvm-make-use-of-KVM_CREATE_SPAPR_TCE_64.patch [bz#1440619] +- kvm-spapr-Add-ibm-processor-radix-AP-encodings-to-the-de.patch [bz#1368786] +- kvm-target-ppc-support-KVM_CAP_PPC_MMU_RADIX-KVM_CAP_PPC.patch [bz#1368786] +- kvm-target-ppc-Add-new-H-CALL-shells-for-in-memory-table.patch [bz#1368786] +- kvm-target-ppc-Implement-H_REGISTER_PROCESS_TABLE-H_CALL.patch [bz#1368786] +- kvm-spapr-move-spapr_populate_pa_features.patch [bz#1368786] +- kvm-spapr-Enable-ISA-3.0-MMU-mode-selection-via-CAS.patch [bz#1368786] +- kvm-spapr-Workaround-for-broken-radix-guests.patch [bz#1368786] +- Resolves: bz#1335808 + ([RFE] [vIOMMU] Add Support for VFIO devices with vIOMMU present) +- Resolves: bz#1368786 + ([Pegas1.0 FEAT] POWER9 guest - qemu - base enablement) +- Resolves: bz#1432295 + (Add gpa2hpa command to qemu hmp) +- Resolves: bz#1435521 + (Migration failed with postcopy enabled from rhel7.3.z host to rhel7.4 host "error while loading state for instance 0x0 of device 'pci) +- Resolves: bz#1440619 + (Reboot guest will induce error message - KVM: Failed to create TCE table for liobn 0x80000001) +- Resolves: bz#1443029 + (Disable new devices in qemu 2.9) + +* Fri Apr 21 2017 Miroslav Rezanina - rhev-2.9.0-1.el7 +- Rebase to QEMU 2.9.0 [bz#1387372] +- Resolves: bz#1387372 + (Rebase qemu-kvm-rhev for RHEL-7.4) + +* Wed Mar 08 2017 Miroslav Rezanina - rhev-2.8.0-6.el7 +- kvm-virtio-Report-real-progress-in-VQ-aio-poll-handler.patch [bz#1425700] +- kvm-intel-hda-fix-rhel6-compat-property.patch [bz#1425765] +- Resolves: bz#1425700 + (virtio-scsi data plane takes 100% host CPU with polling) +- Resolves: bz#1425765 + (The guest failed to start with ich6 sound when machine type is rhel6.*.0) + +* Mon Feb 20 2017 Miroslav Rezanina - rhev-2.8.0-5.el7 +- kvm-Disable-qemu-register-device.patch [bz#1392328] +- kvm-Disable-vfio-pci-igd-lpc-bridge-device.patch [bz#1392328] +- kvm-Disable-new-virtio-crypto-devices.patch [bz#1392328] +- kvm-Disable-amd-iommu-devices.patch [bz#1392328] +- kvm-Disable-loader-device.patch [bz#1392328] +- kvm-Disable-or-irq-device.patch [bz#1392328] +- kvm-Hide-new-floppy-device.patch [bz#1392328] +- kvm-migcompat-e1000e-Work-around-7.3-msi-intr_state-fiel.patch [bz#1420216] +- kvm-migcompat-rtl8139-Work-around-version-bump.patch [bz#1420195] +- kvm-sync-linux-headers.patch [bz#1391942] +- kvm-kvmclock-reduce-kvmclock-difference-on-migration.patch [bz#1391942] +- kvm-ahci-advertise-HOST_CAP_64.patch [bz#1411105] +- kvm-Disable-devices-for-for-AArch64-QEMU.patch [bz#1422349] +- kvm-hw-arm-virt-Disable-virtio-net-pci-option-ROM-file-l.patch [bz#1337510] +- kvm-vfio-Use-error_setg-when-reporting-max-assigned-devi.patch [bz#1369795] +- kvm-cirrus-fix-patterncopy-checks.patch [bz#1420494] +- kvm-Revert-cirrus-allow-zero-source-pitch-in-pattern-fil.patch [bz#1420494] +- kvm-cirrus-add-blit_is_unsafe-call-to-cirrus_bitblt_cput.patch [bz#1420494] +- kvm-Package-man-page-of-kvm_stat-tool.patch [bz#1417840] +- kvm-Update-configuration-for-2.8.0-release.patch [bz#1400962] +- Resolves: bz#1337510 + (Don't try to use a romfile for virtio-net-pci on aarch64) +- Resolves: bz#1369795 + (QMP should prompt more specific information when hotplug more than 32 vfs to guest) +- Resolves: bz#1391942 + (kvmclock: advance clock by time window between vm_stop and pre_save (backport patch)) +- Resolves: bz#1392328 + (Disable new devices in QEMU 2.8 (x86_64)) +- Resolves: bz#1400962 + (Verify configuration coverage for rebased qemu-kvm-rhev) +- Resolves: bz#1411105 + (Windows Server 2008-32 crashes on startup with q35 if cdrom attached) +- Resolves: bz#1417840 + (Include kvm_stat man page in qemu-kvm-tools package) +- Resolves: bz#1420195 + (Migration from RHEL7.4 -> RHEL7.3.z failed with rtl8139 nic card) +- Resolves: bz#1420216 + (Migration from RHEL7.3.z -> RHEL4 failed with e1000e nic card) +- Resolves: bz#1420494 + (EMBARGOED CVE-2017-2620 qemu-kvm-rhev: Qemu: display: cirrus: potential arbitrary code execution via cirrus_bitblt_cputovideo [rhel-7.4]) +- Resolves: bz#1422349 + (Disable new devices in QEMU 2.8 (aarch64)) + +* Fri Feb 10 2017 Miroslav Rezanina - rhev-2.8.0-4.el7 +- kvm-fix-abort-in-acpi_setup-since-2.8-with-rhel6-machine.patch [bz#1410826] +- kvm-spapr-clock-should-count-only-if-vm-is-running.patch [bz#1264258] +- kvm-display-cirrus-ignore-source-pitch-value-as-needed-i.patch [bz#1418236] +- kvm-cirrus-handle-negative-pitch-in-cirrus_invalidate_re.patch [bz#1418236] +- kvm-cirrus-allow-zero-source-pitch-in-pattern-fill-rops.patch [bz#1418236] +- kvm-cirrus-fix-blit-address-mask-handling.patch [bz#1418236] +- kvm-cirrus-fix-oob-access-issue-CVE-2017-2615.patch [bz#1418236] +- kvm-QMP-Fix-forward-port-of-__com.redhat_drive_add.patch [bz#1418575] +- kvm-QMP-Fix-forward-port-of-__com.redhat_drive_del.patch [bz#1418575] +- kvm-Drop-macro-RFQDN_REDHAT.patch [bz#1418575] +- kvm-HMP-Clean-up-botched-conflict-resolution-in-user-man.patch [bz#1418575] +- kvm-HMP-Fix-user-manual-typo-of-__com.redhat_qxl_screend.patch [bz#1419899] +- kvm-HMP-Fix-documentation-of-__com.redhat.drive_add.patch [bz#1419899] +- kvm-aio-add-flag-to-skip-fds-to-aio_dispatch.patch [bz#1404303] +- kvm-aio-add-AioPollFn-and-io_poll-interface.patch [bz#1404303] +- kvm-aio-add-polling-mode-to-AioContext.patch [bz#1404303] +- kvm-virtio-poll-virtqueues-for-new-buffers.patch [bz#1404303] +- kvm-linux-aio-poll-ring-for-completions.patch [bz#1404303] +- kvm-iothread-add-polling-parameters.patch [bz#1404303] +- kvm-virtio-blk-suppress-virtqueue-kick-during-processing.patch [bz#1404303] +- kvm-virtio-scsi-suppress-virtqueue-kick-during-processin.patch [bz#1404303] +- kvm-aio-add-.io_poll_begin-end-callbacks.patch [bz#1404303] +- kvm-virtio-disable-virtqueue-notifications-during-pollin.patch [bz#1404303] +- kvm-aio-self-tune-polling-time.patch [bz#1404303] +- kvm-iothread-add-poll-grow-and-poll-shrink-parameters.patch [bz#1404303] +- kvm-virtio-disable-notifications-again-after-poll-succee.patch [bz#1404303] +- kvm-aio-posix-honor-is_external-in-AioContext-polling.patch [bz#1404303] +- kvm-iothread-enable-AioContext-polling-by-default.patch [bz#1404303] +- kvm-Disable-usbredir-and-libcacard-for-unsupported-archi.patch [bz#1418166] +- Resolves: bz#1264258 + (Guest's time stops with option clock=vm when guest is paused) +- Resolves: bz#1404303 + (RFE: virtio-blk/scsi polling mode (QEMU)) +- Resolves: bz#1410826 + (rhel6 machine types assert; acpi-build.c:2985: acpi_setup: Assertion `build_state->table_mr != ((void *)0)' failed) +- Resolves: bz#1418166 + (Remove dependencies required by spice on ppc64le) +- Resolves: bz#1418236 + (CVE-2017-2615 qemu-kvm-rhev: Qemu: display: cirrus: oob access while doing bitblt copy backward mode [rhel-7.4]) +- Resolves: bz#1418575 + (Forward port of downstream-only QMP commands is incorrect) +- Resolves: bz#1419899 + (Documentation inaccurate for __com.redhat_qxl_screendump and __com.redhat_drive_add) + +* Fri Feb 03 2017 Miroslav Rezanina - rhev-2.8.0-3.el7 +- kvm-hw-arm-virt-remove-aarch64-rhel-machine-type.patch [bz#1390964] +- kvm-hw-arm-virt-create-virt-rhel7.3.0-machine-type.patch [bz#1390964] +- kvm-hw-arm-virt-create-virt-rhel7.4.0-machine-type.patch [bz#1390964] +- kvm-tools-kvm_stat-Introduce-pid-monitoring.patch [bz#1397697] +- kvm-tools-kvm_stat-Add-comments.patch [bz#1397697] +- kvm-x86-Split-out-options-for-the-head-rhel7-machine-typ.patch [bz#1390737] +- kvm-x86-Create-PC_RHEL7_3_COMPAT-definition.patch [bz#1390737] +- kvm-x86-Define-pc-i440fx-rhel7.4.0.patch [bz#1390737] +- kvm-x86-Define-pc-q35-rhel7.4.0.patch [bz#1390737] +- kvm-x86-Remove-downstream-opteron-rdtscp-override.patch [bz#1390737] +- kvm-pci-mark-ROMs-read-only.patch [bz#1404673] +- kvm-vhost-skip-ROM-sections.patch [bz#1404673] +- kvm-Enable-seccomp-for-ppc64-ppc64le-architecture.patch [bz#1385537] +- kvm-Update-qemu-kvm-package-Summary-and-Description.patch [bz#1378538] +- Resolves: bz#1378538 + (QEMU: update package summary and description) +- Resolves: bz#1385537 + ([V4.1 FEAT] Enable seccomp support in QEMU) +- Resolves: bz#1390737 + (RHEL-7.4 new qemu-kvm-rhev machine type (x86)) +- Resolves: bz#1390964 + (RHEL-7.4 new QEMU machine type (AArch64)) +- Resolves: bz#1397697 + (Backport remaining kvm_stat patches from the kernel to QEMU) +- Resolves: bz#1404673 + ([ppc64le]qemu-kvm-rhev-2.8 upstream package, reset vm when do migration, HMP in src host promp "tcmalloc: large alloc 1073872896 bytes...") + +* Mon Jan 16 2017 Miroslav Rezanina - rhev-2.8.0-2.el7 +- kvm-Revert-kvm_stat-Remove.patch [bz#1389238] +- kvm-Include-kvm_stat-in-qemu-kvm.spec.patch [bz#1389238] +- kvm-tools-kvm_stat-Powerpc-related-fixes.patch [bz#1389238] +- kvm-compat-define-HW_COMPAT_RHEL7_3.patch [bz#1390734] +- kvm-spapr-define-pseries-rhel7.4.0-machine-type.patch [bz#1390734] +- kvm-config-Remove-EHCI-from-ppc64-builds.patch [bz#1410674] +- kvm-Fix-unuseds-Fedora-build.patch [bz#1410758] +- Resolves: bz#1389238 + (Re-enable kvm_stat script) +- Resolves: bz#1390734 + (ppc64: pseries-rhel7.4.0 machine type) +- Resolves: bz#1410674 + (qemu: Remove unnecessary EHCI implementation for Power) +- Resolves: bz#1410758 + (Make 7.4 qemu-kvm-rhev build on fedora25) + +* Tue Jan 10 2017 Miroslav Rezanina - rhev-2.8.0-1.el7 +- Rebase to QEMU 2.8.0 [bz#1387600] +- Resolves: bz#1387600 + (Rebase qemu-kvm-rhev to 2.8.0) + +* Tue Sep 27 2016 Miroslav Rezanina - rhev-2.6.0-28.el7 +- kvm-ARM-ACPI-fix-the-AML-ID-format-for-CPU-devices.patch [bz#1373733] +- Resolves: bz#1373733 + (failed to run a guest VM with >= 12 vcpu under ACPI mode) + +* Fri Sep 23 2016 Miroslav Rezanina - rhev-2.6.0-27.el7 +- kvm-char-fix-waiting-for-TLS-and-telnet-connection.patch [bz#1300773] +- kvm-target-i386-introduce-kvm_put_one_msr.patch [bz#1377920] +- kvm-apic-set-APIC-base-as-part-of-kvm_apic_put.patch [bz#1377920] +- Resolves: bz#1300773 + (RFE: add support for native TLS encryption on chardev TCP transports) +- Resolves: bz#1377920 + (Guest fails reboot and causes kernel-panic) + +* Tue Sep 20 2016 Miroslav Rezanina - rhev-2.6.0-26.el7 +- kvm-target-i386-Add-more-Intel-AVX-512-instructions-supp.patch [bz#1372455] +- kvm-iothread-Stop-threads-before-main-quits.patch [bz#1343021] +- kvm-virtio-pci-error-out-when-both-legacy-and-modern-mod.patch [bz#1370005] +- kvm-virtio-bus-Plug-devices-after-features-are-negotiate.patch [bz#1370005] +- kvm-virtio-pci-reduce-modern_mem_bar-size.patch [bz#1365613] +- kvm-virtio-vga-adapt-to-page-per-vq-off.patch [bz#1365613] +- kvm-virtio-gpu-pci-tag-as-not-hotpluggable.patch [bz#1368032] +- kvm-scsi-disk-Cleaning-up-around-tray-open-state.patch [bz#1374251] +- kvm-virtio-scsi-Don-t-abort-when-media-is-ejected.patch [bz#1374251] +- kvm-io-remove-mistaken-call-to-object_ref-on-QTask.patch [bz#1375677] +- kvm-block-Invalidate-all-children.patch [bz#1355927] +- kvm-block-Drop-superfluous-invalidating-bs-file-from-dri.patch [bz#1355927] +- kvm-block-Inactivate-all-children.patch [bz#1355927] +- kvm-vfio-pci-Fix-regression-in-MSI-routing-configuration.patch [bz#1373802] +- kvm-x86-lapic-Load-LAPIC-state-at-post_load.patch [bz#1363998] +- kvm-blockdev-ignore-cache-options-for-empty-CDROM-drives.patch [bz#1342999] +- kvm-block-reintroduce-bdrv_flush_all.patch [bz#1338638] +- kvm-qemu-use-bdrv_flush_all-for-vm_stop-et-al.patch [bz#1338638] +- Resolves: bz#1338638 + (Migration fails after ejecting the cdrom in the guest) +- Resolves: bz#1342999 + ('cache=x' cannot work with empty cdrom) +- Resolves: bz#1343021 + (Core dump when quit from HMP after migration finished) +- Resolves: bz#1355927 + (qemu SIGABRT when doing inactive blockcommit with external system checkpoint snapshot) +- Resolves: bz#1363998 + (Live migration via a compressed file causes the guest desktop to freeze) +- Resolves: bz#1365613 + ([PCI] The default MMIO range reserved by firmware for PCI bridges is not enough to hotplug virtio-1 devices) +- Resolves: bz#1368032 + (kernel crash after hot remove virtio-gpu device) +- Resolves: bz#1370005 + (Fail to get network device info(eth0) in guest with virtio-net-pci/vhostforce) +- Resolves: bz#1372455 + ([Intel 7.3 Bug] SKL-SP Guest cpu doesn't support avx512 instruction sets(avx512bw, avx512dq and avx512vl)(qemu-kvm-rhev)) +- Resolves: bz#1373802 + (Network can't recover when trigger EEH one time) +- Resolves: bz#1374251 + (qemu-kvm-rhev core dumped when enabling virtio-scsi "data plane" and executing "eject") +- Resolves: bz#1375677 + (Crash when performing VNC websockets handshake) + +* Tue Sep 13 2016 Miroslav Rezanina - rhev-2.6.0-25.el7 +- kvm-virtio-recalculate-vq-inuse-after-migration.patch [bz#1372763] +- kvm-virtio-decrement-vq-inuse-in-virtqueue_discard.patch [bz#1372763] +- kvm-virtio-balloon-discard-virtqueue-element-on-reset.patch [bz#1370703] +- kvm-virtio-zero-vq-inuse-in-virtio_reset.patch [bz#1370703 bz#1374623] +- Resolves: bz#1370703 + ([Balloon] Whql Job "Commom scenario stress with IO" failed on 2008-32/64) +- Resolves: bz#1372763 + (RHSA-2016-1756 breaks migration of instances) +- Resolves: bz#1374623 + (RHSA-2016-1756 breaks migration of instances) + +* Fri Sep 09 2016 Miroslav Rezanina - rhev-2.6.0-24.el7 +- kvm-Fix-configure-test-for-PBKDF2-in-nettle.patch [bz#1301019] +- kvm-redhat-switch-from-gcrypt-to-nettle-for-crypto.patch [bz#1301019] +- kvm-crypto-assert-that-qcrypto_hash_digest_len-is-in-ran.patch [bz#1301019] +- kvm-crypto-fix-handling-of-iv-generator-hash-defaults.patch [bz#1301019] +- kvm-crypto-ensure-XTS-is-only-used-with-ciphers-with-16-.patch [bz#1301019] +- kvm-vhost-user-test-Use-libqos-instead-of-pxe-virtio.rom.patch [bz#1371211] +- kvm-vl-Delay-initialization-of-memory-backends.patch [bz#1371211] +- kvm-spapr-implement-H_CHANGE_LOGICAL_LAN_MAC-h_call.patch [bz#1371419] +- Resolves: bz#1301019 + (RFE: add support for LUKS disk encryption format driver w/ RBD, iSCSI, and qcow2) +- Resolves: bz#1371211 + (Qemu 2.6 won't boot guest with 2 meg hugepages) +- Resolves: bz#1371419 + ([ppc64le] Can't modify mac address for spapr-vlan device in rhel6.8 guest) + +* Tue Sep 06 2016 Miroslav Rezanina - rhev-2.6.0-23.el7 +- kvm-vhost-user-disconnect-on-HUP.patch [bz#1355902] +- kvm-vhost-don-t-assume-opaque-is-a-fd-use-backend-cleanu.patch [bz#1355902] +- kvm-vhost-make-vhost_log_put-idempotent.patch [bz#1355902] +- kvm-vhost-assert-the-log-was-cleaned-up.patch [bz#1355902] +- kvm-vhost-fix-cleanup-on-not-fully-initialized-device.patch [bz#1355902] +- kvm-vhost-make-vhost_dev_cleanup-idempotent.patch [bz#1355902] +- kvm-vhost-net-always-call-vhost_dev_cleanup-on-failure.patch [bz#1355902] +- kvm-vhost-fix-calling-vhost_dev_cleanup-after-vhost_dev_.patch [bz#1355902] +- kvm-vhost-do-not-assert-on-vhost_ops-failure.patch [bz#1355902] +- kvm-vhost-add-missing-VHOST_OPS_DEBUG.patch [bz#1355902] +- kvm-vhost-use-error_report-instead-of-fprintf-stderr.patch [bz#1355902] +- kvm-qemu-char-fix-qemu_chr_fe_set_msgfds-crash-when-disc.patch [bz#1355902] +- kvm-vhost-user-call-set_msgfds-unconditionally.patch [bz#1355902] +- kvm-vhost-user-check-qemu_chr_fe_set_msgfds-return-value.patch [bz#1355902] +- kvm-vhost-user-check-vhost_user_-read-write-return-value.patch [bz#1355902] +- kvm-vhost-user-keep-vhost_net-after-a-disconnection.patch [bz#1355902] +- kvm-vhost-user-add-get_vhost_net-assertions.patch [bz#1355902] +- kvm-Revert-vhost-net-do-not-crash-if-backend-is-not-pres.patch [bz#1355902] +- kvm-vhost-net-vhost_migration_done-is-vhost-user-specifi.patch [bz#1355902] +- kvm-vhost-add-assert-to-check-runtime-behaviour.patch [bz#1355902] +- kvm-char-add-chr_wait_connected-callback.patch [bz#1355902] +- kvm-char-add-and-use-tcp_chr_wait_connected.patch [bz#1355902] +- kvm-vhost-user-wait-until-backend-init-is-completed.patch [bz#1355902] +- kvm-vhost-user-add-error-report-in-vhost_user_write.patch [bz#1355902] +- kvm-vhost-add-vhost_net_set_backend.patch [bz#1355902] +- kvm-vhost-do-not-update-last-avail-idx-on-get_vring_base.patch [bz#1355902] +- kvm-vhost-check-for-vhost_ops-before-using.patch [bz#1355902] +- kvm-vhost-user-Introduce-a-new-protocol-feature-REPLY_AC.patch [bz#1355902] +- kvm-linux-aio-Handle-io_submit-failure-gracefully.patch [bz#1285928] +- kvm-Revert-acpi-pc-add-fw_cfg-device-node-to-dsdt.patch [bz#1368153] +- Resolves: bz#1285928 + (linux-aio aborts on io_submit() failure) +- Resolves: bz#1355902 + (vhost-user reconnect misc fixes and improvements) +- Resolves: bz#1368153 + (Please hide fw_cfg device in windows guest in order to make svvp test pass) + +* Mon Aug 22 2016 Miroslav Rezanina - rhev-2.6.0-22.el7 +- kvm-target-i386-kvm-Report-kvm_pv_unhalt-as-unsupported-.patch [bz#1363679] +- kvm-ioapic-keep-RO-bits-for-IOAPIC-entry.patch [bz#1358653] +- kvm-ioapic-clear-remote-irr-bit-for-edge-triggered-inter.patch [bz#1358653] +- kvm-x86-iommu-introduce-parent-class.patch [bz#1358653] +- kvm-intel_iommu-rename-VTD_PCI_DEVFN_MAX-to-x86-iommu.patch [bz#1358653] +- kvm-x86-iommu-provide-x86_iommu_get_default.patch [bz#1358653] +- kvm-x86-iommu-introduce-intremap-property.patch [bz#1358653] +- kvm-acpi-enable-INTR-for-DMAR-report-structure.patch [bz#1358653] +- kvm-intel_iommu-allow-queued-invalidation-for-IR.patch [bz#1358653] +- kvm-intel_iommu-set-IR-bit-for-ECAP-register.patch [bz#1358653] +- kvm-acpi-add-DMAR-scope-definition-for-root-IOAPIC.patch [bz#1358653] +- kvm-intel_iommu-define-interrupt-remap-table-addr-regist.patch [bz#1358653] +- kvm-intel_iommu-handle-interrupt-remap-enable.patch [bz#1358653] +- kvm-intel_iommu-define-several-structs-for-IOMMU-IR.patch [bz#1358653] +- kvm-intel_iommu-add-IR-translation-faults-defines.patch [bz#1358653] +- kvm-intel_iommu-Add-support-for-PCI-MSI-remap.patch [bz#1358653] +- kvm-intel_iommu-get-rid-of-0-initializers.patch [bz#1358653] +- kvm-q35-ioapic-add-support-for-emulated-IOAPIC-IR.patch [bz#1358653] +- kvm-ioapic-introduce-ioapic_entry_parse-helper.patch [bz#1358653] +- kvm-intel_iommu-add-support-for-split-irqchip.patch [bz#1358653] +- kvm-x86-iommu-introduce-IEC-notifiers.patch [bz#1358653] +- kvm-ioapic-register-IOMMU-IEC-notifier-for-ioapic.patch [bz#1358653] +- kvm-intel_iommu-Add-support-for-Extended-Interrupt-Mode.patch [bz#1358653] +- kvm-intel_iommu-add-SID-validation-for-IR.patch [bz#1358653] +- kvm-irqchip-simplify-kvm_irqchip_add_msi_route.patch [bz#1358653] +- kvm-irqchip-i386-add-hook-for-add-remove-virq.patch [bz#1358653] +- kvm-irqchip-x86-add-msi-route-notify-fn.patch [bz#1358653] +- kvm-irqchip-do-explicit-commit-when-update-irq.patch [bz#1358653] +- kvm-intel_iommu-support-all-masks-in-interrupt-entry-cac.patch [bz#1358653] +- kvm-all-add-trace-events-for-kvm-irqchip-ops.patch [bz#1358653] +- kvm-intel_iommu-disallow-kernel-irqchip-on-with-IR.patch [bz#1358653] +- kvm-intel_iommu-avoid-unnamed-fields.patch [bz#1358653] +- kvm-irqchip-only-commit-route-when-irqchip-is-used.patch [bz#1358653] +- kvm-x86-ioapic-ignore-level-irq-during-processing.patch [bz#1358653] +- kvm-x86-ioapic-add-support-for-explicit-EOI.patch [bz#1358653] +- kvm-memory-Fix-IOMMU-replay-base-address.patch [bz#1364035] +- kvm-Add-luks-to-block-driver-whitelist.patch [bz#1301019] +- Resolves: bz#1301019 + (RFE: add support for LUKS disk encryption format driver w/ RBD, iSCSI, and qcow2) +- Resolves: bz#1358653 + ([RFE] Interrupt remapping support for Intel vIOMMUs) +- Resolves: bz#1363679 + (RHEL guest hangs with kernel-irqchip=off and smp>1) +- Resolves: bz#1364035 + ([ppc64le][VFIO]Qemu complains:vfio_dma_map(0x10033d3a980, 0x1f34f0000, 0x10000, 0x3fff9a6d0000) = -6 (No such device or address)) + +* Tue Aug 16 2016 Miroslav Rezanina - rhev-2.6.0-21.el7 +- kvm-fix-qemu-exit-on-memory-hotplug-when-allocation-fail.patch [bz#1351409] +- kvm-spapr-remove-extra-type-variable.patch [bz#1363812] +- kvm-ppc-Introduce-a-function-to-look-up-CPU-alias-string.patch [bz#1363812] +- kvm-hw-ppc-spapr-Look-up-CPU-alias-names-instead-of-hard.patch [bz#1363812] +- kvm-ppc-kvm-Do-not-mess-up-the-generic-CPU-family-regist.patch [bz#1363812] +- kvm-ppc-kvm-Register-also-a-generic-spapr-CPU-core-famil.patch [bz#1363812] +- kvm-ppc64-fix-compressed-dump-with-pseries-kernel.patch [bz#1240497] +- kvm-monitor-fix-crash-when-leaving-qemu-with-spice-audio.patch [bz#1355704] +- kvm-audio-clean-up-before-monitor-clean-up.patch [bz#1355704] +- kvm-vnc-don-t-crash-getting-server-info-if-lsock-is-NULL.patch [bz#1359655] +- kvm-vnc-fix-crash-when-vnc_server_info_get-has-an-error.patch [bz#1359655] +- kvm-vnc-ensure-connection-sharing-limits-is-always-confi.patch [bz#1359655] +- kvm-vnc-make-sure-we-finish-disconnect.patch [bz#1352799] +- kvm-virtio-net-allow-increasing-rx-queue-size.patch [bz#1358962] +- kvm-input-add-trace-events-for-full-queues.patch [bz#1366471] +- kvm-virtio-set-low-features-early-on-load.patch [bz#1365747] +- kvm-Revert-virtio-net-unbreak-self-announcement-and-gues.patch [bz#1365747] +- Resolves: bz#1240497 + (qemu-kvm-rhev: dump-guest-memory creates invalid header with format kdump-{zlib,lzo,snappy} on ppc64) +- Resolves: bz#1351409 + (When hotplug memory, guest will shutdown as Insufficient free host memory pages available to allocate) +- Resolves: bz#1352799 + (Client information from hmp doesn't vanish after client disconnect when using vnc display) +- Resolves: bz#1355704 + (spice: core dump when 'quit') +- Resolves: bz#1358962 + (Increase the queue size to the max allowed, 1024.) +- Resolves: bz#1359655 + (Qemu crashes when connecting to a guest started with "-vnc none" by virt-viewer) +- Resolves: bz#1363812 + (qemu-kvm-rhev: -cpu POWER8 no longer works) +- Resolves: bz#1365747 + (Migrate guest(win10) after hot plug/unplug memory balloon device [Missing section footer for 0000:00:07.0/virtio-net]) +- Resolves: bz#1366471 + (QEMU prints "usb-kbd: warning: key event queue full" when pressing keys during SLOF boot) + +* Wed Aug 10 2016 Miroslav Rezanina - rhev-2.6.0-20.el7 +- kvm-block-gluster-rename-server-volname-image-host-volum.patch [bz#1247933] +- kvm-block-gluster-code-cleanup.patch [bz#1247933] +- kvm-block-gluster-deprecate-rdma-support.patch [bz#1247933] +- kvm-block-gluster-using-new-qapi-schema.patch [bz#1247933] +- kvm-block-gluster-add-support-for-multiple-gluster-serve.patch [bz#1247933] +- kvm-block-gluster-fix-doc-in-the-qapi-schema-and-member-.patch [bz#1247933] +- kvm-throttle-Don-t-allow-burst-limits-to-be-lower-than-t.patch [bz#1355665] +- kvm-throttle-Test-burst-limits-lower-than-the-normal-lim.patch [bz#1355665] +- kvm-spapr-Error-out-when-CPU-hotplug-is-attempted-on-old.patch [bz#1362019] +- kvm-spapr-Correctly-set-query_hotpluggable_cpus-hook-bas.patch [bz#1362019] +- Resolves: bz#1247933 + (RFE: qemu-kvm-rhev: support multiple volume hosts for gluster volumes) +- Resolves: bz#1355665 + (Suggest to limit the burst value to be not less than the throttle value) +- Resolves: bz#1362019 + (Crashes when using query-hotpluggable-cpus with pseries-rhel7.2.0 machine type) + +* Fri Aug 05 2016 Miroslav Rezanina - rhev-2.6.0-19.el7 +- kvm-hw-pcie-root-port-Fix-PCIe-root-port-initialization.patch [bz#1323976] +- kvm-hw-pxb-declare-pxb-devices-as-not-hot-pluggable.patch [bz#1323976] +- kvm-hw-acpi-fix-a-DSDT-table-issue-when-a-pxb-is-present.patch [bz#1323976] +- kvm-acpi-refactor-pxb-crs-computation.patch [bz#1323976] +- kvm-hw-apci-handle-64-bit-MMIO-regions-correctly.patch [bz#1323976] +- kvm-target-i386-Move-TCG-initialization-check-to-tcg_x86.patch [bz#1087672] +- kvm-target-i386-Move-TCG-initialization-to-realize-time.patch [bz#1087672] +- kvm-target-i386-Call-cpu_exec_init-on-realize.patch [bz#1087672] +- kvm-tests-acpi-report-names-of-expected-files-in-verbose.patch [bz#1087672] +- kvm-acpi-add-aml_debug.patch [bz#1087672] +- kvm-acpi-add-aml_refof.patch [bz#1087672] +- kvm-pc-acpi-remove-AML-for-empty-not-used-GPE-handlers.patch [bz#1087672] +- kvm-pc-acpi-consolidate-CPU-hotplug-AML.patch [bz#1087672] +- kvm-pc-acpi-consolidate-GPE._E02-with-the-rest-of-CPU-ho.patch [bz#1087672] +- kvm-pc-acpi-cpu-hotplug-make-AML-CPU_foo-defines-local-t.patch [bz#1087672] +- kvm-pc-acpi-mark-current-CPU-hotplug-functions-as-legacy.patch [bz#1087672] +- kvm-pc-acpi-consolidate-legacy-CPU-hotplug-in-one-file.patch [bz#1087672] +- kvm-pc-acpi-simplify-build_legacy_cpu_hotplug_aml-signat.patch [bz#1087672] +- kvm-pc-acpi-cpuhp-legacy-switch-ProcessorID-to-possible_.patch [bz#1087672] +- kvm-acpi-extend-ACPI-interface-to-provide-send_event-hoo.patch [bz#1087672] +- kvm-pc-use-AcpiDeviceIfClass.send_event-to-issue-GPE-eve.patch [bz#1087672] +- kvm-target-i386-Remove-xlevel-hv-spinlocks-option-fixups.patch [bz#1087672] +- kvm-target-i386-Move-features-logic-that-requires-CPUSta.patch [bz#1087672] +- kvm-target-i386-Remove-assert-kvm_enabled-from-host_x86_.patch [bz#1087672] +- kvm-target-i386-Move-xcc-kvm_required-check-to-realize-t.patch [bz#1087672] +- kvm-target-i386-Use-cpu_generic_init-in-cpu_x86_init.patch [bz#1087672] +- kvm-target-i386-Consolidate-calls-of-object_property_par.patch [bz#1087672] +- kvm-docs-update-ACPI-CPU-hotplug-spec-with-new-protocol.patch [bz#1087672] +- kvm-pc-piix4-ich9-add-cpu-hotplug-legacy-property.patch [bz#1087672] +- kvm-acpi-cpuhp-add-CPU-devices-AML-with-_STA-method.patch [bz#1087672] +- kvm-pc-acpi-introduce-AcpiDeviceIfClass.madt_cpu-hook.patch [bz#1087672] +- kvm-acpi-cpuhp-implement-hot-add-parts-of-CPU-hotplug-in.patch [bz#1087672] +- kvm-acpi-cpuhp-implement-hot-remove-parts-of-CPU-hotplug.patch [bz#1087672] +- kvm-acpi-cpuhp-add-cpu._OST-handling.patch [bz#1087672] +- kvm-pc-use-new-CPU-hotplug-interface-since-2.7-machine-t.patch [bz#1087672] +- kvm-pc-acpi-drop-intermediate-PCMachineState.node_cpu.patch [bz#1087672] +- kvm-qmp-fix-spapr-example-of-query-hotpluggable-cpus.patch [bz#1087672] +- kvm-qdev-Don-t-stop-applying-globals-on-first-error.patch [bz#1087672] +- kvm-qdev-Eliminate-qemu_add_globals-function.patch [bz#1087672] +- kvm-qdev-Use-GList-for-global-properties.patch [bz#1087672] +- kvm-qdev-GlobalProperty.errp-field.patch [bz#1087672] +- kvm-vl-Simplify-global-property-registration.patch [bz#1087672] +- kvm-machine-add-properties-to-compat_props-incrementaly.patch [bz#1087672] +- kvm-machine-Add-machine_register_compat_props-function.patch [bz#1087672] +- kvm-vl-Set-errp-to-error_abort-on-machine-compat_props.patch [bz#1087672] +- kvm-target-sparc-Use-sparc_cpu_parse_features-directly.patch [bz#1087672] +- kvm-target-i386-Avoid-using-locals-outside-their-scope.patch [bz#1087672] +- kvm-cpu-Use-CPUClass-parse_features-as-convertor-to-glob.patch [bz#1087672] +- kvm-arm-virt-Parse-cpu_model-only-once.patch [bz#1087672] +- kvm-cpu-make-cpu-qom.h-only-include-able-from-cpu.h.patch [bz#1087672] +- kvm-target-i386-make-cpu-qom.h-not-target-specific.patch [bz#1087672] +- kvm-target-Don-t-redefine-cpu_exec.patch [bz#1087672] +- kvm-pc-Parse-CPU-features-only-once.patch [bz#1087672] +- kvm-target-i386-Use-uint32_t-for-X86CPU.apic_id.patch [bz#1087672] +- kvm-pc-Add-x86_topo_ids_from_apicid.patch [bz#1087672] +- kvm-pc-Extract-CPU-lookup-into-a-separate-function.patch [bz#1087672] +- kvm-pc-cpu-Consolidate-apic-id-validity-checks-in-pc_cpu.patch [bz#1087672] +- kvm-target-i386-Replace-custom-apic-id-setter-getter-wit.patch [bz#1087672] +- kvm-target-i386-Add-socket-core-thread-properties-to-X86.patch [bz#1087672] +- kvm-target-i386-cpu-Do-not-ignore-error-and-fix-apic-par.patch [bz#1087672] +- kvm-target-i386-Fix-apic-object-leak-when-CPU-is-deleted.patch [bz#1087672] +- kvm-pc-Set-APIC-ID-based-on-socket-core-thread-ids-if-it.patch [bz#1087672] +- kvm-pc-Delay-setting-number-of-boot-CPUs-to-machine_done.patch [bz#1087672] +- kvm-pc-Register-created-initial-and-hotpluged-CPUs-in-on.patch [bz#1087672] +- kvm-pc-Forbid-BSP-removal.patch [bz#1087672] +- kvm-pc-Enforce-adding-CPUs-contiguously-and-removing-the.patch [bz#1087672] +- kvm-pc-cpu-Allow-device_add-to-be-used-with-x86-cpu.patch [bz#1087672] +- kvm-pc-Implement-query-hotpluggable-cpus-callback.patch [bz#1087672] +- kvm-apic-move-MAX_APICS-check-to-apic-class.patch [bz#1087672] +- kvm-apic-Drop-APICCommonState.idx-and-use-APIC-ID-as-ind.patch [bz#1087672] +- kvm-apic-kvm-apic-Fix-crash-due-to-access-to-freed-memor.patch [bz#1087672] +- kvm-apic-Add-unrealize-callbacks.patch [bz#1087672] +- kvm-apic-Use-apic_id-as-apic-s-migration-instance_id.patch [bz#1087672] +- kvm-target-i386-Add-x86_cpu_unrealizefn.patch [bz#1087672] +- kvm-pc-Make-device_del-CPU-work-for-x86-CPUs.patch [bz#1087672] +- kvm-exec-Reduce-CONFIG_USER_ONLY-ifdeffenery.patch [bz#1087672] +- kvm-exec-Don-t-use-cpu_index-to-detect-if-cpu_exec_init-.patch [bz#1087672] +- kvm-exec-Set-cpu_index-only-if-it-s-not-been-explictly-s.patch [bz#1087672] +- kvm-qdev-Fix-object-reference-leak-in-case-device.realiz.patch [bz#1087672] +- kvm-pc-Init-CPUState-cpu_index-with-index-in-possible_cp.patch [bz#1087672] +- kvm-Revert-pc-Enforce-adding-CPUs-contiguously-and-remov.patch [bz#1087672] +- kvm-qdev-ignore-GlobalProperty.errp-for-hotplugged-devic.patch [bz#1087672] +- kvm-vl-exit-if-a-bad-property-value-is-passed-to-global.patch [bz#1087672] +- kvm-apic-fix-broken-migration-for-kvm-apic.patch [bz#1087672] +- kvm-RHEL-only-hw-char-pl011-fix-SBSA-reset.patch [bz#1266048] +- kvm-migration-regain-control-of-images-when-migration-fa.patch [bz#1361539] +- kvm-migration-Promote-improved-autoconverge-commands-out.patch [bz#1358141] +- kvm-spapr-Ensure-CPU-cores-are-added-contiguously-and-re.patch [bz#1361443] +- kvm-spapr-disintricate-core-id-from-DT-semantics.patch [bz#1361443] +- kvm-spapr-init-CPUState-cpu_index-with-index-relative-to.patch [bz#1361443] +- kvm-Revert-spapr-Ensure-CPU-cores-are-added-contiguously.patch [bz#1361443] +- kvm-spapr-Prevent-boot-CPU-core-removal.patch [bz#1361443] +- kvm-virtio-vga-propagate-on-gpu-realized-error.patch [bz#1360664] +- kvm-hw-virtio-pci-fix-virtio-behaviour.patch [bz#1360664] +- kvm-q35-disable-s3-s4-by-default.patch [bz#1357202] +- kvm-pcie-fix-link-active-status-bit-migration.patch [bz#1352860] +- kvm-pc-rhel-7.2-pcie-fix-link-active-status-bit-migratio.patch [bz#1352860] +- kvm-add-e1000e-ipxe-rom-symlink.patch [bz#1343092] +- kvm-e1000e-add-boot-rom.patch [bz#1343092] +- Resolves: bz#1087672 + ([Fujitsu 7.2 FEAT]: qemu vcpu hot-remove support) +- Resolves: bz#1266048 + (login prompt does not work inside KVM guest when keys are pressed while the kernel is booting) +- Resolves: bz#1323976 + (PCI: Add 64-bit MMIO support to PXB devices) +- Resolves: bz#1343092 + (RFE: Integrate e1000e implementation in downstream QEMU) +- Resolves: bz#1352860 + (Migration is failed from host RHEL7.2.z to host RHEL7.3 with "-M pc-i440fx-rhel7.0.0 -device nec-usb-xhci") +- Resolves: bz#1357202 + ([Q35] S3 should be disabled by default for the pc-q35-rhel7.3.0 machine type) +- Resolves: bz#1358141 + (Removal of the "x-" prefix for dynamic cpu throttling) +- Resolves: bz#1360664 + ([virtio] Update default virtio-1 behavior for virtio devices) +- Resolves: bz#1361443 + (ppc64le: Introduce stable cpu_index for cpu hotplugging) +- Resolves: bz#1361539 + (block/io.c:1342: bdrv_co_do_pwritev: Assertion `!(bs->open_flags & 0x0800)' failed on failed migrate) + +* Tue Aug 02 2016 Miroslav Rezanina - rhev-2.6.0-18.el7 +- kvm-pci-fix-unaligned-access-in-pci_xxx_quad.patch [bz#1343092] +- kvm-msix-make-msix_clr_pending-visible-for-clients.patch [bz#1343092] +- kvm-pci-Introduce-define-for-PM-capability-version-1.1.patch [bz#1343092] +- kvm-pcie-Add-support-for-PCIe-CAP-v1.patch [bz#1343092] +- kvm-pcie-Introduce-function-for-DSN-capability-creation.patch [bz#1343092] +- kvm-vmxnet3-Use-generic-function-for-DSN-capability-defi.patch [bz#1343092] +- kvm-net-Introduce-Toeplitz-hash-calculator.patch [bz#1343092] +- kvm-net-Add-macros-for-MAC-address-tracing.patch [bz#1343092] +- kvm-vmxnet3-Use-common-MAC-address-tracing-macros.patch [bz#1343092] +- kvm-net_pkt-Name-vmxnet3-packet-abstractions-more-generi.patch [bz#1343092] +- kvm-rtl8139-Move-more-TCP-definitions-to-common-header.patch [bz#1343092] +- kvm-net_pkt-Extend-packet-abstraction-as-required-by-e10.patch [bz#1343092] +- kvm-vmxnet3-Use-pci_dma_-API-instead-of-cpu_physical_mem.patch [bz#1343092] +- kvm-e1000_regs-Add-definitions-for-Intel-82574-specific-.patch [bz#1343092] +- kvm-e1000-Move-out-code-that-will-be-reused-in-e1000e.patch [bz#1343092] +- kvm-net-Introduce-e1000e-device-emulation.patch [bz#1343092] +- kvm-e1000e-Fix-build-with-gcc-4.6.3-and-ust-tracing.patch [bz#1343092] +- kvm-pci-fix-pci_requester_id.patch [bz#1350196] +- kvm-hw-pci-delay-bus_master_enable_region-initialization.patch [bz#1350196] +- kvm-q35-allow-dynamic-sysbus.patch [bz#1350196] +- kvm-q35-rhel-allow-dynamic-sysbus.patch [bz#1350196] +- kvm-hw-iommu-enable-iommu-with-device.patch [bz#1350196] +- kvm-machine-remove-iommu-property.patch [bz#1350196] +- kvm-rhel-Revert-unwanted-inconsequential-changes-to-ivsh.patch [bz#1333318] +- kvm-rhel-Disable-ivshmem-plain-migration-ivshmem-doorbel.patch [bz#1333318] +- kvm-nvdimm-fix-memory-leak-in-error-code-path.patch [bz#1361205] +- kvm-i8257-Set-no-user-flag.patch [bz#1337457] +- kvm-bitops-Add-MAKE_64BIT_MASK-macro.patch [bz#1339196] +- kvm-target-i386-Provide-TCG_PHYS_ADDR_BITS.patch [bz#1339196] +- kvm-target-i386-Allow-physical-address-bits-to-be-set.patch [bz#1339196] +- kvm-target-i386-Mask-mtrr-mask-based-on-CPU-physical-add.patch [bz#1339196] +- kvm-target-i386-Fill-high-bits-of-mtrr-mask.patch [bz#1339196] +- kvm-target-i386-Set-physical-address-bits-based-on-host.patch [bz#1339196] +- kvm-target-i386-Enable-host-phys-bits-on-RHEL.patch [bz#1339196] +- kvm-pc-Fix-rhel6.3.0-compat_props-setting.patch [bz#1362264] +- Resolves: bz#1333318 + (ivshmem-plain support in RHEL 7.3) +- Resolves: bz#1337457 + (enable i8257 device) +- Resolves: bz#1339196 + (qemu-kvm (on target host) killed by SIGABRT when migrating a guest from AMD host to Intel host.) +- Resolves: bz#1343092 + (RFE: Integrate e1000e implementation in downstream QEMU) +- Resolves: bz#1350196 + (Enable IOMMU device with -device intel-iommu) +- Resolves: bz#1361205 + (nvdimm: fix memory leak in error code path) +- Resolves: bz#1362264 + (rhel6.3.0 machine-type using wrong compat_props list) + +* Fri Jul 29 2016 Miroslav Rezanina - rhev-2.6.0-17.el7 +- kvm-Disable-mptsas1068-device.patch [bz#1333282] +- kvm-Disable-sd-card.patch [bz#1333282] +- kvm-Disable-rocker-device.patch [bz#1333282] +- kvm-Disable-new-ipmi-devices.patch [bz#1333282] +- kvm-Disable-hyperv-testdev.patch [bz#1333282] +- kvm-Disable-allwiner_ahci-device.patch [bz#1333282] +- kvm-Disable-igd-passthrough-i440FX.patch [bz#1333282] +- kvm-Disable-vfio-platform-device.patch [bz#1333282] +- kvm-tap-vhost-busy-polling-support.patch [bz#1345715 bz#1353791] +- kvm-vl-change-runstate-only-if-new-state-is-different-fr.patch [bz#1355982] +- kvm-virtio-error-out-if-guest-exceeds-virtqueue-size.patch [bz#1359733] +- kvm-migration-set-state-to-post-migrate-on-failure.patch [bz#1355683] +- kvm-block-drop-support-for-using-qcow-2-encryption-with-.patch [bz#1336659] +- kvm-json-streamer-Don-t-leak-tokens-on-incomplete-parse.patch [bz#1360612] +- kvm-json-streamer-fix-double-free-on-exiting-during-a-pa.patch [bz#1360612] +- kvm-Add-dump-guest-memory.py-to-all-archs.patch [bz#1360225] +- Resolves: bz#1333282 + (Disable new devices in QEMU 2.6) +- Resolves: bz#1336659 + (Core dump when re-launch guest with encrypted block device) +- Resolves: bz#1345715 + (Busy polling support for vhost net in qemu) +- Resolves: bz#1353791 + (Busy polling support for vhost) +- Resolves: bz#1355683 + (qemu core dump when do postcopy migration again after canceling a migration in postcopy phase) +- Resolves: bz#1355982 + (qemu will abort after type two"system_reset" after the guest poweroff) +- Resolves: bz#1359733 + (CVE-2016-5403 qemu-kvm-rhev: Qemu: virtio: unbounded memory allocation on host via guest leading to DoS [rhel-7.3]) +- Resolves: bz#1360225 + (Can't extract guest memory dump from qemu core) +- Resolves: bz#1360612 + (Memory leak on incomplete JSON parse) + +* Tue Jul 26 2016 Miroslav Rezanina - rhev-2.6.0-16.el7 +- kvm-exec-Remove-cpu-from-cpus-list-during-cpu_exec_exit.patch [bz#1172917] +- kvm-exec-Do-vmstate-unregistration-from-cpu_exec_exit.patch [bz#1172917] +- kvm-cpu-Reclaim-vCPU-objects.patch [bz#1172917] +- kvm-cpu-Add-a-sync-version-of-cpu_remove.patch [bz#1172917] +- kvm-qdev-hotplug-Introduce-HotplugHandler.pre_plug-callb.patch [bz#1172917] +- kvm-cpu-Abstract-CPU-core-type.patch [bz#1172917] +- kvm-xics-xics_kvm-Handle-CPU-unplug-correctly.patch [bz#1172917] +- kvm-spapr_drc-Prevent-detach-racing-against-attach-for-C.patch [bz#1172917] +- kvm-qom-API-to-get-instance_size-of-a-type.patch [bz#1172917] +- kvm-spapr-Abstract-CPU-core-device-and-type-specific-cor.patch [bz#1172917] +- kvm-spapr-Move-spapr_cpu_init-to-spapr_cpu_core.c.patch [bz#1172917] +- kvm-spapr-convert-boot-CPUs-into-CPU-core-devices.patch [bz#1172917] +- kvm-spapr-CPU-hotplug-support.patch [bz#1172917] +- kvm-spapr-CPU-hot-unplug-support.patch [bz#1172917] +- kvm-QMP-Add-query-hotpluggable-cpus.patch [bz#1172917] +- kvm-hmp-Add-info-hotpluggable-cpus-HMP-command.patch [bz#1172917] +- kvm-spapr-implement-query-hotpluggable-cpus-callback.patch [bz#1172917] +- kvm-qapi-Report-support-for-device-cpu-hotplug-in-query-.patch [bz#1172917] +- kvm-qapi-keep-names-in-CpuInstanceProperties-in-sync-wit.patch [bz#1172917] +- kvm-spapr-fix-write-past-end-of-array-error-in-cpu-core-.patch [bz#1172917] +- kvm-spapr-Restore-support-for-older-PowerPC-CPU-cores.patch [bz#1172917] +- kvm-spapr-Restore-support-for-970MP-and-POWER8NVL-CPU-co.patch [bz#1172917] +- kvm-spapr-drop-reference-on-child-object-during-core-rea.patch [bz#1172917] +- kvm-spapr-do-proper-error-propagation-in-spapr_cpu_core_.patch [bz#1172917] +- kvm-spapr-drop-duplicate-variable-in-spapr_core_release.patch [bz#1172917] +- kvm-spapr-Ensure-thread0-of-CPU-core-is-always-realized-.patch [bz#1172917] +- kvm-spapr-fix-core-unplug-crash.patch [bz#1172917] +- kvm-usbredir-add-streams-property.patch [bz#1353180] +- kvm-usbredir-turn-off-streams-for-rhel7.2-older.patch [bz#1353180] +- kvm-net-fix-qemu_announce_self-not-emitting-packets.patch [bz#1343433] +- kvm-Fix-crash-bug-in-rebase-of__com.redhat_drive_add.patch [bz#1352865] +- kvm-ppc-Yet-another-fix-for-the-huge-page-support-detect.patch [bz#1347498] +- kvm-ppc-Huge-page-detection-mechanism-fixes-Episode-III.patch [bz#1347498] +- kvm-hw-ppc-spapr-Make-sure-to-close-the-htab_fd-when-mig.patch [bz#1354341] +- Resolves: bz#1172917 + (add support for CPU hotplugging (qemu-kvm-rhev)) +- Resolves: bz#1343433 + (migration: announce_self fix) +- Resolves: bz#1347498 + ([ppc64le] Guest can't boot up with hugepage memdev) +- Resolves: bz#1352865 + (Boot guest with two virtio-scsi-pci devices and spice, QEMU core dump after executing '(qemu)__com.redhat_drive_add') +- Resolves: bz#1353180 + (7.3->7.2 migration: qemu-kvm: usbredirparser: error unserialize caps mismatch) +- Resolves: bz#1354341 + (guest hang after cancel migration then migrate again) + +* Fri Jul 22 2016 Miroslav Rezanina - rhev-2.6.0-15.el7 +- kvm-spapr_pci-Use-correct-DMA-LIOBN-when-composing-the-d.patch [bz#1213667] +- kvm-spapr_iommu-Finish-renaming-vfio_accel-to-need_vfio.patch [bz#1213667] +- kvm-spapr_iommu-Move-table-allocation-to-helpers.patch [bz#1213667] +- kvm-vmstate-Define-VARRAY-with-VMS_ALLOC.patch [bz#1213667] +- kvm-spapr_iommu-Introduce-enabled-state-for-TCE-table.patch [bz#1213667] +- kvm-spapr_iommu-Migrate-full-state.patch [bz#1213667] +- kvm-spapr_iommu-Add-root-memory-region.patch [bz#1213667] +- kvm-spapr_pci-Reset-DMA-config-on-PHB-reset.patch [bz#1213667] +- kvm-spapr_pci-Add-and-export-DMA-resetting-helper.patch [bz#1213667] +- kvm-memory-Add-reporting-of-supported-page-sizes.patch [bz#1213667] +- kvm-spapr-ensure-device-trees-are-always-associated-with.patch [bz#1213667] +- kvm-spapr_iommu-Realloc-guest-visible-TCE-table-when-sta.patch [bz#1213667] +- kvm-vfio-spapr-Add-DMA-memory-preregistering-SPAPR-IOMMU.patch [bz#1213667] +- kvm-vfio-Add-host-side-DMA-window-capabilities.patch [bz#1213667] +- kvm-vfio-spapr-Create-DMA-window-dynamically-SPAPR-IOMMU.patch [bz#1213667] +- kvm-spapr_pci-spapr_pci_vfio-Support-Dynamic-DMA-Windows.patch [bz#1213667] +- kvm-qemu-sockets-use-qapi_free_SocketAddress-in-cleanup.patch [bz#1354090] +- kvm-tap-use-an-exit-notifier-to-call-down_script.patch [bz#1354090] +- kvm-slirp-use-exit-notifier-for-slirp_smb_cleanup.patch [bz#1354090] +- kvm-net-do-not-use-atexit-for-cleanup.patch [bz#1354090] +- kvm-virtio-mmio-format-transport-base-address-in-BusClas.patch [bz#1356815] +- kvm-vfio-pci-Hide-ARI-capability.patch [bz#1356376] +- kvm-qxl-factor-out-qxl_get_check_slot_offset.patch [bz#1235732] +- kvm-qxl-store-memory-region-and-offset-instead-of-pointe.patch [bz#1235732] +- kvm-qxl-fix-surface-migration.patch [bz#1235732] +- kvm-qxl-fix-qxl_set_dirty-call-in-qxl_dirty_one_surface.patch [bz#1235732] +- kvm-Add-install-dependency-required-for-usb-streams.patch [bz#1354443] +- Resolves: bz#1213667 + (Dynamic DMA Windows for VFIO on Power (qemu component)) +- Resolves: bz#1235732 + (spice-gtk shows outdated screen state after migration [qemu-kvm-rhev]) +- Resolves: bz#1354090 + (Boot guest with vhostuser server mode, QEMU prompt 'Segmentation fault' after executing '(qemu)system_powerdown') +- Resolves: bz#1354443 + (/usr/libexec/qemu-kvm: undefined symbol: libusb_free_ss_endpoint_companion_descriptor) +- Resolves: bz#1356376 + ([Q35] Nic which passthrough from host didn't be found in guest when enable multifunction) +- Resolves: bz#1356815 + (AArch64: backport virtio-mmio dev pathname fix) + +* Tue Jul 19 2016 Miroslav Rezanina - rhev-2.6.0-14.el7 +- kvm-add-vgabios-virtio.bin-symlink.patch [bz#1347402] +- kvm-usb-enable-streams-support.patch [bz#1033733] +- kvm-hw-arm-virt-kill-7.2-machine-type.patch [bz#1356814] +- kvm-blockdev-Fix-regression-with-the-default-naming-of-t.patch [bz#1353801] +- kvm-qemu-iotests-Test-naming-of-throttling-groups.patch [bz#1353801] +- kvm-target-i386-Show-host-and-VM-TSC-frequencies-on-mism.patch [bz#1351442] +- Resolves: bz#1033733 + (RFE: add support for USB-3 bulk streams - qemu-kvm) +- Resolves: bz#1347402 + (vgabios-virtio.bin should be symlinked in qemu-kvm-rhev) +- Resolves: bz#1351442 + ("TSC frequency mismatch" warning message after migration) +- Resolves: bz#1353801 + (The default io throttling group name is null, which makes all throttled disks with a default group name in the same group) +- Resolves: bz#1356814 + (AArch64: remove non-released 7.2 machine type) + +* Tue Jul 12 2016 Miroslav Rezanina - rhev-2.6.0-13.el7 +- kvm-block-gluster-add-support-for-selecting-debug-loggin.patch [bz#1320714] +- kvm-Revert-static-checker-e1000-82540em-got-aliased-to-e.patch [bz#1353070] +- kvm-Revert-e1000-use-alias-for-default-model.patch [bz#1353070] +- kvm-7.x-compat-e1000-82540em.patch [bz#1353070] +- kvm-target-i386-add-Skylake-Client-cpu-model.patch [bz#1327589] +- kvm-scsi-generic-Merge-block-max-xfer-len-in-INQUIRY-res.patch [bz#1353816] +- kvm-raw-posix-Fetch-max-sectors-for-host-block-device.patch [bz#1353816] +- kvm-scsi-Advertise-limits-by-blocksize-not-512.patch [bz#1353816] +- kvm-mirror-clarify-mirror_do_read-return-code.patch [bz#1336705] +- kvm-mirror-limit-niov-to-IOV_MAX-elements-again.patch [bz#1336705] +- kvm-iotests-add-small-granularity-mirror-test.patch [bz#1336705] +- Resolves: bz#1320714 + ([RFE] Allow the libgfapi logging level to be controlled.) +- Resolves: bz#1327589 + (Add Skylake CPU model) +- Resolves: bz#1336705 + (Drive mirror with option granularity fail) +- Resolves: bz#1353070 + (Migration is failed from host RHEL7.2.z to host RHEL7.3 with "-M rhel6.6.0 -device e1000-82540em") +- Resolves: bz#1353816 + (expose host BLKSECTGET limit in scsi-block (qemu-kvm-rhev)) + +* Fri Jul 08 2016 Miroslav Rezanina - rhev-2.6.0-12.el7 +- kvm-Fix-crash-with-__com.redhat_drive_del.patch [bz#1341531] +- kvm-hw-arm-virt-fix-limit-of-64-bit-ACPI-ECAM-PCI-MMIO-r.patch [bz#1349337] +- kvm-Increase-locked-memory-limit-for-all-users-not-just-.patch [bz#1350735] +- kvm-target-i386-Remove-SSE4a-from-qemu64-CPU-model.patch [bz#1318386 bz#1321139 bz#1321139] +- kvm-target-i386-Remove-ABM-from-qemu64-CPU-model.patch [bz#1318386 bz#1321139 bz#1321139] +- kvm-pc-Recover-PC_RHEL7_1_COMPAT-from-RHEL-7.2-code.patch [bz#1318386 bz#1318386 bz#1321139] +- kvm-pc-Include-missing-PC_COMPAT_2_3-entries-in-PC_RHEL7.patch [bz#1318386 bz#1318386 bz#1321139] +- kvm-vhost-user-disable-chardev-handlers-on-close.patch [bz#1347077] +- kvm-char-clean-up-remaining-chardevs-when-leaving.patch [bz#1347077] +- kvm-socket-add-listen-feature.patch [bz#1347077] +- kvm-socket-unlink-unix-socket-on-remove.patch [bz#1347077] +- kvm-char-do-not-use-atexit-cleanup-handler.patch [bz#1347077] +- kvm-vfio-add-pcie-extended-capability-support.patch [bz#1346688] +- kvm-vfio-pci-Hide-SR-IOV-capability.patch [bz#1346688] +- kvm-memory-Add-MemoryRegionIOMMUOps.notify_started-stopp.patch [bz#1346920] +- kvm-intel_iommu-Throw-hw_error-on-notify_started.patch [bz#1346920] +- Resolves: bz#1318386 + (pc-rhel7.2.0 machine type definition needs some fixes) +- Resolves: bz#1321139 + (qemu-kvm-rhev prints warnings in the default CPU+machine-type configuration.) +- Resolves: bz#1341531 + (qemu gets SIGSEGV when hot-plug a scsi hostdev device with duplicate target address) +- Resolves: bz#1346688 + ([Q35] vfio read-only SR-IOV capability confuses OVMF) +- Resolves: bz#1346920 + (vIOMMU: prevent unsupported configurations with vfio) +- Resolves: bz#1347077 + (vhost-user: A socket file is not deleted after VM's port is detached.) +- Resolves: bz#1349337 + (hw/arm/virt: fix limit of 64-bit ACPI/ECAM PCI MMIO range) +- Resolves: bz#1350735 + (memory locking limit for regular users is too low to launch guests through libvirt) + +* Fri Jul 01 2016 Miroslav Rezanina - rhev-2.6.0-11.el7 +- kvm-Postcopy-Avoid-0-length-discards.patch [bz#1347256] +- kvm-Migration-Split-out-ram-part-of-qmp_query_migrate.patch [bz#1347256] +- kvm-Postcopy-Add-stats-on-page-requests.patch [bz#1347256] +- kvm-test-Postcopy.patch [bz#1347256] +- kvm-tests-fix-libqtest-socket-timeouts.patch [bz#1347256] +- kvm-Postcopy-Check-for-support-when-setting-the-capabili.patch [bz#1347256] +- kvm-rbd-change-error_setg-to-error_setg_errno.patch [bz#1329641] +- kvm-ppc-Disable-huge-page-support-if-it-is-not-available.patch [bz#1347498] +- kvm-acpi-do-not-use-TARGET_PAGE_SIZE.patch [bz#1270345] +- kvm-acpi-convert-linker-from-GArray-to-BIOSLinker-struct.patch [bz#1270345] +- kvm-acpi-simplify-bios_linker-API-by-removing-redundant-.patch [bz#1270345] +- kvm-acpi-cleanup-bios_linker_loader_cleanup.patch [bz#1270345] +- kvm-tpm-apci-cleanup-TCPA-table-initialization.patch [bz#1270345] +- kvm-acpi-make-bios_linker_loader_add_pointer-API-offset-.patch [bz#1270345] +- kvm-acpi-make-bios_linker_loader_add_checksum-API-offset.patch [bz#1270345] +- kvm-pc-dimm-get-memory-region-from-get_memory_region.patch [bz#1270345] +- kvm-pc-dimm-introduce-realize-callback.patch [bz#1270345] +- kvm-pc-dimm-introduce-get_vmstate_memory_region-callback.patch [bz#1270345] +- kvm-nvdimm-support-nvdimm-label.patch [bz#1270345] +- kvm-acpi-add-aml_object_type.patch [bz#1270345] +- kvm-acpi-add-aml_call5.patch [bz#1270345] +- kvm-nvdimm-acpi-set-HDLE-properly.patch [bz#1270345] +- kvm-nvdimm-acpi-save-arg3-of-_DSM-method.patch [bz#1270345] +- kvm-nvdimm-acpi-check-UUID.patch [bz#1270345] +- kvm-nvdimm-acpi-abstract-the-operations-for-root-nvdimm-.patch [bz#1270345] +- kvm-nvdimm-acpi-check-revision.patch [bz#1270345] +- kvm-nvdimm-acpi-support-Get-Namespace-Label-Size-functio.patch [bz#1270345] +- kvm-nvdimm-acpi-support-Get-Namespace-Label-Data-functio.patch [bz#1270345] +- kvm-nvdimm-acpi-support-Set-Namespace-Label-Data-functio.patch [bz#1270345] +- kvm-docs-add-NVDIMM-ACPI-documentation.patch [bz#1270345] +- kvm-Fix-qemu-kvm-does-not-quit-when-booting-guest-w-241-.patch [bz#1126666] +- kvm-Adjust-locked-memory-limits-to-allow-unprivileged-VM.patch [bz#1350735] +- kvm-dma-helpers-dma_blk_io-cancel-support.patch [bz#1346237] +- Resolves: bz#1126666 + (qemu-kvm does not quit when booting guest w/ 161 vcpus and "-no-kvm") +- Resolves: bz#1270345 + ([Intel 7.3 FEAT] Virtualization support for NVDIMM - qemu support) +- Resolves: bz#1329641 + ([RFE]Ceph/RBD block driver for qemu-kvm : change error_setg() to error_setg_errno()) +- Resolves: bz#1346237 + (win 10.x86_64 guest coredump when execute avocado test case: win_virtio_update.install_driver) +- Resolves: bz#1347256 + (Backport 2.7 postcopy fix, test and stats) +- Resolves: bz#1347498 + ([ppc64le] Guest can't boot up with hugepage memdev) +- Resolves: bz#1350735 + (memory locking limit for regular users is too low to launch guests through libvirt) + +* Tue Jun 28 2016 Miroslav Rezanina - rhev-2.6.0-10.el7 +- kvm-block-clarify-error-message-for-qmp-eject.patch [bz#961589] +- kvm-blockdev-clean-up-error-handling-in-do_open_tray.patch [bz#961589] +- kvm-blockdev-clarify-error-on-attempt-to-open-locked-tra.patch [bz#961589] +- kvm-blockdev-backup-Use-bdrv_lookup_bs-on-target.patch [bz#1336310 bz#1339498] +- kvm-blockdev-backup-Don-t-move-target-AioContext-if-it-s.patch [bz#1336310 bz#1339498] +- kvm-virtio-blk-Remove-op-blocker-for-dataplane.patch [bz#1336310 bz#1339498] +- kvm-virtio-scsi-Remove-op-blocker-for-dataplane.patch [bz#1336310 bz#1339498] +- kvm-spec-add-a-sample-kvm.conf-to-enable-Nested-Virtuali.patch [bz#1290150] +- Resolves: bz#1290150 + (Include example kvm.conf with nested options commented out) +- Resolves: bz#1336310 + (virtio-scsi data-plane does not support block management QMP commands) +- Resolves: bz#1339498 + (Core dump when do 'block-job-complete' after 'drive-mirror') +- Resolves: bz#961589 + (rhel7 guest sometimes didnt unlock the cdrom when qemu-kvm trying to eject) + +* Thu Jun 23 2016 Miroslav Rezanina - rhev-2.6.0-9.el7 +- kvm-7.2-machine-type-compatibility.patch [bz#1344269] +- kvm-vhost-user-add-ability-to-know-vhost-user-backend-di.patch [bz#1322087] +- kvm-tests-vhost-user-bridge-add-client-mode.patch [bz#1322087] +- kvm-tests-vhost-user-bridge-workaround-stale-vring-base.patch [bz#1322087] +- kvm-qemu-char-add-qemu_chr_disconnect-to-close-a-fd-acce.patch [bz#1322087] +- kvm-vhost-user-disconnect-on-start-failure.patch [bz#1322087] +- kvm-vhost-net-do-not-crash-if-backend-is-not-present.patch [bz#1322087] +- kvm-vhost-net-save-restore-vhost-user-acked-features.patch [bz#1322087] +- kvm-vhost-net-save-restore-vring-enable-state.patch [bz#1322087] +- kvm-tests-append-i386-tests.patch [bz#1322087] +- kvm-test-start-vhost-user-reconnect-test.patch [bz#1322087] +- kvm-block-Prevent-sleeping-jobs-from-resuming-if-they-ha.patch [bz#1265179] +- kvm-blockjob-move-iostatus-reset-out-of-block_job_enter.patch [bz#1265179] +- kvm-blockjob-rename-block_job_is_paused.patch [bz#1265179] +- kvm-blockjob-add-pause-points.patch [bz#1265179] +- kvm-blockjob-add-block_job_get_aio_context.patch [bz#1265179] +- kvm-block-use-safe-iteration-over-AioContext-notifiers.patch [bz#1265179] +- kvm-blockjob-add-AioContext-attached-callback.patch [bz#1265179] +- kvm-mirror-follow-AioContext-change-gracefully.patch [bz#1265179] +- kvm-backup-follow-AioContext-change-gracefully.patch [bz#1265179] +- kvm-block-Fix-snapshot-on-with-aio-native.patch [bz#1336649] +- kvm-block-iscsi-avoid-potential-overflow-of-acb-task-cdb.patch [bz#1340930] +- kvm-block-fixed-BdrvTrackedRequest-filling-in-bdrv_co_di.patch [bz#1348763] +- kvm-block-fix-race-in-bdrv_co_discard-with-drive-mirror.patch [bz#1348763] +- kvm-block-process-before_write_notifiers-in-bdrv_co_disc.patch [bz#1348763] +- Resolves: bz#1265179 + (With dataplane, when migrate to remote NBD disk after drive-mirror, qemu core dump ( both src host and des host)) +- Resolves: bz#1322087 + (No recovery after vhost-user process restart) +- Resolves: bz#1336649 + ([RHEL.7.3] Guest will not boot up when specify aio=native and snapshot=on together) +- Resolves: bz#1340930 + (CVE-2016-5126 qemu-kvm-rhev: Qemu: block: iscsi: buffer overflow in iscsi_aio_ioctl [rhel-7.3]) +- Resolves: bz#1344269 + (Migration: Fixup machine types and HW_COMPAT (stage 2a)) +- Resolves: bz#1348763 + (Fix dirty marking with block discard requests) + +* Tue Jun 21 2016 Miroslav Rezanina - rhev-2.6.0-8.el7 +- kvm-Disable-Windows-enlightnements.patch [bz#1336517] +- kvm-ppc-spapr-Refactor-h_client_architecture_support-CPU.patch [bz#1341492] +- kvm-ppc-Split-pcr_mask-settings-into-supported-bits-and-.patch [bz#1341492] +- kvm-ppc-Provide-function-to-get-CPU-class-of-the-host-CP.patch [bz#1341492] +- kvm-ppc-Improve-PCR-bit-selection-in-ppc_set_compat.patch [bz#1341492] +- kvm-ppc-Add-PowerISA-2.07-compatibility-mode.patch [bz#1341492] +- kvm-machine-types-fix-pc_machine_-_options-chain.patch [bz#1344320] +- kvm-Fix-rhel6-rom-file.patch [bz#1344320] +- kvm-fix-vga-type-for-older-machines.patch [bz#1344320] +- kvm-Revert-aio_notify-force-main-loop-wakeup-with-SIGIO-.patch [bz#1188656] +- kvm-Make-avx2-configure-test-work-with-O2.patch [bz#1323294] +- kvm-avx2-configure-Use-primitives-in-test.patch [bz#1323294] +- kvm-vfio-Fix-broken-EEH.patch [bz#1346627] +- Resolves: bz#1188656 + (lost block IO completion notification (for virtio-scsi disk) hangs main loop) +- Resolves: bz#1323294 + (AVX-2 migration optimisation) +- Resolves: bz#1336517 + (Disable hv-vpindex, hv-runtime, hv-reset, hv-synic & hv-stimer enlightenment for Windows) +- Resolves: bz#1341492 + (QEMU on POWER does not support the PowerISA 2.07 compatibility mode) +- Resolves: bz#1344320 + (migration: fix pc_i440fx_*_options chaining) +- Resolves: bz#1346627 + (qemu discards EEH ioctl results) + +* Thu Jun 16 2016 Miroslav Rezanina - rhev-2.6.0-7.el7 +- kvm-pc-allow-raising-low-memory-via-max-ram-below-4g-opt.patch [bz#1176144] +- kvm-vga-add-sr_vbe-register-set.patch [bz#1331415 bz#1346976] +- Resolves: bz#1176144 + ([Nokia RHEL 7.3 Feature]: 32-bit operating systems get very little memory space with new Qemu's) +- Resolves: bz#1331415 + (CVE-2016-3710 qemu-kvm-rhev: qemu: incorrect banked access bounds checking in vga module [rhel-7.3]) +- Resolves: bz#1346976 + (Regression from CVE-2016-3712: windows installer fails to start) +- Resolves: bz#1339467 + (User can not create windows 7 virtual machine in rhevm3.6.5.) + +* Wed Jun 15 2016 Miroslav Rezanina - rhev-2.6.0-6.el7 +- kvm-throttle-refuse-iops-size-without-iops-total-read-wr.patch [bz#1342330] +- kvm-scsi-mark-TYPE_SCSI_DISK_BASE-as-abstract.patch [bz#1338043] +- kvm-scsi-disk-add-missing-break.patch [bz#1338043] +- kvm-Disable-spapr-rng.patch [bz#1343891] +- kvm-spec-Update-rules-before-triggering-for-kvm-device.patch [bz#1338755] +- kvm-spec-Do-not-package-ivshmem-server-and-ivshmem-clien.patch [bz#1320476] +- Resolves: bz#1320476 + (Failed to upgrade qemu-kvm-tools-rhev from 2.3.0 to 2.5.0) +- Resolves: bz#1338043 + (scsi-block fix - receive the right SCSI status on reads and writes) +- Resolves: bz#1338755 + (qemu-kvm-rhev doesn't reload udev rules before triggering for kvm device) +- Resolves: bz#1342330 + (There is no error prompt when set the io throttling parameters iops_size without iops) +- Resolves: bz#1343891 + (Disable spapr-rng device in downstream qemu 2.6) + +* Mon Jun 06 2016 Miroslav Rezanina - rhev-2.6.0-5.el7 +- kvm-spapr-update-RHEL-7.2-machine-type.patch [bz#1316303] +- kvm-migration-fix-HW_COMPAT_RHEL7_2.patch [bz#1316303] +- kvm-target-i386-add-a-generic-x86-nmi-handler.patch [bz#1335720] +- kvm-nmi-remove-x86-specific-nmi-handling.patch [bz#1335720] +- kvm-cpus-call-the-core-nmi-injection-function.patch [bz#1335720] +- kvm-spec-link-sgabios.bin-only-for-x86_64.patch [bz#1337917] +- kvm-Add-PCIe-bridge-devices-for-AArch64.patch [bz#1326420] +- kvm-Remove-unsupported-VFIO-devices-from-QEMU.patch [bz#1326420] +- kvm-hw-net-spapr_llan-Delay-flushing-of-the-RX-queue-whi.patch [bz#1210221] +- kvm-hw-net-spapr_llan-Provide-counter-with-dropped-rx-fr.patch [bz#1210221] +- kvm-iscsi-pass-SCSI-status-back-for-SG_IO.patch [bz#1338043] +- kvm-dma-helpers-change-BlockBackend-to-opaque-value-in-D.patch [bz#1338043] +- kvm-scsi-disk-introduce-a-common-base-class.patch [bz#1338043] +- kvm-scsi-disk-introduce-dma_readv-and-dma_writev.patch [bz#1338043] +- kvm-scsi-disk-add-need_fua_emulation-to-SCSIDiskClass.patch [bz#1338043] +- kvm-scsi-disk-introduce-scsi_disk_req_check_error.patch [bz#1338043] +- kvm-scsi-block-always-use-SG_IO.patch [bz#1338043] +- kvm-tools-kvm_stat-Powerpc-related-fixes.patch [bz#1337033] +- kvm-pc-New-default-pc-i440fx-rhel7.3.0-machine-type.patch [bz#1305121] +- kvm-7.3-mismerge-fix-Fix-ich9-intel-hda-compatibility.patch [bz#1342015] +- kvm-PC-migration-compat-Section-footers-global-state.patch [bz#1342015] +- kvm-fw_cfg-for-7.2-compatibility.patch [bz#1342015] +- kvm-pc-Create-new-pc-q35-rhel7.3.0-machine-type.patch [bz#1342015] +- kvm-q35-Remove-7.0-7.1-7.2-machine-types.patch [bz#1342015] +- Resolves: bz#1210221 + (Netperf UDP_STREAM Lost most of the packets on spapr-vlan device) +- Resolves: bz#1305121 + (rhel7.3.0 machine-types) +- Resolves: bz#1316303 + (Live migration of VMs from RHEL 7.2 <--> 7.3 with pseries-rhel7.2.0 machine type (qemu 2.6)) +- Resolves: bz#1326420 + (AArch64: clean and add devices to fully support aarch64 vm) +- Resolves: bz#1335720 + (watchdog action 'inject-nmi' takes no effect) +- Resolves: bz#1337033 + (kvm_stat AttributeError: 'ArchPPC' object has no attribute 'exit_reasons') +- Resolves: bz#1337917 + (qemu-kvm-rhev: Only ship /usr/share/qemu-kvm/sgabios.bin on x86) +- Resolves: bz#1338043 + (scsi-block fix - receive the right SCSI status on reads and writes) +- Resolves: bz#1342015 + (Migration: Fixup machine types and HW_COMPAT (stage 1b)) + +* Wed May 25 2016 Miroslav Rezanina - rhev-2.6.0-4.el7 +- kvm-pc-Use-right-HW_COMPAT_-macros-at-PC_RHEL7-compat-ma.patch [bz#1318386] +- kvm-compat-Add-missing-any_layout-in-HW_COMPAT_RHEL7_1.patch [bz#1318386] +- kvm-RHEL-Disable-unsupported-PowerPC-CPU-models.patch [bz#1317977] +- kvm-spec-Use-correct-upstream-QEMU-version.patch [bz#1335705] +- Resolves: bz#1317977 + (qemu-kvm-rhev supports a lot of CPU models) +- Resolves: bz#1318386 + (pc-rhel7.2.0 machine type definition needs some fixes) +- Resolves: bz#1335705 + ('QEMU 2.5.94 monitor' is used for qemu-kvm-rhev-2.6.0-1.el7.x86_64) + +* Mon May 23 2016 Miroslav Rezanina - rhev-2.6.0-3.el7 +- kvm-qmp-Report-drive_add-error-to-monitor.patch [bz#1337100] +- kvm-spec-Remove-dependency-to-ipxe-roms-qemu-for-aarch64.patch [bz#1337496] +- Resolves: bz#1337100 + (redhat_drive_add should report error to qmp if it fails to initialize) +- Resolves: bz#1337496 + (qemu-kvm-rhev should not depend on ipxe-roms-qemu on aarch64) + +* Tue May 17 2016 Miroslav Rezanina - rhev-2.6.0-2.el7 +- kvm-Fix-SLOF-dependency.patch [bz#1336296] +- Resolves: bz#1336296 + (failed dependencies on SLOF) + +* Thu May 12 2016 Miroslav Rezanina - rhev-2.6.0-1.el7 +- Rebase to QEMU 2.6.0 [bz#1289417] +- Resolves: bz#1289417 + (Rebase to QEMU 2.6) + +* Wed Oct 14 2015 Miroslav Rezanina - rhev-2.3.0-31.el7 +- kvm-Migration-Generate-the-completed-event-only-when-we-.patch [bz#1271145] +- Resolves: bz#1271145 + (Guest OS paused after migration.) + +* Mon Oct 12 2015 Jeff E. Nelson - rhev-2.3.0-30.el7 +- kvm-memhp-extend-address-auto-assignment-to-support-gaps.patch [bz#1267533] +- kvm-pc-memhp-force-gaps-between-DIMM-s-GPA.patch [bz#1267533] +- kvm-memory-allow-destroying-a-non-empty-MemoryRegion.patch [bz#1264347] +- kvm-hw-do-not-pass-NULL-to-memory_region_init-from-insta.patch [bz#1264347] +- kvm-tests-Fix-how-qom-test-is-run.patch [bz#1264347] +- kvm-libqtest-Clean-up-unused-QTestState-member-sigact_ol.patch [bz#1264347] +- kvm-libqtest-New-hmp-friends.patch [bz#1264347] +- kvm-device-introspect-test-New-covering-device-introspec.patch [bz#1264347] +- kvm-qmp-Fix-device-list-properties-not-to-crash-for-abst.patch [bz#1264347] +- kvm-qdev-Protect-device-list-properties-against-broken-d.patch [bz#1264347] +- kvm-Revert-qdev-Use-qdev_get_device_class-for-device-typ.patch [bz#1264347] +- Resolves: bz#1264347 + (QMP device-list-properties crashes for CPU devices) +- Resolves: bz#1267533 + (qemu quit when rebooting guest which hotplug memory >=13 times) + +* Thu Oct 08 2015 Miroslav Rezanina - rhev-2.3.0-29.el7 +- kvm-vfio-Remove-unneeded-union-from-VFIOContainer.patch [bz#1259556] +- kvm-vfio-Generalize-vfio_listener_region_add-failure-pat.patch [bz#1259556] +- kvm-vfio-Check-guest-IOVA-ranges-against-host-IOMMU-capa.patch [bz#1259556] +- kvm-vfio-Record-host-IOMMU-s-available-IO-page-sizes.patch [bz#1259556] +- kvm-memory-Allow-replay-of-IOMMU-mapping-notifications.patch [bz#1259556] +- kvm-vfio-Allow-hotplug-of-containers-onto-existing-guest.patch [bz#1259556] +- kvm-spapr_pci-Allow-PCI-host-bridge-DMA-window-to-be-con.patch [bz#1259556] +- kvm-spapr_iommu-Rename-vfio_accel-parameter.patch [bz#1259556] +- kvm-spapr_iommu-Provide-a-function-to-switch-a-TCE-table.patch [bz#1259556] +- kvm-spapr_pci-Allow-VFIO-devices-to-work-on-the-normal-P.patch [bz#1259556] +- Resolves: bz#1259556 + (Allow VFIO devices on the same guest PHB as emulated devices) + +* Mon Oct 05 2015 Miroslav Rezanina - rhev-2.3.0-28.el7 +- kvm-rhel-Revert-unwanted-cannot_instantiate_with_device_.patch [bz#1224542] +- kvm-Disable-additional-e1000-models.patch [bz#1224542 bz#1265161] +- kvm-Remove-intel-iommu-device.patch [bz#1224542] +- kvm-virtio-net-unbreak-self-announcement-and-guest-offlo.patch [bz#1262232] +- kvm-block-mirror-fix-full-sync-mode-when-target-does-not.patch [bz#1136382] +- Resolves: bz#1136382 + (block: Mirroring to raw block device doesn't zero out unused blocks) +- Resolves: bz#1224542 + (unsupported devices need to be disabled in qemu-kvm-rhev after rebasing to 2.3.0) +- Resolves: bz#1262232 + (self announcement and ctrl offloads does not work after migration) +- Resolves: bz#1265161 + (Support various e1000 variants) + +* Wed Sep 30 2015 Miroslav Rezanina - rhev-2.3.0-27.el7 +- kvm-sdl2-Fix-RGB555.patch [bz#1247479] +- kvm-spice-surface-switch-fast-path-requires-same-format-.patch [bz#1247479] +- kvm-virtio-blk-only-clear-VIRTIO_F_ANY_LAYOUT-for-legacy.patch [bz#1207687] +- kvm-vhost-enable-vhost-without-without-MSI-X.patch [bz#1207687] +- kvm-vhost-user-Send-VHOST_RESET_OWNER-on-vhost-stop.patch [bz#1207687] +- kvm-virtio-avoid-leading-underscores-for-helpers.patch [bz#1207687] +- kvm-vhost-user-use-VHOST_USER_XXX-macro-for-switch-state.patch [bz#1207687] +- kvm-vhost-user-add-protocol-feature-negotiation.patch [bz#1207687] +- kvm-vhost-rename-VHOST_RESET_OWNER-to-VHOST_RESET_DEVICE.patch [bz#1207687] +- kvm-vhost-user-add-VHOST_USER_GET_QUEUE_NUM-message.patch [bz#1207687] +- kvm-vhost-introduce-vhost_backend_get_vq_index-method.patch [bz#1207687] +- kvm-vhost-user-add-multiple-queue-support.patch [bz#1207687] +- kvm-vhost-user-add-a-new-message-to-disable-enable-a-spe.patch [bz#1207687] +- Resolves: bz#1207687 + ([6wind 7.2 FEAT]: vhost-user does not support multique) +- Resolves: bz#1247479 + (display mess when boot a win2012-r2-64 guest with -vga std) + +* Thu Sep 24 2015 Miroslav Rezanina - rhev-2.3.0-26.el7 +- kvm-qcow2-Make-size_to_clusters-return-uint64_t.patch [bz#1260365] +- kvm-iotests-Add-test-for-checking-large-image-files.patch [bz#1260365] +- Resolves: bz#1260365 + (Guest image created coredump after installation.) + +* Wed Sep 23 2015 Miroslav Rezanina - rhev-2.3.0-25.el7 +- kvm-block-backend-Expose-bdrv_write_zeroes.patch [bz#1256541] +- kvm-qemu-img-convert-Rewrite-copying-logic.patch [bz#1256541] +- kvm-main-loop-fix-qemu_notify_event-for-aio_notify-optim.patch [bz#1256541] +- kvm-error-New-error_fatal.patch [bz#1232308] +- kvm-Fix-bad-error-handling-after-memory_region_init_ram.patch [bz#1232308] +- kvm-loader-Fix-memory_region_init_resizeable_ram-error-h.patch [bz#1232308] +- kvm-memory-Fix-bad-error-handling-in-memory_region_init_.patch [bz#1232308] +- kvm-spapr_pci-encode-class-code-including-Prog-IF-regist.patch [bz#1264845] +- kvm-scripts-dump-guest-memory.py-fix-after-RAMBlock-chan.patch [bz#1234802] +- kvm-spec-Require-proper-version-of-SLOF.patch [bz#1263795] +- Resolves: bz#1232308 + ([abrt] qemu-system-x86: qemu_ram_alloc(): qemu-system-x86_64 killed by SIGABRT) +- Resolves: bz#1234802 + ([RHEL7.2] dump-guest-memory failed because of Python Exception There is no member named length.) +- Resolves: bz#1256541 + (qemu-img hangs forever in aio_poll when used to convert some images) +- Resolves: bz#1263795 + (vfio device can't be hot unplugged on powerpc guest) +- Resolves: bz#1264845 + ([regression] Guest usb mouse/keyboard could not be used on qemu-kvm-rhev-2.3.0-24.el7.ppc64le) + +* Fri Sep 18 2015 Miroslav Rezanina - rhev-2.3.0-24.el7 +- kvm-spapr-Don-t-use-QOM-syntax-for-DR-connectors.patch [bz#1262143] +- kvm-virtio-mmio-ioeventfd-support.patch [bz#1185480] +- kvm-scsi-fix-buffer-overflow-in-scsi_req_parse_cdb-CVE-2.patch [bz#1244334] +- kvm-spapr-Populate-ibm-associativity-lookup-arrays-corre.patch [bz#1262670] +- kvm-ppc-spapr-Fix-buffer-overflow-in-spapr_populate_drco.patch [bz#1262670] +- kvm-spapr_pci-Introduce-a-liobn-number-generating-macros.patch [bz#1263795] +- kvm-spapr_iommu-Make-spapr_tce_find_by_liobn-public.patch [bz#1263795] +- kvm-spapr_pci-Rework-device-tree-rendering.patch [bz#1263795] +- kvm-spapr_pci-enumerate-and-add-PCI-device-tree.patch [bz#1263795] +- kvm-spapr_pci-populate-ibm-loc-code.patch [bz#1263795] +- kvm-tests-remove-irrelevant-assertions-from-test-aio.patch [bz#1211689] +- kvm-aio-posix-move-pollfds-to-thread-local-storage.patch [bz#1211689] +- kvm-aio-Introduce-type-in-aio_set_fd_handler-and-aio_set.patch [bz#1211689] +- kvm-aio-Save-type-to-AioHandler.patch [bz#1211689] +- kvm-aio-posix-Introduce-aio_poll_clients.patch [bz#1211689] +- kvm-block-Mark-fd-handlers-as-protocol.patch [bz#1211689] +- kvm-nbd-Mark-fd-handlers-client-type-as-nbd-server.patch [bz#1211689] +- kvm-aio-Mark-ctx-notifier-s-client-type-as-context.patch [bz#1211689] +- kvm-dataplane-Mark-host-notifiers-client-type-as-datapla.patch [bz#1211689] +- kvm-block-Introduce-bdrv_aio_poll.patch [bz#1211689] +- kvm-block-Replace-nested-aio_poll-with-bdrv_aio_poll.patch [bz#1211689] +- kvm-block-Only-poll-block-layer-fds-in-bdrv_aio_poll.patch [bz#1211689] +- Resolves: bz#1185480 + (backport ioeventfd support for virtio-mmio) +- Resolves: bz#1211689 + (atomic live snapshots are not atomic with dataplane-backed devices) +- Resolves: bz#1244334 + (qemu-kvm-rhev: Qemu: scsi stack buffer overflow [rhel-7.2]) +- Resolves: bz#1262143 + (VM startup is very slow with large amounts of hotpluggable memory) +- Resolves: bz#1262670 + ([PowerKVM]SIGSEGV when boot up guest with -numa node and set up the cpus in one node to the boundary) +- Resolves: bz#1263795 + (vfio device can't be hot unplugged on powerpc guest) + +* Tue Sep 15 2015 Miroslav Rezanina - rhev-2.3.0-23.el7 +- kvm-scsi-disk-Fix-assertion-failure-on-WRITE-SAME.patch [bz#1247042] +- kvm-mirror-Speed-up-bitmap-initial-scanning.patch [bz#1259229] +- kvm-qemu-iotests-Disable-099-requires-blkverify.patch [bz#1257059] +- kvm-spapr-Reduce-advertised-max-LUNs-for-spapr_vscsi.patch [bz#1260464] +- kvm-vnc-Don-t-assert-if-opening-unix-socket-fails.patch [bz#1261263] +- kvm-qcow2-Handle-EAGAIN-returned-from-update_refcount.patch [bz#1254927] +- kvm-pc-memhotplug-fix-incorrectly-set-reserved-memory-en.patch [bz#1261846] +- kvm-pc-memhotplug-keep-reserved-memory-end-broken-on-rhe.patch [bz#1261846] +- Resolves: bz#1247042 + (qemu quit when using sg_write_same command inside RHEL7.2 guest) +- Resolves: bz#1254927 + (qemu-img shows Input/output error when compressing guest image) +- Resolves: bz#1257059 + (qemu-iotests 099 failed for vmdk) +- Resolves: bz#1259229 + (drive-mirror blocks QEMU due to lseek64() on raw image files) +- Resolves: bz#1260464 + (The spapr vscsi disks for lun id '9-31' and channel id '4-7' could not be recognized inside a power pc guest) +- Resolves: bz#1261263 + (qemu crash while start a guest with invalid vnc socket path) +- Resolves: bz#1261846 + (qemu-kvm-rhev: 64-bit PCI bars may overlap hotplugged memory and vice verse) + +* Thu Sep 03 2015 Miroslav Rezanina - rhev-2.3.0-22.el7 +- kvm-mirror-Fix-coroutine-reentrance.patch [bz#1251487] +- kvm-RHEL-Set-vcpus-hard-limit-to-240-for-Power.patch [bz#1257781] +- kvm-provide-vhost-module-config-file-with-max_mem_region.patch [bz#1255349] +- Resolves: bz#1251487 + (qemu core dump when do drive mirror) +- Resolves: bz#1255349 + (vhost: default value of 'max_mem_regions' should be set larger(>=260) than 64) +- Resolves: bz#1257781 + (The prompt is confusing when boot a guest with larger vcpu number than host physical cpu) + +* Fri Aug 28 2015 Miroslav Rezanina - rhev-2.3.0-21.el7 +- kvm-vnc-fix-memory-corruption-CVE-2015-5225.patch [bz#1255898] +- Resolves: bz#1255898 + (CVE-2015-5225 qemu-kvm-rhev: Qemu: ui: vnc: heap memory corruption in vnc_refresh_server_surface [rhel-7.2]) + +* Thu Aug 27 2015 Yash Mankad - rhev-2.3.0-20.el7 +- kvm-pseries-define-coldplugged-devices-as-configured.patch [bz#1243721] +- kvm-spice-fix-spice_chr_add_watch-pre-condition.patch [bz#1128992] +- Resolves: bz#1128992 + (Spiceport character device is not reliable caused domain shutoff) +- Resolves: bz#1243721 + (After hotunpug virtio device, the device still exist in pci info) + +* Mon Aug 24 2015 Miroslav Rezanina - rhev-2.3.0-19.el7 +- kvm-ppc-add-helpful-message-when-KVM-fails-to-start-VCPU.patch [bz#1215618] +- kvm-pci-allow-0-address-for-PCI-IO-MEM-regions.patch [bz#1241886] +- kvm-RHEL-Suppress-scary-but-unimportant-errors-for-KVM-V.patch [bz#1237034] +- Resolves: bz#1215618 + (Unhelpful error message on Power when SMT is enabled) +- Resolves: bz#1237034 + (Error prompt while booting with vfio-pci device) +- Resolves: bz#1241886 + (hot plugged pci devices won't appear unless reboot) + +* Fri Aug 14 2015 Miroslav Rezanina - rhev-2.3.0-18.el7 +- kvm-vhost-correctly-pass-error-to-caller-in-vhost_dev_en.patch [bz#1248312] +- kvm-Revert-virtio-net-enable-virtio-1.0.patch [bz#1248312] +- kvm-virtio-net-unbreak-any-layout.patch [bz#1248312] +- kvm-virtio-hide-legacy-features-from-modern-guests.patch [bz#1248312] +- kvm-virtio-serial-fix-ANY_LAYOUT.patch [bz#1248312] +- kvm-virtio-9p-fix-any_layout.patch [bz#1248312] +- kvm-virtio-set-any_layout-in-virtio-core.patch [bz#1248312] +- kvm-virtio-pci-fix-memory-MR-cleanup-for-modern.patch [bz#1248312] +- kvm-virtio-get_features-can-fail.patch [bz#1248312] +- kvm-virtio-blk-fail-get_features-when-both-scsi-and-1.0-.patch [bz#1248312] +- kvm-virtio-minor-cleanup.patch [bz#1248312] +- kvm-memory-do-not-add-a-reference-to-the-owner-of-aliase.patch [bz#1248312] +- kvm-virtio-net-remove-virtio-queues-if-the-guest-doesn-t.patch [bz#1248312] +- kvm-virtio-fix-1.0-virtqueue-migration.patch [bz#1248312] +- kvm-Downstream-only-Start-kvm-setup-service-before-libvi.patch [bz#1251962] +- kvm-qcow2-Flush-pending-discards-before-allocating-clust.patch [bz#1226297] +- Resolves: bz#1226297 + (qcow2 crash during discard operation) +- Resolves: bz#1248312 + ("fdisk -l"can not output anything and the process status is D+ after migrating RHEL7.2 guest with virtio-1 virtio-scsi disk) +- Resolves: bz#1251962 + (kvm-setup.service should include Before=libvirtd.service) + +* Wed Aug 12 2015 Miroslav Rezanina - rhev-2.3.0-17.el7 +- kvm-migration-avoid-divide-by-zero-in-xbzrle-cache-miss-.patch [bz#580006] +- kvm-migration-move-ram-stuff-to-migration-ram.patch [bz#580006] +- kvm-migration-move-savevm.c-inside-migration.patch [bz#580006] +- kvm-migration-Add-myself-to-the-copyright-list-of-both-f.patch [bz#580006] +- kvm-migration-reduce-include-files.patch [bz#580006] +- kvm-migration-Remove-duplicated-assignment-of-SETUP-stat.patch [bz#580006] +- kvm-migration-create-savevm_state.patch [bz#580006] +- kvm-migration-Use-normal-VMStateDescriptions-for-Subsect.patch [bz#580006] +- kvm-Add-qemu_get_counted_string-to-read-a-string-prefixe.patch [bz#580006] +- kvm-runstate-Add-runstate-store.patch [bz#580006] +- kvm-runstate-migration-allows-more-transitions-now.patch [bz#580006] +- kvm-migration-create-new-section-to-store-global-state.patch [bz#580006] +- kvm-global_state-Make-section-optional.patch [bz#580006] +- kvm-vmstate-Create-optional-sections.patch [bz#580006] +- kvm-migration-Add-configuration-section.patch [bz#580006] +- kvm-migration-ensure-we-start-in-NONE-state.patch [bz#580006] +- kvm-migration-Use-always-helper-to-set-state.patch [bz#580006] +- kvm-migration-No-need-to-call-trace_migrate_set_state.patch [bz#580006] +- kvm-migration-create-migration-event.patch [bz#580006] +- kvm-migration-Make-events-a-capability.patch [bz#580006] +- kvm-migration-Add-migration-events-on-target-side.patch [bz#580006] +- kvm-migration-Only-change-state-after-migration-has-fini.patch [bz#580006] +- kvm-migration-Trace-event-and-migration-event-are-differ.patch [bz#580006] +- kvm-migration-Write-documetation-for-events-capabilites.patch [bz#580006] +- kvm-migration-Register-global-state-section-before-loadv.patch [bz#580006] +- kvm-migration-We-also-want-to-store-the-global-state-for.patch [bz#580006] +- kvm-block-mirror-limit-qiov-to-IOV_MAX-elements.patch [bz#1238585] +- kvm-i6300esb-fix-timer-overflow.patch [bz#1247893] +- Resolves: bz#1238585 + (drive-mirror has spurious failures with low 'granularity' values) +- Resolves: bz#1247893 + (qemu's i6300esb watchdog does not fire on time with large heartbeat like 2046) +- Resolves: bz#580006 + (QMP: A QMP event notification when migration finish.) + +* Fri Aug 07 2015 Miroslav Rezanina - rhev-2.3.0-16.el7 +- kvm-virtio-scsi-use-virtqueue_map_sg-when-loading-reques.patch [bz#1160169] +- kvm-scsi-disk-fix-cmd.mode-field-typo.patch [bz#1160169] +- kvm-target-i386-emulate-CPUID-level-of-real-hardware.patch [bz#1223317] +- kvm-target-i386-fix-IvyBridge-xlevel-in-PC_COMPAT_2_3.patch [bz#1223317] +- Resolves: bz#1160169 + (Segfault occurred at Dst VM while completed migration upon ENOSPC) +- Resolves: bz#1223317 + (BSod occurs When installing latest Windows Enterprise Insider 10 and windows server 2016 Preview) + +* Wed Aug 05 2015 Miroslav Rezanina - rhev-2.3.0-15.el7 +- kvm-usb-ccid-add-missing-wakeup-calls.patch [bz#1211970] +- kvm-vfio-pci-Fix-bootindex.patch [bz#1245127] +- kvm-acpi-fix-pvpanic-device-is-not-shown-in-ui.patch [bz#1238141] +- kvm-redhat-add-kvm-unit-tests-tarball-to-environment.patch [bz#1225980] +- kvm-spec-Build-tscdeadline_latency.flat-from-kvm-unit-te.patch [bz#1225980] +- Resolves: bz#1211970 + (smart card emulation doesn't work with USB3 (nec-xhci) controller) +- Resolves: bz#1225980 + (Package tscdeadline_latency.flat with qemu-kvm-rhev) +- Resolves: bz#1238141 + ([virtio-win][pvpanic]win10-32 guest can not detect pvpanic device in device manager) +- Resolves: bz#1245127 + (bootindex doesn't work for vfio-pci) + +* Fri Jul 31 2015 Miroslav Rezanina - rhev-2.3.0-14.el7 +- kvm-rtl8139-avoid-nested-ifs-in-IP-header-parsing-CVE-20.patch [bz#1248768] +- kvm-rtl8139-drop-tautologous-if-ip-.-statement-CVE-2015-.patch [bz#1248768] +- kvm-rtl8139-skip-offload-on-short-Ethernet-IP-header-CVE.patch [bz#1248768] +- kvm-rtl8139-check-IP-Header-Length-field-CVE-2015-5165.patch [bz#1248768] +- kvm-rtl8139-check-IP-Total-Length-field-CVE-2015-5165.patch [bz#1248768] +- kvm-rtl8139-skip-offload-on-short-TCP-header-CVE-2015-51.patch [bz#1248768] +- kvm-rtl8139-check-TCP-Data-Offset-field-CVE-2015-5165.patch [bz#1248768] +- Resolves: bz#1248768 + (EMBARGOED CVE-2015-5165 qemu-kvm-rhev: Qemu: rtl8139 uninitialized heap memory information leakage to guest [rhel-7.2]) + +* Fri Jul 24 2015 Miroslav Rezanina - rhev-2.3.0-13.el7 +- kvm-block-Add-bdrv_get_block_status_above.patch [bz#1242316] +- kvm-qmp-Add-optional-bool-unmap-to-drive-mirror.patch [bz#1242316] +- kvm-mirror-Do-zero-write-on-target-if-sectors-not-alloca.patch [bz#1242316] +- kvm-block-Fix-dirty-bitmap-in-bdrv_co_discard.patch [bz#1242316] +- kvm-block-Remove-bdrv_reset_dirty.patch [bz#1242316] +- kvm-iotests-add-QMP-event-waiting-queue.patch [bz#1242316] +- kvm-qemu-iotests-Make-block-job-methods-common.patch [bz#1242316] +- kvm-qemu-iotests-Add-test-case-for-mirror-with-unmap.patch [bz#1242316] +- kvm-iotests-Use-event_wait-in-wait_ready.patch [bz#1242316] +- kvm-rdma-fix-memory-leak.patch [bz#1210715] +- kvm-Only-try-and-read-a-VMDescription-if-it-should-be-th.patch [bz#1210715] +- kvm-qemu_ram_foreach_block-pass-up-error-value-and-down-.patch [bz#1210715] +- kvm-rdma-Fix-qemu-crash-when-IPv6-address-is-used-for-mi.patch [bz#1210715] +- kvm-Rename-RDMA-structures-to-make-destination-clear.patch [bz#1210715] +- kvm-Remove-unneeded-memset.patch [bz#1210715] +- kvm-rdma-typos.patch [bz#1210715] +- kvm-Store-block-name-in-local-blocks-structure.patch [bz#1210715] +- kvm-Translate-offsets-to-destination-address-space.patch [bz#1210715] +- kvm-Rework-ram_control_load_hook-to-hook-during-block-lo.patch [bz#1210715] +- kvm-Allow-rdma_delete_block-to-work-without-the-hash.patch [bz#1210715] +- kvm-Rework-ram-block-hash.patch [bz#1210715] +- kvm-Sort-destination-RAMBlocks-to-be-the-same-as-the-sou.patch [bz#1210715] +- kvm-Sanity-check-RDMA-remote-data.patch [bz#1210715] +- kvm-Fail-more-cleanly-in-mismatched-RAM-cases.patch [bz#1210715] +- kvm-migration-Use-cmpxchg-correctly.patch [bz#1210715] +- kvm-RDMA-Fix-error-exits-for-2.4.patch [bz#1210715] +- kvm-block-mirror-Sleep-periodically-during-bitmap-scanni.patch [bz#1233826] +- kvm-block-curl-Don-t-lose-original-error-when-a-connecti.patch [bz#1235813] +- kvm-vfio-pci-Add-pba_offset-PCI-quirk-for-Chelsio-T5-dev.patch [bz#1244348] +- kvm-hostmem-Fix-qemu_opt_get_bool-crash-in-host_memory_b.patch [bz#1237220] +- kvm-pc-pc-dimm-Extract-hotplug-related-fields-in-PCMachi.patch [bz#1211117] +- kvm-pc-pc-dimm-Factor-out-reusable-parts-in-pc_dimm_plug.patch [bz#1211117] +- kvm-pc-Abort-if-HotplugHandlerClass-plug-fails.patch [bz#1211117] +- kvm-numa-pc-dimm-Store-pc-dimm-memory-information-in-num.patch [bz#1211117] +- kvm-numa-Store-boot-memory-address-range-in-node_info.patch [bz#1211117] +- kvm-numa-API-to-lookup-NUMA-node-by-address.patch [bz#1211117] +- kvm-docs-add-sPAPR-hotplug-dynamic-reconfiguration-docum.patch [bz#1211117] +- kvm-machine-add-default_ram_size-to-machine-class.patch [bz#1211117] +- kvm-spapr-override-default-ram-size-to-512MB.patch [bz#1211117] +- kvm-spapr_pci-Make-find_phb-find_dev-public.patch [bz#1211117] +- kvm-spapr-Merge-sPAPREnvironment-into-sPAPRMachineState.patch [bz#1211117] +- kvm-spapr-Remove-obsolete-ram_limit-field-from-sPAPRMach.patch [bz#1211117] +- kvm-spapr-Remove-obsolete-entry_point-field-from-sPAPRMa.patch [bz#1211117] +- kvm-spapr-Add-sPAPRMachineClass.patch [bz#1211117] +- kvm-spapr-ensure-we-have-at-least-one-XICS-server.patch [bz#1211117] +- kvm-spapr-Consider-max_cpus-during-xics-initialization.patch [bz#1211117] +- kvm-spapr-Support-ibm-lrdr-capacity-device-tree-property.patch [bz#1211117] +- kvm-cpus-Add-a-macro-to-walk-CPUs-in-reverse.patch [bz#1211117] +- kvm-spapr-Reorganize-CPU-dt-generation-code.patch [bz#1211117] +- kvm-spapr-Consolidate-cpu-init-code-into-a-routine.patch [bz#1211117] +- kvm-ppc-Update-cpu_model-in-MachineState.patch [bz#1211117] +- kvm-xics_kvm-Don-t-enable-KVM_CAP_IRQ_XICS-if-already-en.patch [bz#1211117] +- kvm-spapr-Initialize-hotplug-memory-address-space.patch [bz#1211117] +- kvm-spapr-Add-LMB-DR-connectors.patch [bz#1211117] +- kvm-spapr-Support-ibm-dynamic-reconfiguration-memory.patch [bz#1211117] +- kvm-spapr-Make-hash-table-size-a-factor-of-maxram_size.patch [bz#1211117] +- kvm-spapr-Memory-hotplug-support.patch [bz#1211117] +- kvm-spapr-Don-t-allow-memory-hotplug-to-memory-less-node.patch [bz#1211117] +- Resolves: bz#1210715 + (migration/rdma: 7.1->7.2: RDMA ERROR: ram blocks mismatch #3!) +- Resolves: bz#1211117 + (add support for memory hotplug on Power) +- Resolves: bz#1233826 + (issueing drive-mirror command causes monitor unresponsive) +- Resolves: bz#1235813 + (block/curl: Fix generic "Input/output error" on failure) +- Resolves: bz#1237220 + (Fail to create NUMA guest with ) +- Resolves: bz#1242316 + (Add "unmap" support for drive-mirror) +- Resolves: bz#1244348 + (Quirk for Chelsio T5 MSI-X PBA) + +* Fri Jul 17 2015 Miroslav Rezanina - rhev-2.3.0-12.el7 +- kvm-ide-Check-array-bounds-before-writing-to-io_buffer-C.patch [bz#1243692] +- kvm-ide-atapi-Fix-START-STOP-UNIT-command-completion.patch [bz#1243692] +- kvm-ide-Clear-DRQ-after-handling-all-expected-accesses.patch [bz#1243692] +- Resolves: bz#1243692 + () + +* Fri Jul 17 2015 Miroslav Rezanina - rhev-2.3.0-11.el7 +- kvm-hw-acpi-acpi_pm1_cnt_init-take-disable_s3-and-disabl.patch [bz#1204696] +- kvm-hw-acpi-move-etc-system-states-fw_cfg-file-from-PIIX.patch [bz#1204696] +- kvm-hw-acpi-piix4_pm_init-take-fw_cfg-object-no-more.patch [bz#1204696] +- kvm-i386-pc-pc_basic_device_init-delegate-FDC-creation-r.patch [bz#1227282] +- kvm-i386-pc-drive-if-floppy-should-imply-a-board-default.patch [bz#1227282] +- kvm-i386-pc_q35-don-t-insist-on-board-FDC-if-there-s-no-.patch [bz#1227282] +- kvm-i386-drop-FDC-in-pc-q35-rhel7.2.0-if-neither-it-nor-.patch [bz#1227282] +- kvm-hw-i386-pc-factor-out-pc_cmos_init_floppy.patch [bz#1227282] +- kvm-hw-i386-pc-reflect-any-FDC-ioport-0x3f0-in-the-CMOS.patch [bz#1227282] +- kvm-hw-i386-pc-don-t-carry-FDC-from-pc_basic_device_init.patch [bz#1227282] +- kvm-Fix-reported-machine-type.patch [bz#1241331] +- kvm-i386-acpi-build-more-traditional-_UID-and-_HID-for-P.patch [bz#1242479] +- kvm-i386-acpi-build-fix-PXB-workarounds-for-unsupported-.patch [bz#1242479] +- kvm-hw-core-rebase-sysbus_get_fw_dev_path-to-g_strdup_pr.patch [bz#1242479] +- kvm-migration-introduce-VMSTATE_BUFFER_UNSAFE_INFO_TEST.patch [bz#1242479] +- kvm-hw-pci-bridge-expose-_test-parameter-in-SHPC_VMSTATE.patch [bz#1242479] +- kvm-hw-pci-bridge-add-macro-for-chassis_nr-property.patch [bz#1242479] +- kvm-hw-pci-bridge-add-macro-for-msi-property.patch [bz#1242479] +- kvm-hw-pci-introduce-shpc_present-helper-function.patch [bz#1242479] +- kvm-hw-pci-bridge-introduce-shpc-property.patch [bz#1242479] +- kvm-hw-pci-bridge-disable-SHPC-in-PXB.patch [bz#1242479] +- kvm-hw-core-explicit-OFW-unit-address-callback-for-SysBu.patch [bz#1242479] +- kvm-hw-pci-bridge-format-special-OFW-unit-address-for-PX.patch [bz#1242479] +- Resolves: bz#1204696 + (Expose PM system states in fw_cfg file on Q35) +- Resolves: bz#1227282 + (tighten conditions for board-implied FDC in pc-q35-rhel7.2.0+) +- Resolves: bz#1241331 + (Machine type reported by guest is different with that in RHEL.7.1 GA version) +- Resolves: bz#1242479 + (backport QEMU changes needed for supporting multiple PCI root buses with OVMF) + +* Tue Jul 14 2015 Miroslav Rezanina - rhev-2.3.0-10.el7 +- kvm-Disable-Educational-device.patch [bz#1194151] +- kvm-Disable-sdhci-device.patch [bz#1194151] +- kvm-Mark-onboard-devices-as-cannot_instantiate_with_devi.patch [bz#1194151] +- kvm-target-arm-Add-GIC-phandle-to-VirtBoardInfo.patch [bz#1231929] +- kvm-arm_gicv2m-Add-GICv2m-widget-to-support-MSIs.patch [bz#1231929] +- kvm-target-arm-Extend-the-gic-node-properties.patch [bz#1231929] +- kvm-target-arm-Add-the-GICv2m-to-the-virt-board.patch [bz#1231929] +- kvm-introduce-kvm_arch_msi_data_to_gsi.patch [bz#1231929] +- kvm-arm_gicv2m-set-kvm_gsi_direct_mapping-and-kvm_msi_vi.patch [bz#1231929] +- kvm-hw-arm-virt-acpi-build-Fix-table-revision-and-some-c.patch [bz#1231929] +- kvm-hw-arm-virt-acpi-build-Add-GICv2m-description-in-ACP.patch [bz#1231929] +- Resolves: bz#1194151 + (Rebase to qemu 2.3) +- Resolves: bz#1231929 + (AArch64: backport MSI support (gicv2m)) + +* Thu Jul 09 2015 Miroslav Rezanina - rhev-2.3.0-9.el7 +- kvm-acpi-add-a-missing-backslash-to-the-_SB-scope.patch [bz#1103313] +- kvm-range-remove-useless-inclusions.patch [bz#1103313] +- kvm-acpi-Simplify-printing-to-dynamic-string.patch [bz#1103313] +- kvm-acpi-add-aml_add-term.patch [bz#1103313] +- kvm-acpi-add-aml_lless-term.patch [bz#1103313] +- kvm-acpi-add-aml_index-term.patch [bz#1103313] +- kvm-acpi-add-aml_shiftleft-term.patch [bz#1103313] +- kvm-acpi-add-aml_shiftright-term.patch [bz#1103313] +- kvm-acpi-add-aml_increment-term.patch [bz#1103313] +- kvm-acpi-add-aml_while-term.patch [bz#1103313] +- kvm-acpi-add-implementation-of-aml_while-term.patch [bz#1103313] +- kvm-hw-pci-made-pci_bus_is_root-a-PCIBusClass-method.patch [bz#1103313] +- kvm-hw-pci-made-pci_bus_num-a-PCIBusClass-method.patch [bz#1103313] +- kvm-hw-i386-query-only-for-q35-pc-when-looking-for-pci-h.patch [bz#1103313] +- kvm-hw-pci-extend-PCI-config-access-to-support-devices-b.patch [bz#1103313] +- kvm-hw-acpi-add-support-for-i440fx-snooping-root-busses.patch [bz#1103313] +- kvm-hw-apci-add-_PRT-method-for-extra-PCI-root-busses.patch [bz#1103313] +- kvm-hw-acpi-add-_CRS-method-for-extra-root-busses.patch [bz#1103313] +- kvm-hw-acpi-remove-from-root-bus-0-the-crs-resources-use.patch [bz#1103313] +- kvm-hw-pci-removed-rootbus-nr-is-0-assumption-from-qmp_p.patch [bz#1103313] +- kvm-hw-pci-introduce-PCI-Expander-Bridge-PXB.patch [bz#1103313] +- kvm-hw-pci-inform-bios-if-the-system-has-extra-pci-root-.patch [bz#1103313] +- kvm-hw-pxb-add-map_irq-func.patch [bz#1103313] +- kvm-hw-pci-add-support-for-NUMA-nodes.patch [bz#1103313] +- kvm-hw-pxb-add-numa_node-parameter.patch [bz#1103313] +- kvm-apci-fix-PXB-behaviour-if-used-with-unsupported-BIOS.patch [bz#1103313] +- kvm-docs-Add-PXB-documentation.patch [bz#1103313] +- kvm-sPAPR-Don-t-enable-EEH-on-emulated-PCI-devices.patch [bz#1213681] +- kvm-sPAPR-Reenable-EEH-functionality-on-reboot.patch [bz#1213681] +- kvm-sPAPR-Clear-stale-MSIx-table-during-EEH-reset.patch [bz#1213681] +- kvm-configure-Add-support-for-tcmalloc.patch [bz#1213882] +- Resolves: bz#1103313 + (RFE: configure guest NUMA node locality for guest PCI devices) +- Resolves: bz#1213681 + (PAPR PCI-e EEH (Enhanced Error Handling) for KVM/Power guests with VFIO devices (qemu)) +- Resolves: bz#1213882 + (enable using tcmalloc for memory allocation in qemu-kvm-rhev) + +* Wed Jul 08 2015 Miroslav Rezanina - rhev-2.3.0-8.el7 +- kvm-block-Fix-NULL-deference-for-unaligned-write-if-qiov.patch [bz#1207034] +- kvm-qemu-iotests-Test-unaligned-sub-block-zero-write.patch [bz#1207034] +- kvm-spapr_drc-initial-implementation-of-sPAPRDRConnector.patch [bz#1172478] +- kvm-spapr_rtas-add-get-set-power-level-RTAS-interfaces.patch [bz#1172478] +- kvm-spapr_rtas-add-set-indicator-RTAS-interface.patch [bz#1172478] +- kvm-spapr_rtas-add-get-sensor-state-RTAS-interface.patch [bz#1172478] +- kvm-spapr-add-rtas_st_buffer_direct-helper.patch [bz#1172478] +- kvm-spapr_rtas-add-ibm-configure-connector-RTAS-interfac.patch [bz#1172478] +- kvm-spapr_events-re-use-EPOW-event-infrastructure-for-ho.patch [bz#1172478] +- kvm-spapr_events-event-scan-RTAS-interface.patch [bz#1172478] +- kvm-spapr_drc-add-spapr_drc_populate_dt.patch [bz#1172478] +- kvm-spapr_pci-add-dynamic-reconfiguration-option-for-spa.patch [bz#1172478] +- kvm-spapr_pci-create-DRConnectors-for-each-PCI-slot-duri.patch [bz#1172478] +- kvm-pci-make-pci_bar-useable-outside-pci.c.patch [bz#1172478] +- kvm-spapr_pci-enable-basic-hotplug-operations.patch [bz#1172478] +- kvm-spapr_pci-emit-hotplug-add-remove-events-during-hotp.patch [bz#1172478] +- kvm-Print-error-when-failing-to-load-PCI-config-data.patch [bz#1209793] +- kvm-Fix-ich9-intel-hda-compatibility.patch [bz#1209793] +- kvm-pseries-Enable-in-kernel-H_LOGICAL_CI_-LOAD-STORE-im.patch [bz#1217277] +- kvm-Split-serial-isa-into-its-own-config-option.patch [bz#1191845] +- kvm-rhel-Disable-info-irq-and-info-pic-for-Power.patch [bz#1191845] +- kvm-RHEL-Disable-remaining-unsupported-devices-for-ppc.patch [bz#1191845] +- kvm-linux-headers-sync-vhost.h.patch [bz#1225715] +- kvm-virtio-introduce-virtio_legacy_is_cross_endian.patch [bz#1225715] +- kvm-vhost-set-vring-endianness-for-legacy-virtio.patch [bz#1225715] +- kvm-tap-add-VNET_LE-VNET_BE-operations.patch [bz#1225715] +- kvm-tap-fix-non-linux-build.patch [bz#1225715] +- kvm-vhost-net-tell-tap-backend-about-the-vnet-endianness.patch [bz#1225715] +- kvm-vhost_net-re-enable-when-cross-endian.patch [bz#1225715] +- kvm-linux-headers-update.patch [bz#1227343] +- kvm-virtio-input-add-linux-input.h.patch [bz#1227343] +- kvm-virtio-input-core-code-base-class-device.patch [bz#1227343] +- kvm-virtio-input-emulated-devices-device.patch [bz#1227343] +- kvm-virtio-net-Move-DEFINE_VIRTIO_NET_FEATURES-to-virtio.patch [bz#1227343] +- kvm-virtio-scsi-Move-DEFINE_VIRTIO_SCSI_FEATURES-to-virt.patch [bz#1227343] +- kvm-memory-Define-API-for-MemoryRegionOps-to-take-attrs-.patch [bz#1227343] +- kvm-memory-Replace-io_mem_read-write-with-memory_region_.patch [bz#1227343] +- kvm-Make-CPU-iotlb-a-structure-rather-than-a-plain-hwadd.patch [bz#1227343] +- kvm-Add-MemTxAttrs-to-the-IOTLB.patch [bz#1227343] +- kvm-exec.c-Convert-subpage-memory-ops-to-_with_attrs.patch [bz#1227343] +- kvm-exec.c-Make-address_space_rw-take-transaction-attrib.patch [bz#1227343] +- kvm-exec.c-Add-new-address_space_ld-st-functions.patch [bz#1227343] +- kvm-Switch-non-CPU-callers-from-ld-st-_phys-to-address_s.patch [bz#1227343] +- kvm-s390-virtio-sort-into-categories.patch [bz#1227343] +- kvm-s390-virtio-use-common-features.patch [bz#1227343] +- kvm-virtio-move-host_features.patch [bz#1227343] +- kvm-virtio-ccw-Don-t-advertise-VIRTIO_F_BAD_FEATURE.patch [bz#1227343] +- kvm-virtio-move-VIRTIO_F_NOTIFY_ON_EMPTY-into-core.patch [bz#1227343] +- kvm-qdev-add-64bit-properties.patch [bz#1227343] +- kvm-virtio-make-features-64bit-wide.patch [bz#1227343] +- kvm-virtio-input-const_le16-and-const_le32-not-build-tim.patch [bz#1227343] +- kvm-virtio-input-make-virtio-devices-follow-usual-naming.patch [bz#1227343] +- kvm-virtio-64bit-features-fixups.patch [bz#1227343] +- kvm-virtio-endianness-checks-for-virtio-1.0-devices.patch [bz#1227343] +- kvm-virtio-allow-virtio-1-queue-layout.patch [bz#1227343] +- kvm-virtio-disallow-late-feature-changes-for-virtio-1.patch [bz#1227343] +- kvm-virtio-allow-to-fail-setting-status.patch [bz#1227343] +- kvm-virtio-net-no-writeable-mac-for-virtio-1.patch [bz#1227343] +- kvm-virtio-net-support-longer-header.patch [bz#1227343] +- kvm-virtio-net-enable-virtio-1.0.patch [bz#1227343] +- kvm-vhost_net-add-version_1-feature.patch [bz#1227343] +- kvm-vhost-64-bit-features.patch [bz#1227343] +- kvm-linux-headers-add-virtio_pci.patch [bz#1227343] +- kvm-virtio-pci-initial-virtio-1.0-support.patch [bz#1227343] +- kvm-virtio-generation-counter-support.patch [bz#1227343] +- kvm-virtio-add-modern-config-accessors.patch [bz#1227343] +- kvm-virtio-pci-switch-to-modern-accessors-for-1.0.patch [bz#1227343] +- kvm-virtio-pci-add-flags-to-enable-disable-legacy-modern.patch [bz#1227343] +- kvm-virtio-pci-make-QEMU_VIRTIO_PCI_QUEUE_MEM_MULT-small.patch [bz#1227343] +- kvm-virtio-pci-change-document-virtio-pci-bar-layout.patch [bz#1227343] +- kvm-virtio-pci-make-modern-bar-64bit-prefetchable.patch [bz#1227343] +- kvm-virtio-pci-correctly-set-host-notifiers-for-modern-b.patch [bz#1227343] +- kvm-virtio_balloon-header-update.patch [bz#1227343] +- kvm-virtio-balloon-switch-to-virtio_add_feature.patch [bz#1227343] +- kvm-virtio-pci-add-struct-VirtIOPCIRegion-for-virtio-1-r.patch [bz#1227343] +- kvm-virtio-pci-add-virtio_pci_modern_regions_init.patch [bz#1227343] +- kvm-virtio-pci-add-virtio_pci_modern_region_map.patch [bz#1227343] +- kvm-virtio-pci-move-virtio_pci_add_mem_cap-call-to-virti.patch [bz#1227343] +- kvm-virtio-pci-move-cap-type-to-VirtIOPCIRegion.patch [bz#1227343] +- kvm-virtio-pci-drop-identical-virtio_pci_cap.patch [bz#1227343] +- kvm-virtio-pci-fill-VirtIOPCIRegions-early.patch [bz#1227343] +- kvm-pci-add-PCI_CLASS_INPUT_.patch [bz#1227343] +- kvm-virtio-input-core-code-base-class-pci.patch [bz#1227343] +- kvm-virtio-input-emulated-devices-pci.patch [bz#1227343] +- kvm-virtio-net-move-qdev-properties-into-virtio-net.c.patch [bz#1227343] +- kvm-virtio-net.h-Remove-unsed-DEFINE_VIRTIO_NET_PROPERTI.patch [bz#1227343] +- kvm-virtio-scsi-move-qdev-properties-into-virtio-scsi.c.patch [bz#1227343] +- kvm-virtio-rng-move-qdev-properties-into-virtio-rng.c.patch [bz#1227343] +- kvm-virtio-serial-bus-move-qdev-properties-into-virtio-s.patch [bz#1227343] +- kvm-virtio-9p-device-move-qdev-properties-into-virtio-9p.patch [bz#1227343] +- kvm-vhost-scsi-move-qdev-properties-into-vhost-scsi.c.patch [bz#1227343] +- kvm-virito-pci-fix-OVERRUN-problem.patch [bz#1227343] +- kvm-virtio-input-move-properties-use-virtio_instance_ini.patch [bz#1227343] +- kvm-virtio-input-evdev-passthrough.patch [bz#1227343] +- kvm-Add-MAINTAINERS-entry-for-virtio-input.patch [bz#1227343] +- kvm-virtio-input-add-input-routing-support.patch [bz#1227343] +- kvm-dataplane-fix-cross-endian-issues.patch [bz#1227343] +- kvm-aarch64-allow-enable-seccomp.patch [bz#1174861] +- kvm-aarch64-redhat-spec-enable-seccomp.patch [bz#1174861] +- kvm-rhel-Update-package-version-for-SLOF-dependency.patch [bz#1236447] +- Resolves: bz#1172478 + (add support for PCI hotplugging) +- Resolves: bz#1174861 + (use seccomp) +- Resolves: bz#1191845 + ([PowerKVM] There are some unsupported x86 devices under the output of cmds 'man qemu-kvm' and '/usr/libexec/qemu-kvm -device help') +- Resolves: bz#1207034 + (QEMU segfault when doing unaligned zero write to non-512 disk) +- Resolves: bz#1209793 + (migration: 7.1->7.2 error while loading state for instance 0x0 of device '0000:00:04.0/intel-hda') +- Resolves: bz#1217277 + (Enable KVM implementation of H_LOGICAL_CI_{LOAD,STORE}) +- Resolves: bz#1225715 + (Enable cross-endian vhost devices) +- Resolves: bz#1227343 + ([virtio-1] QEMU Virtio-1 Support) +- Resolves: bz#1236447 + (Update qemu-kvm-rhev package for new SLOF) + +* Thu Jul 02 2015 Miroslav Rezanina - rhev-2.3.0-7.el7 +- kvm-docs-update-documentation-for-memory-hot-unplug.patch [bz#1120706] +- kvm-acpi-mem-hotplug-add-acpi_memory_slot_status-to-get-.patch [bz#1120706] +- kvm-acpi-mem-hotplug-add-unplug-request-cb-for-memory-de.patch [bz#1120706] +- kvm-acpi-mem-hotplug-add-unplug-cb-for-memory-device.patch [bz#1120706] +- kvm-acpi-extend-aml_field-to-support-UpdateRule.patch [bz#1120706] +- kvm-acpi-fix-Memory-device-control-fields-register.patch [bz#1120706] +- kvm-acpi-add-hardware-implementation-for-memory-hot-unpl.patch [bz#1120706] +- kvm-qmp-event-add-event-notification-for-memory-hot-unpl.patch [bz#1120706] +- kvm-hw-acpi-aml-build-Fix-memory-leak.patch [bz#1120706] +- kvm-memory-add-memory_region_ram_resize.patch [bz#1231719] +- kvm-acpi-build-remove-dependency-from-ram_addr.h.patch [bz#1231719] +- kvm-hw-i386-Move-ACPI-header-definitions-in-an-arch-inde.patch [bz#1231719] +- kvm-hw-i386-acpi-build-move-generic-acpi-building-helper.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Make-enum-values-to-be-upper-case-.patch [bz#1231719] +- kvm-hw-arm-virt-Move-common-definitions-to-virt.h.patch [bz#1231719] +- kvm-hw-arm-virt-Record-PCIe-ranges-in-MemMapEntry-array.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Basic-framework-for-building-.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_memory32_fixed-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_interrupt-term.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generation-of-DSDT-table-for-.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-FADT-table-and-updat.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-MADT-table.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-GTDT-table.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-RSDT-table.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-RSDP-table.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Generate-MCFG-table.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Make-aml_buffer-definition-consist.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-ToUUID-macro.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_or-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_lnot-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_else-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_create_dword_field-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-aml_dword_io-term.patch [bz#1231719] +- kvm-hw-acpi-aml-build-Add-Unicode-macro.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Add-PCIe-controller-in-ACPI-D.patch [bz#1231719] +- kvm-ACPI-split-CONFIG_ACPI-into-4-pieces.patch [bz#1231719] +- kvm-hw-arm-virt-Enable-dynamic-generation-of-ACPI-v5.1-t.patch [bz#1231719] +- kvm-ACPI-Add-definitions-for-the-SPCR-table.patch [bz#1231719] +- kvm-hw-arm-virt-acpi-build-Add-SPCR-table.patch [bz#1231719] +- kvm-AArch64-Enable-ACPI.patch [bz#1231719] +- kvm-i8254-fix-out-of-bounds-memory-access-in-pit_ioport_.patch [bz#1229647] +- kvm-hw-q35-fix-floppy-controller-definition-in-ich9.patch [bz#894956] +- kvm-Migration-compat-for-pckbd.patch [bz#1215092] +- kvm-Migration-compat-for-fdc.patch [bz#1215091] +- Resolves: bz#1120706 + (Support dynamic virtual Memory deallocation - qemu-kvm) +- Resolves: bz#1215091 + (migration: 7.2->earlier; floppy compatibility) +- Resolves: bz#1215092 + (migration: 7.2->earlier: pckbd compatibility) +- Resolves: bz#1229647 + (CVE-2015-3214 qemu-kvm-rhev: qemu: i8254: out-of-bounds memory access in pit_ioport_read function [rhel-7.2]) +- Resolves: bz#1231719 + (AArch64: backport ACPI support) +- Resolves: bz#894956 + (floppy can not be recognized by Windows guest (q35)) + +* Fri Jun 26 2015 Miroslav Rezanina - rhev-2.3.0-6.el7 +- kvm-vfio-pci-Fix-error-path-sign.patch [bz#1219090] +- kvm-vfio-pci-Further-fix-BAR-size-overflow.patch [bz#1219090] +- kvm-Add-flag-for-pre-2.2-migration-compatibility.patch [bz#1215087] +- kvm-Serial-Migration-compatibility-pre-2.2-7.2.patch [bz#1215087] +- kvm-Migration-compat-for-mc146818rtc-irq_reinject_on_ack.patch [bz#1215088] +- Resolves: bz#1215087 + (migration: 7.2->earlier; serial compatibility) +- Resolves: bz#1215088 + (migration: 7.2->earlier; mc146818rtc compatibility) +- Resolves: bz#1219090 + (vfio-pci - post QEMU2.3 fixes, error sign + BAR overflow) + +* Wed Jun 24 2015 Miroslav Rezanina - rhev-2.3.0-5.el7 +- kvm-atomics-add-explicit-compiler-fence-in-__atomic-memo.patch [bz#1231335] +- kvm-pc-acpi-fix-pvpanic-for-buggy-guests.patch [bz#1221943] +- Resolves: bz#1221943 + (On_crash events didn't work when using guest's pvpanic device) +- Resolves: bz#1231335 + ([abrt] qemu-kvm: bdrv_error_action(): qemu-kvm killed by SIGABRT) + +* Mon Jun 22 2015 Miroslav Rezanina - rhev-2.3.0-4.el7 +- kvm-virtio-ccw-using-VIRTIO_NO_VECTOR-instead-of-0-for-i.patch [bz#1231610] +- kvm-virtio-ccw-sort-into-categories.patch [bz#1231610] +- kvm-virtio-ccw-change-realization-sequence.patch [bz#1231610] +- kvm-virtio-ccw-implement-device_plugged.patch [bz#1231610] +- kvm-virtio-net-fix-the-upper-bound-when-trying-to-delete.patch [bz#1231610] +- kvm-monitor-replace-the-magic-number-255-with-MAX_QUEUE_.patch [bz#1231610] +- kvm-monitor-check-return-value-of-qemu_find_net_clients_.patch [bz#1231610] +- kvm-virtio-introduce-vector-to-virtqueues-mapping.patch [bz#1231610] +- kvm-virtio-pci-speedup-MSI-X-masking-and-unmasking.patch [bz#1231610] +- kvm-pci-remove-hard-coded-bar-size-in-msix_init_exclusiv.patch [bz#1231610] +- kvm-virtio-net-adding-all-queues-in-.realize.patch [bz#1231610] +- kvm-virtio-device_plugged-can-fail.patch [bz#1231610] +- kvm-virtio-introduce-virtio_get_num_queues.patch [bz#1231610] +- kvm-virtio-ccw-introduce-ccw-specific-queue-limit.patch [bz#1231610] +- kvm-virtio-ccw-validate-the-number-of-queues-against-bus.patch [bz#1231610] +- kvm-virtio-s390-introduce-virito-s390-queue-limit.patch [bz#1231610] +- kvm-virtio-s390-introduce-virtio_s390_device_plugged.patch [bz#1231610] +- kvm-virtio-rename-VIRTIO_PCI_QUEUE_MAX-to-VIRTIO_QUEUE_M.patch [bz#1231610] +- kvm-virtio-increase-the-queue-limit-to-1024.patch [bz#1231610] +- kvm-virtio-pci-don-t-try-to-mask-or-unmask-vqs-without-n.patch [bz#1231610] +- Resolves: bz#1231610 + (Support more virtio queues) + +* Fri Jun 19 2015 Miroslav Rezanina - rhev-2.3.0-3.el7 +- kvm-vmdk-Fix-overflow-if-l1_size-is-0x20000000.patch [bz#1226809] +- kvm-Downstream-only-Add-rhel7.2.0-machine-type.patch [bz#1228574] +- kvm-spice-display-fix-segfault-in-qemu_spice_create_upda.patch [bz#1230550] +- kvm-pc-dimm-don-t-assert-if-pc-dimm-alignment-hotpluggab.patch [bz#1221425] +- kvm-Strip-brackets-from-vnc-host.patch [bz#1229073] +- kvm-qcow2-Set-MIN_L2_CACHE_SIZE-to-2.patch [bz#1226996] +- kvm-iotests-qcow2-COW-with-minimal-L2-cache-size.patch [bz#1226996] +- kvm-qcow2-Add-DEFAULT_L2_CACHE_CLUSTERS.patch [bz#1226996] +- kvm-spec-Ship-complete-QMP-documentation-files.patch [bz#1222834] +- Resolves: bz#1221425 + (qemu crash when hot-plug a memory device) +- Resolves: bz#1222834 + (We ship incomplete QMP documentation) +- Resolves: bz#1226809 + (Overflow in malloc size calculation in VMDK driver) +- Resolves: bz#1226996 + (qcow2: Fix minimum L2 cache size) +- Resolves: bz#1228574 + (Add RHEL7.2 machine type in QEMU for PPC64LE) +- Resolves: bz#1229073 + ([graphical framebuffer]Start guest failed when VNC listen on IPV6 address) +- Resolves: bz#1230550 + ([abrt] qemu-system-x86: __memcmp_sse4_1(): qemu-system-x86_64 killed by SIGSEGV) + +* Wed May 27 2015 Miroslav Rezanina - rhev-2.3.0-2.el7 +- kvm-balloon-improve-error-msg-when-adding-second-device.patch [bz#1165534] +- kvm-qmp-add-error-reason-to-the-BLOCK_IO_ERROR-event.patch [bz#1199174] +- kvm-spec-Remove-obsolete-differentiation-code.patch [bz#1122778] +- kvm-spec-Use-external-configuration-script.patch [bz#1122778] +- kvm-spec-Use-configure-options-to-prevent-default-resolu.patch [bz#1122778] +- kvm-fdc-force-the-fifo-access-to-be-in-bounds-of-the-all.patch [bz#1219272] +- Resolves: bz#1122778 + (miss "vhdx" and "iscsi" in qemu-img supported format list) +- Resolves: bz#1165534 + (balloon: improve error message when adding second device) +- Resolves: bz#1199174 + (QMP: forward port rhel-only error reason to BLOCK_IO_ERROR event) +- Resolves: bz#1219272 + (CVE-2015-3456 qemu-kvm-rhev: qemu: floppy disk controller flaw [rhel-7.2]) + +* Tue Apr 28 2015 Miroslav Rezanina - rhev-2.3.0-1.el7 +- Rebase to 2.3.0 [bz#1194151] +- kvm-misc-Add-pc-i440fx-rhel7-2-0-machine-type.patch [bz#1210050] +- kvm-misc-Add-pc-q35-rhel7-2-0-machine-type.patch [bz#1210050] +- Resolves: bz#1194151 + (Rebase to qemu 2.3) +- Resolves: bz#1210050 + (Add pc-i440fx-rhel7.2.0 machine type) + +* Thu Mar 19 2015 Miroslav Rezanina - rhev-2.2.0-8.el7 +- kvm-pc_sysfw-prevent-pflash-and-or-mis-sized-firmware-fo.patch [bz#1175099] +- kvm-build-reenable-local-builds-to-pass-enable-debug-dow.patch [] +- kvm-RPM-spec-install-dump-guest-memory.py-downstream-onl.patch [bz#1194304] +- kvm-vga-Expose-framebuffer-byteorder-as-a-QOM-property.patch [bz#1146809] +- kvm-pseries-Switch-VGA-endian-on-H_SET_MODE.patch [bz#1146809] +- kvm-Generalize-QOM-publishing-of-date-and-time-from-mc14.patch [bz#1172583] +- kvm-Add-more-VMSTATE_-_TEST-variants-for-integers.patch [bz#1171700] +- kvm-pseries-Move-sPAPR-RTC-code-into-its-own-file.patch [bz#1170132 bz#1171700 bz#1172583] +- kvm-pseries-Add-more-parameter-validation-in-RTAS-time-o.patch [bz#1170132 bz#1171700 bz#1172583] +- kvm-pseries-Add-spapr_rtc_read-helper-function.patch [bz#1170132 bz#1171700 bz#1172583] +- kvm-pseries-Make-RTAS-time-of-day-functions-respect-rtc-.patch [bz#1170132] +- kvm-pseries-Make-the-PAPR-RTC-a-qdev-device.patch [bz#1170132 bz#1171700 bz#1172583] +- kvm-pseries-Move-rtc_offset-into-RTC-device-s-state-stru.patch [bz#1171700] +- kvm-pseries-Export-RTC-time-via-QOM.patch [bz#1172583] +- kvm-pseries-Limit-PCI-host-bridge-index-value.patch [bz#1181409] +- Resolves: bz#1146809 + (Incorrect colours on virtual VGA with ppc64le guest under ppc64 host) +- Resolves: bz#1170132 + (Guest time could change with host time even specify the guest clock as "-rtc base=utc,clock=vm,...") +- Resolves: bz#1171700 + ('hwclock' in destination guest returns to base '2006-06-06' after migration) +- Resolves: bz#1172583 + ([Power KVM] Qemu monitor command don't support {"execute":"qom-get","arguments":{"path":"/machine","property":"rtc-time"}}) +- Resolves: bz#1175099 + ([migration]migration failed when configure guest with OVMF bios + machine type=rhel6.5.0) +- Resolves: bz#1181409 + (PCI pass-through device works improperly due to the PHB's index being set to a big value) +- Resolves: bz#1194304 + ([Hitachi 7.2 FEAT] Extract guest memory dump from qemu-kvm-rhev core) + +* Tue Mar 10 2015 Miroslav Rezanina - rhev-2.2.0-7.el7 +- kvm-aarch64-Add-PCI-and-VIRTIO_PCI-devices-for-AArch64.patch [bz#1200090] +- kvm-Add-specific-config-options-for-PCI-E-bridges.patch [bz#1200090] +- Resolves: bz#1200090 + (qemu-kvm-rhev (2.2.0-6) breaks ISO installation) + +* Mon Mar 02 2015 Miroslav Rezanina - rhev-2.2.0-6.el7 +- kvm-AArch64-Prune-the-devices-available-for-AArch64-gues.patch [bz#1170734] +- kvm-Give-ivshmem-its-own-config-option.patch [bz#1170734] +- kvm-aarch64-Prune-unsupported-CPU-types-for-aarch64.patch [bz#1170734] +- Resolves: bz#1170734 + (Trim qemu-kvm devices for aarch64) + +* Wed Feb 11 2015 Miroslav Rezanina - rhev-2.2.0-5.el7 +- kvm-kvm_stat-Add-aarch64-support.patch [bz#1184603] +- kvm-kvm_stat-Update-exit-reasons-to-the-latest-defintion.patch [bz#1184603] +- kvm-kvm_stat-Add-RESET-support-for-perf-event-ioctl.patch [bz#1184603] +- kvm-ignore-SIGIO-in-tests-that-use-AIO-context-aarch64-h.patch [bz#1184405] +- kvm-aio_notify-force-main-loop-wakeup-with-SIGIO-aarch64.patch [bz#1184405] +- Resolves: bz#1184405 + (lost block IO completion notification (for virtio-scsi disk) hangs main loop) +- Resolves: bz#1184603 + (enable kvm_stat support for aarch64) + +* Mon Feb 09 2015 Miroslav Rezanina - rhev-2.2.0-4.el7 +- kvm-Downstream-only-Restore-pseries-machine-alias.patch [bz#1170934] +- kvm-PPC-Fix-crash-on-spapr_tce_table_finalize.patch [bz#1170934] +- kvm-virtio_serial-Don-t-use-vser-config.max_nr_ports-int.patch [bz#1169230] +- kvm-virtio-serial-Don-t-keep-a-persistent-copy-of-config.patch [bz#1169230] +- kvm-spapr-Fix-stale-HTAB-during-live-migration-KVM.patch [bz#1168446] +- kvm-spapr-Fix-integer-overflow-during-migration-TCG.patch [bz#1168446] +- kvm-spapr-Fix-stale-HTAB-during-live-migration-TCG.patch [bz#1168446] +- Resolves: bz#1168446 + (Stale hash PTEs may be transferred during live migration of PAPR guests) +- Resolves: bz#1169230 + (QEMU core dumped when do ping-pong migration to file for LE guest) +- Resolves: bz#1170934 + (Segfault at spapr_tce_table_finalize(): QLIST_REMOVE(tcet, list)) + +* Thu Jan 22 2015 Miroslav Rezanina - rhev-2.2.0-3.el7 +- kvm-Downstream-only-arm-define-a-new-machine-type-for-RH.patch [bz#1176838] +- Resolves: bz#1176838 + (create rhelsa machine type) + +* Wed Jan 14 2015 Miroslav Rezanina - rhev-2.2.0-2.el7.next.candidate +- kvm-Update-to-qemu-kvm-rhev-2.1.2-19.el7.patch [] +- kvm-fw_cfg-remove-superfluous-blank-line.patch [bz#1169869] +- kvm-hw-arm-boot-fix-uninitialized-scalar-variable-warnin.patch [bz#1169869] +- kvm-Sort-include-qemu-typedefs.h.patch [bz#1169869] +- kvm-fw_cfg-hard-separation-between-the-MMIO-and-I-O-port.patch [bz#1169869] +- kvm-fw_cfg-move-boards-to-fw_cfg_init_io-fw_cfg_init_mem.patch [bz#1169869] +- kvm-fw_cfg_mem-max-access-size-and-region-size-are-the-s.patch [bz#1169869] +- kvm-fw_cfg_mem-flip-ctl_mem_ops-and-data_mem_ops-to-DEVI.patch [bz#1169869] +- kvm-exec-allows-8-byte-accesses-in-subpage_ops.patch [bz#1169869] +- kvm-fw_cfg_mem-introduce-the-data_width-property.patch [bz#1169869] +- kvm-fw_cfg_mem-expose-the-data_width-property-with-fw_cf.patch [bz#1169869] +- kvm-arm-add-fw_cfg-to-virt-board.patch [bz#1169869] +- kvm-hw-loader-split-out-load_image_gzipped_buffer.patch [bz#1169869] +- kvm-hw-arm-pass-pristine-kernel-image-to-guest-firmware-.patch [bz#1169869] +- kvm-hw-arm-virt-enable-passing-of-EFI-stubbed-kernel-to-.patch [bz#1169869] +- kvm-fw_cfg-fix-endianness-in-fw_cfg_data_mem_read-_write.patch [bz#1169869] +- Resolves: bz#1169869 + (add fw_cfg to mach-virt) + +* Tue Jan 13 2015 Miroslav Rezanina - rhev-2.1.2-19.el7 +- kvm-smbios-Fix-dimm-size-calculation-when-RAM-is-multipl.patch [bz#1179165] +- kvm-smbios-Don-t-report-unknown-CPU-speed-fix-SVVP-regre.patch [bz#1177127] +- Resolves: bz#1177127 + ([SVVP]smbios HCT job failed with 'Processor Max Speed cannot be Unknown' with -M pc-i440fx-rhel7.1.0) +- Resolves: bz#1179165 + ([SVVP]smbios HCT job failed with Unspecified error with -M pc-i440fx-rhel7.1.0) + +* Thu Jan 08 2015 Miroslav Rezanina - rhev-2.2.0-1.el7 +- rebase to qemu 2.2.0 + +* Thu Jan 08 2015 Miroslav Rezanina - rhev-2.1.2-18.el7 +- kvm-vl-Adjust-the-place-of-calling-mlockall-to-speedup-V.patch [bz#1173394] +- kvm-block-delete-cow-block-driver.patch [bz#1175841] +- Resolves: bz#1173394 + (numa_smaps doesn't respect bind policy with huge page) +- Resolves: bz#1175841 + (Delete cow block driver) + +* Tue Dec 16 2014 Jeff E. Nelson - rhev-2.1.2-17.el7 +- kvm-numa-Don-t-allow-memdev-on-RHEL-6-machine-types.patch [bz#1170093] +- kvm-block-allow-bdrv_unref-to-be-passed-NULL-pointers.patch [bz#1136381] +- kvm-block-vdi-use-block-layer-ops-in-vdi_create-instead-.patch [bz#1136381] +- kvm-block-use-the-standard-ret-instead-of-result.patch [bz#1136381] +- kvm-block-vpc-use-block-layer-ops-in-vpc_create-instead-.patch [bz#1136381] +- kvm-block-iotest-update-084-to-test-static-VDI-image-cre.patch [bz#1136381] +- kvm-block-remove-BLOCK_OPT_NOCOW-from-vdi_create_opts.patch [bz#1136381] +- kvm-block-remove-BLOCK_OPT_NOCOW-from-vpc_create_opts.patch [bz#1136381] +- kvm-migration-fix-parameter-validation-on-ram-load-CVE-2.patch [bz#1163079] +- kvm-qdev-monitor-fix-segmentation-fault-on-qdev_device_h.patch [bz#1169280] +- kvm-block-migration-Disable-cache-invalidate-for-incomin.patch [bz#1171552] +- kvm-acpi-Use-apic_id_limit-when-calculating-legacy-ACPI-.patch [bz#1173167] +- Resolves: bz#1136381 + (RFE: Supporting creating vdi/vpc format disk with protocols (glusterfs) for qemu-kvm-rhev-2.1.x) +- Resolves: bz#1163079 + (CVE-2014-7840 qemu-kvm-rhev: qemu: insufficient parameter validation during ram load [rhel-7.1]) +- Resolves: bz#1169280 + (Segfault while query device properties (ics, icp)) +- Resolves: bz#1170093 + (guest NUMA failed to migrate when machine is rhel6.5.0) +- Resolves: bz#1171552 + (Storage vm migration failed when running BurnInTes) +- Resolves: bz#1173167 + (Corrupted ACPI tables in some configurations using pc-i440fx-rhel7.0.0) + +* Fri Dec 05 2014 Miroslav Rezanina - rhev-2.1.2-16.el7 +- kvm-qemu-iotests-Fix-broken-test-cases.patch [bz#1169589] +- kvm-Fix-for-crash-after-migration-in-virtio-rng-on-bi-en.patch [bz#1165087] +- kvm-Downstream-only-remove-unsupported-machines-from-AAr.patch [bz#1169847] +- Resolves: bz#1165087 + (QEMU core dumped for the destination guest when do migating guest to file) +- Resolves: bz#1169589 + (test case 051 071 and 087 of qemu-iotests fail for qcow2 with qemu-kvm-rhev-2.1.2-14.el7) +- Resolves: bz#1169847 + (only support mach-virt) + +* Tue Dec 02 2014 Miroslav Rezanina - rhev-2.1.2-15.el7 +- kvm-scsi-Optimize-scsi_req_alloc.patch [bz#1141656] +- kvm-virtio-scsi-Optimize-virtio_scsi_init_req.patch [bz#1141656] +- kvm-virtio-scsi-Fix-comment-for-VirtIOSCSIReq.patch [bz#1141656] +- kvm-Downstream-only-Move-daemon-reload-to-make-sure-new-.patch [bz#1168085] +- Resolves: bz#1141656 + (Virtio-scsi: performance degradation from 1.5.3 to 2.1.0) +- Resolves: bz#1168085 + (qemu-kvm-rhev install scripts sometimes don't recognize newly installed systemd presets) + +* Thu Nov 27 2014 Miroslav Rezanina - rhev-2.1.2-14.el7 +- kvm-xhci-add-sanity-checks-to-xhci_lookup_uport.patch [bz#1161397] +- kvm-qemu-img-Allow-source-cache-mode-specification.patch [bz#1166481] +- kvm-qemu-img-Allow-cache-mode-specification-for-amend.patch [bz#1166481] +- kvm-qemu-img-fix-img_compare-flags-error-path.patch [bz#1166481] +- kvm-qemu-img-clarify-src_cache-option-documentation.patch [bz#1166481] +- kvm-qemu-img-fix-rebase-src_cache-option-documentation.patch [bz#1166481] +- Resolves: bz#1161397 + (qemu core dump when install a RHEL.7 guest(xhci) with migration) +- Resolves: bz#1166481 + (Allow qemu-img to bypass the host cache (check, compare, convert, rebase, amend)) + +* Tue Nov 25 2014 Miroslav Rezanina - rhev-2.1.2-13.el7 +- kvm-hw-pci-fixed-error-flow-in-pci_qdev_init.patch [bz#1166067] +- kvm-hw-pci-fixed-hotplug-crash-when-using-rombar-0-with-.patch [bz#1166067] +- Resolves: bz#1166067 + (qemu-kvm aborted when hot plug PCI device to guest with romfile and rombar=0) + +* Fri Nov 21 2014 Miroslav Rezanina - rhev-2.1.2-12.el7 +- kvm-migration-static-variables-will-not-be-reset-at-seco.patch [bz#1166501] +- Resolves: bz#1166501 + (Migration "expected downtime" does not refresh after reset to a new value) + +* Fri Nov 21 2014 Miroslav Rezanina - rhev-2.1.2-11.el7 +- kvm-iscsi-Refuse-to-open-as-writable-if-the-LUN-is-write.patch [bz#1160102] +- kvm-vnc-sanitize-bits_per_pixel-from-the-client.patch [bz#1157646] +- kvm-usb-host-fix-usb_host_speed_compat-tyops.patch [bz#1160504] +- kvm-block-raw-posix-Fix-disk-corruption-in-try_fiemap.patch [bz#1142331] +- kvm-block-raw-posix-use-seek_hole-ahead-of-fiemap.patch [bz#1142331] +- kvm-raw-posix-Fix-raw_co_get_block_status-after-EOF.patch [bz#1142331] +- kvm-raw-posix-raw_co_get_block_status-return-value.patch [bz#1142331] +- kvm-raw-posix-SEEK_HOLE-suffices-get-rid-of-FIEMAP.patch [bz#1142331] +- kvm-raw-posix-The-SEEK_HOLE-code-is-flawed-rewrite-it.patch [bz#1142331] +- kvm-exec-Handle-multipage-ranges-in-invalidate_and_set_d.patch [bz#1164759] +- Resolves: bz#1142331 + (qemu-img convert intermittently corrupts output images) +- Resolves: bz#1157646 + (CVE-2014-7815 qemu-kvm-rhev: qemu: vnc: insufficient bits_per_pixel from the client sanitization [rhel-7.1]) +- Resolves: bz#1160102 + (opening read-only iscsi lun as read-write should fail) +- Resolves: bz#1160504 + (guest can not show usb device after adding some usb controllers and redirdevs.) +- Resolves: bz#1164759 + (Handle multipage ranges in invalidate_and_set_dirty()) + +* Thu Nov 20 2014 Miroslav Rezanina - rhev-2.1.2-10.el7 +- kvm-pc-dimm-Don-t-check-dimm-node-when-there-is-non-NUMA.patch [bz#1150510 bz#1163735] +- kvm-vga-Start-cutting-out-non-32bpp-conversion-support.patch [bz#1146809] +- kvm-vga-Remove-remainder-of-old-conversion-cruft.patch [bz#1146809] +- kvm-vga-Separate-LE-and-BE-conversion-functions.patch [bz#1146809] +- kvm-vga-Remove-rgb_to_pixel-indirection.patch [bz#1146809] +- kvm-vga-Simplify-vga_draw_blank-a-bit.patch [bz#1146809] +- kvm-cirrus-Remove-non-32bpp-cursor-drawing.patch [bz#1146809] +- kvm-vga-Remove-some-should-be-done-in-BIOS-comments.patch [bz#1146809] +- kvm-vga-Rename-vga_template.h-to-vga-helpers.h.patch [bz#1146809] +- kvm-vga-Make-fb-endian-a-common-state-variable.patch [bz#1146809] +- kvm-vga-Add-endian-to-vmstate.patch [bz#1146809] +- kvm-vga-pci-add-qext-region-to-mmio.patch [bz#1146809] +- kvm-virtio-scsi-work-around-bug-in-old-BIOSes.patch [bz#1123812] +- kvm-Revert-Downstream-only-Add-script-to-autoload-KVM-mo.patch [bz#1158250 bz#1159706] +- kvm-Downstream-only-add-script-on-powerpc-to-configure-C.patch [bz#1158250 bz#1158251 bz#1159706] +- kvm-block-New-bdrv_nb_sectors.patch [bz#1132385] +- kvm-vmdk-Optimize-cluster-allocation.patch [bz#1132385] +- kvm-vmdk-Handle-failure-for-potentially-large-allocation.patch [bz#1132385] +- kvm-vmdk-Use-bdrv_nb_sectors-where-sectors-not-bytes-are.patch [bz#1132385] +- kvm-vmdk-fix-vmdk_parse_extents-extent_file-leaks.patch [bz#1132385] +- kvm-vmdk-fix-buf-leak-in-vmdk_parse_extents.patch [bz#1132385] +- kvm-vmdk-Fix-integer-overflow-in-offset-calculation.patch [bz#1132385] +- kvm-Revert-Build-ceph-rbd-only-for-rhev.patch [bz#1140744] +- kvm-Revert-rbd-Only-look-for-qemu-specific-copy-of-librb.patch [bz#1140744] +- kvm-Revert-rbd-link-and-load-librbd-dynamically.patch [bz#1140744] +- kvm-spec-Enable-rbd-driver-add-dependency.patch [bz#1140744] +- kvm-Use-qemu-kvm-in-documentation-instead-of-qemu-system.patch [bz#1140620] +- kvm-ide-stash-aiocb-for-flushes.patch [bz#1024599] +- kvm-ide-simplify-reset-callbacks.patch [bz#1024599] +- kvm-ide-simplify-set_inactive-callbacks.patch [bz#1024599] +- kvm-ide-simplify-async_cmd_done-callbacks.patch [bz#1024599] +- kvm-ide-simplify-start_transfer-callbacks.patch [bz#1024599] +- kvm-ide-wrap-start_dma-callback.patch [bz#1024599] +- kvm-ide-remove-wrong-setting-of-BM_STATUS_INT.patch [bz#1024599] +- kvm-ide-fold-add_status-callback-into-set_inactive.patch [bz#1024599] +- kvm-ide-move-BM_STATUS-bits-to-pci.-ch.patch [bz#1024599] +- kvm-ide-move-retry-constants-out-of-BM_STATUS_-namespace.patch [bz#1024599] +- kvm-ahci-remove-duplicate-PORT_IRQ_-constants.patch [bz#1024599] +- kvm-ide-stop-PIO-transfer-on-errors.patch [bz#1024599] +- kvm-ide-make-all-commands-go-through-cmd_done.patch [bz#1024599] +- kvm-ide-atapi-Mark-non-data-commands-as-complete.patch [bz#1024599] +- kvm-ahci-construct-PIO-Setup-FIS-for-PIO-commands.patch [bz#1024599] +- kvm-ahci-properly-shadow-the-TFD-register.patch [bz#1024599] +- kvm-ahci-Correct-PIO-D2H-FIS-responses.patch [bz#1024599] +- kvm-ahci-Update-byte-count-after-DMA-completion.patch [bz#1024599] +- kvm-ahci-Fix-byte-count-regression-for-ATAPI-PIO.patch [bz#1024599] +- kvm-ahci-Fix-SDB-FIS-Construction.patch [bz#1024599] +- kvm-vhost-user-fix-mmap-offset-calculation.patch [bz#1159710] +- Resolves: bz#1024599 + (Windows7 x86 guest with ahci backend hit BSOD when do "hibernate") +- Resolves: bz#1123812 + (Reboot guest and guest's virtio-scsi disk will be lost after forwards migration (from RHEL6.6 host to RHEL7.1 host)) +- Resolves: bz#1132385 + (qemu-img convert rate about 100k/second from qcow2/raw to vmdk format on nfs system file) +- Resolves: bz#1140620 + (Should replace "qemu-system-i386" by "/usr/libexec/qemu-kvm" in manpage of qemu-kvm for our official qemu-kvm build) +- Resolves: bz#1140744 + (Enable native support for Ceph) +- Resolves: bz#1146809 + (Incorrect colours on virtual VGA with ppc64le guest under ppc64 host) +- Resolves: bz#1150510 + (kernel ignores ACPI memory devices (PNP0C80) present at boot time) +- Resolves: bz#1158250 + (KVM modules are not autoloaded on POWER hosts) +- Resolves: bz#1158251 + (POWER KVM host starts by default with threads enabled, which prevents running guests) +- Resolves: bz#1159706 + (Need means to configure subcore mode for RHEL POWER8 hosts) +- Resolves: bz#1159710 + (vhost-user:Bad ram offset) +- Resolves: bz#1163735 + (-device pc-dimm fails to initialize on non-NUMA configs) + +* Wed Nov 19 2014 Miroslav Rezanina - rhev-2.1.2-9.el7 +- kvm-aarch64-raise-max_cpus-to-8.patch [bz#1160325] +- kvm-hw-arm-virt-add-linux-stdout-path-to-chosen-DT-node.patch [bz#1160325] +- kvm-hw-arm-virt-Provide-flash-devices-for-boot-ROMs.patch [bz#1160325] +- kvm-hw-arm-boot-load-DTB-as-a-ROM-image.patch [bz#1160325] +- kvm-hw-arm-boot-pass-an-address-limit-to-and-return-size.patch [bz#1160325] +- kvm-hw-arm-boot-load-device-tree-to-base-of-DRAM-if-no-k.patch [bz#1160325] +- kvm-hw-arm-boot-enable-DTB-support-when-booting-ELF-imag.patch [bz#1160325] +- kvm-hw-arm-virt-mark-timer-in-fdt-as-v8-compatible.patch [bz#1160325] +- kvm-hw-arm-boot-register-cpu-reset-handlers-if-using-bio.patch [bz#1160325] +- kvm-Downstream-only-Declare-ARM-kernel-support-read-only.patch [bz#1160325] +- Resolves: bz#1160325 + (arm64: support aavmf) + +* Thu Nov 13 2014 Miroslav Rezanina - rhev-2.1.2-8.el7 +- kvm-ide-Add-wwn-support-to-IDE-ATAPI-drive.patch [bz#1150820] +- kvm-exec-report-error-when-memory-hpagesize.patch [bz#1147354] +- kvm-exec-add-parameter-errp-to-gethugepagesize.patch [bz#1147354] +- kvm-block-curl-Improve-type-safety-of-s-timeout.patch [bz#1152901] +- kvm-virtio-serial-avoid-crash-when-port-has-no-name.patch [bz#1151947] +- Resolves: bz#1147354 + (Qemu core dump when boot up a guest on a non-existent hugepage path) +- Resolves: bz#1150820 + (fail to specify wwn for virtual IDE CD-ROM) +- Resolves: bz#1151947 + (virtconsole causes qemu-kvm core dump) +- Resolves: bz#1152901 + (block/curl: Fix type safety of s->timeout) + +* Thu Nov 06 2014 Miroslav Rezanina - rhev-2.1.2-7.el7 +- kvm-ac97-register-reset-via-qom.patch [bz#1141666] +- kvm-specfile-Require-glusterfs-api-3.6.patch [bz#1157329] +- kvm-smbios-Fix-assertion-on-socket-count-calculation.patch [bz#1146573] +- kvm-smbios-Encode-UUID-according-to-SMBIOS-specification.patch [bz#1152922] +- kvm-virtio-scsi-Report-error-if-num_queues-is-0-or-too-l.patch [bz#1146826] +- kvm-virtio-scsi-Fix-memory-leak-when-realize-failed.patch [bz#1146826] +- kvm-virtio-scsi-Fix-num_queue-input-validation.patch [bz#1146826] +- kvm-util-Improve-os_mem_prealloc-error-message.patch [bz#1153590] +- kvm-Downstream-only-Add-script-to-autoload-KVM-modules-o.patch [bz#1158250] +- kvm-Downstream-only-remove-uneeded-PCI-devices-for-POWER.patch [bz#1160120] +- kvm-Downstream-only-Remove-assorted-unneeded-devices-for.patch [bz#1160120] +- kvm-Downstream-only-Remove-ISA-bus-and-device-support-fo.patch [bz#1160120] +- kvm-well-defined-listing-order-for-machine-types.patch [bz#1145042] +- kvm-i386-pc-add-piix-and-q35-machtypes-to-sorting-famili.patch [bz#1145042] +- kvm-i386-pc-add-RHEL-machtypes-to-sorting-families-for-M.patch [bz#1145042] +- Resolves: bz#1141666 + (Qemu crashed if reboot guest after hot remove AC97 sound device) +- Resolves: bz#1145042 + (The output of "/usr/libexec/qemu-kvm -M ?" should be ordered.) +- Resolves: bz#1146573 + (qemu core dump when boot guest with smp(num) - rhev-2.1.2-6.el7 +- kvm-ivshmem-use-error_report.patch [bz#1104063] +- kvm-ivshmem-RHEL-only-remove-unsupported-code.patch [bz#1104063] +- kvm-ivshmem-RHEL-only-explicitly-remove-dead-code.patch [bz#1104063] +- kvm-Revert-rhel-Drop-ivshmem-device.patch [bz#1104063] +- kvm-serial-reset-state-at-startup.patch [bz#1135844] +- kvm-spice-call-qemu_spice_set_passwd-during-init.patch [bz#1140975] +- kvm-input-fix-send-key-monitor-command-release-event-ord.patch [bz#1145028 bz#1146801] +- kvm-virtio-scsi-sense-in-virtio_scsi_command_complete.patch [bz#1152830] +- Resolves: bz#1104063 + ([RHEL7.1 Feat] Enable qemu-kvm Inter VM Shared Memory (IVSHM) feature) +- Resolves: bz#1135844 + ([virtio-win]communication ports were marked with a yellow exclamation after hotplug pci-serial,pci-serial-2x,pci-serial-4x) +- Resolves: bz#1140975 + (fail to login spice session with password + expire time) +- Resolves: bz#1145028 + (send-key does not crash windows guest even when it should) +- Resolves: bz#1146801 + (sendkey: releasing order of combined keys was wrongly converse) +- Resolves: bz#1152830 + (Fix sense buffer in virtio-scsi LUN passthrough) + +* Fri Oct 24 2014 Miroslav Rezanina - rhev-2.1.2-5.el7 +- kvm-blockdev-Orphaned-drive-search.patch [bz#946993] +- kvm-blockdev-Allow-overriding-if_max_dev-property.patch [bz#946993] +- kvm-pc-vl-Add-units-per-default-bus-property.patch [bz#946993] +- kvm-ide-Update-ide_drive_get-to-be-HBA-agnostic.patch [bz#946993] +- kvm-qtest-bios-tables-Correct-Q35-command-line.patch [bz#946993] +- kvm-q35-ahci-Pick-up-cdrom-and-hda-options.patch [bz#946993] +- kvm-trace-events-drop-orphan-virtio_blk_data_plane_compl.patch [bz#1144325] +- kvm-trace-events-drop-orphan-usb_mtp_data_out.patch [bz#1144325] +- kvm-trace-events-drop-orphan-iscsi-trace-events.patch [bz#1144325] +- kvm-cleanup-trace-events.pl-Tighten-search-for-trace-eve.patch [bz#1144325] +- kvm-trace-events-Drop-unused-megasas-trace-event.patch [bz#1144325] +- kvm-trace-events-Drop-orphaned-monitor-trace-event.patch [bz#1144325] +- kvm-trace-events-Fix-comments-pointing-to-source-files.patch [bz#1144325] +- kvm-simpletrace-add-simpletrace.py-no-header-option.patch [bz#1155015] +- kvm-trace-extract-stap_escape-function-for-reuse.patch [bz#1155015] +- kvm-trace-add-tracetool-simpletrace_stap-format.patch [bz#1155015] +- kvm-trace-install-simpletrace-SystemTap-tapset.patch [bz#1155015] +- kvm-trace-install-trace-events-file.patch [bz#1155015] +- kvm-trace-add-SystemTap-init-scripts-for-simpletrace-bri.patch [bz#1155015] +- kvm-simpletrace-install-simpletrace.py.patch [bz#1155015] +- kvm-trace-add-systemtap-initscript-README-file-to-RPM.patch [bz#1155015] +- Resolves: bz#1144325 + (Can not probe "qemu.kvm.virtio_blk_data_plane_complete_request") +- Resolves: bz#1155015 + ([Fujitsu 7.1 FEAT]:QEMU: capturing trace data all the time using ftrace-based tracing) +- Resolves: bz#946993 + (Q35 does not honor -drive if=ide,... and its sugared forms -cdrom, -hda, ...) + +* Mon Oct 20 2014 Miroslav Rezanina - rhev-2.1.2-4.el7 +- kvm-seccomp-add-semctl-to-the-syscall-whitelist.patch [bz#1126704] +- kvm-dataplane-fix-virtio_blk_data_plane_create-op-blocke.patch [bz#1140001] +- kvm-block-fix-overlapping-multiwrite-requests.patch [bz#1123908] +- kvm-qemu-iotests-add-multiwrite-test-cases.patch [bz#1123908] +- Resolves: bz#1123908 + (block.c: multiwrite_merge() truncates overlapping requests) +- Resolves: bz#1126704 + (BUG: When use '-sandbox on'+'vnc'+'hda' and quit, qemu-kvm hang) +- Resolves: bz#1140001 + (data-plane hotplug should be refused to start if device is already in use (drive-mirror job)) + +* Fri Oct 10 2014 Miroslav Rezanina - rhev-2.1.2-3.el7 +- kvm-Disable-tests-for-removed-features.patch [bz#1108040] +- kvm-Disable-arm-board-types-using-lsi53c895a.patch [bz#1108040] +- kvm-libqtest-launch-QEMU-with-QEMU_AUDIO_DRV-none.patch [bz#1108040] +- kvm-Whitelist-blkdebug-driver.patch [bz#1108040] +- kvm-Turn-make-check-on.patch [bz#1108040] +- Resolves: bz#1108040 + (Enable make check for qemu-kvm-rhev 2.0 and newer) + +* Fri Oct 10 2014 Miroslav Rezanina - rhev-2.1.2-2.el7 +- kvm-RPM-spec-Add-enable-numa-to-configure-command-line.patch [bz#1076990] +- kvm-block.curl-adding-timeout-option.patch [bz#1132569] +- kvm-curl-Allow-a-cookie-or-cookies-to-be-sent-with-http-.patch [bz#1132569] +- kvm-curl-Don-t-deref-NULL-pointer-in-call-to-aio_poll.patch [bz#1132569] +- kvm-curl-Add-timeout-and-cookie-options-and-misc.-fix-RH.patch [bz#1132569] +- kvm-Introduce-cpu_clean_all_dirty.patch [bz#1143054] +- kvm-kvmclock-Ensure-proper-env-tsc-value-for-kvmclock_cu.patch [bz#1143054] +- kvm-kvmclock-Ensure-time-in-migration-never-goes-backwar.patch [bz#1143054] +- kvm-IDE-Fill-the-IDENTIFY-request-consistently.patch [bz#852348] +- kvm-ide-Add-resize-callback-to-ide-core.patch [bz#852348] +- kvm-virtio-balloon-fix-integer-overflow-in-memory-stats-.patch [bz#1140997] +- kvm-block-extend-BLOCK_IO_ERROR-event-with-nospace-indic.patch [bz#1117445] +- kvm-block-extend-BLOCK_IO_ERROR-with-reason-string.patch [bz#1117445] +- Resolves: bz#1076990 + (Enable complex memory requirements for virtual machines) +- Resolves: bz#1117445 + (QMP: extend block events with error information) +- Resolves: bz#1132569 + (RFE: Enable curl driver in qemu-kvm-rhev: https only) +- Resolves: bz#1140997 + (guest is stuck when setting balloon memory with large guest-stats-polling-interval) +- Resolves: bz#1143054 + (kvmclock: Ensure time in migration never goes backward (backport)) +- Resolves: bz#852348 + (fail to block_resize local data disk with IDE/AHCI disk_interface) + +* Fri Sep 26 2014 Miroslav Rezanina - rhev-2.1.2-1.el7 +- Rebase to qemu 2.1.2 [bz#1121609] +- Resolves: bz#1121609 + Rebase qemu-kvm-rhev to qemu 2.1.2 + +* Wed Sep 24 2014 Miroslav Rezanina - rhev-2.1.0-5.el7 +- kvm-target-i386-Reject-invalid-CPU-feature-names-on-the-.patch [bz#1055532] +- kvm-target-ppc-virtex-ml507-machine-type-should-depend-o.patch [bz#1113998] +- kvm-RHEL-only-Disable-tests-that-don-t-work-with-RHEL-bu.patch [bz#1113998] +- kvm-RHEL-onlyy-Disable-unused-ppc-machine-types.patch [bz#1113998] +- kvm-RHEL-only-Remove-unneeded-devices-from-ppc64-qemu-kv.patch [] +- kvm-RHEL-only-Replace-upstream-pseries-machine-types-wit.patch [] +- kvm-scsi-bus-prepare-scsi_req_new-for-introduction-of-pa.patch [bz#1123349] +- kvm-scsi-bus-introduce-parse_cdb-in-SCSIDeviceClass-and-.patch [bz#1123349] +- kvm-scsi-block-extract-scsi_block_is_passthrough.patch [bz#1123349] +- kvm-scsi-block-scsi-generic-implement-parse_cdb.patch [bz#1123349] +- kvm-virtio-scsi-implement-parse_cdb.patch [bz#1123349] +- kvm-exec-file_ram_alloc-print-error-when-prealloc-fails.patch [bz#1135893] +- kvm-pc-increase-maximal-VCPU-count-to-240.patch [bz#1144089] +- kvm-ssh-Enable-ssh-driver-in-qemu-kvm-rhev-RHBZ-1138359.patch [bz#1138359] +- Resolves: bz#1055532 + (QEMU should abort when invalid CPU flag name is used) +- Resolves: bz#1113998 + (RHEL Power/KVM (qemu-kvm-rhev)) +- Resolves: bz#1123349 + ([FJ7.0 Bug] SCSI command issued from KVM guest doesn't reach target device) +- Resolves: bz#1135893 + (qemu-kvm should report an error message when host's freehugepage memory < domain's memory) +- Resolves: bz#1138359 + (RFE: Enable ssh driver in qemu-kvm-rhev) +- Resolves: bz#1144089 + ([HP 7.1 FEAT] Increase qemu-kvm-rhev's VCPU limit to 240) + +* Wed Sep 17 2014 Miroslav Rezanina - rhev-2.1.0-4.el7 +- kvm-virtio-rng-add-some-trace-events.patch [bz#1129259] +- kvm-block-vhdx-add-error-check.patch [bz#1126976] +- kvm-block-VHDX-endian-fixes.patch [bz#1126976] +- kvm-qdev-monitor-include-QOM-properties-in-device-FOO-he.patch [bz#1133736] +- kvm-block-acquire-AioContext-in-qmp_block_resize.patch [bz#1136752] +- kvm-virtio-blk-allow-block_resize-with-dataplane.patch [bz#1136752] +- kvm-block-acquire-AioContext-in-do_drive_del.patch [bz#1136752] +- kvm-virtio-blk-allow-drive_del-with-dataplane.patch [bz#1136752] +- kvm-rhel-Add-rhel7.1.0-machine-types.patch [bz#1093023] +- kvm-vmstate_xhci_event-bug-compat-for-rhel7.0.0-machine-.patch [bz#1136512] +- kvm-pflash_cfi01-fixup-stale-DPRINTF-calls.patch [bz#1139706] +- kvm-pflash_cfi01-write-flash-contents-to-bdrv-on-incomin.patch [bz#1139706] +- kvm-ide-Fix-segfault-when-flushing-a-device-that-doesn-t.patch [bz#1140145] +- kvm-xhci-PCIe-endpoint-migration-compatibility-fix.patch [bz#1138579] +- kvm-rh-machine-types-xhci-PCIe-endpoint-migration-compat.patch [bz#1138579] +- Resolves: bz#1093023 + (provide RHEL-specific machine types in QEMU) +- Resolves: bz#1126976 + (VHDX image format does not work on PPC64 (Endian issues)) +- Resolves: bz#1129259 + (Add traces to virtio-rng device) +- Resolves: bz#1133736 + (qemu should provide iothread and x-data-plane properties for /usr/libexec/qemu-kvm -device virtio-blk-pci,?) +- Resolves: bz#1136512 + (rhel7.0.0 machtype compat after CVE-2014-5263 vmstate_xhci_event: fix unterminated field list) +- Resolves: bz#1136752 + (virtio-blk dataplane support for block_resize and hot unplug) +- Resolves: bz#1138579 + (Migration failed with nec-usb-xhci from RHEL7. 0 to RHEL7.1) +- Resolves: bz#1139706 + (pflash (UEFI varstore) migration shortcut for libvirt [RHEV]) +- Resolves: bz#1140145 + (qemu-kvm crashed when doing iofuzz testing) + +* Thu Aug 28 2014 Miroslav Rezanina - rhev-2.1.0-3.el7 +- kvm-Fix-pkgversion-value.patch [bz#1064742] +- kvm-virtio-serial-create-a-linked-list-of-all-active-dev.patch [bz#1003432] +- kvm-virtio-serial-search-for-duplicate-port-names-before.patch [bz#1003432] +- kvm-pc-RHEL-6-CPUID-compat-code-for-Broadwell-CPU-model.patch [bz#1111351] +- kvm-rpm-spec-build-qemu-kvm-with-lzo-and-snappy-enabled.patch [bz#1126933] +- Resolves: bz#1003432 + (qemu-kvm should not allow different virtio serial port use the same name) +- Resolves: bz#1064742 + (QMP: "query-version" doesn't include the -rhev prefix from the qemu-kvm-rhev package) +- Resolves: bz#1111351 + (RHEL-6.6 migration compatibility: CPU models) +- Resolves: bz#1126933 + ([FEAT RHEV7.1]: qemu: Support compression for dump-guest-memory command) + +* Mon Aug 18 2014 Miroslav Rezanina <> - rhev-2.1.0-2.el7 +- kvm-exit-when-no-kvm-and-vcpu-count-160.patch [bz#1076326 bz#1118665] +- kvm-Revert-Use-legacy-SMBIOS-for-rhel-machine-types.patch [bz#1118665] +- kvm-rhel-Use-SMBIOS-legacy-mode-for-machine-types-7.0.patch [bz#1118665] +- kvm-rhel-Suppress-hotplug-memory-address-space-for-machi.patch [bz#1118665] +- kvm-rhel-Fix-ACPI-table-size-for-machine-types-7.0.patch [bz#1118665] +- kvm-rhel-Fix-missing-pc-q35-rhel7.0.0-compatibility-prop.patch [bz#1118665] +- kvm-rhel-virtio-scsi-pci.any_layout-off-for-machine-type.patch [bz#1118665] +- kvm-rhel-PIIX4_PM.memory-hotplug-support-off-for-machine.patch [bz#1118665] +- kvm-rhel-apic.version-0x11-for-machine-types-7.0.patch [bz#1118665] +- kvm-rhel-nec-usb-xhci.superspeed-ports-first-off-for-mac.patch [bz#1118665] +- kvm-rhel-pci-serial.prog_if-0-for-machine-types-7.0.patch [bz#1118665] +- kvm-rhel-virtio-net-pci.guest_announce-off-for-machine-t.patch [bz#1118665] +- kvm-rhel-ICH9-LPC.memory-hotplug-support-off-for-machine.patch [bz#1118665] +- kvm-rhel-.power_controller_present-off-for-machine-types.patch [bz#1118665] +- kvm-rhel-virtio-net-pci.ctrl_guest_offloads-off-for-mach.patch [bz#1118665] +- kvm-pc-q35-rhel7.0.0-Disable-x2apic-default.patch [bz#1118665] +- Resolves: bz#1076326 + (qemu-kvm does not quit when booting guest w/ 161 vcpus and "-no-kvm") +- Resolves: bz#1118665 + (Migration: rhel7.0->rhev7.1) + +* Sat Aug 02 2014 Miroslav Rezanina - rhev-2.1.0-1.el7 +- Rebase to 2.1.0 [bz#1121609] +- Resolves: bz#1121609 + (Rebase qemu-kvm-rhev to qemu 2.1) + +* Wed Jul 09 2014 Miroslav Rezanina - rhev-2.0.0-3.el7 +- kvm-Remove-CONFIG_NE2000_ISA-from-all-config-files.patch [] +- kvm-Fix-conditional-rpmbuild.patch [] +- kvm-RHEL7-RHEV7.1-2.0-migration-compatibility.patch [bz#1085950] +- kvm-remove-superfluous-.hot_add_cpu-and-.max_cpus-initia.patch [bz#1085950] +- kvm-set-model-in-PC_RHEL6_5_COMPAT-for-qemu32-VCPU-RHEV-.patch [bz#1085950] +- kvm-Undo-Enable-x2apic-by-default-for-compatibility.patch [bz#1085950] +- kvm-qemu_loadvm_state-shadow-SeaBIOS-for-VM-incoming-fro.patch [bz#1103579] +- Resolves: bz#1085950 + (Migration/virtio-net: 7.0->vp-2.0-rc2: Mix of migration issues) +- Resolves: bz#1103579 + (fail to reboot guest after migration from RHEL6.5 host to RHEL7.0 host) + +* Fri May 30 2014 Miroslav Rezanina - rhev-2.0.0-2.el7 +- kvm-pc-add-hot_add_cpu-callback-to-all-machine-types.patch [bz#1093411] +- Resolves: bz#1093411 + (Hot unplug CPU not working for RHEL7 host) + +* Fri Apr 18 2014 Miroslav Rezanina - 2.0.0-1.el7ev +- Rebase to qemu 2.0.0 + +* Wed Apr 02 2014 Miroslav Rezanina - 1.5.3-60.el7 +- kvm-qcow2-fix-dangling-refcount-table-entry.patch [bz#1081793] +- kvm-qcow2-link-all-L2-meta-updates-in-preallocate.patch [bz#1081393] +- Resolves: bz#1081393 + (qemu-img will prompt that 'leaked clusters were found' while creating images with '-o preallocation=metadata,cluster_size<=1024') +- Resolves: bz#1081793 + (qemu-img core dumped when creating a qcow2 image base on block device(iscsi or libiscsi)) + +* Wed Mar 26 2014 Miroslav Rezanina - 1.5.3-59.el7 +- kvm-qemu-iotests-add-.-check-cloop-support.patch [bz#1066691] +- kvm-qemu-iotests-add-cloop-input-validation-tests.patch [bz#1066691] +- kvm-block-cloop-validate-block_size-header-field-CVE-201.patch [bz#1079455] +- kvm-block-cloop-prevent-offsets_size-integer-overflow-CV.patch [bz#1079320] +- kvm-block-cloop-refuse-images-with-huge-offsets-arrays-C.patch [bz#1079455] +- kvm-block-cloop-refuse-images-with-bogus-offsets-CVE-201.patch [bz#1079455] +- kvm-size-off-by-one.patch [bz#1066691] +- kvm-qemu-iotests-Support-for-bochs-format.patch [bz#1066691] +- kvm-bochs-Unify-header-structs-and-make-them-QEMU_PACKED.patch [bz#1066691] +- kvm-bochs-Use-unsigned-variables-for-offsets-and-sizes-C.patch [bz#1079339] +- kvm-bochs-Check-catalog_size-header-field-CVE-2014-0143.patch [bz#1079320] +- kvm-bochs-Check-extent_size-header-field-CVE-2014-0142.patch [bz#1079315] +- kvm-bochs-Fix-bitmap-offset-calculation.patch [bz#1066691] +- kvm-vpc-vhd-add-bounds-check-for-max_table_entries-and-b.patch [bz#1079455] +- kvm-vpc-Validate-block-size-CVE-2014-0142.patch [bz#1079315] +- kvm-vdi-add-bounds-checks-for-blocks_in_image-and-disk_s.patch [bz#1079455] +- kvm-vhdx-Bounds-checking-for-block_size-and-logical_sect.patch [bz#1079346] +- kvm-curl-check-data-size-before-memcpy-to-local-buffer.-.patch [bz#1079455] +- kvm-qcow2-Check-header_length-CVE-2014-0144.patch [bz#1079455] +- kvm-qcow2-Check-backing_file_offset-CVE-2014-0144.patch [bz#1079455] +- kvm-qcow2-Check-refcount-table-size-CVE-2014-0144.patch [bz#1079455] +- kvm-qcow2-Validate-refcount-table-offset.patch [bz#1066691] +- kvm-qcow2-Validate-snapshot-table-offset-size-CVE-2014-0.patch [bz#1079455] +- kvm-qcow2-Validate-active-L1-table-offset-and-size-CVE-2.patch [bz#1079455] +- kvm-qcow2-Fix-backing-file-name-length-check.patch [bz#1066691] +- kvm-qcow2-Don-t-rely-on-free_cluster_index-in-alloc_refc.patch [bz#1079339] +- kvm-qcow2-Avoid-integer-overflow-in-get_refcount-CVE-201.patch [bz#1079320] +- kvm-qcow2-Check-new-refcount-table-size-on-growth.patch [bz#1066691] +- kvm-qcow2-Fix-types-in-qcow2_alloc_clusters-and-alloc_cl.patch [bz#1066691] +- kvm-qcow2-Protect-against-some-integer-overflows-in-bdrv.patch [bz#1066691] +- kvm-qcow2-Fix-new-L1-table-size-check-CVE-2014-0143.patch [bz#1079320] +- kvm-dmg-coding-style-and-indentation-cleanup.patch [bz#1066691] +- kvm-dmg-prevent-out-of-bounds-array-access-on-terminator.patch [bz#1066691] +- kvm-dmg-drop-broken-bdrv_pread-loop.patch [bz#1066691] +- kvm-dmg-use-appropriate-types-when-reading-chunks.patch [bz#1066691] +- kvm-dmg-sanitize-chunk-length-and-sectorcount-CVE-2014-0.patch [bz#1079325] +- kvm-dmg-use-uint64_t-consistently-for-sectors-and-length.patch [bz#1066691] +- kvm-dmg-prevent-chunk-buffer-overflow-CVE-2014-0145.patch [bz#1079325] +- kvm-block-vdi-bounds-check-qemu-io-tests.patch [bz#1066691] +- kvm-block-Limit-request-size-CVE-2014-0143.patch [bz#1079320] +- kvm-qcow2-Fix-copy_sectors-with-VM-state.patch [bz#1066691] +- kvm-qcow2-Fix-NULL-dereference-in-qcow2_open-error-path-.patch [bz#1079333] +- kvm-qcow2-Fix-L1-allocation-size-in-qcow2_snapshot_load_.patch [bz#1079325] +- kvm-qcow2-Check-maximum-L1-size-in-qcow2_snapshot_load_t.patch [bz#1079320] +- kvm-qcow2-Limit-snapshot-table-size.patch [bz#1066691] +- kvm-parallels-Fix-catalog-size-integer-overflow-CVE-2014.patch [bz#1079320] +- kvm-parallels-Sanity-check-for-s-tracks-CVE-2014-0142.patch [bz#1079315] +- kvm-fix-machine-check-propagation.patch [bz#740107] +- Resolves: bz#1066691 + (qemu-kvm: include leftover patches from block layer security audit) +- Resolves: bz#1079315 + (CVE-2014-0142 qemu-kvm: qemu: crash by possible division by zero [rhel-7.0]) +- Resolves: bz#1079320 + (CVE-2014-0143 qemu-kvm: Qemu: block: multiple integer overflow flaws [rhel-7.0]) +- Resolves: bz#1079325 + (CVE-2014-0145 qemu-kvm: Qemu: prevent possible buffer overflows [rhel-7.0]) +- Resolves: bz#1079333 + (CVE-2014-0146 qemu-kvm: Qemu: qcow2: NULL dereference in qcow2_open() error path [rhel-7.0]) +- Resolves: bz#1079339 + (CVE-2014-0147 qemu-kvm: Qemu: block: possible crash due signed types or logic error [rhel-7.0]) +- Resolves: bz#1079346 + (CVE-2014-0148 qemu-kvm: Qemu: vhdx: bounds checking for block_size and logical_sector_size [rhel-7.0]) +- Resolves: bz#1079455 + (CVE-2014-0144 qemu-kvm: Qemu: block: missing input validation [rhel-7.0]) +- Resolves: bz#740107 + ([Hitachi 7.0 FEAT] KVM: MCA Recovery for KVM guest OS memory) + +* Wed Mar 26 2014 Miroslav Rezanina - 1.5.3-58.el7 +- kvm-pc-Use-cpu64-rhel6-CPU-model-by-default-on-rhel6-mac.patch [bz#1080170] +- kvm-target-i386-Copy-cpu64-rhel6-definition-into-qemu64.patch [bz#1078607 bz#1080170] +- Resolves: bz#1080170 + (intel 82576 VF not work in windows 2008 x86 - Code 12 [TestOnly]) +- Resolves: bz#1080170 + (Default CPU model for rhel6.* machine-types is different from RHEL-6) + +* Fri Mar 21 2014 Miroslav Rezanina - 1.5.3-57.el7 +- kvm-virtio-net-fix-guest-triggerable-buffer-overrun.patch [bz#1078308] +- Resolves: bz#1078308 + (EMBARGOED CVE-2014-0150 qemu: virtio-net: fix guest-triggerable buffer overrun [rhel-7.0]) + +* Fri Mar 21 2014 Miroslav Rezanina - 1.5.3-56.el7 +- kvm-configure-Fix-bugs-preventing-Ceph-inclusion.patch [bz#1078809] +- Resolves: bz#1078809 + (can not boot qemu-kvm-rhev with rbd image) + +* Wed Mar 19 2014 Miroslav Rezanina - 1.5.3-55.el7 +- kvm-scsi-Change-scsi-sense-buf-size-to-252.patch [bz#1058173] +- kvm-scsi-Fix-migration-of-scsi-sense-data.patch [bz#1058173] +- Resolves: bz#1058173 + (qemu-kvm core dump booting guest with scsi-generic disk attached when using built-in iscsi driver) + +* Wed Mar 19 2014 Miroslav Rezanina - 1.5.3-54.el7 +- kvm-qdev-monitor-Set-properties-after-parent-is-assigned.patch [bz#1046248] +- kvm-block-Update-image-size-in-bdrv_invalidate_cache.patch [bz#1048575] +- kvm-qcow2-Keep-option-in-qcow2_invalidate_cache.patch [bz#1048575] +- kvm-qcow2-Check-bs-drv-in-copy_sectors.patch [bz#1048575] +- kvm-block-bs-drv-may-be-NULL-in-bdrv_debug_resume.patch [bz#1048575] +- kvm-iotests-Test-corruption-during-COW-request.patch [bz#1048575] +- Resolves: bz#1046248 + (qemu-kvm crash when send "info qtree" after hot plug a device with invalid addr) +- Resolves: bz#1048575 + (Segmentation fault occurs after migrate guest(use scsi disk and add stress) to des machine) + +* Wed Mar 12 2014 Miroslav Rezanina - 1.5.3-53.el7 +- kvm-dataplane-Fix-startup-race.patch [bz#1069541] +- kvm-QMP-Relax-__com.redhat_drive_add-parameter-checking.patch [bz#1057471] +- kvm-all-exit-in-case-max-vcpus-exceeded.patch [bz#993429] +- kvm-block-gluster-code-movements-state-storage-changes.patch [bz#1031526] +- kvm-block-gluster-add-reopen-support.patch [bz#1031526] +- kvm-virtio-net-add-feature-bit-for-any-header-s-g.patch [bz#990989] +- kvm-spec-Add-README.rhel6-gpxe-source.patch [bz#1073774] +- kvm-pc-Add-RHEL6-e1000-gPXE-image.patch [bz#1073774] +- kvm-loader-rename-in_ram-has_mr.patch [bz#1064018] +- kvm-pc-avoid-duplicate-names-for-ROM-MRs.patch [bz#1064018] +- kvm-qemu-img-convert-Fix-progress-output.patch [bz#1073728] +- kvm-qemu-iotests-Test-progress-output-for-conversion.patch [bz#1073728] +- kvm-iscsi-Use-bs-sg-for-everything-else-than-disks.patch [bz#1067784] +- kvm-block-Fix-bs-request_alignment-assertion-for-bs-sg-1.patch [bz#1067784] +- kvm-qemu_file-use-fwrite-correctly.patch [bz#1005103] +- kvm-qemu_file-Fix-mismerge-of-use-fwrite-correctly.patch [bz#1005103] +- Resolves: bz#1005103 + (Migration should fail when migrate guest offline to a file which is specified to a readonly directory.) +- Resolves: bz#1031526 + (Can not commit snapshot when disk is using glusterfs:native backend) +- Resolves: bz#1057471 + (fail to do hot-plug with "discard = on" with "Invalid parameter 'discard'" error) +- Resolves: bz#1064018 + (abort from conflicting genroms) +- Resolves: bz#1067784 + (qemu-kvm: block.c:850: bdrv_open_common: Assertion `bs->request_alignment != 0' failed. Aborted (core dumped)) +- Resolves: bz#1069541 + (Segmentation fault when boot guest with dataplane=on) +- Resolves: bz#1073728 + (progress bar doesn't display when converting with -p) +- Resolves: bz#1073774 + (e1000 ROM cause migrate fail from RHEL6.5 host to RHEL7.0 host) +- Resolves: bz#990989 + (backport inline header virtio-net optimization) +- Resolves: bz#993429 + (kvm: test maximum number of vcpus supported (rhel7)) + +* Wed Mar 05 2014 Miroslav Rezanina - 1.5.3-52.el7 +- kvm-target-i386-Move-hyperv_-static-globals-to-X86CPU.patch [bz#1004773] +- kvm-Fix-uninitialized-cpuid_data.patch [bz#1057173] +- kvm-fix-coexistence-of-KVM-and-Hyper-V-leaves.patch [bz#1004773] +- kvm-make-availability-of-Hyper-V-enlightenments-depe.patch [bz#1004773] +- kvm-make-hyperv-hypercall-and-guest-os-id-MSRs-migra.patch [bz#1004773] +- kvm-make-hyperv-vapic-assist-page-migratable.patch [bz#1004773] +- kvm-target-i386-Convert-hv_relaxed-to-static-property.patch [bz#1057173] +- kvm-target-i386-Convert-hv_vapic-to-static-property.patch [bz#1057173] +- kvm-target-i386-Convert-hv_spinlocks-to-static-property.patch [bz#1057173] +- kvm-target-i386-Convert-check-and-enforce-to-static-prop.patch [bz#1004773] +- kvm-target-i386-Cleanup-foo-feature-handling.patch [bz#1057173] +- kvm-add-support-for-hyper-v-timers.patch [bz#1057173] +- Resolves: bz#1004773 + (Hyper-V guest OS id and hypercall MSRs not migrated) +- Resolves: bz#1057173 + (KVM Hyper-V Enlightenment - New feature - hv-time (QEMU)) + +* Wed Mar 05 2014 Miroslav Rezanina - 1.5.3-51.el7 +- kvm-qmp-access-the-local-QemuOptsLists-for-drive-option.patch [bz#1026184] +- kvm-qxl-add-sanity-check.patch [bz#751937] +- kvm-Fix-two-XBZRLE-corruption-issues.patch [bz#1063417] +- kvm-qdev-monitor-set-DeviceState-opts-before-calling-rea.patch [bz#1037956] +- kvm-vfio-blacklist-loading-of-unstable-roms.patch [bz#1037956] +- kvm-block-Set-block-filename-sizes-to-PATH_MAX-instead-o.patch [bz#1072339] +- Resolves: bz#1026184 + (QMP: querying -drive option returns a NULL parameter list) +- Resolves: bz#1037956 + (bnx2x: boot one guest to do vfio-pci with all PFs assigned in same group meet QEMU segmentation fault (Broadcom BCM57810 card)) +- Resolves: bz#1063417 + (google stressapptest vs Migration) +- Resolves: bz#1072339 + (RHEV: Cannot start VMs that have more than 23 snapshots.) +- Resolves: bz#751937 + (qxl triggers assert during iofuzz test) + +* Wed Feb 26 2014 Miroslav Rezanina - 1.5.3-50.el7 +- kvm-mempath-prefault-fix-off-by-one-error.patch [bz#1069039] +- kvm-qemu-option-has_help_option-and-is_valid_option_list.patch [bz#1065873] +- kvm-qemu-img-create-Support-multiple-o-options.patch [bz#1065873] +- kvm-qemu-img-convert-Support-multiple-o-options.patch [bz#1065873] +- kvm-qemu-img-amend-Support-multiple-o-options.patch [bz#1065873] +- kvm-qemu-img-Allow-o-help-with-incomplete-argument-list.patch [bz#1065873] +- kvm-qemu-iotests-Check-qemu-img-command-line-parsing.patch [bz#1065873] +- Resolves: bz#1065873 + (qemu-img silently ignores options with multiple -o parameters) +- Resolves: bz#1069039 + (-mem-prealloc option behaviour is opposite to expected) + +* Wed Feb 19 2014 Miroslav Rezanina - 1.5.3-49.el7 +- kvm-xhci-add-support-for-suspend-resume.patch [bz#1012365] +- kvm-qcow2-remove-n_start-and-n_end-of-qcow2_alloc_cluste.patch [bz#1049176] +- kvm-qcow2-fix-offset-overflow-in-qcow2_alloc_clusters_at.patch [bz#1049176] +- kvm-qcow2-check-for-NULL-l2meta.patch [bz#1055848] +- kvm-qemu-iotests-add-test-for-qcow2-preallocation-with-d.patch [bz#1055848] +- Resolves: bz#1012365 + (xhci usb storage lost in guest after wakeup from S3) +- Resolves: bz#1049176 + (qemu-img core dump when using "-o preallocation=metadata,cluster_size=2048k" to create image of libiscsi lun) +- Resolves: bz#1055848 + (qemu-img core dumped when cluster size is larger than the default value with opreallocation=metadata specified) + +* Mon Feb 17 2014 Miroslav Rezanina - 1.5.3-48.el7 +- kvm-spec-disable-qom-cast-debug.patch [bz#1063942] +- kvm-fix-guest-physical-bits-to-match-host-to-go-beyond-1.patch [bz#989677] +- kvm-monitor-Cleanup-mon-outbuf-on-write-error.patch [bz#1065225] +- Resolves: bz#1063942 + (configure qemu-kvm with --disable-qom-cast-debug) +- Resolves: bz#1065225 + (QMP socket breaks on unexpected close) +- Resolves: bz#989677 + ([HP 7.0 FEAT]: Increase KVM guest supported memory to 4TiB) + +* Wed Feb 12 2014 Miroslav Rezanina - 1.5.3-47.el7 +- kvm-seccomp-add-mkdir-and-fchmod-to-the-whitelist.patch [bz#1026314] +- kvm-seccomp-add-some-basic-shared-memory-syscalls-to-the.patch [bz#1026314] +- kvm-scsi-Support-TEST-UNIT-READY-in-the-dummy-LUN0.patch [bz#1004143] +- kvm-usb-add-vendor-request-defines.patch [bz#1039530] +- kvm-usb-move-usb_-hi-lo-helpers-to-header-file.patch [bz#1039530] +- kvm-usb-add-support-for-microsoft-os-descriptors.patch [bz#1039530] +- kvm-usb-add-microsoft-os-descriptors-compat-property.patch [bz#1039530] +- kvm-usb-hid-add-microsoft-os-descriptor-support.patch [bz#1039530] +- kvm-configure-add-option-to-disable-fstack-protect.patch [bz#1044182] +- kvm-exec-always-use-MADV_DONTFORK.patch [bz#1004197] +- kvm-pc-Save-size-of-RAM-below-4GB.patch [bz#1048080] +- kvm-acpi-Fix-PCI-hole-handling-on-build_srat.patch [bz#1048080] +- kvm-Add-check-for-cache-size-smaller-than-page-size.patch [bz#1017096] +- kvm-XBZRLE-cache-size-should-not-be-larger-than-guest-me.patch [bz#1047448] +- kvm-Don-t-abort-on-out-of-memory-when-creating-page-cach.patch [bz#1047448] +- kvm-Don-t-abort-on-memory-allocation-error.patch [bz#1047448] +- kvm-Set-xbzrle-buffers-to-NULL-after-freeing-them-to-avo.patch [bz#1038540] +- kvm-migration-fix-free-XBZRLE-decoded_buf-wrong.patch [bz#1038540] +- kvm-block-resize-backing-file-image-during-offline-commi.patch [bz#1047254] +- kvm-block-resize-backing-image-during-active-layer-commi.patch [bz#1047254] +- kvm-block-update-block-commit-documentation-regarding-im.patch [bz#1047254] +- kvm-block-Fix-bdrv_commit-return-value.patch [bz#1047254] +- kvm-block-remove-QED-.bdrv_make_empty-implementation.patch [bz#1047254] +- kvm-block-remove-qcow2-.bdrv_make_empty-implementation.patch [bz#1047254] +- kvm-qemu-progress-Drop-unused-include.patch [bz#997878] +- kvm-qemu-progress-Fix-progress-printing-on-SIGUSR1.patch [bz#997878] +- kvm-Documentation-qemu-img-Mention-SIGUSR1-progress-repo.patch [bz#997878] +- Resolves: bz#1004143 + ("test unit ready failed" on LUN 0 delays boot when a virtio-scsi target does not have any disk on LUN 0) +- Resolves: bz#1004197 + (Cannot hot-plug nic in windows VM when the vmem is larger) +- Resolves: bz#1017096 + (Fail to migrate while the size of migrate-compcache less then 4096) +- Resolves: bz#1026314 + (qemu-kvm hang when use '-sandbox on'+'vnc'+'hda') +- Resolves: bz#1038540 + (qemu-kvm aborted while cancel migration then restart it (with page delta compression)) +- Resolves: bz#1039530 + (add support for microsoft os descriptors) +- Resolves: bz#1044182 + (Relax qemu-kvm stack protection to -fstack-protector-strong) +- Resolves: bz#1047254 + (qemu-img failed to commit image) +- Resolves: bz#1047448 + (qemu-kvm core dump in src host when do migration with "migrate_set_capability xbzrle on and migrate_set_cache_size 10000G") +- Resolves: bz#1048080 + (Qemu-kvm NUMA emulation failed) +- Resolves: bz#997878 + (Kill -SIGUSR1 `pidof qemu-img convert` can not get progress of qemu-img) + +* Wed Feb 12 2014 Miroslav Rezanina - 1.5.3-46.el7 +- kvm-block-fix-backing-file-segfault.patch [bz#748906] +- kvm-block-Move-initialisation-of-BlockLimits-to-bdrv_ref.patch [bz#748906] +- kvm-raw-Fix-BlockLimits-passthrough.patch [bz#748906] +- kvm-block-Inherit-opt_transfer_length.patch [bz#748906] +- kvm-block-Update-BlockLimits-when-they-might-have-change.patch [bz#748906] +- kvm-qemu_memalign-Allow-small-alignments.patch [bz#748906] +- kvm-block-Detect-unaligned-length-in-bdrv_qiov_is_aligne.patch [bz#748906] +- kvm-block-Don-t-use-guest-sector-size-for-qemu_blockalig.patch [bz#748906] +- kvm-block-rename-buffer_alignment-to-guest_block_size.patch [bz#748906] +- kvm-raw-Probe-required-direct-I-O-alignment.patch [bz#748906] +- kvm-block-Introduce-bdrv_aligned_preadv.patch [bz#748906] +- kvm-block-Introduce-bdrv_co_do_preadv.patch [bz#748906] +- kvm-block-Introduce-bdrv_aligned_pwritev.patch [bz#748906] +- kvm-block-write-Handle-COR-dependency-after-I-O-throttli.patch [bz#748906] +- kvm-block-Introduce-bdrv_co_do_pwritev.patch [bz#748906] +- kvm-block-Switch-BdrvTrackedRequest-to-byte-granularity.patch [bz#748906] +- kvm-block-Allow-waiting-for-overlapping-requests-between.patch [bz#748906] +- kvm-block-use-DIV_ROUND_UP-in-bdrv_co_do_readv.patch [bz#748906] +- kvm-block-Make-zero-after-EOF-work-with-larger-alignment.patch [bz#748906] +- kvm-block-Generalise-and-optimise-COR-serialisation.patch [bz#748906] +- kvm-block-Make-overlap-range-for-serialisation-dynamic.patch [bz#748906] +- kvm-block-Fix-32-bit-truncation-in-mark_request_serialis.patch [bz#748906] +- kvm-block-Allow-wait_serialising_requests-at-any-point.patch [bz#748906] +- kvm-block-Align-requests-in-bdrv_co_do_pwritev.patch [bz#748906] +- kvm-lock-Fix-memory-leaks-in-bdrv_co_do_pwritev.patch [bz#748906] +- kvm-block-Assert-serialisation-assumptions-in-pwritev.patch [bz#748906] +- kvm-block-Change-coroutine-wrapper-to-byte-granularity.patch [bz#748906] +- kvm-block-Make-bdrv_pread-a-bdrv_prwv_co-wrapper.patch [bz#748906] +- kvm-block-Make-bdrv_pwrite-a-bdrv_prwv_co-wrapper.patch [bz#748906] +- kvm-iscsi-Set-bs-request_alignment.patch [bz#748906] +- kvm-blkdebug-Make-required-alignment-configurable.patch [bz#748906] +- kvm-blkdebug-Don-t-leak-bs-file-on-failure.patch [bz#748906] +- kvm-qemu-io-New-command-sleep.patch [bz#748906] +- kvm-qemu-iotests-Filter-out-qemu-io-prompt.patch [bz#748906] +- kvm-qemu-iotests-Test-pwritev-RMW-logic.patch [bz#748906] +- kvm-block-bdrv_aligned_pwritev-Assert-overlap-range.patch [bz#748906] +- kvm-block-Don-t-call-ROUND_UP-with-negative-values.patch [bz#748906] +- Resolves: bz#748906 + (qemu fails on disk with 4k sectors and cache=off) + +* Wed Feb 05 2014 Miroslav Rezanina - 1.5.3-45.el7 +- kvm-vfio-pci-Fail-initfn-on-DMA-mapping-errors.patch [bz#1044815] +- kvm-vfio-Destroy-memory-regions.patch [bz#1052030] +- kvm-docs-qcow2-compat-1.1-is-now-the-default.patch [bz#1048092] +- kvm-hda-codec-disable-streams-on-reset.patch [bz#947812] +- kvm-QEMUBH-make-AioContext-s-bh-re-entrant.patch [bz#1009297] +- kvm-qxl-replace-pipe-signaling-with-bottom-half.patch [bz#1009297] +- Resolves: bz#1009297 + (RHEL7.0 guest gui can not be used in dest host after migration) +- Resolves: bz#1044815 + (vfio initfn succeeds even if IOMMU mappings fail) +- Resolves: bz#1048092 + (manpage of qemu-img contains error statement about compat option) +- Resolves: bz#1052030 + (src qemu-kvm core dump after hotplug/unhotplug GPU device and do local migration) +- Resolves: bz#947812 + (There's a shot voice after 'system_reset' during playing music inside rhel6 guest w/ intel-hda device) + +* Wed Jan 29 2014 Miroslav Rezanina - 1.5.3-44.el7 +- kvm-Partially-revert-rhel-Drop-cfi.pflash01-and-isa-ide-.patch [bz#1032346] +- kvm-Revert-pc-Disable-the-use-flash-device-for-BIOS-unle.patch [bz#1032346] +- kvm-memory-Replace-open-coded-memory_region_is_romd.patch [bz#1032346] +- kvm-memory-Rename-readable-flag-to-romd_mode.patch [bz#1032346] +- kvm-isapc-Fix-non-KVM-qemu-boot-read-write-memory-for-is.patch [bz#1032346] +- kvm-add-kvm_readonly_mem_enabled.patch [bz#1032346] +- kvm-support-using-KVM_MEM_READONLY-flag-for-regions.patch [bz#1032346] +- kvm-pc_sysfw-allow-flash-pflash-memory-to-be-used-with-K.patch [bz#1032346] +- kvm-fix-double-free-the-memslot-in-kvm_set_phys_mem.patch [bz#1032346] +- kvm-sysfw-remove-read-only-pc_sysfw_flash_vs_rom_bug_com.patch [bz#1032346] +- kvm-pc_sysfw-remove-the-rom_only-property.patch [bz#1032346] +- kvm-pc_sysfw-do-not-make-it-a-device-anymore.patch [bz#1032346] +- kvm-hw-i386-pc_sysfw-support-two-flash-drives.patch [bz#1032346] +- kvm-i440fx-test-qtest_start-should-be-paired-with-qtest_.patch [bz#1032346] +- kvm-i440fx-test-give-each-GTest-case-its-own-qtest.patch [bz#1032346] +- kvm-i440fx-test-generate-temporary-firmware-blob.patch [bz#1032346] +- kvm-i440fx-test-verify-firmware-under-4G-and-1M-both-bio.patch [bz#1032346] +- kvm-piix-fix-32bit-pci-hole.patch [bz#1032346] +- kvm-qapi-Add-backing-to-BlockStats.patch [bz#1041564] +- kvm-pc-Disable-RDTSCP-unconditionally-on-rhel6.-machine-.patch [bz#918907] +- kvm-pc-Disable-RDTSCP-on-AMD-CPU-models.patch [bz#1056428 bz#874400] +- kvm-block-add-.bdrv_reopen_prepare-stub-for-iscsi.patch [bz#1030301] +- Resolves: bz#1030301 + (qemu-img can not merge live snapshot to backing file(r/w backing file via libiscsi)) +- Resolves: bz#1032346 + (basic OVMF support (non-volatile UEFI variables in flash, and fixup for ACPI tables)) +- Resolves: bz#1041564 + ([NFR] qemu: Returning the watermark for all the images opened for writing) +- Resolves: bz#1056428 + ("rdtscp" flag defined on Opteron_G5 model and cann't be exposed to guest) +- Resolves: bz#874400 + ("rdtscp" flag defined on Opteron_G5 model and cann't be exposed to guest) +- Resolves: bz#918907 + (provide backwards-compatible RHEL specific machine types in QEMU - CPU features) + +* Mon Jan 27 2014 Miroslav Rezanina - 1.5.3-43.el7 +- kvm-piix-gigabyte-alignment-for-ram.patch [bz#1026548] +- kvm-pc_piix-document-gigabyte_align.patch [bz#1026548] +- kvm-q35-gigabyle-alignment-for-ram.patch [bz#1026548] +- kvm-virtio-bus-remove-vdev-field.patch [bz#983344] +- kvm-virtio-pci-remove-vdev-field.patch [bz#983344] +- kvm-virtio-bus-cleanup-plug-unplug-interface.patch [bz#983344] +- kvm-virtio-blk-switch-exit-callback-to-VirtioDeviceClass.patch [bz#983344] +- kvm-virtio-serial-switch-exit-callback-to-VirtioDeviceCl.patch [bz#983344] +- kvm-virtio-net-switch-exit-callback-to-VirtioDeviceClass.patch [bz#983344] +- kvm-virtio-scsi-switch-exit-callback-to-VirtioDeviceClas.patch [bz#983344] +- kvm-virtio-balloon-switch-exit-callback-to-VirtioDeviceC.patch [bz#983344] +- kvm-virtio-rng-switch-exit-callback-to-VirtioDeviceClass.patch [bz#983344] +- kvm-virtio-pci-add-device_unplugged-callback.patch [bz#983344] +- kvm-block-use-correct-filename-for-error-report.patch [bz#1051438] +- Resolves: bz#1026548 + (i386: pc: align gpa<->hpa on 1GB boundary) +- Resolves: bz#1051438 + (Error message contains garbled characters when unable to open image due to bad permissions (permission denied).) +- Resolves: bz#983344 + (QEMU core dump and host will reboot when do hot-unplug a virtio-blk disk which use the switch behind switch) + +* Fri Jan 24 2014 Daniel Mach - 10:1.5.3-42 +- Mass rebuild 2014-01-24 + +* Wed Jan 22 2014 Miroslav Rezanina - 1.5.3-41.el7 +- kvm-help-add-id-suboption-to-iscsi.patch [bz#1019221] +- kvm-scsi-disk-add-UNMAP-limits-to-block-limits-VPD-page.patch [bz#1037503] +- kvm-qdev-Fix-32-bit-compilation-in-print_size.patch [bz#1034876] +- kvm-qdev-Use-clz-in-print_size.patch [bz#1034876] +- Resolves: bz#1019221 + (Iscsi miss id sub-option in help output) +- Resolves: bz#1034876 + (export acpi tables to guests) +- Resolves: bz#1037503 + (fix thin provisioning support for block device backends) + +* Wed Jan 22 2014 Miroslav Rezanina - 1.5.3-40.el7 +- kvm-avoid-a-bogus-COMPLETED-CANCELLED-transition.patch [bz#1053699] +- kvm-introduce-MIG_STATE_CANCELLING-state.patch [bz#1053699] +- kvm-vvfat-use-bdrv_new-to-allocate-BlockDriverState.patch [bz#1041301] +- kvm-block-implement-reference-count-for-BlockDriverState.patch [bz#1041301] +- kvm-block-make-bdrv_delete-static.patch [bz#1041301] +- kvm-migration-omit-drive-ref-as-we-have-bdrv_ref-now.patch [bz#1041301] +- kvm-xen_disk-simplify-blk_disconnect-with-refcnt.patch [bz#1041301] +- kvm-nbd-use-BlockDriverState-refcnt.patch [bz#1041301] +- kvm-block-use-BDS-ref-for-block-jobs.patch [bz#1041301] +- kvm-block-Make-BlockJobTypes-const.patch [bz#1041301] +- kvm-blockjob-rename-BlockJobType-to-BlockJobDriver.patch [bz#1041301] +- kvm-qapi-Introduce-enum-BlockJobType.patch [bz#1041301] +- kvm-qapi-make-use-of-new-BlockJobType.patch [bz#1041301] +- kvm-mirror-Don-t-close-target.patch [bz#1041301] +- kvm-mirror-Move-base-to-MirrorBlockJob.patch [bz#1041301] +- kvm-block-Add-commit_active_start.patch [bz#1041301] +- kvm-commit-Support-commit-active-layer.patch [bz#1041301] +- kvm-qemu-iotests-prefill-some-data-to-test-image.patch [bz#1041301] +- kvm-qemu-iotests-Update-test-cases-for-commit-active.patch [bz#1041301] +- kvm-commit-Remove-unused-check.patch [bz#1041301] +- kvm-blockdev-use-bdrv_getlength-in-qmp_drive_mirror.patch [bz#921890] +- kvm-qemu-iotests-make-assert_no_active_block_jobs-common.patch [bz#921890] +- kvm-block-drive-mirror-Check-for-NULL-backing_hd.patch [bz#921890] +- kvm-qemu-iotests-Extend-041-for-unbacked-mirroring.patch [bz#921890] +- kvm-qapi-schema-Update-description-for-NewImageMode.patch [bz#921890] +- kvm-block-drive-mirror-Reuse-backing-HD-for-sync-none.patch [bz#921890] +- kvm-qemu-iotests-Fix-test-041.patch [bz#921890] +- kvm-scsi-bus-fix-transfer-length-and-direction-for-VERIF.patch [bz#1035644] +- kvm-scsi-disk-fix-VERIFY-emulation.patch [bz#1035644] +- kvm-block-ensure-bdrv_drain_all-works-during-bdrv_delete.patch [bz#1041301] +- kvm-use-recommended-max-vcpu-count.patch [bz#998708] +- kvm-pc-Create-pc_compat_rhel-functions.patch [bz#1049706] +- kvm-pc-Enable-x2apic-by-default-on-more-recent-CPU-model.patch [bz#1049706] +- kvm-Build-all-subpackages-for-RHEV.patch [bz#1007204] +- Resolves: bz#1007204 + (qemu-img-rhev qemu-kvm-rhev-tools are not built for qemu-kvm-1.5.3-3.el7) +- Resolves: bz#1035644 + (rhel7.0host + windows guest + virtio-win + 'chkdsk' in the guest gives qemu assertion in scsi_dma_complete) +- Resolves: bz#1041301 + (live snapshot merge (commit) of the active layer) +- Resolves: bz#1049706 + (MIss CPUID_EXT_X2APIC in Westmere cpu model) +- Resolves: bz#1053699 + (Backport Cancelled race condition fixes) +- Resolves: bz#921890 + (Core dump when block mirror with "sync" is "none" and mode is "absolute-paths") +- Resolves: bz#998708 + (qemu-kvm: maximum vcpu should be recommended maximum) + +* Tue Jan 21 2014 Miroslav Rezanina - 1.5.3-39.el7 +- kvm-Revert-qdev-monitor-Fix-crash-when-device_add-is-cal.patch [bz#669524] +- kvm-Revert-qdev-Do-not-let-the-user-try-to-device_add-wh.patch [bz#669524] +- kvm-qdev-monitor-Clean-up-qdev_device_add-variable-namin.patch [bz#669524] +- kvm-qdev-monitor-Fix-crash-when-device_add-is-called.2.patch.patch [bz#669524] +- kvm-qdev-monitor-Avoid-qdev-as-variable-name.patch [bz#669524] +- kvm-qdev-monitor-Inline-qdev_init-for-device_add.patch [bz#669524] +- kvm-qdev-Do-not-let-the-user-try-to-device_add-when-it.2.patch.patch [bz#669524] +- kvm-qdev-monitor-Avoid-device_add-crashing-on-non-device.patch [bz#669524] +- kvm-qdev-monitor-Improve-error-message-for-device-nonexi.patch [bz#669524] +- kvm-exec-change-well-known-physical-sections-to-macros.patch [bz#1003535] +- kvm-exec-separate-sections-and-nodes-per-address-space.patch [bz#1003535] +- Resolves: bz#1003535 + (qemu-kvm core dump when boot vm with more than 32 virtio disks/nics) +- Resolves: bz#669524 + (Confusing error message from -device ) + +* Fri Jan 17 2014 Miroslav Rezanina - 1.5.3-38.el7 +- kvm-intel-hda-fix-position-buffer.patch [bz#947785] +- kvm-The-calculation-of-bytes_xfer-in-qemu_put_buffer-is-.patch [bz#1003467] +- kvm-migration-Fix-rate-limit.patch [bz#1003467] +- kvm-audio-honor-QEMU_AUDIO_TIMER_PERIOD-instead-of-wakin.patch [bz#1017636] +- kvm-audio-Lower-default-wakeup-rate-to-100-times-second.patch [bz#1017636] +- kvm-audio-adjust-pulse-to-100Hz-wakeup-rate.patch [bz#1017636] +- kvm-pc-Fix-rhel6.-3dnow-3dnowext-compat-bits.patch [bz#918907] +- kvm-add-firmware-to-machine-options.patch [bz#1038603] +- kvm-switch-rhel7-machine-types-to-big-bios.patch [bz#1038603] +- kvm-add-bios-256k.bin-from-seabios-bin-1.7.2.2-10.el7.no.patch [bz#1038603] +- kvm-pci-fix-pci-bridge-fw-path.patch [bz#1034518] +- kvm-hw-cannot_instantiate_with_device_add_yet-due-to-poi.patch [bz#1031098] +- kvm-qdev-Document-that-pointer-properties-kill-device_ad.patch [bz#1031098] +- kvm-Add-back-no-hpet-but-ignore-it.patch [bz#1044742] +- Resolves: bz#1003467 + (Backport migration fixes from post qemu 1.6) +- Resolves: bz#1017636 + (PATCH: fix qemu using 50% host cpu when audio is playing) +- Resolves: bz#1031098 + (Disable device smbus-eeprom) +- Resolves: bz#1034518 + (boot order wrong with q35) +- Resolves: bz#1038603 + (make seabios 256k for rhel7 machine types) +- Resolves: bz#1044742 + (Cannot create guest on remote RHEL7 host using F20 virt-manager, libvirt's qemu -no-hpet detection is broken) +- Resolves: bz#918907 + (provide backwards-compatible RHEL specific machine types in QEMU - CPU features) +- Resolves: bz#947785 + (In rhel6.4 guest sound recorder doesn't work when playing audio) + +* Wed Jan 15 2014 Miroslav Rezanina - 1.5.3-37.el7 +- kvm-bitmap-use-long-as-index.patch [bz#997559] +- kvm-memory-cpu_physical_memory_set_dirty_flags-result-is.patch [bz#997559] +- kvm-memory-cpu_physical_memory_set_dirty_range-return-vo.patch [bz#997559] +- kvm-exec-use-accessor-function-to-know-if-memory-is-dirt.patch [bz#997559] +- kvm-memory-create-function-to-set-a-single-dirty-bit.patch [bz#997559] +- kvm-exec-drop-useless-if.patch [bz#997559] +- kvm-exec-create-function-to-get-a-single-dirty-bit.patch [bz#997559] +- kvm-memory-make-cpu_physical_memory_is_dirty-return-bool.patch [bz#997559] +- kvm-memory-all-users-of-cpu_physical_memory_get_dirty-us.patch [bz#997559] +- kvm-memory-set-single-dirty-flags-when-possible.patch [bz#997559] +- kvm-memory-cpu_physical_memory_set_dirty_range-always-di.patch [bz#997559] +- kvm-memory-cpu_physical_memory_mask_dirty_range-always-c.patch [bz#997559] +- kvm-memory-use-bit-2-for-migration.patch [bz#997559] +- kvm-memory-make-sure-that-client-is-always-inside-range.patch [bz#997559] +- kvm-memory-only-resize-dirty-bitmap-when-memory-size-inc.patch [bz#997559] +- kvm-memory-cpu_physical_memory_clear_dirty_flag-result-i.patch [bz#997559] +- kvm-bitmap-Add-bitmap_zero_extend-operation.patch [bz#997559] +- kvm-memory-split-dirty-bitmap-into-three.patch [bz#997559] +- kvm-memory-unfold-cpu_physical_memory_clear_dirty_flag-i.patch [bz#997559] +- kvm-memory-unfold-cpu_physical_memory_set_dirty-in-its-o.patch [bz#997559] +- kvm-memory-unfold-cpu_physical_memory_set_dirty_flag.patch [bz#997559] +- kvm-memory-make-cpu_physical_memory_get_dirty-the-main-f.patch [bz#997559] +- kvm-memory-cpu_physical_memory_get_dirty-is-used-as-retu.patch [bz#997559] +- kvm-memory-s-mask-clear-cpu_physical_memory_mask_dirty_r.patch [bz#997559] +- kvm-memory-use-find_next_bit-to-find-dirty-bits.patch [bz#997559] +- kvm-memory-cpu_physical_memory_set_dirty_range-now-uses-.patch [bz#997559] +- kvm-memory-cpu_physical_memory_clear_dirty_range-now-use.patch [bz#997559] +- kvm-memory-s-dirty-clean-in-cpu_physical_memory_is_dirty.patch [bz#997559] +- kvm-memory-make-cpu_physical_memory_reset_dirty-take-a-l.patch [bz#997559] +- kvm-exec-Remove-unused-global-variable-phys_ram_fd.patch [bz#997559] +- kvm-memory-cpu_physical_memory_set_dirty_tracking-should.patch [bz#997559] +- kvm-memory-move-private-types-to-exec.c.patch [bz#997559] +- kvm-memory-split-cpu_physical_memory_-functions-to-its-o.patch [bz#997559] +- kvm-memory-unfold-memory_region_test_and_clear.patch [bz#997559] +- kvm-use-directly-cpu_physical_memory_-api-for-tracki.patch [bz#997559] +- kvm-refactor-start-address-calculation.patch [bz#997559] +- kvm-memory-move-bitmap-synchronization-to-its-own-functi.patch [bz#997559] +- kvm-memory-syncronize-kvm-bitmap-using-bitmaps-operation.patch [bz#997559] +- kvm-ram-split-function-that-synchronizes-a-range.patch [bz#997559] +- kvm-migration-synchronize-memory-bitmap-64bits-at-a-time.patch [bz#997559] +- Resolves: bz#997559 + (Improve live migration bitmap handling) + +* Tue Jan 14 2014 Miroslav Rezanina - 1.5.3-36.el7 +- kvm-Add-support-statement-to-help-output.patch [bz#972773] +- kvm-__com.redhat_qxl_screendump-add-docs.patch [bz#903910] +- kvm-vl-Round-memory-sizes-below-2MiB-up-to-2MiB.patch [bz#999836] +- kvm-seccomp-exit-if-seccomp_init-fails.patch [bz#1044845] +- kvm-redhat-qemu-kvm.spec-require-python-for-build.patch [bz#1034876] +- kvm-redhat-qemu-kvm.spec-require-iasl.patch [bz#1034876] +- kvm-configure-make-iasl-option-actually-work.patch [bz#1034876] +- kvm-redhat-qemu-kvm.spec-add-cpp-as-build-dependency.patch [bz#1034876] +- kvm-acpi-build-disable-with-no-acpi.patch [bz#1045386] +- kvm-ehci-implement-port-wakeup.patch [bz#1039513] +- kvm-qdev-monitor-Fix-crash-when-device_add-is-called-wit.patch [bz#1026712 bz#1046007] +- kvm-block-vhdx-improve-error-message-and-.bdrv_check-imp.patch [bz#1035001] +- kvm-docs-updated-qemu-img-man-page-and-qemu-doc-to-refle.patch [bz#1017650] +- kvm-enable-pvticketlocks-by-default.patch [bz#1052340] +- kvm-fix-boot-strict-regressed-in-commit-6ef4716.patch [bz#997817] +- kvm-vl-make-boot_strict-variable-static-not-used-outside.patch [bz#997817] +- Resolves: bz#1017650 + (need to update qemu-img man pages on "VHDX" format) +- Resolves: bz#1026712 + (Qemu core dumpd when boot guest with driver name as "virtio-pci") +- Resolves: bz#1034876 + (export acpi tables to guests) +- Resolves: bz#1035001 + (VHDX: journal log should not be replayed by default, but rather via qemu-img check -r all) +- Resolves: bz#1039513 + (backport remote wakeup for ehci) +- Resolves: bz#1044845 + (QEMU seccomp sandbox - exit if seccomp_init() fails) +- Resolves: bz#1045386 + (qemu-kvm: hw/i386/acpi-build.c:135: acpi_get_pm_info: Assertion `obj' failed.) +- Resolves: bz#1046007 + (qemu-kvm aborted when hot plug PCI device to guest with romfile and rombar=0) +- Resolves: bz#1052340 + (pvticketlocks: default on) +- Resolves: bz#903910 + (RHEL7 does not have equivalent functionality for __com.redhat_qxl_screendump) +- Resolves: bz#972773 + (RHEL7: Clarify support statement in KVM help) +- Resolves: bz#997817 + (-boot order and -boot once regressed since RHEL-6) +- Resolves: bz#999836 + (-m 1 crashes) + +* Thu Jan 09 2014 Miroslav Rezanina - 1.5.3-35.el7 +- kvm-option-Add-assigned-flag-to-QEMUOptionParameter.patch [bz#1033490] +- kvm-qcow2-refcount-Snapshot-update-for-zero-clusters.patch [bz#1033490] +- kvm-qemu-iotests-Snapshotting-zero-clusters.patch [bz#1033490] +- kvm-block-Image-file-option-amendment.patch [bz#1033490] +- kvm-qcow2-cache-Empty-cache.patch [bz#1033490] +- kvm-qcow2-cluster-Expand-zero-clusters.patch [bz#1033490] +- kvm-qcow2-Save-refcount-order-in-BDRVQcowState.patch [bz#1033490] +- kvm-qcow2-Implement-bdrv_amend_options.patch [bz#1033490] +- kvm-qcow2-Correct-bitmap-size-in-zero-expansion.patch [bz#1033490] +- kvm-qcow2-Free-only-newly-allocated-clusters-on-error.patch [bz#1033490] +- kvm-qcow2-Add-missing-space-in-error-message.patch [bz#1033490] +- kvm-qemu-iotest-qcow2-image-option-amendment.patch [bz#1033490] +- kvm-qemu-iotests-New-test-case-in-061.patch [bz#1033490] +- kvm-qemu-iotests-Preallocated-zero-clusters-in-061.patch [bz#1033490] +- Resolves: bz#1033490 + (Cannot upgrade/downgrade qcow2 images) + +* Wed Jan 08 2014 Miroslav Rezanina - 1.5.3-34.el7 +- kvm-block-stream-Don-t-stream-unbacked-devices.patch [bz#965636] +- kvm-qemu-io-Let-open-pass-options-to-block-driver.patch [bz#1004347] +- kvm-qcow2.py-Subcommand-for-changing-header-fields.patch [bz#1004347] +- kvm-qemu-iotests-Remaining-error-propagation-adjustments.patch [bz#1004347] +- kvm-qemu-iotests-Add-test-for-inactive-L2-overlap.patch [bz#1004347] +- kvm-qemu-iotests-Adjust-test-result-039.patch [bz#1004347] +- kvm-virtio-net-don-t-update-mac_table-in-error-state.patch [bz#1048671] +- kvm-qcow2-Zero-initialise-first-cluster-for-new-images.patch [bz#1032904] +- Resolves: bz#1004347 + (Backport qcow2 corruption prevention patches) +- Resolves: bz#1032904 + (qemu-img can not create libiscsi qcow2_v3 image) +- Resolves: bz#1048671 + (virtio-net: mac_table change isn't recovered in error state) +- Resolves: bz#965636 + (streaming with no backing file should not do anything) + +* Wed Jan 08 2014 Miroslav Rezanina - 1.5.3-33.el7 +- kvm-block-qemu-iotests-for-vhdx-read-sample-dynamic-imag.patch [bz#879234] +- kvm-block-qemu-iotests-add-quotes-to-TEST_IMG-usage-io-p.patch [bz#879234] +- kvm-block-qemu-iotests-fix-_make_test_img-to-work-with-s.patch [bz#879234] +- kvm-block-qemu-iotests-add-quotes-to-TEST_IMG.base-usage.patch [bz#879234] +- kvm-block-qemu-iotests-add-quotes-to-TEST_IMG-usage-in-0.patch [bz#879234] +- kvm-block-qemu-iotests-removes-duplicate-double-quotes-i.patch [bz#879234] +- kvm-block-vhdx-minor-comments-and-typo-correction.patch [bz#879234] +- kvm-block-vhdx-add-header-update-capability.patch [bz#879234] +- kvm-block-vhdx-code-movement-VHDXMetadataEntries-and-BDR.patch [bz#879234] +- kvm-block-vhdx-log-support-struct-and-defines.patch [bz#879234] +- kvm-block-vhdx-break-endian-translation-functions-out.patch [bz#879234] +- kvm-block-vhdx-update-log-guid-in-header-and-first-write.patch [bz#879234] +- kvm-block-vhdx-code-movement-move-vhdx_close-above-vhdx_.patch [bz#879234] +- kvm-block-vhdx-log-parsing-replay-and-flush-support.patch [bz#879234] +- kvm-block-vhdx-add-region-overlap-detection-for-image-fi.patch [bz#879234] +- kvm-block-vhdx-add-log-write-support.patch [bz#879234] +- kvm-block-vhdx-write-support.patch [bz#879234] +- kvm-block-vhdx-remove-BAT-file-offset-bit-shifting.patch [bz#879234] +- kvm-block-vhdx-move-more-endian-translations-to-vhdx-end.patch [bz#879234] +- kvm-block-vhdx-break-out-code-operations-to-functions.patch [bz#879234] +- kvm-block-vhdx-fix-comment-typos-in-header-fix-incorrect.patch [bz#879234] +- kvm-block-vhdx-add-.bdrv_create-support.patch [bz#879234] +- kvm-block-vhdx-update-_make_test_img-to-filter-out-vhdx-.patch [bz#879234] +- kvm-block-qemu-iotests-for-vhdx-add-write-test-support.patch [bz#879234] +- kvm-block-vhdx-qemu-iotest-log-replay-of-data-sector.patch [bz#879234] +- Resolves: bz#879234 + ([RFE] qemu-img: Add/improve support for VHDX format) + +* Mon Jan 06 2014 Michal Novotny - 1.5.3-32.el7 +- kvm-block-change-default-of-.has_zero_init-to-0.patch.patch [bz#1007815] +- kvm-iscsi-factor-out-sector-conversions.patch.patch [bz#1007815] +- kvm-iscsi-add-logical-block-provisioning-information-to-.patch.patch [bz#1007815] +- kvm-iscsi-add-.bdrv_get_block_status.patch.patch.patch [bz#1007815] +- kvm-iscsi-split-discard-requests-in-multiple-parts.patch.patch.patch [bz#1007815] +- kvm-block-make-BdrvRequestFlags-public.patch.patch.patch [bz#1007815] +- kvm-block-add-flags-to-bdrv_-_write_zeroes.patch.patch.patch [bz#1007815] +- kvm-block-introduce-BDRV_REQ_MAY_UNMAP-request-flag.patch.patch.patch [bz#1007815] +- kvm-block-add-logical-block-provisioning-info-to-BlockDr.patch.patch.patch [bz#1007815] +- kvm-block-add-wrappers-for-logical-block-provisioning-in.patch.patch.patch [bz#1007815] +- kvm-block-iscsi-add-.bdrv_get_info.patch.patch [bz#1007815] +- kvm-block-add-BlockLimits-structure-to-BlockDriverState.patch.patch.patch [bz#1007815] +- kvm-block-raw-copy-BlockLimits-on-raw_open.patch.patch.patch [bz#1007815] +- kvm-block-honour-BlockLimits-in-bdrv_co_do_write_zeroes.patch.patch.patch [bz#1007815] +- kvm-block-honour-BlockLimits-in-bdrv_co_discard.patch.patch.patch [bz#1007815] +- kvm-iscsi-set-limits-in-BlockDriverState.patch.patch.patch [bz#1007815] +- kvm-iscsi-simplify-iscsi_co_discard.patch.patch.patch [bz#1007815] +- kvm-iscsi-add-bdrv_co_write_zeroes.patch.patch.patch [bz#1007815] +- kvm-block-introduce-bdrv_make_zero.patch.patch.patch [bz#1007815] +- kvm-block-get_block_status-fix-BDRV_BLOCK_ZERO-for-unall.patch.patch.patch [bz#1007815] +- kvm-qemu-img-add-support-for-fully-allocated-images.patch.patch.patch [bz#1007815] +- kvm-qemu-img-conditionally-zero-out-target-on-convert.patch.patch.patch [bz#1007815] +- kvm-block-generalize-BlockLimits-handling-to-cover-bdrv_.patch.patch.patch [bz#1007815] +- kvm-block-add-flags-to-BlockRequest.patch.patch.patch [bz#1007815] +- kvm-block-add-flags-argument-to-bdrv_co_write_zeroes-tra.patch.patch.patch [bz#1007815] +- kvm-block-add-bdrv_aio_write_zeroes.patch.patch.patch [bz#1007815] +- kvm-block-handle-ENOTSUP-from-discard-in-generic-code.patch.patch.patch [bz#1007815] +- kvm-block-make-bdrv_co_do_write_zeroes-stricter-in-produ.patch.patch.patch [bz#1007815] +- kvm-vpc-vhdx-add-get_info.patch.patch.patch [bz#1007815] +- kvm-block-drivers-add-discard-write_zeroes-properties-to.patch.patch.patch [bz#1007815] +- kvm-block-drivers-expose-requirement-for-write-same-alig.patch.patch.patch [bz#1007815] +- kvm-block-iscsi-remove-.bdrv_has_zero_init.patch.patch.patch [bz#1007815] +- kvm-block-iscsi-updated-copyright.patch.patch.patch [bz#1007815] +- kvm-block-iscsi-check-WRITE-SAME-support-differently-dep.patch.patch.patch [bz#1007815] +- kvm-scsi-disk-catch-write-protection-errors-in-UNMAP.patch.patch.patch [bz#1007815] +- kvm-scsi-disk-reject-ANCHOR-1-for-UNMAP-and-WRITE-SAME-c.patch.patch.patch [bz#1007815] +- kvm-scsi-disk-correctly-implement-WRITE-SAME.patch.patch.patch [bz#1007815] +- kvm-scsi-disk-fix-WRITE-SAME-with-large-non-zero-payload.patch.patch.patch [bz#1007815] +- kvm-raw-posix-implement-write_zeroes-with-MAY_UNMAP-for-.patch.patch.patch.patch [bz#1007815] +- kvm-raw-posix-implement-write_zeroes-with-MAY_UNMAP-for-.patch.patch.patch.patch.patch [bz#1007815] +- kvm-raw-posix-add-support-for-write_zeroes-on-XFS-and-bl.patch.patch [bz#1007815] +- kvm-qemu-iotests-033-is-fast.patch.patch [bz#1007815] +- kvm-qemu-img-add-support-for-skipping-zeroes-in-input-du.patch.patch [bz#1007815] +- kvm-qemu-img-fix-usage-instruction-for-qemu-img-convert.patch.patch [bz#1007815] +- kvm-block-iscsi-set-bdi-cluster_size.patch.patch [bz#1007815] +- kvm-block-add-opt_transfer_length-to-BlockLimits.patch.patch [bz#1039557] +- kvm-block-iscsi-set-bs-bl.opt_transfer_length.patch.patch [bz#1039557] +- kvm-qemu-img-dynamically-adjust-iobuffer-size-during-con.patch.patch [bz#1039557] +- kvm-qemu-img-round-down-request-length-to-an-aligned-sec.patch.patch [bz#1039557] +- kvm-qemu-img-decrease-progress-update-interval-on-conver.patch.patch [bz#1039557] +- Resolves: bz#1007815 + (fix WRITE SAME support) +- Resolves: bz#1039557 + (optimize qemu-img for thin provisioned images) + +* Fri Dec 27 2013 Daniel Mach - 10:1.5.3-31 +- Mass rebuild 2013-12-27 + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-30.el7 +- kvm-Revert-HMP-Disable-drive_add-for-Red-Hat-Enterprise-2.patch.patch [bz#889051] +- Resolves: bz#889051 + (Commands "__com.redhat_drive_add/del" don' t exist in RHEL7.0) + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-29.el7 +- kvm-QMP-Forward-port-__com.redhat_drive_del-from-RHEL-6.patch [bz#889051] +- kvm-QMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch [bz#889051] +- kvm-HMP-Forward-port-__com.redhat_drive_add-from-RHEL-6.patch [bz#889051] +- kvm-QMP-Document-throttling-parameters-of-__com.redhat_d.patch [bz#889051] +- kvm-HMP-Disable-drive_add-for-Red-Hat-Enterprise-Linux.patch [bz#889051] +- Resolves: bz#889051 + (Commands "__com.redhat_drive_add/del" don' t exist in RHEL7.0) + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-28.el7 +- kvm-virtio_pci-fix-level-interrupts-with-irqfd.patch [bz#1035132] +- Resolves: bz#1035132 + (fail to boot and call trace with x-data-plane=on specified for rhel6.5 guest) + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-27.el7 +- Change systemd service location [bz#1025217] +- kvm-vmdk-Allow-read-only-open-of-VMDK-version-3.patch [bz#1007710 bz#1029852] +- Resolves: bz#1007710 + ([RFE] Enable qemu-img to support VMDK version 3) +- Resolves: bz#1025217 + (systemd can't control ksm.service and ksmtuned.service) +- Resolves: bz#1029852 + (qemu-img fails to convert vmdk image with "qemu-img: Could not open 'image.vmdk'") + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-26.el7 +- Add BuildRequires to libRDMAcm-devel for RDMA support [bz#1011720] +- kvm-add-a-header-file-for-atomic-operations.patch [bz#1011720] +- kvm-savevm-Fix-potential-memory-leak.patch [bz#1011720] +- kvm-migration-Fail-migration-on-bdrv_flush_all-error.patch [bz#1011720] +- kvm-rdma-add-documentation.patch [bz#1011720] +- kvm-rdma-introduce-qemu_update_position.patch [bz#1011720] +- kvm-rdma-export-yield_until_fd_readable.patch [bz#1011720] +- kvm-rdma-export-throughput-w-MigrationStats-QMP.patch [bz#1011720] +- kvm-rdma-introduce-qemu_file_mode_is_not_valid.patch [bz#1011720] +- kvm-rdma-introduce-qemu_ram_foreach_block.patch [bz#1011720] +- kvm-rdma-new-QEMUFileOps-hooks.patch [bz#1011720] +- kvm-rdma-introduce-capability-x-rdma-pin-all.patch [bz#1011720] +- kvm-rdma-update-documentation-to-reflect-new-unpin-suppo.patch [bz#1011720]- kvm-rdma-bugfix-ram_control_save_page.patch [bz#1011720] +- kvm-rdma-introduce-ram_handle_compressed.patch [bz#1011720] +- kvm-rdma-core-logic.patch [bz#1011720] +- kvm-rdma-send-pc.ram.patch [bz#1011720] +- kvm-rdma-allow-state-transitions-between-other-states-be.patch [bz#1011720] +- kvm-rdma-introduce-MIG_STATE_NONE-and-change-MIG_STATE_S.patch [bz#1011720] +- kvm-rdma-account-for-the-time-spent-in-MIG_STATE_SETUP-t.patch [bz#1011720] +- kvm-rdma-bugfix-make-IPv6-support-work.patch [bz#1011720] +- kvm-rdma-forgot-to-turn-off-the-debugging-flag.patch [bz#1011720] +- kvm-rdma-correct-newlines-in-error-statements.patch [bz#1011720] +- kvm-rdma-don-t-use-negative-index-to-array.patch [bz#1011720] +- kvm-rdma-qemu_rdma_post_send_control-uses-wrongly-RDMA_W.patch [bz#1011720] +- kvm-rdma-use-DRMA_WRID_READY.patch [bz#1011720] +- kvm-rdma-memory-leak-RDMAContext-host.patch [bz#1011720] +- kvm-rdma-use-resp.len-after-validation-in-qemu_rdma_regi.patch [bz#1011720] +- kvm-rdma-validate-RDMAControlHeader-len.patch [bz#1011720] +- kvm-rdma-check-if-RDMAControlHeader-len-match-transferre.patch [bz#1011720] +- kvm-rdma-proper-getaddrinfo-handling.patch [bz#1011720] +- kvm-rdma-IPv6-over-Ethernet-RoCE-is-broken-in-linux-work.patch [bz#1011720] +- kvm-rdma-remaining-documentation-fixes.patch [bz#1011720] +- kvm-rdma-silly-ipv6-bugfix.patch [bz#1011720] +- kvm-savevm-fix-wrong-initialization-by-ram_control_load_.patch [bz#1011720] +- kvm-arch_init-right-return-for-ram_save_iterate.patch [bz#1011720] +- kvm-rdma-clean-up-of-qemu_rdma_cleanup.patch [bz#1011720] +- kvm-rdma-constify-ram_chunk_-index-start-end.patch [bz#1011720] +- kvm-migration-Fix-debug-print-type.patch [bz#1011720] +- kvm-arch_init-make-is_zero_page-accept-size.patch [bz#1011720] +- kvm-migration-ram_handle_compressed.patch [bz#1011720] +- kvm-migration-fix-spice-migration.patch [bz#1011720] +- kvm-pci-assign-cap-number-of-devices-that-can-be-assigne.patch [bz#678368] +- kvm-vfio-cap-number-of-devices-that-can-be-assigned.patch [bz#678368] +- kvm-Revert-usb-tablet-Don-t-claim-wakeup-capability-for-.patch [bz#1039513] +- kvm-mempath-prefault-pages-manually-v4.patch [bz#1026554] +- Resolves: bz#1011720 + ([HP 7.0 Feat]: Backport RDMA based live guest migration changes from upstream to RHEL7.0 KVM) +- Resolves: bz#1026554 + (qemu: mempath: prefault pages manually) +- Resolves: bz#1039513 + (backport remote wakeup for ehci) +- Resolves: bz#678368 + (RFE: Support more than 8 assigned devices) + +* Wed Dec 18 2013 Michal Novotny - 1.5.3-25.el7 +- kvm-Change-package-description.patch [bz#1017696] +- kvm-seccomp-add-kill-to-the-syscall-whitelist.patch [bz#1026314] +- kvm-json-parser-fix-handling-of-large-whole-number-value.patch [bz#997915] +- kvm-qapi-add-QMP-input-test-for-large-integers.patch [bz#997915] +- kvm-qapi-fix-visitor-serialization-tests-for-numbers-dou.patch [bz#997915] +- kvm-qapi-add-native-list-coverage-for-visitor-serializat.patch [bz#997915] +- kvm-qapi-add-native-list-coverage-for-QMP-output-visitor.patch [bz#997915] +- kvm-qapi-add-native-list-coverage-for-QMP-input-visitor-.patch [bz#997915] +- kvm-qapi-lack-of-two-commas-in-dict.patch [bz#997915] +- kvm-tests-QAPI-schema-parser-tests.patch [bz#997915] +- kvm-tests-Use-qapi-schema-test.json-as-schema-parser-tes.patch [bz#997915] +- kvm-qapi.py-Restructure-lexer-and-parser.patch [bz#997915] +- kvm-qapi.py-Decent-syntax-error-reporting.patch [bz#997915] +- kvm-qapi.py-Reject-invalid-characters-in-schema-file.patch [bz#997915] +- kvm-qapi.py-Fix-schema-parser-to-check-syntax-systematic.patch [bz#997915] +- kvm-qapi.py-Fix-diagnosing-non-objects-at-a-schema-s-top.patch [bz#997915] +- kvm-qapi.py-Rename-expr_eval-to-expr-in-parse_schema.patch [bz#997915] +- kvm-qapi.py-Permit-comments-starting-anywhere-on-the-lin.patch [bz#997915] +- kvm-scripts-qapi.py-Avoid-syntax-not-supported-by-Python.patch [bz#997915] +- kvm-tests-Fix-schema-parser-test-for-in-tree-build.patch [bz#997915] +- Resolves: bz#1017696 + ([branding] remove references to dynamic translation and user-mode emulation) +- Resolves: bz#1026314 + (qemu-kvm hang when use '-sandbox on'+'vnc'+'hda') +- Resolves: bz#997915 + (Backport new QAPI parser proactively to help developers and avoid silly conflicts) + +* Tue Dec 17 2013 Michal Novotny - 1.5.3-24.el7 +- kvm-range-add-Range-structure.patch [bz#1034876] +- kvm-range-add-Range-to-typedefs.patch [bz#1034876] +- kvm-range-add-min-max-operations-on-ranges.patch [bz#1034876] +- kvm-qdev-Add-SIZE-type-to-qdev-properties.patch [bz#1034876] +- kvm-qapi-make-visit_type_size-fallback-to-type_int.patch [bz#1034876] +- kvm-pc-move-IO_APIC_DEFAULT_ADDRESS-to-include-hw-i386-i.patch [bz#1034876] +- kvm-pci-add-helper-to-retrieve-the-64-bit-range.patch [bz#1034876] +- kvm-pci-fix-up-w64-size-calculation-helper.patch [bz#1034876] +- kvm-refer-to-FWCfgState-explicitly.patch [bz#1034876] +- kvm-fw_cfg-move-typedef-to-qemu-typedefs.h.patch [bz#1034876] +- kvm-arch_init-align-MR-size-to-target-page-size.patch [bz#1034876] +- kvm-loader-store-FW-CFG-ROM-files-in-RAM.patch [bz#1034876] +- kvm-pci-store-PCI-hole-ranges-in-guestinfo-structure.patch [bz#1034876] +- kvm-pc-pass-PCI-hole-ranges-to-Guests.patch [bz#1034876] +- kvm-pc-replace-i440fx_common_init-with-i440fx_init.patch [bz#1034876] +- kvm-pc-don-t-access-fw-cfg-if-NULL.patch [bz#1034876] +- kvm-pc-add-I440FX-QOM-cast-macro.patch [bz#1034876] +- kvm-pc-limit-64-bit-hole-to-2G-by-default.patch [bz#1034876] +- kvm-q35-make-pci-window-address-size-match-guest-cfg.patch [bz#1034876] +- kvm-q35-use-64-bit-window-programmed-by-guest.patch [bz#1034876] +- kvm-piix-use-64-bit-window-programmed-by-guest.patch [bz#1034876] +- kvm-pc-fix-regression-for-64-bit-PCI-memory.patch [bz#1034876] +- kvm-cleanup-object.h-include-error.h-directly.patch [bz#1034876] +- kvm-qom-cleanup-struct-Error-references.patch [bz#1034876] +- kvm-qom-add-pointer-to-int-property-helpers.patch [bz#1034876] +- kvm-fw_cfg-interface-to-trigger-callback-on-read.patch [bz#1034876] +- kvm-loader-support-for-unmapped-ROM-blobs.patch [bz#1034876] +- kvm-pcie_host-expose-UNMAPPED-macro.patch [bz#1034876] +- kvm-pcie_host-expose-address-format.patch [bz#1034876] +- kvm-q35-use-macro-for-MCFG-property-name.patch [bz#1034876] +- kvm-q35-expose-mmcfg-size-as-a-property.patch [bz#1034876] +- kvm-i386-add-ACPI-table-files-from-seabios.patch [bz#1034876] +- kvm-acpi-add-rules-to-compile-ASL-source.patch [bz#1034876] +- kvm-acpi-pre-compiled-ASL-files.patch [bz#1034876] +- kvm-acpi-ssdt-pcihp-updat-generated-file.patch [bz#1034876] +- kvm-loader-use-file-path-size-from-fw_cfg.h.patch [bz#1034876] +- kvm-i386-add-bios-linker-loader.patch [bz#1034876] +- kvm-loader-allow-adding-ROMs-in-done-callbacks.patch [bz#1034876] +- kvm-i386-define-pc-guest-info.patch [bz#1034876] +- kvm-acpi-piix-add-macros-for-acpi-property-names.patch [bz#1034876] +- kvm-piix-APIs-for-pc-guest-info.patch [bz#1034876] +- kvm-ich9-APIs-for-pc-guest-info.patch [bz#1034876] +- kvm-pvpanic-add-API-to-access-io-port.patch [bz#1034876] +- kvm-hpet-add-API-to-find-it.patch [bz#1034876] +- kvm-hpet-fix-build-with-CONFIG_HPET-off.patch [bz#1034876] +- kvm-acpi-add-interface-to-access-user-installed-tables.patch [bz#1034876] +- kvm-pc-use-new-api-to-add-builtin-tables.patch [bz#1034876] +- kvm-i386-ACPI-table-generation-code-from-seabios.patch [bz#1034876] +- kvm-ssdt-fix-PBLK-length.patch [bz#1034876] +- kvm-ssdt-proc-update-generated-file.patch [bz#1034876] +- kvm-pc-disable-pci-info.patch [bz#1034876] +- kvm-acpi-build-fix-build-on-glib-2.22.patch [bz#1034876] +- kvm-acpi-build-fix-build-on-glib-2.14.patch [bz#1034876] +- kvm-acpi-build-fix-support-for-glib-2.22.patch [bz#1034876] +- kvm-acpi-build-Fix-compiler-warning-missing-gnu_printf-f.patch [bz#1034876] +- kvm-exec-Fix-prototype-of-phys_mem_set_alloc-and-related.patch [bz#1034876] +- Resolves: bz#1034876 + (export acpi tables to guests) + +* Tue Dec 17 2013 Michal Novotny - 1.5.3-23.el7 +- kvm-qdev-monitor-Unref-device-when-device_add-fails.patch [bz#1003773] +- kvm-qdev-Drop-misleading-qdev_free-function.patch [bz#1003773] +- kvm-blockdev-fix-drive_init-opts-and-bs_opts-leaks.patch [bz#1003773] +- kvm-libqtest-rename-qmp-to-qmp_discard_response.patch [bz#1003773] +- kvm-libqtest-add-qmp-fmt-.-QDict-function.patch [bz#1003773] +- kvm-blockdev-test-add-test-case-for-drive_add-duplicate-.patch [bz#1003773] +- kvm-qdev-monitor-test-add-device_add-leak-test-cases.patch [bz#1003773] +- kvm-qtest-Use-display-none-by-default.patch [bz#1003773] +- Resolves: bz#1003773 + (When virtio-blk-pci device with dataplane is failed to be added, the drive cannot be released.) + +* Tue Dec 17 2013 Michal Novotny - 1.5.3-22.el7 +- Fix ksmtuned with set_process_name=1 [bz#1027420] +- Fix committed memory when no qemu-kvm running [bz#1027418] +- kvm-virtio-net-fix-the-memory-leak-in-rxfilter_notify.patch [bz#1033810] +- kvm-qom-Fix-memory-leak-in-object_property_set_link.patch [bz#1033810] +- kvm-fix-intel-hda-live-migration.patch [bz#1036537] +- kvm-vfio-pci-Release-all-MSI-X-vectors-when-disabled.patch [bz#1029743] +- kvm-Query-KVM-for-available-memory-slots.patch [bz#921490] +- kvm-block-Dont-ignore-previously-set-bdrv_flags.patch [bz#1039501] +- kvm-cleanup-trace-events.pl-New.patch [bz#997832] +- kvm-slavio_misc-Fix-slavio_led_mem_readw-_writew-tracepo.patch [bz#997832] +- kvm-milkymist-minimac2-Fix-minimac2_read-_write-tracepoi.patch [bz#997832] +- kvm-trace-events-Drop-unused-events.patch [bz#997832] +- kvm-trace-events-Fix-up-source-file-comments.patch [bz#997832] +- kvm-trace-events-Clean-up-with-scripts-cleanup-trace-eve.patch [bz#997832] +- kvm-trace-events-Clean-up-after-removal-of-old-usb-host-.patch [bz#997832] +- kvm-net-Update-netdev-peer-on-link-change.patch [bz#1027571] +- Resolves: bz#1027418 + (ksmtuned committed_memory() still returns "", not 0, when no qemu running) +- Resolves: bz#1027420 + (ksmtuned can’t handle libvirt WITH set_process_name=1) +- Resolves: bz#1027571 + ([virtio-win]win8.1 guest network can not resume automatically after do "set_link tap1 on") +- Resolves: bz#1029743 + (qemu-kvm core dump after hot plug/unplug 82576 PF about 100 times) +- Resolves: bz#1033810 + (memory leak in using object_get_canonical_path()) +- Resolves: bz#1036537 + (Cross version migration from RHEL6.5 host to RHEL7.0 host with sound device failed.) +- Resolves: bz#1039501 + ([provisioning] discard=on broken) +- Resolves: bz#921490 + (qemu-kvm core dumped after hot plugging more than 11 VF through vfio-pci) +- Resolves: bz#997832 + (Backport trace fixes proactively to avoid confusion and silly conflicts) + +* Tue Dec 03 2013 Miroslav Rezanina - 1.5.3-21.el7 +- kvm-scsi-Allocate-SCSITargetReq-r-buf-dynamically-CVE-20.patch [bz#1007334] +- Resolves: bz#1007334 + (CVE-2013-4344 qemu-kvm: qemu: buffer overflow in scsi_target_emulate_report_luns [rhel-7.0]) + +* Thu Nov 28 2013 Miroslav Rezanina - 1.5.3-20.el7 +- kvm-pc-drop-virtio-balloon-pci-event_idx-compat-property.patch [bz#1029539] +- kvm-virtio-net-only-delete-bh-that-existed.patch [bz#922463] +- kvm-virtio-net-broken-RX-filtering-logic-fixed.patch [bz#1029370] +- kvm-block-Avoid-unecessary-drv-bdrv_getlength-calls.patch [bz#1025138] +- kvm-block-Round-up-total_sectors.patch [bz#1025138] +- kvm-doc-fix-hardcoded-helper-path.patch [bz#1016952] +- kvm-introduce-RFQDN_REDHAT-RHEL-6-7-fwd.patch [bz#971933] +- kvm-error-reason-in-BLOCK_IO_ERROR-BLOCK_JOB_ERROR-event.patch [bz#971938] +- kvm-improve-debuggability-of-BLOCK_IO_ERROR-BLOCK_JOB_ER.patch [bz#895041] +- kvm-vfio-pci-Fix-multifunction-on.patch [bz#1029275] +- kvm-qcow2-Change-default-for-new-images-to-compat-1.1.patch [bz#1026739] +- kvm-qcow2-change-default-for-new-images-to-compat-1.1-pa.patch [bz#1026739] +- kvm-rng-egd-offset-the-point-when-repeatedly-read-from-t.patch [bz#1032862] +- kvm-Fix-rhel-rhev-conflict-for-qemu-kvm-common.patch [bz#1033463] +- Resolves: bz#1016952 + (qemu-kvm man page guide wrong path for qemu-bridge-helper) +- Resolves: bz#1025138 + (Read/Randread/Randrw performance regression) +- Resolves: bz#1026739 + (qcow2: Switch to compat=1.1 default for new images) +- Resolves: bz#1029275 + (Guest only find one 82576 VF(function 0) while use multifunction) +- Resolves: bz#1029370 + ([whql][netkvm][wlk] Virtio-net device handles RX multicast filtering improperly) +- Resolves: bz#1029539 + (Machine type rhel6.1.0 and balloon device cause migration fail from RHEL6.5 host to RHEL7.0 host) +- Resolves: bz#1032862 + (virtio-rng-egd: repeatedly read same random data-block w/o considering the buffer offset) +- Resolves: bz#1033463 + (can not upgrade qemu-kvm-common to qemu-kvm-common-rhev due to conflicts) +- Resolves: bz#895041 + (QMP: forward port I/O error debug messages) +- Resolves: bz#922463 + (qemu-kvm core dump when virtio-net multi queue guest hot-unpluging vNIC) +- Resolves: bz#971933 + (QMP: add RHEL's vendor extension prefix) +- Resolves: bz#971938 + (QMP: Add error reason to BLOCK_IO_ERROR event) + +* Mon Nov 11 2013 Miroslav Rezanina - 1.5.3-19.el7 +- kvm-qapi-qapi-visit.py-fix-list-handling-for-union-types.patch [bz#848203] +- kvm-qapi-qapi-visit.py-native-list-support.patch [bz#848203] +- kvm-qapi-enable-generation-of-native-list-code.patch [bz#848203] +- kvm-net-add-support-of-mac-programming-over-macvtap-in-Q.patch [bz#848203] +- Resolves: bz#848203 + (MAC Programming for virtio over macvtap - qemu-kvm support) + +* Fri Nov 08 2013 Michal Novotny - 1.5.3-18.el7 +- Removing leaked patch kvm-e1000-rtl8139-update-HMP-NIC-when-every-bit-is-writt.patch + +* Thu Nov 07 2013 Miroslav Rezanina - 1.5.3-17.el7 +- kvm-pci-assign-Add-MSI-affinity-support.patch [bz#1025877] +- kvm-Fix-potential-resource-leak-missing-fclose.patch [bz#1025877] +- kvm-pci-assign-remove-the-duplicate-function-name-in-deb.patch [bz#1025877] +- kvm-Remove-s390-ccw-img-loader.patch [bz#1017682] +- kvm-Fix-vscclient-installation.patch [bz#1017681] +- kvm-Change-qemu-bridge-helper-permissions-to-4755.patch [bz#1017689] +- kvm-net-update-nic-info-during-device-reset.patch [bz#922589] +- kvm-net-e1000-update-network-information-when-macaddr-is.patch [bz#922589] +- kvm-net-rtl8139-update-network-information-when-macaddr-.patch [bz#922589] +- kvm-virtio-net-fix-up-HMP-NIC-info-string-on-reset.patch [bz#1026689] +- kvm-vfio-pci-VGA-quirk-update.patch [bz#1025477] +- kvm-vfio-pci-Add-support-for-MSI-affinity.patch [bz#1025477] +- kvm-vfio-pci-Test-device-reset-capabilities.patch [bz#1026550] +- kvm-vfio-pci-Lazy-PCI-option-ROM-loading.patch [bz#1026550] +- kvm-vfio-pci-Cleanup-error_reports.patch [bz#1026550] +- kvm-vfio-pci-Add-dummy-PCI-ROM-write-accessor.patch [bz#1026550] +- kvm-vfio-pci-Fix-endian-issues-in-vfio_pci_size_rom.patch [bz#1026550] +- kvm-linux-headers-Update-to-include-vfio-pci-hot-reset-s.patch [bz#1025472] +- kvm-vfio-pci-Implement-PCI-hot-reset.patch [bz#1025472] +- kvm-linux-headers-Update-for-KVM-VFIO-device.patch [bz#1025474] +- kvm-vfio-pci-Make-use-of-new-KVM-VFIO-device.patch [bz#1025474] +- kvm-vmdk-Fix-vmdk_parse_extents.patch [bz#995866] +- kvm-vmdk-fix-VMFS-extent-parsing.patch [bz#995866] +- kvm-e1000-rtl8139-update-HMP-NIC-when-every-bit-is-writt.patch [bz#922589] +- kvm-don-t-disable-ctrl_mac_addr-feature-for-6.5-machine-.patch [bz#1005039] +- Resolves: bz#1005039 + (add compat property to disable ctrl_mac_addr feature) +- Resolves: bz#1017681 + (rpmdiff test "Multilib regressions": vscclient is a libtool script on s390/s390x/ppc/ppc64) +- Resolves: bz#1017682 + (/usr/share/qemu-kvm/s390-ccw.img need not be distributed) +- Resolves: bz#1017689 + (/usr/libexec/qemu-bridge-helper permissions should be 4755) +- Resolves: bz#1025472 + (Nvidia GPU device assignment - qemu-kvm - bus reset support) +- Resolves: bz#1025474 + (Nvidia GPU device assignment - qemu-kvm - NoSnoop support) +- Resolves: bz#1025477 + (VFIO MSI affinity) +- Resolves: bz#1025877 + (pci-assign lacks MSI affinity support) +- Resolves: bz#1026550 + (QEMU VFIO update ROM loading code) +- Resolves: bz#1026689 + (virtio-net: macaddr is reset but network info of monitor isn't updated) +- Resolves: bz#922589 + (e1000/rtl8139: qemu mac address can not be changed via set the hardware address in guest) +- Resolves: bz#995866 + (fix vmdk support to ESX images) + +* Thu Nov 07 2013 Miroslav Rezanina - 1.5.3-16.el7 +- kvm-block-drop-bs_snapshots-global-variable.patch [bz#1026524] +- kvm-block-move-snapshot-code-in-block.c-to-block-snapsho.patch [bz#1026524] +- kvm-block-fix-vvfat-error-path-for-enable_write_target.patch [bz#1026524] +- kvm-block-Bugfix-format-and-snapshot-used-in-drive-optio.patch [bz#1026524] +- kvm-iscsi-use-bdrv_new-instead-of-stack-structure.patch [bz#1026524] +- kvm-qcow2-Add-corrupt-bit.patch [bz#1004347] +- kvm-qcow2-Metadata-overlap-checks.patch [bz#1004347] +- kvm-qcow2-Employ-metadata-overlap-checks.patch [bz#1004347] +- kvm-qcow2-refcount-Move-OFLAG_COPIED-checks.patch [bz#1004347] +- kvm-qcow2-refcount-Repair-OFLAG_COPIED-errors.patch [bz#1004347] +- kvm-qcow2-refcount-Repair-shared-refcount-blocks.patch [bz#1004347] +- kvm-qcow2_check-Mark-image-consistent.patch [bz#1004347] +- kvm-qemu-iotests-Overlapping-cluster-allocations.patch [bz#1004347] +- kvm-w32-Fix-access-to-host-devices-regression.patch [bz#1026524] +- kvm-add-qemu-img-convert-n-option-skip-target-volume-cre.patch [bz#1026524] +- kvm-bdrv-Use-Error-for-opening-images.patch [bz#1026524] +- kvm-bdrv-Use-Error-for-creating-images.patch [bz#1026524] +- kvm-block-Error-parameter-for-open-functions.patch [bz#1026524] +- kvm-block-Error-parameter-for-create-functions.patch [bz#1026524] +- kvm-qemu-img-create-Emit-filename-on-error.patch [bz#1026524] +- kvm-qcow2-Use-Error-parameter.patch [bz#1026524] +- kvm-qemu-iotests-Adjustments-due-to-error-propagation.patch [bz#1026524] +- kvm-block-raw-Employ-error-parameter.patch [bz#1026524] +- kvm-block-raw-win32-Employ-error-parameter.patch [bz#1026524] +- kvm-blkdebug-Employ-error-parameter.patch [bz#1026524] +- kvm-blkverify-Employ-error-parameter.patch [bz#1026524] +- kvm-block-raw-posix-Employ-error-parameter.patch [bz#1026524] +- kvm-block-raw-win32-Always-use-errno-in-hdev_open.patch [bz#1026524] +- kvm-qmp-Documentation-for-BLOCK_IMAGE_CORRUPTED.patch [bz#1004347] +- kvm-qcow2-Correct-snapshots-size-for-overlap-check.patch [bz#1004347] +- kvm-qcow2-CHECK_OFLAG_COPIED-is-obsolete.patch [bz#1004347] +- kvm-qcow2-Correct-endianness-in-overlap-check.patch [bz#1004347] +- kvm-qcow2-Switch-L1-table-in-a-single-sequence.patch [bz#1004347] +- kvm-qcow2-Use-pread-for-inactive-L1-in-overlap-check.patch [bz#1004347] +- kvm-qcow2-Remove-wrong-metadata-overlap-check.patch [bz#1004347] +- kvm-qcow2-Use-negated-overflow-check-mask.patch [bz#1004347] +- kvm-qcow2-Make-overlap-check-mask-variable.patch [bz#1004347] +- kvm-qcow2-Add-overlap-check-options.patch [bz#1004347] +- kvm-qcow2-Array-assigning-options-to-OL-check-bits.patch [bz#1004347] +- kvm-qcow2-Add-more-overlap-check-bitmask-macros.patch [bz#1004347] +- kvm-qcow2-Evaluate-overlap-check-options.patch [bz#1004347] +- kvm-qapi-types.py-Split-off-generate_struct_fields.patch [bz#978402] +- kvm-qapi-types.py-Fix-enum-struct-sizes-on-i686.patch [bz#978402] +- kvm-qapi-types-visit.py-Pass-whole-expr-dict-for-structs.patch [bz#978402] +- kvm-qapi-types-visit.py-Inheritance-for-structs.patch [bz#978402] +- kvm-blockdev-Introduce-DriveInfo.enable_auto_del.patch [bz#978402] +- kvm-Implement-qdict_flatten.patch [bz#978402] +- kvm-blockdev-blockdev-add-QMP-command.patch [bz#978402] +- kvm-blockdev-Separate-ID-generation-from-DriveInfo-creat.patch [bz#978402] +- kvm-blockdev-Pass-QDict-to-blockdev_init.patch [bz#978402] +- kvm-blockdev-Move-parsing-of-media-option-to-drive_init.patch [bz#978402] +- kvm-blockdev-Move-parsing-of-if-option-to-drive_init.patch [bz#978402] +- kvm-blockdev-Moving-parsing-of-geometry-options-to-drive.patch [bz#978402] +- kvm-blockdev-Move-parsing-of-boot-option-to-drive_init.patch [bz#978402] +- kvm-blockdev-Move-bus-unit-index-processing-to-drive_ini.patch [bz#978402] +- kvm-blockdev-Move-virtio-blk-device-creation-to-drive_in.patch [bz#978402] +- kvm-blockdev-Remove-IF_-check-for-read-only-blockdev_ini.patch [bz#978402] +- kvm-qemu-iotests-Check-autodel-behaviour-for-device_del.patch [bz#978402] +- kvm-blockdev-Remove-media-parameter-from-blockdev_init.patch [bz#978402] +- kvm-blockdev-Don-t-disable-COR-automatically-with-blockd.patch [bz#978402] +- kvm-blockdev-blockdev_init-error-conversion.patch [bz#978402] +- kvm-sd-Avoid-access-to-NULL-BlockDriverState.patch [bz#978402] +- kvm-blockdev-fix-cdrom-read_only-flag.patch [bz#978402] +- kvm-block-fix-backing-file-overriding.patch [bz#978402] +- kvm-block-Disable-BDRV_O_COPY_ON_READ-for-the-backing-fi.patch [bz#978402] +- kvm-block-Don-t-copy-backing-file-name-on-error.patch [bz#978402] +- kvm-qemu-iotests-Try-creating-huge-qcow2-image.patch [bz#980771] +- kvm-block-move-qmp-and-info-dump-related-code-to-block-q.patch [bz#980771] +- kvm-block-dump-snapshot-and-image-info-to-specified-outp.patch [bz#980771] +- kvm-block-add-snapshot-info-query-function-bdrv_query_sn.patch [bz#980771] +- kvm-block-add-image-info-query-function-bdrv_query_image.patch [bz#980771] +- kvm-qmp-add-ImageInfo-in-BlockDeviceInfo-used-by-query-b.patch [bz#980771] +- kvm-vmdk-Implement-.bdrv_has_zero_init.patch [bz#980771] +- kvm-qemu-iotests-Add-basic-ability-to-use-binary-sample-.patch [bz#980771] +- kvm-qemu-iotests-Quote-TEST_IMG-and-TEST_DIR-usage.patch [bz#980771] +- kvm-qemu-iotests-fix-test-case-059.patch [bz#980771] +- kvm-qapi-Add-ImageInfoSpecific-type.patch [bz#980771] +- kvm-block-Add-bdrv_get_specific_info.patch [bz#980771] +- kvm-block-qapi-Human-readable-ImageInfoSpecific-dump.patch [bz#980771] +- kvm-qcow2-Add-support-for-ImageInfoSpecific.patch [bz#980771] +- kvm-qemu-iotests-Discard-specific-info-in-_img_info.patch [bz#980771] +- kvm-qemu-iotests-Additional-info-from-qemu-img-info.patch [bz#980771] +- kvm-vmdk-convert-error-code-to-use-errp.patch [bz#980771] +- kvm-vmdk-refuse-enabling-zeroed-grain-with-flat-images.patch [bz#980771] +- kvm-qapi-Add-optional-field-compressed-to-ImageInfo.patch [bz#980771] +- kvm-vmdk-Only-read-cid-from-image-file-when-opening.patch [bz#980771] +- kvm-vmdk-Implment-bdrv_get_specific_info.patch [bz#980771] +- Resolves: bz#1004347 + (Backport qcow2 corruption prevention patches) +- Resolves: bz#1026524 + (Backport block layer error parameter patches) +- Resolves: bz#978402 + ([RFE] Add discard support to qemu-kvm layer) +- Resolves: bz#980771 + ([RFE] qemu-img should be able to tell the compat version of a qcow2 image) + +* Thu Nov 07 2013 Miroslav Rezanina - 1.5.3-15.el7 +- kvm-cow-make-reads-go-at-a-decent-speed.patch [bz#989646] +- kvm-cow-make-writes-go-at-a-less-indecent-speed.patch [bz#989646] +- kvm-cow-do-not-call-bdrv_co_is_allocated.patch [bz#989646] +- kvm-block-keep-bs-total_sectors-up-to-date-even-for-grow.patch [bz#989646] +- kvm-block-make-bdrv_co_is_allocated-static.patch [bz#989646] +- kvm-block-do-not-use-total_sectors-in-bdrv_co_is_allocat.patch [bz#989646] +- kvm-block-remove-bdrv_is_allocated_above-bdrv_co_is_allo.patch [bz#989646] +- kvm-block-expect-errors-from-bdrv_co_is_allocated.patch [bz#989646] +- kvm-block-Fix-compiler-warning-Werror-uninitialized.patch [bz#989646] +- kvm-qemu-img-always-probe-the-input-image-for-allocated-.patch [bz#989646] +- kvm-block-make-bdrv_has_zero_init-return-false-for-copy-.patch [bz#989646] +- kvm-block-introduce-bdrv_get_block_status-API.patch [bz#989646] +- kvm-block-define-get_block_status-return-value.patch [bz#989646] +- kvm-block-return-get_block_status-data-and-flags-for-for.patch [bz#989646] +- kvm-block-use-bdrv_has_zero_init-to-return-BDRV_BLOCK_ZE.patch [bz#989646] +- kvm-block-return-BDRV_BLOCK_ZERO-past-end-of-backing-fil.patch [bz#989646] +- kvm-qemu-img-add-a-map-subcommand.patch [bz#989646] +- kvm-docs-qapi-document-qemu-img-map.patch [bz#989646] +- kvm-raw-posix-return-get_block_status-data-and-flags.patch [bz#989646] +- kvm-raw-posix-report-unwritten-extents-as-zero.patch [bz#989646] +- kvm-block-add-default-get_block_status-implementation-fo.patch [bz#989646] +- kvm-block-look-for-zero-blocks-in-bs-file.patch [bz#989646] +- kvm-qemu-img-fix-invalid-JSON.patch [bz#989646] +- kvm-block-get_block_status-set-pnum-0-on-error.patch [bz#989646] +- kvm-block-get_block_status-avoid-segfault-if-there-is-no.patch [bz#989646] +- kvm-block-get_block_status-avoid-redundant-callouts-on-r.patch [bz#989646] +- kvm-qcow2-Restore-total_sectors-value-in-save_vmstate.patch [bz#1025740] +- kvm-qcow2-Unset-zero_beyond_eof-in-save_vmstate.patch [bz#1025740] +- kvm-qemu-iotests-Test-for-loading-VM-state-from-qcow2.patch [bz#1025740] +- kvm-apic-rename-apic-specific-bitopts.patch [bz#1001216] +- kvm-hw-import-bitmap-operations-in-qdev-core-header.patch [bz#1001216] +- kvm-qemu-help-Sort-devices-by-logical-functionality.patch [bz#1001216] +- kvm-devices-Associate-devices-to-their-logical-category.patch [bz#1001216] +- kvm-Mostly-revert-qemu-help-Sort-devices-by-logical-func.patch [bz#1001216] +- kvm-qdev-monitor-Group-device_add-help-and-info-qdm-by-c.patch [bz#1001216] +- kvm-qdev-Replace-no_user-by-cannot_instantiate_with_devi.patch [bz#1001216] +- kvm-sysbus-Set-cannot_instantiate_with_device_add_yet.patch [bz#1001216] +- kvm-cpu-Document-why-cannot_instantiate_with_device_add_.patch [bz#1001216] +- kvm-apic-Document-why-cannot_instantiate_with_device_add.patch [bz#1001216] +- kvm-pci-host-Consistently-set-cannot_instantiate_with_de.patch [bz#1001216] +- kvm-ich9-Document-why-cannot_instantiate_with_device_add.patch [bz#1001216] +- kvm-piix3-piix4-Clean-up-use-of-cannot_instantiate_with_.patch [bz#1001216] +- kvm-vt82c686-Clean-up-use-of-cannot_instantiate_with_dev.patch [bz#1001216] +- kvm-isa-Clean-up-use-of-cannot_instantiate_with_device_a.patch [bz#1001216] +- kvm-qdev-Do-not-let-the-user-try-to-device_add-when-it-c.patch [bz#1001216] +- kvm-rhel-Revert-unwanted-cannot_instantiate_with_device_.patch [bz#1001216] +- kvm-rhel-Revert-downstream-changes-to-unused-default-con.patch [bz#1001076] +- kvm-rhel-Drop-cfi.pflash01-and-isa-ide-device.patch [bz#1001076] +- kvm-rhel-Drop-isa-vga-device.patch [bz#1001088] +- kvm-rhel-Make-isa-cirrus-vga-device-unavailable.patch [bz#1001088] +- kvm-rhel-Make-ccid-card-emulated-device-unavailable.patch [bz#1001123] +- kvm-x86-fix-migration-from-pre-version-12.patch [bz#1005695] +- kvm-x86-cpuid-reconstruct-leaf-0Dh-data.patch [bz#1005695] +- kvm-kvmvapic-Catch-invalid-ROM-size.patch [bz#920021] +- kvm-kvmvapic-Enter-inactive-state-on-hardware-reset.patch [bz#920021] +- kvm-kvmvapic-Clear-also-physical-ROM-address-when-enteri.patch [bz#920021] +- kvm-block-optionally-disable-live-block-jobs.patch [bz#987582] +- kvm-rpm-spec-template-disable-live-block-ops-for-rhel-en.patch [bz#987582] +- kvm-migration-disable-live-block-migration-b-i-for-rhel-.patch [bz#1022392] +- kvm-Build-ceph-rbd-only-for-rhev.patch [bz#987583] +- kvm-spec-Disable-host-cdrom-RHEL-only.patch [bz#760885] +- kvm-rhel-Make-pci-serial-2x-and-pci-serial-4x-device-una.patch [bz#1001180] +- kvm-usb-host-libusb-Fix-reset-handling.patch [bz#980415] +- kvm-usb-host-libusb-Configuration-0-may-be-a-valid-confi.patch [bz#980383] +- kvm-usb-host-libusb-Detach-kernel-drivers-earlier.patch [bz#980383] +- kvm-monitor-Remove-pci_add-command-for-Red-Hat-Enterpris.patch [bz#1010858] +- kvm-monitor-Remove-pci_del-command-for-Red-Hat-Enterpris.patch [bz#1010858] +- kvm-monitor-Remove-usb_add-del-commands-for-Red-Hat-Ente.patch [bz#1010858] +- kvm-monitor-Remove-host_net_add-remove-for-Red-Hat-Enter.patch [bz#1010858] +- kvm-fw_cfg-add-API-to-find-FW-cfg-object.patch [bz#990601] +- kvm-pvpanic-use-FWCfgState-explicitly.patch [bz#990601] +- kvm-pvpanic-initialization-cleanup.patch [bz#990601] +- kvm-pvpanic-fix-fwcfg-for-big-endian-hosts.patch [bz#990601] +- kvm-hw-misc-make-pvpanic-known-to-user.patch [bz#990601] +- kvm-gdbstub-do-not-restart-crashed-guest.patch [bz#990601] +- kvm-gdbstub-fix-for-commit-87f25c12bfeaaa0c41fb857713bbc.patch [bz#990601] +- kvm-vl-allow-cont-from-panicked-state.patch [bz#990601] +- kvm-hw-misc-don-t-create-pvpanic-device-by-default.patch [bz#990601] +- kvm-block-vhdx-add-migration-blocker.patch [bz#1007176] +- kvm-qemu-kvm.spec-add-vhdx-to-the-read-only-block-driver.patch [bz#1007176] +- kvm-qemu-kvm.spec-Add-VPC-VHD-driver-to-the-block-read-o.patch [bz#1007176] +- Resolves: bz#1001076 + (Disable or remove other block devices we won't support) +- Resolves: bz#1001088 + (Disable or remove display devices we won't support) +- Resolves: bz#1001123 + (Disable or remove device ccid-card-emulated) +- Resolves: bz#1001180 + (Disable or remove devices pci-serial-2x, pci-serial-4x) +- Resolves: bz#1001216 + (Fix no_user or provide another way make devices unavailable with -device / device_add) +- Resolves: bz#1005695 + (QEMU should hide CPUID.0Dh values that it does not support) +- Resolves: bz#1007176 + (Add VPC and VHDX file formats as supported in qemu-kvm (read-only)) +- Resolves: bz#1010858 + (Disable unused human monitor commands) +- Resolves: bz#1022392 + (Disable live-storage-migration in qemu-kvm (migrate -b/-i)) +- Resolves: bz#1025740 + (Saving VM state on qcow2 images results in VM state corruption) +- Resolves: bz#760885 + (Disable host cdrom passthrough) +- Resolves: bz#920021 + (qemu-kvm segment fault when reboot guest after hot unplug device with option ROM) +- Resolves: bz#980383 + (The usb3.0 stick can't be returned back to host after shutdown guest with usb3.0 pass-through) +- Resolves: bz#980415 + (libusbx: error [_open_sysfs_attr] open /sys/bus/usb/devices/4-1/bConfigurationValue failed ret=-1 errno=2) +- Resolves: bz#987582 + (Initial Virtualization Differentiation for RHEL7 (Live snapshots)) +- Resolves: bz#987583 + (Initial Virtualization Differentiation for RHEL7 (Ceph enablement)) +- Resolves: bz#989646 + (Support backup vendors in qemu to access qcow disk readonly) +- Resolves: bz#990601 + (pvpanic device triggers guest bugs when present by default) + +* Wed Nov 06 2013 Miroslav Rezanina - 1.5.3-14.el7 +- kvm-target-i386-remove-tabs-from-target-i386-cpu.h.patch [bz#928867] +- kvm-migrate-vPMU-state.patch [bz#928867] +- kvm-blockdev-do-not-default-cache.no-flush-to-true.patch [bz#1009993] +- kvm-virtio-blk-do-not-relay-a-previous-driver-s-WCE-conf.patch [bz#1009993] +- kvm-rng-random-use-error_setg_file_open.patch [bz#907743] +- kvm-block-mirror_complete-use-error_setg_file_open.patch [bz#907743] +- kvm-blockdev-use-error_setg_file_open.patch [bz#907743] +- kvm-cpus-use-error_setg_file_open.patch [bz#907743] +- kvm-dump-qmp_dump_guest_memory-use-error_setg_file_open.patch [bz#907743] +- kvm-savevm-qmp_xen_save_devices_state-use-error_setg_fil.patch [bz#907743] +- kvm-block-bdrv_reopen_prepare-don-t-use-QERR_OPEN_FILE_F.patch [bz#907743] +- kvm-qerror-drop-QERR_OPEN_FILE_FAILED-macro.patch [bz#907743] +- kvm-rhel-Drop-ivshmem-device.patch [bz#787463] +- kvm-usb-remove-old-usb-host-code.patch [bz#1001144] +- kvm-Add-rhel6-pxe-roms-files.patch [bz#997702] +- kvm-Add-rhel6-pxe-rom-to-redhat-rpm.patch [bz#997702] +- kvm-Fix-migration-from-rhel6.5-to-rhel7-with-ipxe.patch [bz#997702] +- kvm-pc-Don-t-prematurely-explode-QEMUMachineInitArgs.patch [bz#994490] +- kvm-pc-Don-t-explode-QEMUMachineInitArgs-into-local-vari.patch [bz#994490] +- kvm-smbios-Normalize-smbios_entry_add-s-error-handling-t.patch [bz#994490] +- kvm-smbios-Convert-to-QemuOpts.patch [bz#994490] +- kvm-smbios-Improve-diagnostics-for-conflicting-entries.patch [bz#994490] +- kvm-smbios-Make-multiple-smbios-type-accumulate-sanely.patch [bz#994490] +- kvm-smbios-Factor-out-smbios_maybe_add_str.patch [bz#994490] +- kvm-hw-Pass-QEMUMachine-to-its-init-method.patch [bz#994490] +- kvm-smbios-Set-system-manufacturer-product-version-by-de.patch [bz#994490] +- kvm-smbios-Decouple-system-product-from-QEMUMachine.patch [bz#994490] +- kvm-rhel-SMBIOS-type-1-branding.patch [bz#994490] +- kvm-Add-disable-rhev-features-option-to-configure.patch [] +- Resolves: bz#1001144 + (Disable or remove device usb-host-linux) +- Resolves: bz#1009993 + (RHEL7 guests do not issue fdatasyncs on virtio-blk) +- Resolves: bz#787463 + (disable ivshmem (was: [Hitachi 7.0 FEAT] Support ivshmem (Inter-VM Shared Memory))) +- Resolves: bz#907743 + (qemu-ga: empty reason string for OpenFileFailed error) +- Resolves: bz#928867 + (Virtual PMU support during live migration - qemu-kvm) +- Resolves: bz#994490 + (Set per-machine-type SMBIOS strings) +- Resolves: bz#997702 + (Migration from RHEL6.5 host to RHEL7.0 host is failed with virtio-net device) + +* Tue Nov 05 2013 Miroslav Rezanina - 1.5.3-13.el7 +- kvm-seabios-paravirt-allow-more-than-1TB-in-x86-guest.patch [bz#989677] +- kvm-scsi-prefer-UUID-to-VM-name-for-the-initiator-name.patch [bz#1006468] +- kvm-Fix-incorrect-rhel_rhev_conflicts-macro-usage.patch [bz#1017693] +- Resolves: bz#1006468 + (libiscsi initiator name should use vm UUID) +- Resolves: bz#1017693 + (incorrect use of rhel_rhev_conflicts) +- Resolves: bz#989677 + ([HP 7.0 FEAT]: Increase KVM guest supported memory to 4TiB) + +* Mon Nov 04 2013 Michal Novotny - 1.5.3-12.el7 +- kvm-vl-Clean-up-parsing-of-boot-option-argument.patch [bz#997817] +- kvm-qemu-option-check_params-is-now-unused-drop-it.patch [bz#997817] +- kvm-vl-Fix-boot-order-and-once-regressions-and-related-b.patch [bz#997817] +- kvm-vl-Rename-boot_devices-to-boot_order-for-consistency.patch [bz#997817] +- kvm-pc-Make-no-fd-bootchk-stick-across-boot-order-change.patch [bz#997817] +- kvm-doc-Drop-ref-to-Bochs-from-no-fd-bootchk-documentati.patch [bz#997817] +- kvm-libqtest-Plug-fd-and-memory-leaks-in-qtest_quit.patch [bz#997817] +- kvm-libqtest-New-qtest_end-to-go-with-qtest_start.patch [bz#997817] +- kvm-qtest-Don-t-reset-on-qtest-chardev-connect.patch [bz#997817] +- kvm-boot-order-test-New-covering-just-PC-for-now.patch [bz#997817] +- kvm-qemu-ga-execute-fsfreeze-freeze-in-reverse-order-of-.patch [bz#1019352] +- kvm-rbd-link-and-load-librbd-dynamically.patch [bz#989608] +- kvm-rbd-Only-look-for-qemu-specific-copy-of-librbd.so.1.patch [bz#989608] +- kvm-spec-Whitelist-rbd-block-driver.patch [bz#989608] +- Resolves: bz#1019352 + (qemu-guest-agent: "guest-fsfreeze-freeze" deadlocks if the guest have mounted disk images) +- Resolves: bz#989608 + ([7.0 FEAT] qemu runtime support for librbd backend (ceph)) +- Resolves: bz#997817 + (-boot order and -boot once regressed since RHEL-6) + +* Thu Oct 31 2013 Miroslav Rezanina - 1.5.3-11.el7 +- kvm-chardev-fix-pty_chr_timer.patch [bz#994414] +- kvm-qemu-socket-zero-initialize-SocketAddress.patch [bz#922010] +- kvm-qemu-socket-drop-pointless-allocation.patch [bz#922010] +- kvm-qemu-socket-catch-monitor_get_fd-failures.patch [bz#922010] +- kvm-qemu-char-check-optional-fields-using-has_.patch [bz#922010] +- kvm-error-add-error_setg_file_open-helper.patch [bz#922010] +- kvm-qemu-char-use-more-specific-error_setg_-variants.patch [bz#922010] +- kvm-qemu-char-print-notification-to-stderr.patch [bz#922010] +- kvm-qemu-char-fix-documentation-for-telnet-wait-socket-f.patch [bz#922010] +- kvm-qemu-char-don-t-leak-opts-on-error.patch [bz#922010] +- kvm-qemu-char-use-ChardevBackendKind-in-CharDriver.patch [bz#922010] +- kvm-qemu-char-minor-mux-chardev-fixes.patch [bz#922010] +- kvm-qemu-char-add-chardev-mux-support.patch [bz#922010] +- kvm-qemu-char-report-udp-backend-errors.patch [bz#922010] +- kvm-qemu-socket-don-t-leak-opts-on-error.patch [bz#922010] +- kvm-chardev-handle-qmp_chardev_add-KIND_MUX-failure.patch [bz#922010] +- kvm-acpi-piix4-Enable-qemu-kvm-compatibility-mode.patch [bz#1019474] +- kvm-target-i386-support-loading-of-cpu-xsave-subsection.patch [bz#1004743] +- Resolves: bz#1004743 + (XSAVE migration format not compatible between RHEL6 and RHEL7) +- Resolves: bz#1019474 + (RHEL-7 can't load piix4_pm migration section from RHEL-6.5) +- Resolves: bz#922010 + (RFE: support hotplugging chardev & serial ports) +- Resolves: bz#994414 + (hot-unplug chardev with pty backend caused qemu Segmentation fault) + +* Thu Oct 17 2013 Miroslav Rezanina - 1.5.3-10.el7 +- kvm-xhci-fix-endpoint-interval-calculation.patch [bz#1001604] +- kvm-xhci-emulate-intr-endpoint-intervals-correctly.patch [bz#1001604] +- kvm-xhci-reset-port-when-disabling-slot.patch [bz#1001604] +- kvm-Revert-usb-hub-report-status-changes-only-once.patch [bz#1001604] +- kvm-target-i386-Set-model-6-on-qemu64-qemu32-CPU-models.patch [bz#1004290] +- kvm-pc-rhel6-doesn-t-have-APIC-on-pentium-CPU-models.patch [bz#918907] +- kvm-pc-RHEL-6-had-x2apic-set-on-Opteron_G-123.patch [bz#918907] +- kvm-pc-RHEL-6-don-t-have-RDTSCP.patch [bz#918907] +- kvm-scsi-Fix-scsi_bus_legacy_add_drive-scsi-generic-with.patch [bz#1009285] +- kvm-seccomp-fine-tuning-whitelist-by-adding-times.patch [bz#1004175] +- kvm-block-add-bdrv_write_zeroes.patch [bz#921465] +- kvm-block-raw-add-bdrv_co_write_zeroes.patch [bz#921465] +- kvm-rdma-export-qemu_fflush.patch [bz#921465] +- kvm-block-migration-efficiently-encode-zero-blocks.patch [bz#921465] +- kvm-Fix-real-mode-guest-migration.patch [bz#921465] +- kvm-Fix-real-mode-guest-segments-dpl-value-in-savevm.patch [bz#921465] +- kvm-migration-add-autoconvergence-documentation.patch [bz#921465] +- kvm-migration-send-total-time-in-QMP-at-completed-stage.patch [bz#921465] +- kvm-migration-don-t-use-uninitialized-variables.patch [bz#921465] +- kvm-pc-drop-external-DSDT-loading.patch [bz#921465] +- kvm-hda-codec-refactor-common-definitions-into-a-header-.patch [bz#954195] +- kvm-hda-codec-make-mixemu-selectable-at-runtime.patch [bz#954195] +- kvm-audio-remove-CONFIG_MIXEMU-configure-option.patch [bz#954195] +- kvm-pc_piix-disable-mixer-for-6.4.0-machine-types-and-be.patch [bz#954195] +- kvm-spec-mixemu-config-option-is-no-longer-supported-and.patch [bz#954195] +- Resolves: bz#1001604 + (usb hub doesn't work properly (win7 sees downstream port #1 only).) +- Resolves: bz#1004175 + ('-sandbox on' option cause qemu-kvm process hang) +- Resolves: bz#1004290 + (Use model 6 for qemu64 and intel cpus) +- Resolves: bz#1009285 + (-device usb-storage,serial=... crashes with SCSI generic drive) +- Resolves: bz#918907 + (provide backwards-compatible RHEL specific machine types in QEMU - CPU features) +- Resolves: bz#921465 + (Migration can not finished even the "remaining ram" is already 0 kb) +- Resolves: bz#954195 + (RHEL machines <=6.4 should not use mixemu) + +* Thu Oct 10 2013 Miroslav Rezanina - 1.5.3-9.el7 +- kvm-qxl-fix-local-renderer.patch [bz#1005036] +- kvm-spec-include-userspace-iSCSI-initiator-in-block-driv.patch [bz#923843] +- kvm-linux-headers-update-to-kernel-3.10.0-26.el7.patch [bz#1008987] +- kvm-target-i386-add-feature-kvm_pv_unhalt.patch [bz#1008987] +- kvm-warn-if-num-cpus-is-greater-than-num-recommended.patch [bz#1010881] +- kvm-char-move-backends-io-watch-tag-to-CharDriverState.patch [bz#1007222] +- kvm-char-use-common-function-to-disable-callbacks-on-cha.patch [bz#1007222] +- kvm-char-remove-watch-callback-on-chardev-detach-from-fr.patch [bz#1007222] +- kvm-block-don-t-lose-data-from-last-incomplete-sector.patch [bz#1017049] +- kvm-vmdk-fix-cluster-size-check-for-flat-extents.patch [bz#1017049] +- kvm-qemu-iotests-add-monolithicFlat-creation-test-to-059.patch [bz#1017049] +- Resolves: bz#1005036 + (When using “-vga qxl” together with “-display vnc=:5” or “-display sdl” qemu displays pixel garbage) +- Resolves: bz#1007222 + (QEMU core dumped when do hot-unplug virtio serial port during transfer file between host to guest with virtio serial through TCP socket) +- Resolves: bz#1008987 + (pvticketlocks: add kvm feature kvm_pv_unhalt) +- Resolves: bz#1010881 + (backport vcpu soft limit warning) +- Resolves: bz#1017049 + (qemu-img refuses to open the vmdk format image its created) +- Resolves: bz#923843 + (include userspace iSCSI initiator in block driver whitelist) + +* Wed Oct 09 2013 Miroslav Rezanina - qemu-kvm-1.5.3-8.el7 +- kvm-vmdk-Make-VMDK3Header-and-VmdkGrainMarker-QEMU_PACKE.patch [bz#995866] +- kvm-vmdk-use-unsigned-values-for-on-disk-header-fields.patch [bz#995866] +- kvm-qemu-iotests-add-poke_file-utility-function.patch [bz#995866] +- kvm-qemu-iotests-add-empty-test-case-for-vmdk.patch [bz#995866] +- kvm-vmdk-check-granularity-field-in-opening.patch [bz#995866] +- kvm-vmdk-check-l2-table-size-when-opening.patch [bz#995866] +- kvm-vmdk-check-l1-size-before-opening-image.patch [bz#995866] +- kvm-vmdk-use-heap-allocation-for-whole_grain.patch [bz#995866] +- kvm-vmdk-rename-num_gtes_per_gte-to-num_gtes_per_gt.patch [bz#995866] +- kvm-vmdk-Move-l1_size-check-into-vmdk_add_extent.patch [bz#995866] +- kvm-vmdk-fix-L1-and-L2-table-size-in-vmdk3-open.patch [bz#995866] +- kvm-vmdk-support-vmfsSparse-files.patch [bz#995866] +- kvm-vmdk-support-vmfs-files.patch [bz#995866] +- Resolves: bz#995866 + (fix vmdk support to ESX images) + +* Thu Sep 26 2013 Miroslav Rezanina - qemu-kvm-1.5.3-7.el7 +- kvm-spice-fix-display-initialization.patch [bz#974887] +- kvm-Remove-i82550-network-card-emulation.patch [bz#921983] +- kvm-Remove-usb-wacom-tablet.patch [bz#903914] +- kvm-Disable-usb-uas.patch [bz#903914] +- kvm-Disable-vhost-scsi.patch [bz#994642] +- kvm-Remove-no-hpet-option.patch [bz#947441] +- kvm-Disable-isa-parallel.patch [bz#1002286] +- kvm-xhci-implement-warm-port-reset.patch [bz#949514] +- kvm-usb-add-serial-bus-property.patch [bz#953304] +- kvm-rhel6-compat-usb-serial-numbers.patch [bz#953304] +- kvm-vmdk-fix-comment-for-vmdk_co_write_zeroes.patch [bz#995866] +- kvm-gluster-Add-image-resize-support.patch [bz#1007226] +- kvm-block-Introduce-bs-zero_beyond_eof.patch [bz#1007226] +- kvm-block-Produce-zeros-when-protocols-reading-beyond-en.patch [bz#1007226] +- kvm-gluster-Abort-on-AIO-completion-failure.patch [bz#1007226] +- kvm-Preparation-for-usb-bt-dongle-conditional-build.patch [bz#1001131] +- kvm-Remove-dev-bluetooth.c-dependency-from-vl.c.patch [bz#1001131] +- kvm-exec-Fix-Xen-RAM-allocation-with-unusual-options.patch [bz#1009328] +- kvm-exec-Clean-up-fall-back-when-mem-path-allocation-fai.patch [bz#1009328] +- kvm-exec-Reduce-ifdeffery-around-mem-path.patch [bz#1009328] +- kvm-exec-Simplify-the-guest-physical-memory-allocation-h.patch [bz#1009328] +- kvm-exec-Drop-incorrect-dead-S390-code-in-qemu_ram_remap.patch [bz#1009328] +- kvm-exec-Clean-up-unnecessary-S390-ifdeffery.patch [bz#1009328] +- kvm-exec-Don-t-abort-when-we-can-t-allocate-guest-memory.patch [bz#1009328] +- kvm-pc_sysfw-Fix-ISA-BIOS-init-for-ridiculously-big-flas.patch [bz#1009328] +- kvm-virtio-scsi-Make-type-virtio-scsi-common-abstract.patch [bz#903918] +- kvm-qga-move-logfiles-to-new-directory-for-easier-SELinu.patch [bz#1009491] +- kvm-target-i386-add-cpu64-rhel6-CPU-model.patch [bz#918907] +- kvm-fix-steal-time-MSR-vmsd-callback-to-proper-opaque-ty.patch [bz#903889] +- Resolves: bz#1001131 + (Disable or remove device usb-bt-dongle) +- Resolves: bz#1002286 + (Disable or remove device isa-parallel) +- Resolves: bz#1007226 + (Introduce bs->zero_beyond_eof) +- Resolves: bz#1009328 + ([RFE] Nicer error report when qemu-kvm can't allocate guest RAM) +- Resolves: bz#1009491 + (move qga logfiles to new /var/log/qemu-ga/ directory [RHEL-7]) +- Resolves: bz#903889 + (The value of steal time in "top" command always is "0.0% st" after guest migration) +- Resolves: bz#903914 + (Disable or remove usb related devices that we will not support) +- Resolves: bz#903918 + (Disable or remove emulated SCSI devices we will not support) +- Resolves: bz#918907 + (provide backwards-compatible RHEL specific machine types in QEMU - CPU features) +- Resolves: bz#921983 + (Disable or remove emulated network devices that we will not support) +- Resolves: bz#947441 + (HPET device must be disabled) +- Resolves: bz#949514 + (fail to passthrough the USB3.0 stick to windows guest with xHCI controller under pc-i440fx-1.4) +- Resolves: bz#953304 + (Serial number of some USB devices must be fixed for older RHEL machine types) +- Resolves: bz#974887 + (the screen of guest fail to display correctly when use spice + qxl driver) +- Resolves: bz#994642 + (should disable vhost-scsi) +- Resolves: bz#995866 + (fix vmdk support to ESX images) + +* Mon Sep 23 2013 Paolo Bonzini - qemu-kvm-1.5.3-6.el7 +- re-enable spice +- Related: #979953 + +* Mon Sep 23 2013 Paolo Bonzini - qemu-kvm-1.5.3-5.el7 +- temporarily disable spice until libiscsi rebase is complete +- Related: #979953 + +* Thu Sep 19 2013 Michal Novotny - qemu-kvm-1.5.3-4.el7 +- kvm-block-package-preparation-code-in-qmp_transaction.patch [bz#1005818] +- kvm-block-move-input-parsing-code-in-qmp_transaction.patch [bz#1005818] +- kvm-block-package-committing-code-in-qmp_transaction.patch [bz#1005818] +- kvm-block-package-rollback-code-in-qmp_transaction.patch [bz#1005818] +- kvm-block-make-all-steps-in-qmp_transaction-as-callback.patch [bz#1005818] +- kvm-blockdev-drop-redundant-proto_drv-check.patch [bz#1005818] +- kvm-block-Don-t-parse-protocol-from-file.filename.patch [bz#1005818] +- kvm-Revert-block-Disable-driver-specific-options-for-1.5.patch [bz#1005818] +- kvm-qcow2-Add-refcount-update-reason-to-all-callers.patch [bz#1005818] +- kvm-qcow2-Options-to-enable-discard-for-freed-clusters.patch [bz#1005818] +- kvm-qcow2-Batch-discards.patch [bz#1005818] +- kvm-block-Always-enable-discard-on-the-protocol-level.patch [bz#1005818] +- kvm-qapi.py-Avoid-code-duplication.patch [bz#1005818] +- kvm-qapi.py-Allow-top-level-type-reference-for-command-d.patch [bz#1005818] +- kvm-qapi-schema-Use-BlockdevSnapshot-type-for-blockdev-s.patch [bz#1005818] +- kvm-qapi-types.py-Implement-base-for-unions.patch [bz#1005818] +- kvm-qapi-visit.py-Split-off-generate_visit_struct_fields.patch [bz#1005818] +- kvm-qapi-visit.py-Implement-base-for-unions.patch [bz#1005818] +- kvm-docs-Document-QAPI-union-types.patch [bz#1005818] +- kvm-qapi-Add-visitor-for-implicit-structs.patch [bz#1005818] +- kvm-qapi-Flat-unions-with-arbitrary-discriminator.patch [bz#1005818] +- kvm-qapi-Add-consume-argument-to-qmp_input_get_object.patch [bz#1005818] +- kvm-qapi.py-Maintain-a-list-of-union-types.patch [bz#1005818] +- kvm-qapi-qapi-types.py-native-list-support.patch [bz#1005818] +- kvm-qapi-Anonymous-unions.patch [bz#1005818] +- kvm-block-Allow-driver-option-on-the-top-level.patch [bz#1005818] +- kvm-QemuOpts-Add-qemu_opt_unset.patch [bz#1005818] +- kvm-blockdev-Rename-I-O-throttling-options-for-QMP.patch [bz#1005818] +- kvm-qemu-iotests-Update-051-reference-output.patch [bz#1005818] +- kvm-blockdev-Rename-readonly-option-to-read-only.patch [bz#1005818] +- kvm-blockdev-Split-up-cache-option.patch [bz#1005818] +- kvm-qcow2-Use-dashes-instead-of-underscores-in-options.patch [bz#1005818] +- kvm-qemu-iotests-filter-QEMU-version-in-monitor-banner.patch [bz#1006959] +- kvm-tests-set-MALLOC_PERTURB_-to-expose-memory-bugs.patch [bz#1006959] +- kvm-qemu-iotests-Whitespace-cleanup.patch [bz#1006959] +- kvm-qemu-iotests-Fixed-test-case-026.patch [bz#1006959] +- kvm-qemu-iotests-Fix-test-038.patch [bz#1006959] +- kvm-qemu-iotests-Remove-lsi53c895a-tests-from-051.patch [bz#1006959] +- Resolves: bz#1005818 + (qcow2: Backport discard command line options) +- Resolves: bz#1006959 + (qemu-iotests false positives) + +* Thu Aug 29 2013 Miroslav Rezanina - qemu-kvm-1.5.3-3.el7 +- Fix rhel/rhev split + +* Thu Aug 29 2013 Miroslav Rezanina - qemu-kvm-1.5.3-2.el7 +- kvm-osdep-add-qemu_get_local_state_pathname.patch [bz#964304] +- kvm-qga-determine-default-state-dir-and-pidfile-dynamica.patch [bz#964304] +- kvm-configure-don-t-save-any-fixed-local_statedir-for-wi.patch [bz#964304] +- kvm-qga-create-state-directory-on-win32.patch [bz#964304] +- kvm-qga-save-state-directory-in-ga_install_service-RHEL-.patch [bz#964304] +- kvm-Makefile-create-.-var-run-when-installing-the-POSIX-.patch [bz#964304] +- kvm-qemu-option-Fix-qemu_opts_find-for-null-id-arguments.patch [bz#980782] +- kvm-qemu-option-Fix-qemu_opts_set_defaults-for-corner-ca.patch [bz#980782] +- kvm-vl-New-qemu_get_machine_opts.patch [bz#980782] +- kvm-Fix-machine-options-accel-kernel_irqchip-kvm_shadow_.patch [bz#980782] +- kvm-microblaze-Fix-latent-bug-with-default-DTB-lookup.patch [bz#980782] +- kvm-Simplify-machine-option-queries-with-qemu_get_machin.patch [bz#980782] +- kvm-pci-add-VMSTATE_MSIX.patch [bz#838170] +- kvm-xhci-add-XHCISlot-addressed.patch [bz#838170] +- kvm-xhci-add-xhci_alloc_epctx.patch [bz#838170] +- kvm-xhci-add-xhci_init_epctx.patch [bz#838170] +- kvm-xhci-add-live-migration-support.patch [bz#838170] +- kvm-pc-set-level-xlevel-correctly-on-486-qemu32-CPU-mode.patch [bz#918907] +- kvm-pc-Remove-incorrect-rhel6.x-compat-model-value-for-C.patch [bz#918907] +- kvm-pc-rhel6.x-has-x2apic-present-on-Conroe-Penryn-Nehal.patch [bz#918907] +- kvm-pc-set-compat-CPUID-0x80000001-.EDX-bits-on-Westmere.patch [bz#918907] +- kvm-pc-Remove-PCLMULQDQ-from-Westmere-on-rhel6.x-machine.patch [bz#918907] +- kvm-pc-SandyBridge-rhel6.x-compat-fixes.patch [bz#918907] +- kvm-pc-Haswell-doesn-t-have-rdtscp-on-rhel6.x.patch [bz#918907] +- kvm-i386-fix-LAPIC-TSC-deadline-timer-save-restore.patch [bz#972433] +- kvm-all.c-max_cpus-should-not-exceed-KVM-vcpu-limit.patch [bz#996258] +- kvm-add-timestamp-to-error_report.patch [bz#906937] +- kvm-Convert-stderr-message-calling-error_get_pretty-to-e.patch [bz#906937] +- Resolves: bz#838170 + (Add live migration support for USB [xhci, usb-uas]) +- Resolves: bz#906937 + ([Hitachi 7.0 FEAT][QEMU]Add a time stamp to error message (*)) +- Resolves: bz#918907 + (provide backwards-compatible RHEL specific machine types in QEMU - CPU features) +- Resolves: bz#964304 + (Windows guest agent service failed to be started) +- Resolves: bz#972433 + ("INFO: rcu_sched detected stalls" after RHEL7 kvm vm migrated) +- Resolves: bz#980782 + (kernel_irqchip defaults to off instead of on without -machine) +- Resolves: bz#996258 + (boot guest with maxcpu=255 successfully but actually max number of vcpu is 160) + +* Wed Aug 28 2013 Miroslav Rezanina - 10:1.5.3-1 +- Rebase to qemu 1.5.3 + +* Tue Aug 20 2013 Miroslav Rezanina - 10:1.5.2-4 +- qemu: guest agent creates files with insecure permissions in deamon mode [rhel-7.0] (rhbz 974444) +- update qemu-ga config & init script in RHEL7 wrt. fsfreeze hook (rhbz 969942) +- RHEL7 does not have equivalent functionality for __com.redhat_qxl_screendump (rhbz 903910) +- SEP flag behavior for CPU models of RHEL6 machine types should be compatible (rhbz 960216) +- crash command can not read the dump-guest-memory file when paging=false [RHEL-7] (rhbz 981582) +- RHEL 7 qemu-kvm fails to build on F19 host due to libusb deprecated API (rhbz 996469) +- Live migration support in virtio-blk-data-plane (rhbz 995030) +- qemu-img resize can execute successfully even input invalid syntax (rhbz 992935) + +* Fri Aug 09 2013 Miroslav Rezanina - 10:1.5.2-3 +- query mem info from monitor would cause qemu-kvm hang [RHEL-7] (rhbz #970047) +- Throttle-down guest to help with live migration convergence (backport to RHEL7.0) (rhbz #985958) +- disable (for now) EFI-enabled roms (rhbz #962563) +- qemu-kvm "vPMU passthrough" mode breaks migration, shouldn't be enabled by default (rhbz #853101) +- Remove pending watches after virtserialport unplug (rhbz #992900) +- Containment of error when an SR-IOV device encounters an error... (rhbz #984604) + +* Wed Jul 31 2013 Miroslav Rezanina - 10:1.5.2-2 +- SPEC file prepared for RHEL/RHEV split (rhbz #987165) +- RHEL guest( sata disk ) can not boot up (rhbz #981723) +- Kill the "use flash device for BIOS unless KVM" misfeature (rhbz #963280) +- Provide RHEL-6 machine types (rhbz #983991) +- Change s3/s4 default to "disable". (rhbz #980840) +- Support Virtual Memory Disk Format in qemu (rhbz #836675) +- Glusterfs backend for QEMU (rhbz #805139) + +* Tue Jul 02 2013 Miroslav Rezanina - 10:1.5.2-1 +- Rebase to 1.5.2 + +* Tue Jul 02 2013 Miroslav Rezanina - 10:1.5.1-2 +- Fix package package version info (bz #952996) +- pc: Replace upstream machine types by RHEL-7 types (bz #977864) +- target-i386: Update model values on Conroe/Penryn/Nehalem CPU model (bz #861210) +- target-i386: Set level=4 on Conroe/Penryn/Nehalem (bz #861210) + +* Fri Jun 28 2013 Miroslav Rezanina - 10:1.5.1-1 +- Rebase to 1.5.1 +- Change epoch to 10 to obsolete RHEL-6 qemu-kvm-rhev package (bz #818626) + +* Fri May 24 2013 Miroslav Rezanina - 3:1.5.0-2 +- Enable werror (bz #948290) +- Enable nbd driver (bz #875871) +- Fix udev rules file location (bz #958860) +- Remove +x bit from systemd unit files (bz #965000) +- Drop unneeded kvm.modules on x86 (bz #963642) +- Fix build flags +- Enable libusb + +* Thu May 23 2013 Miroslav Rezanina - 3:1.5.0-1 +- Rebase to 1.5.0 + +* Tue Apr 23 2013 Miroslav Rezanina - 3:1.4.0-4 +- Enable build of libcacard subpackage for non-x86_64 archs (bz #873174) +- Enable build of qemu-img subpackage for non-x86_64 archs (bz #873174) +- Enable build of qemu-guest-agent subpackage for non-x86_64 archs (bz #873174) + +* Tue Apr 23 2013 Miroslav Rezanina - 3:1.4.0-3 +- Enable/disable features supported by rhel7 +- Use qemu-kvm instead of qemu in filenames and pathes + +* Fri Apr 19 2013 Daniel Mach - 3:1.4.0-2.1 +- Rebuild for cyrus-sasl + +* Fri Apr 05 2013 Miroslav Rezanina - 3:1.4.0-2 +- Synchronization with Fedora 19 package version 2:1.4.0-8 + +* Wed Apr 03 2013 Daniel Mach - 3:1.4.0-1.1 +- Rebuild for libseccomp + +* Thu Mar 07 2013 Miroslav Rezanina - 3:1.4.0-1 +- Rebase to 1.4.0 + +* Mon Feb 25 2013 Michal Novotny - 3:1.3.0-8 +- Missing package qemu-system-x86 in hardware certification kvm testing (bz#912433) +- Resolves: bz#912433 + (Missing package qemu-system-x86 in hardware certification kvm testing) + +* Fri Feb 22 2013 Alon Levy - 3:1.3.0-6 +- Bump epoch back to 3 since there has already been a 3 package release: + 3:1.2.0-20.el7 https://brewweb.devel.redhat.com/buildinfo?buildID=244866 +- Mark explicit libcacard dependency on new enough qemu-img to avoid conflict + since /usr/bin/vscclient was moved from qemu-img to libcacard subpackage. + +* Wed Feb 13 2013 Michal Novotny - 2:1.3.0-5 +- Fix patch contents for usb-redir (bz#895491) +- Resolves: bz#895491 + (PATCH: 0110-usb-redir-Add-flow-control-support.patch has been mangled on rebase !!) + +* Wed Feb 06 2013 Alon Levy - 2:1.3.0-4 +- Add patch from f19 package for libcacard missing error_set symbol. +- Resolves: bz#891552 + +* Mon Jan 07 2013 Michal Novotny - 2:1.3.0-3 +- Remove dependency on bogus qemu-kvm-kvm package [bz#870343] +- Resolves: bz#870343 + (qemu-kvm-1.2.0-16.el7 cant be installed) + +* Tue Dec 18 2012 Michal Novotny - 2:1.3.0-2 +- Rename qemu to qemu-kvm +- Move qemu-kvm to libexecdir + +* Fri Dec 07 2012 Cole Robinson - 2:1.3.0-1 +- Switch base tarball from qemu-kvm to qemu +- qemu 1.3 release +- Option to use linux VFIO driver to assign PCI devices +- Many USB3 improvements +- New paravirtualized hardware random number generator device. +- Support for Glusterfs volumes with "gluster://" -drive URI +- Block job commands for live block commit and storage migration + +* Wed Nov 28 2012 Alon Levy - 2:1.2.0-25 +* Merge libcacard into qemu, since they both use the same sources now. + +* Thu Nov 22 2012 Paolo Bonzini - 2:1.2.0-24 +- Move vscclient to qemu-common, qemu-nbd to qemu-img + +* Tue Nov 20 2012 Alon Levy - 2:1.2.0-23 +- Rewrite fix for bz #725965 based on fix for bz #867366 +- Resolve bz #867366 + +* Fri Nov 16 2012 Paolo Bonzini - 2:1.2.0-23 +- Backport --with separate_kvm support from EPEL branch + +* Fri Nov 16 2012 Paolo Bonzini - 2:1.2.0-22 +- Fix previous commit + +* Fri Nov 16 2012 Paolo Bonzini - 2:1.2.0-21 +- Backport commit 38f419f (configure: Fix CONFIG_QEMU_HELPERDIR generation, + 2012-10-17) + +* Thu Nov 15 2012 Paolo Bonzini - 2:1.2.0-20 +- Install qemu-bridge-helper as suid root +- Distribute a sample /etc/qemu/bridge.conf file + +* Thu Nov 1 2012 Hans de Goede - 2:1.2.0-19 +- Sync spice patches with upstream, minor bugfixes and set the qxl pci + device revision to 4 by default, so that guests know they can use + the new features + +* Tue Oct 30 2012 Cole Robinson - 2:1.2.0-18 +- Fix loading arm initrd if kernel is very large (bz #862766) +- Don't use reserved word 'function' in systemtap files (bz #870972) +- Drop assertion that was triggering when pausing guests w/ qxl (bz + #870972) + +* Sun Oct 28 2012 Cole Robinson - 2:1.2.0-17 +- Pull patches queued for qemu 1.2.1 + +* Fri Oct 19 2012 Paolo Bonzini - 2:1.2.0-16 +- add s390x KVM support +- distribute pre-built firmware or device trees for Alpha, Microblaze, S390 +- add missing system targets +- add missing linux-user targets +- fix previous commit + +* Thu Oct 18 2012 Dan Horák - 2:1.2.0-15 +- fix build on non-kvm arches like s390(x) + +* Wed Oct 17 2012 Paolo Bonzini - 2:1.2.0-14 +- Change SLOF Requires for the new version number + +* Thu Oct 11 2012 Paolo Bonzini - 2:1.2.0-13 +- Add ppc support to kvm.modules (original patch by David Gibson) +- Replace x86only build with kvmonly build: add separate defines and + conditionals for all packages, so that they can be chosen and + renamed in kvmonly builds and so that qemu has the appropriate requires +- Automatically pick libfdt dependancy +- Add knob to disable spice+seccomp + +* Fri Sep 28 2012 Paolo Bonzini - 2:1.2.0-12 +- Call udevadm on post, fixing bug 860658 + +* Fri Sep 28 2012 Hans de Goede - 2:1.2.0-11 +- Rebuild against latest spice-server and spice-protocol +- Fix non-seamless migration failing with vms with usb-redir devices, + to allow boxes to load such vms from disk + +* Tue Sep 25 2012 Hans de Goede - 2:1.2.0-10 +- Sync Spice patchsets with upstream (rhbz#860238) +- Fix building with usbredir >= 0.5.2 + +* Thu Sep 20 2012 Hans de Goede - 2:1.2.0-9 +- Sync USB and Spice patchsets with upstream + +* Sun Sep 16 2012 Richard W.M. Jones - 2:1.2.0-8 +- Use 'global' instead of 'define', and underscore in definition name, + n-v-r, and 'dist' tag of SLOF, all to fix RHBZ#855252. + +* Fri Sep 14 2012 Paolo Bonzini - 2:1.2.0-4 +- add versioned dependency from qemu-system-ppc to SLOF (BZ#855252) + +* Wed Sep 12 2012 Richard W.M. Jones - 2:1.2.0-3 +- Fix RHBZ#853408 which causes libguestfs failure. + +* Sat Sep 8 2012 Hans de Goede - 2:1.2.0-2 +- Fix crash on (seamless) migration +- Sync usbredir live migration patches with upstream + +* Fri Sep 7 2012 Hans de Goede - 2:1.2.0-1 +- New upstream release 1.2.0 final +- Add support for Spice seamless migration +- Add support for Spice dynamic monitors +- Add support for usb-redir live migration + +* Tue Sep 04 2012 Adam Jackson 1.2.0-0.5.rc1 +- Flip Requires: ceph >= foo to Conflicts: ceph < foo, so we pull in only the + libraries which we need and not the rest of ceph which we don't. + +* Tue Aug 28 2012 Cole Robinson 1.2.0-0.4.rc1 +- Update to 1.2.0-rc1 + +* Mon Aug 20 2012 Richard W.M. Jones - 1.2-0.3.20120806git3e430569 +- Backport Bonzini's vhost-net fix (RHBZ#848400). + +* Tue Aug 14 2012 Cole Robinson - 1.2-0.2.20120806git3e430569 +- Bump release number, previous build forgot but the dist bump helped us out + +* Tue Aug 14 2012 Cole Robinson - 1.2-0.1.20120806git3e430569 +- Revive qemu-system-{ppc*, sparc*} (bz 844502) +- Enable KVM support for all targets (bz 844503) + +* Mon Aug 06 2012 Cole Robinson - 1.2-0.1.20120806git3e430569.fc18 +- Update to git snapshot + +* Sun Jul 29 2012 Cole Robinson - 1.1.1-1 +- Upstream stable release 1.1.1 +- Fix systemtap tapsets (bz 831763) +- Fix VNC audio tunnelling (bz 840653) +- Don't renable ksm on update (bz 815156) +- Bump usbredir dep (bz 812097) +- Fix RPM install error on non-virt machines (bz 660629) +- Obsolete openbios to fix upgrade dependency issues (bz 694802) + +* Sat Jul 21 2012 Fedora Release Engineering - 2:1.1.0-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 10 2012 Richard W.M. Jones - 2:1.1.0-8 +- Re-diff previous patch so that it applies and actually apply it + +* Tue Jul 10 2012 Richard W.M. Jones - 2:1.1.0-7 +- Add patch to fix default machine options. This fixes libvirt + detection of qemu. +- Back out patch 1 which conflicts. + +* Fri Jul 6 2012 Hans de Goede - 2:1.1.0-5 +- Fix qemu crashing (on an assert) whenever USB-2.0 isoc transfers are used + +* Thu Jul 5 2012 Richard W.M. Jones - 2:1.1.0-4 +- Disable tests since they hang intermittently. +- Add kvmvapic.bin (replaces vapic.bin). +- Add cpus-x86_64.conf. qemu now creates /etc/qemu/target-x86_64.conf + as an empty file. +- Add qemu-icon.bmp. +- Add qemu-bridge-helper. +- Build and include virtfs-proxy-helper + man page (thanks Hans de Goede). + +* Wed Jul 4 2012 Hans de Goede - 2:1.1.0-1 +- New upstream release 1.1.0 +- Drop about a 100 spice + USB patches, which are all upstream + +* Mon Apr 23 2012 Paolo Bonzini - 2:1.0-17 +- Fix install failure due to set -e (rhbz #815272) + +* Mon Apr 23 2012 Paolo Bonzini - 2:1.0-16 +- Fix kvm.modules to exit successfully on non-KVM capable systems (rhbz #814932) + +* Thu Apr 19 2012 Hans de Goede - 2:1.0-15 +- Add a couple of backported QXL/Spice bugfixes +- Add spice volume control patches + +* Fri Apr 6 2012 Paolo Bonzini - 2:1.0-12 +- Add back PPC and SPARC user emulators +- Update binfmt rules from upstream + +* Mon Apr 2 2012 Hans de Goede - 2:1.0-11 +- Some more USB bugfixes from upstream + +* Thu Mar 29 2012 Eduardo Habkost - 2:1.0-12 +- Fix ExclusiveArch mistake that disabled all non-x86_64 builds on Fedora + +* Wed Mar 28 2012 Eduardo Habkost - 2:1.0-11 +- Use --with variables for build-time settings + +* Wed Mar 28 2012 Daniel P. Berrange - 2:1.0-10 +- Switch to use iPXE for netboot ROMs + +* Thu Mar 22 2012 Daniel P. Berrange - 2:1.0-9 +- Remove O_NOATIME for 9p filesystems + +* Mon Mar 19 2012 Daniel P. Berrange - 2:1.0-8 +- Move udev rules to /lib/udev/rules.d (rhbz #748207) + +* Fri Mar 9 2012 Hans de Goede - 2:1.0-7 +- Add a whole bunch of USB bugfixes from upstream + +* Mon Feb 13 2012 Daniel P. Berrange - 2:1.0-6 +- Add many more missing BRs for misc QEMU features +- Enable running of test suite during build + +* Tue Feb 07 2012 Justin M. Forbes - 2:1.0-5 +- Add support for virtio-scsi + +* Sun Feb 5 2012 Richard W.M. Jones - 2:1.0-4 +- Require updated ceph for latest librbd with rbd_flush symbol. + +* Tue Jan 24 2012 Justin M. Forbes - 2:1.0-3 +- Add support for vPMU +- e1000: bounds packet size against buffer size CVE-2012-0029 + +* Fri Jan 13 2012 Justin M. Forbes - 2:1.0-2 +- Add patches for USB redirect bits +- Remove palcode-clipper, we don't build it + +* Wed Jan 11 2012 Justin M. Forbes - 2:1.0-1 +- Add patches from 1.0.1 queue + +* Fri Dec 16 2011 Justin M. Forbes - 2:1.0-1 +- Update to qemu 1.0 + +* Tue Nov 15 2011 Justin M. Forbes - 2:0.15.1-3 +- Enable spice for i686 users as well + +* Thu Nov 03 2011 Justin M. Forbes - 2:0.15.1-2 +- Fix POSTIN scriplet failure (#748281) + +* Fri Oct 21 2011 Justin M. Forbes - 2:0.15.1-1 +- Require seabios-bin >= 0.6.0-2 (#741992) +- Replace init scripts with systemd units (#741920) +- Update to 0.15.1 stable upstream + +* Fri Oct 21 2011 Paul Moore +- Enable full relro and PIE (rhbz #738812) + +* Wed Oct 12 2011 Daniel P. Berrange - 2:0.15.0-6 +- Add BR on ceph-devel to enable RBD block device + +* Wed Oct 5 2011 Daniel P. Berrange - 2:0.15.0-5 +- Create a qemu-guest-agent sub-RPM for guest installation + +* Tue Sep 13 2011 Daniel P. Berrange - 2:0.15.0-4 +- Enable DTrace tracing backend for SystemTAP (rhbz #737763) +- Enable build with curl (rhbz #737006) + +* Thu Aug 18 2011 Hans de Goede - 2:0.15.0-3 +- Add missing BuildRequires: usbredir-devel, so that the usbredir code + actually gets build + +* Thu Aug 18 2011 Richard W.M. Jones - 2:0.15.0-2 +- Add upstream qemu patch 'Allow to leave type on default in -machine' + (2645c6dcaf6ea2a51a3b6dfa407dd203004e4d11). + +* Sun Aug 14 2011 Justin M. Forbes - 2:0.15.0-1 +- Update to 0.15.0 stable release. + +* Thu Aug 04 2011 Justin M. Forbes - 2:0.15.0-0.3.201108040af4922 +- Update to 0.15.0-rc1 as we prepare for 0.15.0 release + +* Thu Aug 4 2011 Daniel P. Berrange - 2:0.15.0-0.3.2011072859fadcc +- Fix default accelerator for non-KVM builds (rhbz #724814) + +* Thu Jul 28 2011 Justin M. Forbes - 2:0.15.0-0.1.2011072859fadcc +- Update to 0.15.0-rc0 as we prepare for 0.15.0 release + +* Tue Jul 19 2011 Hans de Goede - 2:0.15.0-0.2.20110718525e3df +- Add support usb redirection over the network, see: + http://fedoraproject.org/wiki/Features/UsbNetworkRedirection +- Restore chardev flow control patches + +* Mon Jul 18 2011 Justin M. Forbes - 2:0.15.0-0.1.20110718525e3df +- Update to git snapshot as we prepare for 0.15.0 release + +* Wed Jun 22 2011 Richard W.M. Jones - 2:0.14.0-9 +- Add BR libattr-devel. This caused the -fstype option to be disabled. + https://www.redhat.com/archives/libvir-list/2011-June/thread.html#01017 + +* Mon May 2 2011 Hans de Goede - 2:0.14.0-8 +- Fix a bug in the spice flow control patches which breaks the tcp chardev + +* Tue Mar 29 2011 Justin M. Forbes - 2:0.14.0-7 +- Disable qemu-ppc and qemu-sparc packages (#679179) + +* Mon Mar 28 2011 Justin M. Forbes - 2:0.14.0-6 +- Spice fixes for flow control. + +* Tue Mar 22 2011 Dan Horák - 2:0.14.0-5 +- be more careful when removing the -g flag on s390 + +* Fri Mar 18 2011 Justin M. Forbes - 2:0.14.0-4 +- Fix thinko on adding the most recent patches. + +* Wed Mar 16 2011 Justin M. Forbes - 2:0.14.0-3 +- Fix migration issue with vhost +- Fix qxl locking issues for spice + +* Wed Mar 02 2011 Justin M. Forbes - 2:0.14.0-2 +- Re-enable sparc and cris builds + +* Thu Feb 24 2011 Justin M. Forbes - 2:0.14.0-1 +- Update to 0.14.0 release + +* Fri Feb 11 2011 Justin M. Forbes - 2:0.14.0-0.1.20110210git7aa8c46 +- Update git snapshot +- Temporarily disable qemu-cris and qemu-sparc due to build errors (to be resolved shorly) + +* Tue Feb 08 2011 Justin M. Forbes - 2:0.14.0-0.1.20110208git3593e6b +- Update to 0.14.0 rc git snapshot +- Add virtio-net to modules + +* Wed Nov 3 2010 Daniel P. Berrange - 2:0.13.0-2 +- Revert previous change +- Make qemu-common own the /etc/qemu directory +- Add /etc/qemu/target-x86_64.conf to qemu-system-x86 regardless + of host architecture. + +* Wed Nov 03 2010 Dan Horák - 2:0.13.0-2 +- Remove kvm config file on non-x86 arches (part of #639471) +- Own the /etc/qemu directory + +* Mon Oct 18 2010 Justin M. Forbes - 2:0.13.0-1 +- Update to 0.13.0 upstream release +- Fixes for vhost +- Fix mouse in certain guests (#636887) +- Fix issues with WinXP guest install (#579348) +- Resolve build issues with S390 (#639471) +- Fix Windows XP on Raw Devices (#631591) + +* Tue Oct 05 2010 jkeating - 2:0.13.0-0.7.rc1.1 +- Rebuilt for gcc bug 634757 + +* Tue Sep 21 2010 Justin M. Forbes - 2:0.13.0-0.7.rc1 +- Flip qxl pci id from unstable to stable (#634535) +- KSM Fixes from upstream (#558281) + +* Tue Sep 14 2010 Justin M. Forbes - 2:0.13.0-0.6.rc1 +- Move away from git snapshots as 0.13 is close to release +- Updates for spice 0.6 + +* Tue Aug 10 2010 Justin M. Forbes - 2:0.13.0-0.5.20100809git25fdf4a +- Fix typo in e1000 gpxe rom requires. +- Add links to newer vgabios + +* Tue Aug 10 2010 Justin M. Forbes - 2:0.13.0-0.4.20100809git25fdf4a +- Disable spice on 32bit, it is not supported and buildreqs don't exist. + +* Mon Aug 9 2010 Justin M. Forbes - 2:0.13.0-0.3.20100809git25fdf4a +- Updates from upstream towards 0.13 stable +- Fix requires on gpxe +- enable spice now that buildreqs are in the repository. +- ksmtrace has moved to a separate upstream package + +* Tue Jul 27 2010 Justin M. Forbes - 2:0.13.0-0.2.20100727gitb81fe95 +- add texinfo buildreq for manpages. + +* Tue Jul 27 2010 Justin M. Forbes - 2:0.13.0-0.1.20100727gitb81fe95 +- Update to 0.13.0 upstream snapshot +- ksm init fixes from upstream + +* Tue Jul 20 2010 Dan Horák - 2:0.12.3-8 +- Add avoid-llseek patch from upstream needed for building on s390(x) +- Don't use parallel make on s390(x) + +* Tue Jun 22 2010 Amit Shah - 2:0.12.3-7 +- Add vvfat hardening patch from upstream (#605202) + +* Fri Apr 23 2010 Justin M. Forbes - 2:0.12.3-6 +- Change requires to the noarch seabios-bin +- Add ownership of docdir to qemu-common (#572110) +- Fix "Cannot boot from non-existent NIC" error when using virt-install (#577851) + +* Thu Apr 15 2010 Justin M. Forbes - 2:0.12.3-5 +- Update virtio console patches from upstream + +* Thu Mar 11 2010 Justin M. Forbes - 2:0.12.3-4 +- Detect cdrom via ioctl (#473154) +- re add increased buffer for USB control requests (#546483) + +* Wed Mar 10 2010 Justin M. Forbes - 2:0.12.3-3 +- Migration clear the fd in error cases (#518032) + +* Tue Mar 09 2010 Justin M. Forbes - 2:0.12.3-2 +- Allow builds --with x86only +- Add libaio-devel buildreq for aio support + +* Fri Feb 26 2010 Justin M. Forbes - 2:0.12.3-1 +- Update to 0.12.3 upstream +- vhost-net migration/restart fixes +- Add F-13 machine type +- virtio-serial fixes + +* Tue Feb 09 2010 Justin M. Forbes - 2:0.12.2-6 +- Add vhost net support. + +* Thu Feb 04 2010 Justin M. Forbes - 2:0.12.2-5 +- Avoid creating too large iovecs in multiwrite merge (#559717) +- Don't try to set max_kernel_pages during ksm init on newer kernels (#558281) +- Add logfile options for ksmtuned debug. + +* Wed Jan 27 2010 Amit Shah - 2:0.12.2-4 +- Remove build dependency on iasl now that we have seabios + +* Wed Jan 27 2010 Amit Shah - 2:0.12.2-3 +- Remove source target for 0.12.1.2 + +* Wed Jan 27 2010 Amit Shah - 2:0.12.2-2 +- Add virtio-console patches from upstream for the F13 VirtioSerial feature + +* Mon Jan 25 2010 Justin M. Forbes - 2:0.12.2-1 +- Update to 0.12.2 upstream + +* Sun Jan 10 2010 Justin M. Forbes - 2:0.12.1.2-3 +- Point to seabios instead of bochs, and add a requires for seabios + +* Mon Jan 4 2010 Justin M. Forbes - 2:0.12.1.2-2 +- Remove qcow2 virtio backing file patch + +* Mon Jan 4 2010 Justin M. Forbes - 2:0.12.1.2-1 +- Update to 0.12.1.2 upstream +- Remove patches included in upstream + +* Fri Nov 20 2009 Mark McLoughlin - 2:0.11.0-12 +- Fix a use-after-free crasher in the slirp code (#539583) +- Fix overflow in the parallels image format support (#533573) + +* Wed Nov 4 2009 Mark McLoughlin - 2:0.11.0-11 +- Temporarily disable preadv/pwritev support to fix data corruption (#526549) + +* Tue Nov 3 2009 Justin M. Forbes - 2:0.11.0-10 +- Default ksm and ksmtuned services on. + +* Thu Oct 29 2009 Mark McLoughlin - 2:0.11.0-9 +- Fix dropped packets with non-virtio NICs (#531419) + +* Wed Oct 21 2009 Glauber Costa - 2:0.11.0-8 +- Properly save kvm time registers (#524229) + +* Mon Oct 19 2009 Mark McLoughlin - 2:0.11.0-7 +- Fix potential segfault from too small MSR_COUNT (#528901) + +* Fri Oct 9 2009 Mark McLoughlin - 2:0.11.0-6 +- Fix fs errors with virtio and qcow2 backing file (#524734) +- Fix ksm initscript errors on kernel missing ksm (#527653) +- Add missing Requires(post): getent, useradd, groupadd (#527087) + +* Tue Oct 6 2009 Mark McLoughlin - 2:0.11.0-5 +- Add 'retune' verb to ksmtuned init script + +* Mon Oct 5 2009 Mark McLoughlin - 2:0.11.0-4 +- Use rtl8029 PXE rom for ne2k_pci, not ne (#526777) +- Also, replace the gpxe-roms-qemu pkg requires with file-based requires + +* Thu Oct 1 2009 Justin M. Forbes - 2:0.11.0-3 +- Improve error reporting on file access (#524695) + +* Mon Sep 28 2009 Mark McLoughlin - 2:0.11.0-2 +- Fix pci hotplug to not exit if supplied an invalid NIC model (#524022) + +* Mon Sep 28 2009 Mark McLoughlin - 2:0.11.0-1 +- Update to 0.11.0 release +- Drop a couple of upstreamed patches + +* Wed Sep 23 2009 Mark McLoughlin - 2:0.10.92-5 +- Fix issue causing NIC hotplug confusion when no model is specified (#524022) + +* Wed Sep 16 2009 Mark McLoughlin - 2:0.10.92-4 +- Fix for KSM patch from Justin Forbes + +* Wed Sep 16 2009 Mark McLoughlin - 2:0.10.92-3 +- Add ksmtuned, also from Dan Kenigsberg +- Use %%_initddir macro + +* Wed Sep 16 2009 Mark McLoughlin - 2:0.10.92-2 +- Add ksm control script from Dan Kenigsberg + +* Mon Sep 7 2009 Mark McLoughlin - 2:0.10.92-1 +- Update to qemu-kvm-0.11.0-rc2 +- Drop upstreamed patches +- extboot install now fixed upstream +- Re-place TCG init fix (#516543) with the one gone upstream + +* Mon Sep 7 2009 Mark McLoughlin - 2:0.10.91-0.10.rc1 +- Fix MSI-X error handling on older kernels (#519787) + +* Fri Sep 4 2009 Mark McLoughlin - 2:0.10.91-0.9.rc1 +- Make pulseaudio the default audio backend (#519540, #495964, #496627) + +* Thu Aug 20 2009 Richard W.M. Jones - 2:0.10.91-0.8.rc1 +- Fix segfault when qemu-kvm is invoked inside a VM (#516543) + +* Tue Aug 18 2009 Mark McLoughlin - 2:0.10.91-0.7.rc1 +- Fix permissions on udev rules (#517571) + +* Mon Aug 17 2009 Lubomir Rintel - 2:0.10.91-0.6.rc1 +- Allow blacklisting of kvm modules (#517866) + +* Fri Aug 7 2009 Mark McLoughlin - 2:0.10.91-0.5.rc1 +- Fix virtio_net with -net user (#516022) + +* Tue Aug 4 2009 Mark McLoughlin - 2:0.10.91-0.4.rc1 +- Update to qemu-kvm-0.11-rc1; no changes from rc1-rc0 + +* Tue Aug 4 2009 Mark McLoughlin - 2:0.10.91-0.3.rc1.rc0 +- Fix extboot checksum (bug #514899) + +* Fri Jul 31 2009 Mark McLoughlin - 2:0.10.91-0.2.rc1.rc0 +- Add KSM support +- Require bochs-bios >= 2.3.8-0.8 for latest kvm bios updates + +* Thu Jul 30 2009 Mark McLoughlin - 2:0.10.91-0.1.rc1.rc0 +- Update to qemu-kvm-0.11.0-rc1-rc0 +- This is a pre-release of the official -rc1 +- A vista installer regression is blocking the official -rc1 release +- Drop qemu-prefer-sysfs-for-usb-host-devices.patch +- Drop qemu-fix-build-for-esd-audio.patch +- Drop qemu-slirp-Fix-guestfwd-for-incoming-data.patch +- Add patch to ensure extboot.bin is installed + +* Sun Jul 26 2009 Fedora Release Engineering - 2:0.10.50-14.kvm88 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Thu Jul 23 2009 Glauber Costa - 2:0.10.50-13.kvm88 +- Fix bug 513249, -net channel option is broken + +* Thu Jul 16 2009 Daniel P. Berrange - 2:0.10.50-12.kvm88 +- Add 'qemu' user and group accounts +- Force disable xen until it can be made to build + +* Thu Jul 16 2009 Mark McLoughlin - 2:0.10.50-11.kvm88 +- Update to kvm-88, see http://www.linux-kvm.org/page/ChangeLog +- Package mutiboot.bin +- Update for how extboot is built +- Fix sf.net source URL +- Drop qemu-fix-ppc-softmmu-kvm-disabled-build.patch +- Drop qemu-fix-pcspk-build-with-kvm-disabled.patch +- Cherry-pick fix for esound support build failure + +* Wed Jul 15 2009 Daniel Berrange - 2:0.10.50-10.kvm87 +- Add udev rules to make /dev/kvm world accessible & group=kvm (rhbz #497341) +- Create a kvm group if it doesn't exist (rhbz #346151) + +* Tue Jul 07 2009 Glauber Costa - 2:0.10.50-9.kvm87 +- use pxe roms from gpxe, instead of etherboot package. + +* Fri Jul 3 2009 Mark McLoughlin - 2:0.10.50-8.kvm87 +- Prefer sysfs over usbfs for usb passthrough (#508326) + +* Sat Jun 27 2009 Mark McLoughlin - 2:0.10.50-7.kvm87 +- Update to kvm-87 +- Drop upstreamed patches +- Cherry-pick new ppc build fix from upstream +- Work around broken linux-user build on ppc +- Fix hw/pcspk.c build with --disable-kvm +- Re-enable preadv()/pwritev() since #497429 is long since fixed +- Kill petalogix-s3adsp1800.dtb, since we don't ship the microblaze target + +* Fri Jun 5 2009 Mark McLoughlin - 2:0.10.50-6.kvm86 +- Fix 'kernel requires an x86-64 CPU' error +- BuildRequires ncurses-devel to enable '-curses' option (#504226) + +* Wed Jun 3 2009 Mark McLoughlin - 2:0.10.50-5.kvm86 +- Prevent locked cdrom eject - fixes hang at end of anaconda installs (#501412) +- Avoid harmless 'unhandled wrmsr' warnings (#499712) + +* Thu May 21 2009 Mark McLoughlin - 2:0.10.50-4.kvm86 +- Update to kvm-86 release +- ChangeLog here: http://marc.info/?l=kvm&m=124282885729710 + +* Fri May 1 2009 Mark McLoughlin - 2:0.10.50-3.kvm85 +- Really provide qemu-kvm as a metapackage for comps + +* Tue Apr 28 2009 Mark McLoughlin - 2:0.10.50-2.kvm85 +- Provide qemu-kvm as a metapackage for comps + +* Mon Apr 27 2009 Mark McLoughlin - 2:0.10.50-1.kvm85 +- Update to qemu-kvm-devel-85 +- kvm-85 is based on qemu development branch, currently version 0.10.50 +- Include new qemu-io utility in qemu-img package +- Re-instate -help string for boot=on to fix virtio booting with libvirt +- Drop upstreamed patches +- Fix missing kernel/include/asm symlink in upstream tarball +- Fix target-arm build +- Fix build on ppc +- Disable preadv()/pwritev() until bug #497429 is fixed +- Kill more .kernelrelease uselessness +- Make non-kvm qemu build verbose + +* Fri Apr 24 2009 Mark McLoughlin - 2:0.10-15 +- Fix source numbering typos caused by make-release addition + +* Thu Apr 23 2009 Mark McLoughlin - 2:0.10-14 +- Improve instructions for generating the tarball + +* Tue Apr 21 2009 Mark McLoughlin - 2:0.10-13 +- Enable pulseaudio driver to fix qemu lockup at shutdown (#495964) + +* Tue Apr 21 2009 Mark McLoughlin - 2:0.10-12 +- Another qcow2 image corruption fix (#496642) + +* Mon Apr 20 2009 Mark McLoughlin - 2:0.10-11 +- Fix qcow2 image corruption (#496642) + +* Sun Apr 19 2009 Mark McLoughlin - 2:0.10-10 +- Run sysconfig.modules from %%post on x86_64 too (#494739) + +* Sun Apr 19 2009 Mark McLoughlin - 2:0.10-9 +- Align VGA ROM to 4k boundary - fixes 'qemu-kvm -std vga' (#494376) + +* Tue Apr 14 2009 Glauber Costa - 2:0.10-8 +- Provide qemu-kvm conditional on the architecture. + +* Thu Apr 9 2009 Mark McLoughlin - 2:0.10-7 +- Add a much cleaner fix for vga segfault (#494002) + +* Sun Apr 5 2009 Glauber Costa - 2:0.10-6 +- Fixed qcow2 segfault creating disks over 2TB. #491943 + +* Fri Apr 3 2009 Mark McLoughlin - 2:0.10-5 +- Fix vga segfault under kvm-autotest (#494002) +- Kill kernelrelease hack; it's not needed +- Build with "make V=1" for more verbose logs + +* Thu Apr 02 2009 Glauber Costa - 2:0.10-4 +- Support botting gpxe roms. + +* Wed Apr 01 2009 Glauber Costa - 2:0.10-2 +- added missing patch. love for CVS. + +* Wed Apr 01 2009 Glauber Costa - 2:0.10-1 +- Include debuginfo for qemu-img +- Do not require qemu-common for qemu-img +- Explicitly own each of the firmware files +- remove firmwares for ppc and sparc. They should be provided by an external package. + Not that the packages exists for sparc in the secondary arch repo as noarch, but they + don't automatically get into main repos. Unfortunately it's the best we can do right + now. +- rollback a bit in time. Snapshot from avi's maint/2.6.30 + - this requires the sasl patches to come back. + - with-patched-kernel comes back. + +* Wed Mar 25 2009 Mark McLoughlin - 2:0.10-0.12.kvm20090323git +- BuildRequires pciutils-devel for device assignment (#492076) + +* Mon Mar 23 2009 Glauber Costa - 2:0.10-0.11.kvm20090323git +- Update to snapshot kvm20090323. +- Removed patch2 (upstream). +- use upstream's new split package. +- --with-patched-kernel flag not needed anymore +- Tell how to get the sources. + +* Wed Mar 18 2009 Glauber Costa - 2:0.10-0.10.kvm20090310git +- Added extboot to files list. + +* Wed Mar 11 2009 Glauber Costa - 2:0.10-0.9.kvm20090310git +- Fix wrong reference to bochs bios. + +* Wed Mar 11 2009 Glauber Costa - 2:0.10-0.8.kvm20090310git +- fix Obsolete/Provides pair +- Use kvm bios from bochs-bios package. +- Using RPM_OPT_FLAGS in configure +- Picked back audio-drv-list from kvm package + +* Tue Mar 10 2009 Glauber Costa - 2:0.10-0.7.kvm20090310git +- modify ppc patch + +* Tue Mar 10 2009 Glauber Costa - 2:0.10-0.6.kvm20090310git +- updated to kvm20090310git +- removed sasl patches (already in this release) + +* Tue Mar 10 2009 Glauber Costa - 2:0.10-0.5.kvm20090303git +- kvm.modules were being wrongly mentioned at %%install. +- update description for the x86 system package to include kvm support +- build kvm's own bios. It is still necessary while kvm uses a slightly different + irq routing mechanism + +* Thu Mar 05 2009 Glauber Costa - 2:0.10-0.4.kvm20090303git +- seems Epoch does not go into the tags. So start back here. + +* Thu Mar 05 2009 Glauber Costa - 2:0.10-0.1.kvm20090303git +- Use bochs-bios instead of bochs-bios-data +- It's official: upstream set on 0.10 + +* Thu Mar 5 2009 Daniel P. Berrange - 2:0.9.2-0.2.kvm20090303git +- Added BSD to license list, since many files are covered by BSD + +* Wed Mar 04 2009 Glauber Costa - 0.9.2-0.1.kvm20090303git +- missing a dot. shame on me + +* Wed Mar 04 2009 Glauber Costa - 0.92-0.1.kvm20090303git +- Set Epoch to 2 +- Set version to 0.92. It seems upstream keep changing minds here, so pick the lowest +- Provides KVM, Obsoletes KVM +- Only install qemu-kvm in ix86 and x86_64 +- Remove pkgdesc macros, as they were generating bogus output for rpm -qi. +- fix ppc and ppc64 builds + +* Tue Mar 03 2009 Glauber Costa - 0.10-0.3.kvm20090303git +- only execute post scripts for user package. +- added kvm tools. + +* Tue Mar 03 2009 Glauber Costa - 0.10-0.2.kvm20090303git +- put kvm.modules into cvs + +* Tue Mar 03 2009 Glauber Costa - 0.10-0.1.kvm20090303git +- Set Epoch to 1 +- Build KVM (basic build, no tools yet) +- Set ppc in ExcludeArch. This is temporary, just to fix one issue at a time. + ppc users (IBM ? ;-)) please wait a little bit. + +* Tue Mar 3 2009 Daniel P. Berrange - 1.0-0.5.svn6666 +- Support VNC SASL authentication protocol +- Fix dep on bochs-bios-data + +* Tue Mar 03 2009 Glauber Costa - 1.0-0.4.svn6666 +- use bios from bochs-bios package. + +* Tue Mar 03 2009 Glauber Costa - 1.0-0.3.svn6666 +- use vgabios from vgabios package. + +* Mon Mar 02 2009 Glauber Costa - 1.0-0.2.svn6666 +- use pxe roms from etherboot package. + +* Mon Mar 02 2009 Glauber Costa - 1.0-0.1.svn6666 +- Updated to tip svn (release 6666). Featuring split packages for qemu. + Unfortunately, still using binary blobs for the bioses. + +* Wed Feb 25 2009 Fedora Release Engineering - 0.9.1-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sun Jan 11 2009 Debarshi Ray - 0.9.1-12 +- Updated build patch. Closes Red Hat Bugzilla bug #465041. + +* Wed Dec 31 2008 Dennis Gilmore - 0.9.1-11 +- add sparcv9 and sparc64 support + +* Fri Jul 25 2008 Bill Nottingham +- Fix qemu-img summary (#456344) + +* Wed Jun 25 2008 Daniel P. Berrange - 0.9.1-10.fc10 +- Rebuild for GNU TLS ABI change + +* Wed Jun 11 2008 Daniel P. Berrange - 0.9.1-9.fc10 +- Remove bogus wildcard from files list (rhbz #450701) + +* Sat May 17 2008 Lubomir Rintel - 0.9.1-8 +- Register binary handlers also for shared libraries + +* Mon May 5 2008 Daniel P. Berrange - 0.9.1-7.fc10 +- Fix text console PTYs to be in rawmode + +* Sun Apr 27 2008 Lubomir Kundrak - 0.9.1-6 +- Register binary handler for SuperH-4 CPU + +* Wed Mar 19 2008 Daniel P. Berrange - 0.9.1-5.fc9 +- Split qemu-img tool into sub-package for smaller footprint installs + +* Wed Feb 27 2008 Daniel P. Berrange - 0.9.1-4.fc9 +- Fix block device checks for extendable disk formats (rhbz #435139) + +* Sat Feb 23 2008 Daniel P. Berrange - 0.9.1-3.fc9 +- Fix block device extents check (rhbz #433560) + +* Mon Feb 18 2008 Fedora Release Engineering - 0.9.1-2 +- Autorebuild for GCC 4.3 + +* Tue Jan 8 2008 Daniel P. Berrange - 0.9.1-1.fc9 +- Updated to 0.9.1 release +- Fix license tag syntax +- Don't mark init script as a config file + +* Wed Sep 26 2007 Daniel P. Berrange - 0.9.0-5.fc8 +- Fix rtl8139 checksum calculation for Vista (rhbz #308201) + +* Tue Aug 28 2007 Daniel P. Berrange - 0.9.0-4.fc8 +- Fix debuginfo by passing -Wl,--build-id to linker + +* Tue Aug 28 2007 David Woodhouse 0.9.0-4 +- Update licence +- Fix CDROM emulation (#253542) + +* Tue Aug 28 2007 Daniel P. Berrange - 0.9.0-3.fc8 +- Added backport of VNC password auth, and TLS+x509 cert auth +- Switch to rtl8139 NIC by default for linkstate reporting +- Fix rtl8139 mmio region mappings with multiple NICs + +* Sun Apr 1 2007 Hans de Goede 0.9.0-2 +- Fix direct loading of a linux kernel with -kernel & -initrd (bz 234681) +- Remove spurious execute bits from manpages (bz 222573) + +* Tue Feb 6 2007 David Woodhouse 0.9.0-1 +- Update to 0.9.0 + +* Wed Jan 31 2007 David Woodhouse 0.8.2-5 +- Include licences + +* Mon Nov 13 2006 Hans de Goede 0.8.2-4 +- Backport patch to make FC6 guests work by Kevin Kofler + (bz 207843). + +* Mon Sep 11 2006 David Woodhouse 0.8.2-3 +- Rebuild + +* Thu Aug 24 2006 Matthias Saou 0.8.2-2 +- Remove the target-list iteration for x86_64 since they all build again. +- Make gcc32 vs. gcc34 conditional on %%{fedora} to share the same spec for + FC5 and FC6. + +* Wed Aug 23 2006 Matthias Saou 0.8.2-1 +- Update to 0.8.2 (#200065). +- Drop upstreamed syscall-macros patch2. +- Put correct scriplet dependencies. +- Force install mode for the init script to avoid umask problems. +- Add %%postun condrestart for changes to the init script to be applied if any. +- Update description with the latest "about" from the web page (more current). +- Update URL to qemu.org one like the Source. +- Add which build requirement. +- Don't include texi files in %%doc since we ship them in html. +- Switch to using gcc34 on devel, FC5 still has gcc32. +- Add kernheaders patch to fix linux/compiler.h inclusion. +- Add target-sparc patch to fix compiling on ppc (some int32 to float). + +* Thu Jun 8 2006 David Woodhouse 0.8.1-3 +- More header abuse in modify_ldt(), change BuildRoot: + +* Wed Jun 7 2006 David Woodhouse 0.8.1-2 +- Fix up kernel header abuse + +* Tue May 30 2006 David Woodhouse 0.8.1-1 +- Update to 0.8.1 + +* Sat Mar 18 2006 David Woodhouse 0.8.0-6 +- Update linker script for PPC + +* Sat Mar 18 2006 David Woodhouse 0.8.0-5 +- Just drop $RPM_OPT_FLAGS. They're too much of a PITA + +* Sat Mar 18 2006 David Woodhouse 0.8.0-4 +- Disable stack-protector options which gcc 3.2 doesn't like + +* Fri Mar 17 2006 David Woodhouse 0.8.0-3 +- Use -mcpu= instead of -mtune= on x86_64 too +- Disable SPARC targets on x86_64, because dyngen doesn't like fnegs + +* Fri Mar 17 2006 David Woodhouse 0.8.0-2 +- Don't use -mtune=pentium4 on i386. GCC 3.2 doesn't like it + +* Fri Mar 17 2006 David Woodhouse 0.8.0-1 +- Update to 0.8.0 +- Resort to using compat-gcc-32 +- Enable ALSA + +* Mon May 16 2005 David Woodhouse 0.7.0-2 +- Proper fix for GCC 4 putting 'blr' or 'ret' in the middle of the function, + for i386, x86_64 and PPC. + +* Sat Apr 30 2005 David Woodhouse 0.7.0-1 +- Update to 0.7.0 +- Fix dyngen for PPC functions which end in unconditional branch + +* Thu Apr 7 2005 Michael Schwendt +- rebuilt + +* Sun Feb 13 2005 David Woodhouse 0.6.1-2 +- Package cleanup + +* Sun Nov 21 2004 David Woodhouse 0.6.1-1 +- Update to 0.6.1 + +* Tue Jul 20 2004 David Woodhouse 0.6.0-2 +- Compile fix from qemu CVS, add x86_64 host support + +* Wed May 12 2004 David Woodhouse 0.6.0-1 +- Update to 0.6.0. + +* Sat May 8 2004 David Woodhouse 0.5.5-1 +- Update to 0.5.5. + +* Sun May 2 2004 David Woodhouse 0.5.4-1 +- Update to 0.5.4. + +* Thu Apr 22 2004 David Woodhouse 0.5.3-1 +- Update to 0.5.3. Add init script. + +* Thu Jul 17 2003 Jeff Johnson 0.4.3-1 +- Create.