From: Uday Shankar <ushankar@purestorage.com>
To: "Jörn Engel" <joern@purestorage.com>
Cc: "Huang, Ying" <ying.huang@intel.com>,
Kees Cook <keescook@chromium.org>,
Tony Luck <tony.luck@intel.com>,
"Guilherme G. Piccoli" <gpiccoli@igalia.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Len Brown <lenb@kernel.org>, James Morse <james.morse@arm.com>,
Borislav Petkov <bp@alien8.de>, Len Brown <len.brown@intel.com>,
linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org,
Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Subject: Re: [PATCH] Revert "ACPI, APEI, use raw spinlock in ERST"
Date: Tue, 22 Aug 2023 17:45:22 -0600 [thread overview]
Message-ID: <20230822234522.GA2590891@dev-ushankar.dev.purestorage.com> (raw)
In-Reply-To: <ZOQodU1CNMRtjYZ6@cork>
On Mon, Aug 21, 2023 at 08:16:05PM -0700, Jörn Engel wrote:
> On Tue, Aug 22, 2023 at 09:56:38AM +0800, Huang, Ying wrote:
> >
> > ERST is mainly used to log the hardware error. While, hardware error
> > may be reported via NMI (e.g., ACPI APEI GHES NMI), so we need to call
> > ERST functions in NMI handlers. Where normal spinlock cannot be used
> > because they will be converted to sleepable rt_mutex in RT kernel.
>
> Non-sleeping spinlocks cannot be used in NMI context either.
> raw_spin_lock_irqsave() will prevent regular interrupts, but not NMI.
> So taking a spinlock inside an NMI can trigger a deadlock.
>
> Am I missing something here?
>
> Jörn
>
> --
> All art is but imitation of nature.
> -- Lucius Annaeus Seneca
Also want to point out that both before and after this commit, we only
use trylock from erst_write, which looks like the only function touched
by this patch which can be called from NMI context. Trylock should be
safe in NMI context regardless of the type of synchronization used
(raw_spinlock, spinlock, or otherwise).
next prev parent reply other threads:[~2023-08-22 23:45 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 1:09 [PATCH] Revert "ACPI, APEI, use raw spinlock in ERST" Uday Shankar
2023-08-22 1:56 ` Huang, Ying
2023-08-22 3:16 ` Jörn Engel
2023-08-22 23:45 ` Uday Shankar [this message]
2023-08-23 2:38 ` Huang, Ying
2023-08-23 2:57 ` Jörn Engel
2023-08-23 21:09 ` Jörn Engel
2023-08-23 2:28 ` Huang, Ying
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=20230822234522.GA2590891@dev-ushankar.dev.purestorage.com \
--to=ushankar@purestorage.com \
--cc=bp@alien8.de \
--cc=gpiccoli@igalia.com \
--cc=james.morse@arm.com \
--cc=joern@purestorage.com \
--cc=keescook@chromium.org \
--cc=len.brown@intel.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=qiuxu.zhuo@intel.com \
--cc=rafael@kernel.org \
--cc=tony.luck@intel.com \
--cc=ying.huang@intel.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