All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	GuoHan Zhao <zhaoguohan@kylinos.cn>,
	"Gonglei (Arei)" <arei.gonglei@huawei.com>
Subject: [PULL v2 39/75] virtio-crypto: clean up every data queue
Date: Fri, 11 Sep 2026 05:02:51 -0400	[thread overview]
Message-ID: <6bc7c19eca673e99feb01d431e4c5c4959d4ebc2.1789117222.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1789117222.git.mst@redhat.com>

From: GuoHan Zhao <zhaoguohan@kylinos.cn>

realize() creates max_queues data queues and one BH for each of them.
unrealize() decides how many to tear down from multiqueue, but nothing ever
sets that field, so it only deletes the first queue and BH.

It does not matter how many queues the guest used here.  unrealize() must
undo all the allocations made by realize(), so loop over max_queues.

Fixes: 20cb2ffd5ff3 ("virtio-crypto: using bh to handle dataq's requests")
Signed-off-by: GuoHan Zhao <zhaoguohan@kylinos.cn>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260728111217.573046-1-zhaoguohan@kylinos.cn>
---
 hw/virtio/virtio-crypto.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index 79e2acb56c..85c7279aae 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -1114,10 +1114,9 @@ static void virtio_crypto_device_unrealize(DeviceState *dev)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtIOCrypto *vcrypto = VIRTIO_CRYPTO(dev);
     VirtIOCryptoQueue *q;
-    int i, max_queues;
+    int i;
 
-    max_queues = vcrypto->multiqueue ? vcrypto->max_queues : 1;
-    for (i = 0; i < max_queues; i++) {
+    for (i = 0; i < vcrypto->max_queues; i++) {
         virtio_delete_queue(vcrypto->vqs[i].dataq);
         q = &vcrypto->vqs[i];
         qemu_bh_delete(q->dataq_bh);
-- 
MST



  parent reply	other threads:[~2026-09-11  9:08 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  9:01 [PULL v2 00/75] pci, vhost, virtio, iommu, apci: features, fixes Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 01/75] virtio: fix exit(1) on DMA mapping failure during migration restore Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 02/75] virtio: fix config_len DoS in migration restore path Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 03/75] virtio-pci: reject Q_ENABLE write on already-enabled queue Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 04/75] hw/cxl: Fix guest-triggerable QEMU exit on reserved interleave ways Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 05/75] linux-headers: add VIRTIO_ID_MEDIA Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 06/75] hw/display: add vhost-user-media device Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 07/75] hw/display/vhost-user-media: add shared memory region BAR Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 08/75] virtio: reduce code duplication for split ring Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 09/75] net/tap: rework tap_parse_script Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 10/75] net/tap: improve script/downscript options documentation Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 11/75] net/tap: deprecate "no" as special value for script/downscript Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 12/75] net/tap: move vhost-net open() calls to tap_parse_vhost_fds() Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 13/75] net/tap: move vhost initialization to tap_setup_vhost() Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 14/75] net/tap: use container_of instead of DO_UPCAST Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 15/75] net/tap: QOMify tap backend Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 16/75] net/tap: add TYPE_VMSTATE_IF interface Michael S. Tsirkin
