Thread (97 messages) 97 messages, 6 authors, 2021-02-22

Re: [RFC PATCH v2 15/26] of/fdt: Introduce early_init_dt_add_memory_hyp()

From: Quentin Perret <hidden>
Date: 2021-01-12 09:52:47
Also in: kvmarm, linux-arm-kernel, lkml

On Monday 11 Jan 2021 at 08:45:10 (-0600), Rob Herring wrote:
On Fri, Jan 8, 2021 at 6:16 AM Quentin Perret [off-list ref] wrote:
quoted
Introduce early_init_dt_add_memory_hyp() to allow KVM to conserve a copy
of the memory regions parsed from DT. This will be needed in the context
of the protected nVHE feature of KVM/arm64 where the code running at EL2
will be cleanly separated from the host kernel during boot, and will
need its own representation of memory.
What happened to doing this with memblock?
I gave it a go, but as mentioned in v1, I ran into issues for nomap
regions. I want the hypervisor to know about these memory regions (it's
possible some of those will be given to protected guests for instance)
but these seem to be entirely removed from the memblocks when using DT:

https://elixir.bootlin.com/linux/latest/source/drivers/of/fdt.c#L1153

EFI appears to do things differently, though, as it 'just' uses
memblock_mark_nomap() instead of actively removing the memblock. And that
means I could actually use the memblock API for EFI, but I'd rather
have a common solution. I tried to understand why things are done
differently but couldn't find an answer and kept things simple and
working for now.

Is there a good reason for not using memblock_mark_nomap() with DT? If
not, I'm happy to try that.

Thanks,
Quentin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help