xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Design session "MSI-X support with Linux stubdomain" notes
@ 2022-09-22 16:05 Anthony PERARD
  2022-09-22 18:00 ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Anthony PERARD @ 2022-09-22 16:05 UTC (permalink / raw)
  To: xen-devel
  Cc: Marek Marczykowski-Górecki, Jan Beulich, George Dunlap,
	Roger Pau Monné

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-09-29 12:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 16:05 Design session "MSI-X support with Linux stubdomain" notes Anthony PERARD
2022-09-22 18:00 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).