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

Configure Feed

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

Merge tag 'powerpc-4.12-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"Hopefully the last two powerpc fixes for 4.12.

The CXL one is larger than I'd usually send at rc7, but it fixes new
code this cycle, so better to have it working for the release. It was
actually sent a few weeks back but got blocked in testing behind
another fix that was causing issues.

We are still tracking one crash in v4.12-rc7, but only one person has
reproduced it and the commit identified by bisect doesn't touch any of
the relevant code, so I think it's 50/50 whether that commit is
actually the problem or it's some code layout / toolchain issue.

Two fixes for code we merged this cycle:

- cxl: Fixes for Coherent Accelerator Interface Architecture 2.0

- Avoid miscompilation w/GCC 4.6.3 on 32-bit - don't inline
copy_to/from_user()

Thanks to Al Viro, Larry Finger, Christophe Lombard"

* tag 'powerpc-4.12-8' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/32: Avoid miscompilation w/GCC 4.6.3 - don't inline copy_to/from_user()
cxl: Fixes for Coherent Accelerator Interface Architecture 2.0

+58 -54
+1 -7
arch/powerpc/include/asm/uaccess.h
··· 267 267 extern unsigned long __copy_tofrom_user(void __user *to, 268 268 const void __user *from, unsigned long size); 269 269 270 - #ifndef __powerpc64__ 271 - 272 - #define INLINE_COPY_FROM_USER 273 - #define INLINE_COPY_TO_USER 274 - 275 - #else /* __powerpc64__ */ 276 - 270 + #ifdef __powerpc64__ 277 271 static inline unsigned long 278 272 raw_copy_in_user(void __user *to, const void __user *from, unsigned long n) 279 273 {
+3 -3
drivers/misc/cxl/context.c
··· 45 45 mutex_init(&ctx->mapping_lock); 46 46 ctx->mapping = NULL; 47 47 48 - if (cxl_is_psl8(afu)) { 48 + if (cxl_is_power8()) { 49 49 spin_lock_init(&ctx->sste_lock); 50 50 51 51 /* ··· 189 189 if (start + len > ctx->afu->adapter->ps_size) 190 190 return -EINVAL; 191 191 192 - if (cxl_is_psl9(ctx->afu)) { 192 + if (cxl_is_power9()) { 193 193 /* 194 194 * Make sure there is a valid problem state 195 195 * area space for this AFU. ··· 324 324 { 325 325 struct cxl_context *ctx = container_of(rcu, struct cxl_context, rcu); 326 326 327 - if (cxl_is_psl8(ctx->afu)) 327 + if (cxl_is_power8()) 328 328 free_page((u64)ctx->sstp); 329 329 if (ctx->ff_page) 330 330 __free_page(ctx->ff_page);
+5 -13
drivers/misc/cxl/cxl.h
··· 357 357 #define CXL_PSL9_DSISR_An_PF_RGP 0x0000000000000090ULL /* PTE not found (Radix Guest (parent)) 0b10010000 */ 358 358 #define CXL_PSL9_DSISR_An_PF_HRH 0x0000000000000094ULL /* PTE not found (HPT/Radix Host) 0b10010100 */ 359 359 #define CXL_PSL9_DSISR_An_PF_STEG 0x000000000000009CULL /* PTE not found (STEG VA) 0b10011100 */ 360 + #define CXL_PSL9_DSISR_An_URTCH 0x00000000000000B4ULL /* Unsupported Radix Tree Configuration 0b10110100 */ 360 361 361 362 /****** CXL_PSL_TFC_An ******************************************************/ 362 363 #define CXL_PSL_TFC_An_A (1ull << (63-28)) /* Acknowledge non-translation fault */ ··· 845 844 846 845 static inline bool cxl_is_power9(void) 847 846 { 848 - /* intermediate solution */ 849 - if (!cxl_is_power8() && 850 - (cpu_has_feature(CPU_FTRS_POWER9) || 851 - cpu_has_feature(CPU_FTR_POWER9_DD1))) 847 + if (pvr_version_is(PVR_POWER9)) 852 848 return true; 853 849 return false; 854 850 } 855 851 856 - static inline bool cxl_is_psl8(struct cxl_afu *afu) 852 + static inline bool cxl_is_power9_dd1(void) 857 853 { 858 - if (afu->adapter->caia_major == 1) 859 - return true; 860 - return false; 861 - } 862 - 863 - static inline bool cxl_is_psl9(struct cxl_afu *afu) 864 - { 865 - if (afu->adapter->caia_major == 2) 854 + if ((pvr_version_is(PVR_POWER9)) && 855 + cpu_has_feature(CPU_FTR_POWER9_DD1)) 866 856 return true; 867 857 return false; 868 858 }
+15 -8
drivers/misc/cxl/fault.c
··· 187 187 188 188 static bool cxl_is_segment_miss(struct cxl_context *ctx, u64 dsisr) 189 189 { 190 - if ((cxl_is_psl8(ctx->afu)) && (dsisr & CXL_PSL_DSISR_An_DS)) 190 + if ((cxl_is_power8() && (dsisr & CXL_PSL_DSISR_An_DS))) 191 191 return true; 192 192 193 193 return false; ··· 195 195 196 196 static bool cxl_is_page_fault(struct cxl_context *ctx, u64 dsisr) 197 197 { 198 - if ((cxl_is_psl8(ctx->afu)) && (dsisr & CXL_PSL_DSISR_An_DM)) 198 + u64 crs; /* Translation Checkout Response Status */ 199 + 200 + if ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_An_DM)) 199 201 return true; 200 202 201 - if ((cxl_is_psl9(ctx->afu)) && 202 - ((dsisr & CXL_PSL9_DSISR_An_CO_MASK) & 203 - (CXL_PSL9_DSISR_An_PF_SLR | CXL_PSL9_DSISR_An_PF_RGC | 204 - CXL_PSL9_DSISR_An_PF_RGP | CXL_PSL9_DSISR_An_PF_HRH | 205 - CXL_PSL9_DSISR_An_PF_STEG))) 206 - return true; 203 + if (cxl_is_power9()) { 204 + crs = (dsisr & CXL_PSL9_DSISR_An_CO_MASK); 205 + if ((crs == CXL_PSL9_DSISR_An_PF_SLR) || 206 + (crs == CXL_PSL9_DSISR_An_PF_RGC) || 207 + (crs == CXL_PSL9_DSISR_An_PF_RGP) || 208 + (crs == CXL_PSL9_DSISR_An_PF_HRH) || 209 + (crs == CXL_PSL9_DSISR_An_PF_STEG) || 210 + (crs == CXL_PSL9_DSISR_An_URTCH)) { 211 + return true; 212 + } 213 + } 207 214 208 215 return false; 209 216 }
+13 -4
drivers/misc/cxl/main.c
··· 329 329 330 330 cxl_debugfs_init(); 331 331 332 - if ((rc = register_cxl_calls(&cxl_calls))) 333 - goto err; 332 + /* 333 + * we don't register the callback on P9. slb callack is only 334 + * used for the PSL8 MMU and CX4. 335 + */ 336 + if (cxl_is_power8()) { 337 + rc = register_cxl_calls(&cxl_calls); 338 + if (rc) 339 + goto err; 340 + } 334 341 335 342 if (cpu_has_feature(CPU_FTR_HVMODE)) { 336 343 cxl_ops = &cxl_native_ops; ··· 354 347 355 348 return 0; 356 349 err1: 357 - unregister_cxl_calls(&cxl_calls); 350 + if (cxl_is_power8()) 351 + unregister_cxl_calls(&cxl_calls); 358 352 err: 359 353 cxl_debugfs_exit(); 360 354 cxl_file_exit(); ··· 374 366 375 367 cxl_debugfs_exit(); 376 368 cxl_file_exit(); 377 - unregister_cxl_calls(&cxl_calls); 369 + if (cxl_is_power8()) 370 + unregister_cxl_calls(&cxl_calls); 378 371 idr_destroy(&cxl_adapter_idr); 379 372 } 380 373
+17 -12
drivers/misc/cxl/native.c
··· 105 105 CXL_AFU_Cntl_An_RS_MASK | CXL_AFU_Cntl_An_ES_MASK, 106 106 false); 107 107 108 - /* Re-enable any masked interrupts */ 109 - serr = cxl_p1n_read(afu, CXL_PSL_SERR_An); 110 - serr &= ~CXL_PSL_SERR_An_IRQ_MASKS; 111 - cxl_p1n_write(afu, CXL_PSL_SERR_An, serr); 112 - 108 + /* 109 + * Re-enable any masked interrupts when the AFU is not 110 + * activated to avoid side effects after attaching a process 111 + * in dedicated mode. 112 + */ 113 + if (afu->current_mode == 0) { 114 + serr = cxl_p1n_read(afu, CXL_PSL_SERR_An); 115 + serr &= ~CXL_PSL_SERR_An_IRQ_MASKS; 116 + cxl_p1n_write(afu, CXL_PSL_SERR_An, serr); 117 + } 113 118 114 119 return rc; 115 120 } ··· 144 139 145 140 pr_devel("PSL purge request\n"); 146 141 147 - if (cxl_is_psl8(afu)) 142 + if (cxl_is_power8()) 148 143 trans_fault = CXL_PSL_DSISR_TRANS; 149 - if (cxl_is_psl9(afu)) 144 + if (cxl_is_power9()) 150 145 trans_fault = CXL_PSL9_DSISR_An_TF; 151 146 152 147 if (!cxl_ops->link_ok(afu->adapter, afu)) { ··· 608 603 if (!test_tsk_thread_flag(current, TIF_32BIT)) 609 604 sr |= CXL_PSL_SR_An_SF; 610 605 } 611 - if (cxl_is_psl9(ctx->afu)) { 606 + if (cxl_is_power9()) { 612 607 if (radix_enabled()) 613 608 sr |= CXL_PSL_SR_An_XLAT_ror; 614 609 else ··· 1122 1117 1123 1118 static bool cxl_is_translation_fault(struct cxl_afu *afu, u64 dsisr) 1124 1119 { 1125 - if ((cxl_is_psl8(afu)) && (dsisr & CXL_PSL_DSISR_TRANS)) 1120 + if ((cxl_is_power8()) && (dsisr & CXL_PSL_DSISR_TRANS)) 1126 1121 return true; 1127 1122 1128 - if ((cxl_is_psl9(afu)) && (dsisr & CXL_PSL9_DSISR_An_TF)) 1123 + if ((cxl_is_power9()) && (dsisr & CXL_PSL9_DSISR_An_TF)) 1129 1124 return true; 1130 1125 1131 1126 return false; ··· 1199 1194 if (ph != ctx->pe) 1200 1195 return; 1201 1196 dsisr = cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An); 1202 - if (cxl_is_psl8(ctx->afu) && 1197 + if (cxl_is_power8() && 1203 1198 ((dsisr & CXL_PSL_DSISR_PENDING) == 0)) 1204 1199 return; 1205 - if (cxl_is_psl9(ctx->afu) && 1200 + if (cxl_is_power9() && 1206 1201 ((dsisr & CXL_PSL9_DSISR_PENDING) == 0)) 1207 1202 return; 1208 1203 /*
+4 -7
drivers/misc/cxl/pci.c
··· 436 436 /* nMMU_ID Defaults to: b’000001001’*/ 437 437 xsl_dsnctl |= ((u64)0x09 << (63-28)); 438 438 439 - if (cxl_is_power9() && !cpu_has_feature(CPU_FTR_POWER9_DD1)) { 439 + if (!(cxl_is_power9_dd1())) { 440 440 /* 441 441 * Used to identify CAPI packets which should be sorted into 442 442 * the Non-Blocking queues by the PHB. This field should match ··· 491 491 cxl_p1_write(adapter, CXL_PSL9_APCDEDTYPE, 0x40000003FFFF0000ULL); 492 492 493 493 /* Disable vc dd1 fix */ 494 - if ((cxl_is_power9() && cpu_has_feature(CPU_FTR_POWER9_DD1))) 494 + if (cxl_is_power9_dd1()) 495 495 cxl_p1_write(adapter, CXL_PSL9_GP_CT, 0x0400000000000001ULL); 496 496 497 497 return 0; ··· 1439 1439 * The adapter is about to be reset, so ignore errors. 1440 1440 * Not supported on P9 DD1 1441 1441 */ 1442 - if ((cxl_is_power8()) || 1443 - ((cxl_is_power9() && !cpu_has_feature(CPU_FTR_POWER9_DD1)))) 1442 + if ((cxl_is_power8()) || (!(cxl_is_power9_dd1()))) 1444 1443 cxl_data_cache_flush(adapter); 1445 1444 1446 1445 /* pcie_warm_reset requests a fundamental pci reset which includes a ··· 1749 1750 .debugfs_add_adapter_regs = cxl_debugfs_add_adapter_regs_psl9, 1750 1751 .debugfs_add_afu_regs = cxl_debugfs_add_afu_regs_psl9, 1751 1752 .psl_irq_dump_registers = cxl_native_irq_dump_regs_psl9, 1752 - .err_irq_dump_registers = cxl_native_err_irq_dump_regs, 1753 1753 .debugfs_stop_trace = cxl_stop_trace_psl9, 1754 1754 .write_timebase_ctrl = write_timebase_ctrl_psl9, 1755 1755 .timebase_read = timebase_read_psl9, ··· 1887 1889 * Flush adapter datacache as its about to be removed. 1888 1890 * Not supported on P9 DD1. 1889 1891 */ 1890 - if ((cxl_is_power8()) || 1891 - ((cxl_is_power9() && !cpu_has_feature(CPU_FTR_POWER9_DD1)))) 1892 + if ((cxl_is_power8()) || (!(cxl_is_power9_dd1()))) 1892 1893 cxl_data_cache_flush(adapter); 1893 1894 1894 1895 cxl_deconfigure_adapter(adapter);