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

Re: Purpose of translate MSI interrupt into INTx for guest passthrough

  • To: Jason Andryuk <jandryuk@xxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Tue, 12 Jan 2021 16:51:59 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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-SenderADCheck; bh=b31DgIWgKNkoIGmvJFAO7ZIK6L5TqrpjOweVGZdR3vA=; b=e6P1MwyIQ8z6d3PssiPBdnyR9WAhteuPDcQuiFHupgDS+FFCmUZdl7HVxrq39sqyKIryYzaNQpqEugoFr4oVaj0jWWjNHumVgRCR3eUYlaivvo6I6XENDWPw2xAWsWwg+T5Svd82YfKQhyRPq21gEUWbrf8Rjxi52yHjlKSWD7f0QPlNPbA5dYX56/xnSy3rJphexlo2btlbeXgRskiUBzhlaPafiEajC61RlIulbsyut7NhwLl/vcHVV39RA+mfMidV7iRnKWjlJ34lmtOnsWsEZ0MtLrppVhTY4VOsVtVZAkbNGqqdSpuAGn48zbu7BXKIfnKlHRFap5BwCQiuuw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D6VQTAUiMVAPa7EM8Pfh7Yi+HhesHP94rAQCwdcOYGJvLhFW9n77bLkKYhGCV0eV+9pdyo5IryqzOJzANCXYDKQpY5d+Jo9dKdOLSF0ef9bUt7sWPCCzPIZhPnz3YmXKSUBa+WFIv1tozZrBjLjMn5sASXZSEOUK49Gv8OUOJm5NVHbo3tf5LnEdw0D9hDqBcPGXPV96k4Inq5wqydUV0dHKvcOhjzmifV3mafOPigZ8QlnICmiJ9nnmL0pzZ58zq2I1tbDwEX/2iQcSqCNww4h0lvkiMBuO3Mzy9c0JiBQKtLw1h9OBT2ZwaAq7NdgbZyMjpl3UguXOnRtbpPTuXw==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 12 Jan 2021 15:52:29 +0000
  • Ironport-sdr: GOUx8Hf1YavCjeYLU/soGwBd/DZSlc9rE9XZhR2Xl7a6T2aQO0a85vvRVxfLimUNXoMckFBEPS /mFWp++1pJVEysRFYZ+lShK/mJWsafELKPLXbIW1YRi+iN58k2wunR3g7koM/UPO75Kmmd8+gs OThqhckpvvtZf54jqDIBpkuuVk1rcxVeevQ81nXqgbD95V9mtEpWHRhxXealjZNMNUQhmPGjLK Pi4wG4HgcxJzZiNFmb5QXVOeZjX1Fo3wTCrNut30LS5ML3cLkDaIsdRbk+C0TfweCapcc2K1Eu jBE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Tue, Jan 12, 2021 at 09:48:17AM -0500, Jason Andryuk wrote:
> On Tue, Jan 12, 2021 at 9:25 AM Roger Pau Monné <roger.pau@xxxxxxxxxx> wrote:
> >
> > Dropping Qing He as this address bounces.
> >
> > On Tue, Jan 12, 2021 at 03:10:57PM +0100, Roger Pau Monné wrote:
> > > Hello,
> > >
> > > While trying to do some cleanup of the Xen interrupt support for pci
> > > pass though I came across the MSI to INTx translation that Xen is in
> > > theory capable of performing (ie: use a physical MSI interrupt source
> > > and inject that as an INTx to a guest).
> > >
> > > AFAICT such functionality is not wired up to the toolstack, so it's
> > > hard to tell what's the indented purpose, or whether it has seen any
> > > usage.
> >
> > So apparently it is wired up to the toolstack for qemu-traditional,
> > albeit it's disabled by default. There's some documentation in
> > xl-pci-configuration:
> >
> > "When enabled, MSI-INTx translation will always enable MSI on the PCI
> > device regardless of whether the guest uses INTx or MSI."
> >
> > So the main purpose seem to be to always use the MSI interrupt source
> > regardless of whether the guest is using INTx or MSI. Maybe the
> > purpose was to workaround some bugs when using INTx? Or buggy devices
> > with INTx interrupts?
> >
> > qemu-upstream doesn't seem to support it anymore, so I would still
> > like to remove it if we get consensus.
> The cover letter from
> http://old-list-archives.xenproject.org/archives/html/xen-devel/2009-01/msg00228.html
> """
> This patchset enables MSI-INTx interrupt translation for HVM
> domains. The intention of the patch is to use MSI as the physical
> interrupt mechanism for passthrough device as much as possible,
> thus reducing the pirq sharing among domains.
> When MSI is globally enabled, if the device has the MSI capability
> but doesn't used by the guest, hypervisor will try to user MSI as
> the underlying pirq and inject translated INTx irq to guest
> vioapic. When guest itself enabled MSI or MSI-X, the translation
> is automatically turned off.
> Add a config file option to disable/enable this feature. Also, in
> order to allow the user to override the option per device, a
> per-device option mechanism is implemented and an MSI-INTx option
> is added
> """
> It seems like it could be a good idea, but I don't know if it presents
> compatibility issues when actually used.

Hm, MSI interrupts are edge triggered, while INTx is (usually) level.
Also devices capable of multiple MSI vectors will be limited to a
single one, and I'm not sure whether the transition from translated
MSI to INTx into multiple MSIs would work correctly, as seems tricky.

> As you say, it's not supported by qemu-upstream, so maybe it should
> just be dropped.

I don't really see much value in forcing Xen to always use MSI
regardless of whether the guest is using INTx or MSI, and it's likely
to cause more issues than benefits.

IMO I think we should get rid of this, as the only real value is
having Xen using MSI intend of INTx, but it's not introducing any kind
of functionality from a guest PoV.

Thanks, Roger.



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