Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+13 -1
+11 -1
arch/powerpc/include/asm/pgtable-ppc64.h
··· 178 178 pte_t *ptep, unsigned long clr, 179 179 int huge) 180 180 { 181 + #ifdef PTE_ATOMIC_UPDATES 181 182 unsigned long old, tmp; 182 183 183 184 __asm__ __volatile__( ··· 191 190 : "=&r" (old), "=&r" (tmp), "=m" (*ptep) 192 191 : "r" (ptep), "r" (clr), "m" (*ptep), "i" (_PAGE_BUSY) 193 192 : "cc" ); 194 - 193 + #else 194 + unsigned long old = pte_val(*ptep); 195 + *ptep = __pte(old & ~clr); 196 + #endif 195 197 /* huge pages use the old page table lock */ 196 198 if (!huge) 197 199 assert_pte_locked(mm, addr); ··· 282 278 unsigned long bits = pte_val(entry) & 283 279 (_PAGE_DIRTY | _PAGE_ACCESSED | _PAGE_RW | 284 280 _PAGE_EXEC | _PAGE_HWEXEC); 281 + 282 + #ifdef PTE_ATOMIC_UPDATES 285 283 unsigned long old, tmp; 286 284 287 285 __asm__ __volatile__( ··· 296 290 :"=&r" (old), "=&r" (tmp), "=m" (*ptep) 297 291 :"r" (bits), "r" (ptep), "m" (*ptep), "i" (_PAGE_BUSY) 298 292 :"cc"); 293 + #else 294 + unsigned long old = pte_val(*ptep); 295 + *ptep = __pte(old | bits); 296 + #endif 299 297 } 300 298 301 299 #define __HAVE_ARCH_PTE_SAME
+2
arch/powerpc/include/asm/pte-hash64.h
··· 41 41 #define _PTEIDX_SECONDARY 0x8 42 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 47 #ifdef CONFIG_PPC_64K_PAGES 46 48 #include <asm/pte-hash64-64k.h>