ia64/xen-unstable

changeset 7873:4c0606fb701b

Fix IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS to work properly for
4MB superpages (32-bit non-pae).

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Nov 17 11:47:49 2005 +0100 (2005-11-17)
parents 0adacfa2e33f
children 9da47130ff42
files linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 10:10:52 2005 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Thu Nov 17 11:47:49 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