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

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


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 22 Sep 2022 20:00:00 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xi5rwIE4lCmJseog6Mrv9gQQht4AW38k0otLebEJPMI=; b=Qm+3ur6YGLV5FCqGzlz3chr7b3jfk/kY74Up+qH5zrR/1RjxIn5X+yO8YxkR4C5e/y7Np8QXhAn/EusVMtzcXdttANt0Q+yei8+aRV/+TQQkzok49Hd6vHirO2HDZVFiiT6tnZd0nAKrdgx1vxQeh7r0co6hpT7UegIKx6g3GD8V/sNKuuiQnWSe3RtJrreXT4YklM9vhlB6tgjejz22rg3XdOmVAnhUFx/wOk/4mshlm4OhKAfwCprvXLf9ZAwoHKD1ZCPMkzbrEqjtus5phr8wpsT35jkrOTWlljD1qYjYz3ui0uQt76bxXbkoCt03aVraBUjlFTWndMFTh0P3dA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KC+mHbrzWii3ebYyNjTR2HnKUqSYEvuiS6Tkh8/OYofO6fvQ7eTNwlVW5a67n6f+3K9Zx8jym/dt24mAMNnVcAOjpuc6LzNl2Y2CAi1H/8zNnrn2V59MKGsniWTyqpyA2JdpIjD/F4m4jc+fwdw91DN080AVyCYCrbndKUxGsr5PkTe6pbaFZ2n9kn1warjfDuY9KEuCvHmDrwrh93B1Tc+Am0v590Pv+tHegzjit3eejyft8x3pCiil3d3RBai/tIeX8MmndMySMS26XpvhC9+gz7WGnGubvqhGX/7I0vuxEmAg3l3fg0dmZTNPSceJv6/KKQAiL2Om85Y5mPxOQQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Thu, 22 Sep 2022 18:00:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.09.2022 18:05, Anthony PERARD wrote:
> 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.

So what I didn't pay enough attention to when talking was that the
completion logic in Xen is for writes only. Maybe something similar
can be had for reads as well, but that's to be checked ...

Jan

> 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,
> 




 


Rackspace

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