diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2016-04-29 09:26:15 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-05-11 07:53:49 -0400 |
commit | 27209206a60fa6ffc92e8d9886ae32abaad5b442 (patch) | |
tree | 782ce073324137d3d9553c2d77da2e570ea43c9c | |
parent | 75a9b8a6c2533064a8d5d090ada7bf9e4c4c84c1 (diff) |
powerpc/mm: Revert changes made to nohash pgalloc-64.h
This reverts pgalloc related changes WRT implementing 4-level page
table for 64K Linux page size and storing of physical address in higher
level page tables since they are only applicable to book3s64 variant
and we now have a separate copy for book3s64. This helps to keep these
headers simpler.
Cc: Scott Wood <scottwood@freescale.com>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | arch/powerpc/include/asm/nohash/64/pgalloc.h | 42 | ||||
-rw-r--r-- | arch/powerpc/include/asm/nohash/64/pgtable.h | 3 |
2 files changed, 10 insertions, 35 deletions
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h index 8d5fc3ac43da..69ef28a81733 100644 --- a/arch/powerpc/include/asm/nohash/64/pgalloc.h +++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h | |||
@@ -53,7 +53,7 @@ static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd) | |||
53 | 53 | ||
54 | #ifndef CONFIG_PPC_64K_PAGES | 54 | #ifndef CONFIG_PPC_64K_PAGES |
55 | 55 | ||
56 | #define pgd_populate(MM, PGD, PUD) pgd_set(PGD, __pgtable_ptr_val(PUD)) | 56 | #define pgd_populate(MM, PGD, PUD) pgd_set(PGD, (unsigned long)PUD) |
57 | 57 | ||
58 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | 58 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) |
59 | { | 59 | { |
@@ -68,19 +68,19 @@ static inline void pud_free(struct mm_struct *mm, pud_t *pud) | |||
68 | 68 | ||
69 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | 69 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) |
70 | { | 70 | { |
71 | pud_set(pud, __pgtable_ptr_val(pmd)); | 71 | pud_set(pud, (unsigned long)pmd); |
72 | } | 72 | } |
73 | 73 | ||
74 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | 74 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
75 | pte_t *pte) | 75 | pte_t *pte) |
76 | { | 76 | { |
77 | pmd_set(pmd, __pgtable_ptr_val(pte)); | 77 | pmd_set(pmd, (unsigned long)pte); |
78 | } | 78 | } |
79 | 79 | ||
80 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | 80 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, |
81 | pgtable_t pte_page) | 81 | pgtable_t pte_page) |
82 | { | 82 | { |
83 | pmd_set(pmd, __pgtable_ptr_val(page_address(pte_page))); | 83 | pmd_set(pmd, (unsigned long)page_address(pte_page)); |
84 | } | 84 | } |
85 | 85 | ||
86 | #define pmd_pgtable(pmd) pmd_page(pmd) | 86 | #define pmd_pgtable(pmd) pmd_page(pmd) |
@@ -171,45 +171,23 @@ extern void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift); | |||
171 | extern void __tlb_remove_table(void *_table); | 171 | extern void __tlb_remove_table(void *_table); |
172 | #endif | 172 | #endif |
173 | 173 | ||
174 | #ifndef __PAGETABLE_PUD_FOLDED | 174 | #define pud_populate(mm, pud, pmd) pud_set(pud, (unsigned long)pmd) |
175 | /* book3s 64 is 4 level page table */ | ||
176 | static inline void pgd_populate(struct mm_struct *mm, pgd_t *pgd, pud_t *pud) | ||
177 | { | ||
178 | pgd_set(pgd, __pgtable_ptr_val(pud)); | ||
179 | } | ||
180 | |||
181 | static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr) | ||
182 | { | ||
183 | return kmem_cache_alloc(PGT_CACHE(PUD_INDEX_SIZE), | ||
184 | GFP_KERNEL|__GFP_REPEAT); | ||
185 | } | ||
186 | |||
187 | static inline void pud_free(struct mm_struct *mm, pud_t *pud) | ||
188 | { | ||
189 | kmem_cache_free(PGT_CACHE(PUD_INDEX_SIZE), pud); | ||
190 | } | ||
191 | #endif | ||
192 | |||
193 | static inline void pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd) | ||
194 | { | ||
195 | pud_set(pud, __pgtable_ptr_val(pmd)); | ||
196 | } | ||
197 | 175 | ||
198 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, | 176 | static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, |
199 | pte_t *pte) | 177 | pte_t *pte) |
200 | { | 178 | { |
201 | pmd_set(pmd, __pgtable_ptr_val(pte)); | 179 | pmd_set(pmd, (unsigned long)pte); |
202 | } | 180 | } |
203 | 181 | ||
204 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, | 182 | static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, |
205 | pgtable_t pte_page) | 183 | pgtable_t pte_page) |
206 | { | 184 | { |
207 | pmd_set(pmd, __pgtable_ptr_val(pte_page)); | 185 | pmd_set(pmd, (unsigned long)pte_page); |
208 | } | 186 | } |
209 | 187 | ||
210 | static inline pgtable_t pmd_pgtable(pmd_t pmd) | 188 | static inline pgtable_t pmd_pgtable(pmd_t pmd) |
211 | { | 189 | { |
212 | return (pgtable_t)pmd_page_vaddr(pmd); | 190 | return (pgtable_t)(pmd_val(pmd) & ~PMD_MASKED_BITS); |
213 | } | 191 | } |
214 | 192 | ||
215 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, | 193 | static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, |
@@ -255,11 +233,11 @@ static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd) | |||
255 | 233 | ||
256 | #define __pmd_free_tlb(tlb, pmd, addr) \ | 234 | #define __pmd_free_tlb(tlb, pmd, addr) \ |
257 | pgtable_free_tlb(tlb, pmd, PMD_CACHE_INDEX) | 235 | pgtable_free_tlb(tlb, pmd, PMD_CACHE_INDEX) |
258 | #ifndef __PAGETABLE_PUD_FOLDED | 236 | #ifndef CONFIG_PPC_64K_PAGES |
259 | #define __pud_free_tlb(tlb, pud, addr) \ | 237 | #define __pud_free_tlb(tlb, pud, addr) \ |
260 | pgtable_free_tlb(tlb, pud, PUD_INDEX_SIZE) | 238 | pgtable_free_tlb(tlb, pud, PUD_INDEX_SIZE) |
261 | 239 | ||
262 | #endif /* __PAGETABLE_PUD_FOLDED */ | 240 | #endif /* CONFIG_PPC_64K_PAGES */ |
263 | 241 | ||
264 | #define check_pgt_cache() do { } while (0) | 242 | #define check_pgt_cache() do { } while (0) |
265 | 243 | ||
diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h index f143d6fb3576..d4d808cf905e 100644 --- a/arch/powerpc/include/asm/nohash/64/pgtable.h +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h | |||
@@ -108,9 +108,6 @@ | |||
108 | #ifndef __ASSEMBLY__ | 108 | #ifndef __ASSEMBLY__ |
109 | /* pte_clear moved to later in this file */ | 109 | /* pte_clear moved to later in this file */ |
110 | 110 | ||
111 | /* Pointers in the page table tree are virtual addresses */ | ||
112 | #define __pgtable_ptr_val(ptr) ((unsigned long)(ptr)) | ||
113 | |||
114 | #define PMD_BAD_BITS (PTE_TABLE_SIZE-1) | 111 | #define PMD_BAD_BITS (PTE_TABLE_SIZE-1) |
115 | #define PUD_BAD_BITS (PMD_TABLE_SIZE-1) | 112 | #define PUD_BAD_BITS (PMD_TABLE_SIZE-1) |
116 | 113 | ||