All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH]: Fix fully-virtualized core dumps for 32-bit guests
@ 2007-06-11 18:22 Chris Lalancette
  2007-06-14 15:04 ` Chris Lalancette
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Lalancette @ 2007-06-11 18:22 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 713 bytes --]

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@redhat.com>

[-- Attachment #2: xen-3.1-32bit-fv-core-dump.patch --]
[-- Type: text/x-patch, Size: 397 bytes --]

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;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-14 15:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11 18:22 [PATCH]: Fix fully-virtualized core dumps for 32-bit guests Chris Lalancette
2007-06-14 15:04 ` Chris Lalancette
2007-06-14 15:09   ` Keir Fraser
2007-06-14 15:12     ` Chris Lalancette

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.