[powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

5 messages, 2 authors, 2021-06-28 · open the first message on its own page

[powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

From: Sachin Sant <hidden>
Date: 2021-06-26 13:52:24

Following kernel warning is seen while booting 5.13.0-rc7-next-20210625
on POWER9 LPAR.

[   40.573592] ------------[ cut here ]------------
[   40.573604] WARNING: CPU: 6 PID: 4743 at arch/powerpc/kernel/interrupt.c:518 interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573614] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables libcrc32c nfnetlink sunrpc pseries_rng xts uio_pdrv_genirq uio vmx_crypto sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse
[   40.573649] CPU: 6 PID: 4743 Comm: dracut-install Not tainted 5.13.0-rc7-next-20210625 #1
[   40.573655] NIP:  c000000000032990 LR: c00000000000c958 CTR: 000000000048dd1c
[   40.573660] REGS: c0000000414db640 TRAP: 0700   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573664] MSR:  8000000000021033 <SF,ME,IR,DR,RI,LE>  CR: 28044288  XER: 00000000
[   40.573674] CFAR: c0000000000327a4 IRQMASK: 1 
               GPR00: c00000000000c958 c0000000414db8e0 c0000000029bbd00 c0000000414db9a0 
               GPR04: 8000000000001033 0000000000000093 0000000000000048 ffffffffffffffbf 
               GPR08: 0000000000000008 0000000000000000 0000000000000003 0000000000000010 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 fcffffffffffffff 0000000000000000 c0000000414db9a0 
[   40.573725] NIP [c000000000032990] interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573730] LR [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
[   40.573736] Call Trace:
[   40.573738] [c0000000414db8e0] [c000000043cbbc00] 0xc000000043cbbc00 (unreliable)
[   40.573744] [c0000000414db930] [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
[   40.573751] --- interrupt: 300 at strnlen_user+0x74/0x240
[   40.573756] NIP:  c00000000070ccf4 LR: c00000000048a460 CTR: 000000000003fffe
[   40.573760] REGS: c0000000414db9a0 TRAP: 0300   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573764] MSR:  8000000000001033 <SF,ME,IR,DR,RI,LE>  CR: 48044228  XER: 20040000
[   40.573774] CFAR: c00000000048a45c DAR: 000001003da495d0 DSISR: 40000000 IRQMASK: 0 
               GPR00: c00000000048a44c c0000000414dbc40 c0000000029bbd00 0000000000000000 
               GPR04: 0000000000200000 0000000000000030 c000000043cbbc00 000001003da495d0 
               GPR08: a8aaaaaaaaaaaaaa bcffffffffffffff 000001003da495d0 0000000000000000 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 c000000043b6a000 c000000043cbbc00 0000000000000000 
[   40.573826] NIP [c00000000070ccf4] strnlen_user+0x74/0x240
[   40.573830] LR [c00000000048a460] copy_strings.isra.42+0xb0/0x350
[   40.573835] --- interrupt: 300
[   40.573838] [c0000000414dbc40] [c00000007d7c0000] 0xc00000007d7c0000 (unreliable)
[   40.573843] [c0000000414dbc70] [c00000000048a44c] copy_strings.isra.42+0x9c/0x350
[   40.573849] [c0000000414dbd10] [c00000000048b60c] do_execveat_common.isra.44+0x1fc/0x240
[   40.573855] [c0000000414dbd80] [c00000000048b6a4] sys_execve+0x54/0x70
[   40.573860] [c0000000414dbdb0] [c0000000000322c0] system_call_exception+0x150/0x2d0
[   40.573865] [c0000000414dbe10] [c00000000000c464] system_call_common+0xf4/0x258
[   40.573871] --- interrupt: c00 at 0x7fffb76db8a8
[   40.573875] NIP:  00007fffb76db8a8 LR: 00007fffb76dc488 CTR: 0000000000000000
[   40.573878] REGS: c0000000414dbe80 TRAP: 0c00   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573883] MSR:  800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28044283  XER: 00000000
[   40.573895] IRQMASK: 0 
               GPR00: 000000000000000b 00007fffc7ab7a00 00007fffb77f7300 00007fffc7ab7a20 
               GPR04: 00007fffc7ab7ae0 00007fffc7ab8b50 0000000000007063 0000000000000000 
               GPR08: ffff800038540059 0000000000000000 0000000000000000 0000000000000000 
               GPR12: 0000000000000000 00007fffb792d720 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 00007fffc7ab7a20 
               GPR20: 00007fffb7926740 000000000000002f 0000000000000000 0000000000000013 
               GPR24: 0000000000000003 00007fffc7abffa7 0000000000000001 00007fffc7ab8b50 
               GPR28: 00007fffc7ab7ae0 00007fffc7abffb0 0000000101dc1378 00007fffc7ab7a20 
