Skip to content

Commit 251a94f

Browse files
committed
Merge tag 'powerpc-6.5-5' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
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
2 parents 947c2a8 + 86582e6 commit 251a94f

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

arch/powerpc/kernel/head_64.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,7 @@ _GLOBAL(generic_secondary_smp_init)
375375
beq 20f
376376

377377
/* start the specified thread */
378-
LOAD_REG_ADDR(r5, fsl_secondary_thread_init)
379-
ld r4, 0(r5)
378+
LOAD_REG_ADDR(r5, DOTSYM(fsl_secondary_thread_init))
380379
bl book3e_start_thread
381380

382381
/* stop the current thread */

arch/powerpc/kernel/trace/ftrace_mprofile.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
* and then arrange for the ftrace function to be called.
3434
*/
3535
.macro ftrace_regs_entry allregs
36+
/* Create a minimal stack frame for representing B */
37+
PPC_STLU r1, -STACK_FRAME_MIN_SIZE(r1)
38+
3639
/* Create our stack frame + pt_regs */
3740
PPC_STLU r1,-SWITCH_FRAME_SIZE(r1)
3841

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

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

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

144149
/* Pop our stack frame */
145-
addi r1, r1, SWITCH_FRAME_SIZE
150+
addi r1, r1, SWITCH_FRAME_SIZE+STACK_FRAME_MIN_SIZE
146151

147152
#ifdef CONFIG_LIVEPATCH_64
148153
/* Based on the cmpd above, if the NIP was altered handle livepatch */

arch/powerpc/mm/init_64.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ void __ref vmemmap_free(unsigned long start, unsigned long end,
314314
start = ALIGN_DOWN(start, page_size);
315315
if (altmap) {
316316
alt_start = altmap->base_pfn;
317-
alt_end = altmap->base_pfn + altmap->reserve +
318-
altmap->free + altmap->alloc + altmap->align;
317+
alt_end = altmap->base_pfn + altmap->reserve + altmap->free;
319318
}
320319

321320
pr_debug("vmemmap_free %lx...%lx\n", start, end);

arch/powerpc/platforms/85xx/smp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static void wake_hw_thread(void *info)
180180
unsigned long inia;
181181
int cpu = *(const int *)info;
182182

183-
inia = *(unsigned long *)fsl_secondary_thread_init;
183+
inia = ppc_function_entry(fsl_secondary_thread_init);
184184
book3e_start_thread(cpu_thread_in_core(cpu), inia);
185185
}
186186
#endif

arch/powerpc/platforms/powermac/time.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
#include <linux/rtc.h>
2727
#include <linux/of_address.h>
2828

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

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

210-
iounmap(via);
210+
early_iounmap((void *)via, resource_size(&rsrc));
211211

212212
return 1;
213213
}

0 commit comments

Comments
 (0)