Skip to content

Commit

Permalink
Fix for the x86_64 "vm -p" command to properly emulate the kernel's
Browse files Browse the repository at this point in the history
pte_present() function, which checks for either _PAGE_PRESENT or
_PAGE_PROTNONE to be set.  Without the patch, user pages whose PTE
does not have _PAGE_PRESENT bit set are misconstrued as SWAP pages
with an "(unknown swap location") along with a bogus OFFSET value.
([email protected])
  • Loading branch information
Dave Anderson committed Apr 25, 2016
1 parent 1230512 commit aad859e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,8 @@ x86_64_uvtop_level4(struct task_context *tc, ulong uvaddr, physaddr_t *paddr, in
pte = ULONG(machdep->ptbl + PAGEOFFSET(ptep));
if (verbose)
fprintf(fp, " PTE: %lx => %lx\n", (ulong)ptep, pte);
if (!(pte & (_PAGE_PRESENT))) {

if (!(pte & (_PAGE_PRESENT | _PAGE_PROTNONE))) {
*paddr = pte;

if (pte && verbose) {
Expand Down

0 comments on commit aad859e

Please sign in to comment.