All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Roger Pau Monné" <roger.pau@citrix.com>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
	Stefano Stabellini <sstabellini@kernel.org>,
	Anthony PERARD <anthony@xenproject.org>,
	Paul Durrant <paul@xen.org>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH] hw/xen: pass PCI domain to xc_physdev_map_pirq_msi()
Date: Thu, 23 Oct 2025 10:55:49 +0200	[thread overview]
Message-ID: <aPntlU6fPwU4jx_w@Mac.lan> (raw)
In-Reply-To: <d4bb9b02-5cdc-4da5-926b-7bb17f78bcfc@linaro.org>

On Tue, Oct 21, 2025 at 08:17:37PM +0200, Philippe Mathieu-Daudé wrote:
> On 17/10/25 17:51, Roger Pau Monne wrote:
> > It's currently impossible for passthrough devices on segment different than
> > 0 to work correctly, as the PCI domain is not provided to
> > xc_physdev_map_pirq_msi(), and hence it's unconditionally assumed that all
> > devices are on segment 0.
> > 
> > Adjust the call to xc_physdev_map_pirq_msi() to pass the PCI domain in the
> > high 16bits of the bus parameter.  On versions of Xen where this is not
> > supported the passed segment will be ignored and assume to be 0, no worse
> > than the current state.
> > 
> > Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> > Cc: Stefano Stabellini <sstabellini@kernel.org>
> > Cc: Anthony PERARD <anthony@xenproject.org>
> > Cc: Paul Durrant <paul@xen.org>
> > Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
> > Cc: xen-devel@lists.xenproject.org
> > ---
> >   hw/xen/xen_pt_msi.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/hw/xen/xen_pt_msi.c b/hw/xen/xen_pt_msi.c
> > index e9ba17317aba..df15ccf0d030 100644
> > --- a/hw/xen/xen_pt_msi.c
> > +++ b/hw/xen/xen_pt_msi.c
> > @@ -138,6 +138,7 @@ static int msi_msix_setup(XenPCIPassthroughState *s,
> >           rc = xc_physdev_map_pirq_msi(xen_xc, xen_domid, XEN_PT_AUTO_ASSIGN,
> >                                        ppirq, PCI_DEVFN(s->real_device.dev,
> >                                                         s->real_device.func),
> > +                                     ((uint32_t)s->real_device.domain << 16) |
> >                                        s->real_device.bus,
> 
> Alternatively:
> 
>   deposit32(s->real_device.bus, 16, 16, s->real_device.domain)

Oh, I have to admit I'm not that well versed in QEMU, so didn't even
knew this existed.

Thanks for picking it up.


      reply	other threads:[~2025-10-23  9:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-17 15:51 [PATCH] hw/xen: pass PCI domain to xc_physdev_map_pirq_msi() Roger Pau Monne
2025-10-18  4:50 ` Frediano Ziglio
2025-10-21 13:55 ` Anthony PERARD
2025-10-21 13:58 ` Edgar E. Iglesias
2025-10-21 18:17 ` Philippe Mathieu-Daudé
2025-10-23  8:55   ` Roger Pau Monné [this message]

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=aPntlU6fPwU4jx_w@Mac.lan \
    --to=roger.pau@citrix.com \
    --cc=anthony@xenproject.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=paul@xen.org \
    --cc=philmd@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sstabellini@kernel.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.