Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82895
b: refs/heads/master
c: 9a14aef
h: refs/heads/master
i:
  82893: e8743e3
  82891: 772fcf6
  82887: fab600b
  82879: 357b8ba
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Feb 4, 2008
1 parent 4a22034 commit 9a2d723
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 34508f66b69ff1708192654f631eb8f1d4c52005
refs/heads/master: 9a14aefc1d28c6037122965ee8c10d92a970ade0
10 changes: 9 additions & 1 deletion trunk/arch/x86/mm/pageattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,14 @@ static inline pgprot_t static_protections(pgprot_t prot, unsigned long address)
return prot;
}

/*
* Lookup the page table entry for a virtual address. Return a pointer
* to the entry and the level of the mapping.
*
* Note: We return pud and pmd either when the entry is marked large
* or when the present bit is not set. Otherwise we would return a
* pointer to a nonexisting mapping.
*/
pte_t *lookup_address(unsigned long address, int *level)
{
pgd_t *pgd = pgd_offset_k(address);
Expand All @@ -206,7 +214,7 @@ pte_t *lookup_address(unsigned long address, int *level)
return NULL;

*level = PG_LEVEL_2M;
if (pmd_large(*pmd))
if (pmd_large(*pmd) || !pmd_present(*pmd))
return (pte_t *)pmd;

*level = PG_LEVEL_4K;
Expand Down

0 comments on commit 9a2d723

Please sign in to comment.