@@ -4725,7 +4725,8 @@ int map_pages_to_xen(
}
virt += 1UL << L3_PAGETABLE_SHIFT;
- mfn += 1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT);
+ if ( !mfn_eq(_mfn(mfn), INVALID_MFN) )
+ mfn += 1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT);
nr_mfns -= 1UL << (L3_PAGETABLE_SHIFT - PAGE_SHIFT);
continue;
}
@@ -4750,7 +4751,8 @@ int map_pages_to_xen(
if ( i > nr_mfns )
i = nr_mfns;
virt += i << PAGE_SHIFT;
- mfn += i;
+ if ( !mfn_eq(_mfn(mfn), INVALID_MFN) )
+ mfn += i;
nr_mfns -= i;
continue;
}
@@ -4818,7 +4820,8 @@ int map_pages_to_xen(
}
virt += 1UL << L2_PAGETABLE_SHIFT;
- mfn += 1UL << PAGETABLE_ORDER;
+ if ( !mfn_eq(_mfn(mfn), INVALID_MFN) )
+ mfn += 1UL << PAGETABLE_ORDER;
nr_mfns -= 1UL << PAGETABLE_ORDER;
}
else
@@ -4847,7 +4850,8 @@ int map_pages_to_xen(
if ( i > nr_mfns )
i = nr_mfns;
virt += i << L1_PAGETABLE_SHIFT;
- mfn += i;
+ if ( !mfn_eq(_mfn(mfn), INVALID_MFN) )
+ mfn += i;
nr_mfns -= i;
goto check_l3;
}
@@ -4892,7 +4896,8 @@ int map_pages_to_xen(
}
virt += 1UL << L1_PAGETABLE_SHIFT;
- mfn += 1UL;
+ if ( !mfn_eq(_mfn(mfn), INVALID_MFN) )
+ mfn += 1UL;
nr_mfns -= 1UL;
if ( (flags == PAGE_HYPERVISOR) &&