[   40.573943] NIP [00007fffb76db8a8] 0x7fffb76db8a8
[   40.573947] LR [00007fffb76dc488] 0x7fffb76dc488
[   40.573950] --- interrupt: c00
[   40.573952] Instruction dump:
[   40.573955] 71290001 892d0933 61290001 992d0933 4082000c 392d0918 7c20492a 4bfe36dd 
[   40.573964] 60000000 4bfffe34 60000000 60000000 <0fe00000> 4bfffe14 60000000 60000000 
[   40.573973] ---[ end trace 604b708523af26f5 ]—

I cannot consistently recreate this problem. 

next-20210624 was good. 

Last patch that touched this code was 6eaaf9de3599.

Thanks
-Sachin

Re: [powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2021-06-26 18:57:38

Excerpts from Sachin Sant's message of June 26, 2021 11:52 pm:
Following kernel warning is seen while booting 5.13.0-rc7-next-20210625
on POWER9 LPAR.

[   40.573592] ------------[ cut here ]------------
[   40.573604] WARNING: CPU: 6 PID: 4743 at arch/powerpc/kernel/interrupt.c:518 interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573614] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables libcrc32c nfnetlink sunrpc pseries_rng xts uio_pdrv_genirq uio vmx_crypto sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse
[   40.573649] CPU: 6 PID: 4743 Comm: dracut-install Not tainted 5.13.0-rc7-next-20210625 #1
[   40.573655] NIP:  c000000000032990 LR: c00000000000c958 CTR: 000000000048dd1c
[   40.573660] REGS: c0000000414db640 TRAP: 0700   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573664] MSR:  8000000000021033 <SF,ME,IR,DR,RI,LE>  CR: 28044288  XER: 00000000
[   40.573674] CFAR: c0000000000327a4 IRQMASK: 1 
               GPR00: c00000000000c958 c0000000414db8e0 c0000000029bbd00 c0000000414db9a0 
               GPR04: 8000000000001033 0000000000000093 0000000000000048 ffffffffffffffbf 
               GPR08: 0000000000000008 0000000000000000 0000000000000003 0000000000000010 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 fcffffffffffffff 0000000000000000 c0000000414db9a0 
[   40.573725] NIP [c000000000032990] interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573730] LR [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
BTW this isn't a restart but a kernel exit. I'll have to update labels 
to make this clear.
[   40.573736] Call Trace:
[   40.573738] [c0000000414db8e0] [c000000043cbbc00] 0xc000000043cbbc00 (unreliable)
[   40.573744] [c0000000414db930] [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
[   40.573751] --- interrupt: 300 at strnlen_user+0x74/0x240
[   40.573756] NIP:  c00000000070ccf4 LR: c00000000048a460 CTR: 000000000003fffe
[   40.573760] REGS: c0000000414db9a0 TRAP: 0300   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573764] MSR:  8000000000001033 <SF,ME,IR,DR,RI,LE>  CR: 48044228  XER: 20040000
[   40.573774] CFAR: c00000000048a45c DAR: 000001003da495d0 DSISR: 40000000 IRQMASK: 0 
               GPR00: c00000000048a44c c0000000414dbc40 c0000000029bbd00 0000000000000000 
               GPR04: 0000000000200000 0000000000000030 c000000043cbbc00 000001003da495d0 
               GPR08: a8aaaaaaaaaaaaaa bcffffffffffffff 000001003da495d0 0000000000000000 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 c000000043b6a000 c000000043cbbc00 0000000000000000 
[   40.573826] NIP [c00000000070ccf4] strnlen_user+0x74/0x240
[   40.573830] LR [c00000000048a460] copy_strings.isra.42+0xb0/0x350
So there's definitely IRQMASK=0 and no MSR[EE]=0 in this frame, which is 
what the warning was.

I'd say either something hasn't set PACA_IRQ_HARD_DIS properly, so EE 
doesn't get enabled when irqs are restored, or maybe the  change to
arch_local_irq_restore(). Less likely that the stack got messed up.

Can you try run with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y ?

Thanks,
Nick

Re: [powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2021-06-27 10:06:16

Excerpts from Nicholas Piggin's message of June 27, 2021 4:57 am:
Excerpts from Sachin Sant's message of June 26, 2021 11:52 pm:
quoted
Following kernel warning is seen while booting 5.13.0-rc7-next-20210625
on POWER9 LPAR.

[   40.573592] ------------[ cut here ]------------
[   40.573604] WARNING: CPU: 6 PID: 4743 at arch/powerpc/kernel/interrupt.c:518 interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573614] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables libcrc32c nfnetlink sunrpc pseries_rng xts uio_pdrv_genirq uio vmx_crypto sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse
[   40.573649] CPU: 6 PID: 4743 Comm: dracut-install Not tainted 5.13.0-rc7-next-20210625 #1
[   40.573655] NIP:  c000000000032990 LR: c00000000000c958 CTR: 000000000048dd1c
[   40.573660] REGS: c0000000414db640 TRAP: 0700   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573664] MSR:  8000000000021033 <SF,ME,IR,DR,RI,LE>  CR: 28044288  XER: 00000000
[   40.573674] CFAR: c0000000000327a4 IRQMASK: 1 
               GPR00: c00000000000c958 c0000000414db8e0 c0000000029bbd00 c0000000414db9a0 
               GPR04: 8000000000001033 0000000000000093 0000000000000048 ffffffffffffffbf 
               GPR08: 0000000000000008 0000000000000000 0000000000000003 0000000000000010 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 fcffffffffffffff 0000000000000000 c0000000414db9a0 
