diff options
Diffstat (limited to 'arch/powerpc/kernel')
43 files changed, 136 insertions, 76 deletions
| diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 91960f83039c..6c6cce937dd8 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  #  # Makefile for the linux kernel.  # diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c index 43ef25156480..3e6c0744c174 100644 --- a/arch/powerpc/kernel/align.c +++ b/arch/powerpc/kernel/align.c @@ -332,7 +332,7 @@ int fix_alignment(struct pt_regs *regs)  	 * when pasting to a co-processor. Furthermore, paste_last is the  	 * synchronisation point for preceding copy/paste sequences.  	 */ -	if ((instr & 0xfc0006fe) == PPC_INST_COPY) +	if ((instr & 0xfc0006fe) == (PPC_INST_COPY & 0xfc0006fe))  		return -EIO;  	r = analyse_instr(&op, regs, instr); diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c index a4dab7cab348..a2dddd7f3d09 100644 --- a/arch/powerpc/kernel/audit.c +++ b/arch/powerpc/kernel/audit.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #include <linux/init.h>  #include <linux/types.h>  #include <linux/audit.h> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c index 3f46ca1c59f9..6537cba1a758 100644 --- a/arch/powerpc/kernel/btext.c +++ b/arch/powerpc/kernel/btext.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Procedures for drawing on the screen early on in the boot process.   * diff --git a/arch/powerpc/kernel/cacheinfo.h b/arch/powerpc/kernel/cacheinfo.h index a7b74d36acd7..955f5e999f1b 100644 --- a/arch/powerpc/kernel/cacheinfo.h +++ b/arch/powerpc/kernel/cacheinfo.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef _PPC_CACHEINFO_H  #define _PPC_CACHEINFO_H diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c index 108ff14e2122..55c6ccda0a85 100644 --- a/arch/powerpc/kernel/compat_audit.c +++ b/arch/powerpc/kernel/compat_audit.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #undef __powerpc64__  #include <asm/unistd.h> diff --git a/arch/powerpc/kernel/dma-iommu.c b/arch/powerpc/kernel/dma-iommu.c index 8f7abf9baa63..66f33e7f8d40 100644 --- a/arch/powerpc/kernel/dma-iommu.c +++ b/arch/powerpc/kernel/dma-iommu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Copyright (C) 2006 Benjamin Herrenschmidt, IBM Corporation   * diff --git a/arch/powerpc/kernel/dt_cpu_ftrs.c b/arch/powerpc/kernel/dt_cpu_ftrs.c index 1df770e8cbe0..7275fed271af 100644 --- a/arch/powerpc/kernel/dt_cpu_ftrs.c +++ b/arch/powerpc/kernel/dt_cpu_ftrs.c @@ -102,10 +102,10 @@ static void cpufeatures_flush_tlb(void)  	case PVR_POWER8:  	case PVR_POWER8E:  	case PVR_POWER8NVL: -		__flush_tlb_power8(POWER8_TLB_SETS); +		__flush_tlb_power8(TLB_INVAL_SCOPE_GLOBAL);  		break;  	case PVR_POWER9: -		__flush_tlb_power9(POWER9_TLB_SETS_HASH); +		__flush_tlb_power9(TLB_INVAL_SCOPE_GLOBAL);  		break;  	default:  		pr_err("unknown CPU version for boot TLB flush\n"); diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 9e816787c0d4..116000b45531 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c @@ -1019,6 +1019,10 @@ int eeh_init(void)  	} else if ((ret = eeh_ops->init()))  		return ret; +	/* Initialize PHB PEs */ +	list_for_each_entry_safe(hose, tmp, &hose_list, list_node) +		eeh_dev_phb_init_dynamic(hose); +  	/* Initialize EEH event */  	ret = eeh_event_init();  	if (ret) diff --git a/arch/powerpc/kernel/eeh_dev.c b/arch/powerpc/kernel/eeh_dev.c index ad04ecd63c20..a34e6912c15e 100644 --- a/arch/powerpc/kernel/eeh_dev.c +++ b/arch/powerpc/kernel/eeh_dev.c @@ -78,21 +78,3 @@ void eeh_dev_phb_init_dynamic(struct pci_controller *phb)  	/* EEH PE for PHB */  	eeh_phb_pe_create(phb);  } - -/** - * eeh_dev_phb_init - Create EEH devices for devices included in existing PHBs - * - * Scan all the existing PHBs and create EEH devices for their OF - * nodes and their children OF nodes - */ -static int __init eeh_dev_phb_init(void) -{ -	struct pci_controller *phb, *tmp; - -	list_for_each_entry_safe(phb, tmp, &hose_list, list_node) -		eeh_dev_phb_init_dynamic(phb); - -	return 0; -} - -core_initcall(eeh_dev_phb_init); diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S index 48da0f5d2f7f..1c80bd292e48 100644 --- a/arch/powerpc/kernel/exceptions-64s.S +++ b/arch/powerpc/kernel/exceptions-64s.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /*   * This file contains the 64-bit "server" PowerPC variant   * of the low level exception handling including exception @@ -734,7 +735,29 @@ EXC_REAL(program_check, 0x700, 0x100)  EXC_VIRT(program_check, 0x4700, 0x100, 0x700)  TRAMP_KVM(PACA_EXGEN, 0x700)  EXC_COMMON_BEGIN(program_check_common) -	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN) +	/* +	 * It's possible to receive a TM Bad Thing type program check with +	 * userspace register values (in particular r1), but with SRR1 reporting +	 * that we came from the kernel. Normally that would confuse the bad +	 * stack logic, and we would report a bad kernel stack pointer. Instead +	 * we switch to the emergency stack if we're taking a TM Bad Thing from +	 * the kernel. +	 */ +	li	r10,MSR_PR		/* Build a mask of MSR_PR ..	*/ +	oris	r10,r10,0x200000@h	/* .. and SRR1_PROGTM		*/ +	and	r10,r10,r12		/* Mask SRR1 with that.		*/ +	srdi	r10,r10,8		/* Shift it so we can compare	*/ +	cmpldi	r10,(0x200000 >> 8)	/* .. with an immediate.	*/ +	bne 1f				/* If != go to normal path.	*/ + +	/* SRR1 had PR=0 and SRR1_PROGTM=1, so use the emergency stack	*/ +	andi.	r10,r12,MSR_PR;		/* Set CR0 correctly for label	*/ +					/* 3 in EXCEPTION_PROLOG_COMMON	*/ +	mr	r10,r1			/* Save r1			*/ +	ld	r1,PACAEMERGSP(r13)	/* Use emergency stack		*/ +	subi	r1,r1,INT_FRAME_SIZE	/* alloc stack frame		*/ +	b 3f				/* Jump into the macro !!	*/ +1:	EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)  	bl	save_nvgprs  	RECONCILE_IRQ_STATE(r10, r11)  	addi	r3,r1,STACK_FRAME_OVERHEAD diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S index 83dd0f6776b3..ea065282b303 100644 --- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /* 1. Find the index of the entry we're executing in */  	bl	invstr				/* Find our address */ diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h index a620203f7de3..d0862a100d29 100644 --- a/arch/powerpc/kernel/head_booke.h +++ b/arch/powerpc/kernel/head_booke.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifndef __HEAD_BOOKE_H__  #define __HEAD_BOOKE_H__ diff --git a/arch/powerpc/kernel/iomap.c b/arch/powerpc/kernel/iomap.c index a1854d1ded8b..aab456ed2a00 100644 --- a/arch/powerpc/kernel/iomap.c +++ b/arch/powerpc/kernel/iomap.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * ppc64 "iomap" interface implementation.   * diff --git a/arch/powerpc/kernel/kprobes.c b/arch/powerpc/kernel/kprobes.c index 367494dc67d9..bebc3007a793 100644 --- a/arch/powerpc/kernel/kprobes.c +++ b/arch/powerpc/kernel/kprobes.c @@ -600,7 +600,12 @@ NOKPROBE_SYMBOL(kprobe_fault_handler);  unsigned long arch_deref_entry_point(void *entry)  { -	return ppc_global_function_entry(entry); +#ifdef PPC64_ELF_ABI_v1 +	if (!kernel_text_address((unsigned long)entry)) +		return ppc_global_function_entry(entry); +	else +#endif +		return (unsigned long)entry;  }  NOKPROBE_SYMBOL(arch_deref_entry_point); diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 5e5a64a8b4e4..33b34a58fc62 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #include <linux/kernel.h>  #include <linux/serial.h>  #include <linux/serial_8250.h> diff --git a/arch/powerpc/kernel/mce_power.c b/arch/powerpc/kernel/mce_power.c index b76ca198e09c..72f153c6f3fa 100644 --- a/arch/powerpc/kernel/mce_power.c +++ b/arch/powerpc/kernel/mce_power.c @@ -624,5 +624,18 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs)  long __machine_check_early_realmode_p9(struct pt_regs *regs)  { +	/* +	 * On POWER9 DD2.1 and below, it's possible to get a machine check +	 * caused by a paste instruction where only DSISR bit 25 is set. This +	 * will result in the MCE handler seeing an unknown event and the kernel +	 * crashing. An MCE that occurs like this is spurious, so we don't need +	 * to do anything in terms of servicing it. If there is something that +	 * needs to be serviced, the CPU will raise the MCE again with the +	 * correct DSISR so that it can be serviced properly. So detect this +	 * case and mark it as handled. +	 */ +	if (SRR1_MC_LOADSTORE(regs->msr) && regs->dsisr == 0x02000000) +		return 1; +  	return mce_handle_error(regs, mce_p9_derror_table, mce_p9_ierror_table);  } diff --git a/arch/powerpc/kernel/optprobes.c b/arch/powerpc/kernel/optprobes.c index 6f8273f5e988..91e037ab20a1 100644 --- a/arch/powerpc/kernel/optprobes.c +++ b/arch/powerpc/kernel/optprobes.c @@ -104,8 +104,10 @@ static unsigned long can_optimize(struct kprobe *p)  	 * and that can be emulated.  	 */  	if (!is_conditional_branch(*p->ainsn.insn) && -			analyse_instr(&op, ®s, *p->ainsn.insn)) +			analyse_instr(&op, ®s, *p->ainsn.insn) == 1) { +		emulate_update_regs(®s, &op);  		nip = regs.nip; +	}  	return nip;  } diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c index 6295e646f78c..9cb7f88df563 100644 --- a/arch/powerpc/kernel/prom_parse.c +++ b/arch/powerpc/kernel/prom_parse.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #undef DEBUG  #include <linux/kernel.h> diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 07cd22e35405..f52ad5bb7109 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -131,7 +131,7 @@ static void flush_tmregs_to_thread(struct task_struct *tsk)  	 * in the appropriate thread structures from live.  	 */ -	if (tsk != current) +	if ((!cpu_has_feature(CPU_FTR_TM)) || (tsk != current))  		return;  	if (MSR_TM_SUSPENDED(mfmsr())) { diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c index df56dfc4b681..c8c5f3a550c2 100644 --- a/arch/powerpc/kernel/rtas-proc.c +++ b/arch/powerpc/kernel/rtas-proc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   *   Copyright (C) 2000 Tilmann Bitterberg diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c index c57c19358a26..49600985c7ef 100644 --- a/arch/powerpc/kernel/rtas-rtc.c +++ b/arch/powerpc/kernel/rtas-rtc.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  #include <linux/kernel.h>  #include <linux/time.h>  #include <linux/timer.h> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c index 0ac741fae90e..2e3bc16d02b2 100644 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@ -904,9 +904,6 @@ void __init setup_arch(char **cmdline_p)  #endif  #endif -#ifdef CONFIG_PPC_64K_PAGES -	init_mm.context.pte_frag = NULL; -#endif  #ifdef CONFIG_SPAPR_TCE_IOMMU  	mm_iommu_init(&init_mm);  #endif diff --git a/arch/powerpc/kernel/signal_64.c b/arch/powerpc/kernel/signal_64.c index c83c115858c1..b2c002993d78 100644 --- a/arch/powerpc/kernel/signal_64.c +++ b/arch/powerpc/kernel/signal_64.c @@ -452,9 +452,20 @@ static long restore_tm_sigcontexts(struct task_struct *tsk,  	if (MSR_TM_RESV(msr))  		return -EINVAL; -	/* pull in MSR TM from user context */ +	/* pull in MSR TS bits from user context */  	regs->msr = (regs->msr & ~MSR_TS_MASK) | (msr & MSR_TS_MASK); +	/* +	 * Ensure that TM is enabled in regs->msr before we leave the signal +	 * handler. It could be the case that (a) user disabled the TM bit +	 * through the manipulation of the MSR bits in uc_mcontext or (b) the +	 * TM bit was disabled because a sufficient number of context switches +	 * happened whilst in the signal handler and load_tm overflowed, +	 * disabling the TM bit. In either case we can end up with an illegal +	 * TM state leading to a TM Bad Thing when we return to userspace. +	 */ +	regs->msr |= MSR_TM; +  	/* pull in MSR LE from user context */  	regs->msr = (regs->msr & ~MSR_LE) | (msr & MSR_LE); diff --git a/arch/powerpc/kernel/smp-tbsync.c b/arch/powerpc/kernel/smp-tbsync.c index 7a37ecd3afa3..21c39355b25e 100644 --- a/arch/powerpc/kernel/smp-tbsync.c +++ b/arch/powerpc/kernel/smp-tbsync.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Smp timebase synchronization for ppc.   * diff --git a/arch/powerpc/kernel/swsusp_32.S b/arch/powerpc/kernel/swsusp_32.S index ba4dee3d233f..34b73a262709 100644 --- a/arch/powerpc/kernel/swsusp_32.S +++ b/arch/powerpc/kernel/swsusp_32.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #include <linux/threads.h>  #include <asm/processor.h>  #include <asm/page.h> diff --git a/arch/powerpc/kernel/swsusp_booke.S b/arch/powerpc/kernel/swsusp_booke.S index 553c1405ee05..88cfdbd530f1 100644 --- a/arch/powerpc/kernel/swsusp_booke.S +++ b/arch/powerpc/kernel/swsusp_booke.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /*   * Based on swsusp_32.S, modified for FSL BookE by   * Anton Vorontsov <[email protected]> diff --git a/arch/powerpc/kernel/tau_6xx.c b/arch/powerpc/kernel/tau_6xx.c index a753b72efbc0..a3374e8a258c 100644 --- a/arch/powerpc/kernel/tau_6xx.c +++ b/arch/powerpc/kernel/tau_6xx.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * temp.c	Thermal management for cpu's with Thermal Assist Units   * diff --git a/arch/powerpc/kernel/tm.S b/arch/powerpc/kernel/tm.S index c4ba37822ba0..1da12f521cb7 100644 --- a/arch/powerpc/kernel/tm.S +++ b/arch/powerpc/kernel/tm.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /*   * Transactional memory support routines to reclaim and recheckpoint   * transactional process state. diff --git a/arch/powerpc/kernel/trace/Makefile b/arch/powerpc/kernel/trace/Makefile index 729dffc5f7bc..d22d8bafb643 100644 --- a/arch/powerpc/kernel/trace/Makefile +++ b/arch/powerpc/kernel/trace/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  #  # Makefile for the powerpc trace subsystem  # diff --git a/arch/powerpc/kernel/trace/ftrace.c b/arch/powerpc/kernel/trace/ftrace.c index 32509de6ce4c..4741fe112f05 100644 --- a/arch/powerpc/kernel/trace/ftrace.c +++ b/arch/powerpc/kernel/trace/ftrace.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Code for replacing ftrace calls with jumps.   * diff --git a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S index c98e90b4ea7b..b4e2b7165f79 100644 --- a/arch/powerpc/kernel/trace/ftrace_64_mprofile.S +++ b/arch/powerpc/kernel/trace/ftrace_64_mprofile.S @@ -181,34 +181,25 @@ _GLOBAL(ftrace_stub)  	 *  - we have no stack frame and can not allocate one  	 *  - LR points back to the original caller (in A)  	 *  - CTR holds the new NIP in C -	 *  - r0 & r12 are free -	 * -	 * r0 can't be used as the base register for a DS-form load or store, so -	 * we temporarily shuffle r1 (stack pointer) into r0 and then put it back. +	 *  - r0, r11 & r12 are free  	 */  livepatch_handler:  	CURRENT_THREAD_INFO(r12, r1) -	/* Save stack pointer into r0 */ -	mr	r0, r1 -  	/* Allocate 3 x 8 bytes */ -	ld	r1, TI_livepatch_sp(r12) -	addi	r1, r1, 24 -	std	r1, TI_livepatch_sp(r12) +	ld	r11, TI_livepatch_sp(r12) +	addi	r11, r11, 24 +	std	r11, TI_livepatch_sp(r12)  	/* Save toc & real LR on livepatch stack */ -	std	r2,  -24(r1) +	std	r2,  -24(r11)  	mflr	r12 -	std	r12, -16(r1) +	std	r12, -16(r11)  	/* Store stack end marker */  	lis     r12, STACK_END_MAGIC@h  	ori     r12, r12, STACK_END_MAGIC@l -	std	r12, -8(r1) - -	/* Restore real stack pointer */ -	mr	r1, r0 +	std	r12, -8(r11)  	/* Put ctr in r12 for global entry and branch there */  	mfctr	r12 @@ -216,36 +207,30 @@ livepatch_handler:  	/*  	 * Now we are returning from the patched function to the original -	 * caller A. We are free to use r0 and r12, and we can use r2 until we +	 * caller A. We are free to use r11, r12 and we can use r2 until we  	 * restore it.  	 */  	CURRENT_THREAD_INFO(r12, r1) -	/* Save stack pointer into r0 */ -	mr	r0, r1 - -	ld	r1, TI_livepatch_sp(r12) +	ld	r11, TI_livepatch_sp(r12)  	/* Check stack marker hasn't been trashed */  	lis     r2,  STACK_END_MAGIC@h  	ori     r2,  r2, STACK_END_MAGIC@l -	ld	r12, -8(r1) +	ld	r12, -8(r11)  1:	tdne	r12, r2  	EMIT_BUG_ENTRY 1b, __FILE__, __LINE__ - 1, 0  	/* Restore LR & toc from livepatch stack */ -	ld	r12, -16(r1) +	ld	r12, -16(r11)  	mtlr	r12 -	ld	r2,  -24(r1) +	ld	r2,  -24(r11)  	/* Pop livepatch stack frame */ -	CURRENT_THREAD_INFO(r12, r0) -	subi	r1, r1, 24 -	std	r1, TI_livepatch_sp(r12) - -	/* Restore real stack pointer */ -	mr	r1, r0 +	CURRENT_THREAD_INFO(r12, r1) +	subi	r11, r11, 24 +	std	r11, TI_livepatch_sp(r12)  	/* Return to original caller of live patched function */  	blr diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index ec74e203ee04..13c9dcdcba69 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -437,6 +437,7 @@ static inline int check_io_access(struct pt_regs *regs)  int machine_check_e500mc(struct pt_regs *regs)  {  	unsigned long mcsr = mfspr(SPRN_MCSR); +	unsigned long pvr = mfspr(SPRN_PVR);  	unsigned long reason = mcsr;  	int recoverable = 1; @@ -478,8 +479,15 @@ int machine_check_e500mc(struct pt_regs *regs)  		 * may still get logged and cause a machine check.  We should  		 * only treat the non-write shadow case as non-recoverable.  		 */ -		if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS)) -			recoverable = 0; +		/* On e6500 core, L1 DCWS (Data cache write shadow mode) bit +		 * is not implemented but L1 data cache always runs in write +		 * shadow mode. Hence on data cache parity errors HW will +		 * automatically invalidate the L1 Data Cache. +		 */ +		if (PVR_VER(pvr) != PVR_VER_E6500) { +			if (!(mfspr(SPRN_L1CSR2) & L1CSR2_DCWS)) +				recoverable = 0; +		}  	}  	if (reason & MCSR_L2MMU_MHIT) { diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile index 78a7449bf489..b8c434d1d459 100644 --- a/arch/powerpc/kernel/vdso32/Makefile +++ b/arch/powerpc/kernel/vdso32/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  # List of files in the vdso, has to be asm only for now diff --git a/arch/powerpc/kernel/vdso32/vdso32.lds.S b/arch/powerpc/kernel/vdso32/vdso32.lds.S index e58ee10fa5c0..099a6db14e67 100644 --- a/arch/powerpc/kernel/vdso32/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso32/vdso32.lds.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /*   * This is the infamous ld script for the 32 bits vdso   * library diff --git a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S index 6ac107ac402a..3f5ef035b0a9 100644 --- a/arch/powerpc/kernel/vdso32/vdso32_wrapper.S +++ b/arch/powerpc/kernel/vdso32/vdso32_wrapper.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #include <linux/linkage.h>  #include <asm/page.h> diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile index 31107bf5a61f..69cecb346269 100644 --- a/arch/powerpc/kernel/vdso64/Makefile +++ b/arch/powerpc/kernel/vdso64/Makefile @@ -1,3 +1,4 @@ +# SPDX-License-Identifier: GPL-2.0  # List of files in the vdso, has to be asm only for now  obj-vdso64 = sigtramp.o gettimeofday.o datapage.o cacheflush.o note.o getcpu.o diff --git a/arch/powerpc/kernel/vdso64/vdso64.lds.S b/arch/powerpc/kernel/vdso64/vdso64.lds.S index 64fb183a47c2..256fb9720298 100644 --- a/arch/powerpc/kernel/vdso64/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso64/vdso64.lds.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  /*   * This is the infamous ld script for the 64 bits vdso   * library diff --git a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S index df60fca6a13d..1d56d81fe3b3 100644 --- a/arch/powerpc/kernel/vdso64/vdso64_wrapper.S +++ b/arch/powerpc/kernel/vdso64/vdso64_wrapper.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #include <linux/linkage.h>  #include <asm/page.h> diff --git a/arch/powerpc/kernel/vecemu.c b/arch/powerpc/kernel/vecemu.c index 2d8f6d8ccafc..8812085883fd 100644 --- a/arch/powerpc/kernel/vecemu.c +++ b/arch/powerpc/kernel/vecemu.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Routines to emulate some Altivec/VMX instructions, specifically   * those that can trap when given denormalized operands in Java mode. diff --git a/arch/powerpc/kernel/vector.S b/arch/powerpc/kernel/vector.S index 0c123f3406cd..f314fd475491 100644 --- a/arch/powerpc/kernel/vector.S +++ b/arch/powerpc/kernel/vector.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #include <asm/processor.h>  #include <asm/ppc_asm.h>  #include <asm/reg.h> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index 882628fa6987..0494e1566ee2 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */  #ifdef CONFIG_PPC64  #define PROVIDE32(x)	PROVIDE(__unused__##x)  #else diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c index 2f6eadd9408d..57190f384f63 100644 --- a/arch/powerpc/kernel/watchdog.c +++ b/arch/powerpc/kernel/watchdog.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0  /*   * Watchdog support on powerpc systems.   * @@ -310,9 +311,6 @@ static int start_wd_on_cpu(unsigned int cpu)  	if (!(watchdog_enabled & NMI_WATCHDOG_ENABLED))  		return 0; -	if (watchdog_suspended) -		return 0; -  	if (!cpumask_test_cpu(cpu, &watchdog_cpumask))  		return 0; @@ -358,36 +356,39 @@ static void watchdog_calc_timeouts(void)  	wd_timer_period_ms = watchdog_thresh * 1000 * 2 / 5;  } -void watchdog_nmi_reconfigure(void) +void watchdog_nmi_stop(void)  {  	int cpu; -	watchdog_calc_timeouts(); -  	for_each_cpu(cpu, &wd_cpus_enabled)  		stop_wd_on_cpu(cpu); +} +void watchdog_nmi_start(void) +{ +	int cpu; + +	watchdog_calc_timeouts();  	for_each_cpu_and(cpu, cpu_online_mask, &watchdog_cpumask)  		start_wd_on_cpu(cpu);  }  /* - * This runs after lockup_detector_init() which sets up watchdog_cpumask. + * Invoked from core watchdog init.   */ -static int __init powerpc_watchdog_init(void) +int __init watchdog_nmi_probe(void)  {  	int err; -	watchdog_calc_timeouts(); - -	err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "powerpc/watchdog:online", -				start_wd_on_cpu, stop_wd_on_cpu); -	if (err < 0) +	err = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, +					"powerpc/watchdog:online", +					start_wd_on_cpu, stop_wd_on_cpu); +	if (err < 0) {  		pr_warn("Watchdog could not be initialized"); - +		return err; +	}  	return 0;  } -arch_initcall(powerpc_watchdog_init);  static void handle_backtrace_ipi(struct pt_regs *regs)  { |