ia64/xen-unstable

changeset 7880:9da47130ff42

Merged.
author emellor@leeni.uk.xensource.com
date Thu Nov 17 12:12:57 2005 +0100 (2005-11-17)
parents c0ef782130db 4c0606fb701b
children c640c0c7f821
files
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 12:10:08 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 12:12:57 2005 +0100
     1.3 @@ -219,7 +219,6 @@ static int privcmd_ioctl(struct inode *i
     1.4  
     1.5  #ifndef __ia64__
     1.6  	case IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS: {
     1.7 -
     1.8  		pgd_t *pgd; 
     1.9  		pud_t *pud; 
    1.10  		pmd_t *pmd; 
    1.11 @@ -235,13 +234,13 @@ static int privcmd_ioctl(struct inode *i
    1.12  
    1.13  		p = m.arr; 
    1.14  
    1.15 -		for(i=0; i < m.num; i++) { 
    1.16 -
    1.17 +		for (i=0; i < m.num; i++) { 
    1.18  			pgd = pgd_offset_k(m2pv);
    1.19  			pud = pud_offset(pgd, m2pv);
    1.20  			pmd = pmd_offset(pud, m2pv);
    1.21 -			m2p_mfn = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
    1.22 -			
    1.23 +			m2p_mfn  = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
    1.24 +			m2p_mfn += pte_index(m2pv);
    1.25 +
    1.26  			if (put_user(m2p_mfn, p + i))
    1.27  				return -EFAULT;
    1.28  
     2.1 --- a/tools/libxc/xc_linux_restore.c	Thu Nov 17 12:10:08 2005 +0100
     2.2 +++ b/tools/libxc/xc_linux_restore.c	Thu Nov 17 12:12:57 2005 +0100
     2.3 @@ -146,7 +146,7 @@ int xc_linux_restore(int xc_handle, int 
     2.4      unsigned long buf[PAGE_SIZE/sizeof(unsigned long)];
     2.5  
     2.6      struct mmuext_op pin[MAX_PIN_BATCH];
     2.7 -    unsigned int nr_pins = 0;
     2.8 +    unsigned int nr_pins; 
     2.9  
    2.10  
    2.11      max_pfn = nr_pfns; 
    2.12 @@ -501,8 +501,17 @@ int xc_linux_restore(int xc_handle, int 
    2.13       * Pin page tables. Do this after writing to them as otherwise Xen
    2.14       * will barf when doing the type-checking.
    2.15       */
    2.16 +    nr_pins = 0; 
    2.17      for (i = 0; i < max_pfn; i++) {
    2.18  
    2.19 +        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
    2.20 +            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
    2.21 +                ERR("Failed to pin batch of %d page tables", nr_pins); 
    2.22 +                goto out;
    2.23 +            } 
    2.24 +            nr_pins = 0;
    2.25 +        }
    2.26 +
    2.27          if ( (pfn_type[i] & LPINTAB) == 0 )
    2.28              continue;
    2.29  
    2.30 @@ -529,16 +538,8 @@ int xc_linux_restore(int xc_handle, int 
    2.31          }
    2.32  
    2.33          pin[nr_pins].arg1.mfn = p2m[i];
    2.34 +        nr_pins++; 
    2.35  
    2.36 -        nr_pins ++; 
    2.37 -        
    2.38 -        if (i == (max_pfn-1) || nr_pins == MAX_PIN_BATCH) {
    2.39 -            if (xc_mmuext_op(xc_handle, pin, nr_pins, dom) < 0) { 
    2.40 -                ERR("Failed to pin batch of %d page tables", nr_pins); 
    2.41 -                goto out;
    2.42 -            } 
    2.43 -            nr_pins = 0;
    2.44 -        }
    2.45      }
    2.46  
    2.47      DPRINTF("\b\b\b\b100%%\n");