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-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux into master

Pull powerpc fixes from Michael Ellerman:
"Some more powerpc fixes for 5.8:

- A fix to the VAS code we merged this cycle, to report the proper
error code to userspace for address translation failures. And a
selftest update to match.

- Another fix for our pkey handling of PROT_EXEC mappings.

- A fix for a crash when booting a "secure VM" under an ultravisor
with certain numbers of CPUs.

Thanks to: Aneesh Kumar K.V, Haren Myneni, Laurent Dufour, Sandipan
Das, Satheesh Rajendran, Thiago Jung Bauermann"

* tag 'powerpc-5.8-7' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
selftests/powerpc: Use proper error code to check fault address
powerpc/vas: Report proper error code for address translation failure
powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size
powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey

+16 -12
+1 -1
Documentation/powerpc/vas-api.rst
··· 213 213 updating CSB with the following data: 214 214 215 215 csb.flags = CSB_V; 216 - csb.cc = CSB_CC_TRANSLATION; 216 + csb.cc = CSB_CC_FAULT_ADDRESS; 217 217 csb.ce = CSB_CE_TERMINATION; 218 218 csb.address = fault_address; 219 219
+2
arch/powerpc/include/asm/icswx.h
··· 77 77 #define CSB_CC_CHAIN (37) 78 78 #define CSB_CC_SEQUENCE (38) 79 79 #define CSB_CC_HW (39) 80 + /* P9 DD2 NX Workbook 3.2 (Table 4-36): Address translation fault */ 81 + #define CSB_CC_FAULT_ADDRESS (250) 80 82 81 83 #define CSB_SIZE (0x10) 82 84 #define CSB_ALIGN CSB_SIZE
+1 -1
arch/powerpc/kernel/paca.c
··· 87 87 * This is very early in boot, so no harm done if the kernel crashes at 88 88 * this point. 89 89 */ 90 - BUG_ON(shared_lppaca_size >= shared_lppaca_total_size); 90 + BUG_ON(shared_lppaca_size > shared_lppaca_total_size); 91 91 92 92 return ptr; 93 93 }
+7 -5
arch/powerpc/mm/book3s64/pkeys.c
··· 354 354 u64 amr; 355 355 356 356 pkey_shift = pkeyshift(pkey); 357 - if (execute && !(read_iamr() & (IAMR_EX_BIT << pkey_shift))) 358 - return true; 357 + if (execute) 358 + return !(read_iamr() & (IAMR_EX_BIT << pkey_shift)); 359 359 360 - amr = read_amr(); /* Delay reading amr until absolutely needed */ 361 - return ((!write && !(amr & (AMR_RD_BIT << pkey_shift))) || 362 - (write && !(amr & (AMR_WR_BIT << pkey_shift)))); 360 + amr = read_amr(); 361 + if (write) 362 + return !(amr & (AMR_WR_BIT << pkey_shift)); 363 + 364 + return !(amr & (AMR_RD_BIT << pkey_shift)); 363 365 } 364 366 365 367 bool arch_pte_access_permitted(u64 pte, bool write, bool execute)
+1 -1
arch/powerpc/platforms/powernv/vas-fault.c
··· 79 79 csb_addr = (void __user *)be64_to_cpu(crb->csb_addr); 80 80 81 81 memset(&csb, 0, sizeof(csb)); 82 - csb.cc = CSB_CC_TRANSLATION; 82 + csb.cc = CSB_CC_FAULT_ADDRESS; 83 83 csb.ce = CSB_CE_TERMINATION; 84 84 csb.cs = 0; 85 85 csb.count = 0;
+2 -2
tools/testing/selftests/powerpc/nx-gzip/gunz_test.c
··· 698 698 699 699 switch (cc) { 700 700 701 - case ERR_NX_TRANSLATION: 701 + case ERR_NX_AT_FAULT: 702 702 703 703 /* We touched the pages ahead of time. In the most common case 704 704 * we shouldn't be here. But may be some pages were paged out. 705 705 * Kernel should have placed the faulting address to fsaddr. 706 706 */ 707 - NXPRT(fprintf(stderr, "ERR_NX_TRANSLATION %p\n", 707 + NXPRT(fprintf(stderr, "ERR_NX_AT_FAULT %p\n", 708 708 (void *)cmdp->crb.csb.fsaddr)); 709 709 710 710 if (pgfault_retries == NX_MAX_FAULTS) {
+2 -2
tools/testing/selftests/powerpc/nx-gzip/gzfht_test.c
··· 306 306 lzcounts, cmdp, handle); 307 307 308 308 if (cc != ERR_NX_OK && cc != ERR_NX_TPBC_GT_SPBC && 309 - cc != ERR_NX_TRANSLATION) { 309 + cc != ERR_NX_AT_FAULT) { 310 310 fprintf(stderr, "nx error: cc= %d\n", cc); 311 311 exit(-1); 312 312 } 313 313 314 314 /* Page faults are handled by the user code */ 315 - if (cc == ERR_NX_TRANSLATION) { 315 + if (cc == ERR_NX_AT_FAULT) { 316 316 NXPRT(fprintf(stderr, "page fault: cc= %d, ", cc)); 317 317 NXPRT(fprintf(stderr, "try= %d, fsa= %08llx\n", 318 318 fault_tries,