From: Borislav Petkov <bp@alien8.de>
To: Steve Wahl <steve.wahl@hpe.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
clang-built-linux@googlegroups.com, vaibhavrustagi@google.com,
russ.anderson@hpe.com, dimitri.sivanich@hpe.com,
mike.travis@hpe.com
Subject: Re: [PATCH 1/1] x86/purgatory: Change compiler flags to avoid relocation errors.
Date: Thu, 5 Sep 2019 18:46:39 +0200 [thread overview]
Message-ID: <20190905164639.GG19246@zn.tnic> (raw)
In-Reply-To: <20190905150738.GD14263@swahl-linux>
On Thu, Sep 05, 2019 at 10:07:38AM -0500, Steve Wahl wrote:
> kexec: Overflow in relocation type 11 value 0x11fffd000
That looks like R_X86_64_32S which is:
"The linker must verify that the generated value for the R_X86_64_32
(R_X86_64_32S) relocation zero-extends (sign-extends) to the original
64-bit value."
Please add that to the commit message.
> ... when loading the crash kernel.
>
> > What exactly caused those errors, the flags removal from
> > kexec-purgatory.o?
>
> No, it's the flags for compiling the other objects (purgatory.o,
> sha256.o, and string.o) that cause the problem. You may have missed
> the added initial values for PURGATORY_CFLAGS_REMOVE and
> PURGATORY_CFLAGS. This changes -mcmodel=kernel back to
> -mcmodel=large,
That I missed...
> and adds back -ffreestanding and
> -fno-zero-initialized-in-bss, to match the previous flags.
... and that I saw. :)
> -mcmodel=kernel is the major cause of the relocation errors, as the
> code generated contained only 32 bit references to things that can be
> anywhere in 64 bit address space.
Needs to go into the commit message.
> The remaining flag changes are appropriate for compiling a standalone
> module, which applies to 3 of the objects compiled from C files in
> this directory -- they contribute to a standalone piece of code that
> is not (technically) linked with the rest of the kernel.
>
> (Fine line here: the standalone binary does not get any symbols
> resolved against the rest of the kernel; which is why I say it's not
> *linked* with it. The binary image of this standalone binary does get
> put into a character array that is pulled into the kernel object code,
> so it does become part of the kernel, but just as an array of bytes
> that kexec copies somewhere and eventually jumps to as a standalone
> program.)
Yes, a shorter version of that should be part of the commit message too.
> kexec-purgatory.o, on the other hand, does get linked with the rest of
> the kernel and should be compiled with the usual flags, not standalone
> flags. That is why changes for it are a bit different, which you
> noticed.
Ok, thanks for explaining.
Now please add that more detailed explanation to your commit message so
that people doing git archeology in the future can gather from it what
the problem was and what the solution became and why.
Also, add the reviewed- and tested-by flags you got from people.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
prev parent reply other threads:[~2019-09-05 16:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 21:45 Steve Wahl
2019-09-04 22:18 ` Nick Desaulniers
2019-09-04 22:28 ` Vaibhav Rustagi
2019-09-05 0:19 ` Vaibhav Rustagi
2019-09-05 0:23 ` Nick Desaulniers
2019-09-04 22:53 ` Randy Dunlap
2019-09-05 5:34 ` Andreas Smas
2019-09-05 18:19 ` Nick Desaulniers
2019-09-05 20:00 ` Andreas Smas
2019-09-05 9:15 ` Borislav Petkov
2019-09-05 15:07 ` Steve Wahl
2019-09-05 16:46 ` Borislav Petkov [this message]
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=20190905164639.GG19246@zn.tnic \
--to=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=dimitri.sivanich@hpe.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.travis@hpe.com \
--cc=ndesaulniers@google.com \
--cc=russ.anderson@hpe.com \
--cc=steve.wahl@hpe.com \
--cc=vaibhavrustagi@google.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
all inboxes | Powered by JetHome®