All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jason Andryuk <jandryuk@gmail.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: Re: Purpose of translate MSI interrupt into INTx for guest passthrough
Date: Tue, 12 Jan 2021 16:51:59 +0100	[thread overview]
Message-ID: <20210112155159.mqhfkww4uflttdno@Air-de-Roger> (raw)
In-Reply-To: <CAKf6xptsLxtjE3-MORi2eQ7ew+rMU1qPaxfPDpOu0Cz74-r0gw@mail.gmail.com>

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@citrix.com> 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.


  reply	other threads:[~2021-01-12 15:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 14:10 Purpose of translate MSI interrupt into INTx for guest passthrough Roger Pau Monné
2021-01-12 14:25 ` Roger Pau Monné
2021-01-12 14:48   ` Jason Andryuk
2021-01-12 15:51     ` Roger Pau Monné [this message]
2021-01-13 21:00       ` Andrew Cooper
2021-01-14 10:41         ` Roger Pau Monné

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112155159.mqhfkww4uflttdno@Air-de-Roger \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jandryuk@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.