Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6918382 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:
 "Fixes marked for stable:
   - fix system reset interrupt winkle wakeups
   - fix setting of AIL in hypervisor mode

  Fixes for code merged this cycle:
   - fix exception vector build with 2.23 era binutils
   - fix missing update of HID register on secondary CPUs

  Other:
   - fix missing pr_cont()s
   - invalidate ERAT on tlbiel for POWER9 DD1"

* tag 'powerpc-4.9-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/mm: Fix missing update of HID register on secondary CPUs
  powerpc/mm/radix: Invalidate ERAT on tlbiel for POWER9 DD1
  powerpc/64: Fix setting of AIL in hypervisor mode
  powerpc/oops: Fix missing pr_cont()s in instruction dump
  powerpc/oops: Fix missing pr_cont()s in show_regs()
  powerpc/oops: Fix missing pr_cont()s in print_msr_bits() et. al.
  powerpc/oops: Fix missing pr_cont()s in show_stack()
  powerpc: Fix exception vector build with 2.23 era binutils
  powerpc/64s: Fix system reset interrupt winkle wakeups
parents 384b0dc4 cac4a185
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@
 */
#define LOAD_HANDLER(reg, label)					\
	ld	reg,PACAKBASE(r13);	/* get high part of &label */	\
	ori	reg,reg,(FIXED_SYMBOL_ABS_ADDR(label))@l;
	ori	reg,reg,FIXED_SYMBOL_ABS_ADDR(label);

#define __LOAD_HANDLER(reg, label)					\
	ld	reg,PACAKBASE(r13);					\
@@ -158,14 +158,17 @@ BEGIN_FTR_SECTION_NESTED(943) \
	std	ra,offset(r13);						\
END_FTR_SECTION_NESTED(ftr,ftr,943)

#define EXCEPTION_PROLOG_0(area)					\
	GET_PACA(r13);							\
#define EXCEPTION_PROLOG_0_PACA(area)					\
	std	r9,area+EX_R9(r13);	/* save r9 */			\
	OPT_GET_SPR(r9, SPRN_PPR, CPU_FTR_HAS_PPR);			\
	HMT_MEDIUM;							\
	std	r10,area+EX_R10(r13);	/* save r10 - r12 */		\
	OPT_GET_SPR(r10, SPRN_CFAR, CPU_FTR_CFAR)

#define EXCEPTION_PROLOG_0(area)					\
	GET_PACA(r13);							\
	EXCEPTION_PROLOG_0_PACA(area)

#define __EXCEPTION_PROLOG_1(area, extra, vec)				\
	OPT_SAVE_REG_TO_PACA(area+EX_PPR, r9, CPU_FTR_HAS_PPR);		\
	OPT_SAVE_REG_TO_PACA(area+EX_CFAR, r10, CPU_FTR_CFAR);		\
@@ -196,6 +199,12 @@ END_FTR_SECTION_NESTED(ftr,ftr,943)
	EXCEPTION_PROLOG_1(area, extra, vec);				\
	EXCEPTION_PROLOG_PSERIES_1(label, h);

/* Have the PACA in r13 already */
#define EXCEPTION_PROLOG_PSERIES_PACA(area, label, h, extra, vec)	\
	EXCEPTION_PROLOG_0_PACA(area);					\
	EXCEPTION_PROLOG_1(area, extra, vec);				\
	EXCEPTION_PROLOG_PSERIES_1(label, h);

#define __KVMTEST(h, n)							\
	lbz	r10,HSTATE_IN_GUEST(r13);				\
	cmpwi	r10,0;							\
+1 −0
Original line number Diff line number Diff line
@@ -460,5 +460,6 @@

#define PPC_SLBIA(IH)	stringify_in_c(.long PPC_INST_SLBIA | \
				       ((IH & 0x7) << 21))
#define PPC_INVALIDATE_ERAT	PPC_SLBIA(7)

