From bcc7e781922e8176daac802658366fd472ecf155 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Fri, 29 Jan 2016 16:28:35 +0000 Subject: [PATCH] xen: use xendevicemodel_mark_memory_region_dirty Signed-off-by: Ian Campbell --- configure | 1 + include/hw/xen/xen_common.h | 3 +++ xen-hvm.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 4908dab9b..b5d9219df 100755 --- a/configure +++ b/configure @@ -2184,6 +2184,7 @@ int main(void) { xendevicemodel_set_pci_intx_level(dm, 0, 0, 0, 0, 0); xendevicemodel_populate_ram(dm, 0, 0); xendevicemodel_create_ioreq_server(dm, 1, NULL); + xendevicemodel_mark_memory_region_dirty(dm, 0, 0); return 0; } EOF diff --git a/include/hw/xen/xen_common.h b/include/hw/xen/xen_common.h index 86749467a..58c479e38 100644 --- a/include/hw/xen/xen_common.h +++ b/include/hw/xen/xen_common.h @@ -152,6 +152,9 @@ static inline int xendevicemodel_populate_ram(xendevicemodel_handle *h, #define xendevicemodel_inject_msi(h, a, d) \ xc_hvm_inject_msi(h, xen_domid, a, d) +#define xendevicemodel_mark_memory_region_dirty(h, s, n) \ + xc_hvm_modified_memory(h, xen_domid, s, n) + #if CONFIG_XEN_CTRL_INTERFACE_VERSION >= 450 #define xendevicemodel_create_ioreq_server(h, b, i) \ diff --git a/xen-hvm.c b/xen-hvm.c index 91fb3e3ae..a6807a0a1 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -1399,7 +1399,7 @@ void xen_modified_memory(ram_addr_t start, ram_addr_t length) start_pfn = start >> TARGET_PAGE_BITS; nb_pages = ((start + length + TARGET_PAGE_SIZE - 1) >> TARGET_PAGE_BITS) - start_pfn; - rc = xc_hvm_modified_memory(xen_xc, xen_domid, start_pfn, nb_pages); + rc = xendevicemodel_mark_memory_region_dirty(xen_dm, start_pfn, nb_pages); if (rc) { fprintf(stderr, "%s failed for "RAM_ADDR_FMT" ("RAM_ADDR_FMT"): %i, %s\n", -- 2.39.5