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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

- One fix for the interrupt rework we did last release which broke
KVM-PR

- Three commits fixing some fallout from the READ_ONCE() changes
interacting badly with our 8xx 16K pages support, which uses a pte_t
that is a structure of 4 actual PTEs

- A cleanup of the 8xx pte_update() to use the newly added pmd_off()

- A fix for a crash when handling an oops if CONFIG_DEBUG_VIRTUAL is
enabled

- A minor fix for the SPU syscall generation

Thanks to Aneesh Kumar K.V, Christian Zigotzky, Christophe Leroy, Mike
Rapoport, Nicholas Piggin.

* tag 'powerpc-5.8-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/8xx: Provide ptep_get() with 16k pages
mm: Allow arches to provide ptep_get()
mm/gup: Use huge_ptep_get() in gup_hugepte()
powerpc/syscalls: Use the number when building SPU syscall table
powerpc/8xx: use pmd_off() to access a PMD entry in pte_update()
powerpc/64s: Fix KVM interrupt using wrong save area
powerpc: Fix kernel crash in show_instructions() w/DEBUG_VIRTUAL

+37 -20
+13 -5
arch/powerpc/include/asm/nohash/32/pgtable.h
··· 205 205 *pmdp = __pmd(0); 206 206 } 207 207 208 - /* to find an entry in a page-table-directory */ 209 - #define pgd_index(address) ((address) >> PGDIR_SHIFT) 210 - #define pgd_offset(mm, address) ((mm)->pgd + pgd_index(address)) 211 - 212 208 /* 213 209 * PTE updates. This function is called whenever an existing 214 210 * valid PTE is updated. This does -not- include set_pte_at() ··· 226 230 * For other page sizes, we have a single entry in the table. 227 231 */ 228 232 #ifdef CONFIG_PPC_8xx 233 + static pmd_t *pmd_off(struct mm_struct *mm, unsigned long addr); 234 + 229 235 static inline pte_basic_t pte_update(struct mm_struct *mm, unsigned long addr, pte_t *p, 230 236 unsigned long clr, unsigned long set, int huge) 231 237 { ··· 235 237 pte_basic_t old = pte_val(*p); 236 238 pte_basic_t new = (old & ~(pte_basic_t)clr) | set; 237 239 int num, i; 238 - pmd_t *pmd = pmd_offset(pud_offset(p4d_offset(pgd_offset(mm, addr), addr), addr), addr); 240 + pmd_t *pmd = pmd_off(mm, addr); 239 241 240 242 if (!huge) 241 243 num = PAGE_SIZE / SZ_4K; ··· 283 285 { 284 286 return __pte(pte_update(mm, addr, ptep, ~0, 0, 0)); 285 287 } 288 + 289 + #if defined(CONFIG_PPC_8xx) && defined(CONFIG_PPC_16K_PAGES) 290 + #define __HAVE_ARCH_PTEP_GET 291 + static inline pte_t ptep_get(pte_t *ptep) 292 + { 293 + pte_t pte = {READ_ONCE(ptep->pte), 0, 0, 0}; 294 + 295 + return pte; 296 + } 297 + #endif 286 298 287 299 #define __HAVE_ARCH_PTEP_SET_WRPROTECT 288 300 static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
+2 -2
arch/powerpc/kernel/exceptions-64s.S
··· 270 270 END_FTR_SECTION_IFSET(CPU_FTR_CFAR) 271 271 .endif 272 272 273 - ld r10,PACA_EXGEN+EX_CTR(r13) 273 + ld r10,IAREA+EX_CTR(r13) 274 274 mtctr r10 275 275 BEGIN_FTR_SECTION 276 276 ld r10,IAREA+EX_PPR(r13) ··· 298 298 299 299 .if IKVM_SKIP 300 300 89: mtocrf 0x80,r9 301 - ld r10,PACA_EXGEN+EX_CTR(r13) 301 + ld r10,IAREA+EX_CTR(r13) 302 302 mtctr r10 303 303 ld r9,IAREA+EX_R9(r13) 304 304 ld r10,IAREA+EX_R10(r13)
+11 -9
arch/powerpc/kernel/process.c
··· 1252 1252 static void show_instructions(struct pt_regs *regs) 1253 1253 { 1254 1254 int i; 1255 + unsigned long nip = regs->nip; 1255 1256 unsigned long pc = regs->nip - (NR_INSN_TO_PRINT * 3 / 4 * sizeof(int)); 1256 1257 1257 1258 printk("Instruction dump:"); 1259 + 1260 + /* 1261 + * If we were executing with the MMU off for instructions, adjust pc 1262 + * rather than printing XXXXXXXX. 1263 + */ 1264 + if (!IS_ENABLED(CONFIG_BOOKE) && !(regs->msr & MSR_IR)) { 1265 + pc = (unsigned long)phys_to_virt(pc); 1266 + nip = (unsigned long)phys_to_virt(regs->nip); 1267 + } 1258 1268 1259 1269 for (i = 0; i < NR_INSN_TO_PRINT; i++) { 1260 1270 int instr; ··· 1272 1262 if (!(i % 8)) 1273 1263 pr_cont("\n"); 1274 1264 1275 - #if !defined(CONFIG_BOOKE) 1276 - /* If executing with the IMMU off, adjust pc rather 1277 - * than print XXXXXXXX. 1278 - */ 1279 - if (!(regs->msr & MSR_IR)) 1280 - pc = (unsigned long)phys_to_virt(pc); 1281 - #endif 1282 - 1283 1265 if (!__kernel_text_address(pc) || 1284 1266 get_kernel_nofault(instr, (const void *)pc)) { 1285 1267 pr_cont("XXXXXXXX "); 1286 1268 } else { 1287 - if (regs->nip == pc) 1269 + if (nip == pc) 1288 1270 pr_cont("<%08x> ", instr); 1289 1271 else 1290 1272 pr_cont("%08x ", instr);
+1 -1
arch/powerpc/platforms/cell/spu_callbacks.c
··· 35 35 */ 36 36 37 37 static void *spu_syscall_table[] = { 38 - #define __SYSCALL(nr, entry) entry, 38 + #define __SYSCALL(nr, entry) [nr] = entry, 39 39 #include <asm/syscall_table_spu.h> 40 40 #undef __SYSCALL 41 41 };
+1 -1
include/asm-generic/hugetlb.h
··· 122 122 #ifndef __HAVE_ARCH_HUGE_PTEP_GET 123 123 static inline pte_t huge_ptep_get(pte_t *ptep) 124 124 { 125 - return READ_ONCE(*ptep); 125 + return ptep_get(ptep); 126 126 } 127 127 #endif 128 128
+7
include/linux/pgtable.h
··· 249 249 } 250 250 #endif 251 251 252 + #ifndef __HAVE_ARCH_PTEP_GET 253 + static inline pte_t ptep_get(pte_t *ptep) 254 + { 255 + return READ_ONCE(*ptep); 256 + } 257 + #endif 258 + 252 259 #ifdef CONFIG_TRANSPARENT_HUGEPAGE 253 260 #ifndef __HAVE_ARCH_PMDP_HUGE_GET_AND_CLEAR 254 261 static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm,
+2 -2
mm/gup.c
··· 2196 2196 */ 2197 2197 static inline pte_t gup_get_pte(pte_t *ptep) 2198 2198 { 2199 - return READ_ONCE(*ptep); 2199 + return ptep_get(ptep); 2200 2200 } 2201 2201 #endif /* CONFIG_GUP_GET_PTE_LOW_HIGH */ 2202 2202 ··· 2425 2425 if (pte_end < end) 2426 2426 end = pte_end; 2427 2427 2428 - pte = READ_ONCE(*ptep); 2428 + pte = huge_ptep_get(ptep); 2429 2429 2430 2430 if (!pte_access_permitted(pte, flags & FOLL_WRITE)) 2431 2431 return 0;