Hello community,
here is the log from the commit of package qemu for openSUSE:Factory checked in at 2019-10-05 16:20:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/qemu (Old)
and /work/SRC/openSUSE:Factory/.qemu.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qemu"
Sat Oct 5 16:20:32 2019 rev:160 rq:734658 version:4.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/qemu/qemu.changes 2019-08-08 14:21:36.660365511 +0200
+++ /work/SRC/openSUSE:Factory/.qemu.new.2352/qemu.changes 2019-10-05 16:20:48.989357343 +0200
@@ -1,0 +2,254 @@
+Wed Oct 2 15:52:16 UTC 2019 - Bruce Rogers
+
+- Since our spec file has bashisms, include the following in the
+ spec file: %define _buildshell /bin/bash
+
+-------------------------------------------------------------------
+Wed Oct 2 13:36:46 UTC 2019 - Bruce Rogers
+
+- Disable some block tests which randomly fail. This is in context
+ of the build service build of qemu-testsuite
+ tests-Disable-some-block-tests-for-now.patch
+- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.1
+
+-------------------------------------------------------------------
+Tue Oct 1 22:07:37 UTC 2019 - Bruce Rogers
+
+- Add some post v4.1.0 upstream stable patches
+* Patches added:
+ mirror-Keep-mirror_top_bs-drained-after-.patch
+ s390x-tcg-Fix-VERIM-with-32-64-bit-eleme.patch
+ target-alpha-fix-tlb_fill-trap_arg2-valu.patch
+ target-arm-Free-TCG-temps-in-trans_VMOV_.patch
+ target-arm-Don-t-abort-on-M-profile-exce.patch
+ qcow2-Fix-the-calculation-of-the-maximum.patch
+ block-file-posix-Reduce-xfsctl-use.patch
+ pr-manager-Fix-invalid-g_free-crash-bug.patch
+ vpc-Return-0-from-vpc_co_create-on-succe.patch
+ block-nfs-tear-down-aio-before-nfs_close.patch
+ block-create-Do-not-abort-if-a-block-dri.patch
+ curl-Keep-pointer-to-the-CURLState-in-CU.patch
+ curl-Keep-socket-until-the-end-of-curl_s.patch
+ curl-Check-completion-in-curl_multi_do.patch
+ curl-Pass-CURLSocket-to-curl_multi_do.patch
+ curl-Report-only-ready-sockets.patch
+ curl-Handle-success-in-multi_check_compl.patch
+ blockjob-update-nodes-head-while-removin.patch
+ memory-Provide-an-equality-function-for-.patch
+ vhost-Fix-memory-region-section-comparis.patch
+ hw-arm-boot.c-Set-NSACR.-CP11-CP10-for-N.patch
+ s390-PCI-fix-IOMMU-region-init.patch
+ hw-core-loader-Fix-possible-crash-in-rom.patch
+- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-4.1
+
+-------------------------------------------------------------------
+Wed Sep 11 14:31:26 UTC 2019 - Bruce Rogers
+
+- Include more tweaks to our packaging workflow scripts
+- Produce qemu-linux-user and qemu-testsuite via the build service
+ multibuild capability, instead of duplicating the spec file and
+ using package link in build service
+* combine qemu-linux-user spec file into main qemu spec file. Since
+ this model uses a single changelog, here are some historicial
+ mentions from the now unused qemu-linux-user.changes (delta from
+ qemu's was quite minimal):
+ - Adjust to a v5.2 linux kernel change regarding SIOCGSTAMP
+ - Fix pwrite64/pread64 to return 0 over -1 for a
+ zero length NULL buffer in qemu (bsc#1121600)
+ * bsc#1112499
+* Since qemu-testsuite.spec and qemu-testsuite.changes were just
+ copies of the main qemu version nothing needs to be done there
+
+-------------------------------------------------------------------
+Fri Sep 6 16:10:18 UTC 2019 - Bruce Rogers
+
+- Build opensbi from source on riscv64
+
+-------------------------------------------------------------------
+Fri Sep 6 16:04:15 UTC 2019 - Bruce Rogers
+
+- Update to v4.1.0: See http://wiki.qemu.org/ChangeLog/4.1
+ Take note that ongoing feature deprecation is tracked at both
+ http://wiki.qemu-project.org/Features/LegacyRemoval and in
+ Appendix B of the qemu-doc.* files installed with the qemu package
+ Some noteworthy changes:
+* x86: CPU models are now versioned
+* x86: CPU die topology can now be configured
+* x86: New Hygon Dhyana and Intel Snowridge CPU models
+* s390: The bios now supports IPL (boot) from ECKD DASD assigned
+ to the guest via vfio-ccw
+* s390: The bios now tolerates the presence of bootmap signature
+ entries written by zipl
+* PowerPC: pseries machine now supports KVM acceleration
+ (kernel_irqchip=on) of the XIVE interrupt controller
+* PowerPC: pseries now supports hot-plug of PCI bridges and hot-plug
+ and unplug of devices under PCI bridges
+* ARM: QEMU now supports emulating an FPU for Cortex-M CPUs, and the
+ Cortex-M4 and Cortex-M33 now provide the FP
+* Python 2 support is deprecated
+* UEFI platform firmware binaries, and matching variable store
+ templates are now installed
+* Now it's possible to specify memory-less NUMA node when using
+ "-numa node,memdev" options
+* Possible to trigger self announcement on specific network interfaces
+* Default memory distribution between NUMA nodes is now deprecated
+* Fallback to normal RAM allocation if QEMU is not able to allocate
+ from the "-mem-path" provided file/filesystem is now deprecated
+* virtio-gpu 2d/3d rendering may now be offloaded to an external
+ vhost-user process, such as QEMU vhost-user-gpu
+* QEMU will automatically try to use the MAP_SYNC mmap flag for memory
+ backends configured with pmem=on,share=on
+* Additional SeaVGABIOS patches added for vga-ati compatibility
+- Drop attempt at build compatibility with SLE12
+- New sub-packages: qemu-edk2, qemu-vhost-user-gpu
+- Conditionalize building of qemu-edk2 (and leave unbuilt for now)
+- Implement new packaging workflow, includes no longer numbering
+ patches, and having the "current git repo" stored with the package
+ in the form of git bundles
+* Patches dropped (upstream unless otherwise noted):
+ 0027-tests-test-thread-pool-is-racy-add-.patch
+ 0032-tests-Fix-Makefile-handling-of-chec.patch
+ 0034-Revert-target-i386-kvm-add-VMX-migr.patch
+ 0036-sockets-avoid-string-truncation-war.patch
+ 0039-linux-user-avoid-string-truncation-.patch
+ 0040-linux-user-elfload-Fix-GCC-9-build-.patch
+ 0041-qxl-avoid-unaligned-pointer-reads-w.patch
+ 0042-libvhost-user-fix-Waddress-of-packe.patch
+ 0043-target-i386-define-md-clear-bit.patch
+ 0045-kbd-state-fix-autorepeat-handling.patch
+ 0046-target-ppc-ensure-we-get-null-termi.patch
+ 0049-qxl-check-release-info-object.patch
+ 0050-qemu-bridge-helper-restrict-interfa.patch
+ 0051-linux-user-fix-to-handle-variably-s.patch
+ ipxe-use-gcc6-for-more-compact-code.patch (no longer needed)
+ (the next three are replaced by the upstream equivalent)
+ ipxe-efi-Simplify-diagnostic-for-NULL-handle.patch
+ ipxe-build-Disable-gcc-address-of-packed-member-warning.patch
+ ipxe-efi-Avoid-string-op-warning-with-cross-gcc-7-compile.patch
+ slirp-fix-heap-overflow-in-ip_reass-on-big-packet-input.patch
+* Patches renamed:
+ 0001-XXX-dont-dump-core-on-sigabort.patch
+ -> XXX-dont-dump-core-on-sigabort.patch
+ 0002-qemu-binfmt-conf-Modify-default-pat.patch
+ -> qemu-binfmt-conf-Modify-default-path.patch
+ 0003-qemu-cvs-gettimeofday.patch
+ -> qemu-cvs-gettimeofday.patch
+ 0004-qemu-cvs-ioctl_debug.patch
+ -> qemu-cvs-ioctl_debug.patch
+ 0005-qemu-cvs-ioctl_nodirection.patch
+ -> qemu-cvs-ioctl_nodirection.patch
+ 0006-linux-user-add-binfmt-wrapper-for-a.patch
+ -> linux-user-add-binfmt-wrapper-for-argv-0.patch
+ 0007-PPC-KVM-Disable-mmu-notifier-check.patch
+ -> PPC-KVM-Disable-mmu-notifier-check.patch
+ 0008-linux-user-binfmt-support-host-bina.patch
+ -> linux-user-binfmt-support-host-binaries.patch
+ 0009-linux-user-Fake-proc-cpuinfo.patch
+ -> linux-user-Fake-proc-cpuinfo.patch
+ 0010-linux-user-use-target_ulong.patch
+ -> linux-user-use-target_ulong.patch
+ 0011-Make-char-muxer-more-robust-wrt-sma.patch
+ -> Make-char-muxer-more-robust-wrt-small-FI.patch
+ 0012-linux-user-lseek-explicitly-cast-no.patch
+ -> linux-user-lseek-explicitly-cast-non-set.patch
+ 0013-AIO-Reduce-number-of-threads-for-32.patch
+ -> AIO-Reduce-number-of-threads-for-32bit-h.patch
+ 0014-xen_disk-Add-suse-specific-flush-di.patch
+ -> xen_disk-Add-suse-specific-flush-disable.patch
+ 0015-qemu-bridge-helper-reduce-security-.patch
+ -> qemu-bridge-helper-reduce-security-profi.patch
+ 0016-qemu-binfmt-conf-use-qemu-ARCH-binf.patch
+ -> qemu-binfmt-conf-use-qemu-ARCH-binfmt.patch
+ 0017-linux-user-properly-test-for-infini.patch
+ -> linux-user-properly-test-for-infinite-ti.patch
+ 0018-roms-Makefile-pass-a-packaging-time.patch
+ -> roms-Makefile-pass-a-packaging-timestamp.patch
+ 0019-Raise-soft-address-space-limit-to-h.patch
+ -> Raise-soft-address-space-limit-to-hard-l.patch
+ 0020-increase-x86_64-physical-bits-to-42.patch
+ -> increase-x86_64-physical-bits-to-42.patch
+ 0021-vga-Raise-VRAM-to-16-MiB-for-pc-0.1.patch
+ -> vga-Raise-VRAM-to-16-MiB-for-pc-0.15-and.patch
+ 0022-i8254-Fix-migration-from-SLE11-SP2.patch
+ -> i8254-Fix-migration-from-SLE11-SP2.patch
+ 0023-acpi_piix4-Fix-migration-from-SLE11.patch
+ -> acpi_piix4-Fix-migration-from-SLE11-SP2.patch
+ 0024-Switch-order-of-libraries-for-mpath.patch
+ -> Switch-order-of-libraries-for-mpath-supp.patch
+ 0025-Make-installed-scripts-explicitly-p.patch
+ -> Make-installed-scripts-explicitly-python.patch
+ 0026-hw-smbios-handle-both-file-formats-.patch
+ -> hw-smbios-handle-both-file-formats-regar.patch
+ 0028-xen-add-block-resize-support-for-xe.patch
+ -> xen-add-block-resize-support-for-xen-dis.patch
+ 0029-tests-qemu-iotests-Triple-timeout-o.patch
+ -> tests-qemu-iotests-Triple-timeout-of-i-o.patch
+ 0030-tests-block-io-test-130-needs-some-.patch
+ -> tests-block-io-test-130-needs-some-delay.patch
+ 0031-xen-ignore-live-parameter-from-xen-.patch
+ -> xen-ignore-live-parameter-from-xen-save-.patch
+ 0033-Conditionalize-ui-bitmap-installati.patch
+ -> Conditionalize-ui-bitmap-installation-be.patch
+ 0035-tests-change-error-message-in-test-.patch
+ -> tests-change-error-message-in-test-162.patch
+ 0037-hw-usb-hcd-xhci-Fix-GCC-9-build-war.patch
+ -> hw-usb-hcd-xhci-Fix-GCC-9-build-warning.patch
+ 0038-hw-usb-dev-mtp-Fix-GCC-9-build-warn.patch
+ -> hw-usb-dev-mtp-Fix-GCC-9-build-warning.patch
++++ 57 more lines (skipped)
++++ between /work/SRC/openSUSE:Factory/qemu/qemu.changes
++++ and /work/SRC/openSUSE:Factory/.qemu.new.2352/qemu.changes
Old:
----
0001-XXX-dont-dump-core-on-sigabort.patch
0002-qemu-binfmt-conf-Modify-default-pat.patch
0003-qemu-cvs-gettimeofday.patch
0004-qemu-cvs-ioctl_debug.patch
0005-qemu-cvs-ioctl_nodirection.patch
0006-linux-user-add-binfmt-wrapper-for-a.patch
0007-PPC-KVM-Disable-mmu-notifier-check.patch
0008-linux-user-binfmt-support-host-bina.patch
0009-linux-user-Fake-proc-cpuinfo.patch
0010-linux-user-use-target_ulong.patch
0011-Make-char-muxer-more-robust-wrt-sma.patch
0012-linux-user-lseek-explicitly-cast-no.patch
0013-AIO-Reduce-number-of-threads-for-32.patch
0014-xen_disk-Add-suse-specific-flush-di.patch
0015-qemu-bridge-helper-reduce-security-.patch
0016-qemu-binfmt-conf-use-qemu-ARCH-binf.patch
0017-linux-user-properly-test-for-infini.patch
0018-roms-Makefile-pass-a-packaging-time.patch
0019-Raise-soft-address-space-limit-to-h.patch
0020-increase-x86_64-physical-bits-to-42.patch
0021-vga-Raise-VRAM-to-16-MiB-for-pc-0.1.patch
0022-i8254-Fix-migration-from-SLE11-SP2.patch
0023-acpi_piix4-Fix-migration-from-SLE11.patch
0024-Switch-order-of-libraries-for-mpath.patch
0025-Make-installed-scripts-explicitly-p.patch
0026-hw-smbios-handle-both-file-formats-.patch
0027-tests-test-thread-pool-is-racy-add-.patch
0028-xen-add-block-resize-support-for-xe.patch
0029-tests-qemu-iotests-Triple-timeout-o.patch
0030-tests-block-io-test-130-needs-some-.patch
0031-xen-ignore-live-parameter-from-xen-.patch
0032-tests-Fix-Makefile-handling-of-chec.patch
0033-Conditionalize-ui-bitmap-installati.patch
0034-Revert-target-i386-kvm-add-VMX-migr.patch
0035-tests-change-error-message-in-test-.patch
0036-sockets-avoid-string-truncation-war.patch
0037-hw-usb-hcd-xhci-Fix-GCC-9-build-war.patch
0038-hw-usb-dev-mtp-Fix-GCC-9-build-warn.patch
0039-linux-user-avoid-string-truncation-.patch
0040-linux-user-elfload-Fix-GCC-9-build-.patch
0041-qxl-avoid-unaligned-pointer-reads-w.patch
0042-libvhost-user-fix-Waddress-of-packe.patch
0043-target-i386-define-md-clear-bit.patch
0044-hw-intc-exynos4210_gic-provide-more.patch
0045-kbd-state-fix-autorepeat-handling.patch
0046-target-ppc-ensure-we-get-null-termi.patch
0047-configure-only-populate-roms-if-sof.patch
0048-pc-bios-s390-ccw-net-avoid-warning-.patch
0049-qxl-check-release-info-object.patch
0050-qemu-bridge-helper-restrict-interfa.patch
0051-linux-user-fix-to-handle-variably-s.patch
ipxe-build-Disable-gcc-address-of-packed-member-warning.patch
ipxe-efi-Avoid-string-op-warning-with-cross-gcc-7-compile.patch
ipxe-efi-Simplify-diagnostic-for-NULL-handle.patch
ipxe-stable-buildid.patch
ipxe-stub-out-the-SAN-req-s-in-int13.patch
ipxe-use-gcc6-for-more-compact-code.patch
keycodemapdb-make-keycode-gen-output-reproducible.patch
pre_checkin.sh
qemu-4.0.0.tar.xz
qemu-4.0.0.tar.xz.sig
qemu-linux-user.changes
qemu-linux-user.spec
qemu-linux-user.spec.in
qemu-testsuite.changes
qemu-testsuite.spec
seabios-fix_cross_compilation.patch
sgabios-fix-cross-build.patch
sgabios-stable-buildid.patch
skiboot-gcc9-compat.patch
New:
----
AIO-Reduce-number-of-threads-for-32bit-h.patch
Conditionalize-ui-bitmap-installation-be.patch
Disable-Waddress-of-packed-member-for-GC.patch
Do-not-apply-WORKAROUND_CFLAGS-for-host-.patch
Fix-s-directive-argument-is-null-error.patch
Make-char-muxer-more-robust-wrt-small-FI.patch
Make-installed-scripts-explicitly-python.patch
Make-keycode-gen-output-reproducible-use.patch
PPC-KVM-Disable-mmu-notifier-check.patch
README.PACKAGING
Raise-soft-address-space-limit-to-hard-l.patch
Switch-order-of-libraries-for-mpath-supp.patch
Workaround-compilation-error-with-gcc-9..patch
XXX-dont-dump-core-on-sigabort.patch
_multibuild
acpi_piix4-Fix-migration-from-SLE11-SP2.patch
ati-add-edid-support.patch
ati-vga-add-rage128-edid-support.patch
ati-vga-fix-ati_read.patch
ati-vga-make-i2c-register-and-bits-confi.patch
ati-vga-make-less-verbose.patch
ati-vga-try-vga-ddc-first.patch
block-create-Do-not-abort-if-a-block-dri.patch
block-file-posix-Reduce-xfsctl-use.patch
block-nfs-tear-down-aio-before-nfs_close.patch
blockjob-update-nodes-head-while-removin.patch
bundles.tar.xz
config.sh
configure-only-populate-roms-if-softmmu.patch
curl-Check-completion-in-curl_multi_do.patch
curl-Handle-success-in-multi_check_compl.patch
curl-Keep-pointer-to-the-CURLState-in-CU.patch
curl-Keep-socket-until-the-end-of-curl_s.patch
curl-Pass-CURLSocket-to-curl_multi_do.patch
curl-Report-only-ready-sockets.patch
enable-cross-compilation-on-ARM.patch
hdata-vpd-fix-printing-char-0x00.patch
hw-arm-boot.c-Set-NSACR.-CP11-CP10-for-N.patch
hw-core-loader-Fix-possible-crash-in-rom.patch
hw-intc-exynos4210_gic-provide-more-room.patch
hw-smbios-handle-both-file-formats-regar.patch
hw-usb-dev-mtp-Fix-GCC-9-build-warning.patch
hw-usb-hcd-xhci-Fix-GCC-9-build-warning.patch
i8254-Fix-migration-from-SLE11-SP2.patch
increase-x86_64-physical-bits-to-42.patch
ipxe-Makefile-fix-issues-of-build-reprod.patch
linux-user-Fake-proc-cpuinfo.patch
linux-user-add-binfmt-wrapper-for-argv-0.patch
linux-user-binfmt-support-host-binaries.patch
linux-user-lseek-explicitly-cast-non-set.patch
linux-user-properly-test-for-infinite-ti.patch
linux-user-use-target_ulong.patch
memory-Provide-an-equality-function-for-.patch
mirror-Keep-mirror_top_bs-drained-after-.patch
pc-bios-s390-ccw-net-avoid-warning-about.patch
pr-manager-Fix-invalid-g_free-crash-bug.patch
qcow2-Fix-the-calculation-of-the-maximum.patch
qemu-4.1.0.tar.xz
qemu-4.1.0.tar.xz.sig
qemu-binfmt-conf-Modify-default-path.patch
qemu-binfmt-conf-use-qemu-ARCH-binfmt.patch
qemu-bridge-helper-reduce-security-profi.patch
qemu-cvs-gettimeofday.patch
qemu-cvs-ioctl_debug.patch
qemu-cvs-ioctl_nodirection.patch
roms-Makefile-pass-a-packaging-timestamp.patch
roms-Makefile.edk2-don-t-invoke-git-sinc.patch
roms-change-cross-compiler-naming-to-be-.patch
roms-sgabios-Fix-csum8-to-be-built-by-ho.patch
s390-PCI-fix-IOMMU-region-init.patch
s390x-tcg-Fix-VERIM-with-32-64-bit-eleme.patch
sgabios-Makefile-fix-issues-of-build-rep.patch
stub-out-the-SAN-req-s-in-int13.patch
target-alpha-fix-tlb_fill-trap_arg2-valu.patch
target-arm-Don-t-abort-on-M-profile-exce.patch
target-arm-Free-TCG-temps-in-trans_VMOV_.patch
tests-Disable-some-block-tests-for-now.patch
tests-block-io-test-130-needs-some-delay.patch
tests-change-error-message-in-test-162.patch
tests-qemu-iotests-Triple-timeout-of-i-o.patch
vbe-add-edid-support.patch
vga-Raise-VRAM-to-16-MiB-for-pc-0.15-and.patch
vga-add-ati-bios-tables.patch
vga-add-atiext-driver.patch
vga-make-memcpy_high-public.patch
vga-move-modelist-from-bochsvga.c-to-new.patch
vhost-Fix-memory-region-section-comparis.patch
vpc-Return-0-from-vpc_co_create-on-succe.patch
xen-add-block-resize-support-for-xen-dis.patch
xen-ignore-live-parameter-from-xen-save-.patch
xen_disk-Add-suse-specific-flush-disable.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ qemu.spec ++++++
++++ 1798 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/qemu/qemu.spec
++++ and /work/SRC/openSUSE:Factory/.qemu.new.2352/qemu.spec
++++++ AIO-Reduce-number-of-threads-for-32bit-h.patch ++++++
From: Alexander Graf
Date: Wed, 14 Jan 2015 01:32:11 +0100
Subject: AIO: Reduce number of threads for 32bit hosts
On hosts with limited virtual address space (32bit pointers), we can very
easily run out of virtual memory with big thread pools.
Instead, we should limit ourselves to small pools to keep memory footprint
low on those systems.
This patch fixes random VM stalls like
(process:25114): GLib-ERROR **: gmem.c:103: failed to allocate 1048576 bytes
on 32bit ARM systems for me.
Signed-off-by: Alexander Graf
---
util/thread-pool.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/util/thread-pool.c b/util/thread-pool.c
index 4ed9b89ab2d9c4e6d805ea47c2b2..697c989885ca8aa4dd1185b780df 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -307,7 +307,12 @@ static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx)
qemu_mutex_init(&pool->lock);
qemu_cond_init(&pool->worker_stopped);
qemu_sem_init(&pool->sem, 0);
- pool->max_threads = 64;
+ if (sizeof(pool) == 4) {
+ /* 32bit systems run out of virtual memory quickly */
+ pool->max_threads = 4;
+ } else {
+ pool->max_threads = 64;
+ }
pool->new_thread_bh = aio_bh_new(ctx, spawn_thread_bh_fn, pool);
QLIST_INIT(&pool->head);
++++++ Conditionalize-ui-bitmap-installation-be.patch ++++++
From: Bruce Rogers
Date: Wed, 23 Jan 2019 20:23:01 -0700
Subject: Conditionalize ui bitmap installation better
Signed-off-by: Bruce Rogers
---
Makefile | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Makefile b/Makefile
index 00ed716275743a161ea05e7d2a1e..ab4d8683ad8f86aa680b343310e1 100644
--- a/Makefile
+++ b/Makefile
@@ -887,6 +887,7 @@ ifneq ($(DESCS),)
"$(DESTDIR)$(qemu_datadir)/firmware/$$x"; \
done
endif
+ifneq ($(or $(CONFIG_GTK),$(CONFIG_SDL)),)
for s in $(ICON_SIZES); do \
mkdir -p "$(DESTDIR)$(qemu_icondir)/hicolor/$${s}/apps"; \
$(INSTALL_DATA) $(SRC_PATH)/ui/icons/qemu_$${s}.png \
@@ -901,6 +902,7 @@ endif
mkdir -p "$(DESTDIR)$(qemu_desktopdir)"
$(INSTALL_DATA) $(SRC_PATH)/ui/qemu.desktop \
"$(DESTDIR)$(qemu_desktopdir)/qemu.desktop"
+endif
ifdef CONFIG_GTK
$(MAKE) -C po $@
endif
++++++ Disable-Waddress-of-packed-member-for-GC.patch ++++++
From: Stewart Smith
Date: Tue, 18 Jun 2019 16:09:44 +1000
Subject: Disable -Waddress-of-packed-member for GCC9
Git-commit: b904cb733750de1bb0e04e5012c391a9c3094d11
We throw a bunch of errors in errorlog code otherwise, which we should
fix, but we don't *have* to yet.
Signed-off-by: Stewart Smith
Signed-off-by: Bruce Rogers
---
Makefile.main | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/roms/skiboot/Makefile.main b/roms/skiboot/Makefile.main
index a8e34d16c4729921901871b3f9e3..91dc73e06903e8f10c6ad09c1db9 100644
--- a/roms/skiboot/Makefile.main
+++ b/roms/skiboot/Makefile.main
@@ -120,7 +120,8 @@ endif
CFLAGS += $(call try-cflag,$(CC),-Wjump-misses-init) \
$(call try-cflag,$(CC),-Wsuggest-attribute=const) \
$(call try-cflag,$(CC),-Wsuggest-attribute=noreturn) \
- $(call try-cflag,$(CC),-Wstack-usage=1024)
+ $(call try-cflag,$(CC),-Wstack-usage=1024) \
+ $(call try-cflag,$(CC),-Wno-error=address-of-packed-member)
CFLAGS += $(CWARNS) $(OPTS) $(DBG)
++++++ Do-not-apply-WORKAROUND_CFLAGS-for-host-.patch ++++++
From: Michael Brown
Date: Mon, 22 Jul 2019 14:51:28 +0100
Subject: Do not apply WORKAROUND_CFLAGS for host compiler
Git-commit: a4f8c6e31f6c62522cfc633bbbffa81b22f9d6f3
Include-If: %ifarch aarch64
The WORKAROUND_CFLAGS list is constructed based on running tests on
the target compiler, and the results may not be valid for the host
compiler.
The only relevant workaround required for the host compiler is
-Wno-stringop-truncation, which is needed to avoid a spurious compiler
warning for a totally correct usage of strncpy() in util/elf2efi.c.
Duplicating the workaround tests for the host compiler is messy, as is
conditionally applying __attribute__((nonstring)). Fix instead by
disapplying WORKAROUND_CFLAGS for the host compiler, and using
memcpy() with an explicitly calculated length instead of strncpy() in
util/elf2efi.c.
Reported-by: Ignat Korchagin
Reported-by: Christopher Clark
Signed-off-by: Michael Brown
Signed-off-by: Bruce Rogers
---
src/Makefile.housekeeping | 2 +-
src/util/elf2efi.c | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/roms/ipxe/src/Makefile.housekeeping b/roms/ipxe/src/Makefile.housekeeping
index e5f6927de889167d286ccfcdda92..1ddbddd247d9929d63b1654d7206 100644
--- a/roms/ipxe/src/Makefile.housekeeping
+++ b/roms/ipxe/src/Makefile.housekeeping
@@ -454,7 +454,7 @@ endif
CFLAGS += $(WORKAROUND_CFLAGS) $(EXTRA_CFLAGS)
ASFLAGS += $(WORKAROUND_ASFLAGS) $(EXTRA_ASFLAGS)
LDFLAGS += $(WORKAROUND_LDFLAGS) $(EXTRA_LDFLAGS)
-HOST_CFLAGS += $(WORKAROUND_CFLAGS) -O2 -g
+HOST_CFLAGS += -O2 -g
# Inhibit -Werror if NO_WERROR is specified on make command line
#
diff --git a/roms/ipxe/src/util/elf2efi.c b/roms/ipxe/src/util/elf2efi.c
index 2c5b9df8aae853bfce4d5d3bae89..bcd53c9afda7880d42ec80c07f17 100644
--- a/roms/ipxe/src/util/elf2efi.c
+++ b/roms/ipxe/src/util/elf2efi.c
@@ -458,6 +458,7 @@ static struct pe_section * process_section ( struct elf_file *elf,
struct pe_header *pe_header ) {
struct pe_section *new;
const char *name;
+ size_t name_len;
size_t section_memsz;
size_t section_filesz;
unsigned long code_start;
@@ -494,7 +495,10 @@ static struct pe_section * process_section ( struct elf_file *elf,
memset ( new, 0, sizeof ( *new ) + section_filesz );
/* Fill in section header details */
- strncpy ( ( char * ) new->hdr.Name, name, sizeof ( new->hdr.Name ) );
+ name_len = strlen ( name );
+ if ( name_len > sizeof ( new->hdr.Name ) )
+ name_len = sizeof ( new->hdr.Name );
+ memcpy ( new->hdr.Name, name, name_len );
new->hdr.Misc.VirtualSize = section_memsz;
new->hdr.VirtualAddress = shdr->sh_addr;
new->hdr.SizeOfRawData = section_filesz;
++++++ Fix-s-directive-argument-is-null-error.patch ++++++
From: Valentine Barshak
Date: Sun, 9 Jun 2019 13:30:11 +0300
Subject: Fix "'%s' directive argument is null" error
Git-commit: 412acd7854de10e7194f362a6b1a3257a17974f7
References: bsc#1121464
Use '%p' directive, and print handle's address if the address is null
and the handle doesn't have a name. This fixes the following
compilation error:
interface/efi/efi_debug.c:334:3: error: '%s' directive
argument is null [-Werror=format-overflow=]
Signed-off-by: Valentine Barshak
Signed-off-by: Michael Brown
Signed-off-by: Bruce Rogers
---
src/interface/efi/efi_debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/roms/ipxe/src/interface/efi/efi_debug.c b/roms/ipxe/src/interface/efi/efi_debug.c
index 8ea0a822d044caca088c64ca2407..de9b1af5579cfddba1b55788b7b6 100644
--- a/roms/ipxe/src/interface/efi/efi_debug.c
+++ b/roms/ipxe/src/interface/efi/efi_debug.c
@@ -331,8 +331,7 @@ void dbg_efi_protocols ( EFI_HANDLE handle ) {
/* Sanity check */
if ( ! handle ) {
- printf ( "HANDLE %s could not retrieve protocols\n",
- efi_handle_name ( handle ) );
+ printf ( "HANDLE %p could not retrieve protocols\n", handle );
return;
}
++++++ Make-char-muxer-more-robust-wrt-small-FI.patch ++++++
From: Alexander Graf
Date: Thu, 1 Apr 2010 17:36:23 +0200
Subject: Make char muxer more robust wrt small FIFOs
Virtio-Console can only process one character at a time. Using it on S390
gave me strage "lags" where I got the character I pressed before when
pressing one. So I typed in "abc" and only received "a", then pressed "d"
but the guest received "b" and so on.
While the stdio driver calls a poll function that just processes on its
queue in case virtio-console can't take multiple characters at once, the
muxer does not have such callbacks, so it can't empty its queue.
To work around that limitation, I introduced a new timer that only gets
active when the guest can not receive any more characters. In that case
it polls again after a while to check if the guest is now receiving input.
This patch fixes input when using -nographic on s390 for me.
[AF: Rebased for v2.7.0-rc2]
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers
---
chardev/char-fe.c | 1 +
chardev/char-mux.c | 16 ++++++++++++++++
chardev/char.c | 1 +
include/chardev/char-mux.h | 3 +++
tests/test-char.c | 1 +
5 files changed, 22 insertions(+)
diff --git a/chardev/char-fe.c b/chardev/char-fe.c
index f3530a90e6364d813097105b6113..f8aa0daf31692810efc7d5ca32eb 100644
--- a/chardev/char-fe.c
+++ b/chardev/char-fe.c
@@ -21,6 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
+#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
diff --git a/chardev/char-mux.c b/chardev/char-mux.c
index 200c62a0d08bd779de8efdc95aad..10acb4fce1d3bda0d9f818eeb5ee 100644
--- a/chardev/char-mux.c
+++ b/chardev/char-mux.c
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
+#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "qemu/module.h"
@@ -191,6 +192,17 @@ static void mux_chr_accept_input(Chardev *chr)
be->chr_read(be->opaque,
&d->buffer[m][d->cons[m]++ & MUX_BUFFER_MASK], 1);
}
+
+#if defined(TARGET_S390X)
+ /*
+ * We're still not able to sync producer and consumer, so let's wait a bit
+ * and try again by then.
+ */
+ if (d->prod[m] != d->cons[m]) {
+ qemu_mod_timer(d->accept_timer, qemu_get_clock_ns(vm_clock)
+ + (int64_t)100000);
+ }
+#endif
}
static int mux_chr_can_read(void *opaque)
@@ -325,6 +337,10 @@ static void qemu_chr_open_mux(Chardev *chr,
}
d->focus = -1;
+#if defined(TARGET_S390X)
+ d->accept_timer = qemu_new_timer_ns(vm_clock,
+ (QEMUTimerCB *)mux_chr_accept_input, chr);
+#endif
/* only default to opened state if we've realized the initial
* set of muxes
*/
diff --git a/chardev/char.c b/chardev/char.c
index 7b6b2cb12300042c6adf257e188c..d2134d72f60e58f35ee9e7869db4 100644
--- a/chardev/char.c
+++ b/chardev/char.c
@@ -22,6 +22,7 @@
* THE SOFTWARE.
*/
+#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
#include "qemu/osdep.h"
#include "qemu/cutils.h"
#include "monitor/monitor.h"
diff --git a/include/chardev/char-mux.h b/include/chardev/char-mux.h
index 572cefd517c8fa9d605cbd10fc21..6e80785bd9c12b85e747fa9f924e 100644
--- a/include/chardev/char-mux.h
+++ b/include/chardev/char-mux.h
@@ -34,6 +34,9 @@ typedef struct MuxChardev {
Chardev parent;
CharBackend *backends[MAX_MUX];
CharBackend chr;
+#if defined(TARGET_S390X)
+ QEMUTimer *accept_timer;
+#endif
int focus;
int mux_cnt;
int term_got_escape;
diff --git a/tests/test-char.c b/tests/test-char.c
index f9440cdcfdb51f98b2f6542e6f21..d1f99632de1acb95ba8e1b4a8584 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -1,3 +1,4 @@
+#define HW_POISON_H /* avoid poison since we patch against rules it "enforces" */
#include "qemu/osdep.h"
#include
++++++ Make-installed-scripts-explicitly-python.patch ++++++
From: Bruce Rogers
Date: Thu, 25 Jan 2018 14:16:10 -0700
Subject: Make installed scripts explicitly python3
References: bsc#1077564
We want to explicitly reference python3 in the scripts we install.
Signed-off-by: Bruce Rogers
---
scripts/analyze-migration.py | 2 +-
scripts/vmstate-static-checker.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/analyze-migration.py b/scripts/analyze-migration.py
index e527eb168e9ce7c3944094ec6701..fd376eac71f73e6366a9e17a1c51 100755
--- a/scripts/analyze-migration.py
+++ b/scripts/analyze-migration.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
#
# Migration Stream Analyzer
#
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index d3467288dcc5dd2f7274576262f7..2046b1feddb4c225c8f3bee080ac 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
#
# Compares vmstate information stored in JSON format, obtained from
# the -dump-vmstate QEMU command.
++++++ Make-keycode-gen-output-reproducible-use.patch ++++++
From: =?UTF-8?q?Stefan=20Br=C3=BCns?=
Date: Mon, 5 Aug 2019 20:03:11 +0000
Subject: Make keycode-gen output reproducible (use SOURCE_DATE_EPOCH
timestamp)
Signed-off-by: Bruce Rogers
Date: Fri, 6 Jan 2012 01:05:55 +0100
Subject: PPC: KVM: Disable mmu notifier check
When using hugetlbfs (which is required for HV mode KVM on 970), we
check for MMU notifiers that on 970 can not be implemented properly.
So disable the check for mmu notifiers on PowerPC guests, making
KVM guests work there, even if possibly racy in some odd circumstances.
Signed-off-by: Bruce Rogers
---
exec.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/exec.c b/exec.c
index 3e78de3b8f8bb1914811a7965377..d2183f58816f53f15ef64e844291 100644
--- a/exec.c
+++ b/exec.c
@@ -2339,11 +2339,13 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
return NULL;
}
+#ifndef TARGET_PPC
if (kvm_enabled() && !kvm_has_sync_mmu()) {
error_setg(errp,
"host lacks kvm mmu notifiers, -mem-path unsupported");
return NULL;
}
+#endif
if (phys_mem_alloc != qemu_anon_ram_alloc) {
/*
++++++ README.PACKAGING ++++++
The qemu package, and derived packages have a special maintenance workflow in
order to support git based patching. Please use it in order to have changes
you make be acceptable to the package maintainers.
The qemu.spec file is generated from a qemu.spec.in template, so to make changes
to the spec file (besides patch name or order changes), you'll need to edit the
template. The patches included are inserted into the spec file by scripts
described below.
If you are not modifying any patches or their order, but just need to update the
spec file from a changed template, run 'bash ./update_git.sh refresh'.
If the set of patches is being modified, including their order, you will want to
first run 'bash ./update_git.sh pkg2git', in order to get the current patch
queue made available in a local git branch named frombundle. (qemu packaging now
includes a "bundle of git bundles" stored as a package source file, which
contains the "git version" of the package patches.) You will create an altered
patch queue in the $GIT_BRANCH branch (see config.sh for actual name), and use
the frombundle branch as a starting point (eg perhaps start by doing git reset
--hard frombundle, then cherry-pick upstream patches from there). Once you have
the patch queue ready to go run 'bash ./update_git.sh git2pkg' to update the
bundle of bundles (bundles.tsr.xz file) as well as the spec and patch files.
Additional Notes:
** SPECIAL NOTE ABOUT CURRENT STATUS ***
The current status as of 12 Sep 2019 is that for this incarnation of qemu
packaging, the old update_git.sh workflow is no longer supported, being
suplanted with the workflow described above. THIS IS STILL A WORK IN PROGRESS.
If it isn't working right, please contact Bruce Rogers .
It isn't foolproof by a long shot!
Also note that qemu now takes advantage of the MultiBuild feature of the Build
Service. No longer do the qemu-linux-user and qemu-testsuite packages have build
service links to the qemu package, but instead are generated straight from the
main qemu spec file via the use of a _multibuild file which identifies those
package variants.
- Bruce Rogers
*** END SPECIAL NOTE ***
Patches which are from an upstream git repo should have the commit id recorded
just below the Subject line (after a blank line) as follows:
Git-commit: <40-char-sha-id>
If a patch is anticipated to be shortly included in upstream repo, mark that
fact by doing the above with 40 0's, which will flag it as needing to be updated
in the near future.
Bug or feature tracking identifiers should also be added to the patch similarly,
using the abbreviations identified here:
http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines#Current_set_of_...
using the "Reference:" tag, with multiple entries comma separated.
The ability to provide a conditional inclusion of a patch (eg based on
architecture, is provided by using the "Include-If:" tag similarly, as follows:
Include-If: %ifarch aarch64
This will cause the patch application in the spec file to be done as follows:
%ifarch aarch64
%patch0013 -p1
%endif
A trick worth noting is, if a given git tracked patch is to be applied in a way
that can't be done in the normal patching section of the spec file, you can still
include the patch, and use it by name with the patch program elsewhere in the
spec file by doing something such as:
Include-If: %if 0%{?patch-possibly-applied-elsewhere}
(this variable will remain undefined in the spec file) And then elsewhere in spec
file, the actual patch (eg specially-handled-change.patch) is referenced as, eg:
patch -p1 < %_sourcedir/specially-handled-change.patch
++++++ Raise-soft-address-space-limit-to-hard-l.patch ++++++
From: =?UTF-8?q?Andreas=20F=C3=A4rber?=
Date: Sun, 15 Jan 2012 19:53:49 +0100
Subject: Raise soft address space limit to hard limit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For SLES we want users to be able to use large memory configurations
with KVM without fiddling with ulimit -Sv.
Signed-off-by: Andreas Färber
[BR: add include for sys/resource.h]
Signed-off-by: Bruce Rogers
---
vl.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/vl.c b/vl.c
index b426b3213461210565bd1db15a0c..2b864f7dbe8b60ace40fa3258a37 100644
--- a/vl.c
+++ b/vl.c
@@ -30,6 +30,7 @@
#include "qemu/cutils.h"
#include "qemu/help_option.h"
#include "qemu/uuid.h"
+#include
#include "sysemu/seccomp.h"
#include "sysemu/tcg.h"
@@ -2889,6 +2890,7 @@ int main(int argc, char **argv, char **envp)
bool list_data_dirs = false;
char *dir, **dirs;
BlockdevOptionsQueue bdo_queue = QSIMPLEQ_HEAD_INITIALIZER(bdo_queue);
+ struct rlimit rlimit_as;
os_set_line_buffering();
@@ -2900,6 +2902,16 @@ int main(int argc, char **argv, char **envp)
qemu_mutex_lock_iothread();
+ /*
+ * Try to raise the soft address space limit.
+ * Default on SLES 11 SP2 is 80% of physical+swap memory.
+ */
+ getrlimit(RLIMIT_AS, &rlimit_as);
+ if (rlimit_as.rlim_cur < rlimit_as.rlim_max) {
+ rlimit_as.rlim_cur = rlimit_as.rlim_max;
+ setrlimit(RLIMIT_AS, &rlimit_as);
+ }
+
atexit(qemu_run_exit_notifiers);
qemu_init_exec_dir(argv[0]);
++++++ Switch-order-of-libraries-for-mpath-supp.patch ++++++
From: Bruce Rogers
Date: Fri, 3 Nov 2017 11:12:40 -0600
Subject: Switch order of libraries for mpath support
Signed-off-by: Bruce Rogers
---
Makefile | 2 +-
configure | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index 85862fb81a1d276c41133a31b2d9..00ed716275743a161ea05e7d2a1e 100644
--- a/Makefile
+++ b/Makefile
@@ -556,7 +556,7 @@ fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
scsi/qemu-pr-helper$(EXESUF): scsi/qemu-pr-helper.o scsi/utils.o $(authz-obj-y) $(crypto-obj-y) $(io-obj-y) $(qom-obj-y) $(COMMON_LDADDS)
ifdef CONFIG_MPATH
-scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmultipath -lmpathpersist
+scsi/qemu-pr-helper$(EXESUF): LIBS += -ludev -lmpathpersist -lmultipath
endif
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
diff --git a/configure b/configure
index 714e7fb6a1fbd72ccdcd92b506ce..578d208b374261803d84c22c2479 100755
--- a/configure
+++ b/configure
@@ -3781,7 +3781,7 @@ int main(void) {
return 0;
}
EOF
- if compile_prog "" "-ludev -lmultipath -lmpathpersist" ; then
+ if compile_prog "" "-ludev -lmpathpersist -lmultipath" ; then
mpathpersist=yes
mpathpersist_new_api=yes
else
++++++ Workaround-compilation-error-with-gcc-9..patch ++++++
From: Valentine Barshak
Date: Mon, 22 Jul 2019 10:47:50 +0100
Subject: Workaround compilation error with gcc 9.1
References: bsc#1121464
Compiling with gcc 9.1 generates lots of "taking address of packed
member of ... may result in an unaligned pointer value" warnings.
Some of these warnings are genuine, and indicate correctly that parts
of iPXE currently require the CPU (or runtime environment) to support
unaligned accesses. For example: the TCP/IP receive data path will
attempt to access 32-bit fields that may not be aligned to a 32-bit
boundary.
Other warnings are either spurious (such as when the pointer is to a
variable-length byte array, which can have no alignment requirement
anyway) or unhelpful (such as when the pointer is used solely to
provide a debug colour value for the DBGC() macro).
There appears to be no easy way to silence the spurious warnings.
Since the ability to perform unaligned accesses is already a
requirement for iPXE, work around the problem by silencing this class
of warnings.
Signed-off-by: Valentine Barshak
Modified-by: Michael Brown
Signed-off-by: Michael Brown
Signed-off-by: Bruce Rogers
---
src/Makefile.housekeeping | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/roms/ipxe/src/Makefile.housekeeping b/roms/ipxe/src/Makefile.housekeeping
index 97fa325bb52314e05192d0414436..e5f6927de889167d286ccfcdda92 100644
--- a/roms/ipxe/src/Makefile.housekeeping
+++ b/roms/ipxe/src/Makefile.housekeeping
@@ -185,6 +185,15 @@ WNST_TEST = $(CC) -Wstringop-truncation -x c -c /dev/null -o /dev/null \
>/dev/null 2>&1
WNST_FLAGS := $(shell $(WNST_TEST) && $(ECHO) '-Wno-stringop-truncation')
WORKAROUND_CFLAGS += $(WNST_FLAGS)
+
+# gcc 9.1 generates warnings for taking address of packed member which
+# may result in an unaligned pointer value. Inhibit the warnings.
+#
+WNAPM_TEST = $(CC) -Wno-address-of-packed-member -x c -c /dev/null \
+ -o /dev/null >/dev/null 2>&1
+WNAPM_FLAGS := $(shell $(WNAPM_TEST) && \
+ $(ECHO) '-Wno-address-of-packed-member')
+WORKAROUND_CFLAGS += $(WNAPM_FLAGS)
endif
# Some versions of gas choke on division operators, treating them as
++++++ XXX-dont-dump-core-on-sigabort.patch ++++++
From: Alexander Graf
Date: Mon, 21 Nov 2011 23:50:36 +0100
Subject: XXX dont dump core on sigabort
Signed-off-by: Bruce Rogers
---
linux-user/signal.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 5ca6d62b15d3e4d3faee3f554fff..1d6382ce881795b057ab229e4129 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -581,6 +581,10 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
trace_user_force_sig(env, target_sig, host_sig);
gdb_signalled(env, target_sig);
+ if (target_sig == 6) {
+ goto no_core;
+ }
+
/* dump core if supported by target binary format */
if (core_dump_signal(target_sig) && (ts->bprm->core_dump != NULL)) {
stop_all_tasks();
@@ -598,6 +602,8 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
target_sig, strsignal(host_sig), "core dumped" );
}
+no_core:
+
/* The proper exit code for dying from an uncaught signal is
* -<signal>. The kernel doesn't allow exit() or _exit() to pass
* a negative value. To get the proper exit code we need to
++++++ _constraints ++++++
--- /var/tmp/diff_new_pack.wED1HF/_old 2019-10-05 16:20:52.553348063 +0200
+++ /var/tmp/diff_new_pack.wED1HF/_new 2019-10-05 16:20:52.557348053 +0200
@@ -50,4 +50,15 @@
</memory>
</hardware>
</overwrite>
+ <!-- To build qemu in a reasonable amount of time, aarch64 and x86_64 needs as much parallelism as we can get -->
+ <overwrite>
+ <conditions>
+ <arch>aarch64</arch>
+ <arch>x86_64</arch>
+ <package>qemu</package>
+ </conditions>
+ <hardware>
+ <processors>8</processors>
+ </hardware>
+ </overwrite>
</constraints>
++++++ _multibuild ++++++
<multibuild>
<package>linux-user</package>
<package>testsuite</package>
</multibuild>
++++++ acpi_piix4-Fix-migration-from-SLE11-SP2.patch ++++++
From: =?UTF-8?q?Andreas=20F=C3=A4rber?=
Date: Wed, 31 Jul 2013 17:32:35 +0200
Subject: acpi_piix4: Fix migration from SLE11 SP2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
References: bnc#812836
qemu-kvm 0.15 uses the same GPE format as qemu 1.4, but as version 2
rather than 3.
Signed-off-by: Andreas Färber
---
hw/acpi/piix4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index ec4e186cec7ccff739b7bad8dcc4..be5529867ab426b38b26dab5498a 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -306,7 +306,7 @@ static bool piix4_vmstate_need_smbus(void *opaque, int version_id)
static const VMStateDescription vmstate_acpi = {
.name = "piix4_pm",
.version_id = 3,
- .minimum_version_id = 3,
+ .minimum_version_id = 2, /* qemu-kvm */
.minimum_version_id_old = 1,
.load_state_old = acpi_load_old,
.post_load = vmstate_acpi_post_load,
++++++ ati-add-edid-support.patch ++++++
From: Gerd Hoffmann
Date: Mon, 18 Mar 2019 15:43:53 +0100
Subject: ati: add edid support.
Git-commit: 588eb12163b51c4d402383369456ce1cd1ec86ab
Read EDID blob via i2c, store in VBE_edid.
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 114 insertions(+)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index 0586279ce214fac7d2a7e6c87a94..8c9e6966db47f083646193d7faf6 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -19,6 +19,8 @@
#define MM_DATA 0x0004
#define CRTC_GEN_CNTL 0x0050
#define CRTC_EXT_CNTL 0x0054
+#define GPIO_VGA_DDC 0x0060
+#define GPIO_DVI_DDC 0x0064
#define CRTC_H_TOTAL_DISP 0x0200
#define CRTC_V_TOTAL_DISP 0x0208
#define CRTC_OFFSET 0x0224
@@ -106,6 +108,20 @@ static inline void ati_write(u32 reg, u32 val)
}
}
+static inline u32 ati_read(u32 reg)
+{
+ u32 io_addr = GET_GLOBAL(ati_io_addr);
+ u32 val;
+
+ if (reg < 0x100) {
+ val = inl(io_addr + reg);
+ } else {
+ outl(reg, io_addr + MM_INDEX);
+ reg = inl(io_addr + MM_DATA);
+ }
+ return val;
+}
+
static void ati_clear(u32 offset, u32 size)
{
u8 data[64];
@@ -180,6 +196,97 @@ ati_set_mode(struct vgamode_s *vmode_g, int flags)
return stdvga_set_mode(vmode_g, flags);
}
+/****************************************************************
+ * edid
+ ****************************************************************/
+
+static void
+ati_i2c_set_scl_sda(int scl, int sda)
+{
+ u32 data = 0;
+
+ if (!scl)
+ data |= (1 << 17);
+ if (!sda)
+ data |= (1 << 16);
+ ati_write(GPIO_DVI_DDC, data);
+}
+
+static int
+ati_i2c_get_sda(void)
+{
+ u32 data = ati_read(GPIO_DVI_DDC);
+
+ return data & (1 << 8) ? 1 : 0;
+}
+
+static void ati_i2c_start(void)
+{
+ ati_i2c_set_scl_sda(1, 1);
+ ati_i2c_set_scl_sda(1, 0);
+ ati_i2c_set_scl_sda(0, 0);
+}
+
+static void ati_i2c_ack(void)
+{
+ ati_i2c_set_scl_sda(0, 0);
+ ati_i2c_set_scl_sda(1, 0);
+ ati_i2c_set_scl_sda(0, 0);
+}
+
+static void ati_i2c_stop(void)
+{
+ ati_i2c_set_scl_sda(0, 0);
+ ati_i2c_set_scl_sda(1, 0);
+ ati_i2c_set_scl_sda(1, 1);
+}
+
+static void ati_i2c_send_byte(u8 byte)
+{
+ int i, bit;
+
+ for (i = 0; i < 8; i++) {
+ bit = (1 << (7-i)) & byte ? 1 : 0;
+ ati_i2c_set_scl_sda(0, bit);
+ ati_i2c_set_scl_sda(1, bit);
+ ati_i2c_set_scl_sda(0, bit);
+ }
+}
+
+static u8 ati_i2c_recv_byte(void)
+{
+ u8 byte = 0;
+ int i, bit;
+
+ for (i = 0; i < 8; i++) {
+ ati_i2c_set_scl_sda(0, 1);
+ ati_i2c_set_scl_sda(1, 1);
+ bit = ati_i2c_get_sda();
+ ati_i2c_set_scl_sda(0, 1);
+ if (bit)
+ byte |= (1 << (7-i));
+ }
+
+ return byte;
+}
+
+static void ati_i2c_edid(void)
+{
+ u8 byte;
+ int i;
+
+ dprintf(1, "ati: reading edid blob\n");
+ ati_i2c_start();
+ ati_i2c_send_byte(0x50 << 1 | 1);
+ ati_i2c_ack();
+ for (i = 0; i < 128; i++) {
+ byte = ati_i2c_recv_byte();
+ ati_i2c_ack();
+ SET_VGA(VBE_edid[i], byte);
+ }
+ ati_i2c_stop();
+}
+
/****************************************************************
* init
****************************************************************/
@@ -241,5 +348,12 @@ ati_setup(void)
}
}
+ u16 device = pci_config_readw(bdf, PCI_DEVICE_ID);
+ switch (device) {
+ case 0x5159:
+ ati_i2c_edid();
+ break;
+ }
+
return 0;
}
++++++ ati-vga-add-rage128-edid-support.patch ++++++
From: Gerd Hoffmann
Date: Mon, 24 Jun 2019 13:35:46 +0200
Subject: ati-vga: add rage128 edid support
Git-commit: 020bc4fc5ce93107c8e1bc731b9802cee56a123e
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index 71dfa859a22dc569ed2fd1312c6b..69dfd46e550a8865734def85c62d 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -21,6 +21,7 @@
#define CRTC_EXT_CNTL 0x0054
#define GPIO_VGA_DDC 0x0060
#define GPIO_DVI_DDC 0x0064
+#define GPIO_MONID 0x0068
#define CRTC_H_TOTAL_DISP 0x0200
#define CRTC_V_TOTAL_DISP 0x0208
#define CRTC_OFFSET 0x0224
@@ -47,6 +48,7 @@ static u32 ati_i2c_reg VAR16;
static u32 ati_i2c_bit_scl_out VAR16;
static u32 ati_i2c_bit_sda_out VAR16;
static u32 ati_i2c_bit_sda_in VAR16;
+static u32 ati_i2c_bit_enable VAR16 = -1;
int
@@ -208,8 +210,11 @@ ati_set_mode(struct vgamode_s *vmode_g, int flags)
static void
ati_i2c_set_scl_sda(int scl, int sda)
{
+ u32 enable = GET_GLOBAL(ati_i2c_bit_enable);
u32 data = 0;
+ if (enable != -1)
+ data |= (1 << enable);
if (!scl)
data |= (1 << GET_GLOBAL(ati_i2c_bit_scl_out));
if (!sda)
@@ -316,6 +321,23 @@ static void ati_i2c_edid_radeon(void)
dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
}
+static void ati_i2c_edid_rage128(void)
+{
+ int valid;
+
+ SET_VGA(ati_i2c_bit_enable, 25);
+ SET_VGA(ati_i2c_bit_scl_out, 18);
+ SET_VGA(ati_i2c_bit_sda_out, 17);
+ SET_VGA(ati_i2c_bit_sda_in, 9);
+ SET_VGA(ati_i2c_reg, GPIO_MONID);
+
+ dprintf(1, "ati: reading edid blob (rage128) ... \n");
+ ati_i2c_edid();
+ valid = (GET_GLOBAL(VBE_edid[0]) == 0x00 &&
+ GET_GLOBAL(VBE_edid[1]) == 0xff);
+ dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
+}
+
/****************************************************************
* init
****************************************************************/
@@ -379,6 +401,9 @@ ati_setup(void)
u16 device = pci_config_readw(bdf, PCI_DEVICE_ID);
switch (device) {
+ case 0x5046:
+ ati_i2c_edid_rage128();
+ break;
case 0x5159:
ati_i2c_edid_radeon();
break;
++++++ ati-vga-fix-ati_read.patch ++++++
From: Gerd Hoffmann
Date: Mon, 24 Jun 2019 12:09:31 +0200
Subject: ati-vga: fix ati_read()
Git-commit: 136e2612bd48ef06562625f15259fbacf7bcf66f
Cut & paste bug probably. Had no bad effect so far because the code
doesn't read registers larger than 0x100.
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index b3975226c47852c80ec4278b9a95..a24b980638a9562daaa37fe236b4 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -117,7 +117,7 @@ static inline u32 ati_read(u32 reg)
val = inl(io_addr + reg);
} else {
outl(reg, io_addr + MM_INDEX);
- reg = inl(io_addr + MM_DATA);
+ val = inl(io_addr + MM_DATA);
}
return val;
}
++++++ ati-vga-make-i2c-register-and-bits-confi.patch ++++++
From: Gerd Hoffmann
Date: Mon, 24 Jun 2019 12:08:32 +0200
Subject: ati-vga: make i2c register and bits configurable
Git-commit: ae9a9796ec395e66ff0ed6d4484ea40ce85c0300
Prepare to support other ati cards. Also log access mode and whenever
we got a valid edid block.
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index a24b980638a9562daaa37fe236b4..901e82d013837f54f4db292628d1 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -43,6 +43,11 @@
#define CRT_CRTC_ON 0x00008000
static u32 ati_io_addr VAR16 = 0;
+static u32 ati_i2c_reg VAR16;
+static u32 ati_i2c_bit_scl_out VAR16;
+static u32 ati_i2c_bit_sda_out VAR16;
+static u32 ati_i2c_bit_sda_in VAR16;
+
int
is_ati_mode(struct vgamode_s *vmode_g)
@@ -206,18 +211,18 @@ ati_i2c_set_scl_sda(int scl, int sda)
u32 data = 0;
if (!scl)
- data |= (1 << 17);
+ data |= (1 << GET_GLOBAL(ati_i2c_bit_scl_out));
if (!sda)
- data |= (1 << 16);
- ati_write(GPIO_DVI_DDC, data);
+ data |= (1 << GET_GLOBAL(ati_i2c_bit_sda_out));
+ ati_write(GET_GLOBAL(ati_i2c_reg), data);
}
static int
ati_i2c_get_sda(void)
{
- u32 data = ati_read(GPIO_DVI_DDC);
+ u32 data = ati_read(GET_GLOBAL(ati_i2c_reg));
- return data & (1 << 8) ? 1 : 0;
+ return data & (1 << GET_GLOBAL(ati_i2c_bit_sda_in)) ? 1 : 0;
}
static void ati_i2c_start(void)
@@ -275,7 +280,6 @@ static void ati_i2c_edid(void)
u8 byte;
int i;
- dprintf(1, "ati: reading edid blob\n");
ati_i2c_start();
ati_i2c_send_byte(0x50 << 1 | 1);
ati_i2c_ack();
@@ -287,6 +291,22 @@ static void ati_i2c_edid(void)
ati_i2c_stop();
}
+static void ati_i2c_edid_radeon(void)
+{
+ int valid;
+
+ SET_VGA(ati_i2c_bit_scl_out, 17);
+ SET_VGA(ati_i2c_bit_sda_out, 16);
+ SET_VGA(ati_i2c_bit_sda_in, 8);
+
+ dprintf(1, "ati: reading edid blob (radeon dvi) ... \n");
+ SET_VGA(ati_i2c_reg, GPIO_DVI_DDC);
+ ati_i2c_edid();
+ valid = (GET_GLOBAL(VBE_edid[0]) == 0x00 &&
+ GET_GLOBAL(VBE_edid[1]) == 0xff);
+ dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
+}
+
/****************************************************************
* init
****************************************************************/
@@ -351,7 +371,7 @@ ati_setup(void)
u16 device = pci_config_readw(bdf, PCI_DEVICE_ID);
switch (device) {
case 0x5159:
- ati_i2c_edid();
+ ati_i2c_edid_radeon();
break;
}
++++++ ati-vga-make-less-verbose.patch ++++++
From: Gerd Hoffmann
Date: Mon, 24 Jun 2019 12:09:52 +0200
Subject: ati-vga: make less verbose
Git-commit: ce52a31f612e33df66ac3553d9633732e34a277b
Reduce loglevel for mode line removals from 1 to 3.
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index 8c9e6966db47f083646193d7faf6..b3975226c47852c80ec4278b9a95 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -343,7 +343,7 @@ ati_setup(void)
height > 0xfff ||
mem > totalmem ||
memmodel != MM_DIRECT) {
- dprintf(1, "ati: removing mode 0x%x\n", GET_GLOBAL(m->mode));
+ dprintf(3, "ati: removing mode 0x%x\n", GET_GLOBAL(m->mode));
SET_VGA(m->mode, 0xffff);
}
}
++++++ ati-vga-try-vga-ddc-first.patch ++++++
From: Gerd Hoffmann
Date: Mon, 24 Jun 2019 12:17:28 +0200
Subject: ati-vga: try vga ddc first
Git-commit: af573dceef7b9a45d13192ec5abf29b73c78540e
Try vga ddc bus before dvi ddc bus.
Return early in case we got valid data.
Signed-off-by: Gerd Hoffmann
Signed-off-by: Bruce Rogers
---
vgasrc/atiext.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/roms/seabios/vgasrc/atiext.c b/roms/seabios/vgasrc/atiext.c
index 901e82d013837f54f4db292628d1..71dfa859a22dc569ed2fd1312c6b 100644
--- a/roms/seabios/vgasrc/atiext.c
+++ b/roms/seabios/vgasrc/atiext.c
@@ -299,6 +299,15 @@ static void ati_i2c_edid_radeon(void)
SET_VGA(ati_i2c_bit_sda_out, 16);
SET_VGA(ati_i2c_bit_sda_in, 8);
+ dprintf(1, "ati: reading edid blob (radeon vga) ... \n");
+ SET_VGA(ati_i2c_reg, GPIO_VGA_DDC);
+ ati_i2c_edid();
+ valid = (GET_GLOBAL(VBE_edid[0]) == 0x00 &&
+ GET_GLOBAL(VBE_edid[1]) == 0xff);
+ dprintf(1, "ati: ... %s\n", valid ? "good" : "invalid");
+ if (valid)
+ return;
+
dprintf(1, "ati: reading edid blob (radeon dvi) ... \n");
SET_VGA(ati_i2c_reg, GPIO_DVI_DDC);
ati_i2c_edid();
++++++ block-create-Do-not-abort-if-a-block-dri.patch ++++++
From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?=
Date: Thu, 12 Sep 2019 00:08:49 +0200
Subject: block/create: Do not abort if a block driver is not available
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: d90d5cae2b10efc0e8d0b3cc91ff16201853d3ba
The 'blockdev-create' QMP command was introduced as experimental
feature in commit b0292b851b8, using the assert() debug call.
It got promoted to 'stable' command in 3fb588a0f2c, but the
assert call was not removed.
Some block drivers are optional, and bdrv_find_format() might
return a NULL value, triggering the assertion.
Stable code is not expected to abort, so return an error instead.
This is easily reproducible when libnfs is not installed:
./configure
[...]
module support no
Block whitelist (rw)
Block whitelist (ro)
libiscsi support yes
libnfs support no
[...]
Start QEMU:
$ qemu-system-x86_64 -S -qmp unix:/tmp/qemu.qmp,server,nowait
Send the 'blockdev-create' with the 'nfs' driver:
$ ( cat << 'EOF'
{'execute': 'qmp_capabilities'}
{'execute': 'blockdev-create', 'arguments': {'job-id': 'x', 'options': {'size': 0, 'driver': 'nfs', 'location': {'path': '/', 'server': {'host': '::1', 'type': 'inet'}}}}, 'id': 'x'}
EOF
) | socat STDIO UNIX:/tmp/qemu.qmp
{"QMP": {"version": {"qemu": {"micro": 50, "minor": 1, "major": 4}, "package": "v4.1.0-733-g89ea03a7dc"}, "capabilities": ["oob"]}}
{"return": {}}
QEMU crashes:
$ gdb qemu-system-x86_64 core
Program received signal SIGSEGV, Segmentation fault.
(gdb) bt
#0 0x00007ffff510957f in raise () at /lib64/libc.so.6
#1 0x00007ffff50f3895 in abort () at /lib64/libc.so.6
#2 0x00007ffff50f3769 in _nl_load_domain.cold.0 () at /lib64/libc.so.6
#3 0x00007ffff5101a26 in .annobin_assert.c_end () at /lib64/libc.so.6
#4 0x0000555555d7e1f1 in qmp_blockdev_create (job_id=0x555556baee40 "x", options=0x555557666610, errp=0x7fffffffc770) at block/create.c:69
#5 0x0000555555c96b52 in qmp_marshal_blockdev_create (args=0x7fffdc003830, ret=0x7fffffffc7f8, errp=0x7fffffffc7f0) at qapi/qapi-commands-block-core.c:1314
#6 0x0000555555deb0a0 in do_qmp_dispatch (cmds=0x55555645de70 , request=0x7fffdc005c70, allow_oob=false, errp=0x7fffffffc898) at qapi/qmp-dispatch.c:131
#7 0x0000555555deb2a1 in qmp_dispatch (cmds=0x55555645de70 , request=0x7fffdc005c70, allow_oob=false) at qapi/qmp-dispatch.c:174
With this patch applied, QEMU returns a QMP error:
{'execute': 'blockdev-create', 'arguments': {'job-id': 'x', 'options': {'size': 0, 'driver': 'nfs', 'location': {'path': '/', 'server': {'host': '::1', 'type': 'inet'}}}}, 'id': 'x'}
{"id": "x", "error": {"class": "GenericError", "desc": "Block driver 'nfs' not found or not supported"}}
Cc: qemu-stable@nongnu.org
Reported-by: Xu Tian
Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Eric Blake
Reviewed-by: John Snow
Signed-off-by: Kevin Wolf
Signed-off-by: Bruce Rogers
---
block/create.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/create.c b/block/create.c
index 95341219efcd670a5151d0d3f4f5..de5e97bb186ffdf039fb39980874 100644
--- a/block/create.c
+++ b/block/create.c
@@ -63,9 +63,13 @@ void qmp_blockdev_create(const char *job_id, BlockdevCreateOptions *options,
const char *fmt = BlockdevDriver_str(options->driver);
BlockDriver *drv = bdrv_find_format(fmt);
+ if (!drv) {
+ error_setg(errp, "Block driver '%s' not found or not supported", fmt);
+ return;
+ }
+
/* If the driver is in the schema, we know that it exists. But it may not
* be whitelisted. */
- assert(drv);
if (bdrv_uses_whitelist() && !bdrv_is_whitelisted(drv, false)) {
error_setg(errp, "Driver is not whitelisted");
return;
++++++ block-file-posix-Reduce-xfsctl-use.patch ++++++
From: Max Reitz
Date: Fri, 23 Aug 2019 15:03:40 +0200
Subject: block/file-posix: Reduce xfsctl() use
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: b2c6f23f4a9f6d8f1b648705cd46d3713b78d6a2
This patch removes xfs_write_zeroes() and xfs_discard(). Both functions
have been added just before the same feature was present through
fallocate():
- fallocate() has supported PUNCH_HOLE for XFS since Linux 2.6.38 (March
2011); xfs_discard() was added in December 2010.
- fallocate() has supported ZERO_RANGE for XFS since Linux 3.15 (June
2014); xfs_write_zeroes() was added in November 2013.
Nowadays, all systems that qemu runs on should support both fallocate()
features (RHEL 7's kernel does).
xfsctl() is still useful for getting the request alignment for O_DIRECT,
so this patch does not remove our dependency on it completely.
Note that xfs_write_zeroes() had a bug: It calls ftruncate() when the
file is shorter than the specified range (because ZERO_RANGE does not
increase the file length). ftruncate() may yield and then discard data
that parallel write requests have written past the EOF in the meantime.
Dropping the function altogether fixes the bug.
Suggested-by: Paolo Bonzini
Fixes: 50ba5b2d994853b38fed10e0841b119da0f8b8e5
Reported-by: Lukáš Doktor
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Reviewed-by: Stefano Garzarella
Reviewed-by: John Snow
Tested-by: Stefano Garzarella
Tested-by: John Snow
Signed-off-by: Kevin Wolf
Signed-off-by: Bruce Rogers
---
block/file-posix.c | 77 +---------------------------------------------
1 file changed, 1 insertion(+), 76 deletions(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 4479cc7ab467f217cff8b3efbd1f..992eb4a798b99fe02e93103028c6 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1445,59 +1445,6 @@ out:
}
}
-#ifdef CONFIG_XFS
-static int xfs_write_zeroes(BDRVRawState *s, int64_t offset, uint64_t bytes)
-{
- int64_t len;
- struct xfs_flock64 fl;
- int err;
-
- len = lseek(s->fd, 0, SEEK_END);
- if (len < 0) {
- return -errno;
- }
-
- if (offset + bytes > len) {
- /* XFS_IOC_ZERO_RANGE does not increase the file length */
- if (ftruncate(s->fd, offset + bytes) < 0) {
- return -errno;
- }
- }
-
- memset(&fl, 0, sizeof(fl));
- fl.l_whence = SEEK_SET;
- fl.l_start = offset;
- fl.l_len = bytes;
-
- if (xfsctl(NULL, s->fd, XFS_IOC_ZERO_RANGE, &fl) < 0) {
- err = errno;
- trace_file_xfs_write_zeroes(strerror(errno));
- return -err;
- }
-
- return 0;
-}
-
-static int xfs_discard(BDRVRawState *s, int64_t offset, uint64_t bytes)
-{
- struct xfs_flock64 fl;
- int err;
-
- memset(&fl, 0, sizeof(fl));
- fl.l_whence = SEEK_SET;
- fl.l_start = offset;
- fl.l_len = bytes;
-
- if (xfsctl(NULL, s->fd, XFS_IOC_UNRESVSP64, &fl) < 0) {
- err = errno;
- trace_file_xfs_discard(strerror(errno));
- return -err;
- }
-
- return 0;
-}
-#endif
-
static int translate_err(int err)
{
if (err == -ENODEV || err == -ENOSYS || err == -EOPNOTSUPP ||
@@ -1553,10 +1500,8 @@ static ssize_t handle_aiocb_write_zeroes_block(RawPosixAIOData *aiocb)
static int handle_aiocb_write_zeroes(void *opaque)
{
RawPosixAIOData *aiocb = opaque;
-#if defined(CONFIG_FALLOCATE) || defined(CONFIG_XFS)
- BDRVRawState *s = aiocb->bs->opaque;
-#endif
#ifdef CONFIG_FALLOCATE
+ BDRVRawState *s = aiocb->bs->opaque;
int64_t len;
#endif
@@ -1564,12 +1509,6 @@ static int handle_aiocb_write_zeroes(void *opaque)
return handle_aiocb_write_zeroes_block(aiocb);
}
-#ifdef CONFIG_XFS
- if (s->is_xfs) {
- return xfs_write_zeroes(s, aiocb->aio_offset, aiocb->aio_nbytes);
- }
-#endif
-
#ifdef CONFIG_FALLOCATE_ZERO_RANGE
if (s->has_write_zeroes) {
int ret = do_fallocate(s->fd, FALLOC_FL_ZERO_RANGE,
@@ -1632,14 +1571,6 @@ static int handle_aiocb_write_zeroes_unmap(void *opaque)
}
#endif
-#ifdef CONFIG_XFS
- if (s->is_xfs) {
- /* xfs_discard() guarantees that the discarded area reads as all-zero
- * afterwards, so we can use it here. */
- return xfs_discard(s, aiocb->aio_offset, aiocb->aio_nbytes);
- }
-#endif
-
/* If we couldn't manage to unmap while guaranteed that the area reads as
* all-zero afterwards, just write zeroes without unmapping */
ret = handle_aiocb_write_zeroes(aiocb);
@@ -1716,12 +1647,6 @@ static int handle_aiocb_discard(void *opaque)
ret = -errno;
#endif
} else {
-#ifdef CONFIG_XFS
- if (s->is_xfs) {
- return xfs_discard(s, aiocb->aio_offset, aiocb->aio_nbytes);
- }
-#endif
-
#ifdef CONFIG_FALLOCATE_PUNCH_HOLE
ret = do_fallocate(s->fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
aiocb->aio_offset, aiocb->aio_nbytes);
++++++ block-nfs-tear-down-aio-before-nfs_close.patch ++++++
From: Peter Lieven
Date: Tue, 10 Sep 2019 17:41:09 +0200
Subject: block/nfs: tear down aio before nfs_close
Git-commit: 601dc6559725f7a614b6f893611e17ff0908e914
nfs_close is a sync call from libnfs and has its own event
handler polling on the nfs FD. Avoid that both QEMU and libnfs
are intefering here.
CC: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven
Signed-off-by: Kevin Wolf
Signed-off-by: Bruce Rogers
---
block/nfs.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/block/nfs.c b/block/nfs.c
index d93241b3bb84cf0a662f0ddec582..2b7a0782419af82aea80dd76e474 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -390,12 +390,14 @@ static void nfs_attach_aio_context(BlockDriverState *bs,
static void nfs_client_close(NFSClient *client)
{
if (client->context) {
+ qemu_mutex_lock(&client->mutex);
+ aio_set_fd_handler(client->aio_context, nfs_get_fd(client->context),
+ false, NULL, NULL, NULL, NULL);
+ qemu_mutex_unlock(&client->mutex);
if (client->fh) {
nfs_close(client->context, client->fh);
client->fh = NULL;
}
- aio_set_fd_handler(client->aio_context, nfs_get_fd(client->context),
- false, NULL, NULL, NULL, NULL);
nfs_destroy_context(client->context);
client->context = NULL;
}
++++++ blockjob-update-nodes-head-while-removin.patch ++++++
From: Sergio Lopez
Date: Wed, 11 Sep 2019 12:03:16 +0200
Subject: blockjob: update nodes head while removing all bdrv
Git-commit: d876bf676f5e7c6aa9ac64555e48cba8734ecb2f
block_job_remove_all_bdrv() iterates through job->nodes, calling
bdrv_root_unref_child() for each entry. The call to the latter may
reach child_job_[can_]set_aio_ctx(), which will also attempt to
traverse job->nodes, potentially finding entries that where freed
on previous iterations.
To avoid this situation, update job->nodes head on each iteration to
ensure that already freed entries are no longer linked to the list.
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1746631
Signed-off-by: Sergio Lopez
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Message-id: 20190911100316.32282-1-mreitz@redhat.com
Reviewed-by: Sergio Lopez
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
blockjob.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/blockjob.c b/blockjob.c
index 20b7f557da3e491927b99b113b73..74abb97bfdf27b5a9f4f82cd55b4 100644
--- a/blockjob.c
+++ b/blockjob.c
@@ -186,14 +186,23 @@ static const BdrvChildRole child_job = {
void block_job_remove_all_bdrv(BlockJob *job)
{
- GSList *l;
- for (l = job->nodes; l; l = l->next) {
+ /*
+ * bdrv_root_unref_child() may reach child_job_[can_]set_aio_ctx(),
+ * which will also traverse job->nodes, so consume the list one by
+ * one to make sure that such a concurrent access does not attempt
+ * to process an already freed BdrvChild.
+ */
+ while (job->nodes) {
+ GSList *l = job->nodes;
BdrvChild *c = l->data;
+
+ job->nodes = l->next;
+
bdrv_op_unblock_all(c->bs, job->blocker);
bdrv_root_unref_child(c);
+
+ g_slist_free_1(l);
}
- g_slist_free(job->nodes);
- job->nodes = NULL;
}
bool block_job_has_bdrv(BlockJob *job, BlockDriverState *bs)
++++++ config.sh ++++++
#!/bin/bash
# config.sh:
# The next few VARIABLES may be edited (or uncommented) as required:
# The commit upon which our patchqueue gets rebased. The special value LATEST
# may be used to "automatically" track the upstream development tree in the
# master branch
GIT_UPSTREAM_COMMIT_ISH=v4.1.0
if [ "$GIT_UPSTREAM_COMMIT_ISH" = "LATEST" ]; then
echo "Using LATEST upstream commit as base for tarball and patch queue"
GIT_BRANCH=master
fi
# otherwise we specify the branch to use, eg:
# WARNING: If transitioning from using LATEST to not, MANUALLY re-set the
# tarball present
GIT_BRANCH=opensuse-4.1
# This is used for the automated development branch tracking
NEXT_RELEASE_IS_MAJOR=0
# The shared openSUSE specific git repo, on which $GIT_LOCAL_TREE is based
GIT_TREE=git://github.com/openSUSE/qemu.git
# Temporary directories used by this script
GIT_DIR=/dev/shm/qemu-factory-git-dir
CMP_DIR=/dev/shm/qemu-factory-cmp-dir
BUNDLE_DIR=/dev/shm/qemu-factory-bundle-dir
# For the following, use 1 or 0 as needed
NUMBERED_PATCHES=0
PATCH_RANGE=1000
REPO_COUNT=26
# Perhaps we need to instead use the terminal local dirname as the index
# and store the ~/git/ as a separate VARIABLE
# This way, we only have one big array instead of two
# BUT STILL WE NEED TO START WITH THE DATA STORED SOMEWHERE!!!!!!
LOCAL_REPO_MAP=(
~/git/qemu-opensuse
~/git/qemu-seabios
~/git/qemu-ipxe
~/git/qemu-sgabios
~/git/qemu-edk2
~/git/qemu-skiboot
~/git/qemu-SLOF
~/git/qemu-openbios
~/git/qemu-keycodemapdb
~/git/qemu-slirp
~/git/qemu-u-boot
~/git/qemu-openhackware
~/git/qemu-dtc
~/git/qemu-opensbi
~/git/qemu-edk2-openssl
~/git/qemu-capstone
~/git/qemu-qemu-palcode
~/git/qemu-seabios-hppa
~/git/qemu-u-boot-sam460ex
~/git/qemu-QemuMacDrivers
~/git/qemu-tests-berkeley-softfloat-3
~/git/qemu-tests-berkeley-testfloat-3
~/git/qemu-edk2-berkeley-softfloat-3
~/git/qemu-edk2-openssl-boringssl
~/git/qemu-edk2-openssl-krb5
~/git/qemu-edk2-openssl-pyca-cryptography
)
PATCH_PATH_MAP=(
""
"roms/seabios/"
"roms/ipxe/"
"roms/sgabios/"
"roms/edk2/"
"roms/skiboot/"
"roms/SLOF/"
"roms/openbios/"
"ui/keycodemapdb/"
"slirp/"
"roms/u-boot/"
"roms/openhackware/"
"dtc/"
"roms/opensbi/"
"roms/edk2/CryptoPkg/Library/OpensslLib/openssl/"
"capstone/"
"roms/qemu-palcode/"
"roms/seabios-hppa/"
"roms/u-boot-sam460ex/"
"roms/QemuMacDrivers/"
"tests/fp/berkeley-softfloat-3/"
"tests/fp/berkeley-testfloat-3/"
"roms/edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3/"
"roms/edk2/CryptoPkg/Library/OpensslLib/openssl/boringssl/"
"roms/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5/"
"roms/edk2/CryptoPkg/Library/OpensslLib/openssl/pyca-cryptography/"
)
# Zero based numbering, so we subtract 1 here:
if (( (REPO_COUNT * PATCH_RANGE) - 1 > 9999 )); then
FIVE_DIGIT_POTENTIAL=1
else
FIVE_DIGIT_POTENTIAL=0
fi
++++++ configure-only-populate-roms-if-softmmu.patch ++++++
From: Bruce Rogers
Date: Tue, 28 May 2019 14:23:37 -0600
Subject: configure: only populate roms if softmmu
Currently roms are mistakenly getting built in a linux-user only
configuration. Add check for softmmu in all places where our list of
roms is being added to.
Signed-off-by: Bruce Rogers
---
configure | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 578d208b374261803d84c22c2479..6cfe739061d2d8fef6d89147fcd5 100755
--- a/configure
+++ b/configure
@@ -6211,12 +6211,13 @@ if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
fi
done
fi
-if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" ; then
+if test "$ARCH" = "ppc64" && test "$targetos" != "Darwin" && \
+ test "$softmmu" = yes ; then
roms="$roms spapr-rtas"
fi
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
-if test "$cpu" = "s390x" ; then
+if test "$cpu" = "s390x" && test "$softmmu" = yes ; then
write_c_skeleton
if compile_prog "-march=z900" ""; then
roms="$roms s390-ccw"
++++++ curl-Check-completion-in-curl_multi_do.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:32 +0200
Subject: curl: Check completion in curl_multi_do()
Git-commit: 948403bcb1c7e71dcbe8ab8479cf3934a0efcbb5
While it is more likely that transfers complete after some file
descriptor has data ready to read, we probably should not rely on it.
Better be safe than sorry and call curl_multi_check_completion() in
curl_multi_do(), too, just like it is done in curl_multi_read().
With this change, curl_multi_do() and curl_multi_read() are actually the
same, so drop curl_multi_read() and use curl_multi_do() as the sole FD
handler.
Signed-off-by: Max Reitz
Message-id: 20190910124136.10565-4-mreitz@redhat.com
Reviewed-by: Maxim Levitsky
Reviewed-by: John Snow
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index 95d7b77dc0b1cf25443effdb9eb3..5838afef99e070d8e7b704fa55e7 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -139,7 +139,6 @@ typedef struct BDRVCURLState {
static void curl_clean_state(CURLState *s);
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. */
@@ -186,7 +185,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
switch (action) {
case CURL_POLL_IN:
aio_set_fd_handler(s->aio_context, fd, false,
- curl_multi_read, NULL, NULL, state);
+ curl_multi_do, NULL, NULL, state);
break;
case CURL_POLL_OUT:
aio_set_fd_handler(s->aio_context, fd, false,
@@ -194,7 +193,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
break;
case CURL_POLL_INOUT:
aio_set_fd_handler(s->aio_context, fd, false,
- curl_multi_read, curl_multi_do, NULL, state);
+ curl_multi_do, curl_multi_do, NULL, state);
break;
case CURL_POLL_REMOVE:
aio_set_fd_handler(s->aio_context, fd, false,
@@ -416,15 +415,6 @@ static void curl_multi_do(void *arg)
{
CURLState *s = (CURLState *)arg;
- qemu_mutex_lock(&s->s->mutex);
- curl_multi_do_locked(s);
- qemu_mutex_unlock(&s->s->mutex);
-}
-
-static void curl_multi_read(void *arg)
-{
- CURLState *s = (CURLState *)arg;
-
qemu_mutex_lock(&s->s->mutex);
curl_multi_do_locked(s);
curl_multi_check_completion(s->s);
++++++ curl-Handle-success-in-multi_check_compl.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:35 +0200
Subject: curl: Handle success in multi_check_completion
Git-commit: bfb23b480a49114315877aacf700b49453e0f9d9
Background: As of cURL 7.59.0, it verifies that several functions are
not called from within a callback. Among these functions is
curl_multi_add_handle().
curl_read_cb() is a callback from cURL and not a coroutine. Waking up
acb->co will lead to entering it then and there, which means the current
request will settle and the caller (if it runs in the same coroutine)
may then issue the next request. In such a case, we will enter
curl_setup_preadv() effectively from within curl_read_cb().
Calling curl_multi_add_handle() will then fail and the new request will
not be processed.
Fix this by not letting curl_read_cb() wake up acb->co. Instead, leave
the whole business of settling the AIOCB objects to
curl_multi_check_completion() (which is called from our timer callback
and our FD handler, so not from any cURL callbacks).
Reported-by: Natalie Gavrielov
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1740193
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Message-id: 20190910124136.10565-7-mreitz@redhat.com
Reviewed-by: John Snow
Reviewed-by: Maxim Levitsky
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 69 ++++++++++++++++++++++------------------------------
1 file changed, 29 insertions(+), 40 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index fd70f1ebc458f22f6d1a4bc01e1e..c343c7ed3ddad205051d7e3b0196 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -229,7 +229,6 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
{
CURLState *s = ((CURLState*)opaque);
size_t realsize = size * nmemb;
- int i;
trace_curl_read_cb(realsize);
@@ -245,32 +244,6 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
memcpy(s->orig_buf + s->buf_off, ptr, realsize);
s->buf_off += realsize;
- for(i=0; iacb[i];
-
- if (!acb)
- continue;
-
- if ((s->buf_off >= acb->end)) {
- size_t request_length = acb->bytes;
-
- qemu_iovec_from_buf(acb->qiov, 0, s->orig_buf + acb->start,
- acb->end - acb->start);
-
- if (acb->end - acb->start < request_length) {
- size_t offset = acb->end - acb->start;
- qemu_iovec_memset(acb->qiov, offset, 0,
- request_length - offset);
- }
-
- acb->ret = 0;
- s->acb[i] = NULL;
- qemu_mutex_unlock(&s->s->mutex);
- aio_co_wake(acb->co);
- qemu_mutex_lock(&s->s->mutex);
- }
- }
-
read_end:
/* curl will error out if we do not return this value */
return size * nmemb;
@@ -351,13 +324,14 @@ static void curl_multi_check_completion(BDRVCURLState *s)
break;
if (msg->msg == CURLMSG_DONE) {
+ int i;
CURLState *state = NULL;
+ bool error = msg->data.result != CURLE_OK;
+
curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE,
(char **)&state);
- /* ACBs for successful messages get completed in curl_read_cb */
- if (msg->data.result != CURLE_OK) {
- int i;
+ if (error) {
static int errcount = 100;
/* Don't lose the original error message from curl, since
@@ -369,20 +343,35 @@ static void curl_multi_check_completion(BDRVCURLState *s)
error_report("curl: further errors suppressed");
}
}
+ }
- for (i = 0; i < CURL_NUM_ACB; i++) {
- CURLAIOCB *acb = state->acb[i];
+ for (i = 0; i < CURL_NUM_ACB; i++) {
+ CURLAIOCB *acb = state->acb[i];
- if (acb == NULL) {
- continue;
- }
+ if (acb == NULL) {
+ continue;
+ }
+
+ if (!error) {
+ /* Assert that we have read all data */
+ assert(state->buf_off >= acb->end);
+
+ qemu_iovec_from_buf(acb->qiov, 0,
+ state->orig_buf + acb->start,
+ acb->end - acb->start);
- acb->ret = -EIO;
- state->acb[i] = NULL;
- qemu_mutex_unlock(&s->mutex);
- aio_co_wake(acb->co);
- qemu_mutex_lock(&s->mutex);
+ if (acb->end - acb->start < acb->bytes) {
+ size_t offset = acb->end - acb->start;
+ qemu_iovec_memset(acb->qiov, offset, 0,
+ acb->bytes - offset);
+ }
}
+
+ acb->ret = error ? -EIO : 0;
+ state->acb[i] = NULL;
+ qemu_mutex_unlock(&s->mutex);
+ aio_co_wake(acb->co);
+ qemu_mutex_lock(&s->mutex);
}
curl_clean_state(state);
++++++ curl-Keep-pointer-to-the-CURLState-in-CU.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:30 +0200
Subject: curl: Keep pointer to the CURLState in CURLSocket
Git-commit: 0487861685294660b23bc146e1ebd5304aa8bbe0
A follow-up patch will make curl_multi_do() and curl_multi_read() take a
CURLSocket instead of the CURLState. They still need the latter,
though, so add a pointer to it to the former.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Reviewed-by: John Snow
Message-id: 20190910124136.10565-2-mreitz@redhat.com
Reviewed-by: Maxim Levitsky
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/block/curl.c b/block/curl.c
index d4c8e94f3e0fe26ee221e763356e..92dc2f630e20f4a6b138c9c82b8b 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -80,6 +80,7 @@ static CURLMcode __curl_multi_socket_action(CURLM *multi_handle,
#define CURL_BLOCK_OPT_TIMEOUT_DEFAULT 5
struct BDRVCURLState;
+struct CURLState;
static bool libcurl_initialized;
@@ -97,6 +98,7 @@ typedef struct CURLAIOCB {
typedef struct CURLSocket {
int fd;
+ struct CURLState *state;
QLIST_ENTRY(CURLSocket) next;
} CURLSocket;
@@ -180,6 +182,7 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
if (!socket) {
socket = g_new0(CURLSocket, 1);
socket->fd = fd;
+ socket->state = state;
QLIST_INSERT_HEAD(&state->sockets, socket, next);
}
socket = NULL;
++++++ curl-Keep-socket-until-the-end-of-curl_s.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:31 +0200
Subject: curl: Keep *socket until the end of curl_sock_cb()
Git-commit: 007f339b1099af46a008dac438ca0943e31dba72
This does not really change anything, but it makes the code a bit easier
to follow once we use @socket as the opaque pointer for
aio_set_fd_handler().
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Message-id: 20190910124136.10565-3-mreitz@redhat.com
Reviewed-by: Maxim Levitsky
Reviewed-by: John Snow
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index 92dc2f630e20f4a6b138c9c82b8b..95d7b77dc0b1cf25443effdb9eb3 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -172,10 +172,6 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
QLIST_FOREACH(socket, &state->sockets, next) {
if (socket->fd == fd) {
- if (action == CURL_POLL_REMOVE) {
- QLIST_REMOVE(socket, next);
- g_free(socket);
- }
break;
}
}
@@ -185,7 +181,6 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
socket->state = state;
QLIST_INSERT_HEAD(&state->sockets, socket, next);
}
- socket = NULL;
trace_curl_sock_cb(action, (int)fd);
switch (action) {
@@ -207,6 +202,11 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
break;
}
+ if (action == CURL_POLL_REMOVE) {
+ QLIST_REMOVE(socket, next);
+ g_free(socket);
+ }
+
return 0;
}
++++++ curl-Pass-CURLSocket-to-curl_multi_do.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:33 +0200
Subject: curl: Pass CURLSocket to curl_multi_do()
Git-commit: 9dbad87d25587ff640ef878f7b6159fc368ff541
curl_multi_do_locked() currently marks all sockets as ready. That is
not only inefficient, but in fact unsafe (the loop is). A follow-up
patch will change that, but to do so, curl_multi_do_locked() needs to
know exactly which socket is ready; and that is accomplished by this
patch here.
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Message-id: 20190910124136.10565-5-mreitz@redhat.com
Reviewed-by: Maxim Levitsky
Reviewed-by: John Snow
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index 5838afef99e070d8e7b704fa55e7..cf2686218dcf4bc7d2db1a7026f9 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -185,15 +185,15 @@ static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
switch (action) {
case CURL_POLL_IN:
aio_set_fd_handler(s->aio_context, fd, false,
- curl_multi_do, NULL, NULL, state);
+ curl_multi_do, NULL, NULL, socket);
break;
case CURL_POLL_OUT:
aio_set_fd_handler(s->aio_context, fd, false,
- NULL, curl_multi_do, NULL, state);
+ NULL, curl_multi_do, NULL, socket);
break;
case CURL_POLL_INOUT:
aio_set_fd_handler(s->aio_context, fd, false,
- curl_multi_do, curl_multi_do, NULL, state);
+ curl_multi_do, curl_multi_do, NULL, socket);
break;
case CURL_POLL_REMOVE:
aio_set_fd_handler(s->aio_context, fd, false,
@@ -392,9 +392,10 @@ static void curl_multi_check_completion(BDRVCURLState *s)
}
/* Called with s->mutex held. */
-static void curl_multi_do_locked(CURLState *s)
+static void curl_multi_do_locked(CURLSocket *ready_socket)
{
CURLSocket *socket, *next_socket;
+ CURLState *s = ready_socket->state;
int running;
int r;
@@ -413,12 +414,13 @@ static void curl_multi_do_locked(CURLState *s)
static void curl_multi_do(void *arg)
{
- CURLState *s = (CURLState *)arg;
+ CURLSocket *socket = arg;
+ BDRVCURLState *s = socket->state->s;
- qemu_mutex_lock(&s->s->mutex);
- curl_multi_do_locked(s);
- curl_multi_check_completion(s->s);
- qemu_mutex_unlock(&s->s->mutex);
+ qemu_mutex_lock(&s->mutex);
+ curl_multi_do_locked(socket);
+ curl_multi_check_completion(s);
+ qemu_mutex_unlock(&s->mutex);
}
static void curl_multi_timeout_do(void *arg)
++++++ curl-Report-only-ready-sockets.patch ++++++
From: Max Reitz
Date: Tue, 10 Sep 2019 14:41:34 +0200
Subject: curl: Report only ready sockets
Git-commit: 9abaf9fc474c3dd53e8e119326abc774c977c331
Instead of reporting all sockets to cURL, only report the one that has
caused curl_multi_do_locked() to be called. This lets us get rid of the
QLIST_FOREACH_SAFE() list, which was actually wrong: SAFE foreaches are
only safe when the current element is removed in each iteration. If it
possible for the list to be concurrently modified, we cannot guarantee
that only the current element will be removed. Therefore, we must not
use QLIST_FOREACH_SAFE() here.
Fixes: ff5ca1664af85b24a4180d595ea6873fd3deac57
Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz
Message-id: 20190910124136.10565-6-mreitz@redhat.com
Reviewed-by: Maxim Levitsky
Reviewed-by: John Snow
Signed-off-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/curl.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/block/curl.c b/block/curl.c
index cf2686218dcf4bc7d2db1a7026f9..fd70f1ebc458f22f6d1a4bc01e1e 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -392,24 +392,19 @@ static void curl_multi_check_completion(BDRVCURLState *s)
}
/* Called with s->mutex held. */
-static void curl_multi_do_locked(CURLSocket *ready_socket)
+static void curl_multi_do_locked(CURLSocket *socket)
{
- CURLSocket *socket, *next_socket;
- CURLState *s = ready_socket->state;
+ BDRVCURLState *s = socket->state->s;
int running;
int r;
- if (!s->s->multi) {
+ if (!s->multi) {
return;
}
- /* Need to use _SAFE because curl_multi_socket_action() may trigger
- * curl_sock_cb() which might modify this list */
- QLIST_FOREACH_SAFE(socket, &s->sockets, next, next_socket) {
- do {
- r = curl_multi_socket_action(s->s->multi, socket->fd, 0, &running);
- } while (r == CURLM_CALL_MULTI_PERFORM);
- }
+ do {
+ r = curl_multi_socket_action(s->multi, socket->fd, 0, &running);
+ } while (r == CURLM_CALL_MULTI_PERFORM);
}
static void curl_multi_do(void *arg)
++++++ enable-cross-compilation-on-ARM.patch ++++++
From: Bruce Rogers
Date: Mon, 26 Aug 2019 13:28:57 -0600
Subject: enable cross compilation on ARM
Signed-off-by: Bruce Rogers
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/seabios/Makefile b/roms/seabios/Makefile
index bd34cfc2394a9103fec2e951bb67..7b8a5cd6b17254685df89798ed10 100644
--- a/roms/seabios/Makefile
+++ b/roms/seabios/Makefile
@@ -13,7 +13,7 @@ export CONFIG_SHELL := sh
export KCONFIG_AUTOHEADER := autoconf.h
export KCONFIG_CONFIG := $(CURDIR)/.config
export LC_ALL := C
-CROSS_PREFIX=
+CROSS_PREFIX=$(CROSS_COMPILE)
ifneq ($(CROSS_PREFIX),)
CC=$(CROSS_PREFIX)gcc
endif
++++++ hdata-vpd-fix-printing-char-0x00.patch ++++++
From: Stewart Smith
Date: Tue, 18 Jun 2019 16:06:44 +1000
Subject: hdata/vpd: fix printing (char*)0x00
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: ba977f2e4406f9de318afcdf5d666e77585ef269
GCC9 now catches this bug:
In file included from hdata/vpd.c:17:
In function ‘vpd_vini_parse’,
inlined from ‘vpd_data_parse’ at hdata/vpd.c:416:3:
/home/stewart/skiboot/include/skiboot.h:93:31: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
93 | #define prlog(l, f, ...) do { _prlog(l, pr_fmt(f), ##__VA_ARGS__); } while(0)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
hdata/vpd.c:390:5: note: in expansion of macro ‘prlog’
390 | prlog(PR_WARNING,
| ^~~~~
hdata/vpd.c: In function ‘vpd_data_parse’:
hdata/vpd.c:391:46: note: format string is defined here
391 | "VPD: CCIN desc not available for: %s\n",
| ^~
cc1: all warnings being treated as errors
Signed-off-by: Stewart Smith
Signed-off-by: Bruce Rogers
---
hdata/vpd.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/roms/skiboot/hdata/vpd.c b/roms/skiboot/hdata/vpd.c
index 129b5062356a48d900c6aa5a140d..5a01bcc9f6fa2faef2a118eca938 100644
--- a/roms/skiboot/hdata/vpd.c
+++ b/roms/skiboot/hdata/vpd.c
@@ -328,6 +328,7 @@ static void vpd_vini_parse(struct dt_node *node,
const void *fruvpd, unsigned int fruvpd_sz)
{
const void *kw;
+ const char *desc;
uint8_t sz;
const struct card_info *cinfo;
@@ -381,15 +382,15 @@ static void vpd_vini_parse(struct dt_node *node,
dt_add_property_string(node,
"description", cinfo->description);
} else {
- kw = vpd_find(fruvpd, fruvpd_sz, "VINI", "DR", &sz);
- if (kw) {
+ desc = vpd_find(fruvpd, fruvpd_sz, "VINI", "DR", &sz);
+ if (desc) {
dt_add_prop_sanitize_val(node,
- "description", kw, sz);
+ "description", desc, sz);
} else {
dt_add_property_string(node, "description", "Unknown");
prlog(PR_WARNING,
"VPD: CCIN desc not available for: %s\n",
- (char *)kw);
+ (char*)kw);
}
}
}
++++++ hw-arm-boot.c-Set-NSACR.-CP11-CP10-for-N.patch ++++++
From: Peter Maydell
Date: Fri, 20 Sep 2019 18:40:39 +0100
Subject: hw/arm/boot.c: Set NSACR.{CP11,CP10} for NS kernel boots
Git-commit: ece628fcf69cbbd4b3efb6fbd203af07609467a2
If we're booting a Linux kernel directly into Non-Secure
state on a CPU which has Secure state, then make sure we
set the NSACR CP11 and CP10 bits, so that Non-Secure is allowed
to access the FPU. Otherwise an AArch32 kernel will UNDEF as
soon as it tries to use the FPU.
It used to not matter that we didn't do this until commit
fc1120a7f5f2d4b6, where we implemented actually honouring
these NSACR bits.
The problem only exists for CPUs where EL3 is AArch32; the
equivalent AArch64 trap bits are in CPTR_EL3 and are "0 to
not trap, 1 to trap", so the reset value of the register
permits NS access, unlike NSACR.
Fixes: fc1120a7f5
Fixes: https://bugs.launchpad.net/qemu/+bug/1844597
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Maydell
Reviewed-by: Richard Henderson
Message-id: 20190920174039.3916-1-peter.maydell@linaro.org
Signed-off-by: Bruce Rogers
---
hw/arm/boot.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index c2b89b3bb9b6b92b0293d859712e..fc4e021a38a6bc1e5e2aa5b5876c 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -754,6 +754,8 @@ static void do_cpu_reset(void *opaque)
(cs != first_cpu || !info->secure_board_setup)) {
/* Linux expects non-secure state */
env->cp15.scr_el3 |= SCR_NS;
+ /* Set NSACR.{CP11,CP10} so NS can access the FPU */
+ env->cp15.nsacr |= 3 << 10;
}
}
++++++ hw-core-loader-Fix-possible-crash-in-rom.patch ++++++
From: Thomas Huth
Date: Wed, 25 Sep 2019 14:16:43 +0200
Subject: hw/core/loader: Fix possible crash in rom_copy()
Git-commit: e423455c4f23a1a828901c78fe6d03b7dde79319
Both, "rom->addr" and "addr" are derived from the binary image
that can be loaded with the "-kernel" paramer. The code in
rom_copy() then calculates:
d = dest + (rom->addr - addr);
and uses "d" as destination in a memcpy() some lines later. Now with
bad kernel images, it is possible that rom->addr is smaller than addr,
thus "rom->addr - addr" gets negative and the memcpy() then tries to
copy contents from the image to a bad memory location. This could
maybe be used to inject code from a kernel image into the QEMU binary,
so we better fix it with an additional sanity check here.
Cc: qemu-stable@nongnu.org
Reported-by: Guangming Liu
Buglink: https://bugs.launchpad.net/qemu/+bug/1844635
Message-Id: <20190925130331.27825-1-thuth@redhat.com>
Reviewed-by: Michael S. Tsirkin
Signed-off-by: Thomas Huth
Signed-off-by: Bruce Rogers
---
hw/core/loader.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 425bf69a9968765b4604a442eb0a..838a34174ac2039d55f557fa427a 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -1242,7 +1242,7 @@ int rom_copy(uint8_t *dest, hwaddr addr, size_t size)
if (rom->addr + rom->romsize < addr) {
continue;
}
- if (rom->addr > end) {
+ if (rom->addr > end || rom->addr < addr) {
break;
}
++++++ hw-intc-exynos4210_gic-provide-more-room.patch ++++++
From: Bruce Rogers
Date: Wed, 15 May 2019 13:32:01 -0600
Subject: hw/intc/exynos4210_gic: provide more room when formatting alias names
sprintf related parameter validation complains about the size of the
buffer being written to in exynos4210_gic_realize(). Provide a bit more
space to avoid the following warning:
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c: In function 'exynos4210_gic_realize':
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:316:36: error: '%x' directive writing between 1 and 7 bytes into a region of size between 4 and 28 [-Werror=format-overflow=]
316 | sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
| ^~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:316:33: note: directive argument in the range [0, 29020050]
316 | sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/include/qemu/osdep.h:99,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:23:
/usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 2 and 32 bytes into a destination of size 28
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:326:37: error: '%x' directive writing between 1 and 7 bytes into a region of size between 3 and 28 [-Werror=format-overflow=]
326 | sprintf(dist_alias_name, "%s%x", dist_prefix, i);
| ^~
/home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:326:34: note: directive argument in the range [0, 29020050]
326 | sprintf(dist_alias_name, "%s%x", dist_prefix, i);
| ^~~~~~
In file included from /usr/include/stdio.h:867,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/include/qemu/osdep.h:99,
from /home/abuild/rpmbuild/BUILD/qemu-4.0.0/hw/intc/exynos4210_gic.c:23:
/usr/include/bits/stdio2.h:36:10: note: '__builtin___sprintf_chk' output between 2 and 33 bytes into a destination of size 28
36 | return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Bruce Rogers
---
hw/intc/exynos4210_gic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
index e37d457fcf3ae8f37ae3c4047161..640f146a50af42ccd03aa18786f2 100644
--- a/hw/intc/exynos4210_gic.c
+++ b/hw/intc/exynos4210_gic.c
@@ -288,8 +288,8 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
SysBusDevice *sbd = SYS_BUS_DEVICE(obj);
const char cpu_prefix[] = "exynos4210-gic-alias_cpu";
const char dist_prefix[] = "exynos4210-gic-alias_dist";
- char cpu_alias_name[sizeof(cpu_prefix) + 3];
- char dist_alias_name[sizeof(cpu_prefix) + 3];
+ char cpu_alias_name[sizeof(cpu_prefix) + 7];
+ char dist_alias_name[sizeof(cpu_prefix) + 8];
SysBusDevice *gicbusdev;
uint32_t i;
++++++ hw-smbios-handle-both-file-formats-regar.patch ++++++
From: Bruce Rogers
Date: Fri, 5 Apr 2019 21:10:30 -0600
Subject: hw/smbios: handle both file formats regardless of machine type
References: bsc#994082, bsc#1084316, boo#1131894
It's easy enough to handle either per-spec or legacy smbios structures
in the smbios file input without regard to the machine type used, by
simply applying the basic smbios formatting rules. then depending on
what is detected. terminal numm bytes are added or removed for machine
type specific processing.
Signed-off-by: Bruce Rogers
---
hw/smbios/smbios.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 file changed, 39 insertions(+), 4 deletions(-)
diff --git a/hw/smbios/smbios.c b/hw/smbios/smbios.c
index 7bcd67b098e91a0e724b77b224c1..44e62c2a627195d71ac569e9de49 100644
--- a/hw/smbios/smbios.c
+++ b/hw/smbios/smbios.c
@@ -965,6 +965,7 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
struct smbios_structure_header *header;
int size;
struct smbios_table *table; /* legacy mode only */
+ uint8_t *dbl_nulls, *orig_end;
qemu_opts_validate(opts, qemu_smbios_file_opts, &err);
if (err) {
@@ -979,11 +980,21 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
}
/*
- * NOTE: standard double '\0' terminator expected, per smbios spec.
- * (except in legacy mode, where the second '\0' is implicit and
- * will be inserted by the BIOS).
+ * NOTE: standard double '\0' terminator expected, per smbios spec,
+ * unless the data is formatted for legacy mode, which is used by
+ * pc-i440fx-2.0 and earlier machine types. Legacy mode structures
+ * without strings have no '\0' terminators, and those with strings
+ * also don't have an additional '\0' terminator at the end of the
+ * final string '\0' terminator. The BIOS will add the '\0' terminators
+ * to comply with the smbios spec.
+ * For greater compatibility, regardless of the machine type used,
+ * either format is accepted.
*/
- smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
+ smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size + 2);
+ orig_end = smbios_tables + smbios_tables_len + size;
+ /* add extra null bytes to end in case of legacy file data */
+ *orig_end = '\0';
+ *(orig_end + 1) = '\0';
header = (struct smbios_structure_header *)(smbios_tables +
smbios_tables_len);
@@ -998,6 +1009,19 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
header->type);
return;
}
+ for (dbl_nulls = smbios_tables + smbios_tables_len + header->length;
+ dbl_nulls + 2 <= orig_end; dbl_nulls++) {
+ if (*dbl_nulls == '\0' && *(dbl_nulls + 1) == '\0') {
+ break;
+ }
+ }
+ if (dbl_nulls + 2 < orig_end) {
+ error_setg(errp, "SMBIOS file data malformed");
+ return;
+ }
+ /* increase size by how many extra nulls were actually needed */
+ size += dbl_nulls + 2 - orig_end;
+ smbios_tables = g_realloc(smbios_tables, smbios_tables_len + size);
set_bit(header->type, have_binfile_bitmap);
if (header->type == 4) {
@@ -1018,6 +1042,17 @@ void smbios_entry_add(QemuOpts *opts, Error **errp)
* delete the one we don't need from smbios_set_defaults(),
* once we know which machine version has been requested.
*/
+ if (dbl_nulls + 2 == orig_end) {
+ /* chop off nulls to get legacy format */
+ if (header->length + 2 == size) {
+ size -= 2;
+ } else {
+ size -= 1;
+ }
+ } else {
+ /* undo conversion from legacy format to per-spec format */
+ size -= dbl_nulls + 2 - orig_end;
+ }
if (!smbios_entries) {
smbios_entries_len = sizeof(uint16_t);
smbios_entries = g_malloc0(smbios_entries_len);
++++++ hw-usb-dev-mtp-Fix-GCC-9-build-warning.patch ++++++
From: Alistair Francis
Date: Sat, 4 May 2019 07:58:55 -0600
Subject: hw/usb/dev-mtp: Fix GCC 9 build warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix this warning with GCC 9 on Fedora 30:
hw/usb/dev-mtp.c:1715:36: error: taking address of packed member of struct <anonymous> may result in an unaligned pointer value [-Werror=address-of-packed-member]
1715 | dataset->filename);
| ~~~~~~~^~~~~~~~~~
Signed-off-by: Alistair Francis
Signed-off-by: Bruce Rogers
---
hw/usb/dev-mtp.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index fd1b3394a5b4b4827deece722e0c..8de503cc4d55423ae0bd070867c0 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1720,9 +1720,22 @@ static void usb_mtp_write_metadata(MTPState *s, uint64_t dlen)
assert(!s->write_pending);
assert(p != NULL);
+/*
+ * We are about to access a packed struct. We are confident that the pointer
+ * address won't be unaligned, so we ignore GCC warnings.
+ */
+#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
+#endif
+
filename = utf16_to_str(MIN(dataset->length, filename_chars),
dataset->filename);
+#if defined(CONFIG_PRAGMA_DIAGNOSTIC_AVAILABLE) && QEMU_GNUC_PREREQ(9, 0)
+#pragma GCC diagnostic pop
+#endif
+
if (strchr(filename, '/')) {
usb_mtp_queue_result(s, RES_PARAMETER_NOT_SUPPORTED, d->trans,
0, 0, 0, 0);
++++++ hw-usb-hcd-xhci-Fix-GCC-9-build-warning.patch ++++++
From: Alistair Francis
Date: Sat, 4 May 2019 07:58:35 -0600
Subject: hw/usb/hcd-xhci: Fix GCC 9 build warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix this build warning with GCC 9 on Fedora 30:
hw/usb/hcd-xhci.c:3339:66: error: %d directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Werror=format-truncation=]
3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1);
| ^~
hw/usb/hcd-xhci.c:3339:54: note: directive argument in the range [1, 2147483647]
3339 | snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1);
| ^~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from /home/alistair/qemu/include/qemu/osdep.h:99,
from hw/usb/hcd-xhci.c:21:
/usr/include/bits/stdio2.h:67:10: note: __builtin___snprintf_chk output between 13 and 22 bytes into a destination of size 16
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Alistair Francis
Signed-off-by: Bruce Rogers
---
hw/usb/hcd-xhci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 5894a186633414970fe748dbd9f4..47ea8dd3a5f6a09e361f0f59c7b9 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3324,6 +3324,7 @@ static void usb_xhci_init(XHCIState *xhci)
usb_bus_new(&xhci->bus, sizeof(xhci->bus), &xhci_bus_ops, dev);
for (i = 0; i < usbports; i++) {
+ g_assert(i < MAX(MAXPORTS_2, MAXPORTS_3));
speedmask = 0;
if (i < xhci->numports_2) {
if (xhci_get_flag(xhci, XHCI_FLAG_SS_FIRST)) {
++++++ i8254-Fix-migration-from-SLE11-SP2.patch ++++++
From: =?UTF-8?q?Andreas=20F=C3=A4rber?=
Date: Wed, 31 Jul 2013 17:05:29 +0200
Subject: i8254: Fix migration from SLE11 SP2
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
References: bnc#812836
qemu-kvm 0.15 had a VMSTATE_UINT32(flags, PITState) field that
qemu 1.4 does not have.
Signed-off-by: Andreas Färber
---
hw/timer/i8254_common.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/timer/i8254_common.c b/hw/timer/i8254_common.c
index 76ca6ec4446998f62d384a909814..fb9d5047f8c50df8ad0e662a42ac 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -261,6 +261,12 @@ static int pit_dispatch_post_load(void *opaque, int version_id)
return 0;
}
+static bool is_qemu_kvm(void *opaque, int version_id)
+{
+ /* HACK: We ignore incoming migration from upstream qemu */
+ return version_id < 3;
+}
+
static const VMStateDescription vmstate_pit_common = {
.name = "i8254",
.version_id = 3,
@@ -270,6 +276,7 @@ static const VMStateDescription vmstate_pit_common = {
.pre_save = pit_dispatch_pre_save,
.post_load = pit_dispatch_post_load,
.fields = (VMStateField[]) {
+ VMSTATE_UNUSED_TEST(is_qemu_kvm, 4),
VMSTATE_UINT32_V(channels[0].irq_disabled, PITCommonState, 3),
VMSTATE_STRUCT_ARRAY(channels, PITCommonState, 3, 2,
vmstate_pit_channel, PITChannelState),
++++++ increase-x86_64-physical-bits-to-42.patch ++++++
From: Bruce Rogers
Date: Fri, 17 May 2013 16:49:58 -0600
Subject: increase x86_64 physical bits to 42
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Allow for guests with higher amounts of ram. The current thought
is that 2TB specified on qemu commandline would be an appropriate
limit. Note that this requires the next higher bit value since
the highest address is actually more than 2TB due to the pci
memory hole.
Signed-off-by: Bruce Rogers
Signed-off-by: Andreas Färber
---
target/i386/cpu.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/cpu.h b/target/i386/cpu.h
index 8b3dc5533e6994bf9066f88f1a5e..3440f1e4297940d8db2e533d5cb1 100644
--- a/target/i386/cpu.h
+++ b/target/i386/cpu.h
@@ -1713,7 +1713,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);
/* XXX: This value should match the one returned by CPUID
* and in exec.c */
# if defined(TARGET_X86_64)
-# define TCG_PHYS_ADDR_BITS 40
+# define TCG_PHYS_ADDR_BITS 42
# else
# define TCG_PHYS_ADDR_BITS 36
# endif
++++++ ipxe-Makefile-fix-issues-of-build-reprod.patch ++++++
From: Bruce Rogers
Date: Thu, 27 Jun 2019 10:15:24 -0600
Subject: ipxe:Makefile: fix issues of build reproducibility
References: bsc#1011213
It is desirable to produce the same bits on subsequent
builds when the actual code of the package doesn't
change. (bsc#1011213)
Signed-off-by: Bruce Rogers
---
src/Makefile.housekeeping | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/roms/ipxe/src/Makefile.housekeeping b/roms/ipxe/src/Makefile.housekeeping
index f8334921b8b93cbd03f0a0de9910..97fa325bb52314e05192d0414436 100644
--- a/roms/ipxe/src/Makefile.housekeeping
+++ b/roms/ipxe/src/Makefile.housekeeping
@@ -1162,11 +1162,18 @@ blib : $(BLIB)
# Command to generate build ID. Must be unique for each $(BIN)/%.tmp,
# even within the same build run.
#
-BUILD_ID_CMD := perl -e 'printf "0x%08x", int ( rand ( 0xffffffff ) );'
+# NB: In the case of the SUSE qemu-ipxe package we want reproducible
+# builds, so we just use the TGT_ROM_NAME variable, which is already
+# a unique (in the context of the files we generate) hex value suitable
+# for specifying the build_id. We no longer define a BUILD_ID_CMD, as
+# we need to use the TGT_ROM_NAME variable directly in the link command
# Build timestamp
#
-BUILD_TIMESTAMP := $(shell date +%s)
+# NB: In the case of the SUSE qemu-ipxe package we want reproducible
+# builds, so we use a pre-determined timestamp, rather than the current
+# timestamp
+BUILD_TIMESTAMP := $(PACKAGING_TIMESTAMP)
# Build version
#
@@ -1186,7 +1193,7 @@ $(BIN)/version.%.o : core/version.c $(MAKEDEPS) $(GIT_INDEX)
$(BIN)/%.tmp : $(BIN)/version.%.o $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
$(QM)$(ECHO) " [LD] $@"
$(Q)$(LD) $(LDFLAGS) -T $(LDSCRIPT) $(TGT_LD_FLAGS) $< $(BLIB) -o $@ \
- --defsym _build_id=`$(BUILD_ID_CMD)` \
+ --defsym _build_id=`$(PRINTF) "0x%b" "$(TGT_ROM_NAME)"` \
--defsym _build_timestamp=$(BUILD_TIMESTAMP) \
-Map $(BIN)/$*.tmp.map
$(Q)$(OBJDUMP) -ht $@ | $(PERL) $(SORTOBJDUMP) >> $(BIN)/$*.tmp.map
++++++ linux-user-Fake-proc-cpuinfo.patch ++++++
From: Alexander Graf
Date: Mon, 23 Jul 2012 10:24:14 +0200
Subject: linux-user: Fake /proc/cpuinfo
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fedora 17 for ARM reads /proc/cpuinfo and fails if it doesn't contain
ARM related contents. This patch implements a quick hack to expose real
/proc/cpuinfo data taken from a real world machine.
The real fix would be to generate at least the flags automatically based
on the selected CPU. Please do not submit this patch upstream until this
has happened.
Signed-off-by: Alexander Graf
[AF: Rebased for v1.6 and v1.7]
Signed-off-by: Andreas Färber
---
linux-user/syscall.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index cf5de07a09235e6d92735332dc7f..3bb2c8921fc203264bbc0a37fe1d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6958,6 +6958,27 @@ static int open_self_stat(void *cpu_env, int fd)
return 0;
}
+#if defined(TARGET_ARM)
+static int open_cpuinfo(void *cpu_env, int fd)
+{
+ dprintf(fd,
+"Processor : ARMv7 Processor rev 5 (v7l)\n"
+"BogoMIPS : 799.53\n"
+"Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3\n"
+"CPU implementer : 0x41\n"
+"CPU architecture: 7\n"
+"CPU variant : 0x2\n"
+"CPU part : 0xc08\n"
+"CPU revision : 5\n"
+"\n"
+"Hardware : Genesi Efika MX (Smarttop)\n"
+"Revision : 51030\n"
+"Serial : 0000000000000000\n");
+
+ return 0;
+}
+#endif
+
static int open_self_auxv(void *cpu_env, int fd)
{
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
@@ -7100,6 +7121,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(TARGET_SPARC)
{ "/proc/cpuinfo", open_cpuinfo, is_proc },
#endif
+#if defined(TARGET_ARM)
+ { "cpuinfo", open_cpuinfo, is_proc_myself },
+#endif
#if defined(TARGET_M68K)
{ "/proc/hardware", open_hardware, is_proc },
#endif
++++++ linux-user-add-binfmt-wrapper-for-argv-0.patch ++++++
From: Alexander Graf
Date: Fri, 30 Sep 2011 19:40:36 +0200
Subject: linux-user: add binfmt wrapper for argv[0] handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When using qemu's linux-user binaries through binfmt, argv[0] gets lost
along the execution because qemu only gets passed in the full file name
to the executable while argv[0] can be something completely different.
This breaks in some subtile situations, such as the grep and make test
suites.
This patch adds a wrapper binary called qemu-$TARGET-binfmt that can be
used with binfmt's P flag which passes the full path _and_ argv[0] to
the binfmt handler.
The binary would be smart enough to be versatile and only exist in the
system once, creating the qemu binary path names from its own argv[0].
However, this seemed like it didn't fit the make system too well, so
we're currently creating a new binary for each target archictecture.
CC: Reinhard Max
Signed-off-by: Alexander Graf
[AF: Rebased onto new Makefile infrastructure, twice]
[AF: Updated for aarch64 for v2.0.0-rc1]
[AF: Rebased onto Makefile changes for v2.1.0-rc0]
[AF: Rebased onto script rewrite for v2.7.0-rc2 - to be fixed]
Signed-off-by: Andreas Färber
---
Makefile.target | 13 +++++++++++++
linux-user/Makefile.objs | 2 ++
linux-user/binfmt.c | 42 ++++++++++++++++++++++++++++++++++++++++
3 files changed, 57 insertions(+)
diff --git a/Makefile.target b/Makefile.target
index 933b27453a1dbb9273e0a9ff2d58..6e401da667fe4295acec4dc11302 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -42,6 +42,10 @@ STPFILES=
# Makefile Tests
include $(SRC_PATH)/tests/tcg/Makefile.include
+ifdef CONFIG_LINUX_USER
+PROGS+=$(QEMU_PROG)-binfmt
+endif
+
config-target.h: config-target.h-timestamp
config-target.h-timestamp: config-target.mak
@@ -134,6 +138,8 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) \
obj-y += linux-user/
obj-y += gdbstub.o thunk.o
+obj-binfmt-y += linux-user/
+
endif #CONFIG_LINUX_USER
#########################################################
@@ -175,7 +181,11 @@ generated-files-y += config-devices.h
endif # CONFIG_SOFTMMU
+ifdef CONFIG_LINUX_USER
+dummy := $(call unnest-vars,,obj-y obj-binfmt-y)
+else
dummy := $(call unnest-vars,,obj-y)
+endif
all-obj-y := $(obj-y)
include $(SRC_PATH)/Makefile.objs
@@ -212,6 +222,9 @@ ifdef CONFIG_DARWIN
$(call quiet-command,SetFile -a C $@,"SETFILE","$(TARGET_DIR)$@")
endif
+$(QEMU_PROG)-binfmt: $(obj-binfmt-y)
+ $(call LINK,$^)
+
gdbstub-xml.c: $(TARGET_XML_FILES) $(SRC_PATH)/scripts/feature_to_c.sh
$(call quiet-command,rm -f $@ && $(SHELL) $(SRC_PATH)/scripts/feature_to_c.sh $@ $(TARGET_XML_FILES),"GEN","$(TARGET_DIR)$@")
diff --git a/linux-user/Makefile.objs b/linux-user/Makefile.objs
index d2f33beb5e52efce6adc7fb85b7f..ffc6b095e253d4c448000a974d4d 100644
--- a/linux-user/Makefile.objs
+++ b/linux-user/Makefile.objs
@@ -8,3 +8,5 @@ obj-$(TARGET_I386) += vm86.o
obj-$(TARGET_ARM) += arm/nwfpe/
obj-$(TARGET_ARM) += arm/semihost.o
obj-$(TARGET_AARCH64) += arm/semihost.o
+
+obj-binfmt-y = binfmt.o
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c
new file mode 100644
index 0000000000000000000000000000000000000000..cd1f513b334f3b263d9e4b5adb1981e376429fa6
--- /dev/null
+++ b/linux-user/binfmt.c
@@ -0,0 +1,42 @@
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+int main(int argc, char **argv, char **envp)
+{
+ char *binfmt;
+ char **new_argv;
+
+ /*
+ * Check if our file name ends with -binfmt
+ */
+ binfmt = argv[0] + strlen(argv[0]) - strlen("-binfmt");
+ if (strcmp(binfmt, "-binfmt")) {
+ fprintf(stderr, "%s: Invalid executable name\n", argv[0]);
+ exit(1);
+ }
+ if (argc < 3) {
+ fprintf(stderr, "%s: Please use me through binfmt with P flag\n",
+ argv[0]);
+ exit(1);
+ }
+
+ binfmt[0] = '\0';
+ /* Now argv[0] is the real qemu binary name */
+
+ new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv));
+ if (argc > 3) {
+ memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv));
+ }
+ new_argv[0] = argv[0];
+ new_argv[1] = (char *)"-0";
+ new_argv[2] = argv[2];
+ new_argv[3] = argv[1];
+ new_argv[argc + 1] = NULL;
+
+ return execve(new_argv[0], new_argv, envp);
+}
++++++ linux-user-binfmt-support-host-binaries.patch ++++++
From: Alexander Graf
Date: Thu, 2 Feb 2012 18:02:33 +0100
Subject: linux-user: binfmt: support host binaries
When we have a working host binary equivalent for the guest binary we're
trying to run, let's just use that instead as it will be a lot faster.
Signed-off-by: Alexander Graf
---
linux-user/binfmt.c | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/linux-user/binfmt.c b/linux-user/binfmt.c
index cd1f513b334f3b263d9e4b5adb19..458f136fb41727702854cae4e542 100644
--- a/linux-user/binfmt.c
+++ b/linux-user/binfmt.c
@@ -5,6 +5,9 @@
#include
#include
+#ifdef __x86_64__
+#define ARCH_NAME "x86_64"
+#endif
int main(int argc, char **argv, char **envp)
{
@@ -28,6 +31,29 @@ int main(int argc, char **argv, char **envp)
binfmt[0] = '\0';
/* Now argv[0] is the real qemu binary name */
+#ifdef ARCH_NAME
+ {
+ char *hostbin;
+ char *guestarch;
+ int r;
+
+ guestarch = strrchr(argv[0], '-') ;
+ if (!guestarch) {
+ goto skip;
+ }
+ guestarch++;
+ r = asprintf(&hostbin, "/emul/" ARCH_NAME "-for-%s/%s", guestarch, argv[1]);
+ if ((r > 0) && !access(hostbin, X_OK)) {
+ /*
+ * We found a host binary replacement for the non-host binary. Let's
+ * use that instead!
+ */
+ return execve(hostbin, &argv[2], envp);
+ }
+ }
+skip:
+#endif
+
new_argv = (char **)malloc((argc + 2) * sizeof(*new_argv));
if (argc > 3) {
memcpy(&new_argv[4], &argv[3], (argc - 3) * sizeof(*new_argv));
++++++ linux-user-lseek-explicitly-cast-non-set.patch ++++++
From: Alexander Graf
Date: Thu, 13 Dec 2012 14:29:22 +0100
Subject: linux-user: lseek: explicitly cast non-set offsets to signed
When doing lseek, SEEK_SET indicates that the offset is an unsigned variable.
Other seek types have parameters that can be negative.
When converting from 32bit to 64bit parameters, we need to take this into
account and enable SEEK_END and SEEK_CUR to be negative, while SEEK_SET stays
absolute positioned which we need to maintain as unsigned.
Signed-off-by: Alexander Graf
---
linux-user/syscall.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8aa653262154326beced64bbe782..5360786be3466c44554b373b4238 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7619,8 +7619,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_ulong arg1,
return ret;
#endif
#ifdef TARGET_NR_lseek
- case TARGET_NR_lseek:
- return get_errno(lseek(arg1, arg2, arg3));
+ case TARGET_NR_lseek: {
+ off_t off = arg2;
+ if (arg3 != SEEK_SET) {
+ off = (abi_long)arg2;
+ }
+ return get_errno(lseek(arg1, off, arg3));
+ }
#endif
#if defined(TARGET_NR_getxpid) && defined(TARGET_ALPHA)
/* Alpha specific */
++++++ linux-user-properly-test-for-infinite-ti.patch ++++++
From: Andreas Schwab
Date: Thu, 8 Sep 2016 11:21:05 +0200
Subject: linux-user: properly test for infinite timeout in poll (#8)
After "linux-user: use target_ulong" the poll syscall was no longer
handling infinite timeout.
/home/abuild/rpmbuild/BUILD/qemu-2.7.0-rc5/linux-user/syscall.c:9773:26: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if (arg3 >= 0) {
^~
Signed-off-by: Andreas Schwab
---
linux-user/syscall.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5360786be3466c44554b373b4238..330fbecb120ebc9ebc1c0ec121f6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9646,7 +9646,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_ulong arg1,
{
struct timespec ts, *pts;
- if (arg3 >= 0) {
+ if ((abi_long)arg3 >= 0) {
/* Convert ms to secs, ns */
ts.tv_sec = arg3 / 1000;
ts.tv_nsec = (arg3 % 1000) * 1000000LL;
++++++ linux-user-use-target_ulong.patch ++++++
From: Alexander Graf
Date: Tue, 9 Oct 2012 09:06:49 +0200
Subject: linux-user: use target_ulong
Linux syscalls pass pointers or data length or other information of that sort
to the kernel. This is all stuff you don't want to have sign extended.
Otherwise a host 64bit variable parameter with a size parameter will extend
it to a negative number, breaking lseek for example.
Pass syscall arguments as ulong always.
Signed-off-by: Alexander Graf
---
linux-user/qemu.h | 8 ++++----
linux-user/syscall.c | 18 +++++++++---------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index aac0334627003fbf375dfd4c88d0..abd0b4569699ff87d015c951e651 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -207,10 +207,10 @@ abi_long memcpy_to_target(abi_ulong dest, const void *src,
void target_set_brk(abi_ulong new_brk);
abi_long do_brk(abi_ulong new_brk);
void syscall_init(void);
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
- abi_long arg2, abi_long arg3, abi_long arg4,
- abi_long arg5, abi_long arg6, abi_long arg7,
- abi_long arg8);
+abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1,
+ abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
+ abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
+ abi_ulong arg8);
void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
extern __thread CPUState *thread_cpu;
void cpu_loop(CPUArchState *env);
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 3bb2c8921fc203264bbc0a37fe1d..8aa653262154326beced64bbe782 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -7264,10 +7264,10 @@ static int host_to_target_cpu_mask(const unsigned long *host_mask,
* of syscall results, can be performed.
* All errnos that do_syscall() returns must be -TARGET_<errcode>.
*/
-static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
- abi_long arg2, abi_long arg3, abi_long arg4,
- abi_long arg5, abi_long arg6, abi_long arg7,
- abi_long arg8)
+static abi_long do_syscall1(void *cpu_env, int num, abi_ulong arg1,
+ abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
+ abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
+ abi_ulong arg8)
{
CPUState *cpu = env_cpu(cpu_env);
abi_long ret;
@@ -10013,7 +10013,7 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
*/
ret = -TARGET_EINVAL;
if (cpu_isar_feature(aa64_sve, env_archcpu(cpu_env))
- && arg2 >= 0 && arg2 <= 512 * 16 && !(arg2 & 15)) {
+ && arg2 <= 512 * 16 && !(arg2 & 15)) {
CPUARMState *env = cpu_env;
ARMCPU *cpu = env_archcpu(env);
uint32_t vq, old_vq;
@@ -11993,10 +11993,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
return ret;
}
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
- abi_long arg2, abi_long arg3, abi_long arg4,
- abi_long arg5, abi_long arg6, abi_long arg7,
- abi_long arg8)
+abi_long do_syscall(void *cpu_env, int num, abi_ulong arg1,
+ abi_ulong arg2, abi_ulong arg3, abi_ulong arg4,
+ abi_ulong arg5, abi_ulong arg6, abi_ulong arg7,
+ abi_ulong arg8)
{
CPUState *cpu = env_cpu(cpu_env);
abi_long ret;
++++++ memory-Provide-an-equality-function-for-.patch ++++++
From: "Dr. David Alan Gilbert"
Date: Wed, 14 Aug 2019 18:55:34 +0100
Subject: memory: Provide an equality function for MemoryRegionSections
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 9366cf02e4e31c2a8128904d4d8290a0fad5f888
Provide a comparison function that checks all the fields are the same.
Signed-off-by: Dr. David Alan Gilbert
Reviewed-by: Philippe Mathieu-Daudé
Message-Id: <20190814175535.2023-3-dgilbert@redhat.com>
Reviewed-by: Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin
Signed-off-by: Bruce Rogers
---
include/exec/memory.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index bb0961ddb96788539e7138d4f5b3..25bc7ef1adc04d6de1ce1a41a38a 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -496,6 +496,18 @@ struct MemoryRegionSection {
bool nonvolatile;
};
+static inline bool MemoryRegionSection_eq(MemoryRegionSection *a,
+ MemoryRegionSection *b)
+{
+ return a->mr == b->mr &&
+ a->fv == b->fv &&
+ a->offset_within_region == b->offset_within_region &&
+ a->offset_within_address_space == b->offset_within_address_space &&
+ int128_eq(a->size, b->size) &&
+ a->readonly == b->readonly &&
+ a->nonvolatile == b->nonvolatile;
+}
+
/**
* memory_region_init: Initialize a memory region
*
++++++ mirror-Keep-mirror_top_bs-drained-after-.patch ++++++
From: Kevin Wolf
Date: Mon, 22 Jul 2019 17:44:27 +0200
Subject: mirror: Keep mirror_top_bs drained after dropping permissions
Git-commit: d2da5e288a2e71e82866c8fdefd41b5727300124
mirror_top_bs is currently implicitly drained through its connection to
the source or the target node. However, the drain section for target_bs
ends early after moving mirror_top_bs from src to target_bs, so that
requests can already be restarted while mirror_top_bs is still present
in the chain, but has dropped all permissions and therefore runs into an
assertion failure like this:
qemu-system-x86_64: block/io.c:1634: bdrv_co_write_req_prepare:
Assertion `child->perm & BLK_PERM_WRITE' failed.
Keep mirror_top_bs drained until all graph changes have completed.
Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Signed-off-by: Bruce Rogers
---
block/mirror.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/mirror.c b/block/mirror.c
index 9f5c59ece1df391babc4461f63cb..642d6570cc97e1239b119a46c457 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -656,7 +656,10 @@ static int mirror_exit_common(Job *job)
s->target = NULL;
/* We don't access the source any more. Dropping any WRITE/RESIZE is
- * required before it could become a backing file of target_bs. */
+ * required before it could become a backing file of target_bs. Not having
+ * these permissions any more means that we can't allow any new requests on
+ * mirror_top_bs from now on, so keep it drained. */
+ bdrv_drained_begin(mirror_top_bs);
bs_opaque->stop = true;
bdrv_child_refresh_perms(mirror_top_bs, mirror_top_bs->backing,
&error_abort);
@@ -724,6 +727,7 @@ static int mirror_exit_common(Job *job)
bs_opaque->job = NULL;
bdrv_drained_end(src);
+ bdrv_drained_end(mirror_top_bs);
s->in_drain = false;
bdrv_unref(mirror_top_bs);
bdrv_unref(src);
++++++ pc-bios-s390-ccw-net-avoid-warning-about.patch ++++++
From: Bruce Rogers
Date: Wed, 29 May 2019 09:59:02 -0600
Subject: pc-bios/s390-ccw/net: avoid warning about packed structure members
This is hopefully temporary. Simply disable the warning about taking
the address of packed structure members which is new in gcc9.
Signed-off-by: Bruce Rogers
---
pc-bios/s390-ccw/netboot.mak | 1 +
1 file changed, 1 insertion(+)
diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak
index 5eefb7c289395ca37fcd241ce53d..ea2994722cde7e8a65796d374dc7 100644
--- a/pc-bios/s390-ccw/netboot.mak
+++ b/pc-bios/s390-ccw/netboot.mak
@@ -53,6 +53,7 @@ libc.a: $(LIBCOBJS)
LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
LIBNETCFLAGS := $(QEMU_CFLAGS) $(CFLAGS) -DDHCPARCH=0x1F $(LIBC_INC) $(LIBNET_INC)
+LIBNETCFLAGS += -Wno-address-of-packed-member
%.o : $(SLOF_DIR)/lib/libnet/%.c
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
++++++ pr-manager-Fix-invalid-g_free-crash-bug.patch ++++++
From: Markus Armbruster
Date: Thu, 22 Aug 2019 15:38:46 +0200
Subject: pr-manager: Fix invalid g_free() crash bug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 6b9d62c2a9e83bbad73fb61406f0ff69b46ff6f3
pr_manager_worker() passes its @opaque argument to g_free(). Wrong;
it points to pr_manager_worker()'s automatic @data. Broken when
commit 2f3a7ab39be converted @data from heap- to stack-allocated. Fix
by deleting the g_free().
Fixes: 2f3a7ab39bec4ba8022dc4d42ea641165b004e3e
Cc: qemu-stable@nongnu.org
Signed-off-by: Markus Armbruster
Reviewed-by: Philippe Mathieu-Daudé
Acked-by: Paolo Bonzini
Signed-off-by: Kevin Wolf
Signed-off-by: Bruce Rogers
---
scsi/pr-manager.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/scsi/pr-manager.c b/scsi/pr-manager.c
index ee43663576ed32c3d27649157e83..0c866e869835930767dacd3a0b21 100644
--- a/scsi/pr-manager.c
+++ b/scsi/pr-manager.c
@@ -39,7 +39,6 @@ static int pr_manager_worker(void *opaque)
int fd = data->fd;
int r;
- g_free(data);
trace_pr_manager_run(fd, hdr->cmdp[0], hdr->cmdp[1]);
/* The reference was taken in pr_manager_execute. */
++++++ qcow2-Fix-the-calculation-of-the-maximum.patch ++++++
From: Alberto Garcia
Date: Fri, 16 Aug 2019 15:17:42 +0300
Subject: qcow2: Fix the calculation of the maximum L2 cache size
Git-commit: b70d08205b2e4044c529eefc21df2c8ab61b473b
The size of the qcow2 L2 cache defaults to 32 MB, which can be easily
larger than the maximum amount of L2 metadata that the image can have.
For example: with 64 KB clusters the user would need a qcow2 image
with a virtual size of 256 GB in order to have 32 MB of L2 metadata.
Because of that, since commit b749562d9822d14ef69c9eaa5f85903010b86c30
we forbid the L2 cache to become larger than the maximum amount of L2
metadata for the image, calculated using this formula:
uint64_t max_l2_cache = virtual_disk_size / (s->cluster_size / 8);
The problem with this formula is that the result should be rounded up
to the cluster size because an L2 table on disk always takes one full
cluster.
For example, a 1280 MB qcow2 image with 64 KB clusters needs exactly
160 KB of L2 metadata, but we need 192 KB on disk (3 clusters) even if
the last 32 KB of those are not going to be used.
However QEMU rounds the numbers down and only creates 2 cache tables
(128 KB), which is not enough for the image.
A quick test doing 4KB random writes on a 1280 MB image gives me
around 500 IOPS, while with the correct cache size I get 16K IOPS.
Cc: qemu-stable@nongnu.org
Signed-off-by: Alberto Garcia
Signed-off-by: Kevin Wolf
Signed-off-by: Bruce Rogers
---
block/qcow2.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/block/qcow2.c b/block/qcow2.c
index 039bdc2f7e799f935f5364daed5c..865839682cd639d1b7aba0cc328f 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -826,7 +826,11 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts,
bool l2_cache_entry_size_set;
int min_refcount_cache = MIN_REFCOUNT_CACHE_SIZE * s->cluster_size;
uint64_t virtual_disk_size = bs->total_sectors * BDRV_SECTOR_SIZE;
- uint64_t max_l2_cache = virtual_disk_size / (s->cluster_size / 8);
+ uint64_t max_l2_entries = DIV_ROUND_UP(virtual_disk_size, s->cluster_size);
+ /* An L2 table is always one cluster in size so the max cache size
+ * should be a multiple of the cluster size. */
+ uint64_t max_l2_cache = ROUND_UP(max_l2_entries * sizeof(uint64_t),
+ s->cluster_size);
combined_cache_size_set = qemu_opt_get(opts, QCOW2_OPT_CACHE_SIZE);
l2_cache_size_set = qemu_opt_get(opts, QCOW2_OPT_L2_CACHE_SIZE);
++++++ qemu-4.0.0.tar.xz -> qemu-4.1.0.tar.xz ++++++
/work/SRC/openSUSE:Factory/qemu/qemu-4.0.0.tar.xz /work/SRC/openSUSE:Factory/.qemu.new.2352/qemu-4.1.0.tar.xz differ: char 26, line 1
++++++ qemu-binfmt-conf-Modify-default-path.patch ++++++
From: =?UTF-8?q?Andreas=20F=C3=A4rber?=
Date: Wed, 10 Aug 2016 19:00:24 +0200
Subject: qemu-binfmt-conf: Modify default path
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Change QEMU_PATH from /usr/local/bin to /usr/bin prefix.
Signed-off-by: Andreas Färber
---
scripts/qemu-binfmt-conf.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index b5a16742a149c0d2e08c6a34d08e..4f1358e2fd8c0da34cf06a763ca8 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -319,7 +319,7 @@ BINFMT_SET=qemu_register_interpreter
SYSTEMDDIR="/etc/binfmt.d"
DEBIANDIR="/usr/share/binfmts"
-QEMU_PATH=/usr/local/bin
+QEMU_PATH=/usr/bin
CREDENTIAL=no
PERSISTENT=no
QEMU_SUFFIX=""
++++++ qemu-binfmt-conf-use-qemu-ARCH-binfmt.patch ++++++
From: Andreas Schwab
Date: Fri, 12 Aug 2016 18:20:49 +0200
Subject: qemu-binfmt-conf: use qemu-ARCH-binfmt
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Andreas Schwab
Signed-off-by: Andreas Färber
---
scripts/qemu-binfmt-conf.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 4f1358e2fd8c0da34cf06a763ca8..13add7775eb7d24c52735b02cd51 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -262,7 +262,7 @@ qemu_generate_register() {
flags="${flags}F"
fi
- echo ":qemu-$cpu:M::$magic:$mask:$qemu:$flags"
+ echo ":qemu-$cpu:M::$magic:$mask:$qemu:P$flags"
}
qemu_register_interpreter() {
@@ -301,9 +301,9 @@ qemu_set_binfmts() {
continue
fi
- qemu="$QEMU_PATH/qemu-$cpu"
+ qemu="$QEMU_PATH/qemu-$cpu-binfmt"
if [ "$cpu" = "i486" ] ; then
- qemu="$QEMU_PATH/qemu-i386"
+ qemu="$QEMU_PATH/qemu-i386-binfmt"
fi
qemu="$qemu$QEMU_SUFFIX"
++++++ qemu-bridge-helper-reduce-security-profi.patch ++++++
From: Bruce Rogers
Date: Tue, 2 Aug 2016 11:36:02 -0600
Subject: qemu-bridge-helper: reduce security profile
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
References: boo#988279
Change from using glib alloc and free routines to those
from libc. Also perform safety measure of dropping privs
to user if configured no-caps.
Signed-off-by: Bruce Rogers
[AF: Rebased for v2.7.0-rc2]
Signed-off-by: Andreas Färber
---
qemu-bridge-helper.c | 28 +++++++++++++++++++++++++---
1 file changed, 25 insertions(+), 3 deletions(-)
diff --git a/qemu-bridge-helper.c b/qemu-bridge-helper.c
index 3d50ec094c794b9c0835628f10c5..f2291b398f8e4589f649af226dba 100644
--- a/qemu-bridge-helper.c
+++ b/qemu-bridge-helper.c
@@ -123,7 +123,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
}
if (strcmp(cmd, "deny") == 0) {
- acl_rule = g_malloc(sizeof(*acl_rule));
+ acl_rule = calloc(1, sizeof(*acl_rule));
+ if (!acl_rule) {
+ fclose(f);
+ errno = ENOMEM;
+ return -1;
+ }
if (strcmp(arg, "all") == 0) {
acl_rule->type = ACL_DENY_ALL;
} else {
@@ -132,7 +137,12 @@ static int parse_acl_file(const char *filename, ACLList *acl_list)
}
QSIMPLEQ_INSERT_TAIL(acl_list, acl_rule, entry);
} else if (strcmp(cmd, "allow") == 0) {
- acl_rule = g_malloc(sizeof(*acl_rule));
+ acl_rule = calloc(1, sizeof(*acl_rule));
+ if (!acl_rule) {
+ fclose(f);
+ errno = ENOMEM;
+ return -1;
+ }
if (strcmp(arg, "all") == 0) {
acl_rule->type = ACL_ALLOW_ALL;
} else {
@@ -433,6 +443,18 @@ int main(int argc, char **argv)
goto cleanup;
}
+#ifndef CONFIG_LIBCAP
+ /*
+ * avoid sending the fd as root user if running suid to not fool
+ * peer credentials to daemons that dont expect that
+ */
+ if (setuid(getuid()) < 0) {
+ fprintf(stderr, "Failed to drop privileges.\n");
+ ret = EXIT_FAILURE;
+ goto cleanup;
+ }
+#endif
+
/* write fd to the domain socket */
if (send_fd(unixfd, fd) == -1) {
fprintf(stderr, "failed to write fd to unix socket: %s\n",
@@ -454,7 +476,7 @@ cleanup:
}
while ((acl_rule = QSIMPLEQ_FIRST(&acl_list)) != NULL) {
QSIMPLEQ_REMOVE_HEAD(&acl_list, entry);
- g_free(acl_rule);
+ free(acl_rule);
}
return ret;
++++++ qemu-cvs-gettimeofday.patch ++++++
From: Ulrich Hecht
Date: Tue, 14 Apr 2009 16:25:41 +0200
Subject: qemu-cvs-gettimeofday
No clue what this is for.
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers
---
linux-user/syscall.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8367cb138dfe075e06ca455009cc..17914fadfc9f3390d4b8ab8d74a6 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8446,6 +8446,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
case TARGET_NR_gettimeofday:
{
struct timeval tv;
+ if (copy_from_user_timeval(&tv, arg1)) {
+ return -TARGET_EFAULT;
+ }
ret = get_errno(gettimeofday(&tv, NULL));
if (!is_error(ret)) {
if (copy_to_user_timeval(arg1, &tv))
++++++ qemu-cvs-ioctl_debug.patch ++++++
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: qemu-cvs-ioctl_debug
Extends unsupported ioctl debug output.
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers
---
linux-user/syscall.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 17914fadfc9f3390d4b8ab8d74a6..25fd641816c0a54e49a167f5e818 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5043,7 +5043,19 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
- gemu_log("Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
+ int i;
+ gemu_log("Unsupported ioctl: cmd=0x%04lx (%x)\n", (unsigned long)cmd,
+ (unsigned int)(cmd & (TARGET_IOC_SIZEMASK << TARGET_IOC_SIZESHIFT))
+ >> TARGET_IOC_SIZESHIFT);
+ for (i = 0; ioctl_entries[i].target_cmd; i++) {
+ if ((ioctl_entries[i].target_cmd & ~(TARGET_IOC_SIZEMASK
+ << TARGET_IOC_SIZESHIFT)) == (cmd & ~(TARGET_IOC_SIZEMASK <<
+ TARGET_IOC_SIZESHIFT)))
+ gemu_log("%p\t->\t%s (%x)\n", (void *)(unsigned long)
+ ioctl_entries[i].host_cmd, ioctl_entries[i].name,
+ (ioctl_entries[i].target_cmd & (TARGET_IOC_SIZEMASK
+ << TARGET_IOC_SIZESHIFT)) >> TARGET_IOC_SIZESHIFT);
+ }
return -TARGET_ENOSYS;
}
if (ie->target_cmd == cmd)
++++++ qemu-cvs-ioctl_nodirection.patch ++++++
From: Alexander Graf
Date: Tue, 14 Apr 2009 16:27:36 +0200
Subject: qemu-cvs-ioctl_nodirection
the direction given in the ioctl should be correct so we can assume the
communication is uni-directional. The alsa developers did not like this
concept though and declared ioctls IOC_R and IOC_W even though they were
IOC_RW.
Signed-off-by: Alexander Graf
Signed-off-by: Ulrich Hecht
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers
---
linux-user/syscall.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 25fd641816c0a54e49a167f5e818..cf5de07a09235e6d92735332dc7f 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5084,6 +5084,13 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
arg_type++;
target_size = thunk_type_size(arg_type, 0);
switch(ie->access) {
+ /*
+ * FIXME: actually the direction given in the ioctl should be
+ * correct so we can assume the communication is uni-directional.
+ * The alsa developers did not like this concept though and
+ * declared ioctls IOC_R and IOC_W even though they were IOC_RW.
+ */
+/*
case IOC_R:
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
if (!is_error(ret)) {
@@ -5102,6 +5109,7 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
unlock_user(argptr, arg, 0);
ret = get_errno(safe_ioctl(fd, ie->host_cmd, buf_temp));
break;
+*/
default:
case IOC_RW:
argptr = lock_user(VERIFY_READ, arg, target_size, 1);
++++++ qemu.spec.in ++++++
++++ 1508 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/qemu/qemu.spec.in
++++ and /work/SRC/openSUSE:Factory/.qemu.new.2352/qemu.spec.in
++++++ roms-Makefile-pass-a-packaging-timestamp.patch ++++++
From: Bruce Rogers
Date: Sat, 19 Nov 2016 08:06:30 -0700
Subject: roms/Makefile: pass a packaging timestamp to subpackages with date
info
References: bsc#1011213
Certain rom subpackages build from qemu git-submodules call the date
program to include date information in the packaged binaries. This
causes repeated builds of the package to be different, wkere the only
real difference is due to the fact that time build timestamp has
changed. To promote reproducible builds and avoid customers being
prompted to update packages needlessly, we'll use the timestamp of the
VERSION file as the packaging timestamp for all packages that build in a
timestamp for whatever reason.
Signed-off-by: Bruce Rogers
---
roms/Makefile | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/roms/Makefile b/roms/Makefile
index 775c963f9dd55bfa17772afb73f4..6efeb1ef7c38fb71556b762d6bf1 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -51,6 +51,12 @@ SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
#
EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
+# NB: Certain SUSE qemu subpackages use date information, but we want
+# reproducible builds, so we use a pre-determined timestamp, rather
+# than the current timestamp to acheive consistent results build to
+# build.
+PACKAGING_TIMESTAMP = $(shell date -r ../VERSION +%s)
+
default:
@echo "nothing is build by default"
@echo "available build targets:"
@@ -99,7 +105,7 @@ build-seabios-config-%: config.%
.PHONY: sgabios skiboot
sgabios:
- $(MAKE) -C sgabios
+ $(MAKE) -C sgabios PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP)
cp sgabios/sgabios.bin ../pc-bios
@@ -119,11 +125,13 @@ efi-rom-%: build-pxe-roms build-efi-roms edk2-basetools
build-pxe-roms:
$(MAKE) -C ipxe/src CONFIG=qemu \
+ PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
CROSS_COMPILE=$(x86_64_cross_prefix) \
$(patsubst %,bin/%.rom,$(pxerom_targets))
build-efi-roms: build-pxe-roms
$(MAKE) -C ipxe/src CONFIG=qemu \
+ PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
CROSS_COMPILE=$(x86_64_cross_prefix) \
$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
@@ -145,7 +153,9 @@ edk2-basetools:
EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
slof:
- $(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
+ $(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) \
+ PACKAGING_TIMESTAMP=$(PACKAGING_TIMESTAMP) \
+ qemu
cp SLOF/boot_rom.bin ../pc-bios/slof.bin
u-boot.e500:
++++++ roms-Makefile.edk2-don-t-invoke-git-sinc.patch ++++++
From: Bruce Rogers
Date: Thu, 20 Jun 2019 18:45:36 -0600
Subject: roms/Makefile.edk2: don't invoke git, since the tarball is complete
Signed-off-by: Bruce Rogers
---
roms/Makefile.edk2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/Makefile.edk2 b/roms/Makefile.edk2
index c2f2ff59d5b1d8b3fa394ed42c8d..98328b883c6578dd9591f069cd2d 100644
--- a/roms/Makefile.edk2
+++ b/roms/Makefile.edk2
@@ -47,7 +47,7 @@ all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \
.INTERMEDIATE: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd)
submodules:
- cd edk2 && git submodule update --init --force
+ cd edk2
# See notes on the ".NOTPARALLEL" target and the "+" indicator in
# "tests/uefi-test-tools/Makefile".
++++++ roms-change-cross-compiler-naming-to-be-.patch ++++++
From: Bruce Rogers
Date: Thu, 20 Jun 2019 17:58:37 -0600
Subject: roms: change cross compiler naming to be suse specific
Signed-off-by: Bruce Rogers
---
roms/edk2-funcs.sh | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/roms/edk2-funcs.sh b/roms/edk2-funcs.sh
index a9fae7ee891bc4cadbe1a3cb3f54..d70bed1729cf0a3ce41ab72df78e 100644
--- a/roms/edk2-funcs.sh
+++ b/roms/edk2-funcs.sh
@@ -113,7 +113,15 @@ qemu_edk2_get_cross_prefix()
# no cross-compiler needed
:
else
- printf '%s-linux-gnu-\n' "$gcc_arch"
+ if [ "$emulation_target" == arm ]; then
+ printf '%s-suse-linux-gnueabi-\n' "$gcc_arch"
+ else
+ if [ "$gcc_arch" == i686 ]; then
+ printf '%s-suse-linux-\n' "i586"
+ else
+ printf '%s-suse-linux-\n' "$gcc_arch"
+ fi
+ fi
fi
}
++++++ roms-sgabios-Fix-csum8-to-be-built-by-ho.patch ++++++
From: Bruce Rogers
Date: Thu, 27 Jun 2019 09:38:43 -0600
Subject: roms/sgabios: Fix csum8 to be built by host compiler
Signed-off-by: Bruce Rogers
Date: Thu, 26 Sep 2019 10:10:36 -0400
Subject: s390: PCI: fix IOMMU region init
Git-commit: 7df1dac5f1c85312474df9cb3a8fcae72303da62
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
Signed-off-by: Bruce Rogers
---
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 2c6e084e2c2636b55980799b5837..9a935f22b5b06a67c8fbd7b6abb6 100644
--- a/hw/s390x/s390-pci-bus.c
+++ b/hw/s390x/s390-pci-bus.c
@@ -694,10 +694,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);
++++++ s390x-tcg-Fix-VERIM-with-32-64-bit-eleme.patch ++++++
From: David Hildenbrand
Date: Wed, 14 Aug 2019 17:12:42 +0200
Subject: s390x/tcg: Fix VERIM with 32/64 bit elements
Git-commit: 25bcb45d1b81d22634daa2b1a2d8bee746ac129b
Wrong order of operands. The constant always comes last. Makes QEMU crash
reliably on specific git fetch invocations.
Reported-by: Stefano Brivio
Signed-off-by: David Hildenbrand
Message-Id: <20190814151242.27199-1-david@redhat.com>
Reviewed-by: Cornelia Huck
Fixes: 5c4b0ab460ef ("s390x/tcg: Implement VECTOR ELEMENT ROTATE AND INSERT UNDER MASK")
Cc: qemu-stable@nongnu.org
Signed-off-by: Cornelia Huck
Signed-off-by: Bruce Rogers