ia64/xen-unstable

changeset 2234:480807ffa67f

bitkeeper revision 1.1159.1.58 (411d059esZt-III1bGswIy02CVBC-A)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Fri Aug 13 18:17:02 2004 +0000 (2004-08-13)
parents 29d3d09a420c 18f6d4de5aac
children 10b75f2911b6
files tools/libxc/xc_linux_restore.c tools/libxc/xc_linux_save.c xen/common/dom0_ops.c xen/include/hypervisor-ifs/dom0_ops.h
line diff
     1.1 --- a/tools/libxc/xc_linux_restore.c	Fri Aug 13 17:35:00 2004 +0000
     1.2 +++ b/tools/libxc/xc_linux_restore.c	Fri Aug 13 18:17:02 2004 +0000
     1.3 @@ -11,7 +11,7 @@
     1.4  
     1.5  #define MAX_BATCH_SIZE 1024
     1.6  
     1.7 -#define DEBUG 0
     1.8 +#define DEBUG 1
     1.9  
    1.10  #if DEBUG
    1.11  #define DPRINTF(_f, _a...) printf ( _f , ## _a )
    1.12 @@ -365,7 +365,7 @@ int xc_linux_restore(int xc_handle, XcIO
    1.13                  goto out;
    1.14              }
    1.15  
    1.16 -            switch( region_pfn_type[i] )
    1.17 +            switch( region_pfn_type[i] & LTABTYPE_MASK )
    1.18              {
    1.19              case 0:
    1.20                  break;
    1.21 @@ -473,8 +473,9 @@ int xc_linux_restore(int xc_handle, XcIO
    1.22       */
    1.23      for ( i = 0; i < nr_pfns; i++ )
    1.24      {
    1.25 -        if ( pfn_type[i] == L1TAB )
    1.26 +        if ( pfn_type[i] == (L1TAB|LPINTAB) )
    1.27          {
    1.28 +printf("XXXXXXXXXXXXXXX pin L1\n");
    1.29              if ( add_mmu_update(xc_handle, mmu,
    1.30                                  (pfn_to_mfn_table[i]<<PAGE_SHIFT) | 
    1.31                                  MMU_EXTENDED_COMMAND,
    1.32 @@ -484,8 +485,9 @@ int xc_linux_restore(int xc_handle, XcIO
    1.33                  goto out;
    1.34              }
    1.35          }
    1.36 -        else if ( pfn_type[i] == L2TAB )
    1.37 +        else if ( pfn_type[i] == (L2TAB|LPINTAB) )
    1.38          {
    1.39 +printf("XXXXXXXXXXXXXXX pin L2\n");
    1.40              if ( add_mmu_update(xc_handle, mmu,
    1.41                                  (pfn_to_mfn_table[i]<<PAGE_SHIFT) | 
    1.42                                  MMU_EXTENDED_COMMAND,
    1.43 @@ -544,7 +546,7 @@ int xc_linux_restore(int xc_handle, XcIO
    1.44  
    1.45      /* Uncanonicalise the page table base pointer. */
    1.46      pfn = ctxt.pt_base >> PAGE_SHIFT;
    1.47 -    if ( (pfn >= nr_pfns) || (pfn_type[pfn] != L2TAB) )
    1.48 +    if ( (pfn >= nr_pfns) || ((pfn_type[pfn]&LTABTYPE_MASK) != L2TAB) )
    1.49      {
    1.50          printf("PT base is bad. pfn=%lu nr=%lu type=%08lx %08lx\n",
    1.51                 pfn, nr_pfns, pfn_type[pfn], (unsigned long)L2TAB);
     2.1 --- a/tools/libxc/xc_linux_save.c	Fri Aug 13 17:35:00 2004 +0000
     2.2 +++ b/tools/libxc/xc_linux_save.c	Fri Aug 13 18:17:02 2004 +0000
     2.3 @@ -13,7 +13,7 @@
     2.4  #define BATCH_SIZE 1024   /* 1024 pages (4MB) at a time */
     2.5  
     2.6  #define DEBUG 1
     2.7 -#define DDEBUG 0
     2.8 +#define DDEBUG 1
     2.9  
    2.10  #if DEBUG
    2.11  #define DPRINTF(_f, _a...) printf ( _f , ## _a )
    2.12 @@ -639,7 +639,7 @@ int xc_linux_save(int xc_handle, XcIOCon
    2.13  
    2.14                      set_bit( n, to_fix );
    2.15                      if( iter>1 )
    2.16 -                        DDPRINTF("netbuf race: iter %d, pfn %lx. mfn %lx\n",
    2.17 +                        DDPRINTF("netbuf race: iter %d, pfn %x. mfn %lx\n",
    2.18                                   iter,n,pfn_type[batch]);
    2.19                      continue;
    2.20                  }
    2.21 @@ -658,7 +658,7 @@ int xc_linux_save(int xc_handle, XcIOCon
    2.22                  batch++;
    2.23              }
    2.24       
    2.25 -            DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n);
    2.26 +//            DDPRINTF("batch %d:%d (n=%d)\n", iter, batch, n);
    2.27  
    2.28              if ( batch == 0 )
    2.29                  goto skip; /* vanishingly unlikely... */
    2.30 @@ -714,12 +714,12 @@ printf("type fail: page %i mfn %08lx\n",
    2.31                      continue;
    2.32                  }
    2.33    
    2.34 -                if ( ((pfn_type[j] & LTAB_MASK) == L1TAB) || 
    2.35 -                     ((pfn_type[j] & LTAB_MASK) == L2TAB) ){
    2.36 +                if ( ((pfn_type[j] & LTABTYPE_MASK) == L1TAB) || 
    2.37 +                     ((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ){
    2.38                      memcpy(page, region_base + (PAGE_SIZE*j), PAGE_SIZE);
    2.39        
    2.40                      for ( k = 0; 
    2.41 -                          k < (((pfn_type[j] & LTAB_MASK) == L2TAB) ? 
    2.42 +                          k < (((pfn_type[j] & LTABTYPE_MASK) == L2TAB) ? 
    2.43                                 (HYPERVISOR_VIRT_START >> L2_PAGETABLE_SHIFT) :
    2.44                                 1024); 
    2.45                            k++ ){
     3.1 --- a/xen/common/dom0_ops.c	Fri Aug 13 17:35:00 2004 +0000
     3.2 +++ b/xen/common/dom0_ops.c	Fri Aug 13 18:17:02 2004 +0000
     3.3 @@ -610,6 +610,7 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
     3.4                  if ( likely(get_page(page, d)) )
     3.5                  {
     3.6                      unsigned long type = 0;
     3.7 +
     3.8                      switch( page->u.inuse.type_info & PGT_type_mask )
     3.9                      {
    3.10                      case PGT_l1_page_table:
    3.11 @@ -625,7 +626,10 @@ long do_dom0_op(dom0_op_t *u_dom0_op)
    3.12                          type = L4TAB;
    3.13                          break;
    3.14                      }
    3.15 -                    l_arr[j] |= type;
    3.16 +
    3.17 +		    if ( page->u.inuse.count_info & PGC_guest_pinned )
    3.18 +			type |= LPINTAB;
    3.19 +		    l_arr[j] |= type;
    3.20                      put_page(page);
    3.21                  }
    3.22                  else
     4.1 --- a/xen/include/hypervisor-ifs/dom0_ops.h	Fri Aug 13 17:35:00 2004 +0000
     4.2 +++ b/xen/include/hypervisor-ifs/dom0_ops.h	Fri Aug 13 18:17:02 2004 +0000
     4.3 @@ -178,8 +178,11 @@ typedef struct {
     4.4  #define L2TAB (2<<28)
     4.5  #define L3TAB (3<<28)
     4.6  #define L4TAB (4<<28)
     4.7 +#define LPINTAB  (1<<31)
     4.8  #define XTAB  (0xf<<28) /* invalid page */
     4.9  #define LTAB_MASK XTAB
    4.10 +#define LTABTYPE_MASK (0x7<<28)
    4.11 +
    4.12  typedef struct {
    4.13      /* IN variables. */
    4.14      memory_t pfn;          /*  0: Machine page frame number to query.       */