public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Breno Leitao <leitao@debian.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel-team@meta.com,
	osandov@fb.com, leo.yan@arm.com, rmikey@meta.com
Subject: Re: [PATCH] arm64: traps: Mark kernel as tainted on SError panic
Date: Tue, 15 Jul 2025 15:02:13 +0100	[thread overview]
Message-ID: <aHZfZbxLGyFjJpNo@willie-the-truck> (raw)
In-Reply-To: <t3v2xvjal67bl5dwyatwgf46tnr2ikxnq62iqmda544llcd7oh@ws3nnrfp7r5p>

On Mon, Jul 14, 2025 at 05:26:43AM -0700, Breno Leitao wrote:
> On Sun, Jul 13, 2025 at 11:46:06PM +0100, Will Deacon wrote:
> > On Thu, Jul 10, 2025 at 03:46:35AM -0700, Breno Leitao wrote:
> 
> > > --- a/arch/arm64/kernel/traps.c
> > > +++ b/arch/arm64/kernel/traps.c
> > > @@ -931,6 +931,7 @@ void __noreturn panic_bad_stack(struct pt_regs *regs, unsigned long esr, unsigne
> > >  
> > >  void __noreturn arm64_serror_panic(struct pt_regs *regs, unsigned long esr)
> > >  {
> > > +	add_taint(TAINT_MACHINE_CHECK, LOCKDEP_STILL_OK);
> > >  	console_verbose();
> > >  
> > >  	pr_crit("SError Interrupt on CPU%d, code 0x%016lx -- %s\n",
> > 
> > If we're going to taint for SError, shouldn't we also taint for an
> > unclaimed SEA?
> 
> Yes. I was not very familiar with SEA errors, given I haven't seen on in
> production yet, but, reading about it, that is another seems to crash
> the system due to hardware errors, thus, we want to taint MACHINE_CHECK.
> 
> What about this?
> 
> 	Author: Breno Leitao <leitao@debian.org>
> 	Date:   Mon Jul 14 05:16:55 2025 -0700
> 
> 	arm64: Taint kernel on fatal hardware error in do_sea()
> 
> 	This patch updates the do_sea() handler to taint the kernel with
> 	TAINT_MACHINE_CHECK when a fatal hardware error is detected and
> 	reported through Synchronous External Abort (SEA). By marking
> 	the kernel as tainted at the point of error, we improve
> 	post-mortem diagnostics and make it clear that a machine check
> 	or unrecoverable hardware fault has occurred.
> 
> 	Suggested-by: Will Deacon <will@kernel.org>
> 	Signed-off-by: Breno Leitao <leitao@debian.org>
> 
> 	diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c
> 	index 11eb8d1adc84..f590dc71ce99 100644
> 	--- a/arch/arm64/mm/fault.c
> 	+++ b/arch/arm64/mm/fault.c
> 	@@ -838,6 +838,7 @@ static int do_sea(unsigned long far, unsigned long esr, struct pt_regs *regs)
> 			*/
> 			siaddr  = untagged_addr(far);
> 		}
> 	+	add_taint(TAINT_MACHINE_CHECK, LOCKDEP_STILL_OK);
> 		arm64_notify_die(inf->name, regs, inf->sig, inf->code, siaddr, esr);
> 
> 		return 0;

Yeah, I reckon so. Probably just fold these into a single patch, though.

Cheers,

Will


  reply	other threads:[~2025-07-15 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-10 10:46 [PATCH] arm64: traps: Mark kernel as tainted on SError panic Breno Leitao
2025-07-13 22:46 ` Will Deacon
2025-07-14 12:26   ` Breno Leitao
2025-07-15 14:02     ` Will Deacon [this message]
2025-07-15 16:09       ` Breno Leitao

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=aHZfZbxLGyFjJpNo@willie-the-truck \
    --to=will@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kernel-team@meta.com \
    --cc=leitao@debian.org \
    --cc=leo.yan@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@fb.com \
    --cc=rmikey@meta.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