public inbox for virtio-comment@lists.linux.dev
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: "virtio-comment@lists.linux.dev" <virtio-comment@lists.linux.dev>
Subject: Should there be a mode in which the virtqueue -> MSI mapping is fixed?
Date: Sat, 4 Apr 2026 17:19:41 -0400	[thread overview]
Message-ID: <e8a35333-589a-4a00-8e1a-32d497171e56@gmail.com> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 1814 bytes --]

Cloud Hypervisor's vhost-user frontend does not implement MSI-X
properly [1].  Specifically:

1. Reads from the Pending Bit Array (PBA) always return 0.

2. Changes to the MSI associated with a virtqueue after the device
   is activated are ignored.
   
Amazingly, there have not been any reports of this causing breakage.
I have a fix for the first [2], which actually decreases the amount
of code.  However, the second is trickier and I'm tempted to not
bother unless it causes real-world problems.

Are there real-world drivers that will run into either of the above
bugs?  Linux seems to only choose anything else as a fallback, which
presumably is not triggered.

One reason I am asking is that I am working on an updated
virtio-vhost-user spec, which I've renamed vhost-guest.  A vhost-guest
device implements a vhost-user server, and requires one MSI for each
virtqueue of _the device being implemented_.  The existing spec
allows the guest to select which MSIs are used, but that seems to
be pointless additional complexity.  A simpler option would be to
hard-code the MSI assignments:

- 0: Configuration change interrupt.

- 1..N (inclusive): Queue interrupts for the N virtqueues provided
  by the vhost-guest device.

- N+1..N+M (inclusive): Buffer availability interrupts for each of
  the M virtqueues that the driver is implementing.

I expect that all real-world drivers for vhost-guest will select
MSIs in this manner.  Hard-coding it makes the device implementation
(and specification!) simpler.  I'd also rather not ship the first
implementation with a known bug!

[1]: https://github.com/cloud-hypervisor/cloud-hypervisor/issues/7813
[2]: https://github.com/cloud-hypervisor/cloud-hypervisor/pull/7963
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2026-04-04 21:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04 21:19 Demi Marie Obenour [this message]
2026-04-05  0:56 ` Should there be a mode in which the virtqueue -> MSI mapping is fixed? Michael S. Tsirkin
2026-04-05 17:50   ` Demi Marie Obenour
2026-04-05 20:15     ` Michael S. Tsirkin
2026-04-05 20:58       ` Demi Marie Obenour
2026-04-05 21:09         ` Michael S. Tsirkin
2026-04-05 21:47           ` Demi Marie Obenour
2026-04-05 21:50             ` Michael S. Tsirkin
2026-04-05 22:28               ` Demi Marie Obenour
2026-04-06  9:25                 ` Michael S. Tsirkin

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=e8a35333-589a-4a00-8e1a-32d497171e56@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=virtio-comment@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox