diff mbox series

[v6,6/6] tools/libxc: add wrapper for PHYSDEVOP_interrupt_control

Message ID 2f61f30aa8d270212506542bda6cdf083a68c069.1568475323.git-series.marmarek@invisiblethingslab.com (mailing list archive)
State Superseded
Headers show
Series Fix PCI passthrough for HVM with stubdomain | expand

Commit Message

Marek Marczykowski-Górecki Sept. 14, 2019, 3:37 p.m. UTC
Add libxc wrapper for PHYSDEVOP_interrupt_control introduced in previous
commit.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
Changes in v3:
 - new patch
Changes in v4:
 - adjust for updated previous patch
Changes in v5:
 - rename to PHYSDEVOP_msi_control, adjust arguments
Change in v6:
 - initialize struct physdev_interrupt_control inline, drop pointless rc
   variable
 - rename to PHYSDEVOP_interrupt_control
---
 tools/libxc/include/xenctrl.h |  6 ++++++
 tools/libxc/xc_physdev.c      | 15 +++++++++++++++
 2 files changed, 21 insertions(+)

Comments

Wei Liu Sept. 16, 2019, 10:54 a.m. UTC | #1
On Sat, 14 Sep 2019 at 16:38, Marek Marczykowski-Górecki
<marmarek@invisiblethingslab.com> wrote:
>
> Add libxc wrapper for PHYSDEVOP_interrupt_control introduced in previous
> commit.
>
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>

Subject to acceptance of earlier patches.

Acked-by: Wei Liu <wl@xen.org>
diff mbox series

Patch

diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
index 0ff6ed9..2adb114 100644
--- a/tools/libxc/include/xenctrl.h
+++ b/tools/libxc/include/xenctrl.h
@@ -1639,6 +1639,12 @@  int xc_physdev_unmap_pirq(xc_interface *xch,
                           uint32_t domid,
                           int pirq);
 
+int xc_physdev_interrupt_control(xc_interface *xch,
+                                 int seg,
+                                 int bus,
+                                 int devfn,
+                                 int flags);
+
 /*
  *  LOGGING AND ERROR REPORTING
  */
diff --git a/tools/libxc/xc_physdev.c b/tools/libxc/xc_physdev.c
index 460a8e7..5af8296 100644
--- a/tools/libxc/xc_physdev.c
+++ b/tools/libxc/xc_physdev.c
@@ -111,3 +111,18 @@  int xc_physdev_unmap_pirq(xc_interface *xch,
     return rc;
 }
 
+int xc_physdev_interrupt_control(xc_interface *xch,
+                                 int seg,
+                                 int bus,
+                                 int devfn,
+                                 int flags)
+{
+    struct physdev_interrupt_control op = {
+        .seg = seg,
+        .bus = bus,
+        .devfn = devfn,
+        .flags = flags,
+    };
+
+    return do_physdev_op(xch, PHYSDEVOP_interrupt_control, &op, sizeof(op));
+}