[   40.573725] NIP [c000000000032990] interrupt_exit_kernel_prepare+0x280/0x2a0
[   40.573730] LR [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
BTW this isn't a restart but a kernel exit. I'll have to update labels 
to make this clear.
quoted
[   40.573736] Call Trace:
[   40.573738] [c0000000414db8e0] [c000000043cbbc00] 0xc000000043cbbc00 (unreliable)
[   40.573744] [c0000000414db930] [c00000000000c958] interrupt_return_srr_user_restart+0x34/0x118
[   40.573751] --- interrupt: 300 at strnlen_user+0x74/0x240
[   40.573756] NIP:  c00000000070ccf4 LR: c00000000048a460 CTR: 000000000003fffe
[   40.573760] REGS: c0000000414db9a0 TRAP: 0300   Not tainted  (5.13.0-rc7-next-20210625)
[   40.573764] MSR:  8000000000001033 <SF,ME,IR,DR,RI,LE>  CR: 48044228  XER: 20040000
[   40.573774] CFAR: c00000000048a45c DAR: 000001003da495d0 DSISR: 40000000 IRQMASK: 0 
               GPR00: c00000000048a44c c0000000414dbc40 c0000000029bbd00 0000000000000000 
               GPR04: 0000000000200000 0000000000000030 c000000043cbbc00 000001003da495d0 
               GPR08: a8aaaaaaaaaaaaaa bcffffffffffffff 000001003da495d0 0000000000000000 
               GPR12: 0000000000004000 c000000005587a00 0000000101dc15a8 0000000101dc1590 
               GPR16: 0000000101dc05a8 00007fffc7abe353 00007fffb7926740 0000000000000000 
               GPR20: 00007fffc7ab7ae0 fffffffffffff000 0000000000000006 c000000043cbbc00 
               GPR24: 0000000000000000 000001003da495d0 0000000000000000 0000000000000000 
               GPR28: 0000000000000000 c000000043b6a000 c000000043cbbc00 0000000000000000 
[   40.573826] NIP [c00000000070ccf4] strnlen_user+0x74/0x240
[   40.573830] LR [c00000000048a460] copy_strings.isra.42+0xb0/0x350
So there's definitely IRQMASK=0 and no MSR[EE]=0 in this frame, which is 
what the warning was.

I'd say either something hasn't set PACA_IRQ_HARD_DIS properly, so EE 
doesn't get enabled when irqs are restored, or maybe the  change to
arch_local_irq_restore(). Less likely that the stack got messed up.

Can you try run with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y ?
Nevermind, I think I've found the problem. Some code runs in the
implicit soft-mask region without expecting to be masked. Working
on a fix...

Thanks,
Nick

Re: [powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

From: Sachin Sant <hidden>
Date: 2021-06-27 11:24:14

On 27-Jun-2021, at 3:36 PM, Nicholas Piggin [off-list ref] wrote:
quoted
So there's definitely IRQMASK=0 and no MSR[EE]=0 in this frame, which is 
what the warning was.

I'd say either something hasn't set PACA_IRQ_HARD_DIS properly, so EE 
doesn't get enabled when irqs are restored, or maybe the  change to
arch_local_irq_restore(). Less likely that the stack got messed up.

Can you try run with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y ?
Nevermind, I think I've found the problem. Some code runs in the
implicit soft-mask region without expecting to be masked. Working
on a fix…
:-) . I was able to recreate this after few attempts. It seem the warning isn’t
always triggered during boot. I had to run a kernel compile operation after
boot to trigger this warning again.

In case its helpful here is the additional trace with PPC_IRQ_SOFT_MASK_DEBUG.

[   92.106731] ------------[ cut here ]------------
[   92.106738] WARNING: CPU: 45 PID: 12757 at arch/powerpc/kernel/irq.c:255 arch_local_irq_restore+0x1d0/0x200
[   92.106753] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables libcrc32c nfnetlink sunrpc pseries_rng xts vmx_crypto uio_pdrv_genirq uio sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse
[   92.106828] CPU: 45 PID: 12757 Comm: sh Kdump: loaded Tainted: G        W         5.13.0-rc7-next-20210625 #1
[   92.106841] NIP:  c0000000000164d0 LR: c000000000cedaa8 CTR: 0000000000000000
[   92.106849] REGS: c00000008dfeb7e0 TRAP: 0700   Tainted: G        W          (5.13.0-rc7-next-20210625)
[   92.106859] MSR:  8000000002823033 <SF,VEC,VSX,FP,ME,IR,DR,RI,LE>  CR: 28004222  XER: 00000000
[   92.106892] CFAR: c00000000001632c IRQMASK: 0 
               GPR00: c000000000ceda98 c00000008dfeba80 c000000002921e00 0000000000000000 
               GPR04: 0000000000000000 0000000000000000 0000000000000000 00000000000000ff 
               GPR08: 0000000000000001 0000000000000000 0000000000000001 0000000000000017 
               GPR12: 0000000024004822 c000000007fb9200 000000012efd81d4 000000012ee50000 
               GPR16: 0000000000000001 00000100268a0e00 000001002687ec10 0000000114200c40 
               GPR20: 00003fffa93f8000 0000000000000000 00003fffa93f9300 000000012efb1988 
               GPR24: 000000012ee7fe7c 000000012efccba0 000000012ee50000 c00000008d5d7600 
               GPR28: c0000000314c0bc0 c000000040d9f100 c0000008beb5861c 4b72201a3063fe13 
[   92.107024] NIP [c0000000000164d0] arch_local_irq_restore+0x1d0/0x200
[   92.107035] LR [c000000000cedaa8] _raw_spin_unlock_irqrestore+0x88/0xb0
[   92.107047] Call Trace:
[   92.107052] [c00000008dfeba80] [c00000008dfebb50] 0xc00000008dfebb50 (unreliable)
[   92.107065] [c00000008dfebab0] [238c5bf052df0858] 0x238c5bf052df0858
[   92.107076] [c00000008dfebae0] [c0000000008178e8] get_random_u64+0x88/0x100
[   92.107090] [c00000008dfebb20] [c000000000020134] arch_randomize_brk+0xb4/0xd8
[   92.107105] [c00000008dfebb50] [c0000000005430b0] load_elf_binary+0xe70/0x1220
[   92.107119] [c00000008dfebc40] [c00000000047ded0] bprm_execve+0x410/0x800
[   92.107132] [c00000008dfebd10] [c00000000047e8ec] do_execveat_common.isra.44+0x21c/0x240
[   92.107145] [c00000008dfebd80] [c00000000047e964] sys_execve+0x54/0x70
[   92.107157] [c00000008dfebdb0] [c000000000032334] system_call_exception+0x164/0x2e0
[   92.107169] [c00000008dfebe10] [c00000000000c464] system_call_common+0xf4/0x258
[   92.107185] --- interrupt: c00 at 0x3fff9bb6b8a8
[   92.107193] NIP:  00003fff9bb6b8a8 LR: 00003fff9bb6c240 CTR: 0000000000000000
[   92.107202] REGS: c00000008dfebe80 TRAP: 0c00   Tainted: G        W          (5.13.0-rc7-next-20210625)
[   92.107213] MSR:  800000000000f033 <SF,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28004224  XER: 00000000
[   92.107243] IRQMASK: 0 
               GPR00: 000000000000000b 00003fffc36a1440 00003fff9bc87300 00000100268a67d0 
               GPR04: 0000010026887e50 0000010026882c50 fefefefefefefeff 7f7f7f7f7f7f7f7f 
               GPR08: 00000100268a67d0 0000000000000000 0000000000000000 0000000000000000 
               GPR12: 0000000000000000 00003fff9bce3780 0000000114200db4 0000000000000000 
               GPR16: 0000000000000001 00000100268a0e00 000001002687ec10 0000000114200c40 
               GPR20: 00000001141dd820 0000000000000000 00000001141dd740 0000000114204358 
               GPR24: 0000000114203948 0000010026876454 0000000000000001 0000010026882c50 
               GPR28: 0000010026887e50 0000010026882c50 00000100268a67d0 00003fffc36a1440 
[   92.107369] NIP [00003fff9bb6b8a8] 0x3fff9bb6b8a8
[   92.107378] LR [00003fff9bb6c240] 0x3fff9bb6c240
[   92.107386] --- interrupt: c00
[   92.107393] Instruction dump:
[   92.107400] 7d2000a6 71298000 40820048 39200000 992d0152 39400000 992d0153 614a8002 
[   92.107427] 7d410164 4bfffe6c 60000000 60000000 <0fe00000> 4bfffe5c 60000000 60000000 
[   92.107451] ---[ end trace 5f1d49fb99f3613d ]—

Complete dmesg log attached.

Thanks
-Sachin

Re: [powerpc][next-20210625] Kernel warning(arch/powerpc/kernel/interrupt.c:518) during boot

From: Nicholas Piggin <npiggin@gmail.com>
Date: 2021-06-28 03:52:09

Excerpts from Sachin Sant's message of June 27, 2021 9:23 pm:
quoted
On 27-Jun-2021, at 3:36 PM, Nicholas Piggin [off-list ref] wrote:
quoted
So there's definitely IRQMASK=0 and no MSR[EE]=0 in this frame, which is 
what the warning was.

I'd say either something hasn't set PACA_IRQ_HARD_DIS properly, so EE 
doesn't get enabled when irqs are restored, or maybe the  change to
arch_local_irq_restore(). Less likely that the stack got messed up.

Can you try run with CONFIG_PPC_IRQ_SOFT_MASK_DEBUG=y ?
Nevermind, I think I've found the problem. Some code runs in the
implicit soft-mask region without expecting to be masked. Working
on a fix…
:-) . I was able to recreate this after few attempts. It seem the warning isn’t
always triggered during boot. I had to run a kernel compile operation after
boot to trigger this warning again.

