From: Yeoreum Yun <yeoreum.yun@arm.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: linux-arm-kernel@lists.infradead.org, ptosi@google.com,
pcc@google.com, catalin.marinas@arm.com, bigeasy@linutronix.de,
linux-kernel@vger.kernel.org, joey.gouly@arm.com,
mcgrof@kernel.org, broonie@kernel.org, geert@linux-m68k.org,
kristina.martsenko@arm.com, james.morse@arm.com,
Will Deacon <will@kernel.org>,
rppt@kernel.org
Subject: Re: [PATCH] arm64/trap: fix broken ct->nmi_nesting when die() is called in a kthread
Date: Tue, 3 Jun 2025 16:23:07 +0100 [thread overview]
Message-ID: <aD8TW7j3TwUsPLqJ@e129823.arm.com> (raw)
In-Reply-To: <aD78oNHA5SlaH50z@J2N7QTR9R3.cambridge.arm.com>
Hi Mark,
> On Tue, Jun 03, 2025 at 12:14:18PM +0100, Yeoreum Yun wrote:
> > > On Mon, Jun 02, 2025 at 06:50:53PM +0100, Yeoreum Yun wrote:
> > > > So, what I think:
> > > > 1. arm64_enter_el1_dbg() should ct_nmi_enter() as it is.
> > > > 2. in bug_handler() while handling BUG_TYPE, add above ct_nmi_exit()
> > > > conditional call.
> > > > 3. DAIF.D and DAIF.A handling.
> > >
> > > No, that is not safe. In step 2, calling ct_nmi_exit() would undo *all*
> > > of the ct_nmi_enter() logic, and may stop RCU from watching if the
> > > exception was entered from some intermediate/inconsistent state.
> >
> > Yes if call ct_nmi_enter() without condition.
> > But I imply with the condition check what I posted.
> > if CT_NESTING_IRQ_NONIDLE,
> > it wouldn't need call and that cpu can be watched by RCU.
>
> I am not keen on conditionally calling ct_nmi_exit(), and would strongly
> prefer to avoid that, regardless of where that lives in the flow.
>
> I suspect that it would be bettter to triage the interrupted context
> earlier, and rethink the way entry/exit works, but that's a much larger
> bit of work and will take more thinking.
Thanks for sharing your thought.
I'll think about it and let me raise it again after ada's patchset is
merged.
--
Sincerely,
Yeoreum Yun
prev parent reply other threads:[~2025-06-03 15:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-30 9:27 [PATCH] arm64/trap: fix broken ct->nmi_nesting when die() is called in a kthread Yeoreum Yun
2025-06-02 12:47 ` Will Deacon
2025-06-02 14:54 ` Yeoreum Yun
2025-06-02 15:11 ` Mark Rutland
2025-06-02 17:50 ` Yeoreum Yun
2025-06-03 9:44 ` Mark Rutland
2025-06-03 11:14 ` Yeoreum Yun
2025-06-03 13:46 ` Mark Rutland
2025-06-03 15:23 ` Yeoreum Yun [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=aD8TW7j3TwUsPLqJ@e129823.arm.com \
--to=yeoreum.yun@arm.com \
--cc=bigeasy@linutronix.de \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=geert@linux-m68k.org \
--cc=james.morse@arm.com \
--cc=joey.gouly@arm.com \
--cc=kristina.martsenko@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mcgrof@kernel.org \
--cc=pcc@google.com \
--cc=ptosi@google.com \
--cc=rppt@kernel.org \
--cc=will@kernel.org \
/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