From: Borislav Petkov <bp@alien8.de>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Jarkko Sakkinen <jarkko.sakkinen@intel.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>,
clang-built-linux <clang-built-linux@googlegroups.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
<x86@kernel.org>, Tri Vo <trong@android.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Rob Herring <robh@kernel.org>,
George Rimar <grimar@accesssoftek.com>,
LKML <linux-kernel@vger.kernel.org>,
Fangrui Song <maskray@google.com>,
Peter Smith <Peter.Smith@arm.com>, Rui Ueyama <ruiu@google.com>
Subject: Re: [PATCH v2] x86, realmode: explicitly set entry via command line
Date: Wed, 25 Sep 2019 19:10:25 +0200 [thread overview]
Message-ID: <20190925171025.GF3891@zn.tnic> (raw)
In-Reply-To: <CAKwvOdneE7kMupFzxZC-6c=ps_98FP+Nz88fCXQ74z90hmaaXQ@mail.gmail.com>
On Wed, Sep 25, 2019 at 09:35:24AM -0700, Nick Desaulniers wrote:
> Thanks for the consideration Boris. So IIUC if the preceding sections
> are larger than 0x1000 altogether, setting the entry there will be
> wrong?
Well, I spent some time this morning grepping to find out whether PA
0x1000 was magical but didn't find anything. Perhaps hpa can refresh my
memory...
> Currently, .text looks like it's currently at 0x1000 for a defconfig,
> and I assume that could move in the case I stated above?
Yes, I think we shouldn't hardcode.
> $ readelf -S arch/x86/realmode/rm/realmode.elf | grep text
> [ 3] .text PROGBITS 00001000 201000 000f51 00 AX
> 0 0 4096
> ...
>
> In that case, it seems that maybe I should set the ENTRY in the linker
> script as:
> diff --git a/arch/x86/realmode/rm/realmode.lds.S
> b/arch/x86/realmode/rm/realmode.lds.S
> index 3bb980800c58..64d135d1ee63 100644
> --- a/arch/x86/realmode/rm/realmode.lds.S
> +++ b/arch/x86/realmode/rm/realmode.lds.S
> @@ -11,6 +11,7 @@
>
> OUTPUT_FORMAT("elf32-i386")
> OUTPUT_ARCH(i386)
> +ENTRY(pa_text_start)
Well, looking at arch/x86/boot/setup.ld, it does do:
ENTRY(_start)
for the global _start symbol in .../boot/header.S.
So you doing the respective thing in that linker script would make
sense...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2019-09-25 17:10 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-23 22:24 [PATCH] x86, realmode: explicitly set ENTRY in linker script Nick Desaulniers
2019-09-24 17:30 ` Sedat Dilek
2019-09-24 18:24 ` Nathan Chancellor
2019-09-24 18:32 ` Nick Desaulniers
2019-09-24 19:33 ` [PATCH v2] x86, realmode: explicitly set entry via command line Nick Desaulniers
2019-09-24 19:37 ` Nick Desaulniers
2019-09-25 10:20 ` Borislav Petkov
2019-09-25 16:35 ` Nick Desaulniers
2019-09-25 17:02 ` Peter Smith
2019-09-25 17:10 ` Borislav Petkov [this message]
2019-09-25 18:09 ` [PATCH v3] x86, realmode: explicitly set entry via ENTRY in linker script Nick Desaulniers
2019-10-01 10:37 ` [tip: x86/boot] x86/realmode: Explicitly set entry point " tip-bot2 for Nick Desaulniers
2019-10-01 20:18 ` tip-bot2 for Nick Desaulniers
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=20190925171025.GF3891@zn.tnic \
--to=bp@alien8.de \
--cc=Peter.Smith@arm.com \
--cc=clang-built-linux@googlegroups.com \
--cc=grimar@accesssoftek.com \
--cc=hpa@zytor.com \
--cc=jarkko.sakkinen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maskray@google.com \
--cc=mingo@redhat.com \
--cc=ndesaulniers@google.com \
--cc=robh@kernel.org \
--cc=ruiu@google.com \
--cc=tglx@linutronix.de \
--cc=trong@android.com \
--cc=x86@kernel.org \
--cc=yamada.masahiro@socionext.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).