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

[xen stable-4.19] tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0



commit 734ddde8961d0a8145c563f9368c561da837f803
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Nov 10 17:12:11 2025 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Nov 10 17:12:11 2025 +0100

    tools/libxc: fix xc_physdev_map_pirq_msi() with PCI segments != 0
    
    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.
    
    Amends: 7620c0cf9a4d ("PCI multi-seg: add new physdevop-s")
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
    master commit: b7838d12bd1adc12e7fa820fc124a251b8f4629e
    master date: 2025-10-21 16:56:19 +0100
---
 tools/include/xenctrl.h      | 2 +-
 tools/libs/ctrl/xc_physdev.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/include/xenctrl.h b/tools/include/xenctrl.h
index 9ceca0cffc..cebc03d4e0 100644
--- a/tools/include/xenctrl.h
+++ b/tools/include/xenctrl.h
@@ -1633,7 +1633,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base);
 
diff --git a/tools/libs/ctrl/xc_physdev.c b/tools/libs/ctrl/xc_physdev.c
index 460a8e779c..d01949454d 100644
--- a/tools/libs/ctrl/xc_physdev.c
+++ b/tools/libs/ctrl/xc_physdev.c
@@ -65,7 +65,7 @@ int xc_physdev_map_pirq_msi(xc_interface *xch,
                             int index,
                             int *pirq,
                             int devfn,
-                            int bus,
+                            int segbus,
                             int entry_nr,
                             uint64_t table_base)
 {
@@ -79,10 +79,10 @@ 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;
+    map.bus = segbus;
     map.devfn = devfn;
     map.entry_nr = entry_nr;
     map.table_base = table_base;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.19



 


Rackspace

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