All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Cédric Le Goater" <clg@redhat.com>,
	"Alex Williamson" <alex@shazbot.org>
Subject: [PULL 06/11] vfio/pci: Replace abort() with g_assert_not_reached()
Date: Wed, 20 May 2026 18:21:10 +0200	[thread overview]
Message-ID: <20260520162115.1613601-7-clg@redhat.com> (raw)
In-Reply-To: <20260520162115.1613601-1-clg@redhat.com>

This check was originally introduced in commit b3ebc10c373e
("vfio-pci: Add debug config options to disable MSI/X KVM support") as
part of a debug block to retrieve the MSI/MSIX message, and was later
moved by commit 0de70dc7bab1 ("vfio/pci: Rename MSI/X functions for
easier tracing") into the main interrupt handling path, becoming
production code.

Under normal conditions, this code path cannot be reached because the
BQL serializes all handler registration, vdev->interrupt updates, and
handler removal. Replace abort() with g_assert_not_reached(), which is
preferred nowdays, and add a comment clarifying the purpose.

Cc: Alex Williamson <alex@shazbot.org>
Acked-by: Alex Williamson <alex@shazbot.org>
Link: https://lore.kernel.org/qemu-devel/20260506152353.1657838-1-clg@redhat.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
 hw/vfio/pci.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index b2a07f6bb4217bcacead194ce75b359b1896ef3a..9c06b25e6370d8bbea2828bfae64a3d14fe68219 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -451,7 +451,12 @@ static void vfio_msi_interrupt(void *opaque)
         get_msg = msi_get_message;
         notify = msi_notify;
     } else {
-        abort();
+        /*
+         * Interrupt state transitions (MSI/MSI-X -> NONE/INTx) are
+         * protected by the BQL, and eventfd handlers are strictly
+         * unregistered before vdev->interrupt is modified.
+         */
+        g_assert_not_reached();
     }
 
     msg = get_msg(pdev, nr);
-- 
2.54.0



  parent reply	other threads:[~2026-05-20 16:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 16:21 [PULL 00/11] vfio queue Cédric Le Goater
2026-05-20 16:21 ` [PULL 01/11] target/s390x: restore cpu_models for system builds Cédric Le Goater
2026-05-20 16:21 ` [PULL 02/11] hw/vfio: Drop superfluous inclusion of hw-error.h Cédric Le Goater
2026-05-20 16:21 ` [PULL 03/11] vfio-user: avoid leaking duplicate device name Cédric Le Goater
2026-05-20 16:21 ` [PULL 04/11] vfio-user: reject malformed migration capabilities Cédric Le Goater
2026-05-20 16:21 ` [PULL 05/11] hw/remote: update libvfio-user subproject Cédric Le Goater
2026-05-20 16:21 ` Cédric Le Goater [this message]
2026-05-20 16:21 ` [PULL 07/11] vfio/ap: Return false when IRQ notifier setup fails Cédric Le Goater
2026-05-20 16:21 ` [PULL 08/11] vfio/ccw: " Cédric Le Goater
2026-05-20 16:21 ` [PULL 09/11] update-linux-headers: Inject VIRTIO_RING_NO_LEGACY in virtio_ring.h Cédric Le Goater
2026-05-20 16:21 ` [PULL 10/11] vfio/migration: Detect and report overflow in migration size queries Cédric Le Goater
2026-05-20 16:21 ` [PULL 11/11] scripts/update-linux-headers: Add typelimits.h Cédric Le Goater
2026-05-20 22:21 ` [PULL 00/11] vfio queue Stefan Hajnoczi

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=20260520162115.1613601-7-clg@redhat.com \
    --to=clg@redhat.com \
    --cc=alex@shazbot.org \
    --cc=qemu-devel@nongnu.org \
    /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.