* [PULL 00/13] Misc HW patches for 2026-07-14
@ 2026-07-14 19:35 Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 01/13] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging Philippe Mathieu-Daudé
` (13 more replies)
0 siblings, 14 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 191489ba750f13357ac677fb3b059f6f89ee4287:
Merge tag 'pull-riscv-to-apply-20260714' of https://github.com/alistair23/qemu into staging (2026-07-14 07:26:45 +0100)
are available in the Git repository at:
https://github.com/philmd/qemu.git tags/hw-misc-20260714
for you to fetch changes up to a38455cf9368e7370b0cfea809ef228ffa2e8209:
net: only advertise passt in netdev help when CONFIG_PASST (2026-07-14 21:33:53 +0200)
----------------------------------------------------------------
Misc HW patches
Various fixes mostly related to misc hardware devices.
----------------------------------------------------------------
Bin Meng (1):
docs/devel: Document SSI dummy-cycle ownership
Dmitry Pimenov (1):
hw/sparc64/niagara: use int64_t for vdisk size to avoid truncation
Haotian Jiang (1):
hw/misc/ivshmem: clear chardev handlers before freeing peers
Marc-André Lureau (2):
hw/display/qxl: fix TOCTOU in cursor chunk data_size handling
hw/display/virtio-gpu: fix dmabuf_fd leak on remap failure
Miao Wang (2):
hw/scsi/vmw_pvscsi: translate data endianness
hw/scsi/vmw_pvscsi: add a comment to explain the endianness
Rohitashv Kumar (1):
net: only advertise passt in netdev help when CONFIG_PASST
Thomas Huth (5):
hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device
plugging
hw/usb/hcd-ohci: Make sure that ohci_service_ed_list() cannot loop
forever
hw/usb/hcd-xhci: Turn guest-triggerable abort() into qemu_log_mask()
hw/usb/hcd-xhci: Remove the FIXME macro
hw/usb/hcd-xhci: Use qemu_log_mask() instead of fprintf() statement
MAINTAINERS | 1 +
docs/devel/index-internals.rst | 1 +
docs/devel/ssi.rst | 132 ++++++++++++++++++++++++++++++++
hw/scsi/vmw_pvscsi.h | 14 ++++
hw/display/qxl-render.c | 28 ++++---
hw/display/virtio-gpu-udmabuf.c | 1 +
hw/misc/ivshmem-pci.c | 6 ++
hw/scsi/vmw_pvscsi.c | 57 +++++++++++++-
hw/sparc64/niagara.c | 2 +-
hw/sparc64/sun4u.c | 7 ++
hw/usb/hcd-ohci.c | 10 +++
hw/usb/hcd-xhci.c | 15 ++--
net/net.c | 2 +
13 files changed, 255 insertions(+), 21 deletions(-)
create mode 100644 docs/devel/ssi.rst
--
2.53.0
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PULL 01/13] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 02/13] hw/misc/ivshmem: clear chardev handlers before freeing peers Philippe Mathieu-Daudé
` (12 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Thomas Huth <thuth@redhat.com>
When trying to plug a PCI device to a Sparc64 machine, you currently
have to specify the right bus ("bus=pciB"), otherwise you get this error:
$ qemu-system-sparc64 -device virtio-scsi-pci
qemu-system-sparc64: -device virtio-scsi-pci: PCI: no slot/function
available for virtio-scsi-pci, all in use or reserved
This is quite annoying for the unexperienced users, and it also breaks
e.g. the iotests ("make check-block") when running with qemu-system-sparc64.
Mark the non-usable PCI busses as full now, so that QEMU can automatically
plug new PCI devices to the right "pciB" bus.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260309181452.83702-1-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/sparc64/sun4u.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/hw/sparc64/sun4u.c b/hw/sparc64/sun4u.c
index d69ed9a81ac..a348096aee6 100644
--- a/hw/sparc64/sun4u.c
+++ b/hw/sparc64/sun4u.c
@@ -719,6 +719,13 @@ static void sun4uv_init(MemoryRegion *address_space_mem,
fw_cfg_add_i16(fw_cfg, FW_CFG_SPARC64_DEPTH, graphic_depth);
qemu_register_boot_set(fw_cfg_boot_set, fw_cfg);
+
+ /*
+ * Mark internal PCI busses as full so that the plugging of additional
+ * PCI devices happens on the right bus that still has free slots:
+ */
+ qbus_mark_full(&pci_bus->qbus);
+ qbus_mark_full(&pci_busA->qbus);
}
enum {
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 02/13] hw/misc/ivshmem: clear chardev handlers before freeing peers
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 01/13] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 03/13] docs/devel: Document SSI dummy-cycle ownership Philippe Mathieu-Daudé
` (11 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Haotian Jiang <sundayjiang@tencent.com>
ivshmem_exit() frees s->peers and s->msi_vectors but does not clear
the chardev handlers registered in ivshmem_common_realize(). Those
handlers are only removed later in object_finalize() via release_chr,
which runs after ivshmem_exit().
Between exit and finalize, ivshmem_read() can fire on pending chardev
data and process_msg_connect() dereferences the freed s->peers.
Additionally, s->peers, s->nb_peers, and s->msi_vectors are not
zeroed after free, leaving dangling pointers that make the UAF code
paths reachable.
Fix by clearing chardev handlers at the beginning of ivshmem_exit(),
before any resources they access are freed, and nullifying freed
pointers.
Cc: qemu-stable@nongnu.org
Fixes: f64a078d45a ("ivshmem: fix pci_ivshmem_exit()")
Link: https://gitlab.com/qemu-project/qemu/-/work_items/3594
Reported-by: Haotian Jiang <sundayjiang@tencent.com>
Signed-off-by: Haotian Jiang <sundayjiang@tencent.com>
Message-ID: <tencent_3105EC28797360A155078F53@qq.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/misc/ivshmem-pci.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/misc/ivshmem-pci.c b/hw/misc/ivshmem-pci.c
index 536475e9de8..372e9dc58df 100644
--- a/hw/misc/ivshmem-pci.c
+++ b/hw/misc/ivshmem-pci.c
@@ -938,6 +938,9 @@ static void ivshmem_exit(PCIDevice *dev)
IVShmemState *s = IVSHMEM_COMMON(dev);
int i;
+ qemu_chr_fe_set_handlers(&s->server_chr,
+ NULL, NULL, NULL, NULL, NULL, NULL, true);
+
migrate_del_blocker(&s->migration_blocker);
if (memory_region_is_mapped(s->ivshmem_bar2)) {
@@ -966,6 +969,8 @@ static void ivshmem_exit(PCIDevice *dev)
close_peer_eventfds(s, i);
}
g_free(s->peers);
+ s->peers = NULL;
+ s->nb_peers = 0;
}
if (ivshmem_has_feature(s, IVSHMEM_MSI)) {
@@ -973,6 +978,7 @@ static void ivshmem_exit(PCIDevice *dev)
}
g_free(s->msi_vectors);
+ s->msi_vectors = NULL;
}
static int ivshmem_pre_load(void *opaque)
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 03/13] docs/devel: Document SSI dummy-cycle ownership
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 01/13] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 02/13] hw/misc/ivshmem: clear chardev handlers before freeing peers Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 04/13] hw/scsi/vmw_pvscsi: translate data endianness Philippe Mathieu-Daudé
` (10 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Bin Meng <bin.meng@processmission.com>
Document the boundary between SPI/SSI controller models and SPI flash
models when representing fast-read dummy cycles. It explains that
flash models own command semantics, while controllers own
hardware-generated dummy transfers and cycle-to-byte conversion.
Signed-off-by: Bin Meng <bin.meng@processmission.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260707083431.219671-11-bin.meng@processmission.com>
[PMD: Update MAINTAINERS]
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
MAINTAINERS | 1 +
docs/devel/index-internals.rst | 1 +
docs/devel/ssi.rst | 132 +++++++++++++++++++++++++++++++++
3 files changed, 134 insertions(+)
create mode 100644 docs/devel/ssi.rst
diff --git a/MAINTAINERS b/MAINTAINERS
index ecb8cfdc41e..f06a2788065 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2350,6 +2350,7 @@ T: git https://github.com/bonzini/qemu.git scsi-next
SSI
M: Alistair Francis <alistair@alistair23.me>
S: Maintained
+F: docs/devel/ssi.rst
F: hw/ssi/*
F: hw/block/m25p80*
F: include/hw/ssi/ssi.h
diff --git a/docs/devel/index-internals.rst b/docs/devel/index-internals.rst
index b89bab9b306..a8f5e310df3 100644
--- a/docs/devel/index-internals.rst
+++ b/docs/devel/index-internals.rst
@@ -20,6 +20,7 @@ Details about QEMU's various subsystems including how to add features to them.
reset
s390-cpu-topology
s390-dasd-ipl
+ ssi
tracing
uefi-vars
vfio-iommufd
diff --git a/docs/devel/ssi.rst b/docs/devel/ssi.rst
new file mode 100644
index 00000000000..864b5d93204
--- /dev/null
+++ b/docs/devel/ssi.rst
@@ -0,0 +1,132 @@
+================================
+SSI devices and SPI flash models
+================================
+
+QEMU's Synchronous Serial Interface (SSI) bus models the full-duplex transfer
+of words between a controller and one selected peripheral. Most SPI flash
+models, including ``m25p80``, are attached to controllers through this bus.
+
+This page documents the expected boundary between a controller model and a
+flash model for SPI fast-read dummy cycles. The boundary is important because
+many real controllers expose dummy-cycle configuration in registers, while the
+flash model observes only the byte stream delivered through ``ssi_transfer()``.
+
+SSI transfer granularity
+------------------------
+
+``ssi_transfer()`` transfers one SSI word. Flash models that implement common
+SPI NOR command streams usually consume one 8-bit word at a time:
+
+* command opcode;
+* address bytes;
+* optional mode or continuous-read bytes;
+* dummy bytes;
+* data bytes.
+
+The SSI core does not model individual clock edges or the number of active SPI
+data lines. If a real transaction has a dummy phase expressed in clock cycles,
+the device model that generates transfers on the SSI bus must represent that
+phase as a number of dummy byte transfers.
+
+Flash model responsibilities
+----------------------------
+
+A SPI flash model owns the command semantics for the flash device:
+
+* which opcodes are recognized;
+* how many address bytes are required;
+* whether a command has mode bytes;
+* how many dummy bytes must be consumed before data can be returned;
+* manufacturer-specific differences in fast-read command behavior.
+
+For the ``m25p80`` model, ``needed_bytes`` is a byte count. It must not store
+raw dummy cycles. When a flash datasheet describes the dummy phase in cycles,
+the flash model converts the cycles to bytes using the bus width used for the
+dummy phase::
+
+ dummy_bytes = DIV_ROUND_UP(dummy_cycles * dummy_bus_width, 8)
+
+For SPI NOR fast-read commands modeled by ``m25p80``, the dummy phase follows
+the address phase width. For example, output-only dual and quad read commands
+such as DOR and QOR use one line for command, address, and dummy phases, then
+use two or four lines only for the data phase. Dual I/O and Quad I/O commands
+such as DIOR and QIOR use the wider bus for both address and dummy phases.
+
+If the exact dummy phase cannot be represented as a whole number of SSI byte
+transfers, the model should round up and log the limitation instead of silently
+treating cycles as bytes.
+
+Controller model responsibilities
+---------------------------------
+
+A controller model owns the behavior of the controller hardware:
+
+* how guest-visible registers select command, address width, bus width, and
+ dummy-cycle count;
+* whether the guest supplies dummy bytes in a transmit FIFO;
+* whether the controller itself generates the dummy phase for a memory-mapped,
+ direct-read, or other automatic transfer mode;
+* how chip-select state changes around controller-generated transfers.
+
+When guest software writes dummy bytes into a transmit FIFO or manual transfer
+path, the controller should pass those bytes to ``ssi_transfer()`` like any
+other guest-provided byte. It should not add more dummy transfers on behalf of
+the flash.
+
+When hardware registers instruct the controller to generate a dummy phase, the
+controller must emit dummy byte transfers before data transfers reach the flash
+model. The controller should convert the configured cycle count using the bus
+width that the controller uses during the dummy phase. For example:
+
+* 8 dummy cycles on a single data line become 1 dummy byte;
+* 8 dummy cycles on two data lines become 2 dummy bytes;
+* 8 dummy cycles on four data lines become 4 dummy bytes.
+
+The controller should not duplicate flash-specific opcode tables merely to
+guess which commands need dummy cycles. In automatic modes the controller
+already has enough hardware configuration to know whether it must generate a
+dummy phase. In manual modes the guest-provided byte stream is authoritative.
+
+Avoiding double counting
+------------------------
+
+Exactly one side should generate each dummy byte transfer seen by the flash:
+
+* If the guest sends dummy bytes through the controller, the controller forwards
+ them and the flash consumes them.
+* If the guest programs a controller dummy-cycle register, the controller
+ converts those cycles to dummy byte transfers and the flash consumes them.
+* The flash may know that a command requires dummy bytes, but it does not create
+ transfers on the SSI bus.
+
+Do not implement controller-side snooping that watches manual-mode opcode
+streams and injects extra dummy transfers based on flash opcodes. That mixes
+flash command semantics into the controller and is fragile when flash models
+gain correct dummy-byte accounting.
+
+Examples in the tree
+--------------------
+
+The following models illustrate the boundary:
+
+* ``hw/block/m25p80.c`` keeps fast-read dummy requirements as byte counts in
+ ``needed_bytes``. Manufacturer-specific helpers convert datasheet dummy
+ cycles to the byte stream expected by the model.
+* ``hw/ssi/aspeed_smc.c`` generates dummy byte transfers for direct fast-read
+ mode from controller registers, but manual user-mode writes are forwarded as
+ guest-provided bytes.
+* ``hw/ssi/npcm7xx_fiu.c`` converts the direct-read dummy configuration to the
+ number of dummy byte transfers sent before reading data.
+
+Review checklist
+----------------
+
+When adding or changing a SPI flash controller or flash model, check:
+
+* Are dummy counts stored in byte units when they drive flash state machines?
+* If a hardware register stores cycles, is the conversion to bytes based on the
+ bus width of the dummy phase?
+* Are manual guest-provided dummy bytes forwarded without extra injection?
+* Are automatic controller-generated dummy phases modeled by the controller?
+* Is flash-specific opcode knowledge kept in the flash model rather than copied
+ into controller snooping paths?
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 04/13] hw/scsi/vmw_pvscsi: translate data endianness
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (2 preceding siblings ...)
2026-07-14 19:35 ` [PULL 03/13] docs/devel: Document SSI dummy-cycle ownership Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 05/13] hw/scsi/vmw_pvscsi: add a comment to explain the endianness Philippe Mathieu-Daudé
` (9 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Miao Wang <shankerwangmiao@gmail.com>
This patch improves the implementation of the pvscsi device by
translating the endianness of the data sent or received from the guest.
This ensures pvscsi can work on big-endian hosts with little-endian
guests.
This patch assumes, although not having found any specifications, that
the pvscsi device is little-endian, since pvscsi seems to be used only
on x86 platforms, which are little-endian.
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Message-ID: <20260710-pvscsi-endianness-v3-1-27fe1c4d1f6e@gmail.com>
[PMD: Rebased on top of commit cb30b8758d4 physmem API conversion]
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/scsi/vmw_pvscsi.c | 57 +++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 56 insertions(+), 1 deletion(-)
diff --git a/hw/scsi/vmw_pvscsi.c b/hw/scsi/vmw_pvscsi.c
index 4398aa54990..05f93171cd7 100644
--- a/hw/scsi/vmw_pvscsi.c
+++ b/hw/scsi/vmw_pvscsi.c
@@ -392,9 +392,18 @@ static void
pvscsi_cmp_ring_put(PVSCSIState *s, struct PVSCSIRingCmpDesc *cmp_desc)
{
hwaddr cmp_descr_pa;
+ PVSCSIRingCmpDesc cmp_desc_conv;
cmp_descr_pa = pvscsi_ring_pop_cmp_descr(&s->rings);
trace_pvscsi_cmp_ring_put(cmp_descr_pa);
+ cmp_desc_conv = (struct PVSCSIRingCmpDesc) {
+ .context = cpu_to_le64(cmp_desc->context),
+ .dataLen = cpu_to_le64(cmp_desc->dataLen),
+ .senseLen = cpu_to_le32(cmp_desc->senseLen),
+ .hostStatus = cpu_to_le16(cmp_desc->hostStatus),
+ .scsiStatus = cpu_to_le16(cmp_desc->scsiStatus),
+ };
+ cmp_desc = &cmp_desc_conv;
physical_memory_write(cmp_descr_pa, cmp_desc, sizeof(*cmp_desc));
}
@@ -402,9 +411,18 @@ static void
pvscsi_msg_ring_put(PVSCSIState *s, struct PVSCSIRingMsgDesc *msg_desc)
{
hwaddr msg_descr_pa;
+ PVSCSIRingMsgDesc msg_desc_conv;
+ int i;
msg_descr_pa = pvscsi_ring_pop_msg_descr(&s->rings);
trace_pvscsi_msg_ring_put(msg_descr_pa);
+ msg_desc_conv = (PVSCSIRingMsgDesc) {
+ .type = cpu_to_le32(msg_desc->type),
+ };
+ for (i = 0; i < ARRAY_SIZE(msg_desc->args); i++) {
+ msg_desc_conv.args[i] = cpu_to_le32(msg_desc->args[i]);
+ }
+ msg_desc = &msg_desc_conv;
physical_memory_write(msg_descr_pa, msg_desc, sizeof(*msg_desc));
}
@@ -481,6 +499,9 @@ pvscsi_get_next_sg_elem(PVSCSISGState *sg)
struct PVSCSISGElement elem;
physical_memory_read(sg->elemAddr, &elem, sizeof(elem));
+ elem.addr = le64_to_cpu(elem.addr);
+ elem.length = le32_to_cpu(elem.length);
+ elem.flags = le32_to_cpu(elem.flags);
if ((elem.flags & ~PVSCSI_KNOWN_FLAGS) != 0) {
/*
* There is PVSCSI_SGE_FLAG_CHAIN_ELEMENT flag described in
@@ -759,6 +780,12 @@ pvscsi_process_io(PVSCSIState *s)
trace_pvscsi_process_io(next_descr_pa);
physical_memory_read(next_descr_pa, &descr, sizeof(descr));
+ descr.context = le64_to_cpu(descr.context);
+ descr.dataAddr = le64_to_cpu(descr.dataAddr);
+ descr.dataLen = le64_to_cpu(descr.dataLen);
+ descr.senseAddr = le64_to_cpu(descr.senseAddr);
+ descr.senseLen = le32_to_cpu(descr.senseLen);
+ descr.flags = le32_to_cpu(descr.flags);
pvscsi_process_request_descriptor(s, &descr);
}
@@ -808,6 +835,17 @@ pvscsi_on_cmd_setup_rings(PVSCSIState *s)
{
PVSCSICmdDescSetupRings *rc =
(PVSCSICmdDescSetupRings *) s->curr_cmd_data;
+ PVSCSICmdDescSetupRings translated;
+ int i;
+
+ translated.reqRingNumPages = le32_to_cpu(rc->reqRingNumPages);
+ translated.cmpRingNumPages = le32_to_cpu(rc->cmpRingNumPages);
+ translated.ringsStatePPN = le64_to_cpu(rc->ringsStatePPN);
+ for (i = 0; i < PVSCSI_SETUP_RINGS_MAX_NUM_PAGES; i++) {
+ translated.reqRingPPNs[i] = le64_to_cpu(rc->reqRingPPNs[i]);
+ translated.cmpRingPPNs[i] = le64_to_cpu(rc->cmpRingPPNs[i]);
+ }
+ rc = &translated;
trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_RINGS");
@@ -831,6 +869,11 @@ pvscsi_on_cmd_abort(PVSCSIState *s)
PVSCSICmdDescAbortCmd *cmd = (PVSCSICmdDescAbortCmd *) s->curr_cmd_data;
PVSCSIRequest *r, *next;
+ PVSCSICmdDescAbortCmd translated = *cmd;
+ translated.context = le32_to_cpu(cmd->context);
+ translated.target = le32_to_cpu(cmd->target);
+ cmd = &translated;
+
trace_pvscsi_on_cmd_abort(cmd->context, cmd->target);
QTAILQ_FOREACH_SAFE(r, &s->pending_queue, next, next) {
@@ -862,6 +905,10 @@ pvscsi_on_cmd_reset_device(PVSCSIState *s)
(struct PVSCSICmdDescResetDevice *) s->curr_cmd_data;
SCSIDevice *sdev;
+ PVSCSICmdDescResetDevice translated = *cmd;
+ translated.target = le32_to_cpu(cmd->target);
+ cmd = &translated;
+
sdev = pvscsi_device_find(s, 0, cmd->target, cmd->lun, &target_lun);
trace_pvscsi_on_cmd_reset_dev(cmd->target, (int) target_lun, sdev);
@@ -892,6 +939,14 @@ pvscsi_on_cmd_setup_msg_ring(PVSCSIState *s)
{
PVSCSICmdDescSetupMsgRing *rc =
(PVSCSICmdDescSetupMsgRing *) s->curr_cmd_data;
+ PVSCSICmdDescSetupMsgRing translated = *rc;
+ int i;
+
+ translated.numPages = le32_to_cpu(rc->numPages);
+ for (i = 0; i < PVSCSI_SETUP_MSG_RING_MAX_NUM_PAGES; i++) {
+ translated.ringPPNs[i] = le64_to_cpu(rc->ringPPNs[i]);
+ }
+ rc = &translated;
trace_pvscsi_on_cmd_arrived("PVSCSI_CMD_SETUP_MSG_RING");
@@ -994,7 +1049,7 @@ pvscsi_on_command_data(PVSCSIState *s, uint32_t value)
size_t bytes_arrived = s->curr_cmd_data_cntr * sizeof(uint32_t);
assert(bytes_arrived < sizeof(s->curr_cmd_data));
- s->curr_cmd_data[s->curr_cmd_data_cntr++] = value;
+ s->curr_cmd_data[s->curr_cmd_data_cntr++] = cpu_to_le32(value);
pvscsi_do_command_processing(s);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 05/13] hw/scsi/vmw_pvscsi: add a comment to explain the endianness
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (3 preceding siblings ...)
2026-07-14 19:35 ` [PULL 04/13] hw/scsi/vmw_pvscsi: translate data endianness Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 06/13] hw/display/qxl: fix TOCTOU in cursor chunk data_size handling Philippe Mathieu-Daudé
` (8 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Miao Wang <shankerwangmiao@gmail.com>
Add a comment to explain the endianness of the pvscsi device. We have
no information about the endianness should be little-endian or CPU
native endian because the current driver code is designed to work only
on x86 and is not endianness aware. We assume that the pvscsi device is
implicitly little-endian.
Signed-off-by: Miao Wang <shankerwangmiao@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260710-pvscsi-endianness-v3-2-27fe1c4d1f6e@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/scsi/vmw_pvscsi.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/hw/scsi/vmw_pvscsi.h b/hw/scsi/vmw_pvscsi.h
index a3ae517e199..defff9e179e 100644
--- a/hw/scsi/vmw_pvscsi.h
+++ b/hw/scsi/vmw_pvscsi.h
@@ -108,6 +108,20 @@ enum PVSCSICommands {
#define PVSCSI_COMMAND_PROCESSING_FAILED (-1)
#define PVSCSI_COMMAND_NOT_ENOUGH_DATA (-2)
+/*
+ * About endianess for the below structs:
+ *
+ * These structs are used to describe the data that is exchanged between the
+ * guest and the PVSCSI device. The endianess of the fields in these structs
+ * is not defined by any standard. The current implemented drivers are designed
+ * to only work on x86 architecture, so there is no endianess awareness in the
+ * drivers and thus we have no idea whether the fields should be in little-
+ * endian or target native endian format.
+ *
+ * Considering the above, we assume that PVSCSI is implicitly little-endian and
+ * expect the fields in these structs to be in little-endian format.
+ */
+
/*
* Command descriptor for PVSCSI_CMD_RESET_DEVICE --
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 06/13] hw/display/qxl: fix TOCTOU in cursor chunk data_size handling
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (4 preceding siblings ...)
2026-07-14 19:35 ` [PULL 05/13] hw/scsi/vmw_pvscsi: add a comment to explain the endianness Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 07/13] hw/sparc64/niagara: use int64_t for vdisk size to avoid truncation Philippe Mathieu-Daudé
` (7 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Snapshot chunk.data_size into a host-local variable before passing it to
qxl_phys2virt() for validation, and pass it through qxl_cursor() and
qxl_unpack_chunks() so that no subsequent code re-reads the field.
Without this, a racing vCPU can inflate data_size between the
qxl_phys2virt() validation and the memcpy in qxl_unpack_chunks(),
causing a source read past the validated region. In practice the read
stays within the guest's own VRAM mmap, so the impact is limited.
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3757
Reported-by: Feifan Qian <bea1e@proton.me>
Signed-off-by: Marc-Andre Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260710134352.2313675-1-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/display/qxl-render.c | 28 +++++++++++++++++-----------
1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c
index 3bf634ee059..4799c9e8bef 100644
--- a/hw/display/qxl-render.c
+++ b/hw/display/qxl-render.c
@@ -217,7 +217,8 @@ void qxl_render_update_area_done(PCIQXLDevice *qxl, QXLCookie *cookie)
}
static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
- QXLDataChunk *chunk, uint32_t group_id)
+ QXLDataChunk *chunk, uint32_t group_id,
+ uint32_t chunk_data_size)
{
uint32_t max_chunks = 32;
size_t offset = 0;
@@ -225,22 +226,21 @@ static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
QXLPHYSICAL next_chunk_phys = 0;
for (;;) {
- bytes = MIN(size - offset, chunk->data_size);
+ bytes = MIN(size - offset, chunk_data_size);
memcpy(dest + offset, chunk->data, bytes);
offset += bytes;
if (offset == size) {
return;
}
next_chunk_phys = chunk->next_chunk;
- /* fist time, only get the next chunk's data size */
chunk = qxl_phys2virt(qxl, next_chunk_phys, group_id,
sizeof(QXLDataChunk));
if (!chunk) {
return;
}
- /* second time, check data size and get data */
+ chunk_data_size = chunk->data_size;
chunk = qxl_phys2virt(qxl, next_chunk_phys, group_id,
- sizeof(QXLDataChunk) + chunk->data_size);
+ sizeof(QXLDataChunk) + chunk_data_size);
if (!chunk) {
return;
}
@@ -252,7 +252,7 @@ static void qxl_unpack_chunks(void *dest, size_t size, PCIQXLDevice *qxl,
}
static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
- uint32_t group_id)
+ uint32_t group_id, uint32_t chunk_data_size)
{
QEMUCursor *c;
uint8_t *and_mask, *xor_mask;
@@ -272,11 +272,11 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
case SPICE_CURSOR_TYPE_MONO:
/* Assume that the full cursor is available in a single chunk. */
size = 2 * cursor_get_mono_bpl(c) * c->height;
- if (size != cursor->data_size || cursor->chunk.data_size < size) {
+ if (size != cursor->data_size || chunk_data_size < size) {
qxl_set_guest_bug(qxl, "%s: bad monochrome cursor %ux%u"
" data_size %u chunk_size %u",
__func__, c->width, c->height,
- cursor->data_size, cursor->chunk.data_size);
+ cursor->data_size, chunk_data_size);
goto fail;
}
and_mask = cursor->chunk.data;
@@ -288,7 +288,8 @@ static QEMUCursor *qxl_cursor(PCIQXLDevice *qxl, QXLCursor *cursor,
break;
case SPICE_CURSOR_TYPE_ALPHA:
size = sizeof(uint32_t) * c->width * c->height;
- qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id);
+ qxl_unpack_chunks(c->data, size, qxl, &cursor->chunk, group_id,
+ chunk_data_size);
if (qxl->debug > 2) {
cursor_print_ascii_art(c, "qxl/alpha");
}
@@ -325,19 +326,23 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
}
switch (cmd->type) {
case QXL_CURSOR_SET:
+ {
+ uint32_t chunk_data_size;
+
/* First read the QXLCursor to get QXLDataChunk::data_size ... */
cursor = qxl_phys2virt(qxl, cmd->u.set.shape, ext->group_id,
sizeof(QXLCursor));
if (!cursor) {
return 1;
}
+ chunk_data_size = cursor->chunk.data_size;
/* Then read including the chunked data following QXLCursor. */
cursor = qxl_phys2virt(qxl, cmd->u.set.shape, ext->group_id,
- sizeof(QXLCursor) + cursor->chunk.data_size);
+ sizeof(QXLCursor) + chunk_data_size);
if (!cursor) {
return 1;
}
- c = qxl_cursor(qxl, cursor, ext->group_id);
+ c = qxl_cursor(qxl, cursor, ext->group_id, chunk_data_size);
if (c == NULL) {
c = cursor_builtin_left_ptr();
}
@@ -351,6 +356,7 @@ int qxl_render_cursor(PCIQXLDevice *qxl, QXLCommandExt *ext)
qemu_mutex_unlock(&qxl->ssd.lock);
qemu_bh_schedule(qxl->ssd.cursor_bh);
break;
+ }
case QXL_CURSOR_MOVE:
qemu_mutex_lock(&qxl->ssd.lock);
qxl->ssd.mouse_x = cmd->u.position.x;
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 07/13] hw/sparc64/niagara: use int64_t for vdisk size to avoid truncation
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (5 preceding siblings ...)
2026-07-14 19:35 ` [PULL 06/13] hw/display/qxl: fix TOCTOU in cursor chunk data_size handling Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 08/13] hw/display/virtio-gpu: fix dmabuf_fd leak on remap failure Philippe Mathieu-Daudé
` (6 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Dmitry Pimenov <sun4qemu@gmail.com>
blk_getlength() returns int64_t, but niagara_init() stored it in an int,
truncating the if=pflash virtual-ramdisk size for images >= 2 GiB. A ~4 GiB
image truncated to 0/negative, failed the `size > 0` check, and exit(1)'d
before the CPU ran, ending with:
qemu-system-sparc64: could not load ram disk
Signed-off-by: Dmitry Pimenov <sun4qemu@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260710222350.9185-1-sun4qemu@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/sparc64/niagara.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/sparc64/niagara.c b/hw/sparc64/niagara.c
index 1211ecb82d4..ad5e5945a85 100644
--- a/hw/sparc64/niagara.c
+++ b/hw/sparc64/niagara.c
@@ -137,7 +137,7 @@ static void niagara_init(MachineState *machine)
outside of the partition RAM */
if (dinfo) {
BlockBackend *blk = blk_by_legacy_dinfo(dinfo);
- int size = blk_getlength(blk);
+ int64_t size = blk_getlength(blk);
if (size > 0) {
memory_region_init_ram(&s->vdisk_ram, NULL, "sun4v_vdisk.ram", size,
&error_fatal);
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 08/13] hw/display/virtio-gpu: fix dmabuf_fd leak on remap failure
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (6 preceding siblings ...)
2026-07-14 19:35 ` [PULL 07/13] hw/sparc64/niagara: use int64_t for vdisk size to avoid truncation Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 09/13] hw/usb/hcd-ohci: Make sure that ohci_service_ed_list() cannot loop forever Philippe Mathieu-Daudé
` (5 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Marc-André Lureau <marcandre.lureau@redhat.com>
When virtio_gpu_create_udmabuf() succeeds but virtio_gpu_remap_udmabuf()
fails (mmap returns MAP_FAILED), virtio_gpu_init_udmabuf() returns early
without closing the dmabuf fd. Since res->blob is never set in this
path, later cleanup via virtio_gpu_cleanup_mapping() skips
virtio_gpu_fini_udmabuf() entirely, leaking the file descriptor.
Call virtio_gpu_destroy_udmabuf() before the early return to close
the fd. This function already handles partial state correctly: it
skips the munmap when res->remapped is NULL and closes the fd when
res->dmabuf_fd >= 0.
Fixes: 9b60cdf98723 ("virtio-gpu: Add udmabuf helpers")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260713125622.111513-1-marcandre.lureau@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/display/virtio-gpu-udmabuf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/display/virtio-gpu-udmabuf.c b/hw/display/virtio-gpu-udmabuf.c
index d5ac1cfca0e..5f08c855dde 100644
--- a/hw/display/virtio-gpu-udmabuf.c
+++ b/hw/display/virtio-gpu-udmabuf.c
@@ -143,6 +143,7 @@ void virtio_gpu_init_udmabuf(struct virtio_gpu_simple_resource *res)
}
virtio_gpu_remap_udmabuf(res);
if (!res->remapped) {
+ virtio_gpu_destroy_udmabuf(res);
return;
}
pdata = res->remapped;
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 09/13] hw/usb/hcd-ohci: Make sure that ohci_service_ed_list() cannot loop forever
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (7 preceding siblings ...)
2026-07-14 19:35 ` [PULL 08/13] hw/display/virtio-gpu: fix dmabuf_fd leak on remap failure Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 10/13] hw/usb/hcd-xhci: Turn guest-triggerable abort() into qemu_log_mask() Philippe Mathieu-Daudé
` (4 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Thomas Huth <thuth@redhat.com>
The inner while loop in ohci_service_ed_list() could theoretically
loop forever if a malicious guest prepares a set of bad descriptors.
Add a check to the loop to avoid this situation.
Reported-by: Feifan Qian <bea1e@proton.me>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3781
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20260713160458.343323-1-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/usb/hcd-ohci.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 40ebafb4dd9..c4a9741bd42 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -28,6 +28,7 @@
#include "qemu/osdep.h"
#include "hw/core/irq.h"
#include "qapi/error.h"
+#include "qemu/log.h"
#include "qemu/module.h"
#include "qemu/timer.h"
#include "hw/usb/usb.h"
@@ -1129,6 +1130,8 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head)
return 0;
}
for (cur = head; cur && link_cnt++ < ED_LINK_LIMIT; cur = next_ed) {
+ unsigned int ed_cnt = 0;
+
if (ohci_read_ed(ohci, cur, &ed)) {
trace_usb_ohci_ed_read_error(cur);
ohci_die(ohci);
@@ -1172,6 +1175,13 @@ static int ohci_service_ed_list(OHCIState *ohci, uint32_t head)
break;
}
}
+
+ if (ed_cnt++ > ED_LINK_LIMIT) {
+ qemu_log_mask(LOG_GUEST_ERROR,
+ "ohci: Too many endpoint descriptors in loop\n");
+ ohci_die(ohci);
+ return 0;
+ }
}
if (ohci_put_ed(ohci, cur, &ed)) {
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 10/13] hw/usb/hcd-xhci: Turn guest-triggerable abort() into qemu_log_mask()
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (8 preceding siblings ...)
2026-07-14 19:35 ` [PULL 09/13] hw/usb/hcd-ohci: Make sure that ohci_service_ed_list() cannot loop forever Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 11/13] hw/usb/hcd-xhci: Remove the FIXME macro Philippe Mathieu-Daudé
` (3 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Thomas Huth <thuth@redhat.com>
The FIXME macros in xhci_alloc_device_streams() can be triggered
by a (malicious) guest. Since the macro also contains an abort()
statement, this terminates QEMU. Turn the FIXME statements into
a qemu_log_mask() instead to avoid that a guest can shoot itself
this way.
Reported-by: Feifan Qian <bea1e@proton.me>
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3784
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260713161406.361197-2-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/usb/hcd-xhci.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 2cdab3ba0e4..f5bb7d25600 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -965,11 +965,13 @@ static TRBCCode xhci_alloc_device_streams(XHCIState *xhci, unsigned int slotid,
* together and make an usb_device_alloc_streams call per group.
*/
if (epctxs[i]->nr_pstreams != req_nr_streams) {
- FIXME("guest streams config not identical for all eps");
+ qemu_log_mask(LOG_UNIMP,
+ "guest streams config not identical for all eps\n");
return CC_RESOURCE_ERROR;
}
if (eps[i]->max_streams != dev_max_streams) {
- FIXME("device streams config not identical for all eps");
+ qemu_log_mask(LOG_UNIMP,
+ "device streams config not identical for all eps\n");
return CC_RESOURCE_ERROR;
}
}
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 11/13] hw/usb/hcd-xhci: Remove the FIXME macro
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (9 preceding siblings ...)
2026-07-14 19:35 ` [PULL 10/13] hw/usb/hcd-xhci: Turn guest-triggerable abort() into qemu_log_mask() Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 12/13] hw/usb/hcd-xhci: Use qemu_log_mask() instead of fprintf() statement Philippe Mathieu-Daudé
` (2 subsequent siblings)
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Thomas Huth <thuth@redhat.com>
The FIXME macro is only used in one case, which should hopefully
never trigger: The containing function handles all the USB_RET_*
values except for USB_RET_ADD_TO_QUEUE and USB_RET_REMOVE_FROM_QUEUE,
which are both internal return values for when an async packet needs
to be queued or dequeued, and which shouldn't still be the status by
the time we get to this function. Thus let's simplify this spot
and use a g_assert_not_reached() instead (and remove the DPRINT()
in front of it to avoid that code analyzers trip over unreachable
code here).
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-ID: <20260713161406.361197-3-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/usb/hcd-xhci.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index f5bb7d25600..cc61e28d33b 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -39,8 +39,6 @@
#else
#define DPRINTF(...) do {} while (0)
#endif
-#define FIXME(_msg) do { fprintf(stderr, "FIXME %s:%d %s\n", \
- __func__, __LINE__, _msg); abort(); } while (0)
#define TRB_LINK_LIMIT 32
#define COMMAND_LIMIT 256
@@ -1673,9 +1671,7 @@ static int xhci_try_complete_packet(XHCITransfer *xfer)
xhci_stall_ep(xfer);
break;
default:
- DPRINTF("%s: FIXME: status = %d\n", __func__,
- xfer->packet.status);
- FIXME("unhandled USB_RET_*");
+ g_assert_not_reached();
}
return 0;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 12/13] hw/usb/hcd-xhci: Use qemu_log_mask() instead of fprintf() statement
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (10 preceding siblings ...)
2026-07-14 19:35 ` [PULL 11/13] hw/usb/hcd-xhci: Remove the FIXME macro Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 13/13] net: only advertise passt in netdev help when CONFIG_PASST Philippe Mathieu-Daudé
2026-07-17 14:50 ` [PULL 00/13] Misc HW patches for 2026-07-14 Stefan Hajnoczi
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Thomas Huth <thuth@redhat.com>
We've got a proper way for logging unimplemented hardware features,
so use qemu_log_mask() instead of the fprintf() here now.
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260713161406.361197-4-thuth@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
hw/usb/hcd-xhci.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index cc61e28d33b..c7e050e38fd 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1017,7 +1017,8 @@ static XHCIStreamContext *xhci_find_stream(XHCIEPContext *epctx,
}
sctx = epctx->pstreams + streamid;
} else {
- fprintf(stderr, "xhci: FIXME: secondary streams not implemented yet");
+ qemu_log_mask(LOG_UNIMP,
+ "xhci: secondary streams not implemented yet\n");
*cc_error = CC_INVALID_STREAM_TYPE_ERROR;
return NULL;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PULL 13/13] net: only advertise passt in netdev help when CONFIG_PASST
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (11 preceding siblings ...)
2026-07-14 19:35 ` [PULL 12/13] hw/usb/hcd-xhci: Use qemu_log_mask() instead of fprintf() statement Philippe Mathieu-Daudé
@ 2026-07-14 19:35 ` Philippe Mathieu-Daudé
2026-07-17 14:50 ` [PULL 00/13] Misc HW patches for 2026-07-14 Stefan Hajnoczi
13 siblings, 0 replies; 15+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-07-14 19:35 UTC (permalink / raw)
To: qemu-devel
From: Rohitashv Kumar <roohiit@amazon.de>
show_netdevs() lists each conditionally-compiled netdev backend behind
its CONFIG_* guard (CONFIG_SLIRP for "user", CONFIG_L2TPV3 for
"l2tpv3", CONFIG_NET_BRIDGE for "bridge", ...). The "passt" entry was
added unconditionally, so "-netdev help" advertises passt even in
builds configured with --disable-passt. Trying to use it then fails
with "Parameter 'type' does not accept value 'passt'", since the QAPI
NetClientDriver enum member "passt" is gated by 'if': 'CONFIG_PASST'.
Guard the help entry with CONFIG_PASST so the advertised backends match
those actually compiled into the binary.
Signed-off-by: Rohitashv Kumar <roohiit@amazon.de>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-ID: <20260713194511.1058450-1-rohit.kuma1313@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
---
net/net.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/net.c b/net/net.c
index 2892f1730d1..5c39f8e7b44 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1385,7 +1385,9 @@ void show_netdevs(void)
"dgram",
"hubport",
"tap",
+#ifdef CONFIG_PASST
"passt",
+#endif
#ifdef CONFIG_SLIRP
"user",
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PULL 00/13] Misc HW patches for 2026-07-14
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
` (12 preceding siblings ...)
2026-07-14 19:35 ` [PULL 13/13] net: only advertise passt in netdev help when CONFIG_PASST Philippe Mathieu-Daudé
@ 2026-07-17 14:50 ` Stefan Hajnoczi
13 siblings, 0 replies; 15+ messages in thread
From: Stefan Hajnoczi @ 2026-07-17 14:50 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 116 bytes --]
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/11.1 for any user-visible changes.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-07-17 14:51 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-14 19:35 [PULL 00/13] Misc HW patches for 2026-07-14 Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 01/13] hw/sparc64/sun4u: Mark unusable PCI busses as full to ease device plugging Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 02/13] hw/misc/ivshmem: clear chardev handlers before freeing peers Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 03/13] docs/devel: Document SSI dummy-cycle ownership Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 04/13] hw/scsi/vmw_pvscsi: translate data endianness Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 05/13] hw/scsi/vmw_pvscsi: add a comment to explain the endianness Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 06/13] hw/display/qxl: fix TOCTOU in cursor chunk data_size handling Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 07/13] hw/sparc64/niagara: use int64_t for vdisk size to avoid truncation Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 08/13] hw/display/virtio-gpu: fix dmabuf_fd leak on remap failure Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 09/13] hw/usb/hcd-ohci: Make sure that ohci_service_ed_list() cannot loop forever Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 10/13] hw/usb/hcd-xhci: Turn guest-triggerable abort() into qemu_log_mask() Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 11/13] hw/usb/hcd-xhci: Remove the FIXME macro Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 12/13] hw/usb/hcd-xhci: Use qemu_log_mask() instead of fprintf() statement Philippe Mathieu-Daudé
2026-07-14 19:35 ` [PULL 13/13] net: only advertise passt in netdev help when CONFIG_PASST Philippe Mathieu-Daudé
2026-07-17 14:50 ` [PULL 00/13] Misc HW patches for 2026-07-14 Stefan Hajnoczi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.