All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: "Marek Marczykowski-Górecki" <marmarek@invisiblethingslab.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: Design session "MSI-X support with Linux stubdomain" notes
Date: Thu, 22 Sep 2022 17:05:18 +0100	[thread overview]
Message-ID: <YyyHvp34Wg1kSqFu@perard.uk.xensource.com> (raw)

WARNING: Notes missing at the beginning of the meeting.

session description:
> Currently a HVM with PCI passthrough and Qemu Linux stubdomain doesn’t
> support MSI-X. For the device to (partially) work, Qemu needs a patch masking
> MSI-X from the PCI config space. Some drivers are not happy about that, which
> is understandable (device natively supports MSI-X, so fallback path are
> rarely tested).
>
> This is mostly (?) about qemu accessing /dev/mem directly (here:
> https://github.com/qemu/qemu/blob/master/hw/xen/xen_pt_msi.c#L579) - lets
> discuss alternative interface that stubdomain could use.



when qemu forward interrupt,
    for correct mask bit, it read physical mask bit.
    an hypercall would make sense.
    -> benefit, mask bit in hardware will be what hypervisor desire, and device model desire.
    from guest point of view, interrupt should be unmask.

interrupt request are first forwarded to qemu, so xen have to do some post processing once request comes back from qemu.
    it's weird..

someone should have a look, and rationalize this weird path.

Xen tries to not forward everything to qemu.

why don't we do that in xen.
    there's already code in xen for that.

Issue: having QEMU open /dev/mem within stubdom isn't working.

We could look at removing the need for /dev/mem by improving support for qemu-depriv.

hypervisor configuration interface was intended for one domain. having stubdom in
the middle makes thing difficult.

See QEMU's code
    https://github.com/qemu/qemu/blob/master/hw/xen/xen_pt_msi.c#L579
        fd = open("/dev/mem", O_RDWR);

TODO:
step1: Find out why qemu wants that mask?
step2: identify what is missing in the PV interface.

QEMU use this to read the Pending Bit Array (PBA), and read entry in  table

comments at L465 (of xen_pt_msi.c) doesn't makes sense

Xen could do more fixup

passing value from hardware??
    can't pass vector to the guest,
    xen overwrite mask bit. (or something)

Did MSI-X worked in qemu-trad in stubdom?
    No one in the room could remember.

MSI-X is required for pci express, not that thing are implemented correctly.

TODO:
- get rid of opening /dev/mem in qemu


Cheers,

-- 
Anthony PERARD


             reply	other threads:[~2022-09-22 16:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-22 16:05 Anthony PERARD [this message]
2022-09-22 18:00 ` Design session "MSI-X support with Linux stubdomain" notes Jan Beulich
2022-09-26 12:43   ` Marek Marczykowski-Górecki
2022-09-26 12:47     ` Jan Beulich
2022-09-29 10:57       ` Marek Marczykowski-Górecki
2022-09-29 11:44         ` Jan Beulich
2022-09-29 11:52           ` Roger Pau Monné
2022-09-29 12:48             ` Juergen Gross

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=YyyHvp34Wg1kSqFu@perard.uk.xensource.com \
    --to=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=marmarek@invisiblethingslab.com \
    --cc=roger.pau@citrix.com \
    --cc=xen-devel@lists.xenproject.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.