Skip to content

Commit

Permalink
Fix for the x86_64 kernel virtual address to physical address
Browse files Browse the repository at this point in the history
translation mechanism.  Without the patch, when verifying that the
PAGE_PRESENT bit is set in the top-level page table, it would always
test positively, and the translation would continue parsing the
remainder of the page tables.  This would virtually never be a
problem in practice because if the top-level page table entry
existed, its PAGE_PRESENT bit would be set.
(oleksandr@redhat.com, anderson@redhat.com)
  • Loading branch information
Dave Anderson committed Oct 30, 2017
1 parent e81db08 commit 0f40db8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions x86_64.c
Expand Up @@ -2086,7 +2086,7 @@ x86_64_kvtop(struct task_context *tc, ulong kvaddr, physaddr_t *paddr, int verbo
}

start_vtop_with_pagetable:
if (!(*pml4) & _PAGE_PRESENT)
if (!(*pml4 & _PAGE_PRESENT))
goto no_kpage;
pgd_paddr = (*pml4) & PHYSICAL_PAGE_MASK;
FILL_PGD(pgd_paddr, PHYSADDR, PAGESIZE());
Expand Down Expand Up @@ -2187,7 +2187,7 @@ x86_64_kvtop_xen_wpt(struct task_context *tc, ulong kvaddr, physaddr_t *paddr, i
fprintf(fp, "PML4 DIRECTORY: %lx\n", vt->kernel_pgd[0]);
fprintf(fp, "PAGE DIRECTORY: %lx [machine]\n", *pml4);
}
if (!(*pml4) & _PAGE_PRESENT)
if (!(*pml4 & _PAGE_PRESENT))
goto no_kpage;
pgd_paddr = (*pml4) & PHYSICAL_PAGE_MASK;
pgd_paddr = xen_m2p(pgd_paddr);
Expand Down

0 comments on commit 0f40db8

Please sign in to comment.