use PT_PHYSMASK on last level PTE entries to avoid returning invalid physical address
This commit is contained in:
@@ -413,7 +413,7 @@ static int __set_pt_page(struct page_table *pt, void *virt, unsigned long phys,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (pt->entry[l1idx] & PFL1_PRESENT) {
|
if (pt->entry[l1idx] & PFL1_PRESENT) {
|
||||||
if ((pt->entry[l1idx] & PAGE_MASK) != phys) {
|
if ((pt->entry[l1idx] & PT_PHYSMASK) != phys) {
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
@@ -505,7 +505,7 @@ int ihk_mc_pt_virt_to_phys(struct page_table *pt,
|
|||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
*phys = (pt->entry[l1idx] & PAGE_MASK) | (v & (PAGE_SIZE - 1));
|
*phys = (pt->entry[l1idx] & PT_PHYSMASK) | (v & (PAGE_SIZE - 1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user