WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 1/3] dump-core take4: hvm domain: set shared_info.arc

To: xen-devel@xxxxxxxxxxxxxxxxxxx, Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 1/3] dump-core take4: hvm domain: set shared_info.arch.max_pfn
From: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Date: Tue, 30 Jan 2007 11:54:20 +0900
Cc: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>, Dave Anderson <anderson@xxxxxxxxxx>, xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 29 Jan 2007 18:57:15 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070130025414.6326.67353.sendpatchset@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20070130025414.6326.67353.sendpatchset@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User yamahata@xxxxxxxxxxxxx
# Date 1169363541 -32400
# Node ID a697dea956db9ecc5310a411b6cb21246e089b39
# Parent  e79afe8634b5ad6d24109b246e4f5c698e59d511
x86 hvm domain builder, restore: set shared_info.arch.max_pfn for dump-core
to know the area to dump
PATCHNAME: x86_hvm_domain_builder_set_max_pfn

Signed-off-by: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>

diff -r e79afe8634b5 -r a697dea956db tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c        Wed Jan 17 12:20:08 2007 +0900
+++ b/tools/libxc/xc_hvm_build.c        Sun Jan 21 16:12:21 2007 +0900
@@ -271,6 +271,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 e79afe8634b5 -r a697dea956db tools/libxc/xc_hvm_restore.c
--- a/tools/libxc/xc_hvm_restore.c      Wed Jan 17 12:20:08 2007 +0900
+++ b/tools/libxc/xc_hvm_restore.c      Sun Jan 21 16:12:21 2007 +0900
@@ -31,6 +31,8 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/hvm/params.h>
 #include <xen/hvm/e820.h>
+
+#define SCRATCH_PFN 0xFFFFF
 
 /* max mfn of the whole machine */
 static unsigned long max_mfn;
@@ -90,6 +92,8 @@ int xc_hvm_restore(int xc_handle, int io
     hvm_domain_context_t hvm_ctxt;
     unsigned long long v_end, memsize;
     unsigned long shared_page_nr;
+    struct xen_add_to_physmap xatp;
+    shared_info_t *shared_info = NULL;
 
     unsigned long mfn, pfn;
     unsigned int prev_pc, this_pc;
@@ -152,6 +156,20 @@ int xc_hvm_restore(int xc_handle, int io
         p2m[i] = i;
     for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < max_pfn; i++ )
         p2m[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
+
+    /* shared-info page. shared_info.arch.max_pfn is used by dump-core */
+    xatp.domid = dom;
+    xatp.space = XENMAPSPACE_shared_info;
+    xatp.idx   = 0;
+    xatp.gpfn  = SCRATCH_PFN;
+    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,
+             SCRATCH_PFN)) == NULL) )
+        goto out;
+    memset(shared_info, 0, PAGE_SIZE);
+    shared_info->arch.max_pfn = p2m[max_pfn - 1];
+    munmap(shared_info, PAGE_SIZE);
 
     /* Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000. */
     rc = xc_domain_memory_populate_physmap(
yamahata

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

<Prev in Thread] Current Thread [Next in Thread>