* [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
@ 2025-10-17 14:14 Roger Pau Monne
2025-10-17 15:41 ` Oleksii Kurochko
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Roger Pau Monne @ 2025-10-17 14:14 UTC (permalink / raw)
To: xen-devel
Cc: oleksii.kurochko, Roger Pau Monne, Anthony PERARD, Juergen Gross
Otherwise it's not possible for device models to map IRQs of devices on
segments different than 0. Keep the same function prototype and pass the
segment in the high 16bits of the bus parameter, like it's done for the
hypercall itself.
Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
I think it's 4.21 material, as otherwise it's not possible to passthrough
PCI devices on segments != 0.
---
tools/libs/ctrl/xc_physdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
index 25e686d7b389..1307d6836d72 100644
--- a/tools/libs/ctrl/xc_physdev.c
+++ b/tools/libs/ctrl/xc_physdev.c
@@ -79,7 +79,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
}
memset(&map, 0, sizeof(struct physdev_map_pirq));
map.domid = domid;
- map.type = MAP_PIRQ_TYPE_MSI;
+ map.type = MAP_PIRQ_TYPE_MSI_SEG;
map.index = index;
map.pirq = *pirq;
map.bus = bus;
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-17 14:14 [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0 Roger Pau Monne
@ 2025-10-17 15:41 ` Oleksii Kurochko
2025-10-18 4:46 ` Frediano Ziglio
2025-10-20 7:46 ` Jan Beulich
2 siblings, 0 replies; 7+ messages in thread
From: Oleksii Kurochko @ 2025-10-17 15:41 UTC (permalink / raw)
To: Roger Pau Monne, xen-devel; +Cc: Anthony PERARD, Juergen Gross
[-- Attachment #1: Type: text/plain, Size: 1232 bytes --]
On 10/17/25 4:14 PM, Roger Pau Monne wrote:
> Otherwise it's not possible for device models to map IRQs of devices on
> segments different than 0. Keep the same function prototype and pass the
> segment in the high 16bits of the bus parameter, like it's done for the
> hypercall itself.
>
> Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
> Signed-off-by: Roger Pau Monné<roger.pau@citrix.com>
> ---
> I think it's 4.21 material, as otherwise it's not possible to passthrough
> PCI devices on segments != 0.
Make sense to me:
Release-Acked-by: Oleksii Kurochko<oleksii.kurochko@gmail.com>
Thanks.
~ Oleksii
> ---
> tools/libs/ctrl/xc_physdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
> index 25e686d7b389..1307d6836d72 100644
> --- a/tools/libs/ctrl/xc_physdev.c
> +++ b/tools/libs/ctrl/xc_physdev.c
> @@ -79,7 +79,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
> }
> memset(&map, 0, sizeof(struct physdev_map_pirq));
> map.domid = domid;
> - map.type = MAP_PIRQ_TYPE_MSI;
> + map.type = MAP_PIRQ_TYPE_MSI_SEG;
> map.index = index;
> map.pirq = *pirq;
> map.bus = bus;
[-- Attachment #2: Type: text/html, Size: 1880 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-17 14:14 [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0 Roger Pau Monne
2025-10-17 15:41 ` Oleksii Kurochko
@ 2025-10-18 4:46 ` Frediano Ziglio
2025-10-20 7:50 ` Jan Beulich
2025-10-20 7:46 ` Jan Beulich
2 siblings, 1 reply; 7+ messages in thread
From: Frediano Ziglio @ 2025-10-18 4:46 UTC (permalink / raw)
To: Roger Pau Monne
Cc: xen-devel, oleksii.kurochko, Anthony PERARD, Juergen Gross
On Fri, Oct 17, 2025 at 3:26 PM Roger Pau Monne <roger.pau@citrix.com> wrote:
>
> Otherwise it's not possible for device models to map IRQs of devices on
> segments different than 0. Keep the same function prototype and pass the
> segment in the high 16bits of the bus parameter, like it's done for the
> hypercall itself.
>
> Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> I think it's 4.21 material, as otherwise it's not possible to passthrough
> PCI devices on segments != 0.
> ---
> tools/libs/ctrl/xc_physdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
> index 25e686d7b389..1307d6836d72 100644
> --- a/tools/libs/ctrl/xc_physdev.c
> +++ b/tools/libs/ctrl/xc_physdev.c
> @@ -79,7 +79,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
> }
> memset(&map, 0, sizeof(struct physdev_map_pirq));
> map.domid = domid;
> - map.type = MAP_PIRQ_TYPE_MSI;
> + map.type = MAP_PIRQ_TYPE_MSI_SEG;
> map.index = index;
> map.pirq = *pirq;
> map.bus = bus;
Reviewed-by: Frediano Ziglio <frediano.ziglio@citrx.com>
This was tested on a real machine.
About MAP_PIRQ_TYPE_MSI and MAP_PIRQ_TYPE_MSI_SEG, do we need to keep
ABI compatibility or we should just remove MAP_PIRQ_TYPE_MSI_SEG and
make MAP_PIRQ_TYPE_MSI consider the segment ?
Frediano
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-18 4:46 ` Frediano Ziglio
@ 2025-10-20 7:50 ` Jan Beulich
0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2025-10-20 7:50 UTC (permalink / raw)
To: Frediano Ziglio
Cc: xen-devel, oleksii.kurochko, Anthony PERARD, Juergen Gross,
Roger Pau Monne
On 18.10.2025 06:46, Frediano Ziglio wrote:
> On Fri, Oct 17, 2025 at 3:26 PM Roger Pau Monne <roger.pau@citrix.com> wrote:
>>
>> Otherwise it's not possible for device models to map IRQs of devices on
>> segments different than 0. Keep the same function prototype and pass the
>> segment in the high 16bits of the bus parameter, like it's done for the
>> hypercall itself.
>>
>> Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
>> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
>> ---
>> I think it's 4.21 material, as otherwise it's not possible to passthrough
>> PCI devices on segments != 0.
>> ---
>> tools/libs/ctrl/xc_physdev.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
>> index 25e686d7b389..1307d6836d72 100644
>> --- a/tools/libs/ctrl/xc_physdev.c
>> +++ b/tools/libs/ctrl/xc_physdev.c
>> @@ -79,7 +79,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
>> }
>> memset(&map, 0, sizeof(struct physdev_map_pirq));
>> map.domid = domid;
>> - map.type = MAP_PIRQ_TYPE_MSI;
>> + map.type = MAP_PIRQ_TYPE_MSI_SEG;
>> map.index = index;
>> map.pirq = *pirq;
>> map.bus = bus;
>
> Reviewed-by: Frediano Ziglio <frediano.ziglio@citrx.com>
>
> This was tested on a real machine.
>
> About MAP_PIRQ_TYPE_MSI and MAP_PIRQ_TYPE_MSI_SEG, do we need to keep
> ABI compatibility or we should just remove MAP_PIRQ_TYPE_MSI_SEG and
> make MAP_PIRQ_TYPE_MSI consider the segment ?
Assuming you talk about the hypervisor interface, could you explain how
you see breaking ABI compatibility to not break anything? These aren't
tools-only interfaces, after all.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-17 14:14 [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0 Roger Pau Monne
2025-10-17 15:41 ` Oleksii Kurochko
2025-10-18 4:46 ` Frediano Ziglio
@ 2025-10-20 7:46 ` Jan Beulich
2025-10-20 9:07 ` Roger Pau Monné
2 siblings, 1 reply; 7+ messages in thread
From: Jan Beulich @ 2025-10-20 7:46 UTC (permalink / raw)
To: Roger Pau Monne
Cc: oleksii.kurochko, Anthony PERARD, Juergen Gross, xen-devel
On 17.10.2025 16:14, Roger Pau Monne wrote:
> Otherwise it's not possible for device models to map IRQs of devices on
> segments different than 0. Keep the same function prototype and pass the
> segment in the high 16bits of the bus parameter, like it's done for the
> hypercall itself.
While easiest, that's an odd interface, though. Should, at the very least the
function parameter then be named e.g. "segbus", along the lines of "devfn"?
> Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
This commit wasn't about tool stack uses of the interfaces at all.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-20 7:46 ` Jan Beulich
@ 2025-10-20 9:07 ` Roger Pau Monné
2025-10-20 10:50 ` Jan Beulich
0 siblings, 1 reply; 7+ messages in thread
From: Roger Pau Monné @ 2025-10-20 9:07 UTC (permalink / raw)
To: Jan Beulich; +Cc: oleksii.kurochko, Anthony PERARD, Juergen Gross, xen-devel
On Mon, Oct 20, 2025 at 09:46:42AM +0200, Jan Beulich wrote:
> On 17.10.2025 16:14, Roger Pau Monne wrote:
> > Otherwise it's not possible for device models to map IRQs of devices on
> > segments different than 0. Keep the same function prototype and pass the
> > segment in the high 16bits of the bus parameter, like it's done for the
> > hypercall itself.
>
> While easiest, that's an odd interface, though. Should, at the very least the
> function parameter then be named e.g. "segbus", along the lines of "devfn"?
I certainly don't mind using segbus instead of plain bus, will adjust
now.
> > Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
>
> This commit wasn't about tool stack uses of the interfaces at all.
But there should have been a tools side change somewhere to make use
of that interface, at the point that support for multi-segment was
added to Xen? Otherwise the support feels like half done.
Would you prefer me to use the "Amends:" tag? Or no tag at all.
Thanks, Roger.
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
2025-10-20 9:07 ` Roger Pau Monné
@ 2025-10-20 10:50 ` Jan Beulich
0 siblings, 0 replies; 7+ messages in thread
From: Jan Beulich @ 2025-10-20 10:50 UTC (permalink / raw)
To: Roger Pau Monné
Cc: oleksii.kurochko, Anthony PERARD, Juergen Gross, xen-devel
On 20.10.2025 11:07, Roger Pau Monné wrote:
> On Mon, Oct 20, 2025 at 09:46:42AM +0200, Jan Beulich wrote:
>> On 17.10.2025 16:14, Roger Pau Monne wrote:
>>> Otherwise it's not possible for device models to map IRQs of devices on
>>> segments different than 0. Keep the same function prototype and pass the
>>> segment in the high 16bits of the bus parameter, like it's done for the
>>> hypercall itself.
>>
>> While easiest, that's an odd interface, though. Should, at the very least the
>> function parameter then be named e.g. "segbus", along the lines of "devfn"?
>
> I certainly don't mind using segbus instead of plain bus, will adjust
> now.
>
>>> Fixes: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
>>
>> This commit wasn't about tool stack uses of the interfaces at all.
>
> But there should have been a tools side change somewhere to make use
> of that interface, at the point that support for multi-segment was
> added to Xen? Otherwise the support feels like half done.
Perhaps. I was after kernel functionality only at that point, and I
would really have liked toolstack folks to have picked up any work
needed there.
> Would you prefer me to use the "Amends:" tag? Or no tag at all.
Both would be fine with me.
Jan
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2025-10-20 10:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-17 14:14 [PATCH for-4.21] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0 Roger Pau Monne
2025-10-17 15:41 ` Oleksii Kurochko
2025-10-18 4:46 ` Frediano Ziglio
2025-10-20 7:50 ` Jan Beulich
2025-10-20 7:46 ` Jan Beulich
2025-10-20 9:07 ` Roger Pau Monné
2025-10-20 10:50 ` Jan Beulich
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.