[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Design session "MSI-X support with Linux stubdomain" notes


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Thu, 22 Sep 2022 17:05:18 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, "George Dunlap" <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Thu, 22 Sep 2022 16:05:57 +0000
  • Ironport-data: A9a23:fG+jeqz0xApMAPcx3bB6t+dJxirEfRIJ4+MujC+fZmUNrF6WrkUFm DFJCm+DOveJM2qgf9B+bIS0/UhSuMOHn4AwTwBkrCAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnj/0bv676yEUOZigHtLUEPTDNj16WThqQSIgjQMLs+Mii8tjjMPR7zml4 LsemOWCfg7+s9JIGjhMsfjb+Uk15K6aVA4w5TTSW9ga5DcyqFFNZH4vDfnZB2f1RIBSAtm7S 47rpF1u1jqEl/uFIorNfofTKiXmcJaLVeS9oiM+t5yZqgpDvkQPPpMTb5LwX6v1ZwKhxLidw P0V3XC5pJxA0qfkwIzxWDEAe81y0DEvFBYq7hFTvOTKp3AqfUcAzN1uNUAaO6oi9d0wEGQe7 cc7M3MBdhWM0rfeLLKTEoGAh+wmJcjveogepmth3XfSCvNOrZLrGvuQo4UChXFp254ITa22i 8kxMFKDaDzJZQFPPVEGToozhu6yilH0ciFCqULTrq0yi4TW5FwpiuewboqOEjCMbeRbpFm1t mudxFnGWB4FLcLCmQKv1n3504cjmgukAdlPRdVU7MVCglee22gSAx0+TkagrL+yjUvWc9dWM Ukd4Ccthak06k2wT9P5UgG4oXiLpRoVUZxbFOhSwBGAzO/Y7hiUAkAATyVdc5o2uckuXzso2 1SV2dTzClRSXKa9ECzHsO3O9HXrZHZTfTRqiTI4oRUt4+DijIcUtB30CcdmQLaOrca2FSn1z GXfxMQhvIn/nfLnxo3iow6c02nz9siYJuImzl6JBzz4t2uVcKbgPtX1sgaDsJ6sOa7DFjG8U G44d99yBQzkJbWEj2SzTeoEB9lFDN7VYWSH0TaD83TMnglBGkJPnqgKulmS3G8zbq45lcbBO Sc/Qz956p5JJ2eNZqRqeY+3AMlC5fG+S4+6Bq2PM4UWP8EZmOq7EMZGOiatM53FyhBwwcnTx 7/CGSpTMZrqIfs+l2fnLwvs+bQq2jo/1QvueHwP9Dz+iOL2WZJgYe1aWLd4RrxmsfjsTcS82 4o3CvZmPD0GCLChOnaOqN5PRb3IRFBiba3LRwVsXrbrCmJb9KsJUJc9HZtJl1RZoplo
  • Ironport-hdrordr: A9a23:kQDcBqBrgTKNHHblHemm55DYdb4zR+YMi2TC1yhKJyC9Vvbo8v xG+85rsSMc6QxhOk3I9ursBEDtex/hHP1OkOos1NWZPDUO0VHAROoJ0WKL+UyGJ8SUzI9gPM lbHJRDNA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.