Skip to content

Commit 645a4f1

Browse files
committed
Automatic merge of 'fixes' into merge (2023-08-01 11:03)
2 parents 2b51c52 + 41a506e commit 645a4f1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

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);

0 commit comments

Comments
 (0)