Nicholas Piggin
4ec5feec1a
powerpc/64s: Make NMI record implicitly soft-masked code as irqs disabled
scv support introduced the notion of code that implicitly soft-masks
irqs due to the instruction addresses. This is required because scv
enters the kernel with MSR[EE]=1.
If a NMI (including soft-NMI) interrupt hits when we are implicitly
soft-masked then its regs->softe does not reflect this because it is
derived from the explicit soft mask state (paca->irq_soft_mask). This
makes arch_irq_disabled_regs(regs) return false.
This can trigger a warning in the soft-NMI watchdog code (shown below).
Fix it by having NMI interrupts set regs->softe to disabled in case of
interrupting an implicit soft-masked region.
------------[ cut here ]------------
WARNING: CPU: 41 PID: 1103 at arch/powerpc/kernel/watchdog.c:259 soft_nmi_interrupt+0x3e4/0x5f0
CPU: 41 PID: 1103 Comm: (spawn) Not tainted
NIP: c000000000039534 LR: c000000000039234 CTR: c000000000009a00
REGS: c000007fffbcf940 TRAP: 0700 Not tainted
MSR: 9000000000021033 <SF,HV,ME,IR,DR,RI,LE> CR: 22042482 XER: 200400ad
CFAR: c000000000039260 IRQMASK: 3
GPR00: c000000000039204 c000007fffbcfbe0 c000000001d6c300 0000000000000003
GPR04: 00007ffffa45d078 0000000000000000 0000000000000008 0000000000000020
GPR08: 0000007ffd4e0000 0000000000000000 c000007ffffceb00 7265677368657265
GPR12: 9000000000009033 c000007ffffceb00 00000f7075bf4480 000000000000002a
GPR16: 00000f705745a528 00007ffffa45ddd8 00000f70574d0008 0000000000000000
GPR20: 00000f7075c58d70 00000f7057459c38 0000000000000001 0000000000000040
GPR24: 0000000000000000 0000000000000029 c000000001dae058 0000000000000029
GPR28: 0000000000000000 0000000000000800 0000000000000009 c000007fffbcfd60
NIP [c000000000039534] soft_nmi_interrupt+0x3e4/0x5f0
LR [c000000000039234] soft_nmi_interrupt+0xe4/0x5f0
Call Trace:
[c000007fffbcfbe0] [c000000000039204] soft_nmi_interrupt+0xb4/0x5f0 (unreliable)
[c000007fffbcfcf0] [c00000000000c0e8] soft_nmi_common+0x138/0x1c4
--- interrupt: 900 at end_real_trampolines+0x0/0x1000
NIP: c000000000003000 LR: 00007ca426adb03c CTR: 900000000280f033
REGS: c000007fffbcfd60 TRAP: 0900
MSR: 9000000000009033 <SF,HV,EE,ME,IR,DR,RI,LE> CR: 44042482 XER: 200400ad
CFAR: 00007ca426946020 IRQMASK: 0
GPR00: 00000000000000ad 00007ffffa45d050 00007ca426b07f00 0000000000000035
GPR04: 00007ffffa45d078 0000000000000000 0000000000000008 0000000000000020
GPR08: 0000000000000000 0000000000100000 0000000010000000 00007ffffa45d110
GPR12: 0000000000000001 00007ca426d4e680 00000f7075bf4480 000000000000002a
GPR16: 00000f705745a528 00007ffffa45ddd8 00000f70574d0008 0000000000000000
GPR20: 00000f7075c58d70 00000f7057459c38 0000000000000001 0000000000000040
GPR24: 0000000000000000 00000f7057473f68 0000000000000003 000000000000041b
GPR28: 00007ffffa45d4c4 0000000000000035 0000000000000000 00000f7057473f68
NIP [c000000000003000] end_real_trampolines+0x0/0x1000
LR [00007ca426adb03c] 0x7ca426adb03c
--- interrupt: 900
Instruction dump:
60000000 60000000 60420000 38600001 482b3ae5 60000000 e93f0138 a36d0008
7daa6b78 71290001 7f7907b4 4082fd34 <0fe00000> 4bfffd2c 60420000 ea6100a8
---[ end trace dc75f67d819779da ]---
Fixes: 118178e62e ("powerpc: move NMI entry/exit code into wrapper")
Reported-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210503111708.758261-1-npiggin@gmail.com
2021-05-14 17:28:52 +10:00
..
2021-04-22 20:59:15 +10:00
2021-04-22 20:59:15 +10:00
2021-04-14 23:04:44 +10:00
2021-04-14 23:04:20 +10:00
2020-12-04 22:13:19 +11:00
2021-03-29 12:48:46 +11:00
2021-04-14 23:04:44 +10:00
2021-04-14 23:04:19 +10:00
2020-12-15 22:50:11 +11:00
2020-12-04 01:01:10 +11:00
2021-03-10 07:58:04 +11:00
2020-12-09 17:00:54 +11:00
2021-04-08 21:17:42 +10:00
2021-03-14 20:32:24 +11:00
2021-01-29 10:05:51 +05:30
2021-02-09 00:10:49 +11:00
2021-03-01 12:33:31 +11:00
2021-02-09 00:02:12 +11:00
2020-12-05 21:49:52 +11:00
2021-01-20 15:58:19 +11:00
2021-01-20 15:58:19 +11:00
2021-02-09 00:10:50 +11:00
2021-04-22 20:59:15 +10:00
2021-04-07 10:56:52 +02:00
2021-03-23 14:08:18 -04:00
2021-03-26 23:19:43 +11:00
2021-01-24 10:34:53 -08:00
2021-02-11 23:35:06 +11:00
2021-05-12 11:07:38 +10:00
2021-03-24 14:09:30 +11:00
2021-02-11 23:35:09 +11:00
2021-03-24 14:09:29 +11:00
2021-04-21 22:52:33 +10:00
2021-05-14 17:28:52 +10:00
2021-05-07 00:26:34 -07:00
2021-03-29 13:22:17 +11:00
2021-04-03 21:22:21 +11:00
2021-04-25 21:29:04 +10:00
2021-04-14 23:04:16 +10:00
2021-03-11 09:53:38 -07:00
2021-03-24 14:09:30 +11:00
2021-03-29 13:22:11 +11:00
2021-02-10 14:31:08 +11:00
2021-05-06 00:25:42 +10:00
2020-12-04 01:01:22 +11:00
2021-04-17 08:31:08 -04:00
2020-12-04 01:01:22 +11:00
2021-05-01 10:14:08 -07:00
2021-02-03 09:46:36 +11:00
2021-01-31 22:35:49 +11:00
2021-04-14 23:04:44 +10:00
2021-03-02 22:41:50 +11:00
2021-02-09 00:02:12 +11:00
2020-12-11 09:53:10 +11:00
2021-05-02 23:35:32 +10:00
2021-02-11 23:35:05 +11:00
2020-12-09 23:48:14 +11:00
2021-05-12 11:07:38 +10:00
2021-05-02 23:35:32 +10:00
2021-05-02 23:35:32 +10:00
2021-04-20 14:22:23 +10:00
2021-02-09 01:09:44 +11:00
2021-03-24 14:09:30 +11:00
2021-02-09 01:09:44 +11:00
2021-05-12 11:07:38 +10:00
2020-12-04 01:01:30 +11:00
2021-04-14 23:04:20 +10:00
2021-04-21 22:52:33 +10:00
2021-02-11 23:35:36 +11:00
2021-04-08 21:17:45 +10:00
2020-12-04 01:01:22 +11:00
2021-04-14 23:04:44 +10:00
2021-03-29 12:48:46 +11:00
2021-02-11 23:35:12 +11:00
2021-04-21 22:52:32 +10:00
2020-12-08 21:41:02 +11:00
2021-04-14 23:04:16 +10:00
2021-02-09 00:10:50 +11:00
2021-03-26 23:19:43 +11:00
2021-04-17 10:40:51 +10:00
2021-03-26 23:19:43 +11:00
2021-01-29 10:05:51 +05:30
2021-03-10 11:15:00 +11:00
2021-04-08 21:17:45 +10:00
2021-02-09 00:02:10 +11:00
2020-12-04 01:01:10 +11:00
2020-12-09 16:46:56 +11:00
2021-04-17 10:40:51 +10:00
2021-05-12 11:07:39 +10:00
2021-03-26 23:19:42 +11:00
2021-04-14 23:04:44 +10:00
2020-12-04 01:01:19 +11:00
2021-04-20 14:22:24 +10:00
2021-04-30 11:20:40 -07:00
2021-04-14 23:04:14 +10:00
2021-02-09 00:10:50 +11:00