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

[Xen-changelog] [xen-unstable] libxc: add new operation in HVMOP to deliver emulated MSI.



# HG changeset patch
# User Wei Liu <liuw@xxxxxxxxx>
# Date 1306418477 -3600
# Node ID a7383a7a00006a6983fc3b9587363ffc7c53e156
# Parent  5024faf7c92986a86843b977bd63b3c54d688647
libxc: add new operation in HVMOP to deliver emulated MSI.

Signed-off-by: Wei Liu <liuw@xxxxxxxxx>
---


diff -r 5024faf7c929 -r a7383a7a0000 tools/libxc/xc_misc.c
--- a/tools/libxc/xc_misc.c     Thu May 26 14:58:28 2011 +0100
+++ b/tools/libxc/xc_misc.c     Thu May 26 15:01:17 2011 +0100
@@ -417,6 +417,35 @@
     return rc;
 }
 
+int xc_hvm_inject_msi(
+    xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data)
+{
+    DECLARE_HYPERCALL;
+    DECLARE_HYPERCALL_BUFFER(struct xen_hvm_inj_msi, arg);
+    int rc;
+
+    arg = xc_hypercall_buffer_alloc(xch, arg, sizeof(*arg));
+    if ( arg == NULL )
+    {
+        PERROR("Could not allocate memory for xc_hvm_inj_msi hypercall");
+        return -1;
+    }
+
+    hypercall.op     = __HYPERVISOR_hvm_op;
+    hypercall.arg[0] = HVMOP_inj_msi;
+    hypercall.arg[1] = HYPERCALL_BUFFER_AS_ARG(arg);
+
+    arg->domid = dom;
+    arg->addr  = addr;
+    arg->data  = data;
+
+    rc = do_xen_hypercall(xch, &hypercall);
+
+    xc_hypercall_buffer_free(xch, arg);
+
+    return rc;
+}
+
 int xc_hvm_track_dirty_vram(
     xc_interface *xch, domid_t dom,
     uint64_t first_pfn, uint64_t nr,
diff -r 5024faf7c929 -r a7383a7a0000 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h     Thu May 26 14:58:28 2011 +0100
+++ b/tools/libxc/xenctrl.h     Thu May 26 15:01:17 2011 +0100
@@ -1398,6 +1398,8 @@
 int xc_hvm_set_pci_link_route(
     xc_interface *xch, domid_t dom, uint8_t link, uint8_t isa_irq);
 
+int xc_hvm_inject_msi(
+    xc_interface *xch, domid_t dom, uint64_t addr, uint32_t data);
 
 /*
  * Track dirty bit changes in the VRAM area

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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