In case its helpful here is the additional trace with PPC_IRQ_SOFT_MASK_DEBUG.
Thanks. I ended up being able to reproduce as well, quite frequently 
with some extra debug checks that specifically catch more cases.

I've got a few patches under test right now, very stable so far. I'll 
post them out if they survive a nother hour or two stress testing.

The problem is some code (e.g., ret_from_fork) now gets implicitly 
soft-masked where that was not expecting to be. A masked interrupt might 
hit, and then when it moves out of the implicit soft-mask region it
does not re-enable interrupts. Some types of pending interrupts will 
clear MSR[EE], and that ends up causing this bug on the next interrupt
that happens.

Not a wonderful escape :\  thanks for finding it. The fixes aren't too
bad, fortunately.

Thanks,
Nick
[   92.106731] ------------[ cut here ]------------
[   92.106738] WARNING: CPU: 45 PID: 12757 at arch/powerpc/kernel/irq.c:255 arch_local_irq_restore+0x1d0/0x200
[   92.106753] Modules linked in: dm_mod bonding nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 ip_set rfkill nf_tables libcrc32c nfnetlink sunrpc pseries_rng xts vmx_crypto uio_pdrv_genirq uio sch_fq_codel ip_tables ext4 mbcache jbd2 sd_mod t10_pi sg ibmvscsi ibmveth scsi_transport_srp fuse
[   92.106828] CPU: 45 PID: 12757 Comm: sh Kdump: loaded Tainted: G        W         5.13.0-rc7-next-20210625 #1
[   92.106841] NIP:  c0000000000164d0 LR: c000000000cedaa8 CTR: 0000000000000000
[   92.106849] REGS: c00000008dfeb7e0 TRAP: 0700   Tainted: G        W          (5.13.0-rc7-next-20210625)
[   92.106859] MSR:  8000000002823033 <SF,VEC,VSX,FP,ME,IR,DR,RI,LE>  CR: 28004222  XER: 00000000
[   92.106892] CFAR: c00000000001632c IRQMASK: 0 
               GPR00: c000000000ceda98 c00000008dfeba80 c000000002921e00 0000000000000000 
               GPR04: 0000000000000000 0000000000000000 0000000000000000 00000000000000ff 
               GPR08: 0000000000000001 0000000000000000 0000000000000001 0000000000000017 
               GPR12: 0000000024004822 c000000007fb9200 000000012efd81d4 000000012ee50000 
               GPR16: 0000000000000001 00000100268a0e00 000001002687ec10 0000000114200c40 
               GPR20: 00003fffa93f8000 0000000000000000 00003fffa93f9300 000000012efb1988 
               GPR24: 000000012ee7fe7c 000000012efccba0 000000012ee50000 c00000008d5d7600 
               GPR28: c0000000314c0bc0 c000000040d9f100 c0000008beb5861c 4b72201a3063fe13 
