SHA256
1
0
forked from pool/qemu

Accepting request 1006734 from home:dfaggioli:devel:Virtualization

- Runs of the test-suite seem much more stable now, in this version
  of QEMU. (bsc#1203610) We are also fine re-enabling running them
  in parallel.
- Switch QEMU Linux user to emulate the same CPU as the one of the
  host by default. This is a bit conrtoversial and tricky, when
  thinking about system emulation/virtualization. But for linux-user,
  it should be just fine. (bsc#1203684)
* Patches added:
  linux-user-use-max-as-default-CPU-model-.patch
- Be less verbose when packaging documentation. In fact, with just
  a couple of (minor) re-arrangements, we can get rid of having to
  list all the files all the time
- Package /etc/qemu/bridge.conf as '%config(noreplace). Next step
  will probably be to move it to /usr/etc/qemu (bsc#1201944)
- Switch to %autosetup for all products (this required some changes
  in update_git.sh)
- Run check-qtest sequentially, as it's more reliable, when in OBS
- Build with libbpf, fdt and capstone support
- Drop the patch adding our support document, and deal with that
  in the spec file directly
* Patches dropped:
  doc-add-our-support-doc-to-the-main-proj.patch
- Updated to latest upstream version 7.1
  * https://wiki.qemu.org/ChangeLog/7.1
  Be sure to also check the following pages:
  * https://qemu-project.gitlab.io/qemu/about/removed-features.html
  * https://qemu-project.gitlab.io/qemu/about/deprecated.html
  Some notable changes:
  * [x86] Support for architectural LBRs on KVM virtual machines
  * [x86] The libopcode-based disassembler has been removed. Use
          Capstone instead
  * [LoongArch] Add initial support for the LoongArch64 architecture.
  * [ARM] The emulated SMMUv3 now advertises support for SMMUv3.2-BBML2
  * [ARM] The xlnx-zynqmp SoC model now implements the 4 TTC timers
  * [ARM] The versal machine now models the Cortex-R5s in the Real-Time
          Processing Unit (RPU) subsystem
  * [ARM] The virt board now supports emulation of the GICv4.0
  * [ARM] New emulated CPU types: Cortex-A76, Neoverse-N1
  * [HPPA] Fix serial port pass-through from host to guest
  * [HPPA] Lots of general code improvements and tidy-ups
  * [RISC-V] RISC-V
  * [RISC-V] Add support for privileged spec version 1.12.0
  * [RISC-V] Use privileged spec version 1.12.0 for virt machine by default
  * [RISC-V] Allow software access to MIP SEIP
  * [RISC-V] Add initial support for the Sdtrig extension
  * [RISC-V] Optimisations and improvements for the vector extension
  * [VFIO] Experimental support for exposing emulated PCI devices over the
           new vfio-user protocol (a vfio-user client is not yet available
           in QEMU, though)
  * [QMP] The on-cbw-error option for copy-before-write filter, to specify
           behavior on CBW (copy before write) operation failure.
  * [QMP] The cbw-timeout option for copy-before-write filter, to specify
          timeout for CBW operation.
  * [QMP] New commands query-stats and query-stats-schema to retrieve
          statistics from various QEMU subsystems (right now only from
          KVM).
  * [QMP] The PanicAction can now be configured to report an exit-failure
          (useful for automated testing)
  * [Networking] QEMU can be compiled with the system slirp library even
                 when using CFI. This requires libslirp 4.7.
  * [Migration] Support for zero-copy-send on Linux, which reduces CPU
                usage on the source host. Note that locked memory is needed
                to support this
* Patches added:
  Revert-tests-qtest-enable-more-vhost-use.patch
  meson-remove-pkgversion-from-CONFIG_STAM.patch
* Patches dropped:
  AIO-Reduce-number-of-threads-for-32bit-h.patch
  Makefile-Don-t-check-pc-bios-as-pre-requ.patch
  Revert-8dcb404bff6d9147765d7dd3e9c849337.patch
  Revert-qht-constify-qht_statistics_init.patch
  XXX-dont-dump-core-on-sigabort.patch
  acpi_piix4-Fix-migration-from-SLE11-SP2.patch
  configure-only-populate-roms-if-softmmu.patch
  configure-remove-pkgversion-from-CONFIG_.patch
  coroutine-ucontext-use-QEMU_DEFINE_STATI.patch
  coroutine-use-QEMU_DEFINE_STATIC_CO_TLS.patch
  coroutine-win32-use-QEMU_DEFINE_STATIC_C.patch
  hostmem-default-the-amount-of-prealloc-t.patch
  hw-usb-hcd-ehci-fix-writeback-order.patch
  i8254-Fix-migration-from-SLE11-SP2.patch
  intc-exynos4210_gic-replace-snprintf-wit.patch
  modules-generates-per-target-modinfo.patch
  modules-introduces-module_kconfig-direct.patch
  pc-bios-s390-ccw-net-avoid-warning-about.patch
  pci-fix-overflow-in-snprintf-string-form.patch
  qemu-cvs-gettimeofday.patch
  qemu-cvs-ioctl_debug.patch
  qemu-cvs-ioctl_nodirection.patch
  qht-Revert-some-constification-in-qht.c.patch
  qom-handle-case-of-chardev-spice-module-.patch
  scsi-lsi53c895a-fix-use-after-free-in-ls.patch
  scsi-lsi53c895a-really-fix-use-after-fre.patch
  softmmu-Always-initialize-xlat-in-addres.patch
  sphinx-change-default-language-to-en.patch
  test-add-mapping-from-arch-of-i686-to-qe.patch
  tests-Fix-block-tests-to-be-compatible-w.patch
  tests-qtest-Move-the-fuzz-tests-to-x86-o.patch
  usb-Help-compiler-out-to-avoid-a-warning.patch

OBS-URL: https://build.opensuse.org/request/show/1006734
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=732
This commit is contained in:
Dario Faggioli 2022-09-29 06:46:40 +00:00 committed by Git OBS Bridge
parent cfd2438e0a
commit d58941a9c7
65 changed files with 503 additions and 2951 deletions

View File

@ -1,39 +0,0 @@
From: Alexander Graf <agraf@suse.de>
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 <agraf@suse.de>
---
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 d763cea505b68575af8e1b39cd95..785487b8767d96ca76c643f1851f 100644
--- a/util/thread-pool.c
+++ b/util/thread-pool.c
@@ -306,7 +306,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);

View File

@ -18,12 +18,12 @@ Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index e860b0edf275cd68cd24516cb1ca..ef1af9b109c1591e3bfda2cb4a56 100644
index be4b30dea248d75f477cc402ce8d..06a2015232fd920170a9f503be52 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -35,6 +35,10 @@ qtests_pci = \
(config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : []) + \
(config_all_devices.has_key('CONFIG_IVSHMEM_DEVICE') ? ['ivshmem-test'] : [])
@@ -39,6 +39,10 @@ qtests_pci = \
qtests_cxl = \
(config_all_devices.has_key('CONFIG_CXL') ? ['cxl-test'] : [])
+# display-vga-test currently fails in OBS, for ppc64
+qtests_pci_novga = \
@ -32,7 +32,7 @@ index e860b0edf275cd68cd24516cb1ca..ef1af9b109c1591e3bfda2cb4a56 100644
qtests_i386 = \
(slirp.found() ? ['pxe-test', 'test-netfilter'] : []) + \
(config_host.has_key('CONFIG_POSIX') ? ['test-filter-mirror'] : []) + \
@@ -171,7 +175,7 @@ qtests_ppc64 = \
@@ -167,7 +171,7 @@ qtests_ppc64 = \
(slirp.found() ? ['pxe-test'] : []) + \
(config_all_devices.has_key('CONFIG_USB_UHCI') ? ['usb-hcd-uhci-test'] : []) + \
(config_all_devices.has_key('CONFIG_USB_XHCI_NEC') ? ['usb-hcd-xhci-test'] : []) + \

View File

@ -94,10 +94,10 @@ index 0169d8dde4b533c9cf851831b03c..3b1495c0a4fd6b9e81f6703eeb49 100644
#include "qemu/cutils.h"
#include "monitor/monitor.h"
diff --git a/chardev/chardev-internal.h b/chardev/chardev-internal.h
index aba0240759ebf938cf391d89edb8..fb3957b771f9e24547619fd45669 100644
index 4e03af31476cb88cbe699dfafb23..ae5738ae4e3bd90ae703740a68da 100644
--- a/chardev/chardev-internal.h
+++ b/chardev/chardev-internal.h
@@ -36,6 +36,9 @@ struct MuxChardev {
@@ -37,6 +37,9 @@ struct MuxChardev {
Chardev parent;
CharBackend *backends[MAX_MUX];
CharBackend chr;

View File

@ -23,7 +23,7 @@ index b82a1b0c58c4490ffd0c7d083a44..26f9fb1382108787cc1b56546873 100755
# Migration Stream Analyzer
#
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index 539ead62b498202fc40b42bff05f..0b7d30eef392cd659dbd722d8bdc 100755
index b36938836026facea26c0e475579..cf08875c4a51dfe17902e802e76b 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -1,4 +1,4 @@

View File

@ -1,27 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Mon, 19 Oct 2020 15:05:15 -0600
Subject: Makefile: Don't check pc-bios as pre-requisite for config-host.mak
This check isn't needed when we know this is a fresh build, which of
course it is when we are building the qemu packages.
Signed-off-by: Bruce Rogers <brogers@suse.com>
[DF: Rebased on top of 6.2.0]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index e5fd1ebdf6199c4cb15780e90236..e5881a951fc05d479b032c0b56d8 100644
--- a/Makefile
+++ b/Makefile
@@ -87,7 +87,7 @@ x := $(shell rm -rf meson-private meson-info meson-logs)
endif
# 1. ensure config-host.mak is up-to-date
-config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/pc-bios $(SRC_PATH)/VERSION
+config-host.mak: $(SRC_PATH)/configure $(SRC_PATH)/scripts/meson-buildoptions.sh $(SRC_PATH)/VERSION
@echo config-host.mak is out-of-date, running configure
@if test -f meson-private/coredata.dat; then \
./config.status --skip-meson; \

View File

@ -14,10 +14,10 @@ Signed-off-by: Bruce Rogers <brogers@suse.com>
1 file changed, 2 insertions(+)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 4e1b27a20eccca027515aee6f78f..02aa7205a4992a678414111f625c 100644
index dc3c3e5f2e7071eb21e77f3d95c2..b89279889e13b9d1bc37440a67a8 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -2066,11 +2066,13 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
@@ -2077,11 +2077,13 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
return NULL;
}

View File

@ -16,10 +16,10 @@ Signed-off-by: Bruce Rogers <brogers@suse.com>
1 file changed, 12 insertions(+)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 6f646531a0aeb6ff2dd3fc8a5cd8..f0f2f190a4a84af95ccaac353bb1 100644
index 706bd7cff793dff6433c93dc6601..738736c50d90e7144743dfe0f61c 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -41,6 +41,7 @@
@@ -42,6 +42,7 @@
#include "sysemu/reset.h"
#include "sysemu/runstate.h"
#include "sysemu/runstate-action.h"
@ -27,7 +27,7 @@ index 6f646531a0aeb6ff2dd3fc8a5cd8..f0f2f190a4a84af95ccaac353bb1 100644
#include "sysemu/seccomp.h"
#include "sysemu/tcg.h"
#include "sysemu/xen.h"
@@ -2778,6 +2779,17 @@ void qemu_init(int argc, char **argv, char **envp)
@@ -2613,6 +2614,17 @@ void qemu_init(int argc, char **argv, char **envp)
MachineClass *machine_class;
bool userconfig = true;
FILE *vmstate_dump_file = NULL;

View File

@ -1,55 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Thu, 13 Aug 2020 13:07:56 -0600
Subject: Revert "qht: constify qht_statistics_init"
This reverts commit 6579f10779b5b5ed2e978e7b8cae7bcbf8665254.
This change partially addresses https://bugs.launchpad.net/qemu/+bug/1886155
where a pre-release gcc 11 warns about const qualifier abuse.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
include/qemu/qht.h | 2 +-
util/qht.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/qemu/qht.h b/include/qemu/qht.h
index 758c7ac6c89978ee762e9d946584..2e2d6bca932c83bea993850b60f8 100644
--- a/include/qemu/qht.h
+++ b/include/qemu/qht.h
@@ -211,7 +211,7 @@ void qht_iter_remove(struct qht *ht, qht_iter_bool_func_t func, void *userp);
* When done with @stats, pass the struct to qht_statistics_destroy().
* Failing to do this will leak memory.
*/
-void qht_statistics_init(const struct qht *ht, struct qht_stats *stats);
+void qht_statistics_init(struct qht *ht, struct qht_stats *stats);
/**
* qht_statistics_destroy - Destroy a &struct qht_stats
diff --git a/util/qht.c b/util/qht.c
index 065fc501f44c46dffac74134ee2c..0803c194d10b5cdafdc8b18ec083 100644
--- a/util/qht.c
+++ b/util/qht.c
@@ -902,9 +902,9 @@ bool qht_resize(struct qht *ht, size_t n_elems)
}
/* pass @stats to qht_statistics_destroy() when done */
-void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
+void qht_statistics_init(struct qht *ht, struct qht_stats *stats)
{
- const struct qht_map *map;
+ struct qht_map *map;
int i;
map = qatomic_rcu_read(&ht->map);
@@ -921,8 +921,8 @@ void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
stats->head_buckets = map->n_buckets;
for (i = 0; i < map->n_buckets; i++) {
- const struct qht_bucket *head = &map->buckets[i];
- const struct qht_bucket *b;
+ struct qht_bucket *head = &map->buckets[i];
+ struct qht_bucket *b;
unsigned int version;
size_t buckets;
size_t entries;

View File

@ -9,13 +9,14 @@ No need. In our build system submodules are checked out.
Signed-off-by: Bruce Rogers <brogers@suse.com>
[DF: Rebased on top of 6.2.0]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
roms/Makefile | 2 --
tests/uefi-test-tools/Makefile | 1 -
2 files changed, 3 deletions(-)
diff --git a/roms/Makefile b/roms/Makefile
index 3d53bd528666b594ab3d6b631450..c7c6e973db59572e8b8bee74e969 100644
index 0e652aff895fe0680cf35e43b299..fd2c5824787e1c983f6e66170a60 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -151,8 +151,6 @@ build-efi-roms: build-pxe-roms

View File

@ -1,6 +1,6 @@
From: Dario Faggioli <dfaggioli@suse.com>
Date: Tue, 24 May 2022 20:52:17 +0200
Subject: Revert 8dcb404bff6d9147765d7dd3e9c8493372186420
Subject: Revert "tests/qtest: enable more vhost-user tests by default"
Git-commit: 0000000000000000000000000000000000000000
@ -20,10 +20,10 @@ Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/tests/qtest/vhost-user-test.c b/tests/qtest/vhost-user-test.c
index ee30f54796485e1fb2cab1fe7641..6e79935c47e6f7fab9741cdf9e50 100644
index 8bf390be207cd2c016662c78f4a4..a4f7cc4359fac1bc6f556ef28810 100644
--- a/tests/qtest/vhost-user-test.c
+++ b/tests/qtest/vhost-user-test.c
@@ -995,17 +995,20 @@ static void register_vhost_user_test(void)
@@ -996,17 +996,20 @@ static void register_vhost_user_test(void)
"virtio-net",
test_migrate, &opts);

View File

@ -1,33 +0,0 @@
From: Alexander Graf <agraf@suse.de>
Date: Mon, 21 Nov 2011 23:50:36 +0100
Subject: XXX dont dump core on sigabort
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
linux-user/signal.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 092e70b80c6ffb83fc52ff6d6a0a..b918084cc769c9bc1d15fbfad792 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -737,6 +737,10 @@ static void QEMU_NORETURN dump_core_and_abort(int target_sig)
trace_user_dump_core_and_abort(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();
@@ -754,6 +758,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

View File

@ -1,30 +0,0 @@
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
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 <afaerber@suse.de>
---
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 fe5625d07a289800831170f7e41f..dd005ff2fc097f72947a62d91b96 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -287,7 +287,7 @@ static bool vmstate_test_migrate_acpi_index(void *opaque, int version_id)
static const VMStateDescription vmstate_acpi = {
.name = "piix4_pm",
.version_id = 3,
- .minimum_version_id = 3,
+ .minimum_version_id = 2, /* qemu-kvm */
.post_load = vmstate_acpi_post_load,
.fields = (VMStateField[]) {
VMSTATE_PCI_DEVICE(parent_obj, PIIX4PMState),

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a91840fe3ca2e630233b1a545007fdf03430eebc54d9eeae015f17e32f036c90
size 68168
oid sha256:dd2a3b0dd5a7afd9f7bf34d986fa29521b25e75ef3f83312f7332668abeae2e9
size 40104

View File

@ -18,12 +18,13 @@ UPSTREAM_GIT_REPO=https://gitlab.com/qemu-project/qemu.git
# The following specifies the upstream tag or 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=v7.0.0
#GIT_UPSTREAM_COMMIT_ISH=v7.0.0
GIT_UPSTREAM_COMMIT_ISH=v7.1.0
# WARNING: If transitioning from using LATEST to not, MANUALLY re-set the
# tarball present. If transitioning TO LATEST, make sure that
# NEXT_RELEASE_IS_MAJOR is set correctly
# This is used to choose the version number when LATEST processing is active
NEXT_RELEASE_IS_MAJOR=0
NEXT_RELEASE_IS_MAJOR=1
# Unfortunately, SeaBIOS doesn't always follow an "always increasing" version
# model, so there may be times we should overide the automated version setting.
@ -41,7 +42,8 @@ OVERRIDE_FIVE_DIGIT_NUMBERING=0
# Path to be used for temporary files, directories, repositories, etc.
# Default is /dev/shm. An alternative could be /tmp (e.g., when building
# in containers, or whatever).
TMPDIR=/dev/shm
#TMPDIR=/dev/shm
TMPDIR=/tmp
# This array tracks all git submodule paths within the superproject (1st entry)
PATCH_PATH_MAP=(

View File

@ -1,26 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
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 <brogers@suse.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index 7c08c18358becf49779c876b0f3d..a35b63b2106900e6f7ff46d2b8da 100755
--- a/configure
+++ b/configure
@@ -2725,7 +2725,7 @@ fi
# Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
# or -march=z10 (which is the lowest architecture level that Clang supports)
-if test "$cpu" = "s390x" ; then
+if test "$cpu" = "s390x" && test "$softmmu" = yes ; then
write_c_skeleton
compile_prog "-march=z900" ""
has_z900=$?

View File

@ -1,32 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Fri, 17 Apr 2020 13:07:37 -0600
Subject: configure: remove $pkgversion from CONFIG_STAMP input to broaden
compatibility
As part of the effort to close the gap with Leap I think we are fine
removing the $pkgversion component to creating a unique CONFIG_STAMP.
This stamp is only used in creating a unique symbol used in ensuring the
dynamically loaded modules correspond correctly to the loading qemu.
The default inputs to producing this unique symbol are somewhat reasonable
as a generic mechanism, but specific packaging and maintenance practices
might require the default to be modified for best use. This is an example
of that.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
configure | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/configure b/configure
index a35b63b2106900e6f7ff46d2b8da..b031106ff395bf5092348780dbb6 100755
--- a/configure
+++ b/configure
@@ -2823,7 +2823,7 @@ echo "TARGET_DIRS=$target_list" >> $config_host_mak
if test "$modules" = "yes"; then
# $shacmd can generate a hash started with digit, which the compiler doesn't
# like as an symbol. So prefix it with an underscore
- echo "CONFIG_STAMP=_$( (echo $qemu_version; echo $pkgversion; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
+ echo "CONFIG_STAMP=_$( (echo $qemu_version; cat $0) | $shacmd - | cut -f1 -d\ )" >> $config_host_mak
echo "CONFIG_MODULES=y" >> $config_host_mak
fi
if test "$module_upgrades" = "yes"; then

View File

@ -1,122 +0,0 @@
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Mon, 7 Mar 2022 15:38:51 +0000
Subject: coroutine-ucontext: use QEMU_DEFINE_STATIC_CO_TLS()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 34145a307d849d0b6734d0222a7aa0bb9eef7407
Thread-Local Storage variables cannot be used directly from coroutine
code because the compiler may optimize TLS variable accesses across
qemu_coroutine_yield() calls. When the coroutine is re-entered from
another thread the TLS variables from the old thread must no longer be
used.
Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220307153853.602859-2-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
[DF: see: https://bugzilla.redhat.com/show_bug.cgi?id=1952483]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
util/coroutine-ucontext.c | 38 ++++++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/util/coroutine-ucontext.c b/util/coroutine-ucontext.c
index 904b375192cab6d24c2bdea46d8c..127d5a13c8e77cae82cbb7cb5129 100644
--- a/util/coroutine-ucontext.c
+++ b/util/coroutine-ucontext.c
@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include <ucontext.h>
#include "qemu/coroutine_int.h"
+#include "qemu/coroutine-tls.h"
#ifdef CONFIG_VALGRIND_H
#include <valgrind/valgrind.h>
@@ -66,8 +67,8 @@ typedef struct {
/**
* Per-thread coroutine bookkeeping
*/
-static __thread CoroutineUContext leader;
-static __thread Coroutine *current;
+QEMU_DEFINE_STATIC_CO_TLS(Coroutine *, current);
+QEMU_DEFINE_STATIC_CO_TLS(CoroutineUContext, leader);
/*
* va_args to makecontext() must be type 'int', so passing
@@ -97,14 +98,15 @@ static inline __attribute__((always_inline))
void finish_switch_fiber(void *fake_stack_save)
{
#ifdef CONFIG_ASAN
+ CoroutineUContext *leaderp = get_ptr_leader();
const void *bottom_old;
size_t size_old;
__sanitizer_finish_switch_fiber(fake_stack_save, &bottom_old, &size_old);
- if (!leader.stack) {
- leader.stack = (void *)bottom_old;
- leader.stack_size = size_old;
+ if (!leaderp->stack) {
+ leaderp->stack = (void *)bottom_old;
+ leaderp->stack_size = size_old;
}
#endif
#ifdef CONFIG_TSAN
@@ -161,8 +163,10 @@ static void coroutine_trampoline(int i0, int i1)
/* Initialize longjmp environment and switch back the caller */
if (!sigsetjmp(self->env, 0)) {
- start_switch_fiber_asan(COROUTINE_YIELD, &fake_stack_save, leader.stack,
- leader.stack_size);
+ CoroutineUContext *leaderp = get_ptr_leader();
+
+ start_switch_fiber_asan(COROUTINE_YIELD, &fake_stack_save,
+ leaderp->stack, leaderp->stack_size);
start_switch_fiber_tsan(&fake_stack_save, self, true); /* true=caller */
siglongjmp(*(sigjmp_buf *)co->entry_arg, 1);
}
@@ -297,7 +301,7 @@ qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
int ret;
void *fake_stack_save = NULL;
- current = to_;
+ set_current(to_);
ret = sigsetjmp(from->env, 0);
if (ret == 0) {
@@ -315,18 +319,24 @@ qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
Coroutine *qemu_coroutine_self(void)
{
- if (!current) {
- current = &leader.base;
+ Coroutine *self = get_current();
+ CoroutineUContext *leaderp = get_ptr_leader();
+
+ if (!self) {
+ self = &leaderp->base;
+ set_current(self);
}
#ifdef CONFIG_TSAN
- if (!leader.tsan_co_fiber) {
- leader.tsan_co_fiber = __tsan_get_current_fiber();
+ if (!leaderp->tsan_co_fiber) {
+ leaderp->tsan_co_fiber = __tsan_get_current_fiber();
}
#endif
- return current;
+ return self;
}
bool qemu_in_coroutine(void)
{
- return current && current->caller;
+ Coroutine *self = get_current();
+
+ return self && self->caller;
}

View File

@ -1,124 +0,0 @@
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Mon, 7 Mar 2022 15:38:52 +0000
Subject: coroutine: use QEMU_DEFINE_STATIC_CO_TLS()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: ac387a08a9c9f6b36757da912f0339c25f421f90
Thread-Local Storage variables cannot be used directly from coroutine
code because the compiler may optimize TLS variable accesses across
qemu_coroutine_yield() calls. When the coroutine is re-entered from
another thread the TLS variables from the old thread must no longer be
used.
Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
The alloc_pool QSLIST needs a typedef so the return value of
get_ptr_alloc_pool() can be stored in a local variable.
One example of why this code is necessary: a coroutine that yields
before calling qemu_coroutine_create() to create another coroutine is
affected by the TLS issue.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220307153853.602859-3-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
[DF: see: https://bugzilla.redhat.com/show_bug.cgi?id=1952483]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
util/qemu-coroutine.c | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/util/qemu-coroutine.c b/util/qemu-coroutine.c
index c03b2422ff686e7138bf7bf0abba..f3e8300c8d2ec64fc16fa562a518 100644
--- a/util/qemu-coroutine.c
+++ b/util/qemu-coroutine.c
@@ -18,6 +18,7 @@
#include "qemu/atomic.h"
#include "qemu/coroutine.h"
#include "qemu/coroutine_int.h"
+#include "qemu/coroutine-tls.h"
#include "block/aio.h"
/** Initial batch size is 64, and is increased on demand */
@@ -29,17 +30,20 @@ enum {
static QSLIST_HEAD(, Coroutine) release_pool = QSLIST_HEAD_INITIALIZER(pool);
static unsigned int pool_batch_size = POOL_INITIAL_BATCH_SIZE;
static unsigned int release_pool_size;
-static __thread QSLIST_HEAD(, Coroutine) alloc_pool = QSLIST_HEAD_INITIALIZER(pool);
-static __thread unsigned int alloc_pool_size;
-static __thread Notifier coroutine_pool_cleanup_notifier;
+
+typedef QSLIST_HEAD(, Coroutine) CoroutineQSList;
+QEMU_DEFINE_STATIC_CO_TLS(CoroutineQSList, alloc_pool);
+QEMU_DEFINE_STATIC_CO_TLS(unsigned int, alloc_pool_size);
+QEMU_DEFINE_STATIC_CO_TLS(Notifier, coroutine_pool_cleanup_notifier);
static void coroutine_pool_cleanup(Notifier *n, void *value)
{
Coroutine *co;
Coroutine *tmp;
+ CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
- QSLIST_FOREACH_SAFE(co, &alloc_pool, pool_next, tmp) {
- QSLIST_REMOVE_HEAD(&alloc_pool, pool_next);
+ QSLIST_FOREACH_SAFE(co, alloc_pool, pool_next, tmp) {
+ QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
qemu_coroutine_delete(co);
}
}
@@ -49,27 +53,30 @@ Coroutine *qemu_coroutine_create(CoroutineEntry *entry, void *opaque)
Coroutine *co = NULL;
if (CONFIG_COROUTINE_POOL) {
- co = QSLIST_FIRST(&alloc_pool);
+ CoroutineQSList *alloc_pool = get_ptr_alloc_pool();
+
+ co = QSLIST_FIRST(alloc_pool);
if (!co) {
if (release_pool_size > qatomic_read(&pool_batch_size)) {
/* Slow path; a good place to register the destructor, too. */
- if (!coroutine_pool_cleanup_notifier.notify) {
- coroutine_pool_cleanup_notifier.notify = coroutine_pool_cleanup;
- qemu_thread_atexit_add(&coroutine_pool_cleanup_notifier);
+ Notifier *notifier = get_ptr_coroutine_pool_cleanup_notifier();
+ if (!notifier->notify) {
+ notifier->notify = coroutine_pool_cleanup;
+ qemu_thread_atexit_add(notifier);
}
/* This is not exact; there could be a little skew between
* release_pool_size and the actual size of release_pool. But
* it is just a heuristic, it does not need to be perfect.
*/
- alloc_pool_size = qatomic_xchg(&release_pool_size, 0);
- QSLIST_MOVE_ATOMIC(&alloc_pool, &release_pool);
- co = QSLIST_FIRST(&alloc_pool);
+ set_alloc_pool_size(qatomic_xchg(&release_pool_size, 0));
+ QSLIST_MOVE_ATOMIC(alloc_pool, &release_pool);
+ co = QSLIST_FIRST(alloc_pool);
}
}
if (co) {
- QSLIST_REMOVE_HEAD(&alloc_pool, pool_next);
- alloc_pool_size--;
+ QSLIST_REMOVE_HEAD(alloc_pool, pool_next);
+ set_alloc_pool_size(get_alloc_pool_size() - 1);
}
}
@@ -93,9 +100,9 @@ static void coroutine_delete(Coroutine *co)
qatomic_inc(&release_pool_size);
return;
}
- if (alloc_pool_size < qatomic_read(&pool_batch_size)) {
- QSLIST_INSERT_HEAD(&alloc_pool, co, pool_next);
- alloc_pool_size++;
+ if (get_alloc_pool_size() < qatomic_read(&pool_batch_size)) {
+ QSLIST_INSERT_HEAD(get_ptr_alloc_pool(), co, pool_next);
+ set_alloc_pool_size(get_alloc_pool_size() + 1);
return;
}
}

View File

@ -1,89 +0,0 @@
From: Stefan Hajnoczi <stefanha@redhat.com>
Date: Mon, 7 Mar 2022 15:38:53 +0000
Subject: coroutine-win32: use QEMU_DEFINE_STATIC_CO_TLS()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: c1fe694357a328c807ae3cc6961c19e923448fcc
Thread-Local Storage variables cannot be used directly from coroutine
code because the compiler may optimize TLS variable accesses across
qemu_coroutine_yield() calls. When the coroutine is re-entered from
another thread the TLS variables from the old thread must no longer be
used.
Use QEMU_DEFINE_STATIC_CO_TLS() for the current and leader variables.
I think coroutine-win32.c could get away with __thread because the
variables are only used in situations where either the stale value is
correct (current) or outside coroutine context (loading leader when
current is NULL). Due to the difficulty of being sure that this is
really safe in all scenarios it seems worth converting it anyway.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20220307153853.602859-4-stefanha@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
[DF: see: https://bugzilla.redhat.com/show_bug.cgi?id=1952483]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
util/coroutine-win32.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/util/coroutine-win32.c b/util/coroutine-win32.c
index de6bd4fd3e4e9747b08348e2a5f7..c02a62c896908162160440cbc8ba 100644
--- a/util/coroutine-win32.c
+++ b/util/coroutine-win32.c
@@ -25,6 +25,7 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "qemu/coroutine_int.h"
+#include "qemu/coroutine-tls.h"
typedef struct
{
@@ -34,8 +35,8 @@ typedef struct
CoroutineAction action;
} CoroutineWin32;
-static __thread CoroutineWin32 leader;
-static __thread Coroutine *current;
+QEMU_DEFINE_STATIC_CO_TLS(CoroutineWin32, leader);
+QEMU_DEFINE_STATIC_CO_TLS(Coroutine *, current);
/* This function is marked noinline to prevent GCC from inlining it
* into coroutine_trampoline(). If we allow it to do that then it
@@ -52,7 +53,7 @@ qemu_coroutine_switch(Coroutine *from_, Coroutine *to_,
CoroutineWin32 *from = DO_UPCAST(CoroutineWin32, base, from_);
CoroutineWin32 *to = DO_UPCAST(CoroutineWin32, base, to_);
- current = to_;
+ set_current(to_);
to->action = action;
SwitchToFiber(to->fiber);
@@ -89,14 +90,21 @@ void qemu_coroutine_delete(Coroutine *co_)
Coroutine *qemu_coroutine_self(void)
{
+ Coroutine *current = get_current();
+
if (!current) {
- current = &leader.base;
- leader.fiber = ConvertThreadToFiber(NULL);
+ CoroutineWin32 *leader = get_ptr_leader();
+
+ current = &leader->base;
+ set_current(current);
+ leader->fiber = ConvertThreadToFiber(NULL);
}
return current;
}
bool qemu_in_coroutine(void)
{
+ Coroutine *current = get_current();
+
return current && current->caller;
}

View File

@ -1,25 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Fri, 29 Jan 2021 20:06:16 -0700
Subject: doc: add our support doc to the main project doc for x86 and s390x
Git-commit: 0000000000000000000000000000000000000000
Include-If: %if %{legacy_qemu_kvm}
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
docs/index.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/index.rst b/docs/index.rst
index 0b9ee9901d952c37cf3f9aefeffc..0669fc4cca6d0298cfab566857ba 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -11,6 +11,7 @@ Welcome to QEMU's documentation!
:maxdepth: 2
:caption: Contents:
+ supported.rst
about/index
system/index
user/index

View File

@ -1,44 +0,0 @@
From: Jaroslav Jindrak <dzejrou@gmail.com>
Date: Tue, 17 May 2022 14:38:58 +0200
Subject: hostmem: default the amount of prealloc-threads to smp-cpus
Git-commit: f8d426a6852c560fdd8648ae961c8189909a4b82
References: bsc#1197084
Prior to the introduction of the prealloc-threads property, the amount
of threads used to preallocate memory was derived from the value of
smp-cpus passed to qemu, the amount of physical cpus of the host
and a hardcoded maximum value. When the prealloc-threads property
was introduced, it included a default of 1 in backends/hostmem.c and
a default of smp-cpus using the sugar API for the property itself. The
latter default is not used when the property is not specified on qemu's
command line, so guests that were not adjusted for this change suddenly
started to use the default of 1 thread to preallocate memory, which
resulted in observable slowdowns in guest boots for guests with large
memory (e.g. when using libvirt <8.2.0 or managing guests manually).
This commit restores the original behavior for these cases while not
impacting guests started with the prealloc-threads property in any way.
Fixes: 220c1fd864e9d ("hostmem: introduce "prealloc-threads" property")
Signed-off-by: Jaroslav Jindrak <dzejrou@gmail.com>
Message-Id: <20220517123858.7933-1-dzejrou@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
backends/hostmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/backends/hostmem.c b/backends/hostmem.c
index b2a5e905e866cd52f2f3e84f7d91..e4062a1c34920b5302fe57b8fdac 100644
--- a/backends/hostmem.c
+++ b/backends/hostmem.c
@@ -274,7 +274,7 @@ static void host_memory_backend_init(Object *obj)
backend->merge = machine_mem_merge(machine);
backend->dump = machine_dump_guest_core(machine);
backend->reserve = true;
- backend->prealloc_threads = 1;
+ backend->prealloc_threads = machine->smp.cpus;
}
static void host_memory_backend_post_init(Object *obj)

View File

@ -1,60 +0,0 @@
From: Arnout Engelen <arnout@bzzt.net>
Date: Sun, 8 May 2022 17:32:22 +0200
Subject: hw/usb/hcd-ehci: fix writeback order
Git-commit: f471e8b060798f26a7fc339c6152f82f22a7b33d
References: bsc#1192115
The 'active' bit passes control over a qTD between the guest and the
controller: set to 1 by guest to enable execution by the controller,
and the controller sets it to '0' to hand back control to the guest.
ehci_state_writeback write two dwords to main memory using DMA:
the third dword of the qTD (containing dt, total bytes to transfer,
cpage, cerr and status) and the fourth dword of the qTD (containing
the offset).
This commit makes sure the fourth dword is written before the third,
avoiding a race condition where a new offset written into the qTD
by the guest after it observed the status going to go to '0' gets
overwritten by a 'late' DMA writeback of the previous offset.
This race condition could lead to 'cpage out of range (5)' errors,
and reproduced by:
./qemu-system-x86_64 -enable-kvm -bios $SEABIOS/bios.bin -m 4096 -device usb-ehci -blockdev driver=file,read-only=on,filename=/home/aengelen/Downloads/openSUSE-Tumbleweed-DVD-i586-Snapshot20220428-Media.iso,node-name=iso -device usb-storage,drive=iso,bootindex=0 -chardev pipe,id=shell,path=/tmp/pipe -device virtio-serial -device virtconsole,chardev=shell -device virtio-rng-pci -serial mon:stdio -nographic
(press a key, select 'Installation' (2), and accept the default
values. On my machine the 'cpage out of range' is reproduced while
loading the Linux Kernel about once per 7 attempts. With the fix in
this commit it no longer fails)
This problem was previously reported as a seabios problem in
https://mail.coreboot.org/hyperkitty/list/seabios@seabios.org/thread/OUTHT5ISSQJGXPNTUPY3O5E5EPZJCHM3/
and as a nixos CI build failure in
https://github.com/NixOS/nixpkgs/issues/170803
Signed-off-by: Arnout Engelen <arnout@bzzt.net>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Lin Ma <lma@suse.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/usb/hcd-ehci.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-ehci.c b/hw/usb/hcd-ehci.c
index 33a8a377bd9503cf0ac1e6bd97e6..d4da8dcb8d15e3f1dcb8b6cfddf7 100644
--- a/hw/usb/hcd-ehci.c
+++ b/hw/usb/hcd-ehci.c
@@ -2011,7 +2011,10 @@ static int ehci_state_writeback(EHCIQueue *q)
ehci_trace_qtd(q, NLPTR_GET(p->qtdaddr), (EHCIqtd *) &q->qh.next_qtd);
qtd = (uint32_t *) &q->qh.next_qtd;
addr = NLPTR_GET(p->qtdaddr);
- put_dwords(q->ehci, addr + 2 * sizeof(uint32_t), qtd + 2, 2);
+ /* First write back the offset */
+ put_dwords(q->ehci, addr + 3 * sizeof(uint32_t), qtd + 3, 1);
+ /* Then write back the token, clearing the 'active' bit */
+ put_dwords(q->ehci, addr + 2 * sizeof(uint32_t), qtd + 2, 1);
ehci_free_packet(p);
/*

View File

@ -1,42 +0,0 @@
From: =?UTF-8?q?Andreas=20F=C3=A4rber?= <afaerber@suse.de>
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 <afaerber@suse.de>
---
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 050875b49738809ac586ba9ed259..59aa28b8a72590e7fdda0feecefe 100644
--- a/hw/timer/i8254_common.c
+++ b/hw/timer/i8254_common.c
@@ -224,6 +224,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,
@@ -231,6 +237,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),

View File

@ -59,7 +59,7 @@ Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/i386/tcg/helper-tcg.h b/target/i386/tcg/helper-tcg.h
index 0a4401e917f9a0b40fb95bf947fd..ef916d40e8c9497853b265a1e7b4 100644
index 34167e2e29cacee8dfb05e943fac..8ded299c8f4bf91ba2bea6b88211 100644
--- a/target/i386/tcg/helper-tcg.h
+++ b/target/i386/tcg/helper-tcg.h
@@ -26,7 +26,7 @@

View File

@ -1,58 +0,0 @@
From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= <marcandre.lureau@redhat.com>
Date: Wed, 20 Apr 2022 17:25:58 +0400
Subject: intc/exynos4210_gic: replace snprintf() with g_strdup_printf()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: a0e04317f3ef86d7b18ec6e6459d8aa66f787d12
While at it, replace '%x' with '%u' as suggested by Philippe Mathieu-Daudé.
Also fixes a GCC 12.0.1 -Wformat-overflow false-positive.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220420132624.2439741-16-marcandre.lureau@redhat.com>
[DF: Replaces downstream patch: hw-intc-exynos4210_gic-provide-more-room.patch]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/intc/exynos4210_gic.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/hw/intc/exynos4210_gic.c b/hw/intc/exynos4210_gic.c
index bc73d1f1152438de04c252a2ec84..f8dd719caa1e598a32ab6cc6ee7a 100644
--- a/hw/intc/exynos4210_gic.c
+++ b/hw/intc/exynos4210_gic.c
@@ -289,10 +289,6 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
Object *obj = OBJECT(dev);
Exynos4210GicState *s = EXYNOS4210_GIC(obj);
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];
SysBusDevice *gicbusdev;
uint32_t n = s->num_cpu;
uint32_t i;
@@ -322,8 +318,10 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
*/
assert(n <= EXYNOS4210_NCPUS);
for (i = 0; i < n; i++) {
+ g_autofree char *cpu_alias_name = g_strdup_printf("exynos4210-gic-alias_cpu%u", i);
+ g_autofree char *dist_alias_name = g_strdup_printf("exynos4210-gic-alias_dist%u", i);
+
/* Map CPU interface per SMP Core */
- sprintf(cpu_alias_name, "%s%x", cpu_prefix, i);
memory_region_init_alias(&s->cpu_alias[i], obj,
cpu_alias_name,
sysbus_mmio_get_region(gicbusdev, 1),
@@ -333,7 +331,6 @@ static void exynos4210_gic_realize(DeviceState *dev, Error **errp)
EXYNOS4210_EXT_GIC_CPU_GET_OFFSET(i), &s->cpu_alias[i]);
/* Map Distributor per SMP Core */
- sprintf(dist_alias_name, "%s%x", dist_prefix, i);
memory_region_init_alias(&s->dist_alias[i], obj,
dist_alias_name,
sysbus_mmio_get_region(gicbusdev, 0),

View File

@ -16,20 +16,32 @@ has happened.
Signed-off-by: Alexander Graf <agraf@suse.de>
[AF: Rebased for v1.6 and v1.7]
Signed-off-by: Andreas Färber <afaerber@suse.de>
[DF: Restructured it a bit, to make ARM look like other arch-es]
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
linux-user/syscall.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
linux-user/syscall.c | 26 ++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index c9adb65a2293e9735341a217a68d..8de1bb8d48eeb867a1047d986299 100644
index f4091212027c254a19dc871a675d..b746511fe5ba1c03cf44a14ed811 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8099,6 +8099,27 @@ static int open_self_stat(void *cpu_env, int fd)
return 0;
@@ -8157,7 +8157,8 @@ static int is_proc_myself(const char *filename, const char *entry)
}
#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN || \
- defined(TARGET_SPARC) || defined(TARGET_M68K) || defined(TARGET_HPPA)
+ defined(TARGET_SPARC) || defined(TARGET_M68K) || \
+ defined(TARGET_HPPA) || defined(TARGET_ARM)
static int is_proc(const char *filename, const char *entry)
{
return strcmp(filename, entry) == 0;
@@ -8229,6 +8230,27 @@ static int open_cpuinfo(CPUArchState *cpu_env, int fd)
}
#endif
+#if defined(TARGET_ARM)
+static int open_cpuinfo(void *cpu_env, int fd)
+static int open_cpuinfo(CPUArchState *cpu_env, int fd)
+{
+ dprintf(fd,
+"Processor : ARMv7 Processor rev 5 (v7l)\n"
@ -44,21 +56,20 @@ index c9adb65a2293e9735341a217a68d..8de1bb8d48eeb867a1047d986299 100644
+"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)
+
#if defined(TARGET_M68K)
static int open_hardware(CPUArchState *cpu_env, int fd)
{
CPUState *cpu = env_cpu((CPUArchState *)cpu_env);
@@ -8253,6 +8274,9 @@ static int do_openat(void *cpu_env, int dirfd, const char *pathname, int flags,
#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
@@ -8253,7 +8275,7 @@ static int do_openat(CPUArchState *cpu_env, int dirfd, const char *pathname, int
#if HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN
{ "/proc/net/route", open_net_route, is_proc },
#endif
-#if defined(TARGET_SPARC) || defined(TARGET_HPPA)
+#if defined(TARGET_SPARC) || defined(TARGET_HPPA) || defined(TARGET_ARM)
{ "/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

View File

@ -82,10 +82,10 @@ index 0000000000000000000000000000000000000000..cd1f513b334f3b263d9e4b5adb1981e3
+ return execve(new_argv[0], new_argv, envp);
+}
diff --git a/meson.build b/meson.build
index 861de93c4f58f294f9d353c9674e..05740dd14228fb700ecf6b793cfc 100644
index 20fddbd707c91c1baee604202fb1..ce227b6c25e3c71f16416f0a8f25 100644
--- a/meson.build
+++ b/meson.build
@@ -3336,6 +3336,11 @@ endforeach
@@ -3585,6 +3585,11 @@ endforeach
# Other build targets

View File

@ -15,10 +15,10 @@ Signed-off-by: Alexander Graf <agraf@suse.de>
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 5096b1258f6d631b80fb6cca6011..ae26ad25466aca617d272e4c7474 100644
index de782620fe3c9169a58e442a6f05..9d92e56e3996dc2174a4af9d0491 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -8929,8 +8929,13 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_ulong arg1,
@@ -8936,8 +8936,13 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_ulong arg1,
return ret;
#endif
#ifdef TARGET_NR_lseek

View File

@ -0,0 +1,67 @@
From: Dario Faggioli <dfaggioli@suse.com>
Date: Wed, 28 Sep 2022 13:13:08 +0200
Subject: linux-user: use "max" as default CPU model, to deal with x86_64-v2
binaries
Git-commit: 0000000000000000000000000000000000000000
References: bsc#1203684
The old "qemu64" model cannot run binaries compiled for, e.g.,
x86_64-v2. This could be a problem because a couple of major
distribution are switching to that as their baseline. In fact, errors
like this one can be observed (if 'ls' is such a binary):
x86_64-linux-user/qemu-x86_64 /usr/bin/ls
qemu: uncaught target signal 4 (Illegal instruction) - core dumped
Instead, using "max" as the CPU model, everything (of course) works:
export QEMU_CPU=max
x86_64-linux-user/qemu-x86_64 /usr/bin/ls
This has been and is being discussed in several places, e.g.:
https://lore.kernel.org/qemu-devel/20210607135843.196595-1-berrange@redhat.com/
https://bugzilla.redhat.com/show_bug.cgi?id=2079915
https://bugzilla.redhat.com/show_bug.cgi?id=2080133
http:s//github.com/containers/podman/issues/14314
However, these are all about system-emulation/virtualization, which is
indeed quite tricky. In fact, what would be a good alternative default
CPU model to pick, in that case? At the same time, however, it's also
less problematic. In fact, people using QEMU for that purpose are likely
in one of the following two situations already:
1) they're starting QEMU manually, with a long and complex command line,
for whatever specific reason. In that case, adding '-cpu host' (or
whatever) to such long and complex command line, isn't a big deal;
2) they're using QEMU via libvirt, which has its own fancy and
convenient ways of determining the best CPU model, and the default
"qemu64" one is pretty much never being used.
The case of Linux user emulation, however, it's a bit more tricky, as
it's less convenient to actually pass any parameter to QEMU at all, in
this scenario, so having to add one might be complicated. The same goes
for having to define the QEMU_CPU environment variable. When doing Linux
userspace emulation, though, a lot of the downsides of just using '-cpu
host' as the default are non-issue (e.g., we do not need to think about
migration!).
Therefore, while the topic remain complex and unsolved for system
emulation, for Linux user, let's just switch and be happy.
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
linux-user/x86_64/target_elf.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/x86_64/target_elf.h b/linux-user/x86_64/target_elf.h
index 7b76a90de8805a84b4983f3b2bb9..3f628f8d66197faae698cbec4e24 100644
--- a/linux-user/x86_64/target_elf.h
+++ b/linux-user/x86_64/target_elf.h
@@ -9,6 +9,6 @@
#define X86_64_TARGET_ELF_H
static inline const char *cpu_get_model(uint32_t eflags)
{
- return "qemu64";
+ return "max";
}
#endif

View File

@ -20,11 +20,11 @@ Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 8de1bb8d48eeb867a1047d986299..5096b1258f6d631b80fb6cca6011 100644
index b746511fe5ba1c03cf44a14ed811..de782620fe3c9169a58e442a6f05 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -6406,8 +6406,8 @@ static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2)
#define do_prctl_set_unalign do_prctl_inval1
@@ -6405,8 +6405,8 @@ static abi_long do_prctl_inval1(CPUArchState *env, abi_long arg2)
#define do_prctl_sme_set_vl do_prctl_inval1
#endif
-static abi_long do_prctl(CPUArchState *env, abi_long option, abi_long arg2,
@ -34,30 +34,30 @@ index 8de1bb8d48eeb867a1047d986299..5096b1258f6d631b80fb6cca6011 100644
{
abi_long ret;
@@ -8574,10 +8574,10 @@ _syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
@@ -8581,10 +8581,10 @@ _syscall2(int, pivot_root, const char *, new_root, const char *, put_old)
* 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,
-static abi_long do_syscall1(CPUArchState *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,
+static abi_long do_syscall1(CPUArchState *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;
@@ -13201,10 +13201,10 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
@@ -13203,10 +13203,10 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
return ret;
}
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
-abi_long do_syscall(CPUArchState *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_long do_syscall(CPUArchState *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)
@ -65,21 +65,21 @@ index 8de1bb8d48eeb867a1047d986299..5096b1258f6d631b80fb6cca6011 100644
CPUState *cpu = env_cpu(cpu_env);
abi_long ret;
diff --git a/linux-user/user-internals.h b/linux-user/user-internals.h
index ee152ccfaa8fdfa33b1e6d36b8ab..7117d8b2c583a16311ef82a0eb60 100644
index 0280e76addda504ea9745a17324b..1026e09da8caecf3e74159ea319e 100644
--- a/linux-user/user-internals.h
+++ b/linux-user/user-internals.h
@@ -59,10 +59,10 @@ int info_is_fdpic(struct image_info *info);
void target_set_brk(abi_ulong new_brk);
void syscall_init(void);
-abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
-abi_long do_syscall(CPUArchState *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_long do_syscall(CPUArchState *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);
extern __thread CPUState *thread_cpu;
void QEMU_NORETURN cpu_loop(CPUArchState *env);
const char *target_strerror(int err);
G_NORETURN void cpu_loop(CPUArchState *env);
abi_long get_errno(abi_long ret);

View File

@ -0,0 +1,35 @@
From: Dario Faggioli <dfaggioli@suse.com>
Date: Tue, 20 Sep 2022 09:10:59 +0200
Subject: meson: remove $pkgversion from CONFIG_STAMP input to broaden
compatibility
Git-commit: 0000000000000000000000000000000000000000
As part of the effort to close the gap with Leap I think we are fine
removing the $pkgversion component to creating a unique CONFIG_STAMP.
This stamp is only used in creating a unique symbol used in ensuring the
dynamically loaded modules correspond correctly to the loading qemu.
The default inputs to producing this unique symbol are somewhat reasonable
as a generic mechanism, but specific packaging and maintenance practices
might require the default to be modified for best use. This is an example
of that.
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
meson.build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meson.build b/meson.build
index ce227b6c25e3c71f16416f0a8f25..09145d35aa3e684e92da7895ac67 100644
--- a/meson.build
+++ b/meson.build
@@ -1736,7 +1736,7 @@ config_host_data.set_quoted('CONFIG_SYSCONFDIR', get_option('prefix') / get_opti
if config_host.has_key('CONFIG_MODULES')
config_host_data.set('CONFIG_STAMP', run_command(
meson.current_source_dir() / 'scripts/qemu-stamp.py',
- meson.project_version(), get_option('pkgversion'), '--',
+ meson.project_version(), '--',
meson.current_source_dir() / 'configure',
capture: true, check: true).stdout().strip())
endif

View File

@ -1,137 +0,0 @@
From: "Jose R. Ziviani" <jziviani@suse.de>
Date: Tue, 28 Sep 2021 17:46:28 -0300
Subject: modules: generates per-target modinfo
Git-commit: 05d6814c3eb16524e992bb7048d3385f8e99dd6a
References: bsc#1199015
This patch changes the way modinfo is generated and built. Instead of
one modinfo.c it generates one modinfo-<target>-softmmu.c per target. It
aims a fine-tune control of modules by configuring Kconfig.
Signed-off-by: Jose R. Ziviani <jziviani@suse.de>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Message-Id: <165369003038.5857.13084289285185196779.stgit@work>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
meson.build | 25 +++++++++++++++-------
scripts/modinfo-generate.py | 42 ++++++++++++++++++++++---------------
2 files changed, 42 insertions(+), 25 deletions(-)
diff --git a/meson.build b/meson.build
index 05740dd14228fb700ecf6b793cfc..eeaa045c90402cee5ba946f321c1 100644
--- a/meson.build
+++ b/meson.build
@@ -2999,14 +2999,23 @@ foreach d, list : target_modules
endforeach
if enable_modules
- modinfo_src = custom_target('modinfo.c',
- output: 'modinfo.c',
- input: modinfo_files,
- command: [modinfo_generate, '@INPUT@'],
- capture: true)
- modinfo_lib = static_library('modinfo', modinfo_src)
- modinfo_dep = declare_dependency(link_whole: modinfo_lib)
- softmmu_ss.add(modinfo_dep)
+ foreach target : target_dirs
+ if target.endswith('-softmmu')
+ config_target = config_target_mak[target]
+ config_devices_mak = target + '-config-devices.mak'
+ modinfo_src = custom_target('modinfo-' + target + '.c',
+ output: 'modinfo-' + target + '.c',
+ input: modinfo_files,
+ command: [modinfo_generate, '--devices', config_devices_mak, '@INPUT@'],
+ capture: true)
+
+ modinfo_lib = static_library('modinfo-' + target + '.c', modinfo_src)
+ modinfo_dep = declare_dependency(link_with: modinfo_lib)
+
+ arch = config_target['TARGET_NAME'] == 'sparc64' ? 'sparc64' : config_target['TARGET_BASE_ARCH']
+ hw_arch[arch].add(modinfo_dep)
+ endif
+ endforeach
endif
nm = find_program('nm')
diff --git a/scripts/modinfo-generate.py b/scripts/modinfo-generate.py
index 689f33c0f2919508341712a1cde4..a0c09edae1009bc77964e95d585f 100755
--- a/scripts/modinfo-generate.py
+++ b/scripts/modinfo-generate.py
@@ -32,7 +32,7 @@ def parse_line(line):
continue
return (kind, data)
-def generate(name, lines):
+def generate(name, lines, core_modules):
arch = ""
objs = []
deps = []
@@ -49,7 +49,13 @@ def generate(name, lines):
elif kind == 'arch':
arch = data;
elif kind == 'kconfig':
- pass # ignore
+ # don't add a module which dependency is not enabled
+ # in kconfig
+ if data.strip() not in core_modules:
+ print(" /* module {} isn't enabled in Kconfig. */"
+ .format(data.strip()))
+ print("/* },{ */")
+ return []
else:
print("unknown:", kind)
exit(1)
@@ -60,7 +66,7 @@ def generate(name, lines):
print_array("objs", objs)
print_array("deps", deps)
print_array("opts", opts)
- print("},{");
+ print("},{")
return deps
def print_pre():
@@ -74,26 +80,28 @@ def print_post():
print("}};")
def main(args):
+ if len(args) < 3 or args[0] != '--devices':
+ print('Expected: modinfo-generate.py --devices '
+ 'config-device.mak [modinfo files]', file=sys.stderr)
+ exit(1)
+
+ # get all devices enabled in kconfig, from *-config-device.mak
+ enabled_core_modules = set()
+ with open(args[1]) as file:
+ for line in file.readlines():
+ config = line.split('=')
+ if config[1].rstrip() == 'y':
+ enabled_core_modules.add(config[0][7:]) # remove CONFIG_
+
deps = {}
print_pre()
- for modinfo in args:
+ for modinfo in args[2:]:
with open(modinfo) as f:
lines = f.readlines()
print(" /* %s */" % modinfo)
- (basename, ext) = os.path.splitext(modinfo)
- deps[basename] = generate(basename, lines)
+ (basename, _) = os.path.splitext(modinfo)
+ deps[basename] = generate(basename, lines, enabled_core_modules)
print_post()
- flattened_deps = {flat.strip('" ') for dep in deps.values() for flat in dep}
- error = False
- for dep in flattened_deps:
- if dep not in deps.keys():
- print("Dependency {} cannot be satisfied".format(dep),
- file=sys.stderr)
- error = True
-
- if error:
- exit(1)
-
if __name__ == "__main__":
main(sys.argv[1:])

View File

@ -1,269 +0,0 @@
From: "Jose R. Ziviani" <jziviani@suse.de>
Date: Tue, 28 Sep 2021 17:46:27 -0300
Subject: modules: introduces module_kconfig directive
Git-commit: 24ce7aa77dd1a3095d994bf53d60cce6e672cf4d
References: bsc#1199015
module_kconfig is a new directive that should be used with module_obj
whenever that module depends on the Kconfig to be enabled.
When the module is enabled in Kconfig we are sure that its dependencies
will be enabled as well, thus the module will be loaded without any
problem.
The correct way to use module_kconfig is by passing the Kconfig option
to module_kconfig (or the *config-devices.mak without CONFIG_).
Signed-off-by: Jose R. Ziviani <jziviani@suse.de>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Message-Id: <165369002370.5857.12150544416563557322.stgit@work>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/display/qxl.c | 1 +
hw/display/vhost-user-gpu-pci.c | 1 +
hw/display/vhost-user-gpu.c | 1 +
hw/display/vhost-user-vga.c | 1 +
hw/display/virtio-gpu-base.c | 1 +
hw/display/virtio-gpu-gl.c | 1 +
hw/display/virtio-gpu-pci-gl.c | 1 +
hw/display/virtio-gpu-pci.c | 1 +
hw/display/virtio-gpu.c | 1 +
hw/display/virtio-vga-gl.c | 1 +
hw/display/virtio-vga.c | 1 +
hw/s390x/virtio-ccw-gpu.c | 1 +
hw/usb/ccid-card-emulated.c | 1 +
hw/usb/ccid-card-passthru.c | 1 +
hw/usb/host-libusb.c | 1 +
hw/usb/redirect.c | 1 +
include/qemu/module.h | 10 ++++++++++
scripts/modinfo-generate.py | 2 ++
18 files changed, 28 insertions(+)
diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index adbdbcaeb6121106bfcaee288d4c..092fb36b3a928b062067207d7518 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -2515,6 +2515,7 @@ static const TypeInfo qxl_primary_info = {
.class_init = qxl_primary_class_init,
};
module_obj("qxl-vga");
+module_kconfig(QXL);
static void qxl_secondary_class_init(ObjectClass *klass, void *data)
{
diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pci.c
index daefcf7101590cbd3b3681ac6fa9..d119bcae45d48e6eb14afe7d26e6 100644
--- a/hw/display/vhost-user-gpu-pci.c
+++ b/hw/display/vhost-user-gpu-pci.c
@@ -44,6 +44,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = {
.instance_init = vhost_user_gpu_pci_initfn,
};
module_obj(TYPE_VHOST_USER_GPU_PCI);
+module_kconfig(VHOST_USER_GPU);
static void vhost_user_gpu_pci_register_types(void)
{
diff --git a/hw/display/vhost-user-gpu.c b/hw/display/vhost-user-gpu.c
index 09818231bd24a9f8acd7ee3c2e15..5fc192022346dfc7ad5646db069d 100644
--- a/hw/display/vhost-user-gpu.c
+++ b/hw/display/vhost-user-gpu.c
@@ -599,6 +599,7 @@ static const TypeInfo vhost_user_gpu_info = {
.class_init = vhost_user_gpu_class_init,
};
module_obj(TYPE_VHOST_USER_GPU);
+module_kconfig(VHOST_USER_GPU);
static void vhost_user_gpu_register_types(void)
{
diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c
index 072c9c65bc754f399bc49a3dbb88..0c146080fd2c15ff9fd86338164e 100644
--- a/hw/display/vhost-user-vga.c
+++ b/hw/display/vhost-user-vga.c
@@ -45,6 +45,7 @@ static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
.instance_init = vhost_user_vga_inst_initfn,
};
module_obj(TYPE_VHOST_USER_VGA);
+module_kconfig(VHOST_USER_VGA);
static void vhost_user_vga_register_types(void)
{
diff --git a/hw/display/virtio-gpu-base.c b/hw/display/virtio-gpu-base.c
index fff0fb4a828a0814ab5290a17f78..a8a5a8812f331fa56e3ef6a18821 100644
--- a/hw/display/virtio-gpu-base.c
+++ b/hw/display/virtio-gpu-base.c
@@ -260,6 +260,7 @@ static const TypeInfo virtio_gpu_base_info = {
.abstract = true
};
module_obj(TYPE_VIRTIO_GPU_BASE);
+module_kconfig(VIRTIO_GPU);
static void
virtio_register_types(void)
diff --git a/hw/display/virtio-gpu-gl.c b/hw/display/virtio-gpu-gl.c
index 6cc4313b1af2c3fac0011d6b39aa..f7837cc44dc41c665b703d12c79f 100644
--- a/hw/display/virtio-gpu-gl.c
+++ b/hw/display/virtio-gpu-gl.c
@@ -160,6 +160,7 @@ static const TypeInfo virtio_gpu_gl_info = {
.class_init = virtio_gpu_gl_class_init,
};
module_obj(TYPE_VIRTIO_GPU_GL);
+module_kconfig(VIRTIO_GPU);
static void virtio_register_types(void)
{
diff --git a/hw/display/virtio-gpu-pci-gl.c b/hw/display/virtio-gpu-pci-gl.c
index 99b14a07185ea6b3a2a2f99f167f..a2819e1ca93f98022a81b5a14d18 100644
--- a/hw/display/virtio-gpu-pci-gl.c
+++ b/hw/display/virtio-gpu-pci-gl.c
@@ -47,6 +47,7 @@ static const VirtioPCIDeviceTypeInfo virtio_gpu_gl_pci_info = {
.instance_init = virtio_gpu_gl_initfn,
};
module_obj(TYPE_VIRTIO_GPU_GL_PCI);
+module_kconfig(VIRTIO_PCI);
static void virtio_gpu_gl_pci_register_types(void)
{
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index e36eee0c409bb8d3bf7cbec85278..93f214ff58127452d0d56a19c361 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -65,6 +65,7 @@ static const TypeInfo virtio_gpu_pci_base_info = {
.abstract = true
};
module_obj(TYPE_VIRTIO_GPU_PCI_BASE);
+module_kconfig(VIRTIO_PCI);
#define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci"
typedef struct VirtIOGPUPCI VirtIOGPUPCI;
diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 529b5246b2b55da16445712e4173..cd4a56056fd9407a904470878318 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -1452,6 +1452,7 @@ static const TypeInfo virtio_gpu_info = {
.class_init = virtio_gpu_class_init,
};
module_obj(TYPE_VIRTIO_GPU);
+module_kconfig(VIRTIO_GPU);
static void virtio_register_types(void)
{
diff --git a/hw/display/virtio-vga-gl.c b/hw/display/virtio-vga-gl.c
index f22549097c5e8bb070da6d1c28d4..984faa6b39a80bc786e31ec3d393 100644
--- a/hw/display/virtio-vga-gl.c
+++ b/hw/display/virtio-vga-gl.c
@@ -37,6 +37,7 @@ static VirtioPCIDeviceTypeInfo virtio_vga_gl_info = {
.instance_init = virtio_vga_gl_inst_initfn,
};
module_obj(TYPE_VIRTIO_VGA_GL);
+module_kconfig(VIRTIO_VGA);
static void virtio_vga_register_types(void)
{
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index 7b55c8d0e72390b430fc4ad30f9f..c206b5da384bcc18dd14d3fcf62a 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -231,6 +231,7 @@ static const TypeInfo virtio_vga_base_info = {
.abstract = true,
};
module_obj(TYPE_VIRTIO_VGA_BASE);
+module_kconfig(VIRTIO_VGA);
#define TYPE_VIRTIO_VGA "virtio-vga"
diff --git a/hw/s390x/virtio-ccw-gpu.c b/hw/s390x/virtio-ccw-gpu.c
index 5868a2a07093f163f93690b9b87b..024e8990f499b0b95f8912da86d5 100644
--- a/hw/s390x/virtio-ccw-gpu.c
+++ b/hw/s390x/virtio-ccw-gpu.c
@@ -60,6 +60,7 @@ static const TypeInfo virtio_ccw_gpu = {
.class_init = virtio_ccw_gpu_class_init,
};
module_obj(TYPE_VIRTIO_GPU_CCW);
+module_kconfig(VIRTIO_CCW);
static void virtio_ccw_gpu_register(void)
{
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 6c8c0355e099c94a84fdf3b4ab12..1ddf7297f6125d59eae04a2ef5c4 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -613,6 +613,7 @@ static const TypeInfo emulated_card_info = {
.class_init = emulated_class_initfn,
};
module_obj(TYPE_EMULATED_CCID);
+module_kconfig(USB);
static void ccid_card_emulated_register_types(void)
{
diff --git a/hw/usb/ccid-card-passthru.c b/hw/usb/ccid-card-passthru.c
index fa3040fb7154419ce9767d55e4ed..748544d170835ca5a1ef99c1faac 100644
--- a/hw/usb/ccid-card-passthru.c
+++ b/hw/usb/ccid-card-passthru.c
@@ -415,6 +415,7 @@ static const TypeInfo passthru_card_info = {
.class_init = passthru_class_initfn,
};
module_obj(TYPE_CCID_PASSTHRU);
+module_kconfig(USB);
static void ccid_card_passthru_register_types(void)
{
diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c
index 2b35cb6cdd3933f2cf98307bcc4e..28f8af8941ff6db20283fcd85d23 100644
--- a/hw/usb/host-libusb.c
+++ b/hw/usb/host-libusb.c
@@ -1809,6 +1809,7 @@ static const TypeInfo usb_host_dev_info = {
.instance_init = usb_host_instance_init,
};
module_obj(TYPE_USB_HOST_DEVICE);
+module_kconfig(USB);
static void usb_host_register_types(void)
{
diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c
index 8692ea256109532acf791bb590bd..b384ad7e73fbea58655324a65fb8 100644
--- a/hw/usb/redirect.c
+++ b/hw/usb/redirect.c
@@ -2620,6 +2620,7 @@ static const TypeInfo usbredir_dev_info = {
.instance_init = usbredir_instance_init,
};
module_obj(TYPE_USB_REDIR);
+module_kconfig(USB);
static void usbredir_register_types(void)
{
diff --git a/include/qemu/module.h b/include/qemu/module.h
index 5fcc323b2a79d5adfdf27fa19bf7..bd73607104c951a34512a156cff0 100644
--- a/include/qemu/module.h
+++ b/include/qemu/module.h
@@ -135,6 +135,16 @@ void module_allow_arch(const char *arch);
*/
#define module_opts(name) modinfo(opts, name)
+/**
+ * module_kconfig
+ *
+ * @name: Kconfig requirement necessary to load the module
+ *
+ * This module requires a core module that should be implemented and
+ * enabled in Kconfig.
+ */
+#define module_kconfig(name) modinfo(kconfig, name)
+
/*
* module info database
*
diff --git a/scripts/modinfo-generate.py b/scripts/modinfo-generate.py
index f559eed0077a22bfd25a26a79c01..689f33c0f2919508341712a1cde4 100755
--- a/scripts/modinfo-generate.py
+++ b/scripts/modinfo-generate.py
@@ -48,6 +48,8 @@ def generate(name, lines):
opts.append(data)
elif kind == 'arch':
arch = data;
+ elif kind == 'kconfig':
+ pass # ignore
else:
print("unknown:", kind)
exit(1)

View File

@ -1,24 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
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 <brogers@suse.com>
---
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 68b4d7edcb2c8b10e162a0872e27..1839add9eea2af542b01b5591121 100644
--- a/pc-bios/s390-ccw/netboot.mak
+++ b/pc-bios/s390-ccw/netboot.mak
@@ -54,6 +54,7 @@ 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) $(LIBC_INC) $(LIBNET_INC) \
-DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
+LIBNETCFLAGS += -Wno-address-of-packed-member
%.o : $(SLOF_DIR)/lib/libnet/%.c
$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")

View File

@ -1,101 +0,0 @@
From: Claudio Fontana <cfontana@suse.de>
Date: Tue, 31 May 2022 13:47:07 +0200
Subject: pci: fix overflow in snprintf string formatting
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 36f18c6989a3d1ff1d7a0e50b0868ef3958299b4
References: bsc#1199924
the code in pcibus_get_fw_dev_path contained the potential for a
stack buffer overflow of 1 byte, potentially writing to the stack an
extra NUL byte.
This overflow could happen if the PCI slot is >= 0x10000000,
and the PCI function is >= 0x10000000, due to the size parameter
of snprintf being incorrectly calculated in the call:
if (PCI_FUNC(d->devfn))
snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn));
since the off obtained from a previous call to snprintf is added
instead of subtracted from the total available size of the buffer.
Without the accurate size guard from snprintf, we end up writing in the
worst case:
name (32) + "@" (1) + SLOT (8) + "," (1) + FUNC (8) + term NUL (1) = 51 bytes
In order to provide something more robust, replace all of the code in
pcibus_get_fw_dev_path with a single call to g_strdup_printf,
so there is no need to rely on manual calculations.
Found by compiling QEMU with FORTIFY_SOURCE=3 as the error:
*** buffer overflow detected ***: terminated
Thread 1 "qemu-system-x86" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff642c380 (LWP 121307)]
0x00007ffff71ff55c in __pthread_kill_implementation () from /lib64/libc.so.6
(gdb) bt
#0 0x00007ffff71ff55c in __pthread_kill_implementation () at /lib64/libc.so.6
#1 0x00007ffff71ac6f6 in raise () at /lib64/libc.so.6
#2 0x00007ffff7195814 in abort () at /lib64/libc.so.6
#3 0x00007ffff71f279e in __libc_message () at /lib64/libc.so.6
#4 0x00007ffff729767a in __fortify_fail () at /lib64/libc.so.6
#5 0x00007ffff7295c36 in () at /lib64/libc.so.6
#6 0x00007ffff72957f5 in __snprintf_chk () at /lib64/libc.so.6
#7 0x0000555555b1c1fd in pcibus_get_fw_dev_path ()
#8 0x0000555555f2bde4 in qdev_get_fw_dev_path_helper.constprop ()
#9 0x0000555555f2bd86 in qdev_get_fw_dev_path_helper.constprop ()
#10 0x00005555559a6e5d in get_boot_device_path ()
#11 0x00005555559a712c in get_boot_devices_list ()
#12 0x0000555555b1a3d0 in fw_cfg_machine_reset ()
#13 0x0000555555bf4c2d in pc_machine_reset ()
#14 0x0000555555c66988 in qemu_system_reset ()
#15 0x0000555555a6dff6 in qdev_machine_creation_done ()
#16 0x0000555555c79186 in qmp_x_exit_preconfig.part ()
#17 0x0000555555c7b459 in qemu_init ()
#18 0x0000555555960a29 in main ()
Found-by: Dario Faggioli <Dario Faggioli <dfaggioli@suse.com>
Found-by: Martin Liška <martin.liska@suse.com>
Cc: qemu-stable@nongnu.org
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Message-Id: <20220531114707.18830-1-cfontana@suse.de>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/pci/pci.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index dae9119bfe5fe45a15e31985151e..c69b412434775df1368beb67984c 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -2625,15 +2625,15 @@ static char *pci_dev_fw_name(DeviceState *dev, char *buf, int len)
static char *pcibus_get_fw_dev_path(DeviceState *dev)
{
PCIDevice *d = (PCIDevice *)dev;
- char path[50], name[33];
- int off;
-
- off = snprintf(path, sizeof(path), "%s@%x",
- pci_dev_fw_name(dev, name, sizeof name),
- PCI_SLOT(d->devfn));
- if (PCI_FUNC(d->devfn))
- snprintf(path + off, sizeof(path) + off, ",%x", PCI_FUNC(d->devfn));
- return g_strdup(path);
+ char name[33];
+ int has_func = !!PCI_FUNC(d->devfn);
+
+ return g_strdup_printf("%s@%x%s%.*x",
+ pci_dev_fw_name(dev, name, sizeof(name)),
+ PCI_SLOT(d->devfn),
+ has_func ? "," : "",
+ has_func,
+ PCI_FUNC(d->devfn));
}
static char *pcibus_get_dev_path(DeviceState *dev)

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f6b375c7951f728402798b0baabb2d86478ca53d44cedbefabbe1c46bf46f839
size 125117636

Binary file not shown.

BIN
qemu-7.1.0.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
qemu-7.1.0.tar.xz.sig Normal file

Binary file not shown.

View File

@ -13,10 +13,10 @@ Signed-off-by: Andreas Färber <afaerber@suse.de>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 9cb723f44355c55d21eeeb2c1b7b..02eedc7c92d788637385ef3eba19 100755
index 6ef9f118d9ffe39cfadcdf54168e..4115eaa121aabc17a417f5ef4955 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -334,7 +334,7 @@ BINFMT_SET=qemu_register_interpreter
@@ -341,7 +341,7 @@ BINFMT_SET=qemu_register_interpreter
SYSTEMDDIR="/etc/binfmt.d"
DEBIANDIR="/usr/share/binfmts"

View File

@ -1,26 +0,0 @@
From: Ulrich Hecht <uli@suse.de>
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 <brogers@suse.com>
---
linux-user/syscall.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index f65045efe6a22bb38d0c95dde084..4ba8637359340c3d84953be2347b 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -9754,6 +9754,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1,
{
struct timeval tv;
struct timezone tz;
+ if (copy_from_user_timeval(&tv, arg1)) {
+ return -TARGET_EFAULT;
+ }
ret = get_errno(gettimeofday(&tv, &tz));
if (!is_error(ret)) {

View File

@ -1,41 +0,0 @@
From: Alexander Graf <agraf@suse.de>
Date: Tue, 14 Apr 2009 16:26:33 +0200
Subject: qemu-cvs-ioctl_debug
Extends unsupported ioctl debug output.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Ulrich Hecht <uli@suse.de>
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
linux-user/syscall.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 4ba8637359340c3d84953be2347b..72cb2bbbcc3bf29af6f3f6ee3d85 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5700,8 +5700,21 @@ static abi_long do_ioctl(int fd, int cmd, abi_long arg)
ie = ioctl_entries;
for(;;) {
if (ie->target_cmd == 0) {
+ int i;
qemu_log_mask(
- LOG_UNIMP, "Unsupported ioctl: cmd=0x%04lx\n", (long)cmd);
+ LOG_UNIMP, "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)))
+ qemu_log_mask(
+ LOG_UNIMP, "%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)

View File

@ -1,43 +0,0 @@
From: Alexander Graf <agraf@suse.de>
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 <agraf@suse.de>
Signed-off-by: Ulrich Hecht <uli@suse.de>
[BR: minor edits to pass qemu's checkpatch script]
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
linux-user/syscall.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 72cb2bbbcc3bf29af6f3f6ee3d85..c9adb65a2293e9735341a217a68d 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5745,6 +5745,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)) {
@@ -5763,6 +5770,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);

View File

@ -1,3 +1,122 @@
-------------------------------------------------------------------
Wed Sep 28 16:35:10 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Runs of the test-suite seem much more stable now, in this version
of QEMU. (bsc#1203610) We are also fine re-enabling running them
in parallel.
-------------------------------------------------------------------
Wed Sep 28 11:48:14 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Switch QEMU Linux user to emulate the same CPU as the one of the
host by default. This is a bit conrtoversial and tricky, when
thinking about system emulation/virtualization. But for linux-user,
it should be just fine. (bsc#1203684)
* Patches added:
linux-user-use-max-as-default-CPU-model-.patch
-------------------------------------------------------------------
Tue Sep 27 16:16:17 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Be less verbose when packaging documentation. In fact, with just
a couple of (minor) re-arrangements, we can get rid of having to
list all the files all the time
- Package /etc/qemu/bridge.conf as '%config(noreplace). Next step
will probably be to move it to /usr/etc/qemu (bsc#1201944)
-------------------------------------------------------------------
Wed Sep 21 07:08:48 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Switch to %autosetup for all products (this required some changes
in update_git.sh)
- Run check-qtest sequentially, as it's more reliable, when in OBS
- Build with libbpf, fdt and capstone support
- Drop the patch adding our support document, and deal with that
in the spec file directly
* Patches dropped:
doc-add-our-support-doc-to-the-main-proj.patch
-------------------------------------------------------------------
Tue Sep 20 07:14:16 UTC 2022 - Dario Faggioli <dfaggioli@suse.com>
- Updated to latest upstream version 7.1
* https://wiki.qemu.org/ChangeLog/7.1
Be sure to also check the following pages:
* https://qemu-project.gitlab.io/qemu/about/removed-features.html
* https://qemu-project.gitlab.io/qemu/about/deprecated.html
Some notable changes:
* [x86] Support for architectural LBRs on KVM virtual machines
* [x86] The libopcode-based disassembler has been removed. Use
Capstone instead
* [LoongArch] Add initial support for the LoongArch64 architecture.
* [ARM] The emulated SMMUv3 now advertises support for SMMUv3.2-BBML2
* [ARM] The xlnx-zynqmp SoC model now implements the 4 TTC timers
* [ARM] The versal machine now models the Cortex-R5s in the Real-Time
Processing Unit (RPU) subsystem
* [ARM] The virt board now supports emulation of the GICv4.0
* [ARM] New emulated CPU types: Cortex-A76, Neoverse-N1
* [HPPA] Fix serial port pass-through from host to guest
* [HPPA] Lots of general code improvements and tidy-ups
* [RISC-V] RISC-V
* [RISC-V] Add support for privileged spec version 1.12.0
* [RISC-V] Use privileged spec version 1.12.0 for virt machine by default
* [RISC-V] Allow software access to MIP SEIP
* [RISC-V] Add initial support for the Sdtrig extension
* [RISC-V] Optimisations and improvements for the vector extension
* [VFIO] Experimental support for exposing emulated PCI devices over the
new vfio-user protocol (a vfio-user client is not yet available
in QEMU, though)
* [QMP] The on-cbw-error option for copy-before-write filter, to specify
behavior on CBW (copy before write) operation failure.
* [QMP] The cbw-timeout option for copy-before-write filter, to specify
timeout for CBW operation.
* [QMP] New commands query-stats and query-stats-schema to retrieve
statistics from various QEMU subsystems (right now only from
KVM).
* [QMP] The PanicAction can now be configured to report an exit-failure
(useful for automated testing)
* [Networking] QEMU can be compiled with the system slirp library even
when using CFI. This requires libslirp 4.7.
* [Migration] Support for zero-copy-send on Linux, which reduces CPU
usage on the source host. Note that locked memory is needed
to support this
* Patches added:
Revert-tests-qtest-enable-more-vhost-use.patch
meson-remove-pkgversion-from-CONFIG_STAM.patch
* Patches dropped:
AIO-Reduce-number-of-threads-for-32bit-h.patch
Makefile-Don-t-check-pc-bios-as-pre-requ.patch
Revert-8dcb404bff6d9147765d7dd3e9c849337.patch
Revert-qht-constify-qht_statistics_init.patch
XXX-dont-dump-core-on-sigabort.patch
acpi_piix4-Fix-migration-from-SLE11-SP2.patch
configure-only-populate-roms-if-softmmu.patch
configure-remove-pkgversion-from-CONFIG_.patch
coroutine-ucontext-use-QEMU_DEFINE_STATI.patch
coroutine-use-QEMU_DEFINE_STATIC_CO_TLS.patch
coroutine-win32-use-QEMU_DEFINE_STATIC_C.patch
hostmem-default-the-amount-of-prealloc-t.patch
hw-usb-hcd-ehci-fix-writeback-order.patch
i8254-Fix-migration-from-SLE11-SP2.patch
intc-exynos4210_gic-replace-snprintf-wit.patch
modules-generates-per-target-modinfo.patch
modules-introduces-module_kconfig-direct.patch
pc-bios-s390-ccw-net-avoid-warning-about.patch
pci-fix-overflow-in-snprintf-string-form.patch
qemu-cvs-gettimeofday.patch
qemu-cvs-ioctl_debug.patch
qemu-cvs-ioctl_nodirection.patch
qht-Revert-some-constification-in-qht.c.patch
qom-handle-case-of-chardev-spice-module-.patch
scsi-lsi53c895a-fix-use-after-free-in-ls.patch
scsi-lsi53c895a-really-fix-use-after-fre.patch
softmmu-Always-initialize-xlat-in-addres.patch
sphinx-change-default-language-to-en.patch
test-add-mapping-from-arch-of-i686-to-qe.patch
tests-Fix-block-tests-to-be-compatible-w.patch
tests-qtest-Move-the-fuzz-tests-to-x86-o.patch
usb-Help-compiler-out-to-avoid-a-warning.patch
-------------------------------------------------------------------
Thu Sep 15 09:44:38 UTC 2022 - Dominique Leuenberger <dimstar@opensuse.org>

507
qemu.spec
View File

@ -107,6 +107,7 @@
%ifnarch %ix86 x86_64
%define _lto_cflags %{nil}
%endif
%define _lto_cflags %{nil}
%define generic_qemu_description \
QEMU provides full machine emulation and cross architecture usage. It closely\
@ -118,8 +119,8 @@ virtualization.
%bcond_with system_membarrier
%bcond_with malloc_trim
%define qemuver 7.0.0
%define srcver 7.0.0
%define qemuver 7.1.0
%define srcver 7.1.0
%define sbver 1.16.0_0_gd239552
%define srcname qemu
Name: qemu%{name_suffix}
@ -158,73 +159,43 @@ Source303: README.PACKAGING
# This patch queue is auto-generated - see README.PACKAGING for process
# Patches applied in base project:
Patch00000: XXX-dont-dump-core-on-sigabort.patch
Patch00001: qemu-binfmt-conf-Modify-default-path.patch
Patch00002: qemu-cvs-gettimeofday.patch
Patch00003: qemu-cvs-ioctl_debug.patch
Patch00004: qemu-cvs-ioctl_nodirection.patch
Patch00005: linux-user-add-binfmt-wrapper-for-argv-0.patch
Patch00006: PPC-KVM-Disable-mmu-notifier-check.patch
Patch00000: roms-Makefile-pass-a-packaging-timestamp.patch
Patch00001: roms-change-cross-compiler-naming-to-be-.patch
Patch00002: roms-Makefile-add-cross-file-to-qboot-me.patch
Patch00003: hw-smbios-handle-both-file-formats-regar.patch
Patch00004: Revert-roms-efirom-tests-uefi-test-tools.patch
Patch00005: qemu-binfmt-conf-Modify-default-path.patch
Patch00006: linux-user-add-binfmt-wrapper-for-argv-0.patch
Patch00007: linux-user-binfmt-support-host-binaries.patch
Patch00008: linux-user-Fake-proc-cpuinfo.patch
Patch00009: linux-user-use-target_ulong.patch
Patch00010: Make-char-muxer-more-robust-wrt-small-FI.patch
Patch00011: linux-user-lseek-explicitly-cast-non-set.patch
Patch00012: AIO-Reduce-number-of-threads-for-32bit-h.patch
Patch00013: xen_disk-Add-suse-specific-flush-disable.patch
Patch00014: qemu-bridge-helper-reduce-security-profi.patch
Patch00015: roms-Makefile-pass-a-packaging-timestamp.patch
Patch00016: Raise-soft-address-space-limit-to-hard-l.patch
Patch00017: increase-x86_64-physical-bits-to-42.patch
Patch00018: i8254-Fix-migration-from-SLE11-SP2.patch
Patch00019: acpi_piix4-Fix-migration-from-SLE11-SP2.patch
Patch00020: Make-installed-scripts-explicitly-python.patch
Patch00021: hw-smbios-handle-both-file-formats-regar.patch
Patch00022: xen-add-block-resize-support-for-xen-dis.patch
Patch00023: tests-qemu-iotests-Triple-timeout-of-i-o.patch
Patch00024: tests-Fix-block-tests-to-be-compatible-w.patch
Patch00025: xen-ignore-live-parameter-from-xen-save-.patch
Patch00026: tests-change-error-message-in-test-162.patch
Patch00027: configure-only-populate-roms-if-softmmu.patch
Patch00028: pc-bios-s390-ccw-net-avoid-warning-about.patch
Patch00029: roms-change-cross-compiler-naming-to-be-.patch
Patch00030: test-add-mapping-from-arch-of-i686-to-qe.patch
Patch00031: configure-remove-pkgversion-from-CONFIG_.patch
Patch00032: Revert-qht-constify-qht_statistics_init.patch
Patch00033: qht-Revert-some-constification-in-qht.c.patch
Patch00034: meson-install-ivshmem-client-and-ivshmem.patch
Patch00035: Revert-roms-efirom-tests-uefi-test-tools.patch
Patch00036: Makefile-Don-t-check-pc-bios-as-pre-requ.patch
Patch00037: roms-Makefile-add-cross-file-to-qboot-me.patch
Patch00038: usb-Help-compiler-out-to-avoid-a-warning.patch
Patch00039: qom-handle-case-of-chardev-spice-module-.patch
Patch00040: scsi-generic-replace-logical-block-count.patch
Patch00041: hw-scsi-megasas-check-for-NULL-frame-in-.patch
Patch00042: scsi-generic-check-for-additional-SG_IO-.patch
Patch00043: doc-add-our-support-doc-to-the-main-proj.patch
Patch00044: intc-exynos4210_gic-replace-snprintf-wit.patch
Patch00045: coroutine-ucontext-use-QEMU_DEFINE_STATI.patch
Patch00046: coroutine-use-QEMU_DEFINE_STATIC_CO_TLS.patch
Patch00047: coroutine-win32-use-QEMU_DEFINE_STATIC_C.patch
Patch00048: modules-introduces-module_kconfig-direct.patch
Patch00049: modules-generates-per-target-modinfo.patch
Patch00050: sphinx-change-default-language-to-en.patch
Patch00051: pci-fix-overflow-in-snprintf-string-form.patch
Patch00052: hw-usb-hcd-ehci-fix-writeback-order.patch
Patch00053: scsi-lsi53c895a-fix-use-after-free-in-ls.patch
Patch00054: softmmu-Always-initialize-xlat-in-addres.patch
Patch00055: hostmem-default-the-amount-of-prealloc-t.patch
Patch00056: scsi-lsi53c895a-really-fix-use-after-fre.patch
Patch00057: tests-qtest-Move-the-fuzz-tests-to-x86-o.patch
Patch00058: Revert-8dcb404bff6d9147765d7dd3e9c849337.patch
Patch00059: Disable-some-tests-that-have-problems-in.patch
Patch00010: linux-user-lseek-explicitly-cast-non-set.patch
Patch00011: PPC-KVM-Disable-mmu-notifier-check.patch
Patch00012: Make-char-muxer-more-robust-wrt-small-FI.patch
Patch00013: qemu-bridge-helper-reduce-security-profi.patch
Patch00014: Raise-soft-address-space-limit-to-hard-l.patch
Patch00015: increase-x86_64-physical-bits-to-42.patch
Patch00016: xen_disk-Add-suse-specific-flush-disable.patch
Patch00017: xen-add-block-resize-support-for-xen-dis.patch
Patch00018: xen-ignore-live-parameter-from-xen-save-.patch
Patch00019: scsi-generic-replace-logical-block-count.patch
Patch00020: hw-scsi-megasas-check-for-NULL-frame-in-.patch
Patch00021: scsi-generic-check-for-additional-SG_IO-.patch
Patch00022: Revert-tests-qtest-enable-more-vhost-use.patch
Patch00023: tests-change-error-message-in-test-162.patch
Patch00024: tests-qemu-iotests-Triple-timeout-of-i-o.patch
Patch00025: Disable-some-tests-that-have-problems-in.patch
Patch00026: Make-installed-scripts-explicitly-python.patch
Patch00027: meson-install-ivshmem-client-and-ivshmem.patch
Patch00028: meson-remove-pkgversion-from-CONFIG_STAM.patch
Patch00029: linux-user-use-max-as-default-CPU-model-.patch
# Patches applied in roms/seabios/:
Patch01000: seabios-switch-to-python3-as-needed.patch
Patch01001: enable-cross-compilation-on-ARM.patch
Patch01002: build-be-explicit-about-mx86-used-note-n.patch
# Patches applied in roms/ipxe/:
Patch02000: ath5k-Add-missing-AR5K_EEPROM_READ-in-at.patch
Patch02001: stub-out-the-SAN-req-s-in-int13.patch
#Patch02001: stub-out-the-SAN-req-s-in-int13.patch
Patch02002: ipxe-Makefile-fix-issues-of-build-reprod.patch
Patch02003: help-compiler-out-by-initializing-array.patch
Patch02004: Silence-GCC-12-spurious-warnings.patch
@ -240,6 +211,9 @@ Patch11000: qboot-add-cross.ini-file-to-handle-aarch.patch
# Patches applied in roms/opensbi/:
Patch13000: Makefile-fix-build-with-binutils-2.38.patch
# Patches that will be applied directly across the spec file
Source1000: stub-out-the-SAN-req-s-in-int13.patch
# Please do not add patches manually here.
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -282,6 +256,7 @@ BuildRequires: cross-ppc64-gcc%gcc_version
%endif
%endif
%ifarch x86_64
BuildRequires: gcc-32bit
BuildRequires: xen-devel >= 4.2
BuildRequires: pkgconfig(libpmem)
%endif
@ -306,11 +281,14 @@ BuildRequires: brlapi-devel
BuildRequires: flex
BuildRequires: libaio-devel
BuildRequires: libattr-devel
BuildRequires: libbpf-devel
BuildRequires: libbz2-devel
BuildRequires: libcapstone-devel
BuildRequires: libfdt-devel >= 1.4.2
BuildRequires: libgcrypt-devel >= 1.8.0
BuildRequires: lzfse-devel
BuildRequires: multipath-tools-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: python3-Sphinx
BuildRequires: rdma-core-devel
@ -458,6 +436,7 @@ syscall layer occurs on the native hardware and operating system.
%_bindir/qemu-hexagon
%_bindir/qemu-hppa
%_bindir/qemu-i386
%_bindir/qemu-loongarch64
%_bindir/qemu-m68k
%_bindir/qemu-microblaze
%_bindir/qemu-microblazeel
@ -504,33 +483,18 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%dir %_datadir/%name
%dir %_datadir/%name/firmware
%dir %_datadir/%name/forsplits
%dir %_docdir/%name/about
%dir %_docdir/%name/devel
%dir %_docdir/%name/interop
%dir %_docdir/%name/specs
%dir %_docdir/%name/system
%dir %_docdir/%name/system/arm
%dir %_docdir/%name/system/devices
%dir %_docdir/%name/system/i386
%dir %_docdir/%name/system/ppc
%dir %_docdir/%name/system/riscv
%dir %_docdir/%name/system/s390x
%dir %_docdir/%name/tools
%dir %_docdir/%name/user
%dir %_datadir/%name/vhost-user
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/firmware
%dir /usr/lib/supportconfig
%dir /usr/lib/supportconfig/plugins
%doc %_docdir/%name
%if %{kvm_available}
%ifarch s390x
%{_prefix}/lib/modules-load.d/kvm.conf
%endif
/usr/lib/udev/rules.d/80-kvm.rules
%endif
%if %{legacy_qemu_kvm}
%_docdir/%name/supported.html
%endif
%_datadir/applications/qemu.desktop
%_datadir/icons/hicolor/16x16/apps/qemu.png
%_datadir/icons/hicolor/24x24/apps/qemu.png
@ -551,208 +515,6 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%_datadir/%name/qemu-nsis.bmp
%_datadir/%name/trace-events-all
%_datadir/%name/vhost-user/50-qemu-virtiofsd.json
%_docdir/%name/.buildinfo
%_docdir/%name/about/build-platforms.html
%_docdir/%name/about/deprecated.html
%_docdir/%name/about/index.html
%_docdir/%name/about/license.html
%_docdir/%name/about/removed-features.html
%_docdir/%name/dbus-dbusindex.html
%_docdir/%name/devel/atomics.html
%_docdir/%name/devel/bitops.html
%_docdir/%name/devel/block-coroutine-wrapper.html
%_docdir/%name/devel/build-system.html
%_docdir/%name/devel/ci.html
%_docdir/%name/devel/clocks.html
%_docdir/%name/devel/code-of-conduct.html
%_docdir/%name/devel/conflict-resolution.html
%_docdir/%name/devel/control-flow-integrity.html
%_docdir/%name/devel/decodetree.html
%_docdir/%name/devel/ebpf_rss.html
%_docdir/%name/devel/fuzzing.html
%_docdir/%name/devel/index-api.html
%_docdir/%name/devel/index-build.html
%_docdir/%name/devel/index-internals.html
%_docdir/%name/devel/index-process.html
%_docdir/%name/devel/index-tcg.html
%_docdir/%name/devel/index.html
%_docdir/%name/devel/kconfig.html
%_docdir/%name/devel/loads-stores.html
%_docdir/%name/devel/memory.html
%_docdir/%name/devel/migration.html
%_docdir/%name/devel/modules.html
%_docdir/%name/devel/multi-process.html
%_docdir/%name/devel/multi-thread-tcg.html
%_docdir/%name/devel/qapi-code-gen.html
%_docdir/%name/devel/qgraph.html
%_docdir/%name/devel/qom.html
%_docdir/%name/devel/qtest.html
%_docdir/%name/devel/reset.html
%_docdir/%name/devel/s390-dasd-ipl.html
%_docdir/%name/devel/secure-coding-practices.html
%_docdir/%name/devel/stable-process.html
%_docdir/%name/devel/style.html
%_docdir/%name/devel/submitting-a-patch.html
%_docdir/%name/devel/submitting-a-pull-request.html
%_docdir/%name/devel/tcg-icount.html
%_docdir/%name/devel/tcg-plugins.html
%_docdir/%name/devel/tcg.html
%_docdir/%name/devel/testing.html
%_docdir/%name/devel/tracing.html
%_docdir/%name/devel/trivial-patches.html
%_docdir/%name/devel/ui.html
%_docdir/%name/devel/vfio-migration.html
%_docdir/%name/devel/writing-monitor-commands.html
%_docdir/%name/genindex.html
%_docdir/%name/index.html
%_docdir/%name/interop/barrier.html
%_docdir/%name/interop/bitmaps.html
%_docdir/%name/interop/dbus-display.html
%_docdir/%name/interop/dbus-vmstate.html
%_docdir/%name/interop/dbus.html
%_docdir/%name/interop/index.html
%_docdir/%name/interop/live-block-operations.html
%_docdir/%name/interop/pr-helper.html
%_docdir/%name/interop/qemu-ga-ref.html
%_docdir/%name/interop/qemu-qmp-ref.html
%_docdir/%name/interop/qemu-storage-daemon-qmp-ref.html
%_docdir/%name/interop/vhost-user-gpu.html
%_docdir/%name/interop/vhost-user.html
%_docdir/%name/interop/vhost-vdpa.html
%_docdir/%name/interop/virtio-balloon-stats.html
%_docdir/%name/objects.inv
%_docdir/%name/search.html
%_docdir/%name/searchindex.js
%_docdir/%name/specs/acpi_cpu_hotplug.html
%_docdir/%name/specs/acpi_erst.html
%_docdir/%name/specs/acpi_hest_ghes.html
%_docdir/%name/specs/acpi_hw_reduced_hotplug.html
%_docdir/%name/specs/acpi_mem_hotplug.html
%_docdir/%name/specs/acpi_nvdimm.html
%_docdir/%name/specs/acpi_pci_hotplug.html
%_docdir/%name/specs/index.html
%_docdir/%name/specs/ppc-spapr-hcalls.html
%_docdir/%name/specs/ppc-spapr-hotplug.html
%_docdir/%name/specs/ppc-spapr-numa.html
%_docdir/%name/specs/ppc-spapr-uv-hcalls.html
%_docdir/%name/specs/ppc-spapr-xive.html
%_docdir/%name/specs/ppc-xive.html
%_docdir/%name/specs/sev-guest-firmware.html
%_docdir/%name/specs/tpm.html
%_docdir/%name/system/arm/aspeed.html
%_docdir/%name/system/arm/collie.html
%_docdir/%name/system/arm/cpu-features.html
%_docdir/%name/system/arm/cubieboard.html
%_docdir/%name/system/arm/digic.html
%_docdir/%name/system/arm/emcraft-sf2.html
%_docdir/%name/system/arm/emulation.html
%_docdir/%name/system/arm/gumstix.html
%_docdir/%name/system/arm/highbank.html
%_docdir/%name/system/arm/imx25-pdk.html
%_docdir/%name/system/arm/integratorcp.html
%_docdir/%name/system/arm/kzm.html
%_docdir/%name/system/arm/mainstone.html
%_docdir/%name/system/arm/mps2.html
%_docdir/%name/system/arm/musca.html
%_docdir/%name/system/arm/musicpal.html
%_docdir/%name/system/arm/nrf.html
%_docdir/%name/system/arm/nseries.html
%_docdir/%name/system/arm/nuvoton.html
%_docdir/%name/system/arm/orangepi.html
%_docdir/%name/system/arm/palm.html
%_docdir/%name/system/arm/raspi.html
%_docdir/%name/system/arm/realview.html
%_docdir/%name/system/arm/sabrelite.html
%_docdir/%name/system/arm/sbsa.html
%_docdir/%name/system/arm/stellaris.html
%_docdir/%name/system/arm/stm32.html
%_docdir/%name/system/arm/sx1.html
%_docdir/%name/system/arm/versatile.html
%_docdir/%name/system/arm/vexpress.html
%_docdir/%name/system/arm/virt.html
%_docdir/%name/system/arm/xlnx-versal-virt.html
%_docdir/%name/system/arm/xscale.html
%_docdir/%name/system/authz.html
%_docdir/%name/system/barrier.html
%_docdir/%name/system/bootindex.html
%_docdir/%name/system/confidential-guest-support.html
%_docdir/%name/system/cpu-hotplug.html
%_docdir/%name/system/device-emulation.html
%_docdir/%name/system/devices/can.html
%_docdir/%name/system/devices/ivshmem.html
%_docdir/%name/system/devices/net.html
%_docdir/%name/system/devices/nvme.html
%_docdir/%name/system/devices/usb.html
%_docdir/%name/system/devices/vhost-user-rng.html
%_docdir/%name/system/devices/vhost-user.html
%_docdir/%name/system/devices/virtio-pmem.html
%_docdir/%name/system/gdb.html
%_docdir/%name/system/generic-loader.html
%_docdir/%name/system/guest-loader.html
%_docdir/%name/system/i386/amd-memory-encryption.html
%_docdir/%name/system/i386/cpu.html
%_docdir/%name/system/i386/kvm-pv.html
%_docdir/%name/system/i386/microvm.html
%_docdir/%name/system/i386/pc.html
%_docdir/%name/system/i386/sgx.html
%_docdir/%name/system/images.html
%_docdir/%name/system/index.html
%_docdir/%name/system/invocation.html
%_docdir/%name/system/keys.html
%_docdir/%name/system/linuxboot.html
%_docdir/%name/system/managed-startup.html
%_docdir/%name/system/monitor.html
%_docdir/%name/system/multi-process.html
%_docdir/%name/system/mux-chardev.html
%_docdir/%name/system/ppc/embedded.html
%_docdir/%name/system/ppc/powermac.html
%_docdir/%name/system/ppc/powernv.html
%_docdir/%name/system/ppc/ppce500.html
%_docdir/%name/system/ppc/prep.html
%_docdir/%name/system/ppc/pseries.html
%_docdir/%name/system/pr-manager.html
%_docdir/%name/system/qemu-block-drivers.html
%_docdir/%name/system/qemu-cpu-models.html
%_docdir/%name/system/qemu-manpage.html
%_docdir/%name/system/quickstart.html
%_docdir/%name/system/riscv/microchip-icicle-kit.html
%_docdir/%name/system/riscv/shakti-c.html
%_docdir/%name/system/riscv/sifive_u.html
%_docdir/%name/system/riscv/virt.html
%_docdir/%name/system/s390x/3270.html
%_docdir/%name/system/s390x/bootdevices.html
%_docdir/%name/system/s390x/css.html
%_docdir/%name/system/s390x/protvirt.html
%_docdir/%name/system/s390x/vfio-ap.html
%_docdir/%name/system/s390x/vfio-ccw.html
%_docdir/%name/system/secrets.html
%_docdir/%name/system/security.html
%_docdir/%name/system/target-arm.html
%_docdir/%name/system/target-avr.html
%_docdir/%name/system/target-i386.html
%_docdir/%name/system/target-m68k.html
%_docdir/%name/system/target-mips.html
%_docdir/%name/system/target-ppc.html
%_docdir/%name/system/target-riscv.html
%_docdir/%name/system/target-rx.html
%_docdir/%name/system/target-s390x.html
%_docdir/%name/system/target-sparc.html
%_docdir/%name/system/target-sparc64.html
%_docdir/%name/system/target-xtensa.html
%_docdir/%name/system/targets.html
%_docdir/%name/system/tls.html
%_docdir/%name/system/virtio-net-failover.html
%_docdir/%name/system/vnc-security.html
%_docdir/%name/tools/index.html
%_docdir/%name/tools/qemu-img.html
%_docdir/%name/tools/qemu-nbd.html
%_docdir/%name/tools/qemu-pr-helper.html
%_docdir/%name/tools/qemu-storage-daemon.html
%_docdir/%name/tools/qemu-trace-stap.html
%_docdir/%name/tools/virtfs-proxy-helper.html
%_docdir/%name/tools/virtiofsd.html
%_docdir/%name/user/index.html
%_docdir/%name/user/main.html
%_mandir/man1/%name.1.gz
%_mandir/man1/qemu-storage-daemon.1.gz
%_mandir/man1/virtiofsd.1.gz
@ -762,8 +524,6 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%_mandir/man7/qemu-ga-ref.7.gz
%_mandir/man7/qemu-storage-daemon-qmp-ref.7.gz
/usr/lib/supportconfig/plugins/%name
%doc %_docdir/%name/_static
%doc README.rst VERSION
%license COPYING COPYING.LIB LICENSE
%if %{kvm_available}
@ -827,8 +587,7 @@ This package provides i386 and x86_64 emulation.
%_datadir/%name/multiboot.bin
%_datadir/%name/multiboot_dma.bin
%_datadir/%name/pvh.bin
%dir %_docdir/qemu-x86
%_docdir/qemu-x86/supported.txt
%doc %_docdir/qemu-x86
%package ppc
Summary: Machine emulator and virtualizer for Power architectures
@ -856,8 +615,7 @@ This package provides ppc and ppc64 emulation.
%_datadir/%name/u-boot.e500
%_datadir/%name/u-boot-sam460-20100605.bin
%_datadir/%name/vof*.bin
%dir %_docdir/qemu-ppc
%_docdir/qemu-ppc/supported.txt
%doc %_docdir/qemu-ppc
%package s390x
Summary: Machine emulator and virtualizer for S/390 architectures
@ -878,8 +636,7 @@ This package provides s390x emulation.
%_bindir/qemu-system-s390x
%_datadir/%name/s390-ccw.img
%_datadir/%name/s390-netboot.img
%dir %_docdir/qemu-s390x
%_docdir/qemu-s390x/supported.txt
%doc %_docdir/qemu-s390x
%package arm
Summary: Machine emulator and virtualizer for ARM architectures
@ -902,8 +659,7 @@ This package provides arm emulation.
%_bindir/qemu-system-arm
%_bindir/qemu-system-aarch64
%_datadir/%name/npcm7xx_bootrom.bin
%dir %_docdir/qemu-arm
%_docdir/qemu-arm/supported.txt
%doc %_docdir/qemu-arm
%package extra
Summary: Machine emulator and virtualizer for "extra" architectures
@ -928,6 +684,7 @@ popular QEMU packages which are dedicated to a single architecture.)
%_bindir/qemu-system-avr
%_bindir/qemu-system-cris
%_bindir/qemu-system-hppa
%_bindir/qemu-system-loongarch64
%_bindir/qemu-system-m68k
%_bindir/qemu-system-microblaze
%_bindir/qemu-system-microblazeel
@ -1519,7 +1276,7 @@ a virtfs helper, ivshmem, disk utilities and scripts for various purposes.
%_mandir/man8/qemu-nbd.8.gz
%_mandir/man8/qemu-pr-helper.8.gz
%dir %_sysconfdir/%name
%config %_sysconfdir/%name/bridge.conf
%config(noreplace) %_sysconfdir/%name/bridge.conf
%post tools
%set_permissions %_libexecdir/qemu-bridge-helper
@ -1567,8 +1324,6 @@ to provide information and control at the guest OS level.
%files guest-agent
%defattr(-, root, root)
%attr(0755,root,kvm) %_bindir/qemu-ga
%dir %_docdir/%name/interop
%_docdir/%name/interop/qemu-ga.html
%_mandir/man8/qemu-ga.8.gz
%{_unitdir}/qemu-guest-agent.service
/usr/lib/udev/rules.d/80-qemu-ga.rules
@ -1675,6 +1430,7 @@ This package provides QTest accelerator for testing QEMU.
%_libdir/%name/accel-qtest-cris.so
%_libdir/%name/accel-qtest-hppa.so
%_libdir/%name/accel-qtest-i386.so
%_libdir/%name/accel-qtest-loongarch64.so
%_libdir/%name/accel-qtest-m68k.so
%_libdir/%name/accel-qtest-microblaze.so
%_libdir/%name/accel-qtest-microblazeel.so
@ -1744,9 +1500,7 @@ This package is an artifact of the early origins of QEMU, and is deprecated.
%files kvm
%defattr(-,root,root)
%_bindir/qemu-kvm
%dir %_docdir/qemu-kvm
%_docdir/qemu-kvm/kvm-supported.html
%_docdir/qemu-kvm/kvm-supported.txt
%doc %_docdir/qemu-kvm
%_mandir/man1/qemu-kvm.1.gz
# End of "if legacy_qemu_kvm"
%endif
@ -1922,96 +1676,16 @@ network adapters available with QEMU.
%endif
%prep
%if 0%{?sle_version} <= 150400
#if 0%{?sle_version} <= 150400
# Apparently, autosetup does not work, not even in 15.4. So,
# keep 'setup' plus the generated list of patches here for a
# while. Hopefully we'll be able to get rid of this soon enough.
%setup -q -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
%patch00000 -p1
%patch00001 -p1
%patch00002 -p1
%patch00003 -p1
%patch00004 -p1
%patch00005 -p1
%patch00006 -p1
%patch00007 -p1
%patch00008 -p1
%patch00009 -p1
%patch00010 -p1
%patch00011 -p1
%patch00012 -p1
%patch00013 -p1
%patch00014 -p1
%patch00015 -p1
%patch00016 -p1
%patch00017 -p1
%patch00018 -p1
%patch00019 -p1
%patch00020 -p1
%patch00021 -p1
%patch00022 -p1
%patch00023 -p1
%patch00024 -p1
%patch00025 -p1
%patch00026 -p1
%patch00027 -p1
%patch00028 -p1
%patch00029 -p1
%patch00030 -p1
%patch00031 -p1
%patch00032 -p1
%patch00033 -p1
%patch00034 -p1
%patch00035 -p1
%patch00036 -p1
%ifarch aarch64
%patch00037 -p1
%endif
%ifarch %arm %ix86 ppc
%patch00038 -p1
%endif
%patch00039 -p1
%patch00040 -p1
%patch00041 -p1
%patch00042 -p1
%if %{legacy_qemu_kvm}
%patch00043 -p1
%endif
%patch00044 -p1
%patch00045 -p1
%patch00046 -p1
%patch00047 -p1
%patch00048 -p1
%patch00049 -p1
%patch00050 -p1
%patch00051 -p1
%patch00052 -p1
%patch00053 -p1
%patch00054 -p1
%patch00055 -p1
%patch00056 -p1
%patch00057 -p1
%patch00058 -p1
%patch00059 -p1
%patch01000 -p1
%patch01001 -p1
%patch01002 -p1
%patch02000 -p1
%if 0%{?patch-possibly-applied-elsewhere}
%patch02001 -p1
%endif
%patch02002 -p1
%patch02003 -p1
%patch02004 -p1
%patch03000 -p1
%patch03001 -p1
%patch04000 -p1
%patch05000 -p1
%patch11000 -p1
%patch13000 -p1
%else
%autosetup -p1 -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
%endif
#setup -q -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
#PATCH_EXEC
#else
#autosetup -p1 -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
%autosetup -p1 -n %{srcname}-%{srcver}
#endif
%if "%{name}" == "qemu"
# Specific preparation steps for building qemu
@ -2030,6 +1704,7 @@ network adapters available with QEMU.
# - extra firmwares are built "manually" (see below) from their own sources
# (which, typically, are submodules checked out in the {srcdi}r/roms directory)
%define ppc_default_firmware %{nil}
#{vof.bin vof-nvram.bin}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define riscv64_default_firmware %{nil}
%define riscv64_extra_firmware {opensbi-riscv64-generic-fw_dynamic.bin}
@ -2093,11 +1768,9 @@ efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%build
%if %{legacy_qemu_kvm}
%ifarch s390x
# FIXME: Why are we copying the s390 specific one (SOURCE13)?
cp %{SOURCE13} docs/supported.rst
%else
cp %{SOURCE13} docs/supported.rst
%endif
sed -i '/^\ \ \ about\/index.*/i \ \ \ supported.rst' docs/index.rst
%endif
mkdir -p %blddir
@ -2109,22 +1782,33 @@ cd %blddir
# for them.
# TODO: Check whether we want to enable the followings:
# * avx2
# * avx512f
# * trace-backends=dtrace
# * debug-info
# * fuse
# * malloc-trim
# * multiprocess
# * qom-cast-debug
# * trace-backends=dtrace
#
# Fedora has avx2 enabled for ix86, while we can't (I tried). Guess it's
# because, for them, ix86 == i686 (while for us it's i586).
# Let's try to stick to _FORTIFY_SOURCE=2 for now
EXTRA_CFLAGS="$(echo %{optflags} | sed -E 's/-[A-Z]?_FORTIFY_SOURCE[=]?[0-9]*//g') -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
%srcdir/configure \
--docdir=%_docdir \
--extra-cflags="%{optflags}" \
--datadir=%_datadir \
--extra-cflags="${EXTRA_CFLAGS}" \
--firmwarepath=%_datadir/%name \
--libdir=%_libdir \
--libexecdir=%_libexecdir \
--localstatedir=%_localstatedir \
--prefix=%_prefix \
--python=%_bindir/python3 \
--sysconfdir=%_sysconfdir \
--with-git-submodules=ignore \
--with-pkgversion="%(echo '%{distro}' | sed 's/ (.*)//')" \
--python=%_bindir/python3 \
--disable-alsa \
--disable-attr \
--disable-auth-pam \
@ -2157,7 +1841,6 @@ cd %blddir
--disable-fdt \
--disable-fuse \
--disable-fuse-lseek \
--disable-fuzzing \
--disable-gcrypt \
--disable-gettext \
--disable-gio \
@ -2167,15 +1850,10 @@ cd %blddir
--disable-guest-agent \
--disable-guest-agent-msi \
--disable-hax \
--disable-hax \
--disable-hvf \
--disable-hvf \
--disable-iconv \
--disable-iconv \
--disable-install-blobs \
--disable-jack \
--disable-kvm \
--disable-kvm \
--disable-l2tpv3 \
--disable-libdaxctl \
--disable-libiscsi \
@ -2207,6 +1885,7 @@ cd %blddir
--disable-parallels \
--disable-pie \
--disable-plugins \
--disable-png \
--disable-pvrdma \
--disable-qcow1 \
--disable-qed \
@ -2228,7 +1907,6 @@ cd %blddir
--disable-sparse \
--disable-spice \
--disable-spice-protocol \
--disable-stack-protector \
--disable-strip \
--disable-system \
--disable-tcg \
@ -2243,24 +1921,19 @@ cd %blddir
--disable-vhost-crypto \
--disable-vhost-kernel \
--disable-vhost-net \
--disable-vhost-scsi \
--disable-vhost-user \
--disable-vhost-user-blk-server \
--disable-vhost-user-fs \
--disable-vhost-vdpa \
--disable-vhost-vsock \
--disable-virglrenderer \
--disable-virtfs \
--disable-virtiofsd \
--disable-vnc \
--disable-vnc-jpeg \
--disable-vnc-png \
--disable-vnc-sasl \
--disable-vte \
--disable-vvfat \
--disable-werror \
--disable-whpx \
--disable-whpx \
--disable-xen \
--disable-xen-pci-passthrough \
--disable-xkbcommon \
@ -2276,15 +1949,18 @@ cd %blddir
--enable-lto \
%endif
%if "%{name}" == "qemu-linux-user"
--static \
--disable-install-blobs \
--enable-attr \
--enable-coroutine-pool \
--enable-linux-user \
--enable-selinux \
--enable-tcg \
--static \
%else
--disable-linux-user \
--audio-drv-list=pa,alsa,jack,oss \
--enable-auth-pam \
%ifarch x86_64
--enable-avx2 \
--enable-libpmem \
--enable-xen \
--enable-xen-pci-passthrough \
@ -2308,8 +1984,10 @@ cd %blddir
--enable-attr \
--enable-bochs \
--enable-brlapi \
--enable-bpf \
--enable-bzip2 \
--enable-cap-ng \
--enable-capstone \
--enable-cloop \
--enable-coroutine-pool \
--enable-curl \
@ -2317,7 +1995,7 @@ cd %blddir
--enable-dbus-display \
--enable-dmg \
--enable-docs \
--enable-fdt \
--enable-fdt=system \
--enable-gcrypt \
--enable-gettext \
--enable-gio \
@ -2326,7 +2004,6 @@ cd %blddir
--enable-gtk \
--enable-guest-agent \
--enable-iconv \
--enable-install-blobs \
--enable-jack \
--enable-l2tpv3 \
--enable-libiscsi \
@ -2345,6 +2022,7 @@ cd %blddir
--enable-pa \
--enable-parallels \
--enable-pie \
--enable-png \
--enable-pvrdma \
--enable-qcow1 \
--enable-qed \
@ -2368,28 +2046,29 @@ cd %blddir
--enable-vhost-crypto \
--enable-vhost-kernel \
--enable-vhost-net \
--enable-vhost-scsi \
--enable-vhost-user \
--enable-vhost-user-blk-server \
--enable-vhost-user-fs \
--enable-vhost-vdpa \
--enable-vhost-vsock \
--enable-virglrenderer \
--enable-virtfs \
--enable-virtiofsd \
--enable-vnc \
--enable-vnc-jpeg \
--enable-vnc-png \
--enable-vnc-sasl \
--enable-vte \
--enable-vvfat \
--enable-werror \
--enable-xkbcommon \
--enable-zstd \
--with-coroutine=ucontext \
--with-default-devices
# End of configure option ("name == qemu-linux-user" above)
%endif
echo "=== Content of config-host.mak: ==="
cat config-host.mak
echo "=== ==="
%if "%{name}" == "qemu"
# For building QEMU and all the "default" firmwares, for each arch,
# for the package qemu, we first need to delete the firmware files that
@ -2560,6 +2239,7 @@ install -D -m 0644 %{SOURCE13} %{buildroot}%_docdir/qemu-s390x/supported.txt
%if %{legacy_qemu_kvm}
install -D -m 0644 %{SOURCE5} %{buildroot}%_mandir/man1/qemu-kvm.1.gz
install -d %{buildroot}%_docdir/qemu-kvm
# FIXME: Why do we onlly generate the HTML for the legacy package documentation?
%ifarch s390x
ln -s qemu-system-s390x %{buildroot}%_bindir/qemu-kvm
ln -s ../qemu-s390x/supported.txt %{buildroot}%_docdir/qemu-kvm/kvm-supported.txt
@ -2615,7 +2295,12 @@ done
# copied there during `make install`.
%if %{build_ppc_firmware}
# in support of update-alternatives
# In support of update-alternatives
#
# The reason why we do this, is because we have (only for PPC) an skiboot
# package, shipping an alternative version of skiboot.lid. That is, in fact,
# what's "on the other end" of us supporting update-alternatives for this
# particular firmware.
mv %{buildroot}%_datadir/%name/skiboot.lid %{buildroot}%_datadir/%name/skiboot.lid.qemu
# create a dummy target for /etc/alternatives/skiboot.lid
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
@ -2678,6 +2363,8 @@ cp %{SOURCE202} %{srcdir}/tests/data/acpi/microvm/
# This would be `make_build check-block`. But iotests are not reliable
# if ran in parallel in OBS, so let's be slow for now.
make -O V=1 VERBOSE=1 -j1 check-block
# Run qtests in parallel. If it becomes unreliable, we can try something
# like this: make -O V=1 VERBOSE=1 -j1 check-qtest
%make_build check-qtest
# Last step will be to run a full check-report, but we will
# enable this at a later point

View File

@ -110,6 +110,7 @@
%ifnarch %ix86 x86_64
%define _lto_cflags %{nil}
%endif
%define _lto_cflags %{nil}
%define generic_qemu_description \
QEMU provides full machine emulation and cross architecture usage. It closely\
@ -201,6 +202,7 @@ BuildRequires: cross-ppc64-gcc%gcc_version
%endif
%endif
%ifarch x86_64
BuildRequires: gcc-32bit
BuildRequires: pkgconfig(libpmem)
BuildRequires: xen-devel >= 4.2
%endif
@ -224,12 +226,15 @@ BuildRequires: brlapi-devel
BuildRequires: flex
BuildRequires: libaio-devel
BuildRequires: libattr-devel
BuildRequires: libbpf-devel
BuildRequires: libbz2-devel
BuildRequires: libcapstone-devel
BuildRequires: libfdt-devel >= 1.4.2
BuildRequires: libgcrypt-devel >= 1.8.0
BuildRequires: lzfse-devel
BuildRequires: Mesa-devel
BuildRequires: multipath-tools-devel
BuildRequires: pam-devel
BuildRequires: pkgconfig
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(epoxy)
@ -377,6 +382,7 @@ syscall layer occurs on the native hardware and operating system.
%_bindir/qemu-hexagon
%_bindir/qemu-hppa
%_bindir/qemu-i386
%_bindir/qemu-loongarch64
%_bindir/qemu-m68k
%_bindir/qemu-microblaze
%_bindir/qemu-microblazeel
@ -423,33 +429,18 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%dir %_datadir/%name
%dir %_datadir/%name/firmware
%dir %_datadir/%name/forsplits
%dir %_docdir/%name/about
%dir %_docdir/%name/devel
%dir %_docdir/%name/interop
%dir %_docdir/%name/specs
%dir %_docdir/%name/system
%dir %_docdir/%name/system/arm
%dir %_docdir/%name/system/devices
%dir %_docdir/%name/system/i386
%dir %_docdir/%name/system/ppc
%dir %_docdir/%name/system/riscv
%dir %_docdir/%name/system/s390x
%dir %_docdir/%name/tools
%dir %_docdir/%name/user
%dir %_datadir/%name/vhost-user
%dir %_sysconfdir/%name
%dir %_sysconfdir/%name/firmware
%dir /usr/lib/supportconfig
%dir /usr/lib/supportconfig/plugins
%doc %_docdir/%name
%if %{kvm_available}
%ifarch s390x
%{_prefix}/lib/modules-load.d/kvm.conf
%endif
/usr/lib/udev/rules.d/80-kvm.rules
%endif
%if %{legacy_qemu_kvm}
%_docdir/%name/supported.html
%endif
%_datadir/applications/qemu.desktop
%_datadir/icons/hicolor/16x16/apps/qemu.png
%_datadir/icons/hicolor/24x24/apps/qemu.png
@ -470,208 +461,6 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%_datadir/%name/qemu-nsis.bmp
%_datadir/%name/trace-events-all
%_datadir/%name/vhost-user/50-qemu-virtiofsd.json
%_docdir/%name/.buildinfo
%_docdir/%name/about/build-platforms.html
%_docdir/%name/about/deprecated.html
%_docdir/%name/about/index.html
%_docdir/%name/about/license.html
%_docdir/%name/about/removed-features.html
%_docdir/%name/dbus-dbusindex.html
%_docdir/%name/devel/atomics.html
%_docdir/%name/devel/bitops.html
%_docdir/%name/devel/block-coroutine-wrapper.html
%_docdir/%name/devel/build-system.html
%_docdir/%name/devel/ci.html
%_docdir/%name/devel/clocks.html
%_docdir/%name/devel/code-of-conduct.html
%_docdir/%name/devel/conflict-resolution.html
%_docdir/%name/devel/control-flow-integrity.html
%_docdir/%name/devel/decodetree.html
%_docdir/%name/devel/ebpf_rss.html
%_docdir/%name/devel/fuzzing.html
%_docdir/%name/devel/index-api.html
%_docdir/%name/devel/index-build.html
%_docdir/%name/devel/index-internals.html
%_docdir/%name/devel/index-process.html
%_docdir/%name/devel/index-tcg.html
%_docdir/%name/devel/index.html
%_docdir/%name/devel/kconfig.html
%_docdir/%name/devel/loads-stores.html
%_docdir/%name/devel/memory.html
%_docdir/%name/devel/migration.html
%_docdir/%name/devel/modules.html
%_docdir/%name/devel/multi-process.html
%_docdir/%name/devel/multi-thread-tcg.html
%_docdir/%name/devel/qapi-code-gen.html
%_docdir/%name/devel/qgraph.html
%_docdir/%name/devel/qom.html
%_docdir/%name/devel/qtest.html
%_docdir/%name/devel/reset.html
%_docdir/%name/devel/s390-dasd-ipl.html
%_docdir/%name/devel/secure-coding-practices.html
%_docdir/%name/devel/stable-process.html
%_docdir/%name/devel/style.html
%_docdir/%name/devel/submitting-a-patch.html
%_docdir/%name/devel/submitting-a-pull-request.html
%_docdir/%name/devel/tcg-icount.html
%_docdir/%name/devel/tcg-plugins.html
%_docdir/%name/devel/tcg.html
%_docdir/%name/devel/testing.html
%_docdir/%name/devel/tracing.html
%_docdir/%name/devel/trivial-patches.html
%_docdir/%name/devel/ui.html
%_docdir/%name/devel/vfio-migration.html
%_docdir/%name/devel/writing-monitor-commands.html
%_docdir/%name/genindex.html
%_docdir/%name/index.html
%_docdir/%name/interop/barrier.html
%_docdir/%name/interop/bitmaps.html
%_docdir/%name/interop/dbus-display.html
%_docdir/%name/interop/dbus-vmstate.html
%_docdir/%name/interop/dbus.html
%_docdir/%name/interop/index.html
%_docdir/%name/interop/live-block-operations.html
%_docdir/%name/interop/pr-helper.html
%_docdir/%name/interop/qemu-ga-ref.html
%_docdir/%name/interop/qemu-qmp-ref.html
%_docdir/%name/interop/qemu-storage-daemon-qmp-ref.html
%_docdir/%name/interop/vhost-user-gpu.html
%_docdir/%name/interop/vhost-user.html
%_docdir/%name/interop/vhost-vdpa.html
%_docdir/%name/interop/virtio-balloon-stats.html
%_docdir/%name/objects.inv
%_docdir/%name/search.html
%_docdir/%name/searchindex.js
%_docdir/%name/specs/acpi_cpu_hotplug.html
%_docdir/%name/specs/acpi_erst.html
%_docdir/%name/specs/acpi_hest_ghes.html
%_docdir/%name/specs/acpi_hw_reduced_hotplug.html
%_docdir/%name/specs/acpi_mem_hotplug.html
%_docdir/%name/specs/acpi_nvdimm.html
%_docdir/%name/specs/acpi_pci_hotplug.html
%_docdir/%name/specs/index.html
%_docdir/%name/specs/ppc-spapr-hcalls.html
%_docdir/%name/specs/ppc-spapr-hotplug.html
%_docdir/%name/specs/ppc-spapr-numa.html
%_docdir/%name/specs/ppc-spapr-uv-hcalls.html
%_docdir/%name/specs/ppc-spapr-xive.html
%_docdir/%name/specs/ppc-xive.html
%_docdir/%name/specs/sev-guest-firmware.html
%_docdir/%name/specs/tpm.html
%_docdir/%name/system/arm/aspeed.html
%_docdir/%name/system/arm/collie.html
%_docdir/%name/system/arm/cpu-features.html
%_docdir/%name/system/arm/cubieboard.html
%_docdir/%name/system/arm/digic.html
%_docdir/%name/system/arm/emcraft-sf2.html
%_docdir/%name/system/arm/emulation.html
%_docdir/%name/system/arm/gumstix.html
%_docdir/%name/system/arm/highbank.html
%_docdir/%name/system/arm/imx25-pdk.html
%_docdir/%name/system/arm/integratorcp.html
%_docdir/%name/system/arm/kzm.html
%_docdir/%name/system/arm/mainstone.html
%_docdir/%name/system/arm/mps2.html
%_docdir/%name/system/arm/musca.html
%_docdir/%name/system/arm/musicpal.html
%_docdir/%name/system/arm/nrf.html
%_docdir/%name/system/arm/nseries.html
%_docdir/%name/system/arm/nuvoton.html
%_docdir/%name/system/arm/orangepi.html
%_docdir/%name/system/arm/palm.html
%_docdir/%name/system/arm/raspi.html
%_docdir/%name/system/arm/realview.html
%_docdir/%name/system/arm/sabrelite.html
%_docdir/%name/system/arm/sbsa.html
%_docdir/%name/system/arm/stellaris.html
%_docdir/%name/system/arm/stm32.html
%_docdir/%name/system/arm/sx1.html
%_docdir/%name/system/arm/versatile.html
%_docdir/%name/system/arm/vexpress.html
%_docdir/%name/system/arm/virt.html
%_docdir/%name/system/arm/xlnx-versal-virt.html
%_docdir/%name/system/arm/xscale.html
%_docdir/%name/system/authz.html
%_docdir/%name/system/barrier.html
%_docdir/%name/system/bootindex.html
%_docdir/%name/system/confidential-guest-support.html
%_docdir/%name/system/cpu-hotplug.html
%_docdir/%name/system/device-emulation.html
%_docdir/%name/system/devices/can.html
%_docdir/%name/system/devices/ivshmem.html
%_docdir/%name/system/devices/net.html
%_docdir/%name/system/devices/nvme.html
%_docdir/%name/system/devices/usb.html
%_docdir/%name/system/devices/vhost-user-rng.html
%_docdir/%name/system/devices/vhost-user.html
%_docdir/%name/system/devices/virtio-pmem.html
%_docdir/%name/system/gdb.html
%_docdir/%name/system/generic-loader.html
%_docdir/%name/system/guest-loader.html
%_docdir/%name/system/i386/amd-memory-encryption.html
%_docdir/%name/system/i386/cpu.html
%_docdir/%name/system/i386/kvm-pv.html
%_docdir/%name/system/i386/microvm.html
%_docdir/%name/system/i386/pc.html
%_docdir/%name/system/i386/sgx.html
%_docdir/%name/system/images.html
%_docdir/%name/system/index.html
%_docdir/%name/system/invocation.html
%_docdir/%name/system/keys.html
%_docdir/%name/system/linuxboot.html
%_docdir/%name/system/managed-startup.html
%_docdir/%name/system/monitor.html
%_docdir/%name/system/multi-process.html
%_docdir/%name/system/mux-chardev.html
%_docdir/%name/system/ppc/embedded.html
%_docdir/%name/system/ppc/powermac.html
%_docdir/%name/system/ppc/powernv.html
%_docdir/%name/system/ppc/ppce500.html
%_docdir/%name/system/ppc/prep.html
%_docdir/%name/system/ppc/pseries.html
%_docdir/%name/system/pr-manager.html
%_docdir/%name/system/qemu-block-drivers.html
%_docdir/%name/system/qemu-cpu-models.html
%_docdir/%name/system/qemu-manpage.html
%_docdir/%name/system/quickstart.html
%_docdir/%name/system/riscv/microchip-icicle-kit.html
%_docdir/%name/system/riscv/shakti-c.html
%_docdir/%name/system/riscv/sifive_u.html
%_docdir/%name/system/riscv/virt.html
%_docdir/%name/system/s390x/3270.html
%_docdir/%name/system/s390x/bootdevices.html
%_docdir/%name/system/s390x/css.html
%_docdir/%name/system/s390x/protvirt.html
%_docdir/%name/system/s390x/vfio-ap.html
%_docdir/%name/system/s390x/vfio-ccw.html
%_docdir/%name/system/secrets.html
%_docdir/%name/system/security.html
%_docdir/%name/system/target-arm.html
%_docdir/%name/system/target-avr.html
%_docdir/%name/system/target-i386.html
%_docdir/%name/system/target-m68k.html
%_docdir/%name/system/target-mips.html
%_docdir/%name/system/target-ppc.html
%_docdir/%name/system/target-riscv.html
%_docdir/%name/system/target-rx.html
%_docdir/%name/system/target-s390x.html
%_docdir/%name/system/target-sparc.html
%_docdir/%name/system/target-sparc64.html
%_docdir/%name/system/target-xtensa.html
%_docdir/%name/system/targets.html
%_docdir/%name/system/tls.html
%_docdir/%name/system/virtio-net-failover.html
%_docdir/%name/system/vnc-security.html
%_docdir/%name/tools/index.html
%_docdir/%name/tools/qemu-img.html
%_docdir/%name/tools/qemu-nbd.html
%_docdir/%name/tools/qemu-pr-helper.html
%_docdir/%name/tools/qemu-storage-daemon.html
%_docdir/%name/tools/qemu-trace-stap.html
%_docdir/%name/tools/virtfs-proxy-helper.html
%_docdir/%name/tools/virtiofsd.html
%_docdir/%name/user/index.html
%_docdir/%name/user/main.html
%_mandir/man1/%name.1.gz
%_mandir/man1/qemu-storage-daemon.1.gz
%_mandir/man1/virtiofsd.1.gz
@ -681,8 +470,6 @@ This package acts as an umbrella package to the other QEMU sub-packages.
%_mandir/man7/qemu-ga-ref.7.gz
%_mandir/man7/qemu-storage-daemon-qmp-ref.7.gz
/usr/lib/supportconfig/plugins/%name
%doc %_docdir/%name/_static
%doc README.rst VERSION
%license COPYING COPYING.LIB LICENSE
%if %{kvm_available}
@ -746,8 +533,7 @@ This package provides i386 and x86_64 emulation.
%_datadir/%name/multiboot.bin
%_datadir/%name/multiboot_dma.bin
%_datadir/%name/pvh.bin
%dir %_docdir/qemu-x86
%_docdir/qemu-x86/supported.txt
%doc %_docdir/qemu-x86
%package ppc
Summary: Machine emulator and virtualizer for Power architectures
@ -775,8 +561,7 @@ This package provides ppc and ppc64 emulation.
%_datadir/%name/u-boot.e500
%_datadir/%name/u-boot-sam460-20100605.bin
%_datadir/%name/vof*.bin
%dir %_docdir/qemu-ppc
%_docdir/qemu-ppc/supported.txt
%doc %_docdir/qemu-ppc
%package s390x
Summary: Machine emulator and virtualizer for S/390 architectures
@ -797,8 +582,7 @@ This package provides s390x emulation.
%_bindir/qemu-system-s390x
%_datadir/%name/s390-ccw.img
%_datadir/%name/s390-netboot.img
%dir %_docdir/qemu-s390x
%_docdir/qemu-s390x/supported.txt
%doc %_docdir/qemu-s390x
%package arm
Summary: Machine emulator and virtualizer for ARM architectures
@ -821,8 +605,7 @@ This package provides arm emulation.
%_bindir/qemu-system-arm
%_bindir/qemu-system-aarch64
%_datadir/%name/npcm7xx_bootrom.bin
%dir %_docdir/qemu-arm
%_docdir/qemu-arm/supported.txt
%doc %_docdir/qemu-arm
%package extra
Summary: Machine emulator and virtualizer for "extra" architectures
@ -847,6 +630,7 @@ popular QEMU packages which are dedicated to a single architecture.)
%_bindir/qemu-system-avr
%_bindir/qemu-system-cris
%_bindir/qemu-system-hppa
%_bindir/qemu-system-loongarch64
%_bindir/qemu-system-m68k
%_bindir/qemu-system-microblaze
%_bindir/qemu-system-microblazeel
@ -1438,7 +1222,7 @@ a virtfs helper, ivshmem, disk utilities and scripts for various purposes.
%_mandir/man8/qemu-nbd.8.gz
%_mandir/man8/qemu-pr-helper.8.gz
%dir %_sysconfdir/%name
%config %_sysconfdir/%name/bridge.conf
%config(noreplace) %_sysconfdir/%name/bridge.conf
%post tools
%set_permissions %_libexecdir/qemu-bridge-helper
@ -1486,8 +1270,6 @@ to provide information and control at the guest OS level.
%files guest-agent
%defattr(-, root, root)
%attr(0755,root,kvm) %_bindir/qemu-ga
%dir %_docdir/%name/interop
%_docdir/%name/interop/qemu-ga.html
%_mandir/man8/qemu-ga.8.gz
%{_unitdir}/qemu-guest-agent.service
/usr/lib/udev/rules.d/80-qemu-ga.rules
@ -1594,6 +1376,7 @@ This package provides QTest accelerator for testing QEMU.
%_libdir/%name/accel-qtest-cris.so
%_libdir/%name/accel-qtest-hppa.so
%_libdir/%name/accel-qtest-i386.so
%_libdir/%name/accel-qtest-loongarch64.so
%_libdir/%name/accel-qtest-m68k.so
%_libdir/%name/accel-qtest-microblaze.so
%_libdir/%name/accel-qtest-microblazeel.so
@ -1663,9 +1446,7 @@ This package is an artifact of the early origins of QEMU, and is deprecated.
%files kvm
%defattr(-,root,root)
%_bindir/qemu-kvm
%dir %_docdir/qemu-kvm
%_docdir/qemu-kvm/kvm-supported.html
%_docdir/qemu-kvm/kvm-supported.txt
%doc %_docdir/qemu-kvm
%_mandir/man1/qemu-kvm.1.gz
# End of "if legacy_qemu_kvm"
%endif
@ -1841,15 +1622,16 @@ network adapters available with QEMU.
%endif
%prep
%if 0%{?sle_version} <= 150400
#if 0%{?sle_version} <= 150400
# Apparently, autosetup does not work, not even in 15.4. So,
# keep 'setup' plus the generated list of patches here for a
# while. Hopefully we'll be able to get rid of this soon enough.
%setup -q -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
PATCH_EXEC
%else
%autosetup -p1 -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
%endif
#setup -q -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
#PATCH_EXEC
#else
#autosetup -p1 -n %{srcname}-%{expand:%%(SV=%{srcver};echo ${SV%%%%+git*})}
%autosetup -p1 -n %{srcname}-%{srcver}
#endif
%if "%{name}" == "qemu"
# Specific preparation steps for building qemu
@ -1868,6 +1650,7 @@ PATCH_EXEC
# - extra firmwares are built "manually" (see below) from their own sources
# (which, typically, are submodules checked out in the {srcdi}r/roms directory)
%define ppc_default_firmware %{nil}
#{vof.bin vof-nvram.bin}
%define ppc_extra_firmware {skiboot.lid slof.bin}
%define riscv64_default_firmware %{nil}
%define riscv64_extra_firmware {opensbi-riscv64-generic-fw_dynamic.bin}
@ -1931,11 +1714,9 @@ efi-rtl8139.rom efi-virtio.rom efi-vmxnet3.rom}
%build
%if %{legacy_qemu_kvm}
%ifarch s390x
# FIXME: Why are we copying the s390 specific one (SOURCE13)?
cp %{SOURCE13} docs/supported.rst
%else
cp %{SOURCE13} docs/supported.rst
%endif
sed -i '/^\ \ \ about\/index.*/i \ \ \ supported.rst' docs/index.rst
%endif
mkdir -p %blddir
@ -1947,22 +1728,33 @@ cd %blddir
# for them.
# TODO: Check whether we want to enable the followings:
# * avx2
# * avx512f
# * trace-backends=dtrace
# * debug-info
# * fuse
# * malloc-trim
# * multiprocess
# * qom-cast-debug
# * trace-backends=dtrace
#
# Fedora has avx2 enabled for ix86, while we can't (I tried). Guess it's
# because, for them, ix86 == i686 (while for us it's i586).
# Let's try to stick to _FORTIFY_SOURCE=2 for now
EXTRA_CFLAGS="$(echo %{optflags} | sed -E 's/-[A-Z]?_FORTIFY_SOURCE[=]?[0-9]*//g') -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
%srcdir/configure \
--docdir=%_docdir \
--extra-cflags="%{optflags}" \
--datadir=%_datadir \
--extra-cflags="${EXTRA_CFLAGS}" \
--firmwarepath=%_datadir/%name \
--libdir=%_libdir \
--libexecdir=%_libexecdir \
--localstatedir=%_localstatedir \
--prefix=%_prefix \
--python=%_bindir/python3 \
--sysconfdir=%_sysconfdir \
--with-git-submodules=ignore \
--with-pkgversion="%(echo '%{distro}' | sed 's/ (.*)//')" \
--python=%_bindir/python3 \
--disable-alsa \
--disable-attr \
--disable-auth-pam \
@ -1995,7 +1787,6 @@ cd %blddir
--disable-fdt \
--disable-fuse \
--disable-fuse-lseek \
--disable-fuzzing \
--disable-gcrypt \
--disable-gettext \
--disable-gio \
@ -2005,15 +1796,10 @@ cd %blddir
--disable-guest-agent \
--disable-guest-agent-msi \
--disable-hax \
--disable-hax \
--disable-hvf \
--disable-hvf \
--disable-iconv \
--disable-iconv \
--disable-install-blobs \
--disable-jack \
--disable-kvm \
--disable-kvm \
--disable-l2tpv3 \
--disable-libdaxctl \
--disable-libiscsi \
@ -2045,6 +1831,7 @@ cd %blddir
--disable-parallels \
--disable-pie \
--disable-plugins \
--disable-png \
--disable-pvrdma \
--disable-qcow1 \
--disable-qed \
@ -2066,7 +1853,6 @@ cd %blddir
--disable-sparse \
--disable-spice \
--disable-spice-protocol \
--disable-stack-protector \
--disable-strip \
--disable-system \
--disable-tcg \
@ -2081,24 +1867,19 @@ cd %blddir
--disable-vhost-crypto \
--disable-vhost-kernel \
--disable-vhost-net \
--disable-vhost-scsi \
--disable-vhost-user \
--disable-vhost-user-blk-server \
--disable-vhost-user-fs \
--disable-vhost-vdpa \
--disable-vhost-vsock \
--disable-virglrenderer \
--disable-virtfs \
--disable-virtiofsd \
--disable-vnc \
--disable-vnc-jpeg \
--disable-vnc-png \
--disable-vnc-sasl \
--disable-vte \
--disable-vvfat \
--disable-werror \
--disable-whpx \
--disable-whpx \
--disable-xen \
--disable-xen-pci-passthrough \
--disable-xkbcommon \
@ -2114,15 +1895,18 @@ cd %blddir
--enable-lto \
%endif
%if "%{name}" == "qemu-linux-user"
--static \
--disable-install-blobs \
--enable-attr \
--enable-coroutine-pool \
--enable-linux-user \
--enable-selinux \
--enable-tcg \
--static \
%else
--disable-linux-user \
--audio-drv-list=pa,alsa,jack,oss \
--enable-auth-pam \
%ifarch x86_64
--enable-avx2 \
--enable-libpmem \
--enable-xen \
--enable-xen-pci-passthrough \
@ -2146,8 +1930,10 @@ cd %blddir
--enable-attr \
--enable-bochs \
--enable-brlapi \
--enable-bpf \
--enable-bzip2 \
--enable-cap-ng \
--enable-capstone \
--enable-cloop \
--enable-coroutine-pool \
--enable-curl \
@ -2155,7 +1941,7 @@ cd %blddir
--enable-dbus-display \
--enable-dmg \
--enable-docs \
--enable-fdt \
--enable-fdt=system \
--enable-gcrypt \
--enable-gettext \
--enable-gio \
@ -2164,7 +1950,6 @@ cd %blddir
--enable-gtk \
--enable-guest-agent \
--enable-iconv \
--enable-install-blobs \
--enable-jack \
--enable-l2tpv3 \
--enable-libiscsi \
@ -2183,6 +1968,7 @@ cd %blddir
--enable-pa \
--enable-parallels \
--enable-pie \
--enable-png \
--enable-pvrdma \
--enable-qcow1 \
--enable-qed \
@ -2206,28 +1992,29 @@ cd %blddir
--enable-vhost-crypto \
--enable-vhost-kernel \
--enable-vhost-net \
--enable-vhost-scsi \
--enable-vhost-user \
--enable-vhost-user-blk-server \
--enable-vhost-user-fs \
--enable-vhost-vdpa \
--enable-vhost-vsock \
--enable-virglrenderer \
--enable-virtfs \
--enable-virtiofsd \
--enable-vnc \
--enable-vnc-jpeg \
--enable-vnc-png \
--enable-vnc-sasl \
--enable-vte \
--enable-vvfat \
--enable-werror \
--enable-xkbcommon \
--enable-zstd \
--with-coroutine=ucontext \
--with-default-devices
# End of configure option ("name == qemu-linux-user" above)
%endif
echo "=== Content of config-host.mak: ==="
cat config-host.mak
echo "=== ==="
%if "%{name}" == "qemu"
# For building QEMU and all the "default" firmwares, for each arch,
# for the package qemu, we first need to delete the firmware files that
@ -2398,6 +2185,7 @@ install -D -m 0644 %{SOURCE13} %{buildroot}%_docdir/qemu-s390x/supported.txt
%if %{legacy_qemu_kvm}
install -D -m 0644 %{SOURCE5} %{buildroot}%_mandir/man1/qemu-kvm.1.gz
install -d %{buildroot}%_docdir/qemu-kvm
# FIXME: Why do we onlly generate the HTML for the legacy package documentation?
%ifarch s390x
ln -s qemu-system-s390x %{buildroot}%_bindir/qemu-kvm
ln -s ../qemu-s390x/supported.txt %{buildroot}%_docdir/qemu-kvm/kvm-supported.txt
@ -2453,7 +2241,12 @@ done
# copied there during `make install`.
%if %{build_ppc_firmware}
# in support of update-alternatives
# In support of update-alternatives
#
# The reason why we do this, is because we have (only for PPC) an skiboot
# package, shipping an alternative version of skiboot.lid. That is, in fact,
# what's "on the other end" of us supporting update-alternatives for this
# particular firmware.
mv %{buildroot}%_datadir/%name/skiboot.lid %{buildroot}%_datadir/%name/skiboot.lid.qemu
# create a dummy target for /etc/alternatives/skiboot.lid
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
@ -2516,6 +2309,8 @@ cp %{SOURCE202} %{srcdir}/tests/data/acpi/microvm/
# This would be `make_build check-block`. But iotests are not reliable
# if ran in parallel in OBS, so let's be slow for now.
make -O V=1 VERBOSE=1 -j1 check-block
# Run qtests in parallel. If it becomes unreliable, we can try something
# like this: make -O V=1 VERBOSE=1 -j1 check-qtest
%make_build check-qtest
# Last step will be to run a full check-report, but we will
# enable this at a later point

View File

@ -1,83 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Thu, 13 Aug 2020 13:16:13 -0600
Subject: qht: Revert some constification in qht.c
This change partially addresses https://bugs.launchpad.net/qemu/+bug/1886155
where a pre-release gcc 11 warns about const qualifier abuse.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
include/qemu/qht.h | 4 ++--
util/qht.c | 12 ++++++------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/qemu/qht.h b/include/qemu/qht.h
index 2e2d6bca932c83bea993850b60f8..6484837487b012cbfc63b6c6e39e 100644
--- a/include/qemu/qht.h
+++ b/include/qemu/qht.h
@@ -104,7 +104,7 @@ bool qht_insert(struct qht *ht, void *p, uint32_t hash, void **existing);
* Returns the corresponding pointer when a match is found.
* Returns NULL otherwise.
*/
-void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
+void *qht_lookup_custom(struct qht *ht, const void *userp, uint32_t hash,
qht_lookup_func_t func);
/**
@@ -115,7 +115,7 @@ void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
*
* Calls qht_lookup_custom() using @ht's default comparison function.
*/
-void *qht_lookup(const struct qht *ht, const void *userp, uint32_t hash);
+void *qht_lookup(struct qht *ht, const void *userp, uint32_t hash);
/**
* qht_remove - remove a pointer from the hash table
diff --git a/util/qht.c b/util/qht.c
index 0803c194d10b5cdafdc8b18ec083..24fdd3e0e23447b2ca67c0a1bc3a 100644
--- a/util/qht.c
+++ b/util/qht.c
@@ -486,10 +486,10 @@ bool qht_reset_size(struct qht *ht, size_t n_elems)
}
static inline
-void *qht_do_lookup(const struct qht_bucket *head, qht_lookup_func_t func,
+void *qht_do_lookup(struct qht_bucket *head, qht_lookup_func_t func,
const void *userp, uint32_t hash)
{
- const struct qht_bucket *b = head;
+ struct qht_bucket *b = head;
int i;
do {
@@ -513,7 +513,7 @@ void *qht_do_lookup(const struct qht_bucket *head, qht_lookup_func_t func,
}
static __attribute__((noinline))
-void *qht_lookup__slowpath(const struct qht_bucket *b, qht_lookup_func_t func,
+void *qht_lookup__slowpath(struct qht_bucket *b, qht_lookup_func_t func,
const void *userp, uint32_t hash)
{
unsigned int version;
@@ -526,10 +526,10 @@ void *qht_lookup__slowpath(const struct qht_bucket *b, qht_lookup_func_t func,
return ret;
}
-void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
+void *qht_lookup_custom(struct qht *ht, const void *userp, uint32_t hash,
qht_lookup_func_t func)
{
- const struct qht_bucket *b;
+ struct qht_bucket *b;
const struct qht_map *map;
unsigned int version;
void *ret;
@@ -549,7 +549,7 @@ void *qht_lookup_custom(const struct qht *ht, const void *userp, uint32_t hash,
return qht_lookup__slowpath(b, func, userp, hash);
}
-void *qht_lookup(const struct qht *ht, const void *userp, uint32_t hash)
+void *qht_lookup(struct qht *ht, const void *userp, uint32_t hash)
{
return qht_lookup_custom(ht, userp, hash, ht->cmp);
}

View File

@ -1,32 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Mon, 25 Jan 2021 22:09:27 -0700
Subject: qom: handle case of chardev-spice module unavailability
When qemu is built with modules, but a given module doesn't load
qemu should handle that gracefully. When chardev-spice.so isn't
able to be loaded and qemu is invoked with -display spice-app,
qemu will reach an abort call. Explicitly detect these conditions
and error out in a normal way before we reach the abort.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
qom/object.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/qom/object.c b/qom/object.c
index d34608558e9e5e53f4b363774f06..ce9f80117e518640b89fb1afa7d3 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -238,6 +238,12 @@ static bool type_is_ancestor(TypeImpl *type, TypeImpl *target_type)
return true;
}
+
+ if (type->parent && !strcmp(type->parent, "chardev-spiceport")) {
+ if (!type->parent_type && !type_get_by_name(type->parent)) {
+ return false;
+ }
+ }
type = type_get_parent(type);
}

View File

@ -2,26 +2,25 @@ From: Bruce Rogers <brogers@suse.com>
Date: Mon, 23 Nov 2020 07:13:23 -0700
Subject: roms/Makefile: add --cross-file to qboot meson setup for aarch64
Include-If: %ifarch aarch64
We conditionally add a --cross-file reference so that we can do
cross compilation of qboot from an aarch64 build.
We add a --cross-file reference so that we can do cross compilation
of qboot from an aarch64 build.
Signed-off-by: Bruce Rogers <brogers@suse.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
roms/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/roms/Makefile b/roms/Makefile
index c7c6e973db59572e8b8bee74e969..6f979016c273246ce91432ee0ace 100644
index 3d53bd528666b594ab3d6b631450..0e652aff895fe0680cf35e43b299 100644
--- a/roms/Makefile
+++ b/roms/Makefile
@@ -197,7 +197,7 @@ MESON = meson
@@ -199,7 +199,7 @@ MESON = meson
NINJA = ninja
qboot:
mkdir -p qboot/build
- $(MESON) setup $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
+ $(MESON) setup --cross-file qboot/cross.ini $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
+ $(MESON) setup $(if $(x86_64_cross_prefix),--cross-file qboot/cross.ini,) $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
$(NINJA) -C qboot/build
cp qboot/build/bios.bin ../pc-bios/qboot.rom

View File

@ -20,10 +20,10 @@ Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 343b51c2c0ab5dc7fb792aeb6458..513b10bed0f4279dc4077a31c66f 100644
index aa3ae417ac726e9decf7e678e25f..8eb65f5f81bd4e998966571a3741 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -391,7 +391,10 @@ static void scsi_write_complete(void * opaque, int ret)
@@ -397,7 +397,10 @@ static void scsi_write_complete(void * opaque, int ret)
aio_context_acquire(blk_get_aio_context(s->conf.blk));

View File

@ -78,10 +78,10 @@ Signed-off-by: Lin Ma <lma@suse.com>
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c
index 0306ccc7b1e4827a67aaed926f93..343b51c2c0ab5dc7fb792aeb6458 100644
index 3d35d307e1a2dcb1390b7c319b85..aa3ae417ac726e9decf7e678e25f 100644
--- a/hw/scsi/scsi-generic.c
+++ b/hw/scsi/scsi-generic.c
@@ -315,11 +315,17 @@ static void scsi_read_complete(void * opaque, int ret)
@@ -322,11 +322,17 @@ static void scsi_read_complete(void * opaque, int ret)
if (r->req.cmd.buf[0] == READ_CAPACITY_10 &&
(ldl_be_p(&r->buf[0]) != 0xffffffffU || s->max_lba == 0)) {
s->blocksize = ldl_be_p(&r->buf[4]);
@ -99,5 +99,5 @@ index 0306ccc7b1e4827a67aaed926f93..343b51c2c0ab5dc7fb792aeb6458 100644
+ s->max_lba = bs->total_sectors - 1;
+ stq_be_p(&r->buf[0], s->max_lba);
}
blk_set_guest_block_size(s->conf.blk, s->blocksize);
/*

View File

@ -1,36 +0,0 @@
From: Mauro Matteo Cascella <mcascell@redhat.com>
Date: Tue, 5 Jul 2022 22:05:43 +0200
Subject: scsi/lsi53c895a: fix use-after-free in lsi_do_msgout (CVE-2022-0216)
Git-commit: 6c8fa961da5e60f574bb52fd3ad44b1e9e8ad4b8
References: bsc#1198038, CVE-2022-0216
Set current_req->req to NULL to prevent reusing a free'd buffer in case of
repeated SCSI cancel requests. Thanks to Thomas Huth for suggesting the patch.
Fixes: CVE-2022-0216
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220705200543.2366809-1-mcascell@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/scsi/lsi53c895a.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index c8773f73f75610add97008c67523..99ea42d49b08c301406db810ffef 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1028,8 +1028,9 @@ static void lsi_do_msgout(LSIState *s)
case 0x0d:
/* The ABORT TAG message clears the current I/O process only. */
trace_lsi_do_msgout_abort(current_tag);
- if (current_req) {
+ if (current_req && current_req->req) {
scsi_req_cancel(current_req->req);
+ current_req->req = NULL;
}
lsi_disconnect(s);
break;

View File

@ -1,141 +0,0 @@
From: Mauro Matteo Cascella <mcascell@redhat.com>
Date: Mon, 11 Jul 2022 14:33:16 +0200
Subject: scsi/lsi53c895a: really fix use-after-free in lsi_do_msgout
(CVE-2022-0216)
Git-commit: 4367a20cc442c56b05611b4224de9a61908f9eac
References: bsc#1198038, CVE-2022-0216
Set current_req to NULL, not current_req->req, to prevent reusing a free'd
buffer in case of repeated SCSI cancel requests. Also apply the fix to
CLEAR QUEUE and BUS DEVICE RESET messages as well, since they also cancel
the request.
Thanks to Alexander Bulekov for providing a reproducer.
Fixes: CVE-2022-0216
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/972
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Tested-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20220711123316.421279-1-mcascell@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
hw/scsi/lsi53c895a.c | 3 +-
tests/qtest/fuzz-lsi53c895a-test.c | 76 ++++++++++++++++++++++++++++++
2 files changed, 78 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/lsi53c895a.c b/hw/scsi/lsi53c895a.c
index 99ea42d49b08c301406db810ffef..ad5f5e5f394f27665feaf7e265eb 100644
--- a/hw/scsi/lsi53c895a.c
+++ b/hw/scsi/lsi53c895a.c
@@ -1030,7 +1030,7 @@ static void lsi_do_msgout(LSIState *s)
trace_lsi_do_msgout_abort(current_tag);
if (current_req && current_req->req) {
scsi_req_cancel(current_req->req);
- current_req->req = NULL;
+ current_req = NULL;
}
lsi_disconnect(s);
break;
@@ -1056,6 +1056,7 @@ static void lsi_do_msgout(LSIState *s)
/* clear the current I/O process */
if (s->current) {
scsi_req_cancel(s->current->req);
+ current_req = NULL;
}
/* As the current implemented devices scsi_disk and scsi_generic
diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
index ba5d468970cf9da86615d55211bf..c1af0ab1ce62350b7455b953cf83 100644
--- a/tests/qtest/fuzz-lsi53c895a-test.c
+++ b/tests/qtest/fuzz-lsi53c895a-test.c
@@ -8,6 +8,79 @@
#include "qemu/osdep.h"
#include "libqos/libqtest.h"
+/*
+ * This used to trigger a UAF in lsi_do_msgout()
+ * https://gitlab.com/qemu-project/qemu/-/issues/972
+ */
+static void test_lsi_do_msgout_cancel_req(void)
+{
+ QTestState *s;
+
+ if (sizeof(void *) == 4) {
+ g_test_skip("memory size too big for 32-bit build");
+ return;
+ }
+
+ s = qtest_init("-M q35 -m 4G -display none -nodefaults "
+ "-device lsi53c895a,id=scsi "
+ "-device scsi-hd,drive=disk0 "
+ "-drive file=null-co://,id=disk0,if=none,format=raw");
+
+ qtest_outl(s, 0xcf8, 0x80000810);
+ qtest_outl(s, 0xcf8, 0xc000);
+ qtest_outl(s, 0xcf8, 0x80000810);
+ qtest_outw(s, 0xcfc, 0x7);
+ qtest_outl(s, 0xcf8, 0x80000810);
+ qtest_outl(s, 0xcfc, 0xc000);
+ qtest_outl(s, 0xcf8, 0x80000804);
+ qtest_outw(s, 0xcfc, 0x05);
+ qtest_writeb(s, 0x69736c10, 0x08);
+ qtest_writeb(s, 0x69736c13, 0x58);
+ qtest_writeb(s, 0x69736c1a, 0x01);
+ qtest_writeb(s, 0x69736c1b, 0x06);
+ qtest_writeb(s, 0x69736c22, 0x01);
+ qtest_writeb(s, 0x69736c23, 0x07);
+ qtest_writeb(s, 0x69736c2b, 0x02);
+ qtest_writeb(s, 0x69736c48, 0x08);
+ qtest_writeb(s, 0x69736c4b, 0x58);
+ qtest_writeb(s, 0x69736c52, 0x04);
+ qtest_writeb(s, 0x69736c53, 0x06);
+ qtest_writeb(s, 0x69736c5b, 0x02);
+ qtest_outl(s, 0xc02d, 0x697300);
+ qtest_writeb(s, 0x5a554662, 0x01);
+ qtest_writeb(s, 0x5a554663, 0x07);
+ qtest_writeb(s, 0x5a55466a, 0x10);
+ qtest_writeb(s, 0x5a55466b, 0x22);
+ qtest_writeb(s, 0x5a55466c, 0x5a);
+ qtest_writeb(s, 0x5a55466d, 0x5a);
+ qtest_writeb(s, 0x5a55466e, 0x34);
+ qtest_writeb(s, 0x5a55466f, 0x5a);
+ qtest_writeb(s, 0x5a345a5a, 0x77);
+ qtest_writeb(s, 0x5a345a5b, 0x55);
+ qtest_writeb(s, 0x5a345a5c, 0x51);
+ qtest_writeb(s, 0x5a345a5d, 0x27);
+ qtest_writeb(s, 0x27515577, 0x41);
+ qtest_outl(s, 0xc02d, 0x5a5500);
+ qtest_writeb(s, 0x364001d0, 0x08);
+ qtest_writeb(s, 0x364001d3, 0x58);
+ qtest_writeb(s, 0x364001da, 0x01);
+ qtest_writeb(s, 0x364001db, 0x26);
+ qtest_writeb(s, 0x364001dc, 0x0d);
+ qtest_writeb(s, 0x364001dd, 0xae);
+ qtest_writeb(s, 0x364001de, 0x41);
+ qtest_writeb(s, 0x364001df, 0x5a);
+ qtest_writeb(s, 0x5a41ae0d, 0xf8);
+ qtest_writeb(s, 0x5a41ae0e, 0x36);
+ qtest_writeb(s, 0x5a41ae0f, 0xd7);
+ qtest_writeb(s, 0x5a41ae10, 0x36);
+ qtest_writeb(s, 0x36d736f8, 0x0c);
+ qtest_writeb(s, 0x36d736f9, 0x80);
+ qtest_writeb(s, 0x36d736fa, 0x0d);
+ qtest_outl(s, 0xc02d, 0x364000);
+
+ qtest_quit(s);
+}
+
/*
* This used to trigger the assert in lsi_do_dma()
* https://bugs.launchpad.net/qemu/+bug/697510
@@ -48,5 +121,8 @@ int main(int argc, char **argv)
test_lsi_do_dma_empty_queue);
}
+ qtest_add_func("fuzz/lsi53c895a/lsi_do_msgout_cancel_req",
+ test_lsi_do_msgout_cancel_req);
+
return g_test_run();
}

View File

@ -1,67 +0,0 @@
From: Richard Henderson <richard.henderson@linaro.org>
Date: Tue, 21 Jun 2022 08:38:29 -0700
Subject: softmmu: Always initialize xlat in address_space_translate_for_iotlb
Git-commit: 418ade7849ce7641c0f7333718caf5091a02fd4c
References: bsc#1201367, CVE-2022-35414
The bug is an uninitialized memory read, along the translate_fail
path, which results in garbage being read from iotlb_to_section,
which can lead to a crash in io_readx/io_writex.
The bug may be fixed by writing any value with zero
in ~TARGET_PAGE_MASK, so that the call to iotlb_to_section using
the xlat'ed address returns io_mem_unassigned, as desired by the
translate_fail path.
It is most useful to record the original physical page address,
which will eventually be logged by memory_region_access_valid
when the access is rejected by unassigned_mem_accepts.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1065
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220621153829.366423-1-richard.henderson@linaro.org>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
softmmu/physmem.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 02aa7205a4992a678414111f625c..ce398f425793f209a896497ccaba 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -669,7 +669,7 @@ void tcg_iommu_init_notifier_list(CPUState *cpu)
/* Called from RCU critical section */
MemoryRegionSection *
-address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
+address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr orig_addr,
hwaddr *xlat, hwaddr *plen,
MemTxAttrs attrs, int *prot)
{
@@ -678,6 +678,7 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
IOMMUMemoryRegionClass *imrc;
IOMMUTLBEntry iotlb;
int iommu_idx;
+ hwaddr addr = orig_addr;
AddressSpaceDispatch *d =
qatomic_rcu_read(&cpu->cpu_ases[asidx].memory_dispatch);
@@ -722,6 +723,16 @@ address_space_translate_for_iotlb(CPUState *cpu, int asidx, hwaddr addr,
return section;
translate_fail:
+ /*
+ * We should be given a page-aligned address -- certainly
+ * tlb_set_page_with_attrs() does so. The page offset of xlat
+ * is used to index sections[], and PHYS_SECTION_UNASSIGNED = 0.
+ * The page portion of xlat will be logged by memory_region_access_valid()
+ * when this memory access is rejected, so use the original untranslated
+ * physical address.
+ */
+ assert((orig_addr & ~TARGET_PAGE_MASK) == 0);
+ *xlat = orig_addr;
return &d->map.sections[PHYS_SECTION_UNASSIGNED];
}

View File

@ -1,35 +0,0 @@
From: =?UTF-8?q?Martin=20Li=C5=A1ka?= <mliska@suse.cz>
Date: Fri, 24 Jun 2022 15:42:55 +0100
Subject: sphinx: change default language to 'en'
Git-commit: ba1a6723f58640ba281bc952abc255e97c70bad5
References: bsc#1200557
Fixes the following Sphinx warning (treated as error) starting
with 5.0 release:
Warning, treated as error:
Invalid configuration value found: 'language = None'. Update your configuration to a valid langauge code. Falling back to 'en' (English).
Signed-off-by: Martin Liska <mliska@suse.cz>
Message-id: e91e51ee-48ac-437e-6467-98b56ee40042@suse.cz
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
docs/conf.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py
index 49dab44cca5a72637b4f892d7612..e33cf3d381211eacbf0114b194cb 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -126,7 +126,7 @@ finally:
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
-language = None
+language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.

View File

@ -1,25 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Sat, 5 Oct 2019 09:09:42 -0600
Subject: test: add mapping from arch of i686 to qemu_arch=i386
While we don't specifically set QEMU_PROG, the code which detects the
host architecture needs a little help mapping the output of uname -m to
what the qemu project uses to reference that architecture.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
tests/qemu-iotests/common.config | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/qemu-iotests/common.config b/tests/qemu-iotests/common.config
index 9bd1a5a6fc8367c336e9f51fe22f..e1c6ffa0cca3a8f14feeb38d6da8 100644
--- a/tests/qemu-iotests/common.config
+++ b/tests/qemu-iotests/common.config
@@ -24,6 +24,7 @@ PATH=".:$PATH"
HOSTOS=$(uname -s)
arch=$(uname -m)
[[ "$arch" =~ "ppc64" ]] && qemu_arch=ppc64 || qemu_arch="$arch"
+[[ "$arch" = "i686" ]] && qemu_arch=i386
# make sure we have a standard umask
umask 022

View File

@ -1,107 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Tue, 15 Oct 2019 11:16:14 -0600
Subject: tests: Fix block tests to be compatible with membarrier configuration
The use of membarriers collides with the block test's practice of
SIGKILLing test vm's. Have them quit politely. Tests: 130, 153 - and
though test 161 seems to have the same issue, it is not yet fixed, but
just marked here as possibly needing a fix.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
tests/qemu-iotests/130 | 6 ++++--
tests/qemu-iotests/130.out | 2 ++
tests/qemu-iotests/153 | 6 ++++--
tests/qemu-iotests/153.out | 4 ++++
4 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/tests/qemu-iotests/130 b/tests/qemu-iotests/130
index 7257f096774f6e9e835479006ba4..bfb7bfda6b4d0925fccc87853cd2 100755
--- a/tests/qemu-iotests/130
+++ b/tests/qemu-iotests/130
@@ -64,7 +64,8 @@ echo
_launch_qemu -drive id=testdisk,file="$TEST_IMG",backing.file.filename="$TEST_IMG.base"
_send_qemu_cmd $QEMU_HANDLE "commit testdisk" "(qemu)"
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
-_cleanup_qemu
+_send_qemu_cmd $QEMU_HANDLE 'quit' ''
+wait=1 _cleanup_qemu
_img_info | _filter_img_info
# Make sure that if there was a backing file that was just overridden on the
@@ -73,7 +74,8 @@ _make_test_img -F raw -b "$TEST_IMG.orig" 64M
_launch_qemu -drive id=testdisk,file="$TEST_IMG",backing.file.filename="$TEST_IMG.base",backing.driver=$IMGFMT
_send_qemu_cmd $QEMU_HANDLE "commit testdisk" "(qemu)"
_send_qemu_cmd $QEMU_HANDLE '' '(qemu)'
-_cleanup_qemu
+_send_qemu_cmd $QEMU_HANDLE 'quit' ''
+wait=1 _cleanup_qemu
_img_info | _filter_img_info
echo
diff --git a/tests/qemu-iotests/130.out b/tests/qemu-iotests/130.out
index e45285ccc311522481ac1b27ba99..7168bdf70c3eb32d4de0d28bb947 100644
--- a/tests/qemu-iotests/130.out
+++ b/tests/qemu-iotests/130.out
@@ -11,6 +11,7 @@ virtual size: 64 MiB (67108864 bytes)
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) commit testdisk
(qemu)
+(qemu) quit
image: TEST_DIR/t.IMGFMT
file format: IMGFMT
virtual size: 64 MiB (67108864 bytes)
@@ -18,6 +19,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=TEST_DIR/t
QEMU X.Y.Z monitor - type 'help' for more information
(qemu) commit testdisk
(qemu)
+(qemu) quit
image: TEST_DIR/t.IMGFMT
file format: IMGFMT
virtual size: 64 MiB (67108864 bytes)
diff --git a/tests/qemu-iotests/153 b/tests/qemu-iotests/153
index 9bc3be8f75c5a791331868d51136..9875eaf25981d557e403c3471633 100755
--- a/tests/qemu-iotests/153
+++ b/tests/qemu-iotests/153
@@ -202,7 +202,8 @@ _send_qemu_cmd $QEMU_HANDLE \
'return'
_run_cmd $QEMU_IMG commit -b "${TEST_IMG}.b" "${TEST_IMG}.c"
-_cleanup_qemu
+_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'quit' }" ''
+wait=1 _cleanup_qemu
_launch_qemu
@@ -254,7 +255,8 @@ _send_qemu_cmd $QEMU_HANDLE \
_run_cmd $QEMU_IO "${TEST_IMG}" -c 'write 0 512'
-_cleanup_qemu
+_send_qemu_cmd $QEMU_HANDLE "{ 'execute': 'quit' }" ''
+wait=1 _cleanup_qemu
echo
echo "== Detecting -U and force-share conflicts =="
diff --git a/tests/qemu-iotests/153.out b/tests/qemu-iotests/153.out
index ff8e55864a53501197bb4a66bf99..4e9c4607bdb3d46c24bad9e80f64 100644
--- a/tests/qemu-iotests/153.out
+++ b/tests/qemu-iotests/153.out
@@ -424,6 +424,8 @@ Is another process using the image [TEST_DIR/t.qcow2]?
_qemu_img_wrapper commit -b TEST_DIR/t.qcow2.b TEST_DIR/t.qcow2.c
{ 'execute': 'qmp_capabilities' }
{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
+{"return": {}}
Adding drive
{ 'execute': 'human-monitor-command',
'arguments': { 'command-line': 'drive_add 0 if=none,id=d0,file=TEST_DIR/t.IMGFMT' } }
@@ -463,6 +465,8 @@ Closing the other
{"return": ""}
_qemu_io_wrapper TEST_DIR/t.qcow2 -c write 0 512
+{"return": {}}
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false, "reason": "host-qmp-quit"}}
== Detecting -U and force-share conflicts ==

View File

@ -2,6 +2,8 @@ From: Bruce Rogers <brogers@suse.com>
Date: Mon, 11 Mar 2019 22:02:37 -0600
Subject: tests: change error message in test 162
Git-commit: 0000000000000000000000000000000000000000
Since we have a quite restricted execution environment, as far as
networking is concerned, we need to change the error message we expect
in test 162. There is actually no routing set up so the error we get is

View File

@ -3,6 +3,8 @@ Date: Tue, 20 Nov 2018 15:46:41 -0700
Subject: tests/qemu-iotests: Triple timeout of i/o tests due to obs
environment
Git-commit: 0000000000000000000000000000000000000000
Executing tests in obs is very fickle, since you aren't guaranteed
reliable cpu time. Triple the timeout for each test to help ensure
we don't fail a test because the stars align against us.

View File

@ -1,170 +0,0 @@
From: Thomas Huth <thuth@redhat.com>
Date: Thu, 14 Apr 2022 15:01:27 +0200
Subject: tests/qtest: Move the fuzz tests to x86 only
Git-commit: b911c30c566dee48a27bc1bfa1ee6df3a729cbbb
The fuzz tests are currently scheduled for all targets, but their setup
code limits the run to "i386", so that these tests always show "SKIP"
on other targets. Move it to the right x86 list in meson.build, then
we can drop the architecture check during runtime, too.
Message-Id: <20220414130127.719528-1-thuth@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
---
tests/qtest/fuzz-lsi53c895a-test.c | 8 ++------
tests/qtest/fuzz-megasas-test.c | 12 ++++--------
tests/qtest/fuzz-sb16-test.c | 12 ++++--------
tests/qtest/fuzz-sdcard-test.c | 12 ++++--------
tests/qtest/fuzz-virtio-scsi-test.c | 8 ++------
tests/qtest/meson.build | 13 ++++++-------
6 files changed, 22 insertions(+), 43 deletions(-)
diff --git a/tests/qtest/fuzz-lsi53c895a-test.c b/tests/qtest/fuzz-lsi53c895a-test.c
index c1af0ab1ce62350b7455b953cf83..df019114d31b10dc1e7768534a0a 100644
--- a/tests/qtest/fuzz-lsi53c895a-test.c
+++ b/tests/qtest/fuzz-lsi53c895a-test.c
@@ -112,14 +112,10 @@ static void test_lsi_do_dma_empty_queue(void)
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
-
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
- qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
- test_lsi_do_dma_empty_queue);
- }
+ qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
+ test_lsi_do_dma_empty_queue);
qtest_add_func("fuzz/lsi53c895a/lsi_do_msgout_cancel_req",
test_lsi_do_msgout_cancel_req);
diff --git a/tests/qtest/fuzz-megasas-test.c b/tests/qtest/fuzz-megasas-test.c
index e1141c58a4ec77d50279d1a53443..129b182f830c1e73b9a994bbeae9 100644
--- a/tests/qtest/fuzz-megasas-test.c
+++ b/tests/qtest/fuzz-megasas-test.c
@@ -64,16 +64,12 @@ static void test_gitlab_issue521_megasas_sgl_ovf(void)
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
-
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
- qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt",
- test_lp1878263_megasas_zero_iov_cnt);
- qtest_add_func("fuzz/gitlab_issue521_megasas_sgl_ovf",
- test_gitlab_issue521_megasas_sgl_ovf);
- }
+ qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt",
+ test_lp1878263_megasas_zero_iov_cnt);
+ qtest_add_func("fuzz/gitlab_issue521_megasas_sgl_ovf",
+ test_gitlab_issue521_megasas_sgl_ovf);
return g_test_run();
}
diff --git a/tests/qtest/fuzz-sb16-test.c b/tests/qtest/fuzz-sb16-test.c
index f47a8bcdbd91eece6aee03f66070..91fdcd1e8a0f8b4095f8374a3750 100644
--- a/tests/qtest/fuzz-sb16-test.c
+++ b/tests/qtest/fuzz-sb16-test.c
@@ -55,15 +55,11 @@ static void test_fuzz_sb16_0xd4(void)
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
-
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "i386") == 0) {
- qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
- qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
- qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
- }
+ qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
+ qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
+ qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
- return g_test_run();
+ return g_test_run();
}
diff --git a/tests/qtest/fuzz-sdcard-test.c b/tests/qtest/fuzz-sdcard-test.c
index 0f94965a66e77cc52ed3a33fd93b..d0f4e0e93c0b0e23894b1f6a8095 100644
--- a/tests/qtest/fuzz-sdcard-test.c
+++ b/tests/qtest/fuzz-sdcard-test.c
@@ -164,15 +164,11 @@ static void oss_fuzz_36391(void)
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
-
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "i386") == 0) {
- qtest_add_func("fuzz/sdcard/oss_fuzz_29225", oss_fuzz_29225);
- qtest_add_func("fuzz/sdcard/oss_fuzz_36217", oss_fuzz_36217);
- qtest_add_func("fuzz/sdcard/oss_fuzz_36391", oss_fuzz_36391);
- }
+ qtest_add_func("fuzz/sdcard/oss_fuzz_29225", oss_fuzz_29225);
+ qtest_add_func("fuzz/sdcard/oss_fuzz_36217", oss_fuzz_36217);
+ qtest_add_func("fuzz/sdcard/oss_fuzz_36391", oss_fuzz_36391);
- return g_test_run();
+ return g_test_run();
}
diff --git a/tests/qtest/fuzz-virtio-scsi-test.c b/tests/qtest/fuzz-virtio-scsi-test.c
index aaf6d10e189d40ffd4b40c4f144e..c9b6fe21231d618cbaf336cada20 100644
--- a/tests/qtest/fuzz-virtio-scsi-test.c
+++ b/tests/qtest/fuzz-virtio-scsi-test.c
@@ -62,14 +62,10 @@ static void test_mmio_oob_from_memory_region_cache(void)
int main(int argc, char **argv)
{
- const char *arch = qtest_get_arch();
-
g_test_init(&argc, &argv, NULL);
- if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
- qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache",
- test_mmio_oob_from_memory_region_cache);
- }
+ qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache",
+ test_mmio_oob_from_memory_region_cache);
return g_test_run();
}
diff --git a/tests/qtest/meson.build b/tests/qtest/meson.build
index d25f82bb5ac0be9befb3e98de169..e860b0edf275cd68cd24516cb1ca 100644
--- a/tests/qtest/meson.build
+++ b/tests/qtest/meson.build
@@ -17,13 +17,7 @@ slow_qtests = {
'test-hmp' : 120,
}
-qtests_generic = \
- (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
- (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
- (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
- (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
- (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
- [
+qtests_generic = [
'cdrom-test',
'device-introspect-test',
'machine-none-test',
@@ -67,6 +61,11 @@ qtests_i386 = \
(config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) + \
(config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) + \
(config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) + \
+ (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
+ (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
+ (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
+ (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
+ (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
(config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) + \
(config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) + \
(config_all_devices.has_key('CONFIG_VIRTIO_NET') and \

View File

@ -17,6 +17,7 @@ set -e
clean_up_temp_dirs()
{
echo "Cleaning temporary files before exit"
exit
rm -rf $GIT_DIR
rm -rf $CMP_DIR
rm -rf $BUN_DIR
@ -470,7 +471,7 @@ while IFS= read -r line; do
PATCHES_BY_SUBMODULE_PATH[$INDEX]=$ACCUMULATED_PATCHES
break;
fi
if [[ "$line" =~ ^Patch[0-9]*:[\ ]*(.*)$ ]]; then
if [[ "$line" =~ ^#?Patch[0-9]*:[\ ]*(.*)$ ]]; then
PATCH="${BASH_REMATCH[1]}"
#echo "Patch is $PATCH"
ACCUMULATED_PATCHES="$ACCUMULATED_PATCHES $PATCH"
@ -680,9 +681,22 @@ find $BUN_DIR -mindepth 1 -delete
for package in $PKG; do
while IFS= read -r line; do
if [ "$line" = "PATCH_FILES" ]; then
SPNUM=1000
SP_PATCHES=$(mktemp /tmp/sp-patches-XXXX)
# Here (and other places below) we try to get ONLY the numbered patches, but it's possible some ACTUAL patch name actually starts with multiple digits, but EXTREMELY unlikely
# TODO: do this better!
for i in [0-9][0-9][0-9][0-9]*-*.patch; do
COMMENT=""
if grep "^Include-If: " $i &> /dev/null ; then
COMMENT="#"
if [[ "$NUMBERED_PATCHES" = "0" ]]; then
PATCH_NUMBER=${i%%-*}
echo -e "Source$SPNUM: ${i:${#PATCH_NUMBER}+1:40+1+5}" >> $SP_PATCHES
else
echo -e "Source$SPNUM: $i" >> $SP_PATCHES
fi
SPNUM=$((SPNUM+1))
fi
NUM=${i%%-*}
DIV=$((10#$NUM/$PATCH_RANGE))
REM=$((10#$NUM%$PATCH_RANGE))
@ -696,19 +710,23 @@ find $BUN_DIR -mindepth 1 -delete
if [[ "$FIVE_DIGIT_POTENTIAL" != "0" ]]; then
if [[ "$NUMBERED_PATCHES" = "0" ]]; then
PATCH_NUMBER=${i%%-*}
echo -e "Patch$NUM: ${i:${#PATCH_NUMBER}+1:40+1+5}"
echo -e "${COMMENT}Patch$NUM: ${i:${#PATCH_NUMBER}+1:40+1+5}"
else
echo -e "Patch$NUM: $i"
echo -e "${COMMENT}Patch$NUM: $i"
fi
else
if [[ "$NUMBERED_PATCHES" = "0" ]]; then
PATCH_NUMBER=${i%%-*}
echo -e "Patch$NUM: ${i:${#PATCH_NUMBER}+1:40+1+5}"
echo -e "${COMMENT}Patch$NUM: ${i:${#PATCH_NUMBER}+1:40+1+5}"
else
echo -e "Patch$NUM: $i"
echo -e "${COMMENT}Patch$NUM: $i"
fi
fi
done
echo
echo "# Patches that will be applied directly across the spec file"
cat $SP_PATCHES
elif [ "$line" = "PATCH_EXEC" ]; then
unset PREV_S
for i in [0-9][0-9][0-9][0-9]*-*.patch; do

View File

@ -1,43 +0,0 @@
From: Bruce Rogers <brogers@suse.com>
Date: Thu, 3 Dec 2020 16:48:13 -0700
Subject: usb: Help compiler out to avoid a warning on x86 compilation
Git-commit: 0000000000000000000000000000000000000000
Include-If: %ifarch %arm %ix86 ppc
There is an assert present which already should give the compiler
enough information about the value of i as used in the snprintf,
but if I remember right, for x86, because memory is tighter some of
the compiler smarts are turned off, so we get the uninformed warning
there and not on other archs. So on x86 only we'll add some code to
help the compiler out, so we can again compile qemu with
--enable-werror.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
hw/usb/hcd-xhci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 0cd0a5e540272a4183176ce8426d..2af21f0af68da3cd9d10f0e41f84 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3314,7 +3314,7 @@ static void usb_xhci_init(XHCIState *xhci)
USB_SPEED_MASK_FULL |
USB_SPEED_MASK_HIGH;
assert(i < XHCI_MAXPORTS);
- snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1);
+ snprintf(port->name, sizeof(port->name), "usb2 port #%d", i+1 < XHCI_MAXPORTS ? i+1 : 0);
speedmask |= port->speedmask;
}
if (i < xhci->numports_3) {
@@ -3328,7 +3328,7 @@ static void usb_xhci_init(XHCIState *xhci)
port->uport = &xhci->uports[i];
port->speedmask = USB_SPEED_MASK_SUPER;
assert(i < XHCI_MAXPORTS);
- snprintf(port->name, sizeof(port->name), "usb3 port #%d", i+1);
+ snprintf(port->name, sizeof(port->name), "usb3 port #%d", i+1 < XHCI_MAXPORTS ? i+1 : 0);
speedmask |= port->speedmask;
}
usb_register_port(&xhci->bus, &xhci->uports[i], xhci, i,

View File

@ -15,10 +15,10 @@ Signed-off-by: Bruce Rogers <brogers@suse.com>
1 file changed, 3 insertions(+)
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 07b3be7b9b9f6093642363f13187..b0fe7583f9de18bfe75109e3f194 100644
index 4c7f17c253e97bd747347aca3063..46168753f3dcc0d1795d5f567145 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -271,6 +271,9 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
@@ -270,6 +270,9 @@ static void xen_block_realize(XenDevice *xendev, Error **errp)
xen_block_set_size(blockdev);

View File

@ -27,10 +27,10 @@ Signed-off-by: Bruce Rogers <brogers@suse.com>
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/savevm.c b/migration/savevm.c
index 02ed94c180661c99970aebfe16a0..52251cf0afd48f919ad705544bf2 100644
index 48e85c052c2c0197405803b9ef83..58eea0775eaa78d5d0250cdcbcaf 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2966,7 +2966,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
@@ -2950,7 +2950,7 @@ void qmp_xen_save_devices_state(const char *filename, bool has_live, bool live,
* So call bdrv_inactivate_all (release locks) here to let the other
* side of the migration take control of the images.
*/

View File

@ -18,10 +18,10 @@ Signed-off-by: Olaf Hering <olaf@aepfle.de>
1 file changed, 12 insertions(+)
diff --git a/hw/block/xen-block.c b/hw/block/xen-block.c
index 674953f1adeeaec6a81d9857144e..07b3be7b9b9f6093642363f13187 100644
index 345b284d70181727f17a64d51bf2..4c7f17c253e97bd747347aca3063 100644
--- a/hw/block/xen-block.c
+++ b/hw/block/xen-block.c
@@ -723,6 +723,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
@@ -722,6 +722,8 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
const char *mode = qdict_get_try_str(opts, "mode");
const char *direct_io_safe = qdict_get_try_str(opts, "direct-io-safe");
const char *discard_enable = qdict_get_try_str(opts, "discard-enable");
@ -30,7 +30,7 @@ index 674953f1adeeaec6a81d9857144e..07b3be7b9b9f6093642363f13187 100644
char *driver = NULL;
char *filename = NULL;
XenBlockDrive *drive = NULL;
@@ -803,6 +805,16 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
@@ -802,6 +804,16 @@ static XenBlockDrive *xen_block_drive_create(const char *id,
}
}