diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-19 15:34:15 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-23 22:47:34 -0400 |
commit | a033a487f8ae79800a15774cb6565cbbca685fc6 (patch) | |
tree | aca38e1e3d92ac1be2d4d965dd48a8eaa6d14b40 /arch/powerpc/include | |
parent | ff7c660092de1f70e156cf95784a4b55556412d9 (diff) |
powerpc/mm: Add option for non-atomic PTE updates to ppc64
ppc32 has it already, add it to ppc64 as a preliminary for adding
support for Book3E 64-bit support
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include')
-rw-r--r-- | arch/powerpc/include/asm/pgtable-ppc64.h | 12 | ||||
-rw-r--r-- | arch/powerpc/include/asm/pte-hash64.h | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/pgtable-ppc64.h b/arch/powerpc/include/asm/pgtable-ppc64.h index 768e0f08f009..c40db05f21e0 100644 --- a/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/arch/powerpc/include/asm/pgtable-ppc64.h | |||
@@ -178,6 +178,7 @@ static inline unsigned long pte_update(struct mm_struct *mm, | |||
178 | pte_t *ptep, unsigned long clr, | 178 | pte_t *ptep, unsigned long clr, |
179 | int huge) | 179 | int huge) |
180 | { | 180 | { |
181 | #ifdef PTE_ATOMIC_UPDATES | ||
181 | unsigned long old, tmp; | 182 | unsigned long old, tmp; |
182 | 183 | ||
183 | __asm__ __volatile__( | 184 | __asm__ __volatile__( |
@@ -190,7 +191,10 @@ static inline unsigned long pte_update(struct mm_struct *mm, | |||
190 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) | 191 | : "=&r" (old), "=&r" (tmp), "=m" (*ptep) |
191 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) | 192 | : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) |
192 | : "cc" ); | 193 | : "cc" ); |
193 | 194 | #else | |
195 | unsigned long old = pte_val(*ptep); | ||
196 | *ptep = __pte(old & ~clr); | ||
197 | #endif | ||
194 | /* huge pages use the old page table lock */ | 198 | /* huge pages use the old page table lock */ |
195 | if (!huge) | 199 | if (!huge) |
196 | assert_pte_locked(mm, addr); | 200 | assert_pte_locked(mm, addr); |
@@ -278,6 +282,8 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) | |||
278 | unsigned long bits = pte_val(entry) & | 282 | unsigned long bits = pte_val(entry) & |
279 | (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | | 283 | (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | |
280 | _PAGE_EXEC | _PAGE_HWEXEC); | 284 | _PAGE_EXEC | _PAGE_HWEXEC); |
285 | |||
286 | #ifdef PTE_ATOMIC_UPDATES | ||
281 | unsigned long old, tmp; | 287 | unsigned long old, tmp; |
282 | 288 | ||
283 | __asm__ __volatile__( | 289 | __asm__ __volatile__( |
@@ -290,6 +296,10 @@ static inline void __ptep_set_access_flags(pte_t *ptep, pte_t entry) | |||
290 | :"=&r" (old), "=&r" (tmp), "=m" (*ptep) | 296 | :"=&r" (old), "=&r" (tmp), "=m" (*ptep) |
291 | :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY) | 297 | :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY) |
292 | :"cc"); | 298 | :"cc"); |
299 | #else | ||
300 | unsigned long old = pte_val(*ptep); | ||
301 | *ptep = __pte(old | bits); | ||
302 | #endif | ||
293 | } | 303 | } |
294 | 304 | ||
295 | #define __HAVE_ARCH_PTE_SAME | 305 | #define __HAVE_ARCH_PTE_SAME |
diff --git a/arch/powerpc/include/asm/pte-hash64.h b/arch/powerpc/include/asm/pte-hash64.h index b61b7e4a18de..0419eeb53274 100644 --- a/arch/powerpc/include/asm/pte-hash64.h +++ b/arch/powerpc/include/asm/pte-hash64.h | |||
@@ -41,6 +41,8 @@ | |||
41 | #define _PTEIDX_SECONDARY 0x8 | 41 | #define _PTEIDX_SECONDARY 0x8 |
42 | #define _PTEIDX_GROUP_IX 0x7 | 42 | #define _PTEIDX_GROUP_IX 0x7 |
43 | 43 | ||
44 | /* Hash table based platforms need atomic updates of the linux PTE */ | ||
45 | #define PTE_ATOMIC_UPDATES 1 | ||
44 | 46 | ||
45 | #ifdef CONFIG_PPC_64K_PAGES | 47 | #ifdef CONFIG_PPC_64K_PAGES |
46 | #include <asm/pte-hash64-64k.h> | 48 | #include <asm/pte-hash64-64k.h> |