ia64/xen-unstable

changeset 7987:72a1421dcf1b

Better handle page type info becoming incoherent during live migrate.

Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Tue Nov 22 17:50:41 2005 +0100 (2005-11-22)
parents bc1bfdb35f29
children f7bee3cb1bf1
files tools/libxc/xc_linux_save.c
line diff
     1.1 --- a/tools/libxc/xc_linux_save.c	Tue Nov 22 17:00:56 2005 +0100
     1.2 +++ b/tools/libxc/xc_linux_save.c	Tue Nov 22 17:50:41 2005 +0100
     1.3 @@ -470,10 +470,9 @@ void canonicalize_pagetable(unsigned lon
     1.4          if (pte & _PAGE_PRESENT) {
     1.5              
     1.6              mfn = (pte >> PAGE_SHIFT) & 0xfffffff;      
     1.7 -            pfn = live_m2p[mfn];
     1.8 -            
     1.9              if (!MFN_IS_IN_PSEUDOPHYS_MAP(mfn)) {
    1.10 -                /* I don't think this should ever happen */
    1.11 +                /* This will happen if the type info is stale which 
    1.12 +                   is quite feasible under live migration */
    1.13                  DPRINTF("FNI: [%08lx,%d] pte=%llx,"
    1.14                          " mfn=%08lx, pfn=%08lx [mfn]=%08lx\n",
    1.15                          type, i, (unsigned long long)pte, mfn, 
    1.16 @@ -482,7 +481,10 @@ void canonicalize_pagetable(unsigned lon
    1.17                          live_p2m[live_m2p[mfn]] : 0xdeadbeaf);
    1.18                  
    1.19                  pfn = 0; /* be suspicious */
    1.20 -            }
    1.21 +            } else 
    1.22 +                pfn = live_m2p[mfn];
    1.23 +            
    1.24 +
    1.25              
    1.26              pte &= 0xffffff0000000fffULL;
    1.27              pte |= (uint64_t)pfn << PAGE_SHIFT;
    1.28 @@ -1031,7 +1033,7 @@ int xc_linux_save(int xc_handle, int io_
    1.29  
    1.30          if (last_iter && debug){
    1.31              int minusone = -1;
    1.32 -            memset( to_send, 0xff, (max_pfn+8)/8 );
    1.33 +            memset(to_send, 0xff, BITMAP_SIZE); 
    1.34              debug = 0;
    1.35              fprintf(stderr, "Entering debug resend-all mode\n");
    1.36