From: Michael Ellerman <mpe@ellerman.id.au>
To: Hugh Dickins <hughd@google.com>
Cc: linuxppc-dev@ozlabs.org, hughd@google.com, npiggin@gmail.com
Subject: Re: [PATCH] powerpc/64s: Fix unrecoverable SLB crashes due to preemption check
Date: Mon, 04 May 2020 20:53:47 +1000 [thread overview]
Message-ID: <87a72odl8k.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <alpine.LSU.2.11.2005030008400.1557@eggly.anvils>
Hugh Dickins <hughd@google.com> writes:
> On Sun, 3 May 2020, Michael Ellerman wrote:
>
>> Hugh reported that his trusty G5 crashed after a few hours under load
>> with an "Unrecoverable exception 380".
>>
>> The crash is in interrupt_return() where we check lazy_irq_pending(),
>> which calls get_paca() and with CONFIG_DEBUG_PREEMPT=y that goes to
>> check_preemption_disabled() via debug_smp_processor_id().
>>
>> As Nick explained on the list:
>>
>> 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.
>>
>> The problematic access is in preempt_count() which is:
>>
>> return READ_ONCE(current_thread_info()->preempt_count);
>>
>> Because of THREAD_INFO_IN_TASK, current_thread_info() just points to
>> current, so the access is to somewhere in kernel memory, but not on
>> the stack or in .data, which means it can cause an SLB miss. If we
>> take an SLB miss with RI=0 it is fatal.
>>
>> The easiest solution is to add a version of lazy_irq_pending() that
>> doesn't do the preemption check and call it from the interrupt return
>> path.
>>
>> Fixes: 68b34588e202 ("powerpc/64/sycall: Implement syscall entry/exit logic in C")
>> Reported-by: Hugh Dickins <hughd@google.com>
>> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
>
> Thank you, Michael and Nick: this has been running fine all day for me.
Thanks Hugh.
cheers
next prev parent reply other threads:[~2020-05-04 10:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-02 14:33 [PATCH] powerpc/64s: Fix unrecoverable SLB crashes due to preemption check Michael Ellerman
2020-05-03 7:10 ` Hugh Dickins
2020-05-04 10:53 ` Michael Ellerman [this message]
2020-05-13 12:43 ` Michael Ellerman
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=87a72odl8k.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=hughd@google.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=npiggin@gmail.com \
/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