From: Ian Campbell Date: Fri, 29 Jan 2016 12:32:08 +0000 (+0000) Subject: xen: Use libxendevicemodel for emulated MSI handling X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=021a4158039e7466912d16dc301d2acfcab5f98b;p=people%2Fliuw%2Flibxenctrl-split%2Fqemu-xen.git xen: Use libxendevicemodel for emulated MSI handling 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 --- diff --git a/configure b/configure index 3872443d8..672bea68f 100755 --- 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); diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 9522aea42..5210eccb4 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -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 */ diff --git a/xen-hvm.c b/xen-hvm.c index ff73fe87a..8c23b1608 100644 --- 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)