[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200910173414.GD4898@sirena.org.uk>
Date: Thu, 10 Sep 2020 18:34:14 +0100
From: Mark Brown <broonie@...nel.org>
To: Mark Rutland <mark.rutland@....com>
Cc: Miroslav Benes <mbenes@...e.cz>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will@...nel.org>,
Vasily Gorbik <gor@...ux.ibm.com>,
Heiko Carstens <hca@...ux.ibm.com>,
Borislav Petkov <bp@...en8.de>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>,
Christian Borntraeger <borntraeger@...ibm.com>,
Ingo Molnar <mingo@...nel.org>,
Jiri Slaby <jirislaby@...nel.org>, x86@...nel.org,
linux-arm-kernel@...ts.infradead.org, linux-s390@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] arm64: stacktrace: Convert to ARCH_STACKWALK
On Wed, Sep 02, 2020 at 07:50:27PM +0100, Mark Rutland wrote:
> On Wed, Sep 02, 2020 at 11:32:13AM +0200, Miroslav Benes wrote:
> > > - start_backtrace(&frame,
> > > - (unsigned long)__builtin_frame_address(0),
> > > - (unsigned long)__save_stack_trace);
> Oh whoops; I'm annoyed I didn't spot that.
> With that gone this cannot work for (task == current && regs == NULL), as
> we'll erroneously use stale values from the task struct.
I remember somehow convincing myself at the time I originally did this
that doing the above was redundant with the new interface but that was
quite some time ago and I can't reconstruct my reasoning any more, I'm
pretty sure I was just mistaken. I've added it back in, thanks for
spotting this.
> It looks like the LKDTM tests only trigger cases with non-NULL regs, but
> IIUC this should show up with show_stack(NULL, NULL, KERN_INFO), as
> drivers/tty/sysrq.c does for other cpus.
show_stack() doesn't go through this bit of the stacktrace code, it goes
through dump_backtrace() in traps.c which used the underlying arch
specific unwinder directly so is unaffected by arch_stack_walk().
Actually now I look at LKDTM it's ending up using show_stack() mostly
if not entirely so my testing with it was not exercising this change
as much as might be expected anyway (the modified code was getting hit
by other things like /proc/N/stack).
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists