[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/11] xen: Add xc_domain_add_to_physmap to xen_inte
From: |
Alexander Graf |
Subject: |
[Qemu-devel] [PATCH 01/11] xen: Add xc_domain_add_to_physmap to xen_interface. |
Date: |
Sun, 19 Jun 2011 05:39:40 +0200 |
From: Anthony PERARD <address@hidden>
This function will be used to support sync dirty bitmap.
This come with a check against every Xen release, and special
implementation for Xen version that doesn't have this specific call.
This function will not be usable with Xen 3.3 because the behavior is
different.
Signed-off-by: Anthony PERARD <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
configure | 29 ++++++++++++++++++++++++++++-
hw/xen_common.h | 14 ++++++++++++++
2 files changed, 42 insertions(+), 1 deletions(-)
diff --git a/configure b/configure
index 44c092a..b63b49f 100755
--- a/configure
+++ b/configure
@@ -1210,6 +1210,7 @@ int main(void) {
xc = xc_interface_open(0, 0, 0);
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
xc_gnttab_open(NULL, 0);
+ xc_domain_add_to_physmap(0, 0, XENMAPSPACE_gmfn, 0, 0);
return 0;
}
EOF
@@ -1228,10 +1229,14 @@ EOF
# error HVM_MAX_VCPUS not defined
#endif
int main(void) {
+ struct xen_add_to_physmap xatp = {
+ .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
+ };
xs_daemon_open();
xc_interface_open();
xc_gnttab_open();
xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+ xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
return 0;
}
EOF
@@ -1240,7 +1245,29 @@ EOF
xen_ctrl_version=400
xen=yes
- # Xen 3.3.0, 3.4.0
+ # Xen 3.4.0
+ elif (
+ cat > $TMPC <<EOF
+#include <xenctrl.h>
+#include <xs.h>
+int main(void) {
+ struct xen_add_to_physmap xatp = {
+ .domid = 0, .space = XENMAPSPACE_gmfn, .idx = 0, .gpfn = 0,
+ };
+ xs_daemon_open();
+ xc_interface_open();
+ xc_gnttab_open();
+ xc_hvm_set_mem_type(0, 0, HVMMEM_ram_ro, 0, 0);
+ xc_memory_op(0, XENMEM_add_to_physmap, &xatp);
+ return 0;
+}
+EOF
+ compile_prog "" "$xen_libs"
+ ) ; then
+ xen_ctrl_version=340
+ xen=yes
+
+ # Xen 3.3.0
elif (
cat > $TMPC <<EOF
#include <xenctrl.h>
diff --git a/hw/xen_common.h b/hw/xen_common.h
index a1958a0..2c79af6 100644
--- a/hw/xen_common.h
+++ b/hw/xen_common.h
@@ -71,6 +71,20 @@ static inline int xc_domain_populate_physmap_exact
(xc_handle, domid, nr_extents, extent_order, mem_flags, extent_start);
}
+static inline int xc_domain_add_to_physmap(int xc_handle, uint32_t domid,
+ unsigned int space, unsigned long
idx,
+ xen_pfn_t gpfn)
+{
+ struct xen_add_to_physmap xatp = {
+ .domid = domid,
+ .space = space,
+ .idx = idx,
+ .gpfn = gpfn,
+ };
+
+ return xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp);
+}
+
/* Xen 4.1 */
#else
--
1.6.0.2
- [Qemu-devel] [PULL] Xen Patch Queue, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 09/11] xen: only track the linear framebuffer, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 11/11] xen: Add the Xen platform pci device, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 10/11] xen: fix interrupt routing, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 02/11] xen: Introduce VGA sync dirty bitmap support, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 07/11] xen: mapcache performance improvements, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 01/11] xen: Add xc_domain_add_to_physmap to xen_interface.,
Alexander Graf <=
- [Qemu-devel] [PATCH 08/11] cirrus_vga: reset lfb_addr after a pci config write if the BAR is unmapped, Alexander Graf, 2011/06/20
- [Qemu-devel] [PATCH 06/11] exec.c: refactor cpu_physical_memory_map, Alexander Graf, 2011/06/20
[Qemu-devel] [PATCH 05/11] xen: remove xen_map_block and xen_unmap_block, Alexander Graf, 2011/06/20
[Qemu-devel] [PATCH 04/11] xen: remove qemu_map_cache_unlock, Alexander Graf, 2011/06/20
[Qemu-devel] [PATCH 03/11] xen: fix qemu_map_cache with size != MCACHE_BUCKET_SIZE, Alexander Graf, 2011/06/20
Re: [Qemu-devel] [PULL] Xen Patch Queue, Anthony Liguori, 2011/06/22