| .. | .. |
|---|
| 2 | 2 | /* |
|---|
| 3 | 3 | * mm/pgtable-generic.c |
|---|
| 4 | 4 | * |
|---|
| 5 | | - * Generic pgtable methods declared in asm-generic/pgtable.h |
|---|
| 5 | + * Generic pgtable methods declared in linux/pgtable.h |
|---|
| 6 | 6 | * |
|---|
| 7 | 7 | * Copyright (C) 2010 Linus Torvalds |
|---|
| 8 | 8 | */ |
|---|
| 9 | 9 | |
|---|
| 10 | 10 | #include <linux/pagemap.h> |
|---|
| 11 | +#include <linux/hugetlb.h> |
|---|
| 12 | +#include <linux/pgtable.h> |
|---|
| 11 | 13 | #include <asm/tlb.h> |
|---|
| 12 | | -#include <asm-generic/pgtable.h> |
|---|
| 13 | 14 | |
|---|
| 14 | 15 | /* |
|---|
| 15 | 16 | * If a p?d_bad entry is found while walking page tables, report |
|---|
| .. | .. |
|---|
| 23 | 24 | pgd_clear(pgd); |
|---|
| 24 | 25 | } |
|---|
| 25 | 26 | |
|---|
| 27 | +#ifndef __PAGETABLE_P4D_FOLDED |
|---|
| 26 | 28 | void p4d_clear_bad(p4d_t *p4d) |
|---|
| 27 | 29 | { |
|---|
| 28 | 30 | p4d_ERROR(*p4d); |
|---|
| 29 | 31 | p4d_clear(p4d); |
|---|
| 30 | 32 | } |
|---|
| 33 | +#endif |
|---|
| 31 | 34 | |
|---|
| 35 | +#ifndef __PAGETABLE_PUD_FOLDED |
|---|
| 32 | 36 | void pud_clear_bad(pud_t *pud) |
|---|
| 33 | 37 | { |
|---|
| 34 | 38 | pud_ERROR(*pud); |
|---|
| 35 | 39 | pud_clear(pud); |
|---|
| 36 | 40 | } |
|---|
| 41 | +#endif |
|---|
| 37 | 42 | |
|---|
| 43 | +/* |
|---|
| 44 | + * Note that the pmd variant below can't be stub'ed out just as for p4d/pud |
|---|
| 45 | + * above. pmd folding is special and typically pmd_* macros refer to upper |
|---|
| 46 | + * level even when folded |
|---|
| 47 | + */ |
|---|
| 38 | 48 | void pmd_clear_bad(pmd_t *pmd) |
|---|
| 39 | 49 | { |
|---|
| 40 | 50 | pmd_ERROR(*pmd); |
|---|
| .. | .. |
|---|
| 43 | 53 | |
|---|
| 44 | 54 | #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS |
|---|
| 45 | 55 | /* |
|---|
| 46 | | - * Only sets the access flags (dirty, accessed), as well as write |
|---|
| 56 | + * Only sets the access flags (dirty, accessed), as well as write |
|---|
| 47 | 57 | * permission. Furthermore, we know it always gets set to a "more |
|---|
| 48 | 58 | * permissive" setting, which allows most architectures to optimize |
|---|
| 49 | 59 | * this. We return whether the PTE actually changed, which in turn |
|---|
| .. | .. |
|---|
| 184 | 194 | pmd_t pmdp_invalidate(struct vm_area_struct *vma, unsigned long address, |
|---|
| 185 | 195 | pmd_t *pmdp) |
|---|
| 186 | 196 | { |
|---|
| 187 | | - pmd_t old = pmdp_establish(vma, address, pmdp, pmd_mknotpresent(*pmdp)); |
|---|
| 197 | + pmd_t old = pmdp_establish(vma, address, pmdp, pmd_mkinvalid(*pmdp)); |
|---|
| 188 | 198 | flush_pmd_tlb_range(vma, address, address + HPAGE_PMD_SIZE); |
|---|
| 189 | 199 | return old; |
|---|
| 190 | 200 | } |
|---|