[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86 hvm domain builder, restore: set shared_info.arch.max_pfn for



# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1172326745 0
# Node ID aa1be6f5150e609585d1d404c364b76de95a632b
# Parent  6c938630de54277aebdbb73f88fcbc71643c319e
x86 hvm domain builder, restore: set shared_info.arch.max_pfn for
dump-core to know the area to dump

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
---
 tools/libxc/xc_hvm_build.c   |    1 +
 tools/libxc/xc_hvm_restore.c |   11 +++++++++++
 2 files changed, 12 insertions(+)

diff -r 6c938630de54 -r aa1be6f5150e tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Sat Feb 24 14:10:27 2007 +0000
+++ b/tools/libxc/xc_hvm_build.c        Sat Feb 24 14:19:05 2007 +0000
@@ -262,6 +262,7 @@ static int setup_guest(int xc_handle,
     /* NB. evtchn_upcall_mask is unused: leave as zero. */
     memset(&shared_info->evtchn_mask[0], 0xff,
            sizeof(shared_info->evtchn_mask));
+    shared_info->arch.max_pfn = page_array[nr_pages - 1];
     munmap(shared_info, PAGE_SIZE);
 
     if ( v_end > HVM_BELOW_4G_RAM_END )
diff -r 6c938630de54 -r aa1be6f5150e tools/libxc/xc_hvm_restore.c
--- a/tools/libxc/xc_hvm_restore.c      Sat Feb 24 14:10:27 2007 +0000
+++ b/tools/libxc/xc_hvm_restore.c      Sat Feb 24 14:19:05 2007 +0000
@@ -86,6 +86,8 @@ int xc_hvm_restore(int xc_handle, int io
     uint8_t *hvm_buf = NULL;
     unsigned long long v_end, memsize;
     unsigned long shared_page_nr;
+    shared_info_t *shared_info = NULL;
+    xen_pfn_t arch_max_pfn;
 
     unsigned long pfn;
     unsigned int prev_pc, this_pc;
@@ -141,6 +143,7 @@ int xc_hvm_restore(int xc_handle, int io
         pfns[i] = i;
     for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < max_pfn; i++ )
         pfns[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
+    arch_max_pfn = pfns[max_pfn - 1];/* used later */
 
     /* Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000. */
     rc = xc_domain_memory_populate_physmap(
@@ -350,6 +353,14 @@ int xc_hvm_restore(int xc_handle, int io
         ERROR("setting the shared-info pfn failed!\n");
         goto out;
     }
+    if ( (xc_memory_op(xc_handle, XENMEM_add_to_physmap, &xatp) != 0) ||
+         ((shared_info = xc_map_foreign_range(
+             xc_handle, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
+             shared_info_frame)) == NULL) )
+        goto out;
+    /* shared_info.arch.max_pfn is used by dump-core */
+    shared_info->arch.max_pfn = arch_max_pfn;
+    munmap(shared_info, PAGE_SIZE);
 
     rc = 0;
     goto out;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.