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

Re: [PATCH] hw/xen: pass PCI domain to xc_physdev_map_pirq_msi()


  • To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Thu, 23 Oct 2025 10:55:49 +0200
  • 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=arcselector10001; 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=kzfwZCceF4wWOKQ3APZGG3TEWSaoZ0JykLg7ajLVIlo=; b=jQ+B2RmufF3+v/xucCM3gPwp6K1DsJopHO7GRkXVanOT1daODJpQ/Z7HWBUIaiWlQoxZk4ME/DFdM8r87ZusAAPkM59f0ac9AzLim5KLK28QVOLSZF77psfMAxuIgimvR2TG5Pto2QN9X1RDPro1mX15aFaUtAsEO/W42kBC02O9lvr/OmUp90BSZR7NBFK/4tkvNaf5OXRuYpLV2ZTO6KoIHZpPFOl0ZTFwxkYT6Cwq+dv5JSnibTo/THZpwBGxr2HOUf2D4VOOocWH9mrj+3jPWmmyRRdCTiahqwTpcPQRITrcBEoXS6jN56O0JSXyDonwMuZRfuIBuj7lxxA5xQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=W1Vba8K+JVf5WGQnl3tUe90ozK8smNw20MzvyFNVbi+wR3K5p0vmSBqpTUwizTBVKwGygeZBK8xpCCHuXCFT0H7CWa4aGH4DGM+0r3ykLIF1Uvr5yELwm+z2yGFuFSQN2jQkFK2tk+u3jrAi8tdiN9Fe0Vct0fksuvXJokh76+KrELArKEpxIUgCEODTbMEpmDwynVmPjbdtTS2QjQNTPC+AkDsEmMhzs8qwWDFjw5mzg+0QfOkU5ZQaJS/WD+SMl72ZV/yM48nnwdpc7zZQGO19EibDIGzcS3AvShkWa52CL7tUYtKU38IwjXJ2fIpSx5OL1TBGhxFtv3+Y3tCmSw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: qemu-devel@xxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony@xxxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 23 Oct 2025 08:56:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.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@xxxxxxxxxx>
> > ---
> > Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
> > Cc: Anthony PERARD <anthony@xxxxxxxxxxxxxx>
> > Cc: Paul Durrant <paul@xxxxxxx>
> > Cc: "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>
> > Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
> > ---
> >   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.



 


Rackspace

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