powerpc/pmu/fsl: fix is_nmi test for irq mask change
Nicholas Piggin
reviewerPATCH 1/2 powerpc/pmu/fsl: fix is_nmi test for irq mask change
When soft enabled was changed to irq disabled mask, this test missed being converted (although the equivalent book3s test was converted).
The PMU drivers consider it an NMI when they take a PMI while general interrupts are disabled. This change restores that behaviour.
--- arch/powerpc/perf/core-fsl-emb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/perf/core-fsl-emb.c +1 -1
@@ -42,7 +42,7 @@ static DEFINE_MUTEX(pmc_reserve_mutex);static inline int perf_intr_is_nmi (struct pt_regs *regs) {#ifdef __powerpc64__ -return !regs->softe; +return (regs->softe &IRQS_DISABLED );#else return 0 ;#endif
Signature · 1 line
2.17.0
Nicholas Piggin
reviewerPATCH 2/2 powerpc/64: change softe to irqmask in show_regs and xmon
When the soft enabled flag was changed to a soft disable mask, xmon and register dump code was not updated to reflect that, which is confusing ('SOFTE: 1' previously meant interrupts were soft enabled, currently it means the opposite, the general interrupt type has been disabled).
Fix this by using the name irqmask, and printing it in hex.
--- arch/powerpc/kernel/process.c | 2 +- arch/powerpc/xmon/xmon.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/kernel/process.c +1 -1
@@ -1437,7 +1437,7 @@ void show_regs(struct pt_regs * regs)pr_cont ("DAR: " REG " DSISR: %08lx " , regs->dar, regs->dsisr);#endif #ifdef CONFIG_PPC64 -pr_cont ("SOFTE: %ld " , regs->softe); +pr_cont ("IRQMASK: %lx " , regs->softe);#endif #ifdef CONFIG_PPC_TRANSACTIONAL_MEM if (MSR_TM_ACTIVE (regs->msr))
arch/powerpc/xmon/xmon.c +1 -1
@@ -1636,7 +1636,7 @@ static void excprint(struct pt_regs *fp)printf (" current = 0x%lx\n" , current);#ifdef CONFIG_PPC64 -printf (" paca = 0x%lx\t softe: %d\t irq_happened: 0x%02x\n" , +printf (" paca = 0x%lx\t irqmask: 0x%02x\t irq_happened: 0x%02x\n" , local_paca, local_paca->irq_soft_mask, local_paca->irq_happened);#endif if (current) {
Signature · 1 line
2.17.0
Re: [PATCH 2/2] powerpc/64: change softe to irqmask in show_regs and xmon
Quoted 10 lines · Nicholas Piggin
When the soft enabled flag was changed to a soft disable mask, xmon and register dump code was not updated to reflect that, which is confusing ('SOFTE: 1' previously meant interrupts were soft enabled, currently it means the opposite, the general interrupt type has been disabled).
Fix this by using the name irqmask, and printing it in hex.
Signed-off-by Nicholas Piggin <[email protected]>
Quoted 5 lines · Nicholas Piggin
When soft enabled was changed to irq disabled mask, this test missed being converted (although the equivalent book3s test was converted).
The PMU drivers consider it an NMI when they take a PMI while general interrupts are disabled. This change restores that behaviour.
Looks fine to me.
Quoted 19 lines
Fixes 01417c6cc7 ("powerpc/64: Change soft_enabled from flag to bitmask")Signed-off-by Nicholas Piggin <[email protected]>--- arch/powerpc/perf/core-fsl-emb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/powerpc/perf/core-fsl-emb.c +1
-1@@ -42,7 +42,7 @@ static DEFINE_MUTEX(pmc_reserve_mutex);static inline int perf_intr_is_nmi (struct pt_regs *regs) {#ifdef __powerpc64__ -return !regs->softe; +return (regs->softe &IRQS_DISABLED );#else return 0 ;#endif
Quoted 9 lines · Nicholas Piggin
When soft enabled was changed to irq disabled mask, this test missed being converted (although the equivalent book3s test was converted).
The PMU drivers consider it an NMI when they take a PMI while general interrupts are disabled. This change restores that behaviour.
Fixes 01417c6cc7 ("powerpc/64: Change soft_enabled from flag to bitmask")Signed-off-by Nicholas Piggin <[email protected]>Reviewed-by Madhavan Srinivasan <[email protected]>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/81ea11d3af3aba0bea475dd1dd2f79
cheers