From 36a43ff85169f2d563b59f397935401044134f8b Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Dec 17 2019 09:23:19 +0000 Subject: import qemu-kvm-2.12.0-88.module+el8.1.0+5013+4f99814c.1 --- diff --git a/SOURCES/kvm-arm-fixes.patch b/SOURCES/kvm-arm-fixes.patch deleted file mode 100644 index 61d3dae..0000000 --- a/SOURCES/kvm-arm-fixes.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff -Naurwp a/default-configs/pci.mak b/default-configs/pci.mak ---- a/default-configs/pci.mak 2019-06-28 11:45:41.983632134 +0000 -+++ b/default-configs/pci.mak 2019-06-29 02:13:42.117191042 +0000 -@@ -15,7 +15,7 @@ CONFIG_USB_XHCI_NEC=y - CONFIG_AC97=y - CONFIG_HDA=y - #CONFIG_ES1370=y --#CONFIG_LSI_SCSI_PCI=y -+CONFIG_LSI_SCSI_PCI=y - #CONFIG_VMW_PVSCSI_SCSI_PCI=y - #CONFIG_MEGASAS_SCSI_PCI=y - #CONFIG_MPTSAS_SCSI_PCI=y -diff -Naurwp a/hw/arm/Makefile.objs b/hw/arm/Makefile.objs ---- a/hw/arm/Makefile.objs 2019-06-28 11:45:39.996700783 +0000 -+++ b/hw/arm/Makefile.objs 2019-06-28 12:41:01.139408649 +0000 -@@ -16,7 +16,7 @@ obj-$(CONFIG_STRONGARM) += collie.o - obj-$(CONFIG_VERSATILE) += vexpress.o versatilepb.o - obj-$(CONFIG_ZYNQ) += xilinx_zynq.o - --#obj-$(CONFIG_ARM_V7M) += armv7m.o -+obj-$(CONFIG_ARM_V7M) += armv7m.o - obj-$(CONFIG_EXYNOS4) += exynos4210.o - obj-$(CONFIG_PXA2XX) += pxa2xx.o pxa2xx_gpio.o pxa2xx_pic.o - obj-$(CONFIG_DIGIC) += digic.o -diff -Naurwp a/hw/arm/nseries.c b/hw/arm/nseries.c ---- a/hw/arm/nseries.c 2018-04-24 16:30:46.000000000 +0000 -+++ b/hw/arm/nseries.c 2019-06-28 12:58:48.691559918 +0000 -@@ -786,6 +786,7 @@ static void n8x0_cbus_setup(struct n800_ - - static void n8x0_uart_setup(struct n800_s *s) - { -+#if 0 //Bluetooth Disabled - Chardev *radio = uart_hci_init(); - - qdev_connect_gpio_out(s->mpu->gpio, N8X0_BT_RESET_GPIO, -@@ -794,6 +795,7 @@ static void n8x0_uart_setup(struct n800_ - csrhci_pins_get(radio)[csrhci_pin_wakeup]); - - omap_uart_attach(s->mpu->uart[BT_UART], radio); -+#endif - } - - static void n8x0_usb_setup(struct n800_s *s) -diff -Naurwp a/hw/char/exynos4210_uart.c b/hw/char/exynos4210_uart.c ---- a/hw/char/exynos4210_uart.c 2018-04-24 16:30:46.000000000 +0000 -+++ b/hw/char/exynos4210_uart.c 2019-06-28 12:07:13.338023334 +0000 -@@ -590,7 +590,7 @@ DeviceState *exynos4210_uart_create(hwad - SysBusDevice *bus; - - const char chr_name[] = "serial"; -- char label[ARRAY_SIZE(chr_name) + 1]; -+ char label[ARRAY_SIZE(chr_name) + 20]; - - dev = qdev_create(NULL, TYPE_EXYNOS4210_UART); - -diff -Naurwp a/hw/core/Makefile.objs b/hw/core/Makefile.objs ---- a/hw/core/Makefile.objs 2019-06-28 11:45:40.002700575 +0000 -+++ b/hw/core/Makefile.objs 2019-06-28 13:20:50.504941179 +0000 -@@ -16,11 +16,10 @@ common-obj-$(CONFIG_SOFTMMU) += machine. - common-obj-$(CONFIG_SOFTMMU) += loader.o - common-obj-$(CONFIG_FITLOADER) += loader-fit.o - common-obj-$(CONFIG_SOFTMMU) += qdev-properties-system.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 --#common-obj-$(CONFIG_SOFTMMU) += split-irq.o -+common-obj-$(CONFIG_SOFTMMU) += register.o -+common-obj-$(CONFIG_SOFTMMU) += or-irq.o -+common-obj-$(CONFIG_SOFTMMU) += split-irq.o - common-obj-$(CONFIG_PLATFORM_BUS) += platform-bus.o - -+obj-$(CONFIG_SOFTMMU) += generic-loader.o - obj-$(CONFIG_SOFTMMU) += null-machine.o diff --git a/SOURCES/kvm-s390-PCI-fix-IOMMU-region-init.patch b/SOURCES/kvm-s390-PCI-fix-IOMMU-region-init.patch new file mode 100644 index 0000000..b058d08 --- /dev/null +++ b/SOURCES/kvm-s390-PCI-fix-IOMMU-region-init.patch @@ -0,0 +1,70 @@ +From 8c8c1a97b07700a2115bf23986fb402fc842bfe1 Mon Sep 17 00:00:00 2001 +From: Cornelia Huck +Date: Tue, 5 Nov 2019 12:54:41 +0000 +Subject: [PATCH] s390: PCI: fix IOMMU region init + +RH-Author: Cornelia Huck +Message-id: <20191105125441.19477-1-cohuck@redhat.com> +Patchwork-id: 92032 +O-Subject: [RHEL-8.1.0.z qemu-kvm PATCH] s390: PCI: fix IOMMU region init +Bugzilla: 1764829 +RH-Acked-by: David Hildenbrand +RH-Acked-by: Maxim Levitsky +RH-Acked-by: Jens Freimann +RH-Acked-by: Thomas Huth + +From: Matthew Rosato + +BUGZILLA: https://bugzilla.redhat.com/show_bug.cgi?id=1764829 +BRANCH: rhel-8.1.0 +UPSTREAM: 7df1dac5f1c85312474df9cb3a8fcae72303da62 +BREW: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=24461099 +TESTED: only sanity checked, as we lack PCI hardware + +The fix in dbe9cf606c shrinks the IOMMU memory region to a size +that seems reasonable on the surface, however is actually too +small as it is based against a 0-mapped address space. This +causes breakage with small guests as they can overrun the IOMMU window. + +Let's go back to the prior method of initializing iommu for now. + +Fixes: dbe9cf606c ("s390x/pci: Set the iommu region size mpcifc request") +Cc: qemu-stable@nongnu.org +Reviewed-by: Pierre Morel +Reported-by: Boris Fiuczynski +Tested-by: Boris Fiuczynski +Reported-by: Stefan Zimmerman +Signed-off-by: Matthew Rosato +Message-Id: <1569507036-15314-1-git-send-email-mjrosato@linux.ibm.com> +Signed-off-by: Christian Borntraeger +(cherry picked from commit 7df1dac5f1c85312474df9cb3a8fcae72303da62) +Signed-off-by: Cornelia Huck +Signed-off-by: Danilo C. L. de Paula +--- + hw/s390x/s390-pci-bus.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c +index 383b3e7..069e152 100644 +--- a/hw/s390x/s390-pci-bus.c ++++ b/hw/s390x/s390-pci-bus.c +@@ -691,10 +691,15 @@ static const MemoryRegionOps s390_msi_ctrl_ops = { + + void s390_pci_iommu_enable(S390PCIIOMMU *iommu) + { ++ /* ++ * The iommu region is initialized against a 0-mapped address space, ++ * so the smallest IOMMU region we can define runs from 0 to the end ++ * of the PCI address space. ++ */ + char *name = g_strdup_printf("iommu-s390-%04x", iommu->pbdev->uid); + memory_region_init_iommu(&iommu->iommu_mr, sizeof(iommu->iommu_mr), + TYPE_S390_IOMMU_MEMORY_REGION, OBJECT(&iommu->mr), +- name, iommu->pal - iommu->pba + 1); ++ name, iommu->pal + 1); + iommu->enabled = true; + memory_region_add_subregion(&iommu->mr, 0, MEMORY_REGION(&iommu->iommu_mr)); + g_free(name); +-- +1.8.3.1 + diff --git a/SPECS/qemu-kvm.spec b/SPECS/qemu-kvm.spec index e38901f..c708fb8 100644 --- a/SPECS/qemu-kvm.spec +++ b/SPECS/qemu-kvm.spec @@ -13,7 +13,7 @@ %global have_usbredir 0 %endif -%ifnarch s390x %{arm} +%ifnarch s390x %global have_librdma 1 %else %global have_librdma 0 @@ -47,10 +47,6 @@ %global kvm_target aarch64 %global have_fdt 1 %endif -%ifarch %{arm} - %global kvm_target arm - %global have_fdt 1 -%endif #Versions of various parts: @@ -71,13 +67,13 @@ Obsoletes: %1-rhev Summary: QEMU is a machine emulator and virtualizer Name: qemu-kvm Version: 2.12.0 -Release: 88%{?dist} +Release: 88%{?dist}.1 # Epoch because we pushed a qemu-1.0 package. AIUI this can't ever be dropped Epoch: 15 License: GPLv2 and GPLv2+ and CC-BY Group: Development/Tools URL: http://www.qemu.org/ -ExclusiveArch: x86_64 %{power64} aarch64 s390x %{arm} +ExclusiveArch: x86_64 %{power64} aarch64 s390x Source0: http://wiki.qemu.org/download/qemu-2.12.0.tar.xz @@ -108,7 +104,6 @@ Source35: udev-kvm-check.c Source36: README.tests -Source9999: kvm-arm-fixes.patch Patch0001: 0001-Initial-redhat-build.patch Patch0002: 0002-Enable-disable-devices-for-RHEL-7.patch @@ -1686,6 +1681,8 @@ Patch820: kvm-iotests-Filter-175-s-allocation-information.patch Patch821: kvm-block-posix-Always-allocate-the-first-block.patch # For bz#1738839 - I/O error when virtio-blk disk is backed by a raw image on 4k disk Patch822: kvm-iotests-Test-allocate_first_block-with-O_DIRECT.patch +# For bz#1764829 - RHEL8.1 Snapshot3 - Passthrough PCI card goes into error state if used in domain (kvm) [rhel-8.1.0.z] +Patch823: kvm-s390-PCI-fix-IOMMU-region-init.patch BuildRequires: zlib-devel BuildRequires: glib2-devel @@ -1759,7 +1756,7 @@ BuildRequires: cpp # For compressed guest memory dumps BuildRequires: lzo-devel snappy-devel # For NUMA memory binding -%ifnarch s390x %{arm} +%ifnarch s390x BuildRequires: numactl-devel %endif BuildRequires: libgcrypt-devel @@ -1818,7 +1815,7 @@ Requires: edk2-ovmf Requires: edk2-aarch64 %endif -%ifnarch aarch64 s390x %{arm} +%ifnarch aarch64 s390x Requires: seavgabios-bin >= 1.10.2-1 Requires: ipxe-roms-qemu >= 20170123-1 %endif @@ -1967,10 +1964,6 @@ the Secure Shell (SSH) protocol. %setup -q -n qemu-%{version} %autopatch -p1 -%ifarch %{arm} -patch -p1 < %{SOURCE9999} -%endif - %build %global buildarch %{kvm_target}-softmmu @@ -2007,7 +2000,7 @@ buildldflags="VL_LDFLAGS=-Wl,--build-id" --disable-glusterfs \ %endif --enable-guest-agent \ -%ifnarch s390x %{arm} +%ifnarch s390x --enable-numa \ %else --disable-numa \ @@ -2340,7 +2333,7 @@ pxe_link() { ln -s ../ipxe.efi/$2.rom %{buildroot}%{_datadir}/%{name}/efi-$1.rom } -%ifnarch aarch64 s390x %{arm} +%ifnarch aarch64 s390x pxe_link e1000 8086100e pxe_link ne2k_pci 10ec8029 pxe_link pcnet 10222000 @@ -2353,7 +2346,7 @@ rom_link() { ln -s $1 %{buildroot}%{_datadir}/%{name}/$2 } -%ifnarch aarch64 s390x %{arm} +%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 @@ -2391,9 +2384,7 @@ find $RPM_BUILD_ROOT -name '*.la' -or -name '*.a' | xargs rm -f chmod +x $RPM_BUILD_ROOT%{_libdir}/qemu-kvm/block-*.so %check -%ifnarch %{arm} export DIFF=diff; make check V=1 -%endif %post -n qemu-kvm-core # load kvm modules now, so we can make sure no reboot is needed. @@ -2505,7 +2496,7 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %{_datadir}/%{name}/s390-ccw.img %{_datadir}/%{name}/s390-netboot.img %endif -%ifnarch aarch64 s390x %{arm} +%ifnarch aarch64 s390x %{_datadir}/%{name}/vgabios.bin %{_datadir}/%{name}/vgabios-cirrus.bin %{_datadir}/%{name}/vgabios-qxl.bin @@ -2578,6 +2569,11 @@ useradd -r -u 107 -g qemu -G kvm -d / -s /sbin/nologin \ %changelog +* Mon Dec 02 2019 Danilo Cesar Lemes de Paula - 2.12.0-88.el8_1_0.1 +- kvm-s390-PCI-fix-IOMMU-region-init.patch [bz#1764829] +- Resolves: bz#1764829 + (RHEL8.1 Snapshot3 - Passthrough PCI card goes into error state if used in domain (kvm) [rhel-8.1.0.z]) + * Fri Sep 13 2019 Danilo Cesar Lemes de Paula - 2.12.0-88.el8 - Revert fix for bz#1749724 - this got delayed to 8.2 (CVE-2019-15890 qemu-kvm: QEMU: Slirp: use-after-free during packet reassembly [rhel-8])