#endif /* _ASM_POWERPC_PPC_OPCODE_H */
+8 −3
Original line number Diff line number Diff line
@@ -116,7 +116,9 @@ EXC_VIRT_NONE(0x4000, 0x4100)

EXC_REAL_BEGIN(system_reset, 0x100, 0x200)
	SET_SCRATCH0(r13)
	EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common, EXC_STD,
	GET_PACA(r13)
	clrrdi	r13,r13,1 /* Last bit of HSPRG0 is set if waking from winkle */
	EXCEPTION_PROLOG_PSERIES_PACA(PACA_EXGEN, system_reset_common, EXC_STD,
				 IDLETEST, 0x100)

EXC_REAL_END(system_reset, 0x100, 0x200)
@@ -124,6 +126,9 @@ EXC_VIRT_NONE(0x4100, 0x4200)

#ifdef CONFIG_PPC_P7_NAP
EXC_COMMON_BEGIN(system_reset_idle_common)
BEGIN_FTR_SECTION
	GET_PACA(r13) /* Restore HSPRG0 to get the winkle bit in r13 */
END_FTR_SECTION_IFCLR(CPU_FTR_ARCH_300)
	bl	pnv_restore_hyp_resource

	li	r0,PNV_THREAD_RUNNING
@@ -169,7 +174,7 @@ EXC_REAL_BEGIN(machine_check, 0x200, 0x300)
	SET_SCRATCH0(r13)		/* save r13 */
	/*
	 * Running native on arch 2.06 or later, we may wakeup from winkle
	 * inside machine check. If yes, then last bit of HSPGR0 would be set
	 * inside machine check. If yes, then last bit of HSPRG0 would be set
	 * to 1. Hence clear it unconditionally.
	 */
	GET_PACA(r13)
@@ -388,7 +393,7 @@ EXC_COMMON_BEGIN(machine_check_handle_early)
	/*
	 * Go back to winkle. Please note that this thread was woken up in
	 * machine check from winkle and have not restored the per-subcore
	 * state. Hence before going back to winkle, set last bit of HSPGR0
	 * state. Hence before going back to winkle, set last bit of HSPRG0
	 * to 1. This will make sure that if this thread gets woken up
	 * again at reset vector 0x100 then it will get chance to restore
	 * the subcore state.
+21 −21
Original line number Diff line number Diff line
@@ -1215,7 +1215,7 @@ static void show_instructions(struct pt_regs *regs)
		int instr;

		if (!(i % 8))
			printk("\n");
			pr_cont("\n");

#if !defined(CONFIG_BOOKE)
		/* If executing with the IMMU off, adjust pc rather
@@ -1227,18 +1227,18 @@ static void show_instructions(struct pt_regs *regs)

		if (!__kernel_text_address(pc) ||
		     probe_kernel_address((unsigned int __user *)pc, instr)) {
			printk(KERN_CONT "XXXXXXXX ");
			pr_cont("XXXXXXXX ");
		} else {
			if (regs->nip == pc)
				printk(KERN_CONT "<%08x> ", instr);
				pr_cont("<%08x> ", instr);
			else
				printk(KERN_CONT "%08x ", instr);
				pr_cont("%08x ", instr);
		}

		pc += sizeof(int);
	}

	printk("\n");
	pr_cont("\n");
}

struct regbit {
@@ -1282,7 +1282,7 @@ static void print_bits(unsigned long val, struct regbit *bits, const char *sep)

	for (; bits->bit; ++bits)
		if (val & bits->bit) {
			printk("%s%s", s, bits->name);
			pr_cont("%s%s", s, bits->name);
			s = sep;
		}
}
@@ -1305,9 +1305,9 @@ static void print_tm_bits(unsigned long val)
 *   T: Transactional	(bit 34)
 */
	if (val & (MSR_TM | MSR_TS_S | MSR_TS_T)) {
		printk(",TM[");
		pr_cont(",TM[");
		print_bits(val, msr_tm_bits, "");
		printk("]");
		pr_cont("]");
	}
}
#else
@@ -1316,10 +1316,10 @@ static void print_tm_bits(unsigned long val) {}

