summary refs log tree commit diff stats
path: root/include/hw/xen/xen_common.h
diff options
context:
space:
mode:
authorDon Slutz <dslutz@verizon.com>2014-10-20 15:49:12 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2014-10-30 14:16:38 +0000
commit37f9e258b64b3cf97c7c78df60660100c9eb5a21 (patch)
treeb1a3f4c8e3b4d968d336730ac93c47e77b630f0e /include/hw/xen/xen_common.h
parentcbd5ac699173b684e678d66df3aea33df81fd89f (diff)
downloadfocaccia-qemu-37f9e258b64b3cf97c7c78df60660100c9eb5a21.tar.gz
focaccia-qemu-37f9e258b64b3cf97c7c78df60660100c9eb5a21.zip
xen-hvm.c: Add support for Xen access to vmport
This adds synchronisation of the 6 vcpu registers (only 32bits of
them) that vmport.c needs between Xen and QEMU.

This is to avoid a 2nd and 3rd exchange between QEMU and Xen to
fetch and put these 6 vcpu registers used by the code in vmport.c
and vmmouse.c

The registers are passed in the new shared page provided by
HVM_PARAM_VMPORT_REGS_PFN.

Add new array to XenIOState that allows selection of current_cpu by
vcpu id.

Now pass XenIOState to handle_ioreq().

Add new routines regs_to_cpu(), regs_from_cpu(), and
handle_vmport_ioreq().

Signed-off-by: Don Slutz <dslutz@verizon.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'include/hw/xen/xen_common.h')
-rw-r--r--include/hw/xen/xen_common.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h
index 07731b9289..95612a40c1 100644
--- a/include/hw/xen/xen_common.h
+++ b/include/hw/xen/xen_common.h
@@ -164,4 +164,19 @@ void destroy_hvm_domain(bool reboot);
 /* shutdown/destroy current domain because of an error */
 void xen_shutdown_fatal_error(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
 
+#ifdef HVM_PARAM_VMPORT_REGS_PFN
+static inline int xen_get_vmport_regs_pfn(XenXC xc, domid_t dom,
+                                          unsigned long *vmport_regs_pfn)
+{
+    return xc_get_hvm_param(xc, dom, HVM_PARAM_VMPORT_REGS_PFN,
+                            vmport_regs_pfn);
+}
+#else
+static inline int xen_get_vmport_regs_pfn(XenXC xc, domid_t dom,
+                                          unsigned long *vmport_regs_pfn)
+{
+    return -ENOSYS;
+}
+#endif
+
 #endif /* QEMU_HW_XEN_COMMON_H */