[PATCH 2/2] ARM: move device tree mapping out of linear region

Ard Biesheuvel ardb at kernel.org
Wed Oct 7 06:12:21 EDT 2020


On Wed, 7 Oct 2020 at 11:56, Linus Walleij <linus.walleij at linaro.org> wrote:
>
> On Tue, Oct 6, 2020 at 6:46 PM Nicolas Pitre <nico at fluxnic.net> wrote:
>
> > This is unfortunate that the DT is needed early, otherwise it would have
> > been nicer to simply put it in the vmalloc area directly.
>
> We can issue unflatten_and_copy_device_tree() like most arches
> do and then remove the mapping and memblock after that, but then
> we also need a remove_mapping() call that is counterpart to
> create_mapping() to get rid of this early map.
>
> But that can be a separate project (if desirable).
>

I still don't get what the advantage is of doing that. With this
series applied, the DT could be anywhere in the 32-bit addressable
physical memory, and I intend to update the EFI code for ARM to take
advantage of that (currently, it has to reason about how large the
linear region might be, which is annoying).

unflatten_and_copy_device_tree() reallocates the DT into lowmem, and
then unflattens it. So if the DT was in lowmem, you release some
lowmem at one end, and allocate it at another. If the DT was not in
lowmem to begin with, you waste lowmem for something that does not
need to be in lowmem in the first place.

I know none of this is likely to make a huge difference, given that
DTBs are typically small. However, I'd like to understand the
rationale for doing the copy, beyond 'other architectures do it'
(which does not include arm64 btw)

-- 
Ard.



More information about the linux-arm-kernel mailing list