qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PULL 00/10] Misc HW patches for 2025-12-09
@ 2025-12-09 20:05 Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 01/10] osdep: Undefine FSCALE definition to fix Solaris builds Philippe Mathieu-Daudé
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

The following changes since commit 2257f52a97f28ce3be4366817ea8817ad866562b:

  Merge tag 'pull-10.2-final-fixes-051225-2' of https://gitlab.com/stsquad/qemu into staging (2025-12-05 12:38:37 -0600)

are available in the Git repository at:

  https://github.com/philmd/qemu.git tags/hw-misc-20251209

for you to fetch changes up to efd6b3d1768d04d5491b62ad7385f623fb12f627:

  Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer" (2025-12-09 21:00:15 +0100)

----------------------------------------------------------------
Misc HW / migration / typo fixes
----------------------------------------------------------------

Alano Song (1):
  hw/9pfs: Correct typo

Cédric Le Goater (1):
  Fix const qualifier build errors with recent glibc

Denis V. Lunev (1):
  scripts: fix broken error path in modinfo-collect.py

Hanna Czenczek (1):
  vhost: Always initialize cached vring data

Philippe Mathieu-Daudé (3):
  osdep: Undefine FSCALE definition to fix Solaris builds
  Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro"
  Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a
    pointer"

Stefan Weil (3):
  migration: Fix order of function arguments
  hw/pci: Fix typo in documentation
  scripts/nsis.py: Tell makensis that WoA is 64 bit

 include/hw/pci/pci.h           |  2 +-
 include/hw/virtio/virtio-net.h |  2 +-
 include/migration/vmstate.h    |  9 ++++++++
 include/qemu/osdep.h           |  6 ++++++
 backends/tpm/tpm_passthrough.c |  2 +-
 block/vmdk.c                   |  2 +-
 block/vvfat.c                  |  2 +-
 gdbstub/gdbstub.c              |  2 +-
 hw/9pfs/xen-9p-backend.c       |  2 +-
 hw/net/virtio-net.c            |  9 ++++----
 hw/virtio/vhost.c              | 38 ++++++++++++++++++++--------------
 migration/postcopy-ram.c       |  5 +++--
 qga/commands-linux.c           |  7 ++++---
 ui/ui-hmp-cmds.c               |  2 +-
 util/log.c                     |  2 +-
 scripts/modinfo-collect.py     |  2 +-
 scripts/nsis.py                |  2 +-
 17 files changed, 61 insertions(+), 35 deletions(-)

-- 
2.51.0



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PULL 01/10] osdep: Undefine FSCALE definition to fix Solaris builds
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 02/10] hw/9pfs: Correct typo Philippe Mathieu-Daudé
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

Solaris defines FSCALE in <sys/param.h>:

  301 /*
  302  * Scale factor for scaled integers used to count
  303  * %cpu time and load averages.
  304  */
  305 #define FSHIFT  8               /* bits to right of fixed binary point */
  306 #define FSCALE  (1<<FSHIFT)

When emulating the SVE FSCALE instruction, we defines the same name
in decodetree format in target/arm/tcg/sve.decode:

  1129:FSCALE          01100101 .. 00 1001 100 ... ..... .....    @rdn_pg_rm

This leads to a definition clash:

  In file included from ../target/arm/tcg/translate-sve.c:21:
  ../target/arm/tcg/translate.h:875:17: error: pasting "trans_" and "(" does not give a valid preprocessing token
    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                 ^~~~~~
  ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
   4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
        |     ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:12: error: expected declaration specifiers or '...' before numeric constant
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        |            ^~~~~~
  ../target/arm/tcg/translate.h:875:25: note: in definition of macro 'TRANS_FEAT'
    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                         ^~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  ../target/arm/tcg/translate.h:875:47: error: pasting "arg_" and "(" does not give a valid preprocessing token
    875 |     static bool trans_##NAME(DisasContext *s, arg_##NAME *a) \
        |                                               ^~~~
  ../target/arm/tcg/translate-sve.c:4205:5: note: in expansion of macro 'TRANS_FEAT'
   4205 |     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
        |     ^~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:1: note: in expansion of macro 'DO_ZPZZ_FP'
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        | ^~~~~~~~~~
  In file included from ../target/arm/tcg/translate-sve.c:100:
  libqemu-aarch64-softmmu.a.p/decode-sve.c.inc:1227:13: warning: 'trans_FSCALE' used but never defined
   1227 | static bool trans_FSCALE(DisasContext *ctx, arg_FSCALE *a);
        |             ^~~~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4249:30: warning: 'sve_fscalbn_zpzz_fns' defined but not used [-Wunused-const-variable=]
   4249 | DO_ZPZZ_FP(FSCALE, aa64_sve, sve_fscalbn)
        |                              ^~~~~~~~~~~
  ../target/arm/tcg/translate-sve.c:4201:42: note: in definition of macro 'DO_ZPZZ_FP'
   4201 |     static gen_helper_gvec_4_ptr * const name##_zpzz_fns[4] = { \
        |                                          ^~~~

As a kludge, undefine it globally in <qemu/osdep.h>.

Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20251203120315.62889-1-philmd@linaro.org>
---
 include/qemu/osdep.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h
index cf8d7cf7e61..3cb45a14678 100644
--- a/include/qemu/osdep.h
+++ b/include/qemu/osdep.h
@@ -141,6 +141,12 @@ QEMU_EXTERN_C int daemon(int, int);
 #undef ELF_DATA
 #undef ELF_ARCH
 
+/*
+ * Avoid conflict with Solaris FSCALE definition from <sys/param.h> header,
+ * but we might as well do this unconditionally.
+ */
+#undef FSCALE
+
 #ifdef CONFIG_IOVEC
 #include <sys/uio.h>
 #endif
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 02/10] hw/9pfs: Correct typo
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 01/10] osdep: Undefine FSCALE definition to fix Solaris builds Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 03/10] scripts: fix broken error path in modinfo-collect.py Philippe Mathieu-Daudé
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Alano Song <AlanoSong@163.com>

Correct comment typo in xen_9pfs_bh()

Signed-off-by: Alano Song <AlanoSong@163.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20251202132132.17636-1-AlanoSong@163.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/9pfs/xen-9p-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/xen-9p-backend.c b/hw/9pfs/xen-9p-backend.c
index 79359d911a7..ca0fff5fa9b 100644
--- a/hw/9pfs/xen-9p-backend.c
+++ b/hw/9pfs/xen-9p-backend.c
@@ -310,7 +310,7 @@ static void xen_9pfs_bh(void *opaque)
 
 again:
     wait = ring->co != NULL && qemu_coroutine_entered(ring->co);
-    /* paired with the smb_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
+    /* paired with the smp_wmb barriers in xen_9pfs_init_in_iov_from_pdu */
     smp_rmb();
     if (wait) {
         cpu_relax();
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 03/10] scripts: fix broken error path in modinfo-collect.py
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 01/10] osdep: Undefine FSCALE definition to fix Solaris builds Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 02/10] hw/9pfs: Correct typo Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 04/10] vhost: Always initialize cached vring data Philippe Mathieu-Daudé
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: "Denis V. Lunev" <den@openvz.org>

sys.stderr.print is dropped long ago and should not be used. Official
replacement is sys.stderr.write

The problem has been found debugging building on some fancy platform
derived from Debian.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: John Snow <jsnow@redhat.com>
CC: Cleber Rosa <crosa@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251203220138.159656-1-den@openvz.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 scripts/modinfo-collect.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/modinfo-collect.py b/scripts/modinfo-collect.py
index 6ebaea989db..db78b16c1f5 100644
--- a/scripts/modinfo-collect.py
+++ b/scripts/modinfo-collect.py
@@ -41,7 +41,7 @@ def main(args):
     for obj in args:
         entry = compile_commands.get(obj, None)
         if not entry:
