diff options
Diffstat (limited to 'arch/powerpc/mm/pgtable.c')
-rw-r--r-- | arch/powerpc/mm/pgtable.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/arch/powerpc/mm/pgtable.c b/arch/powerpc/mm/pgtable.c index 010e1c616cb2..d3d61d29b4f1 100644 --- a/arch/powerpc/mm/pgtable.c +++ b/arch/powerpc/mm/pgtable.c | |||
@@ -74,7 +74,7 @@ static struct page *maybe_pte_to_page(pte_t pte) | |||
74 | * support falls into the same category. | 74 | * support falls into the same category. |
75 | */ | 75 | */ |
76 | 76 | ||
77 | static pte_t set_pte_filter(pte_t pte) | 77 | static pte_t set_pte_filter_hash(pte_t pte) |
78 | { | 78 | { |
79 | if (radix_enabled()) | 79 | if (radix_enabled()) |
80 | return pte; | 80 | return pte; |
@@ -93,14 +93,12 @@ static pte_t set_pte_filter(pte_t pte) | |||
93 | return pte; | 93 | return pte; |
94 | } | 94 | } |
95 | 95 | ||
96 | static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, | ||
97 | int dirty) | ||
98 | { | ||
99 | return pte; | ||
100 | } | ||
101 | |||
102 | #else /* CONFIG_PPC_BOOK3S */ | 96 | #else /* CONFIG_PPC_BOOK3S */ |
103 | 97 | ||
98 | static pte_t set_pte_filter_hash(pte_t pte) { return pte; } | ||
99 | |||
100 | #endif /* CONFIG_PPC_BOOK3S */ | ||
101 | |||
104 | /* Embedded type MMU with HW exec support. This is a bit more complicated | 102 | /* Embedded type MMU with HW exec support. This is a bit more complicated |
105 | * as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so | 103 | * as we don't have two bits to spare for _PAGE_EXEC and _PAGE_HWEXEC so |
106 | * instead we "filter out" the exec permission for non clean pages. | 104 | * instead we "filter out" the exec permission for non clean pages. |
@@ -109,6 +107,9 @@ static pte_t set_pte_filter(pte_t pte) | |||
109 | { | 107 | { |
110 | struct page *pg; | 108 | struct page *pg; |
111 | 109 | ||
110 | if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) | ||
111 | return set_pte_filter_hash(pte); | ||
112 | |||
112 | /* No exec permission in the first place, move on */ | 113 | /* No exec permission in the first place, move on */ |
113 | if (!pte_exec(pte) || !pte_looks_normal(pte)) | 114 | if (!pte_exec(pte) || !pte_looks_normal(pte)) |
114 | return pte; | 115 | return pte; |
@@ -138,6 +139,9 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, | |||
138 | { | 139 | { |
139 | struct page *pg; | 140 | struct page *pg; |
140 | 141 | ||
142 | if (mmu_has_feature(MMU_FTR_HPTE_TABLE)) | ||
143 | return pte; | ||
144 | |||
141 | /* So here, we only care about exec faults, as we use them | 145 | /* So here, we only care about exec faults, as we use them |
142 | * to recover lost _PAGE_EXEC and perform I$/D$ coherency | 146 | * to recover lost _PAGE_EXEC and perform I$/D$ coherency |
143 | * if necessary. Also if _PAGE_EXEC is already set, same deal, | 147 | * if necessary. Also if _PAGE_EXEC is already set, same deal, |
@@ -172,8 +176,6 @@ static pte_t set_access_flags_filter(pte_t pte, struct vm_area_struct *vma, | |||
172 | return pte_mkexec(pte); | 176 | return pte_mkexec(pte); |
173 | } | 177 | } |
174 | 178 | ||
175 | #endif /* CONFIG_PPC_BOOK3S */ | ||
176 | |||
177 | /* | 179 | /* |
178 | * set_pte stores a linux PTE into the linux page table. | 180 | * set_pte stores a linux PTE into the linux page table. |
179 | */ | 181 | */ |
@@ -221,9 +223,9 @@ int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address, | |||
221 | } | 223 | } |
222 | 224 | ||
223 | #ifdef CONFIG_HUGETLB_PAGE | 225 | #ifdef CONFIG_HUGETLB_PAGE |
224 | extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, | 226 | int huge_ptep_set_access_flags(struct vm_area_struct *vma, |
225 | unsigned long addr, pte_t *ptep, | 227 | unsigned long addr, pte_t *ptep, |
226 | pte_t pte, int dirty) | 228 | pte_t pte, int dirty) |
227 | { | 229 | { |
228 | #ifdef HUGETLB_NEED_PRELOAD | 230 | #ifdef HUGETLB_NEED_PRELOAD |
229 | /* | 231 | /* |