From: Steve Wahl <steve.wahl@hpe.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Steve Wahl <steve.wahl@hpe.com>,
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 10:07:38 -0500 [thread overview]
Message-ID: <20190905150738.GD14263@swahl-linux> (raw)
In-Reply-To: <20190905091514.GA21479@zn.tnic>
On Thu, Sep 05, 2019 at 11:15:14AM +0200, Borislav Petkov wrote:
> On Wed, Sep 04, 2019 at 04:45:05PM -0500, Steve Wahl wrote:
> > The last change to this Makefile caused relocation errors when loading
> > a kdump kernel.
>
> How do those relocation errors look like?
kexec: Overflow in relocation type 11 value 0x11fffd000
... 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, and adds back -ffreestanding and
-fno-zero-initialized-in-bss, to match the previous flags.
-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.
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.)
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.
> Can we have the failure properly explained in the commit message pls?
Is " 'kexec: Overflow in relocation type 11 value 0x11fffd000' when
loading the crash kernel" sufficient, or would you like more?
> > This change restores the appropriate flags, without
>
> You don't have to say "This change" in the commit message - it is
> obvious which change you're talking about. Instead say: "Restore the
> appropriate... "
OK.
--> Steve
--
Steve Wahl, Hewlett Packard Enterprise
next prev parent reply other threads:[~2019-09-05 15:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-04 21:45 [PATCH 1/1] x86/purgatory: Change compiler flags to avoid relocation errors 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 [this message]
2019-09-05 16:46 ` Borislav Petkov
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=20190905150738.GD14263@swahl-linux \
--to=steve.wahl@hpe.com \
--cc=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=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;
as well as URLs for NNTP newsgroup(s).