linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ardb@kernel.org>
To: Felix Fietkau <nbd@nbd.name>
Cc: "Arnd Bergmann" <arnd@arndb.de>, "Bert Vermeulen" <bert@biot.com>,
	DTML <devicetree@vger.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>,
	"Linux ARM" <linux-arm-kernel@lists.infradead.org>,
	"Russell King" <linux@armlinux.org.uk>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"Anshuman Khandual" <anshuman.khandual@arm.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski@canonical.com>,
	"John Crispin" <john@phrozen.org>,
	"YiFei Zhu" <yifeifz2@illinois.edu>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Kees Cook" <keescook@chromium.org>,
	"Masahiro Yamada" <masahiroy@kernel.org>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Viresh Kumar" <viresh.kumar@linaro.org>
Subject: Re: [PATCH 4/5] ARM: Add basic support for EcoNet EN7523 SoC
Date: Fri, 3 Sep 2021 19:47:12 +0200	[thread overview]
Message-ID: <CAMj1kXHGfTSv+95NJF1BPS76M6-6FF9GQk24L2LLG9Epx4FpfA@mail.gmail.com> (raw)
In-Reply-To: <7d3e2c5b-931c-1f82-77a3-fc51268f1986@nbd.name>

On Fri, 3 Sept 2021 at 18:20, Felix Fietkau <nbd@nbd.name> wrote:
>
>
> On 2021-08-01 18:44, Ard Biesheuvel wrote:
> > On Fri, 30 Jul 2021 at 16:48, Arnd Bergmann <arnd@arndb.de> wrote:
> >>
> >> Why is this needed?
> >>
> >> Note also the comment directly above it exlaining
> >> # Text offset. This list is sorted numerically by address in order to
> >> # provide a means to avoid/resolve conflicts in multi-arch kernels.
> >>
> >
> > Yes, please drop this - it is a horrible hack and it's already quite
> > disappointing that we are stuck with it for the foreseeable future.
> >
> > So I assume the purpose of this is to protect the first 128k of DRAM
> > to be protected from being overwritten by the decompressor?
> >
> > It would be best to move this reserved region elsewhere, but I can
> > understand that this is no longer an option. So the alternatives are
> > - omit this window from the /memory node, and rely on Geert's recent
> > decompressor changes which make it discover the usable memory from the
> > DT, or
> > - better would be to use a /memreserve/ here (which you may already
> > have?), and teach the newly added decompressor code to take those into
> > account when choosing the target window for decompressing the kernel.
> I looked into this issue myself and found that this approach has a
> significant drawback: 2 MiB of RAM is permanently wasted for something
> that only needs to be preserved during boot time.
>

How so? If that memory region carries your PSCI implementation, it
should be preserved permanently. So at least the 512k are permanently
reserved.

> If the first 256 or 512 KiB of RAM are reserved in the decompressor, it
> means that the first 2 MiB need to be reserved, because that's the
> granularity for the kernel page mapping when the MMU is turned on.
>

Indeed.

> If we reserve it, we also need to need to take it out of the physical
> RAM address range, so there's no way to reclaim it later.
>
> On the other hand, with the simple textofs solution, I believe it gets
> freed in a late initcall, making it usable.
>
> So what's the right approach to deal with this?
>

The right solution here is to fix your firmware/bootloader so that the
PSCI reserved region is moved to the top of memory. Adding more
TEXT_OFFSET hacks is really not the right approach here.

  reply	other threads:[~2021-09-03 17:47 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 13:45 [PATCH 0/4] Add " Bert Vermeulen
2021-07-30 13:45 ` [PATCH 1/5] dt-bindings: Add vendor prefix for EcoNet Bert Vermeulen
2021-08-06 21:02   ` Rob Herring
2021-07-30 13:45 ` [PATCH 2/5] dt-bindings: arm: econet: Add binding for EN7523 SoC and EVB Bert Vermeulen
2021-08-06 21:04   ` Rob Herring
2021-07-30 13:45 ` [PATCH 3/5] ARM: dts: Add basic support for EcoNet EN7523 Bert Vermeulen
2021-07-30 14:31   ` Linus Walleij
     [not found]     ` <87y29n26po.wl-maz@kernel.org>
2021-08-01  9:07       ` Bert Vermeulen
2021-08-01  9:40         ` Arnd Bergmann
2021-07-30 14:45   ` Daniel Palmer
2021-07-30 14:46   ` Mark Rutland
2021-08-04 16:41     ` Bert Vermeulen
2021-08-06 20:59       ` Rob Herring
2021-07-30 14:59   ` Mark Rutland
2021-08-06 20:52     ` Rob Herring
2021-07-30 16:47   ` Andre Przywara
2021-07-30 13:45 ` [PATCH 4/5] ARM: Add basic support for EcoNet EN7523 SoC Bert Vermeulen
2021-07-30 14:48   ` Arnd Bergmann
2021-07-30 15:15     ` John Crispin
2021-07-30 16:55       ` Arnd Bergmann
2021-08-01 16:44     ` Ard Biesheuvel
2021-09-03 16:20       ` Felix Fietkau
2021-09-03 17:47         ` Ard Biesheuvel [this message]
2021-08-04 16:43     ` Bert Vermeulen
2021-08-09 12:46       ` Geert Uytterhoeven
2021-08-09 12:49         ` Ard Biesheuvel
2021-08-09 13:00         ` Bert Vermeulen
2021-07-30 13:45 ` [PATCH 5/5] ARM: multi_v7_defconfig: Add " Bert Vermeulen
2021-07-30 14:26 ` [PATCH 0/4] " Linus Walleij

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=CAMj1kXHGfTSv+95NJF1BPS76M6-6FF9GQk24L2LLG9Epx4FpfA@mail.gmail.com \
    --to=ardb@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=anshuman.khandual@arm.com \
    --cc=arnd@arndb.de \
    --cc=bert@biot.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert+renesas@glider.be \
    --cc=john@phrozen.org \
    --cc=keescook@chromium.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=masahiroy@kernel.org \
    --cc=nathan@kernel.org \
    --cc=nbd@nbd.name \
    --cc=ndesaulniers@google.com \
    --cc=rppt@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=viresh.kumar@linaro.org \
    --cc=yifeifz2@illinois.edu \
    --subject='Re: [PATCH 4/5] ARM: Add basic support for EcoNet EN7523 SoC' \
    /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

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).