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]: Fix fully-virtualized core dumps for 32-bit guests

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH]: Fix fully-virtualized core dumps for 32-bit guests
From: Chris Lalancette <clalance@xxxxxxxxxx>
Date: Mon, 11 Jun 2007 14:22:11 -0400
Delivery-date: Mon, 11 Jun 2007 11:20:19 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501)
All,
     Attached is a simple patch to fix core dumps for 32-bit guests running on
32-bit HV/dom0.  The problem ends up being a cast in the libxc dumping code;
basically in xc_core_x86.c, p2m_size is a ulong, and in the case of a 32-bit FV
guest 0xFFFFF is returned from xc_memory_op() in nr_gpfns.  However, 1 is then
added.  This means that when we are doing the map->size calculations, we have
0x100000 << 12, which yields 0, which is then stored in the uint64 map->size.
The simple fix is to cast p2m_size up to 64-bits first, then do the shift, then
store it into map->size.
     The patch is against xen-3.1, but should apply to current xen-unstable.

Signed-off-by: Chris Lalancette <clalance@xxxxxxxxxx>
diff -r c0b0974fb055 tools/libxc/xc_core_x86.c
--- a/tools/libxc/xc_core_x86.c Fri May 18 16:59:32 2007 +0100
+++ b/tools/libxc/xc_core_x86.c Mon Jun 11 14:18:19 2007 -0400
@@ -49,7 +49,7 @@ xc_core_arch_memory_map_get(int xc_handl
     }
 
     map->addr = 0;
-    map->size = p2m_size << PAGE_SHIFT;
+    map->size = ((uint64_t)p2m_size) << PAGE_SHIFT;
 
     *mapp = map;
     *nr_entries = 1;
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>