[   92.107024] NIP [c0000000000164d0] arch_local_irq_restore+0x1d0/0x200
[   92.107035] LR [c000000000cedaa8] _raw_spin_unlock_irqrestore+0x88/0xb0
[   92.107047] Call Trace:
[   92.107052] [c00000008dfeba80] [c00000008dfebb50] 0xc00000008dfebb50 (unreliable)
[   92.107065] [c00000008dfebab0] [238c5bf052df0858] 0x238c5bf052df0858
[   92.107076] [c00000008dfebae0] [c0000000008178e8] get_random_u64+0x88/0x100
[   92.107090] [c00000008dfebb20] [c000000000020134] arch_randomize_brk+0xb4/0xd8
[   92.107105] [c00000008dfebb50] [c0000000005430b0] load_elf_binary+0xe70/0x1220
[   92.107119] [c00000008dfebc40] [c00000000047ded0] bprm_execve+0x410/0x800
[   92.107132] [c00000008dfebd10] [c00000000047e8ec] do_execveat_common.isra.44+0x21c/0x240
[   92.107145] [c00000008dfebd80] [c00000000047e964] sys_execve+0x54/0x70
[   92.107157] [c00000008dfebdb0] [c000000000032334] system_call_exception+0x164/0x2e0
[   92.107169] [c00000008dfebe10] [c00000000000c464] system_call_common+0xf4/0x258
[   92.107185] --- interrupt: c00 at 0x3fff9bb6b8a8
[   92.107193] NIP:  00003fff9bb6b8a8 LR: 00003fff9bb6c240 CTR: 0000000000000000
[   92.107202] REGS: c00000008dfebe80 TRAP: 0c00   Tainted: G        W          (5.13.0-rc7-next-20210625)
[   92.107213] MSR:  800000000000f033 <SF,EE,PR,FP,ME,IR,DR,RI,LE>  CR: 28004224  XER: 00000000
[   92.107243] IRQMASK: 0 
               GPR00: 000000000000000b 00003fffc36a1440 00003fff9bc87300 00000100268a67d0 
               GPR04: 0000010026887e50 0000010026882c50 fefefefefefefeff 7f7f7f7f7f7f7f7f 
               GPR08: 00000100268a67d0 0000000000000000 0000000000000000 0000000000000000 
               GPR12: 0000000000000000 00003fff9bce3780 0000000114200db4 0000000000000000 
               GPR16: 0000000000000001 00000100268a0e00 000001002687ec10 0000000114200c40 
               GPR20: 00000001141dd820 0000000000000000 00000001141dd740 0000000114204358 
               GPR24: 0000000114203948 0000010026876454 0000000000000001 0000010026882c50 
               GPR28: 0000010026887e50 0000010026882c50 00000100268a67d0 00003fffc36a1440 
[   92.107369] NIP [00003fff9bb6b8a8] 0x3fff9bb6b8a8
[   92.107378] LR [00003fff9bb6c240] 0x3fff9bb6c240
[   92.107386] --- interrupt: c00
[   92.107393] Instruction dump:
[   92.107400] 7d2000a6 71298000 40820048 39200000 992d0152 39400000 992d0153 614a8002 
[   92.107427] 7d410164 4bfffe6c 60000000 60000000 <0fe00000> 4bfffe5c 60000000 60000000 
[   92.107451] ---[ end trace 5f1d49fb99f3613d ]—

Complete dmesg log attached.

Thanks
-Sachin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help