2026-09-11  9:01 ` [PULL v2 17/75] qapi: add local migration parameter Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 18/75] migration/fd: fix fd leak when fd is not valid for migration Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 19/75] migration/fd: add errp parameter to migration_fd_valid() Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 20/75] migration: check that transfer is UNIX socket when "local" set Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 21/75] virtio-net: support local migration of backend Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 22/75] net/tap: disable read polling for stopped VM Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 23/75] net/tap: support local migration with virtio-net Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 24/75] tests/functional: add test_tap_migration Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 25/75] tests/bios-tables-test: Exclude CEDT.cxl for the CFMW restriction change Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 26/75] hw/cxl: Drop Back-Invalidate from default CFMW window restrictions Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 27/75] tests/acpi/cxl: Update CEDT.cxl for the default CFMW restrictions Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 28/75] hw/cxl: Add configurable CXL Fixed Memory Window restriction flags Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 29/75] tests/qtest/cxl: Add CXL Fixed Memory Window restriction flag tests Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 30/75] hw/net/virtio-net: check packet size before VLAN tag access in receive_filter() Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 31/75] hw/virtio-blk: Account discard operations Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 32/75] hw/virtio-blk: Complete zone-append cookies Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 33/75] hw/nvme: Fix block accounting in nvme_copy() Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 34/75] hw/nvme: Fix block accounting for compare Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 35/75] hw/ide: Have ide_dma_cb() complete accounting Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 36/75] hw/scsi-disk: Fix accounting for IGNORE, ret > 0 Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 37/75] meson: disable "maybe uninitilized" errors with -Og Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 38/75] hw/net/virtio-net: strip trailing padding when caching RSC segment Michael S. Tsirkin
2026-09-11  9:02 ` Michael S. Tsirkin [this message]
2026-09-11  9:02 ` [PULL v2 40/75] hw/virtio: reject inverted virtio-iommu IOVA ranges Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 41/75] virtio-balloon: fix free-page BH teardown on unrealize Michael S. Tsirkin
2026-09-11  9:02 ` [PULL v2 42/75] vhost-user.rst: fix typo Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 43/75] hw/virtio: Propagate vhost_virtqueue_mask errors Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 44/75] amd_iommu: Return empty efr for stub call Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 45/75] tests/acpi: x86: Allow IVRS acpi table changes Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 46/75] amd_iommu: acpi-build: update PA, GVA and VA size macros Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 47/75] acpi_build: Use IOMMU pci device to build IOMMU DeviceID Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 48/75] acpi_build: Build IVRS feature report using extended feature register Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 49/75] amd_iommu: acpi-build: Remove unsupported PPR and HE feature Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 50/75] tests/acpi: x86: update golden masters for IVRS Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 51/75] libvhost-user: accept the postcopy client base ack in vu_add_mem_reg() Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 52/75] libvhost-user: return the backend mapping address for added regions Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 53/75] linux-headers: Update to Linux v7.3-rc1 Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 54/75] virtio-scsi: set dataplane_started to false upon failure Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 55/75] hw/cxl: fix the CDAT DOE overlapping the Flex Bus DVSEC when sn= is set Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 56/75] virtio-rtc: Report smeared UTC clock type Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 57/75] intel_iommu: Support concurrent page fault handling with PRI Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 58/75] intel_iommu: Only set dirty bit when PTE exposes write permission Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 59/75] intel_iommu: Always write all the flags passed to vtd_set_flag_in_pte Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 60/75] pci: batch BAR remapping into one memory transaction Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 61/75] pci: load a device's config inside " Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 62/75] hw/acpi: Make AcpiGedState const in build_ged_aml() Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 63/75] hw/hotplug: Mark various HotplugHandlerClass variables as const Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 64/75] hw/hotplug: Reduce some HotplugHandler variables scope Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 65/75] hw/hotplug: Constify HotplugHandler Michael S. Tsirkin
2026-09-11  9:03 ` [PULL v2 66/75] net/tap-solaris: Fix resource leaks on error paths Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 67/75] virtio-net: validate IHL in virtio_net_rsc_extract_unit4 before use Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 68/75] intel_iommu: Expose SMPWC when SVM is enabled Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 69/75] vhost-user: add skip_drain param to do_vhost_virtqueue_stop Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 70/75] vhost-user: add GET_VRING_BASE_SKIP_DRAIN message Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 71/75] vhost-user: use skip_drain with " Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 72/75] vhost-user-blk: make inflight-migration prop mutable on running vm Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 73/75] vhost-user-blk: move inflight_needed higher Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 74/75] vhost-user-blk: use GET_VRING_BASE_SKIP_DRAIN when inflight-migration is on Michael S. Tsirkin
2026-09-11  9:04 ` [PULL v2 75/75] MAINTAINERS: add Junjie Cao as CXL reviewer Michael S. Tsirkin
2026-09-11 13:41 ` [PULL v2 00/75] pci, vhost, virtio, iommu, apci: features, fixes Albert Esteve
2026-09-11 19:40   ` Michael S. Tsirkin
2026-09-11 19:06 ` Richard Henderson
2026-09-11 20:00   ` Michael S. Tsirkin
2026-09-11 23:43     ` Richard Henderson
2026-09-12  9:54     ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6bc7c19eca673e99feb01d431e4c5c4959d4ebc2.1789117222.git.mst@redhat.com \
    --to=mst@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhaoguohan@kylinos.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.