aboutsummaryrefslogtreecommitdiffstats
path: root/tools/libxc/xc_domain_save.c
diff options
context:
space:
mode:
authorTim Deegan <tim@xen.org>2012-03-08 16:40:05 +0000
committerTim Deegan <tim@xen.org>2012-03-08 16:40:05 +0000
commit770d1e858de56ba8f2e0d7e45c08f48d599528e5 (patch)
treefcae677231c44b4c20c0816f41cbd51074a5412e /tools/libxc/xc_domain_save.c
parent7a3de767373545388a9fded238b3450c5b21066d (diff)
downloadxen-770d1e858de56ba8f2e0d7e45c08f48d599528e5.tar.gz
xen-770d1e858de56ba8f2e0d7e45c08f48d599528e5.tar.bz2
xen-770d1e858de56ba8f2e0d7e45c08f48d599528e5.zip
Use a reserved pfn in the guest address space to store mem event rings
This solves a long-standing issue in which the pages backing these rings were pages belonging to dom0 user-space processes. Thus, if the process would die unexpectedly, Xen would keep posting events to a page now belonging to some other process. We update all API-consumers in tree (xenpaging and xen-access). This is an API/ABI change, so please speak up if it breaks your accumptions. The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits. Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org> Acked-by: Tim Deegan <tim@xen.org> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Tim Deegan <tim@xen.org>
Diffstat (limited to 'tools/libxc/xc_domain_save.c')
-rw-r--r--tools/libxc/xc_domain_save.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/tools/libxc/xc_domain_save.c b/tools/libxc/xc_domain_save.c
index 9fa39b2f1c..a9216ddf71 100644
--- a/tools/libxc/xc_domain_save.c
+++ b/tools/libxc/xc_domain_save.c
@@ -1639,6 +1639,42 @@ int xc_domain_save(xc_interface *xch, int io_fd, uint32_t dom, uint32_t max_iter
goto out;
}
+ chunk.id = XC_SAVE_ID_HVM_PAGING_RING_PFN;
+ chunk.data = 0;
+ xc_get_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN,
+ (unsigned long *)&chunk.data);
+
+ if ( (chunk.data != 0) &&
+ wrexact(io_fd, &chunk, sizeof(chunk)) )
+ {
+ PERROR("Error when writing the paging ring pfn for guest");
+ goto out;
+ }
+
+ chunk.id = XC_SAVE_ID_HVM_ACCESS_RING_PFN;
+ chunk.data = 0;
+ xc_get_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN,
+ (unsigned long *)&chunk.data);
+
+ if ( (chunk.data != 0) &&
+ wrexact(io_fd, &chunk, sizeof(chunk)) )
+ {
+ PERROR("Error when writing the access ring pfn for guest");
+ goto out;
+ }
+
+ chunk.id = XC_SAVE_ID_HVM_SHARING_RING_PFN;
+ chunk.data = 0;
+ xc_get_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN,
+ (unsigned long *)&chunk.data);
+
+ if ( (chunk.data != 0) &&
+ wrexact(io_fd, &chunk, sizeof(chunk)) )
+ {
+ PERROR("Error when writing the sharing ring pfn for guest");
+ goto out;
+ }
+
chunk.id = XC_SAVE_ID_HVM_VM86_TSS;
chunk.data = 0;
xc_get_hvm_param(xch, dom, HVM_PARAM_VM86_TSS,