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
2019-05-30 11:26:32 -07:00
2020-01-25 12:18:51 -05:00
2020-10-22 14:26:09 +11:00
2021-04-14 23:04:20 +10:00
2019-05-24 17:27:11 +02:00
2020-12-04 22:13:19 +11:00
2021-03-29 12:48:46 +11:00
2020-11-19 14:50:13 +11:00
2019-06-07 19:00:14 +10:00
2021-04-14 23:04:44 +10:00
2019-05-30 11:26:32 -07:00
2020-10-25 14:51:49 -07:00
2021-04-14 23:04:19 +10:00
2019-05-30 11:26:32 -07:00
2020-12-15 22:50:11 +11:00
2020-12-04 01:01:10 +11:00
2020-05-28 23:24:36 +10:00
2021-03-10 07:58:04 +11:00
2020-09-17 13:00:46 -04:00
2019-05-30 11:26:32 -07:00
2020-12-09 17:00:54 +11:00
2021-04-08 21:17:42 +10:00
2019-12-09 13:54:34 -06:00
2021-03-14 20:32:24 +11:00
2020-11-19 14:49:56 +11:00
2019-05-30 11:26:32 -07:00
2019-04-30 22:37:48 +10:00
2021-01-29 10:05:51 +05:30
2020-09-16 22:05:19 +10:00
2021-02-09 00:10:49 +11:00
2020-07-29 23:47:54 +10:00
2019-08-20 21:22:15 +10:00
2020-07-29 21:02:09 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2021-03-01 12:33:31 +11:00
2019-05-30 11:26:35 -07:00
2021-02-09 00:02:12 +11:00
2019-05-30 11:26:32 -07:00
2020-10-08 21:17:15 +11:00
2020-08-11 14:13:24 -07:00
2019-06-05 17:30:28 +02:00
2020-09-11 09:14:43 +02:00
2020-04-01 14:30:50 +11:00
2020-10-08 12:50:52 +11:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:35 -07:00
2020-10-07 22:34:47 +11:00
2020-12-05 21:49:52 +11:00
2019-08-30 09:40:15 +10:00
2019-06-05 17:37:07 +02:00
2020-07-27 00:01:31 +10:00
2020-07-29 21:08:12 +10:00
2021-01-20 15:58:19 +11:00
2020-05-04 22:29:58 +10:00
2019-09-14 00:04:45 +10: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
2020-05-12 19:34:53 +03:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2021-04-07 10:56:52 +02:00
2019-05-30 11:26:32 -07:00
2021-03-23 14:08:18 -04:00
2021-03-26 23:19:43 +11:00
2020-07-29 23:47:53 +10:00
2020-07-22 23:00:27 +10:00
2021-01-24 10:34:53 -08:00
2019-05-24 17:39:01 +02: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
2019-05-30 11:26:35 -07:00
2019-01-14 20:39:27 +11:00
2020-09-15 22:13:20 +10:00
2021-02-11 23:35:09 +11:00
2021-03-24 14:09:29 +11:00
2020-08-25 01:31:33 +10:00
2020-04-30 12:35:26 +10:00
2020-07-16 13:12:46 +10:00
2021-04-21 22:52:33 +10:00
2021-05-14 17:28:52 +10:00
2019-05-30 11:26:32 -07:00
2019-08-27 13:03:34 +10:00
2021-05-07 00:26:34 -07:00
2020-10-06 07:07:03 +02:00
2019-05-30 11:26:32 -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
2020-07-29 23:47:53 +10:00
2021-03-11 09:53:38 -07:00
2021-03-24 14:09:30 +11:00
2020-05-19 00:10:39 +10:00
2021-03-29 13:22:11 +11:00
2020-03-19 16:39:52 +11:00
2019-06-05 17:30:28 +02:00
2020-05-29 16:09:27 +10:00
2021-02-10 14:31:08 +11:00
2020-07-28 12:34:52 +10:00
2021-05-06 00:25:42 +10:00
2019-06-19 17:09:55 +02:00
2020-07-29 21:02:09 +10:00
2019-06-05 17:30:28 +02: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
2020-11-13 12:15:28 -05:00
2019-11-24 15:06:33 -08:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:39 -07:00
2021-02-03 09:46:36 +11:00
2019-05-30 11:26:32 -07:00
2021-01-31 22:35:49 +11:00
2019-08-30 09:55:41 +10:00
2020-08-24 14:12:54 +10:00
2019-04-08 12:09:27 +01:00
2021-04-14 23:04:44 +10:00
2021-03-02 22:41:50 +11:00
2020-11-22 10:48:22 -08:00
2020-06-05 12:39:30 -07:00
2020-09-25 00:36:41 +09:00
2019-05-24 17:27:12 +02:00
2019-05-24 17:27:12 +02:00
2019-06-05 17:37:18 +02:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:17 +02:00
2021-02-09 00:02:12 +11:00
2019-05-30 11:26:32 -07: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
2020-04-10 15:36:21 -07:00
2020-07-27 00:01:30 +10:00
2021-05-12 11:07:38 +10:00
2019-06-05 17:37:06 +02:00
2021-05-02 23:35:32 +10:00
2021-05-02 23:35:32 +10:00
2020-08-04 23:15:59 +10:00
2019-05-30 11:26:32 -07:00
2021-04-20 14:22:23 +10:00
2021-02-09 01:09:44 +11:00
2019-09-24 15:54:09 -07:00
2019-05-03 01:20:23 +10:00
2019-05-03 01:20:23 +10: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
2019-05-30 11:26:32 -07:00
2019-07-15 12:41:26 +10:00
2019-05-30 11:26:32 -07:00
2020-12-04 01:01:30 +11:00
2020-01-23 21:31:17 +11:00
2019-07-13 16:08:36 -07:00
2019-05-24 17:27:12 +02: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
2019-05-30 11:26:35 -07:00
2021-04-08 21:17:45 +10:00
2020-06-02 20:59:20 +10:00
2020-12-04 01:01:22 +11:00
2019-05-30 11:26:39 -07:00
2019-06-05 17:37:07 +02:00
2019-07-13 16:08:36 -07:00
2019-07-05 00:43:50 +10:00
2021-04-14 23:04:44 +10:00
2020-07-27 00:01:29 +10:00
2021-03-29 12:48:46 +11:00
2020-01-23 21:31:14 +11:00
2019-05-30 11:26:32 -07:00
2021-02-11 23:35:12 +11:00
2021-04-21 22:52:32 +10:00
2019-05-30 11:26:32 -07:00
2020-12-08 21:41:02 +11:00
2021-04-14 23:04:16 +10:00
2020-11-20 11:16:35 -08:00
2020-06-18 12:10:37 -07:00
2019-11-12 12:25:49 +11:00
2020-11-19 23:47:18 +11:00
2019-11-13 00:33:22 +11:00
2019-05-30 11:26:32 -07:00
2020-04-01 14:30:51 +11:00
2021-02-09 00:10:50 +11:00
2018-12-04 19:45:01 +11:00
2020-04-01 13:42:13 +11:00
2020-07-26 23:34:26 +10:00
2021-03-26 23:19:43 +11:00
2020-05-26 22:22:21 +10:00
2021-04-17 10:40:51 +10:00
2020-07-27 00:01:32 +10:00
2020-11-22 10:48:22 -08:00
2020-07-27 00:01:23 +10:00
2021-03-26 23:19:43 +11:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:39 -07:00
2021-01-29 10:05:51 +05:30
2020-07-23 17:43:44 +10:00
2020-10-06 11:18:04 +02:00
2020-09-14 23:07:14 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2021-03-10 11:15:00 +11:00
2020-10-06 23:22:23 +11:00
2020-05-15 11:58:54 +10:00
2019-02-23 22:31:39 +11:00
2019-05-03 01:20:23 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07: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
2019-06-19 17:09:55 +02:00
2019-05-01 16:45:05 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2021-05-12 11:07:39 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-11-28 17:02:31 +11:00
2019-11-28 17:02:31 +11:00
2021-03-26 23:19:42 +11:00
2020-05-19 00:10:39 +10:00
2020-04-20 16:53:14 +10:00
2021-04-14 23:04:44 +10:00
2020-12-04 01:01:19 +11:00
2020-04-23 10:50:26 +09:00
2021-04-20 14:22:24 +10:00
2021-04-30 11:20:40 -07:00
2020-05-07 22:58:31 +10:00
2021-04-14 23:04:14 +10:00
2021-02-09 00:10:50 +11:00
2019-05-30 11:26:35 -07:00