-            sys.stderr.print('modinfo: Could not find object file', obj)
+            sys.stderr.write(f'modinfo: Could not find object file {obj}')
             sys.exit(1)
         src = entry['file']
         if not src.endswith('.c'):
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 04/10] vhost: Always initialize cached vring data
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 03/10] scripts: fix broken error path in modinfo-collect.py Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 05/10] migration: Fix order of function arguments Philippe Mathieu-Daudé
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Hanna Czenczek <hreitz@redhat.com>

vhost_virtqueue_start() can exit early if the descriptor ring address is
0, assuming the virtqueue isn’t ready to start.

In this case, all cached vring information (size, physical address,
pointer) is left as-is.  This is OK at first startup, when that info is
still initialized to 0, but after a reset, it will retain old (outdated)
information.

vhost_virtqueue_start() must make sure these values are (re-)set
properly before exiting.

(When using an IOMMU, these outdated values can stall the device:
vhost_dev_start() deliberately produces an IOMMU miss event for each
used vring.  If used_phys contains an outdated value, the resulting
lookup may fail, forcing the device to be stopped.)

Cc: qemu-stable@nongnu.org
Signed-off-by: Hanna Czenczek <hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251208113008.153249-1-hreitz@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/virtio/vhost.c | 38 +++++++++++++++++++++++---------------
 1 file changed, 23 insertions(+), 15 deletions(-)

diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 266a11514a1..e654ea468a0 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -1261,7 +1261,7 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
     BusState *qbus = BUS(qdev_get_parent_bus(DEVICE(vdev)));
     VirtioBusState *vbus = VIRTIO_BUS(qbus);
     VirtioBusClass *k = VIRTIO_BUS_GET_CLASS(vbus);
-    hwaddr s, l, a;
+    hwaddr l;
     int r;
     int vhost_vq_index = dev->vhost_ops->vhost_get_vq_index(dev, idx);
     struct vhost_vring_file file = {
@@ -1272,8 +1272,17 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
     };
     struct VirtQueue *vvq = virtio_get_queue(vdev, idx);
 
-    a = virtio_queue_get_desc_addr(vdev, idx);
-    if (a == 0) {
+    vq->desc_size = virtio_queue_get_desc_size(vdev, idx);
+    vq->desc_phys = virtio_queue_get_desc_addr(vdev, idx);
+    vq->desc = NULL;
+    vq->avail_size = virtio_queue_get_avail_size(vdev, idx);
+    vq->avail_phys = virtio_queue_get_avail_addr(vdev, idx);
+    vq->avail = NULL;
+    vq->used_size = virtio_queue_get_used_size(vdev, idx);
+    vq->used_phys = virtio_queue_get_used_addr(vdev, idx);
+    vq->used = NULL;
+
+    if (vq->desc_phys == 0) {
         /* Queue might not be ready for start */
         return 0;
     }
@@ -1301,24 +1310,23 @@ int vhost_virtqueue_start(struct vhost_dev *dev,
         }
     }
 
