Commit 251a94f1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull powerpc fixes from Michael Ellerman:

 - Fix vmemmap altmap boundary check which could cause memory hotunplug
   failure

 - Create a dummy stackframe to fix ftrace stack unwind

 - Fix secondary thread bringup for Book3E ELFv2 kernels

 - Use early_ioremap/unmap() in via_calibrate_decr()

Thanks to Aneesh Kumar K.V, Benjamin Gray, Christophe Leroy, David
Hildenbrand, and Naveen N Rao.

* tag 'powerpc-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/powermac: Use early_* IO variants in via_calibrate_decr()
  powerpc/64e: Fix secondary thread bringup for ELFv2 kernels
  powerpc/ftrace: Create a dummy stackframe to fix stack unwind
  powerpc/mm/altmap: Fix altmap boundary check
parents 947c2a83 86582e61
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -375,8 +375,7 @@ _GLOBAL(generic_secondary_smp_init)
	beq	20f

	/* start the specified thread */
	LOAD_REG_ADDR(r5, fsl_secondary_thread_init)
	ld	r4, 0(r5)
	LOAD_REG_ADDR(r5, DOTSYM(fsl_secondary_thread_init))
	bl	book3e_start_thread

	/* stop the current thread */
+7 −2
Original line number Diff line number Diff line
@@ -33,6 +33,9 @@
 * and then arrange for the ftrace function to be called.
 */
.macro	ftrace_regs_entry allregs
	/* Create a minimal stack frame for representing B */
	PPC_STLU	r1, -STACK_FRAME_MIN_SIZE(r1)

	/* Create our stack frame + pt_regs */
	PPC_STLU	r1,-SWITCH_FRAME_SIZE(r1)

@@ -42,7 +45,7 @@

#ifdef CONFIG_PPC64
	/* Save the original return address in A's stack frame */
	std	r0, LRSAVE+SWITCH_FRAME_SIZE(r1)
	std	r0, LRSAVE+SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE(r1)
	/* Ok to continue? */
	lbz	r3, PACA_FTRACE_ENABLED(r13)
	cmpdi	r3, 0
@@ -77,6 +80,8 @@
	mflr	r7
	/* Save it as pt_regs->nip */
	PPC_STL	r7, _NIP(r1)
	/* Also save it in B's stackframe header for proper unwind */
	PPC_STL	r7, LRSAVE+SWITCH_FRAME_SIZE(r1)
	/* Save the read LR in pt_regs->link */
	PPC_STL	r0, _LINK(r1)

@@ -142,7 +147,7 @@
#endif

	/* Pop our stack frame */
	addi r1, r1, SWITCH_FRAME_SIZE
	addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE

#ifdef CONFIG_LIVEPATCH_64
        /* Based on the cmpd above, if the NIP was altered handle livepatch */
+1 −2
Original line number Diff line number Diff line
@@ -314,8 +314,7 @@ void __ref vmemmap_free(unsigned long start, unsigned long end,
	start = ALIGN_DOWN(start, page_size);
	if (altmap) {
		alt_start = altmap->base_pfn;
		alt_end = altmap->base_pfn + altmap->reserve +
			  altmap->free + altmap->alloc + altmap->align;
		alt_end = altmap->base_pfn + altmap->reserve + altmap->free;
	}

	pr_debug("vmemmap_free %lx...%lx\n", start, end);
+1 −1
Original line number Diff line number Diff line
@@ -180,7 +180,7 @@ static void wake_hw_thread(void *info)
	unsigned long inia;
	int cpu = *(const int *)info;

	inia = *(unsigned long *)fsl_secondary_thread_init;
	inia = ppc_function_entry(fsl_secondary_thread_init);
	book3e_start_thread(cpu_thread_in_core(cpu), inia);
}
#endif
+3 −3
Original line number Diff line number Diff line
@@ -26,8 +26,8 @@
#include <linux/rtc.h>
#include <linux/of_address.h>

#include <asm/early_ioremap.h>
#include <asm/sections.h>
#include <asm/io.h>
#include <asm/machdep.h>
#include <asm/time.h>
#include <asm/nvram.h>
@@ -182,7 +182,7 @@ static int __init via_calibrate_decr(void)
		return 0;
	}
	of_node_put(vias);
	via = ioremap(rsrc.start, resource_size(&rsrc));
	via = early_ioremap(rsrc.start, resource_size(&rsrc));
	if (via == NULL) {
		printk(KERN_ERR "Failed to map VIA for timer calibration !\n");
		return 0;
@@ -207,7 +207,7 @@ static int __init via_calibrate_decr(void)

	ppc_tb_freq = (dstart - dend) * 100 / 6;

	iounmap(via);
	early_iounmap((void *)via, resource_size(&rsrc));

	return 1;
}