[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9ee61d2b89b4cecd10ece64002bf2c06648e1de7.camel@infradead.org>
Date: Tue, 17 Dec 2024 13:03:07 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Nathan Chancellor <nathan@...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>,
jpoimboe@...nel.org, bsz@...zon.de
Subject: Re: [PATCH v5 07/20] x86/kexec: Invoke copy of relocate_kernel()
instead of the original
On Mon, 2024-12-16 at 12:09 +0000, David Woodhouse wrote:
> On Sun, 2024-12-15 at 22:49 -0700, Nathan Chancellor wrote:
> > On Sun, Dec 15, 2024 at 10:09:57AM +0000, David Woodhouse wrote:
> > > On Sat, 2024-12-14 at 16:08 -0700, Nathan Chancellor wrote:
> > > >
> > > > I guess this seems somewhat unavoidable because control_page is just a
> > > > 'void *', perhaps machine_kexec() should just be marked as __nocfi? This
> > > > diff resolves that issue for me.
> > >
> > > The patch below seems to work too. I already wanted to deal with the
> >
> > Can confirm, thanks for the quick fix. With your fix for the first issue
> > I reported, the fix I sent for LTO, and this patch below, I can kexec on
> > a CFI and LTO enabled kernel without any issues.
>
> Argh, using SYM_TYPED_FUNC_START() leads to objtool having more opinions.
>
> I have the Clang build working in my tree now, but the GCC build now complains
>
> vmlinux.o: warning: objtool: relocate_kernel+0x0: unreachable instruction
>
> It seems like adding UNWIND_HINT_FUNC ought to be the answer for that?
> But then it complains about this instead:
>
> vmlinux.o: warning: objtool: relocate_kernel+0x69: unsupported stack register modification
>
> That's the lea instruction at
> lea PAGE_SIZE(%rsi), %rsp
> 79: 48 8d a6 00 10 00 00 lea 0x1000(%rsi),%rsp
>
> I've pushed what I have to my kexec-debug branch; I was hoping to post
> the fixes for the tip/x86/boot branch this morning but I've run out of
> time and will be travelling for the rest of the week. Will try to get
> something sent out this evening when I land.
>
> I may resort to the __nocfi option for now. As noted on the typedef
> patch and in IRC, the whole SYM_TYPED_FUNC_START() thing using the type
> information from the *C* code which is actually doing the call anyway,
> is a bit tautological anyway.
I've dropped this for now and just posted the __nocfi thing as the
regression fix. I think we *should* provide the CFI information in
relocate_kernel_64.S though, so I've left these commits in my tree at
https://git.infradead.org/?p=users/dwmw2/linux.git;a=shortlog;h=refs/heads/kexec-debug
I'd really appreciate some help in getting objtool to stop whining
about them, for *both* Clang and GCC builds at the same time :)
Download attachment "smime.p7s" of type "application/pkcs7-signature" (5965 bytes)
Powered by blists - more mailing lists