LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Nicholas Piggin" <npiggin@gmail.com>
To: "Sachin Sant" <sachinp@linux.ibm.com>,
	"linuxppc-dev" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [merge] WARN arch/powerpc/kernel/irq_64.c:278
Date: Fri, 03 Feb 2023 20:25:48 +1000	[thread overview]
Message-ID: <CQ8USYNS32BA.37RU0GOQ2LO7M@bobo> (raw)
In-Reply-To: <7C586644-B8B4-4B41-86E3-80A60D5FE1C7@linux.ibm.com>

On Fri Feb 3, 2023 at 4:26 PM AEST, Sachin Sant wrote:
> I am observing an intermittent crash while running powerpc/security
> selftests on a Power10 LPAR booted with powerpc/merge branch code.
>
> ------------[ cut here ]------------
> WARNING: CPU: 1 PID: 5644 at arch/powerpc/kernel/irq_64.c:278 arch_local_irq_restore+0x254/0x260

Okay, I guess the static branch test changes from true to false both
times it is tested and so it doesn't recover properly. It's a real bug.
I don't know why I didn't change the static branch under stop machine,
maybe it gets into some recursive issue, that would be ideal if we could
though. But this might be a safer minimal fix?

Thanks,
Nick
--

diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c
index fc6631a80527..0ec1581619db 100644
--- a/arch/powerpc/kernel/interrupt.c
+++ b/arch/powerpc/kernel/interrupt.c
@@ -50,16 +50,18 @@ static inline bool exit_must_hard_disable(void)
  */
 static notrace __always_inline bool prep_irq_for_enabled_exit(bool restartable)
 {
+	bool must_hard_disable = (exit_must_hard_disable() || !restartable);
+
 	/* This must be done with RI=1 because tracing may touch vmaps */
 	trace_hardirqs_on();
 
-	if (exit_must_hard_disable() || !restartable)
+	if (must_hard_disable)
 		__hard_EE_RI_disable();
 
 #ifdef CONFIG_PPC64
 	/* This pattern matches prep_irq_for_idle */
 	if (unlikely(lazy_irq_pending_nocheck())) {
-		if (exit_must_hard_disable() || !restartable) {
+		if (must_hard_disable) {
 			local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
 			__hard_RI_enable();
 		}

  reply	other threads:[~2023-02-03 10:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03  6:26 [merge] WARN arch/powerpc/kernel/irq_64.c:278 Sachin Sant
2023-02-03 10:25 ` Nicholas Piggin [this message]
2023-02-05 15:39   ` Sachin Sant

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=CQ8USYNS32BA.37RU0GOQ2LO7M@bobo \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sachinp@linux.ibm.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