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

Pull powerpc fixes from Michael Ellerman:
"This is all fairly boring, except that there's two KVM fixes that
you'd normally get via Paul's kvm-ppc tree. He's away so I picked them
up. I was waiting to see if he would apply them, which is why they
have only been in my tree since today. But they were on the list for a
while and have been tested on the relevant hardware.

Of note is two fixes for KVM XIVE (Power9 interrupt controller). These
would normally go via the KVM tree but Paul is away so I've picked
them up.

Other than that, two fixes for error handling in the IMC driver, and
one for a potential oops in the BHRB code if the hardware records a
branch address that has subsequently been unmapped, and finally a
s/%p/%px/ in our oops code.

Thanks to: Anju T Sudhakar, Cédric Le Goater, Laurent Vivier, Madhavan
Srinivasan, Naveen N. Rao, Ravi Bangoria"

* tag 'powerpc-4.15-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
KVM: PPC: Book3S HV: Fix pending_pri value in kvmppc_xive_get_icp()
KVM: PPC: Book3S: fix XIVE migration of pending interrupts
powerpc/kernel: Print actual address of regs when oopsing
powerpc/perf: Fix kfree memory allocated for nest pmus
powerpc/perf/imc: Fix nest-imc cpuhotplug callback failure
powerpc/perf: Dereference BHRB entries safely

+27 -7
+1 -1
arch/powerpc/kernel/process.c
··· 1403 1403 1404 1404 printk("NIP: "REG" LR: "REG" CTR: "REG"\n", 1405 1405 regs->nip, regs->link, regs->ctr); 1406 - printk("REGS: %p TRAP: %04lx %s (%s)\n", 1406 + printk("REGS: %px TRAP: %04lx %s (%s)\n", 1407 1407 regs, regs->trap, print_tainted(), init_utsname()->release); 1408 1408 printk("MSR: "REG" ", regs->msr); 1409 1409 print_msr_bits(regs->msr);
+4 -3
arch/powerpc/kvm/book3s_xive.c
··· 725 725 726 726 /* Return the per-cpu state for state saving/migration */ 727 727 return (u64)xc->cppr << KVM_REG_PPC_ICP_CPPR_SHIFT | 728 - (u64)xc->mfrr << KVM_REG_PPC_ICP_MFRR_SHIFT; 728 + (u64)xc->mfrr << KVM_REG_PPC_ICP_MFRR_SHIFT | 729 + (u64)0xff << KVM_REG_PPC_ICP_PPRI_SHIFT; 729 730 } 730 731 731 732 int kvmppc_xive_set_icp(struct kvm_vcpu *vcpu, u64 icpval) ··· 1559 1558 1560 1559 /* 1561 1560 * Restore P and Q. If the interrupt was pending, we 1562 - * force both P and Q, which will trigger a resend. 1561 + * force Q and !P, which will trigger a resend. 1563 1562 * 1564 1563 * That means that a guest that had both an interrupt 1565 1564 * pending (queued) and Q set will restore with only ··· 1567 1566 * is perfectly fine as coalescing interrupts that haven't 1568 1567 * been presented yet is always allowed. 1569 1568 */ 1570 - if (val & KVM_XICS_PRESENTED || val & KVM_XICS_PENDING) 1569 + if (val & KVM_XICS_PRESENTED && !(val & KVM_XICS_PENDING)) 1571 1570 state->old_p = true; 1572 1571 if (val & KVM_XICS_QUEUED || val & KVM_XICS_PENDING) 1573 1572 state->old_q = true;
+6 -2
arch/powerpc/perf/core-book3s.c
··· 410 410 int ret; 411 411 __u64 target; 412 412 413 - if (is_kernel_addr(addr)) 414 - return branch_target((unsigned int *)addr); 413 + if (is_kernel_addr(addr)) { 414 + if (probe_kernel_read(&instr, (void *)addr, sizeof(instr))) 415 + return 0; 416 + 417 + return branch_target(&instr); 418 + } 415 419 416 420 /* Userspace: need copy instruction here then translate it */ 417 421 pagefault_disable();
+16 -1
arch/powerpc/perf/imc-pmu.c
··· 310 310 return 0; 311 311 312 312 /* 313 + * Check whether nest_imc is registered. We could end up here if the 314 + * cpuhotplug callback registration fails. i.e, callback invokes the 315 + * offline path for all successfully registered nodes. At this stage, 316 + * nest_imc pmu will not be registered and we should return here. 317 + * 318 + * We return with a zero since this is not an offline failure. And 319 + * cpuhp_setup_state() returns the actual failure reason to the caller, 320 + * which in turn will call the cleanup routine. 321 + */ 322 + if (!nest_pmus) 323 + return 0; 324 + 325 + /* 313 326 * Now that this cpu is one of the designated, 314 327 * find a next cpu a) which is online and b) in same chip. 315 328 */ ··· 1184 1171 if (nest_pmus == 1) { 1185 1172 cpuhp_remove_state(CPUHP_AP_PERF_POWERPC_NEST_IMC_ONLINE); 1186 1173 kfree(nest_imc_refc); 1174 + kfree(per_nest_pmu_arr); 1187 1175 } 1188 1176 1189 1177 if (nest_pmus > 0) ··· 1209 1195 kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]->attrs); 1210 1196 kfree(pmu_ptr->attr_groups[IMC_EVENT_ATTR]); 1211 1197 kfree(pmu_ptr); 1212 - kfree(per_nest_pmu_arr); 1213 1198 return; 1214 1199 } 1215 1200 ··· 1322 1309 ret = nest_pmu_cpumask_init(); 1323 1310 if (ret) { 1324 1311 mutex_unlock(&nest_init_lock); 1312 + kfree(nest_imc_refc); 1313 + kfree(per_nest_pmu_arr); 1325 1314 goto err_free; 1326 1315 } 1327 1316 }