Skip to content

Commit 1249b57

Browse files
committed
Merge tag 'powerpc-4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Nine small fixes, really nothing that stands out. A work-around for a spurious MCE on Power9. A CXL fault handling fix, some fixes to the new XIVE code, and a fix to the new 32-bit STRICT_KERNEL_RWX code. Fixes for old code/stable: an fix to an incorrect TLB flush on boot but not on any current machines, a compile error on 4xx and a fix to memory hotplug when using radix (Power9). Thanks to: Anton Blanchard, Cédric Le Goater, Christian Lamparter, Christophe Leroy, Christophe Lombard, Guenter Roeck, Jeremy Kerr, Michael Neuling, Nicholas Piggin" * tag 'powerpc-4.14-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/powernv: Increase memory block size to 1GB on radix powerpc/mm: Call flush_tlb_kernel_range with interrupts enabled powerpc/xive: Clear XIVE internal structures when a CPU is removed powerpc/xive: Fix IPI reset powerpc/4xx: Fix compile error with 64K pages on 40x, 44x powerpc: Fix action argument for cpufeatures-based TLB flush cxl: Fix memory page not handled powerpc: Fix workaround for spurious MCE on POWER9 powerpc: Handle MCE on POWER9 with only DSISR bit 30 set
2 parents 9c0c1ad + 53ecde0 commit 1249b57

File tree

8 files changed

+48
-9
lines changed

8 files changed

+48
-9
lines changed

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ static void cpufeatures_flush_tlb(void)
102102
case PVR_POWER8:
103103
case PVR_POWER8E:
104104
case PVR_POWER8NVL:
105-
__flush_tlb_power8(POWER8_TLB_SETS);
105+
__flush_tlb_power8(TLB_INVAL_SCOPE_GLOBAL);
106106
break;
107107
case PVR_POWER9:
108-
__flush_tlb_power9(POWER9_TLB_SETS_HASH);
108+
__flush_tlb_power9(TLB_INVAL_SCOPE_GLOBAL);
109109
break;
110110
default:
111111
pr_err("unknown CPU version for boot TLB flush\n");

arch/powerpc/kernel/mce_power.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,5 +624,18 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs)
624624

625625
long __machine_check_early_realmode_p9(struct pt_regs *regs)
626626
{
627+
/*
628+
* On POWER9 DD2.1 and below, it's possible to get a machine check
629+
* caused by a paste instruction where only DSISR bit 25 is set. This
630+
* will result in the MCE handler seeing an unknown event and the kernel
631+
* crashing. An MCE that occurs like this is spurious, so we don't need
632+
* to do anything in terms of servicing it. If there is something that
633+
* needs to be serviced, the CPU will raise the MCE again with the
634+
* correct DSISR so that it can be serviced properly. So detect this
635+
* case and mark it as handled.
636+
*/
637+
if (SRR1_MC_LOADSTORE(regs->msr) && regs->dsisr == 0x02000000)
638+
return 1;
639+
627640
return mce_handle_error(regs, mce_p9_derror_table, mce_p9_ierror_table);
628641
}

arch/powerpc/kernel/setup-common.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,6 @@ void __init setup_arch(char **cmdline_p)
904904
#endif
905905
#endif
906906

907-
#ifdef CONFIG_PPC_64K_PAGES
908-
init_mm.context.pte_frag = NULL;
909-
#endif
910907
#ifdef CONFIG_SPAPR_TCE_IOMMU
911908
mm_iommu_init(&init_mm);
912909
#endif

arch/powerpc/mm/pgtable_32.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ static int change_page_attr(struct page *page, int numpages, pgprot_t prot)
361361
break;
362362
}
363363
wmb();
364+
local_irq_restore(flags);
364365
flush_tlb_kernel_range((unsigned long)page_address(start),
365366
(unsigned long)page_address(page));
366-
local_irq_restore(flags);
367367
return err;
368368
}
369369

arch/powerpc/platforms/powernv/setup.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,15 @@ static void pnv_kexec_cpu_down(int crash_shutdown, int secondary)
272272
#ifdef CONFIG_MEMORY_HOTPLUG_SPARSE
273273
static unsigned long pnv_memory_block_size(void)
274274
{
275-
return 256UL * 1024 * 1024;
275+
/*
276+
* We map the kernel linear region with 1GB large pages on radix. For
277+
* memory hot unplug to work our memory block size must be at least
278+
* this size.
279+
*/
280+
if (radix_enabled())
281+
return 1UL * 1024 * 1024 * 1024;
282+
else
283+
return 256UL * 1024 * 1024;
276284
}
277285
#endif
278286

arch/powerpc/sysdev/xive/common.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1402,6 +1402,14 @@ void xive_teardown_cpu(void)
14021402

14031403
if (xive_ops->teardown_cpu)
14041404
xive_ops->teardown_cpu(cpu, xc);
1405+
1406+
#ifdef CONFIG_SMP
1407+
/* Get rid of IPI */
1408+
xive_cleanup_cpu_ipi(cpu, xc);
1409+
#endif
1410+
1411+
/* Disable and free the queues */
1412+
xive_cleanup_cpu_queues(cpu, xc);
14051413
}
14061414

14071415
void xive_kexec_teardown_cpu(int secondary)

arch/powerpc/sysdev/xive/spapr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,11 @@ static int xive_spapr_get_ipi(unsigned int cpu, struct xive_cpu *xc)
431431

432432
static void xive_spapr_put_ipi(unsigned int cpu, struct xive_cpu *xc)
433433
{
434+
if (!xc->hw_ipi)
435+
return;
436+
434437
xive_irq_bitmap_free(xc->hw_ipi);
438+
xc->hw_ipi = 0;
435439
}
436440
#endif /* CONFIG_SMP */
437441

drivers/misc/cxl/cxllib.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,17 @@ int cxllib_handle_fault(struct mm_struct *mm, u64 addr, u64 size, u64 flags)
219219

220220
down_read(&mm->mmap_sem);
221221

222-
for (dar = addr; dar < addr + size; dar += page_size) {
223-
if (!vma || dar < vma->vm_start || dar > vma->vm_end) {
222+
vma = find_vma(mm, addr);
223+
if (!vma) {
224+
pr_err("Can't find vma for addr %016llx\n", addr);
225+
rc = -EFAULT;
226+
goto out;
227+
}
228+
/* get the size of the pages allocated */
229+
page_size = vma_kernel_pagesize(vma);
230+
231+
for (dar = (addr & ~(page_size - 1)); dar < (addr + size); dar += page_size) {
232+
if (dar < vma->vm_start || dar >= vma->vm_end) {
224233
vma = find_vma(mm, addr);
225234
if (!vma) {
226235
pr_err("Can't find vma for addr %016llx\n", addr);

0 commit comments

Comments
 (0)