Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96111
b: refs/heads/master
c: aeed5fc
h: refs/heads/master
i:
  96109: dae3ea2
  96107: 388ae6a
  96103: eadc0fa
  96095: ac6e388
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed May 6, 2008
1 parent e0ba4c0 commit 244570a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 21 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: bb78be8397d3b0900af3d717672218ee3ea07985
refs/heads/master: aeed5fce37196e09b4dac3a1c00d8b7122e040ce
7 changes: 0 additions & 7 deletions trunk/arch/x86/mm/pgtable_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,3 @@ void reserve_top_address(unsigned long reserve)
__FIXADDR_TOP = -reserve - PAGE_SIZE;
__VMALLOC_RESERVE += reserve;
}

int pmd_bad(pmd_t pmd)
{
WARN_ON_ONCE(pmd_bad_v1(pmd) != pmd_bad_v2(pmd));

return pmd_bad_v1(pmd);
}
9 changes: 1 addition & 8 deletions trunk/include/asm-x86/pgtable_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,7 @@ extern unsigned long pg0[];
/* To avoid harmful races, pmd_none(x) should check only the lower when PAE */
#define pmd_none(x) (!(unsigned long)pmd_val((x)))
#define pmd_present(x) (pmd_val((x)) & _PAGE_PRESENT)

extern int pmd_bad(pmd_t pmd);

#define pmd_bad_v1(x) \
(_KERNPG_TABLE != (pmd_val((x)) & ~(PAGE_MASK | _PAGE_USER)))
#define pmd_bad_v2(x) \
(_KERNPG_TABLE != (pmd_val((x)) & ~(PAGE_MASK | _PAGE_USER | \
_PAGE_PSE | _PAGE_NX)))
#define pmd_bad(x) ((pmd_val(x) & (~PAGE_MASK & ~_PAGE_USER)) != _KERNPG_TABLE)

#define pages_to_mb(x) ((x) >> (20-PAGE_SHIFT))

Expand Down
6 changes: 2 additions & 4 deletions trunk/include/asm-x86/pgtable_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,12 @@ static inline unsigned long pgd_bad(pgd_t pgd)

static inline unsigned long pud_bad(pud_t pud)
{
return pud_val(pud) &
~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX);
return pud_val(pud) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
}

static inline unsigned long pmd_bad(pmd_t pmd)
{
return pmd_val(pmd) &
~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER | _PAGE_PSE | _PAGE_NX);
return pmd_val(pmd) & ~(PTE_MASK | _KERNPG_TABLE | _PAGE_USER);
}

#define pte_none(x) (!pte_val((x)))
Expand Down
5 changes: 4 additions & 1 deletion trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
goto no_page_table;

pmd = pmd_offset(pud, address);
if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
if (pmd_none(*pmd))
goto no_page_table;

if (pmd_huge(*pmd)) {
Expand All @@ -978,6 +978,9 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address,
goto out;
}

if (unlikely(pmd_bad(*pmd)))
goto no_page_table;

ptep = pte_offset_map_lock(mm, pmd, address, &ptl);
if (!ptep)
goto out;
Expand Down

0 comments on commit 244570a

Please sign in to comment.