Re: [PATCH 2/3] vmd: disable MSI remapping bypass under Xen

From: Roger Pau Monné
Date: Mon Jan 13 2025 - 05:07:41 EST


On Fri, Jan 10, 2025 at 10:02:00PM -0700, Jonathan Derrick wrote:
> Hi Bjorn,
>
> On 1/10/25 3:25 PM, Bjorn Helgaas wrote:
> > Match historical subject line style for prefix and capitalization:
> >
> > PCI: vmd: Set devices to D0 before enabling PM L1 Substates
> > PCI: vmd: Add DID 8086:B06F and 8086:B60B for Intel client SKUs
> > PCI: vmd: Fix indentation issue in vmd_shutdown()
> >
> > On Fri, Jan 10, 2025 at 03:01:49PM +0100, Roger Pau Monne wrote:
> > > MSI remapping bypass (directly configuring MSI entries for devices on the VMD
> > > bus) won't work under Xen, as Xen is not aware of devices in such bus, and
> > > hence cannot configure the entries using the pIRQ interface in the PV case, and
> > > in the PVH case traps won't be setup for MSI entries for such devices.
> > >
> > > Until Xen is aware of devices in the VMD bus prevent the
> > > VMD_FEAT_CAN_BYPASS_MSI_REMAP capability from being used when running as any
> > > kind of Xen guest.
> >
> > Wrap to fit in 75 columns.
> >
> > Can you include a hint about *why* Xen is not aware of devices below
> > VMD? That will help to know whether it's a permanent unfixable
> > situation or something that could be done eventually.
> >
> I wasn't aware of the Xen issue with VMD but if I had to guess it's probably
> due to the special handling of the downstream device into the dmar table.

Nothing to do with DMAR or IOMMUs, it's just that on a Xen system it
must be Xen the one that configures the MSI entries, and that requires
Xen being aware of the VMD devices and it's MSI or MSI-X
capabilities.

None of this is currently done, as Xen has no visibility at all of
devices behind a VMD bridge because is doesn't even know about VMD
bridges, neither about the exposed ECAM-like region on those
devices.

Thanks, Roger.