Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"Some more powerpc fixes for 5.12:

- Fix wrong instruction encoding for lis in ppc_function_entry(),
which could potentially lead to missed kprobes.

- Fix SET_FULL_REGS on 32-bit and 64e, which prevented ptrace of
non-volatile GPRs immediately after exec.

- Clean up a missed SRR specifier in the recent interrupt rework.

- Don't treat unrecoverable_exception() as an interrupt handler, it's
called from other handlers so shouldn't do the interrupt entry/exit
accounting itself.

- Fix build errors caused by missing declarations for
[en/dis]able_kernel_vsx().

Thanks to Christophe Leroy, Daniel Axtens, Geert Uytterhoeven, Jiri
Olsa, Naveen N. Rao, and Nicholas Piggin"

* tag 'powerpc-5.12-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/traps: unrecoverable_exception() is not an interrupt handler
powerpc: Fix missing declaration of [en/dis]able_kernel_vsx()
powerpc/64s/exception: Clean up a missed SRR specifier
powerpc: Fix inverted SET_FULL_REGS bitop
powerpc/64s: Use symbolic macros for function entry encoding
powerpc/64s: Fix instruction encoding for lis in ppc_function_entry()

+20 -9
+4 -3
arch/powerpc/include/asm/code-patching.h
··· 73 73 #endif 74 74 75 75 #define OP_RT_RA_MASK 0xffff0000UL 76 - #define LIS_R2 0x3c020000UL 77 - #define ADDIS_R2_R12 0x3c4c0000UL 78 - #define ADDI_R2_R2 0x38420000UL 76 + #define LIS_R2 (PPC_INST_ADDIS | __PPC_RT(R2)) 77 + #define ADDIS_R2_R12 (PPC_INST_ADDIS | __PPC_RT(R2) | __PPC_RA(R12)) 78 + #define ADDI_R2_R2 (PPC_INST_ADDI | __PPC_RT(R2) | __PPC_RA(R2)) 79 + 79 80 80 81 static inline unsigned long ppc_function_entry(void *func) 81 82 {
+2 -1
arch/powerpc/include/asm/interrupt.h
··· 410 410 DECLARE_INTERRUPT_HANDLER(CacheLockingException); 411 411 DECLARE_INTERRUPT_HANDLER(SPEFloatingPointException); 412 412 DECLARE_INTERRUPT_HANDLER(SPEFloatingPointRoundException); 413 - DECLARE_INTERRUPT_HANDLER(unrecoverable_exception); 414 413 DECLARE_INTERRUPT_HANDLER(WatchdogException); 415 414 DECLARE_INTERRUPT_HANDLER(kernel_bad_stack); 416 415 ··· 435 436 DECLARE_INTERRUPT_HANDLER_NMI(hmi_exception_realmode); 436 437 437 438 DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException); 439 + 440 + void unrecoverable_exception(struct pt_regs *regs); 438 441 439 442 void replay_system_reset(void); 440 443 void replay_soft_interrupts(void);
+2 -2
arch/powerpc/include/asm/ptrace.h
··· 195 195 #define TRAP_FLAGS_MASK 0x11 196 196 #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) 197 197 #define FULL_REGS(regs) (((regs)->trap & 1) == 0) 198 - #define SET_FULL_REGS(regs) ((regs)->trap |= 1) 198 + #define SET_FULL_REGS(regs) ((regs)->trap &= ~1) 199 199 #endif 200 200 #define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs)) 201 201 #define NV_REG_POISON 0xdeadbeefdeadbeefUL ··· 210 210 #define TRAP_FLAGS_MASK 0x1F 211 211 #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) 212 212 #define FULL_REGS(regs) (((regs)->trap & 1) == 0) 213 - #define SET_FULL_REGS(regs) ((regs)->trap |= 1) 213 + #define SET_FULL_REGS(regs) ((regs)->trap &= ~1) 214 214 #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) 215 215 #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) 216 216 #define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0)
+10
arch/powerpc/include/asm/switch_to.h
··· 71 71 { 72 72 msr_check_and_clear(MSR_FP|MSR_VEC|MSR_VSX); 73 73 } 74 + #else 75 + static inline void enable_kernel_vsx(void) 76 + { 77 + BUILD_BUG(); 78 + } 79 + 80 + static inline void disable_kernel_vsx(void) 81 + { 82 + BUILD_BUG(); 83 + } 74 84 #endif 75 85 76 86 #ifdef CONFIG_SPE
+1 -1
arch/powerpc/kernel/exceptions-64s.S
··· 466 466 467 467 ld r10,PACAKMSR(r13) /* get MSR value for kernel */ 468 468 /* MSR[RI] is clear iff using SRR regs */ 469 - .if IHSRR == EXC_HV_OR_STD 469 + .if IHSRR_IF_HVMODE 470 470 BEGIN_FTR_SECTION 471 471 xori r10,r10,MSR_RI 472 472 END_FTR_SECTION_IFCLR(CPU_FTR_HVMODE)
-1
arch/powerpc/kernel/interrupt.c
··· 436 436 return ret; 437 437 } 438 438 439 - void unrecoverable_exception(struct pt_regs *regs); 440 439 void preempt_schedule_irq(void); 441 440 442 441 notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr)
+1 -1
arch/powerpc/kernel/traps.c
··· 2170 2170 * in the MSR is 0. This indicates that SRR0/1 are live, and that 2171 2171 * we therefore lost state by taking this exception. 2172 2172 */ 2173 - DEFINE_INTERRUPT_HANDLER(unrecoverable_exception) 2173 + void unrecoverable_exception(struct pt_regs *regs) 2174 2174 { 2175 2175 pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n", 2176 2176 regs->trap, regs->nip, regs->msr);