All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Arnd Bergmann <arnd@arndb.de>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Russell King - ARM Linux <linux@armlinux.org.uk>
Subject: Re: [PATCH 2/2] ARM: axxia: remove TEXT_OFFSET override hack
Date: Tue, 12 Jan 2021 15:05:53 +0100	[thread overview]
Message-ID: <CAMj1kXHnQh8p_iXu+2wKCKZOOdGvRMLGZswFYumX4gMatWvBiQ@mail.gmail.com> (raw)
In-Reply-To: <b5cd54f8-2cfb-36af-3c0e-887dae8618fb@nokia.com>

On Tue, 12 Jan 2021 at 14:55, Alexander Sverdlin
<alexander.sverdlin@nokia.com> wrote:
>
> Hi Ard,
>
> On 12/01/2021 11:40, Ard Biesheuvel wrote:
> >>> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
> >>> ---
> >>>  arch/arm/Makefile | 1 -
> >>>  1 file changed, 1 deletion(-)
> >>>
> >>> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> >>> index 4aaec9599e8a..c0496983198f 100644
> >>> --- a/arch/arm/Makefile
> >>> +++ b/arch/arm/Makefile
> >>> @@ -151,7 +151,6 @@ textofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000
> >>>  textofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
> >>>  textofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
> >>>  textofs-$(CONFIG_ARCH_MESON) := 0x00208000
> >>> -textofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
> >>>
> >>>  # Machine directory name.  This list is sorted alphanumerically
> >>>  # by CONFIG_* macro name.
> >> What should the users of uncompressed kernel do with their legacy bootloaders?
> >> I've tested you patch and AXXIA bootloader is not able to deal with 0x8000 default
> >> load address...
> >>
> > I am not sure I understand why this makes a difference. Does the AXXIA
> > bootloader take the load address from the uncompressed image somehow?
> >
> > I would assume that the bootloader knows about the memory reservation
> > at the base of DRAM, and places the kernel image outside of it. That
> > kernel image can now run at any offset of the start of DRAM modulo 2
> > MB.
> >
> > Maybe the issue is that the old offset is 3 MiB?
>
> Some more info from the AXXIA U-Boot, include/configs/axxia.arm.h:
>
> #define CONFIG_UBOOT_REGION_SIZE        0x400000
> #define CONFIG_FEMAC_DMA_SIZE           0x40000
> #define CONFIG_FEMAC_DMA_START          (CONFIG_UBOOT_REGION_SIZE - CONFIG_FEMAC_DMA_SIZE)
>
> From what I see in same file the layout seems to be:
> Start: 0
> CodeEnd: 0x200000
> StackTop: 0x260000
> HeapTop: 0x3C0000
> FEMAC_Top: 0x400000
>
> So the previous 0x308000 worked overwriting U-Boot heap, but
> going down to 0x8000 actually overwrites U-Boot code and everything explodes...
>

It is rather disappointing that the axxia bootloader is so braindead
that it will overwrite itself if vmlinux is not built with a huge hole
at the beginning.

I guess that rules out any cleanup we might attempt to do here.

Thanks for testing,

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-12 14:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-11 10:30 [PATCH 0/2] ARM: remove TEXT_OFFSET override for Axxia Ard Biesheuvel
2021-01-11 10:30 ` [PATCH 1/2] ARM: take memreserve FDT entries into account when discovering base of RAM Ard Biesheuvel
2021-01-11 10:30 ` [PATCH 2/2] ARM: axxia: remove TEXT_OFFSET override hack Ard Biesheuvel
2021-01-12 10:34   ` Alexander Sverdlin
2021-01-12 10:40     ` Ard Biesheuvel
2021-01-12 11:22       ` Alexander Sverdlin
2021-01-12 13:55       ` Alexander Sverdlin
2021-01-12 14:05         ` Ard Biesheuvel [this message]
2021-01-12 14:21           ` Alexander Sverdlin
2021-01-13 17:49             ` Ard Biesheuvel
2021-01-13 21:26               ` Russell King - ARM Linux admin
2021-01-13 22:43                 ` Ard Biesheuvel

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=CAMj1kXHnQh8p_iXu+2wKCKZOOdGvRMLGZswFYumX4gMatWvBiQ@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=alexander.sverdlin@nokia.com \
    --cc=arnd@arndb.de \
    --cc=geert+renesas@glider.be \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.