Fix IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS to work properly for

4MB superpages (32-bit non-pae).

Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-11-17 11:47:49 +01:00
1 parent a041c675c7
commit 77625388ed
1 file changed
+4 -5
@@ -219,7 +219,6 @@ static int privcmd_ioctl(struct inode *inode, struct file *file,
#ifndef __ia64__
case IOCTL_PRIVCMD_GET_MACH2PHYS_MFNS: {
pgd_t *pgd;
pud_t *pud;
pmd_t *pmd;
@@ -235,13 +234,13 @@ static int privcmd_ioctl(struct inode *inode, struct file *file,
p = m.arr;
for(i=0; i < m.num; i++) {
for (i=0; i < m.num; i++) {
pgd = pgd_offset_k(m2pv);
pud = pud_offset(pgd, m2pv);
pmd = pmd_offset(pud, m2pv);
m2p_mfn = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
m2p_mfn = (*(uint64_t *)pmd >> PAGE_SHIFT)&0xFFFFFFFF;
m2p_mfn += pte_index(m2pv);
if (put_user(m2p_mfn, p + i))
return -EFAULT;
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.