From: Frank van der Linden <fllinden@amazon.com>
To: <linux-arm-kernel@lists.infradead.org>, <rppt@kernel.org>,
<robh+dt@kernel.org>, <frowand.list@gmail.com>, <ardb@kernel.org>,
<linux-mm@kvack.org>, <devicetree@vger.kernel.org>,
<linux-efi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<kexec@lists.infradead.org>, <catalin.marinas@arm.com>,
<will@kernel.org>
Cc: <geert+renesas@glider.be>, Frank van der Linden <fllinden@amazon.com>
Subject: [PATCH 0/3] usable memory range fixes (arm64/fdt/efi)
Date: Mon, 10 Jan 2022 21:08:06 +0000 [thread overview]
Message-ID: <20220110210809.3528-1-fllinden@amazon.com> (raw)
b261dba2fdb2 ("arm64: kdump: Remove custom linux,usable-memory-range handling")
moved capping memory ranges using the FDT-specified linux,usable-memory-range
to the FDT code. This property is used to specify the memory range that
a crash kernel runs in.
While this correctly filters any memory ranges that come from the DT,
this breaks crash kernels on arm64 EFI systems. In these cases, DT is used
for the usable-memory-range property, but the actual memory ranges
come from EFI. Since the call to filter them was moved to the FDT
code, which runs before the EFI init code, the EFI ranges are not
filtered anymore, leading to the crash kernel using memory that
it shouldn't.
This set fixes the the issue by having the EFI code cap its
memory ranges too, and defining a common interface for both the
DT and EFI code to use.
These changes stick to the "firmware code should cap its own memory ranges"
idea, using a common memblock interface. An alternative would be to
use an FDT-specific interface as before, called from arm64_memblock_init,
but having things a little more generalized seemed like a good idea.
This is only a functional change on architectures that have both
DT and EFI, and a usable-memory-range property (which is just arm64).
On any other architecture, usable_size will not be set, leading to a
memblock_cap_memory_range call with 0 size, which is a no-op.
Frank van der Linden (3):
memblock: define functions to set the usable memory range
of: fdt: use memblock usable range interface
efi: enforce usable memory range after reserving regions
drivers/firmware/efi/efi-init.c | 7 +++++++
drivers/of/fdt.c | 3 ++-
include/linux/memblock.h | 2 ++
mm/memblock.c | 37 +++++++++++++++++++++++++++++++++
4 files changed, 48 insertions(+), 1 deletion(-)
--
2.32.0
next reply other threads:[~2022-01-10 21:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 21:08 Frank van der Linden [this message]
2022-01-10 21:08 ` [PATCH 1/3] memblock: define functions to set the usable memory range Frank van der Linden
2022-01-11 10:31 ` Mike Rapoport
2022-01-11 20:44 ` Frank van der Linden
2022-01-12 18:05 ` Mike Rapoport
2022-01-13 17:33 ` Mike Rapoport
2022-01-14 0:10 ` Frank van der Linden
2022-01-14 0:22 ` Frank van der Linden
2022-01-14 23:27 ` Frank van der Linden
2022-01-24 21:05 ` Frank van der Linden
2022-01-29 16:19 ` Ard Biesheuvel
2022-01-10 21:08 ` [PATCH 2/3] of: fdt: use memblock usable range interface Frank van der Linden
2022-01-10 21:08 ` [PATCH 3/3] efi: enforce usable memory range after reserving regions Frank van der Linden
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=20220110210809.3528-1-fllinden@amazon.com \
--to=fllinden@amazon.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=geert+renesas@glider.be \
--cc=kexec@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=robh+dt@kernel.org \
--cc=rppt@kernel.org \
--cc=will@kernel.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