Skip to contentSkip to conversation

: Fix fully-virtualized core dumps for 32-bit guests

PATCH In review Chris Lalancette 2 participants 4 messages Jun 11, 2007 – Jun 14, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix fully-virtualized core dumps for 32-bit guests

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.

tools/libxc/xc_core_x86.c +1 -1
diff -r c0b0974fb055 tools/libxc/xc_core_x86.c
@@ -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
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

tools/libxc/xc_core_x86.c xc_core_arch_memory_map_get(int xc_handl · line 55

Quoted 13 lines · Chris Lalancette

diff -r c0b0974fb055 tools/libxc/xc_core_x86.c

tools/libxc/xc_core_x86.c +1 -1
@@ -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;

Any takers for this simple patch?

Chris Lalancette

#2 lore raw
Quoted 7 lines · Chris Lalancette
Quoted 1 line · Chris Lalancette

Any takers for this simple patch?

Chris Lalancette

It's checked in already.

K.

#3 lore raw
Quoted 5 lines · Keir Fraser

It's checked in already.

K.

Keir,
Ah, didn't see it in the public tree, must still be in staging. Thanks!

Chris Lalancette