[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()



On Fri, Oct 17, 2025 at 4:52 PM Roger Pau Monne <roger.pau@xxxxxxxxxx> 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

typo: assumed

> 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,
>                                       msix_entry, table_base);
>          if (rc) {

Reviewed-by: Frediano Ziglio <freddy77@xxxxxxxxx>

This was tested on a real machine.

Frediano



 


Rackspace

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