mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
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;
|
||||
|
||||
|
||||