ia64/xen-unstable

changeset 19526:a6003404e95b

restore: sign extend p2m when restoring on a host with pfn width <
guest pfn width

(i.e. 32on64 domain 0 and 64 bit guest domain).

Otherwise P2M entries which were INVALID_P2M_ENTRY
(==0xffffffffffffffff) become 0xffffffff after a migrate.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 08 19:10:33 2009 +0100 (2009-04-08)
parents f9c8c6b08972
children 0e24e9674ded
files tools/libxc/xc_domain_restore.c
line diff
     1.1 --- a/tools/libxc/xc_domain_restore.c	Wed Apr 08 14:43:12 2009 +0100
     1.2 +++ b/tools/libxc/xc_domain_restore.c	Wed Apr 08 19:10:33 2009 +0100
     1.3 @@ -1197,7 +1197,7 @@ int xc_domain_restore(int xc_handle, int
     1.4       * we need to adjust the live_p2m assignment appropriately */
     1.5      if ( guest_width > sizeof (xen_pfn_t) )
     1.6          for ( i = p2m_size - 1; i >= 0; i-- )
     1.7 -            ((uint64_t *)live_p2m)[i] = p2m[i];
     1.8 +            ((int64_t *)live_p2m)[i] = (long)p2m[i];
     1.9      else if ( guest_width < sizeof (xen_pfn_t) )
    1.10          for ( i = 0; i < p2m_size; i++ )   
    1.11              ((uint32_t *)live_p2m)[i] = p2m[i];