From: Nicholas Piggin <npiggin@gmail.com>
To: Hugh Dickins <hughd@google.com>
Cc: Michal Suchanek <msuchanek@suse.de>, linuxppc-dev@lists.ozlabs.org
Subject: Re: 5.7-rc interrupt_return Unrecoverable exception 380
Date: Sat, 02 May 2020 12:40:34 +1000 [thread overview]
Message-ID: <1588386603.8cl0cdd0nk.astroid@bobo.none> (raw)
In-Reply-To: <alpine.LSU.2.11.2005011253250.3734@eggly.anvils>
Excerpts from Hugh Dickins's message of May 2, 2020 6:38 am:
> Hi Nick,
>
> I've been getting an "Unrecoverable exception 380" after a few hours
> of load on the G5 (yes, that G5!) with 5.7-rc: when interrupt_return
> checks lazy_irq_pending, it crashes at check_preemption_disabled+0x24
> with CONFIG_DEBUG_PREEMPT=y.
>
> check_preemption_disabled():
> lib/smp_processor_id.c:13
> 0: 7c 08 02 a6 mflr r0
> 4: fb e1 ff f8 std r31,-8(r1)
> 8: fb 61 ff d8 std r27,-40(r1)
> c: fb 81 ff e0 std r28,-32(r1)
> 10: fb a1 ff e8 std r29,-24(r1)
> 14: fb c1 ff f0 std r30,-16(r1)
> get_current():
> arch/powerpc/include/asm/current.h:20
> 18: eb ed 01 88 ld r31,392(r13)
> check_preemption_disabled():
> lib/smp_processor_id.c:13
> 1c: f8 01 00 10 std r0,16(r1)
> 20: f8 21 ff 61 stdu r1,-160(r1)
> __read_once_size():
> include/linux/compiler.h:199
> 24: 81 3f 00 00 lwz r9,0(r31)
> check_preemption_disabled():
> lib/smp_processor_id.c:14
> 28: a3 cd 00 02 lhz r30,2(r13)
>
> I don't read ppc assembly, and have not jotted down the registers,
> but hope you can make sense of it. I get around it with the patch
> below (just avoiding the debug), but have no idea whether it's a
> necessary fix or a hacky workaround.
Hi Hugh,
Thanks for the report, nice catch. Your fix is actually the correct one
(well, we probably want a __lazy_irq_pending() variant which is to be
used in these cases).
Problem is MSR[RI] is cleared here, ready to do the last few things for
interrupt return where we're not allowed to take any other interrupts.
SLB interrupts can happen just about anywhere aside from kernel text,
global variables, and stack. When that hits, it appears to be
unrecoverable due to RI=0.
We could clear just MSR[EE] for asynchronous interrupts, then check
lazy_irq_pending(), and then clear MSR[RI] ready to return, and the
SLB miss in the debug check would be fine. But that's two mtmsr
instructions, which is slower. So we'll skip the check.
I tested hash, and preempt, possibly even preempt+hash, but clearly not
preempt+preempt_debug+hash+slb thrashing!
Thanks,
Nick
>
> Hugh
>
> --- 5.7-rc3/arch/powerpc/include/asm/hw_irq.h 2020-04-12 16:24:29.802769727 -0700
> +++ linux/arch/powerpc/include/asm/hw_irq.h 2020-04-27 11:31:10.000000000 -0700
> @@ -252,7 +252,7 @@ static inline bool arch_irqs_disabled(vo
>
> static inline bool lazy_irq_pending(void)
> {
> - return !!(get_paca()->irq_happened & ~PACA_IRQ_HARD_DIS);
> + return !!(local_paca->irq_happened & ~PACA_IRQ_HARD_DIS);
> }
>
> /*
>
prev parent reply other threads:[~2020-05-02 2:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-01 20:38 5.7-rc interrupt_return Unrecoverable exception 380 Hugh Dickins
2020-05-02 2:40 ` Nicholas Piggin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1588386603.8cl0cdd0nk.astroid@bobo.none \
--to=npiggin@gmail.com \
--cc=hughd@google.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=msuchanek@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox