[Bug 15] get_pte malfunction in case of 2MiB page size: FIX

This commit is contained in:
Balazs Gerofi bgerofi@riken.jp
2013-05-10 12:40:00 +09:00
parent ab37f57a59
commit d5a6343dd3

View File

@@ -260,21 +260,15 @@ pte_t *get_pte(struct page_table *pt, void *virt, int attr)
pt = newpt;
}
/* TODO: PTATTR_LARGEPAGE
/* PTATTR_LARGEPAGE */
if (attr & PTATTR_LARGEPAGE) {
if (pt->entry[l2idx] & PFL2_PRESENT) {
if ((pt->entry[l2idx] & PAGE_MASK) != phys) {
return -EBUSY;
} else {
return 0;
}
} else {
pt->entry[l2idx] = phys | attr_to_l2attr(attr)
| PFL2_SIZE;
return 0;
}
return &(pt->entry[l2idx]);
}
/* Requested regular page, but large is allocated? */
if (pt->entry[l2idx] & PFL2_SIZE) {
return NULL;
}
*/
if (pt->entry[l2idx] & PFL2_PRESENT) {
pt = phys_to_virt(pt->entry[l2idx] & PAGE_MASK);