static void print_msr_bits(unsigned long val)
{
	printk("<");
	pr_cont("<");
	print_bits(val, msr_bits, ",");
	print_tm_bits(val);
	printk(">");
	pr_cont(">");
}

#ifdef CONFIG_PPC64
@@ -1347,29 +1347,29 @@ void show_regs(struct pt_regs * regs)
	printk("  CR: %08lx  XER: %08lx\n", regs->ccr, regs->xer);
	trap = TRAP(regs);
	if ((regs->trap != 0xc00) && cpu_has_feature(CPU_FTR_CFAR))
		printk("CFAR: "REG" ", regs->orig_gpr3);
		pr_cont("CFAR: "REG" ", regs->orig_gpr3);
	if (trap == 0x200 || trap == 0x300 || trap == 0x600)
#if defined(CONFIG_4xx) || defined(CONFIG_BOOKE)
		printk("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
		pr_cont("DEAR: "REG" ESR: "REG" ", regs->dar, regs->dsisr);
#else
		printk("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
		pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr);
#endif
#ifdef CONFIG_PPC64
	printk("SOFTE: %ld ", regs->softe);
	pr_cont("SOFTE: %ld ", regs->softe);
#endif
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM
	if (MSR_TM_ACTIVE(regs->msr))
		printk("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
		pr_cont("\nPACATMSCRATCH: %016llx ", get_paca()->tm_scratch);
#endif

	for (i = 0;  i < 32;  i++) {
		if ((i % REGS_PER_LINE) == 0)
			printk("\nGPR%02d: ", i);
		printk(REG " ", regs->gpr[i]);
			pr_cont("\nGPR%02d: ", i);
		pr_cont(REG " ", regs->gpr[i]);
		if (i == LAST_VOLATILE && !FULL_REGS(regs))
			break;
	}
	printk("\n");
	pr_cont("\n");
#ifdef CONFIG_KALLSYMS
	/*
	 * Lookup NIP late so we have the best change of getting the
@@ -1900,14 +1900,14 @@ void show_stack(struct task_struct *tsk, unsigned long *stack)
			printk("["REG"] ["REG"] %pS", sp, ip, (void *)ip);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
			if ((ip == rth) && curr_frame >= 0) {
				printk(" (%pS)",
				pr_cont(" (%pS)",
				       (void *)current->ret_stack[curr_frame].ret);
				curr_frame--;
			}
#endif
			if (firstframe)
				printk(" (unreliable)");
			printk("\n");
				pr_cont(" (unreliable)");
			pr_cont("\n");
		}
		firstframe = 0;

+14 −6
Original line number Diff line number Diff line
@@ -226,17 +226,25 @@ static void __init configure_exceptions(void)
		if (firmware_has_feature(FW_FEATURE_OPAL))
			opal_configure_cores();

		/* Enable AIL if supported, and we are in hypervisor mode */
		/* AIL on native is done in cpu_ready_for_interrupts() */
	}
}

static void cpu_ready_for_interrupts(void)
{
	/*
	 * Enable AIL if supported, and we are in hypervisor mode. This
	 * is called once for every processor.
	 *
	 * If we are not in hypervisor mode the job is done once for
	 * the whole partition in configure_exceptions().
	 */
	if (early_cpu_has_feature(CPU_FTR_HVMODE) &&
	    early_cpu_has_feature(CPU_FTR_ARCH_207S)) {
		unsigned long lpcr = mfspr(SPRN_LPCR);
		mtspr(SPRN_LPCR, lpcr | LPCR_AIL_3);
	}
	}
}

static void cpu_ready_for_interrupts(void)
{
	/* Set IR and DR in PACA MSR */
	get_paca()->kernel_msr = MSR_KERNEL;
}
Loading