]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/qemu-xen.git/commitdiff
xen: Use libxendevicemodel for emulated MSI handling
authorIan Campbell <ian.campbell@citrix.com>
Fri, 29 Jan 2016 12:32:08 +0000 (12:32 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Thu, 11 Feb 2016 16:16:43 +0000 (16:16 +0000)
Create the necessary shim layer for older versions of Xen, as usual
using the new library API as the basis.

We need to drop the configure check for xc_hvm_inject_msi from the
iface=471 case, since it will go away around the same time that
libxendevicemodel is introduced. Other factors in this block will
ensure we don't detect 471 in error.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
configure
include/hw/xen/xen_common.h
xen-hvm.c

index 3872443d81749de1a3aeab418304d7be6a3a76b3..672bea68f7acd91e1d2bbadbdbe30c345bd8a990 100755 (executable)
--- a/configure
+++ b/configure
@@ -1997,7 +1997,6 @@ int main(void) {
   xc = xc_interface_open(0, 0, 0);
   xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
   xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
-  xc_hvm_inject_msi(xc, 0, 0xf0000000, 0x00000000);
   xc_hvm_create_ioreq_server(xc, 0, HVM_IOREQSRV_BUFIOREQ_ATOMIC, NULL);
   xc_domain_create(xc, 0, handle, 0, NULL, NULL);
 
index 9522aea42ba32cb2ff602169afb32e677248e18d..5210eccb490975fa9f8657f7ad1037a43da7f437 100644 (file)
@@ -149,6 +149,9 @@ static inline int xendevicemodel_populate_ram(xendevicemodel_handle *h,
 #define xendevicemodel_set_isa_irq_level(h, i, a) \
     xc_hvm_set_isa_irq_level(h, xen_domid, i, a)
 
+#define xendevicemodel_inject_msi(h, a, d) \
+    xc_hvm_inject_msi(h, xen_domid, a, d)
+
 #endif
 
 /* Xen before 4.6 */
index ff73fe87a3cbeb963a5b07b412f0c6cba2a6e23f..8c23b16083c68974ddb79706f544cccc19a0ed74 100644 (file)
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -159,7 +159,7 @@ int xen_is_pirq_msi(uint32_t msi_data)
 
 void xen_hvm_inject_msi(uint64_t addr, uint32_t data)
 {
-    xc_hvm_inject_msi(xen_xc, xen_domid, addr, data);
+    xendevicemodel_inject_msi(xen_dm, addr, data);
 }
 
 static void xen_suspend_notifier(Notifier *n, void *data)