linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Mark Rutland <mark.rutland@arm.com>
To: Kalesh Singh <kaleshsingh@google.com>
Cc: "moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)"
	<linux-arm-kernel@lists.infradead.org>,
	Mark Brown <broonie@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	James Morse <james.morse@arm.com>,
	"Madhavan T. Venkataraman" <madvenka@linux.microsoft.com>,
	Marc Zyngier <maz@kernel.org>, Fuad Tabba <tabba@google.com>,
	Will Deacon <will@kernel.org>
Subject: Re: [PATCH 3/8] arm64: stacktrace: move SDEI stack helpers to stacktrace code
Date: Tue, 2 Aug 2022 13:26:36 +0100	[thread overview]
Message-ID: <YukX/CKMNATdesdB@FVFF77S0Q05N> (raw)
In-Reply-To: <CAC_TJvf+Ri6Y1U6Q2wuZ1BhQy7nuzzMtWaXThgBWsEPafNMhyw@mail.gmail.com>

Hi Kalesh,

On Mon, Aug 01, 2022 at 09:53:35PM -0700, Kalesh Singh wrote:
> On Mon, Aug 1, 2022 at 5:12 AM Mark Rutland <mark.rutland@arm.com> wrote:
> > diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c
> > index 4c8865e495fea..04a9b56b114c1 100644
> > --- a/arch/arm64/kernel/stacktrace.c
> > +++ b/arch/arm64/kernel/stacktrace.c
> > @@ -86,8 +86,17 @@ static bool on_accessible_stack(const struct task_struct *tsk,
> >                 return true;
> >         if (on_overflow_stack(sp, size, info))
> >                 return true;
> > -       if (on_sdei_stack(sp, size, info))
> > -               return true;
> > +
> > +       if (IS_ENABLED(CONFIG_VMAP_STACK) &&
> > +           IS_ENABLED(CONFIG_ARM_SDE_INTERFACE) &&
> > +           in_nmi())
> 
> I think we can remove the IS_ENABLED() checks since it's handled by
> ifdefs in asm/stacktrace.h
> 
> Otherwise, Reviewed-by: Kalesh Singh <kaleshsingh@google.com>

I'd kept the IS_ENABLED() checks here to avoid code being generated of in_nmi()
when SDEI is not configured in. Since in_nmi() uses preempt_count() and that
uses READ_ONCE(), the compiler can't optimize the read away in case there are
side effects (but I imagine will discard the value immediately).

With that in mind, are you happy if I leave this as is, and take your
Reviewed-by?

Thanks,
Mark.

> 
> > +       {
> > +               if (on_sdei_critical_stack(sp, size, info))
> > +                       return true;
> > +
> > +               if (on_sdei_normal_stack(sp, size, info))
> > +                       return true;
> > +       }
> >
> >         return false;
> >  }
> > --
> > 2.30.2
> >

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2022-08-02 12:28 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-01 12:12 [PATCH 0/8] arm64: stacktrace: cleanups and improvements Mark Rutland
2022-08-01 12:12 ` [PATCH 1/8] arm64: stacktrace: simplify unwind_next_common() Mark Rutland
2022-08-01 12:46   ` Mark Brown
2022-08-02  4:34   ` Kalesh Singh
2022-08-01 12:12 ` [PATCH 2/8] arm64: stacktrace: rename unwind_next_common() -> unwind_next_frame_record() Mark Rutland
2022-08-01 12:52   ` Mark Brown
2022-08-02  4:38   ` Kalesh Singh
2022-08-01 12:12 ` [PATCH 3/8] arm64: stacktrace: move SDEI stack helpers to stacktrace code Mark Rutland
2022-08-01 12:48   ` Mark Brown
2022-08-02  4:53   ` Kalesh Singh
2022-08-02 12:26     ` Mark Rutland [this message]
2022-08-02 16:31       ` Kalesh Singh
2022-08-04 14:38   ` Mark Rutland
2022-08-01 12:12 ` [PATCH 4/8] arm64: stacktrace: add stackinfo_on_stack() helper Mark Rutland
2022-08-01 15:56   ` Mark Brown
2022-08-02  5:00   ` Kalesh Singh
2022-08-01 12:12 ` [PATCH 5/8] arm64: stacktrace: rework stack boundary discovery Mark Rutland
2022-08-01 17:14   ` Mark Brown
2022-08-02  5:22   ` Kalesh Singh
2022-08-02 12:29     ` Mark Rutland
2022-08-01 12:12 ` [PATCH 6/8] arm64: stacktrace: remove stack type from fp translator Mark Rutland
2022-08-02  5:32   ` Kalesh Singh
2022-08-03 12:36   ` Mark Brown
2022-08-01 12:12 ` [PATCH 7/8] arm64: stacktrace: track all stack boundaries explicitly Mark Rutland
2022-08-02 16:05   ` Kalesh Singh
2022-08-01 12:12 ` [PATCH 8/8] arm64: stacktrace: track hyp stacks in unwinder's address space Mark Rutland
2022-08-02 16:27   ` Kalesh Singh
2022-08-02 17:48     ` Mark Rutland

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=YukX/CKMNATdesdB@FVFF77S0Q05N \
    --to=mark.rutland@arm.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=james.morse@arm.com \
    --cc=kaleshsingh@google.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=madvenka@linux.microsoft.com \
    --cc=maz@kernel.org \
    --cc=tabba@google.com \
    --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;
as well as URLs for NNTP newsgroup(s).