public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: Conor Dooley <conor.dooley@microchip.com>,
	Alexandre Ghiti <alexghiti@rivosinc.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Andreas Schwab <schwab@linux-m68k.org>,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -fixes] riscv: Fix relocatable kernels with early alternatives using -fno-pie
Date: Tue, 30 May 2023 18:47:18 +0100	[thread overview]
Message-ID: <20230530-hatchery-unifier-64d7a2ffe0d0@spud> (raw)
In-Reply-To: <92d4aaa8-a1ed-74e1-3a22-df9be1ca1e4a@ghiti.fr>

[-- Attachment #1: Type: text/plain, Size: 3630 bytes --]

On Tue, May 30, 2023 at 04:33:45PM +0200, Alexandre Ghiti wrote:
> 
> On 30/05/2023 13:27, Conor Dooley wrote:
> > On Mon, May 29, 2023 at 09:37:28PM +0200, Alexandre Ghiti wrote:
> > > On 29/05/2023 21:06, Conor Dooley wrote:
> > > > On Mon, May 29, 2023 at 08:51:57PM +0200, Alexandre Ghiti wrote:
> > > > > On 28/05/2023 15:56, Conor Dooley wrote:
> > > > > > On Sun, May 28, 2023 at 03:42:59PM +0200, Alexandre Ghiti wrote:
> > > > > > > Hmmm, it still works for me with both clang and gcc-9.
> > > > > > gcc-9 is a bit of a relic, do you have more recent compilers lying
> > > > > > around? If not, I can try some older compilers at some point.
> > > > > > 
> > > > > > > You don't have to do that now but is there a way I could get your compiled
> > > > > > > image? With the sha1 used to build it? Sorry, I don't see what happens, I
> > > > > > > need to get my hands dirty in some debug!
> > > > > > What do you mean by "sha1"? It falls with v6.4-rc1 which is a stable
> > > > > > hash, if that's what you're looking for.
> > > > > > 
> > > > > > Otherwise,
> > > > > > https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vmlinux.bin
> > > > > > (ignore the release crap haha, too lazy to find a proper hosting
> > > > > > mechanism)
> > > > > Ok, I don't get much info without the symbols, can you also provide the
> > > > > vmlinux please? But at least your image does not boot, not during the early
> > > > > boot though because the mmu is enabled.
> > > > Do you see anything print when you try it? Cos I do not. Iff I have time
> > > > tomorrow, I'll go poking with gdb. I'm sorry I have not really done any
> > > > investigating, I have been really busy this last week or so with
> > > > dt-binding stuff but I should be freer again from tomorrow.
> > > > 
> > > > https://github.com/ConchuOD/riscv-env/releases/download/v2022.03/vmlinux
> > > 
> > > Better, the trap happens in kasan_early_init() when it tries to access a
> > > global symbol using the GOT but ends up with a NULL pointer, which is weird.
> > > So to me, this is not related to kasan, it happens that kasan_early_init()
> > > is the first function called after enabling the mmu, I think you may have an
> > > issue with the filling of the relocations.
> > Yeah, it reproduces without KASAN.
> > 
> > > Sorry to bother you again, but if
> > > at some point you can recompile with DEBUG_INFO enabled, that would be
> > > perfect! And also provide the vmlinux.relocs file. Sorry for all that, too
> > > bad I can't reproduce it.
> > New vmlinux & vmlinux.relocs here:
> > https://microchiptechnology-my.sharepoint.com/:u:/g/personal/conor_dooley_microchip_com/EZpFNxYYrnNAh5Z3c-rf0pUBBpdPGTLafqdtfcXRUUBkXw?e=7KKMHX
> > They're pretty massive unfortunately & hopefully that is not some
> > garbage internal-only link.
> > .config is a wee bit different, cos different build machine, but the
> > problem still manifests on a icicle. I've added it to the tarball just
> > in case.
> 
> 
> Ok so I had to recreate the Image from the files you gave me and it boots
> fine using qemu: is that expected? Because you only mention the icicle
> above.

Unfortunately you sent this one right as I left work..
I ssh'ed in though and ran the vmlinux.bin & had the same issues.
Silly question perhaps - is it just not possible to boot something that
has been hit with `objcopy -O binary vmlinux vmlinux.bin` with
CONFIG_RELOCATABLE? At this point that's the main thing that sticks out
to me as being different. You couldn't boot the vmlinux.bin that I sent
you either.

Cheers,
Conor.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-05-30 17:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26 15:46 [PATCH -fixes] riscv: Fix relocatable kernels with early alternatives using -fno-pie Alexandre Ghiti
2023-05-26 16:24 ` Conor Dooley
2023-05-26 16:35   ` Conor Dooley
2023-05-27  9:13     ` Alexandre Ghiti
2023-05-27 10:02       ` Conor Dooley
2023-05-28 13:00         ` Alexandre Ghiti
2023-05-28 13:12           ` Conor Dooley
2023-05-28 13:42             ` Alexandre Ghiti
2023-05-28 13:56               ` Conor Dooley
2023-05-29 18:51                 ` Alexandre Ghiti
2023-05-29 19:06                   ` Conor Dooley
2023-05-29 19:37                     ` Alexandre Ghiti
2023-05-30 11:27                       ` Conor Dooley
2023-05-30 14:33                         ` Alexandre Ghiti
2023-05-30 17:47                           ` Conor Dooley [this message]
2023-05-30 18:04                             ` Alexandre Ghiti
2023-05-30 20:22                               ` Conor Dooley
2023-05-31  7:26                                 ` Alexandre Ghiti
2023-05-31  9:32                                   ` Conor Dooley
2023-05-31 11:03                                     ` Alexandre Ghiti
2023-05-26 16:38   ` Alexandre Ghiti
2023-05-31 15:03 ` Palmer Dabbelt
2023-05-31 15:10 ` patchwork-bot+linux-riscv

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=20230530-hatchery-unifier-64d7a2ffe0d0@spud \
    --to=conor@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=alexghiti@rivosinc.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor.dooley@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=schwab@linux-m68k.org \
    /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