Skip to content

Commit b84a7c2

Browse files
committed
Merge tag 'powerpc-5.13-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Michael Ellerman: "Fix initrd corruption caused by our recent change to use relative jump labels. Fix a crash using perf record on systems without a hardware PMU backend. Rework our 64-bit signal handling slighty to make it more closely match the old behaviour, after the recent change to use unsafe user accessors. Thanks to Anastasia Kovaleva, Athira Rajeev, Christophe Leroy, Daniel Axtens, Greg Kurz, and Roman Bolshakov" * tag 'powerpc-5.13-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/perf: Fix crash in perf_instruction_pointer() when ppmu is not set powerpc: Fix initrd corruption with relative jump labels powerpc/signal64: Copy siginfo before changing regs->nip powerpc/mem: Add back missing header to fix 'no previous prototype' error
2 parents 913ec3c + 60b7ed5 commit b84a7c2

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

arch/powerpc/include/asm/jump_label.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static __always_inline bool arch_static_branch_jump(struct static_key *key, bool
5050
1098: nop; \
5151
.pushsection __jump_table, "aw"; \
5252
.long 1098b - ., LABEL - .; \
53-
FTR_ENTRY_LONG KEY; \
53+
FTR_ENTRY_LONG KEY - .; \
5454
.popsection
5555
#endif
5656

arch/powerpc/kernel/signal_64.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,10 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
902902
unsafe_copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set), badframe_block);
903903
user_write_access_end();
904904

905+
/* Save the siginfo outside of the unsafe block. */
906+
if (copy_siginfo_to_user(&frame->info, &ksig->info))
907+
goto badframe;
908+
905909
/* Make sure signal handler doesn't get spurious FP exceptions */
906910
tsk->thread.fp_state.fpscr = 0;
907911

@@ -915,11 +919,6 @@ int handle_rt_signal64(struct ksignal *ksig, sigset_t *set,
915919
regs->nip = (unsigned long) &frame->tramp[0];
916920
}
917921

918-
919-
/* Save the siginfo outside of the unsafe block. */
920-
if (copy_siginfo_to_user(&frame->info, &ksig->info))
921-
goto badframe;
922-
923922
/* Allocate a dummy caller frame for the signal handler. */
924923
newsp = ((unsigned long)frame) - __SIGNAL_FRAMESIZE;
925924
err |= put_user(regs->gpr[1], (unsigned long __user *)newsp);

arch/powerpc/mm/mem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/machdep.h>
2121
#include <asm/rtas.h>
2222
#include <asm/kasan.h>
23+
#include <asm/sparsemem.h>
2324
#include <asm/svm.h>
2425

2526
#include <mm/mmu_decl.h>

arch/powerpc/perf/core-book3s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2254,7 +2254,7 @@ unsigned long perf_instruction_pointer(struct pt_regs *regs)
22542254
bool use_siar = regs_use_siar(regs);
22552255
unsigned long siar = mfspr(SPRN_SIAR);
22562256

2257-
if (ppmu->flags & PPMU_P10_DD1) {
2257+
if (ppmu && (ppmu->flags & PPMU_P10_DD1)) {
22582258
if (siar)
22592259
return siar;
22602260
else

0 commit comments

Comments
 (0)