[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cb9978537cc64941cfc607f2b8b38fa7f7eea884.camel@infradead.org>
Date: Fri, 14 Mar 2025 18:29:08 +0000
From: David Woodhouse <dwmw2@...radead.org>
To: Josh Poimboeuf <jpoimboe@...nel.org>
Cc: kexec@...ts.infradead.org, Thomas Gleixner <tglx@...utronix.de>, Ingo
Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>, Dave Hansen
<dave.hansen@...ux.intel.com>, x86@...nel.org, "H . Peter Anvin"
<hpa@...or.com>, "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Kai Huang <kai.huang@...el.com>, Nikolay Borisov <nik.borisov@...e.com>,
linux-kernel@...r.kernel.org, Simon Horman <horms@...nel.org>, Dave Young
<dyoung@...hat.com>, Peter Zijlstra <peterz@...radead.org>, bsz@...zon.de
Subject: Re: [PATCH v7 8/8] [DO NOT MERGE] x86/kexec: Add CFI type
information to relocate_kernel()
On Fri, 2025-03-14 at 10:52 -0700, Josh Poimboeuf wrote:
> On Fri, Mar 14, 2025 at 05:23:15PM +0000, David Woodhouse wrote:
> > ISTR this version is OK with Clang and CONFIG_CFI_CLANG but with GCC I
> > get this:
> >
> > vmlinux.o: warning: objtool: relocate_kernel+0x69: unsupported stack register modification
> >
> > /* setup a new stack at the end of the physical control page */
> > lea PAGE_SIZE(%rsi), %rsp
> > 79: 48 8d a6 00 10 00 00 lea 0x1000(%rsi),%rsp
> >
> >
> > Maybe the answer is to put the UNWIND_HINT_FUNC into #ifdef
> > CONFIG_CFI_CLANG but that seems wrong.
>
> The UNWIND_HINT_FUNC definitely looks wrong, why would Clang need it?
I think it's when CONFIG_CFI_CLANG makes the SYM_TYPED_FUNC_START()
macro actually emit the CFI prologue?
> > I'll have another look at putting it in the data section, and see if I
> > can remember why I didn't want to do that before (and if that's still
> > relevant now).
>
> IIRC, the reasons were the patched alternative, and also you wanted to
> disassemble (but note that's still possible with gdb).
>
> Here was a patch to make it work:
>
> https://lore.kernel.org/20241218212326.44qff3i5n6cxuu5d@jpoimboe
Yeah, that does seem reasonable. Sorry, I think I missed that before
Christmas. I'll look at rolling it in. This part is kind of orthogonal
to the actual debug support so it's fine to keep it separate.
Thanks.
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5069 bytes)
Powered by blists - more mailing lists