-    vq->desc_size = s = l = virtio_queue_get_desc_size(vdev, idx);
-    vq->desc_phys = a;
-    vq->desc = vhost_memory_map(dev, a, &l, false);
-    if (!vq->desc || l != s) {
+    l = vq->desc_size;
+    vq->desc = vhost_memory_map(dev, vq->desc_phys, &l, false);
+    if (!vq->desc || l != vq->desc_size) {
         r = -ENOMEM;
         goto fail_alloc_desc;
     }
-    vq->avail_size = s = l = virtio_queue_get_avail_size(vdev, idx);
-    vq->avail_phys = a = virtio_queue_get_avail_addr(vdev, idx);
-    vq->avail = vhost_memory_map(dev, a, &l, false);
-    if (!vq->avail || l != s) {
+
+    l = vq->avail_size;
+    vq->avail = vhost_memory_map(dev, vq->avail_phys, &l, false);
+    if (!vq->avail || l != vq->avail_size) {
         r = -ENOMEM;
         goto fail_alloc_avail;
     }
-    vq->used_size = s = l = virtio_queue_get_used_size(vdev, idx);
-    vq->used_phys = a = virtio_queue_get_used_addr(vdev, idx);
-    vq->used = vhost_memory_map(dev, a, &l, true);
-    if (!vq->used || l != s) {
+
+    l = vq->used_size;
+    vq->used = vhost_memory_map(dev, vq->used_phys, &l, true);
+    if (!vq->used || l != vq->used_size) {
         r = -ENOMEM;
         goto fail_alloc_used;
     }
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 05/10] migration: Fix order of function arguments
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 04/10] vhost: Always initialize cached vring data Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 06/10] hw/pci: Fix typo in documentation Philippe Mathieu-Daudé
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Stefan Weil <sw@weilnetz.de>

This fixes a compiler error when higher warning levels are enabled:

../migration/postcopy-ram.c: In function ‘postcopy_temp_pages_setup’:
../migration/postcopy-ram.c:1483:50: error: ‘g_malloc0_n’ sizes specified with ‘sizeof’ in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
 1483 |     mis->postcopy_tmp_pages = g_malloc0_n(sizeof(PostcopyTmpPage), channels);
      |                                                  ^~~~~~~~~~~~~~~
../migration/postcopy-ram.c:1483:50: note: earlier argument should specify number of elements, later size of each element

Avoid also a related int/unsigned mismatch by fixing the type of
two local variables.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251209125049.764095-1-sw@weilnetz.de>
[PMD: Replace g_malloc0_n() by g_new0()]
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Peter Xu <peterx@redhat.com>
Message-Id: <20251209195010.83219-1-philmd@linaro.org>
---
 migration/postcopy-ram.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/migration/postcopy-ram.c b/migration/postcopy-ram.c
index 7c9fe61041f..715ef021a91 100644
--- a/migration/postcopy-ram.c
+++ b/migration/postcopy-ram.c
@@ -1467,7 +1467,8 @@ retry:
 static int postcopy_temp_pages_setup(MigrationIncomingState *mis)
 {
     PostcopyTmpPage *tmp_page;
-    int err, i, channels;
+    int err;
+    unsigned i, channels;
     void *temp_page;
 
     if (migrate_postcopy_preempt()) {
@@ -1479,7 +1480,7 @@ static int postcopy_temp_pages_setup(MigrationIncomingState *mis)
     }
 
     channels = mis->postcopy_channels;
-    mis->postcopy_tmp_pages = g_malloc0_n(sizeof(PostcopyTmpPage), channels);
+    mis->postcopy_tmp_pages = g_new0(PostcopyTmpPage, channels);
 
     for (i = 0; i < channels; i++) {
         tmp_page = &mis->postcopy_tmp_pages[i];
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 06/10] hw/pci: Fix typo in documentation
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 05/10] migration: Fix order of function arguments Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 07/10] scripts/nsis.py: Tell makensis that WoA is 64 bit Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Stefan Weil <sw@weilnetz.de>

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-ID: <20251209125759.764296-1-sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/pci/pci.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
index 6bccb25ac2f..b72e4845009 100644
--- a/include/hw/pci/pci.h
+++ b/include/hw/pci/pci.h
@@ -751,7 +751,7 @@ int pci_iommu_register_iotlb_notifier(PCIDevice *dev, uint32_t pasid,
 
 /**
  * pci_iommu_unregister_iotlb_notifier: unregister a notifier that has been
- * registerd with pci_iommu_register_iotlb_notifier.
+ * registered with pci_iommu_register_iotlb_notifier.
  *
  * Returns 0 on success, or a negative errno otherwise.
  *
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 07/10] scripts/nsis.py: Tell makensis that WoA is 64 bit
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (5 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 06/10] hw/pci: Fix typo in documentation Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 08/10] Fix const qualifier build errors with recent glibc Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Stefan Weil <sw@weilnetz.de>

This fixes some settings like the default installation path
for the QEMU installation on Windows on ARM (WoA).

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251209130212.764443-1-sw@weilnetz.de>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 scripts/nsis.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/nsis.py b/scripts/nsis.py
index 8f469634eb7..33069f4a86e 100644
--- a/scripts/nsis.py
+++ b/scripts/nsis.py
@@ -114,7 +114,7 @@ def main():
             "-DSRCDIR=" + args.srcdir,
             "-DBINDIR=" + destdir + prefix,
         ]
-        if args.cpu == "x86_64":
+        if args.cpu == "aarch64" or args.cpu == "x86_64":
             makensis += ["-DW64"]
         makensis += ["-DDLLDIR=" + dlldir]
 
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 08/10] Fix const qualifier build errors with recent glibc
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (6 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 07/10] scripts/nsis.py: Tell makensis that WoA is 64 bit Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 09/10] Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro" Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

From: Cédric Le Goater <clg@redhat.com>

A recent change in glibc 2.42.9000 [1] changes the return type of
strstr() and other string functions to be 'const char *' when the
input is a 'const char *'.

This breaks the build in various files with errors such as :

  error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
    208 |         char *pidstr = strstr(filename, "%");
        |                        ^~~~~~

Fix this by changing the type of the variables that store the result
of these functions to 'const char *'.

[1] https://sourceware.org/git/?p=glibc.git;a=commit;h=cd748a63ab1a7ae846175c532a3daab341c62690

Signed-off-by: Cédric Le Goater <clg@redhat.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20251209174328.698774-1-clg@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 backends/tpm/tpm_passthrough.c | 2 +-
 block/vmdk.c                   | 2 +-
 block/vvfat.c                  | 2 +-
 gdbstub/gdbstub.c              | 2 +-
 qga/commands-linux.c           | 7 ++++---
 ui/ui-hmp-cmds.c               | 2 +-
 util/log.c                     | 2 +-
 7 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/backends/tpm/tpm_passthrough.c b/backends/tpm/tpm_passthrough.c
index b7c7074c2aa..a9f35ab7d60 100644
--- a/backends/tpm/tpm_passthrough.c
+++ b/backends/tpm/tpm_passthrough.c
@@ -211,7 +211,7 @@ static size_t tpm_passthrough_get_buffer_size(TPMBackend *tb)
 static int tpm_passthrough_open_sysfs_cancel(TPMPassthruState *tpm_pt)
 {
     int fd = -1;
-    char *dev;
+    const char *dev;
     char path[PATH_MAX];
 
     if (tpm_pt->options->cancel_path) {
diff --git a/block/vmdk.c b/block/vmdk.c
index 3b35b63cb59..89e89cd10e3 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1089,7 +1089,7 @@ vmdk_open_vmdk4(BlockDriverState *bs, BdrvChild *file, int flags,
 static int vmdk_parse_description(const char *desc, const char *opt_name,
         char *buf, int buf_size)
 {
-    char *opt_pos, *opt_end;
+    const char *opt_pos, *opt_end;
     const char *end = desc + strlen(desc);
 
     opt_pos = strstr(desc, opt_name);
diff --git a/block/vvfat.c b/block/vvfat.c
index 814796d9185..e334b9febb1 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -1826,7 +1826,7 @@ cluster_was_modified(BDRVVVFATState *s, uint32_t cluster_num)
 
 static const char* get_basename(const char* path)
 {
-    char* basename = strrchr(path, '/');
+    const char *basename = strrchr(path, '/');
     if (basename == NULL)
         return path;
     else
diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index dd5fb5667cc..5b2fc06e58d 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -362,7 +362,7 @@ static const char *get_feature_xml(const char *p, const char **newp,
      * qXfer:features:read:ANNEX:OFFSET,LENGTH'
      *                     ^p    ^newp
      */
-    char *term = strchr(p, ':');
+    const char *term = strchr(p, ':');
     *newp = term + 1;
     len = term - p;
 
diff --git a/qga/commands-linux.c b/qga/commands-linux.c
index 4a09ddc760c..c639a60a941 100644
--- a/qga/commands-linux.c
+++ b/qga/commands-linux.c
@@ -403,7 +403,8 @@ static bool build_guest_fsinfo_for_pci_dev(char const *syspath,
     int i, offset, nhosts = 0, pcilen;
     GuestPCIAddress *pciaddr = disk->pci_controller;
     bool has_ata = false, has_host = false, has_tgt = false;
-    char *p, *driver = NULL;
+    const char *p;
+    char *driver = NULL;
     bool ret = false;
 
     p = strstr(syspath, "/devices/pci");
@@ -543,7 +544,7 @@ static bool build_guest_fsinfo_for_nonpci_virtio(char const *syspath,
                                                  Error **errp)
 {
     unsigned int tgt[3];
-    char *p;
+    const char *p;
 
     if (!strstr(syspath, "/virtio") || !strstr(syspath, "/block")) {
         g_debug("Unsupported virtio device '%s'", syspath);
@@ -575,7 +576,7 @@ static bool build_guest_fsinfo_for_ccw_dev(char const *syspath,
                                            Error **errp)
 {
     unsigned int cssid, ssid, subchno, devno;
-    char *p;
+    const char *p;
 
     p = strstr(syspath, "/devices/css");
     if (!p || sscanf(p + 12, "%*x/%x.%x.%x/%*x.%*x.%x/",
diff --git a/ui/ui-hmp-cmds.c b/ui/ui-hmp-cmds.c
index 980a8bbc518..6c93d452c9c 100644
--- a/ui/ui-hmp-cmds.c
+++ b/ui/ui-hmp-cmds.c
@@ -418,7 +418,7 @@ err_out:
 void sendkey_completion(ReadLineState *rs, int nb_args, const char *str)
 {
     int i;
-    char *sep;
+    const char *sep;
     size_t len;
 
     if (nb_args != 2) {
diff --git a/util/log.c b/util/log.c
index 41f78ce86b2..c44d66b5ce7 100644
--- a/util/log.c
+++ b/util/log.c
@@ -203,7 +203,7 @@ static ValidFilenameTemplateResult
 valid_filename_template(const char *filename, bool per_thread, Error **errp)
 {
     if (filename) {
-        char *pidstr = strstr(filename, "%");
+        const char *pidstr = strstr(filename, "%");
 
         if (pidstr) {
             /* We only accept one %d, no other format strings */
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 09/10] Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro"
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (7 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 08/10] Fix const qualifier build errors with recent glibc Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 20:05 ` [PULL 10/10] Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer" Philippe Mathieu-Daudé
  2025-12-09 22:42 ` [PULL 00/10] Misc HW patches for 2025-12-09 Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

Next commit will re-use VMSTATE_BUFFER_POINTER_UNSAFE().

This reverts commit 58341158d022823234d25fd337654a82fa6d157b.

Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/migration/vmstate.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h
index df57e6550a2..a87a5efa428 100644
--- a/include/migration/vmstate.h
+++ b/include/migration/vmstate.h
@@ -727,6 +727,15 @@ extern const VMStateInfo vmstate_info_qlist;
     .offset     = offsetof(_state, _field),                          \
 }
 
+#define VMSTATE_BUFFER_POINTER_UNSAFE(_field, _state, _version, _size) { \
+    .name       = (stringify(_field)),                               \
+    .version_id = (_version),                                        \
+    .size       = (_size),                                           \
+    .info       = &vmstate_info_buffer,                              \
+    .flags      = VMS_BUFFER | VMS_POINTER,                          \
+    .offset     = offsetof(_state, _field),                          \
+}
+
 /* Allocate a temporary of type 'tmp_type', set tmp->parent to _state
  * and execute the vmsd on the temporary.  Note that we're working with
  * the whole of _state here, not a field within it.
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PULL 10/10] Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer"
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (8 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 09/10] Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro" Philippe Mathieu-Daudé
@ 2025-12-09 20:05 ` Philippe Mathieu-Daudé
  2025-12-09 22:42 ` [PULL 00/10] Misc HW patches for 2025-12-09 Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Philippe Mathieu-Daudé @ 2025-12-09 20:05 UTC (permalink / raw)
  To: qemu-devel

Per https://lore.kernel.org/qemu-devel/7798584d-e861-47b7-af52-2c2efb67a4de@proxmox.com/:

Loading a VM state taken with v10.1.2 or older doesn't work anymore,
using the script [*] we get:

  kvm: VQ 1 size 0x100 < last_avail_idx 0x9 - used_idx 0x3e30
  kvm: load of migration failed: Operation not permitted: error while loading state for instance 0x0 of device '0000:00:13.0/virtio-net': Failed to load element of type virtio for virtio: -1
  qemu-system-x86_64: Missing section footer for 0000:00:13.0/virtio-net
  qemu-system-x86_64: Section footer error, section_id: 41

[*]:

  #!/bin/bash
  rm /tmp/disk.qcow2
  args="
    -netdev type=tap,id=net1,ifname=tap104i1,script=/usr/libexec/qemu-server/pve-bridge,downscript=/usr/libexec/qemu-server/pve-bridgedown,vhost=on
    -device virtio-net-pci,mac=BC:24:11:32:3C:69,netdev=net1,bus=pci.0,addr=0x13,id=net1
    -machine type=pc-i440fx-10.1
  "
  $1/qemu-img create -f qcow2 /tmp/disk.qcow2 1G
  $1/qemu-system-x86_64 --qmp stdio --blockdev qcow2,node-name=node0,file.driver=file,file.filename=/tmp/disk.qcow2 $args <<EOF
  {"execute": "qmp_capabilities"}
  {"execute": "snapshot-save", "arguments": { "job-id": "save0", "tag": "snap", "vmstate": "node0", "devices": ["node0"] } }
  {"execute": "quit"}
  EOF
  $2/qemu-system-x86_64 --qmp stdio --blockdev qcow2,node-name=node0,file.driver=file,file.filename=/tmp/disk.qcow2 $args -loadvm snap

This reverts commit 3a9cd2a4a1571266dea37398de04f650c2a72d86.

Reported-by: Fiona Ebner <f.ebner@proxmox.com>
Suggested-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/virtio/virtio-net.h | 2 +-
 hw/net/virtio-net.c            | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/hw/virtio/virtio-net.h b/include/hw/virtio/virtio-net.h
index f7083553068..5b8ab7bda79 100644
--- a/include/hw/virtio/virtio-net.h
+++ b/include/hw/virtio/virtio-net.h
@@ -202,7 +202,7 @@ struct VirtIONet {
         uint8_t uni_overflow;
         uint8_t *macs;
     } mac_table;
-    uint32_t vlans[MAX_VLAN];
+    uint32_t *vlans;
     virtio_net_conf net_conf;
     NICConf nic_conf;
     DeviceState *qdev;
diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index f5d93eb4005..ca813203d76 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -986,7 +986,7 @@ static void virtio_net_set_features(VirtIODevice *vdev,
         virtio_has_feature_ex(vdev->guest_features_ex,
                               VIRTIO_NET_F_CTRL_VLAN)) {
         bool vlan = virtio_has_feature_ex(features, VIRTIO_NET_F_CTRL_VLAN);
-        memset(n->vlans, vlan ? 0 : 0xff, sizeof(n->vlans));
+        memset(n->vlans, vlan ? 0 : 0xff, MAX_VLAN >> 3);
     }
 
     if (virtio_has_feature_ex(features, VIRTIO_NET_F_STANDBY)) {
@@ -3598,8 +3598,7 @@ static const VMStateDescription vmstate_virtio_net_device = {
          * buffer; hold onto your endiannesses; it's actually used as a bitmap
          * but based on the uint.
          */
-        VMSTATE_BUFFER_UNSAFE(vlans, VirtIONet, 0,
-                              sizeof(typeof_field(VirtIONet, vlans))),
+        VMSTATE_BUFFER_POINTER_UNSAFE(vlans, VirtIONet, 0, MAX_VLAN >> 3),
         VMSTATE_WITH_TMP(VirtIONet, struct VirtIONetMigTmp,
                          vmstate_virtio_net_has_vnet),
         VMSTATE_UINT8(mac_table.multi_overflow, VirtIONet),
@@ -4017,7 +4016,8 @@ static void virtio_net_device_realize(DeviceState *dev, Error **errp)
 
     n->mac_table.macs = g_malloc0(MAC_TABLE_ENTRIES * ETH_ALEN);
 
-    memset(n->vlans, 0xff, sizeof(n->vlans));
+    n->vlans = g_malloc0(MAX_VLAN >> 3);
+    memset(n->vlans, 0xff, MAX_VLAN >> 3);
 
     nc = qemu_get_queue(n->nic);
     nc->rxfilter_notify_enabled = 1;
@@ -4066,6 +4066,7 @@ static void virtio_net_device_unrealize(DeviceState *dev)
     n->netclient_type = NULL;
 
     g_free(n->mac_table.macs);
+    g_free(n->vlans);
 
     if (n->failover) {
         qobject_unref(n->primary_opts);
-- 
2.51.0



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PULL 00/10] Misc HW patches for 2025-12-09
  2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
                   ` (9 preceding siblings ...)
  2025-12-09 20:05 ` [PULL 10/10] Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer" Philippe Mathieu-Daudé
@ 2025-12-09 22:42 ` Richard Henderson
  10 siblings, 0 replies; 12+ messages in thread
From: Richard Henderson @ 2025-12-09 22:42 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel

On 12/9/25 14:05, Philippe Mathieu-Daudé wrote:
> The following changes since commit 2257f52a97f28ce3be4366817ea8817ad866562b:
> 
>    Merge tag 'pull-10.2-final-fixes-051225-2' ofhttps://gitlab.com/stsquad/qemu into staging (2025-12-05 12:38:37 -0600)
> 
> are available in the Git repository at:
> 
>    https://github.com/philmd/qemu.git tags/hw-misc-20251209
> 
> for you to fetch changes up to efd6b3d1768d04d5491b62ad7385f623fb12f627:
> 
>    Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer" (2025-12-09 21:00:15 +0100)
> 
> ----------------------------------------------------------------
> Misc HW / migration / typo fixes


Applied, thanks.  Please update https://wiki.qemu.org/ChangeLog/10.2 as appropriate.

r~


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-12-09 22:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-09 20:05 [PULL 00/10] Misc HW patches for 2025-12-09 Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 01/10] osdep: Undefine FSCALE definition to fix Solaris builds Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 02/10] hw/9pfs: Correct typo Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 03/10] scripts: fix broken error path in modinfo-collect.py Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 04/10] vhost: Always initialize cached vring data Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 05/10] migration: Fix order of function arguments Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 06/10] hw/pci: Fix typo in documentation Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 07/10] scripts/nsis.py: Tell makensis that WoA is 64 bit Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 08/10] Fix const qualifier build errors with recent glibc Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 09/10] Revert "migration/vmstate: remove VMSTATE_BUFFER_POINTER_UNSAFE macro" Philippe Mathieu-Daudé
2025-12-09 20:05 ` [PULL 10/10] Revert "hw/net/virtio-net: make VirtIONet.vlans an array instead of a pointer" Philippe Mathieu-Daudé
2025-12-09 22:42 ` [PULL 00/10] Misc HW patches for 2025-12-09 Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).