Thread (2 messages) 2 messages, 2 authors, 2016-07-06

[Question] Memory attribute reserved by Device Tree?

From: mark.rutland@arm.com (Mark Rutland)
Date: 2016-07-06 09:34:58
Also in: linux-devicetree

On Wed, Jul 06, 2016 at 07:34:58AM +0200, Ard Biesheuvel wrote:
On 6 July 2016 at 06:10, Masahiro Yamada [off-list ref] wrote:
quoted
My motivation is to try my own implementation of PSCI for my ARMv7 SoC.

I put my PSCI firmware somewhere in the DRAM region and
protected it with /memreserve/, but I was not sure what kind of memory attribute
is used for the area.
As Mark implies, /memreserve/ entries are not suitable for this, and
you should create an entry under /reserved-memory instead (please
check the bindings under Documentation/ for details).
I'd strongly recommend that the memory in question was carved out of the
memory node, rather than using a reserved-memory node. The OS has
absolutely no reason to know about this memory in the first place.

This is more robust as other agents will similarly not poke the memory.
This not only allows you to add a no-map attribute to prevent the
kernel from mapping it (which allows you to map it any way you like),
it also guarantees that the reservation is honoured even when booting
via UEFI, as /memreserve/s are ignored in this case.
You'll still need to teach your UEFI implementation to reserve the
region (and to not give it cacheable attributes), to enable this, so
similarly I'd recommend that it is completely removed from the memory
map -- no agent other than the PSCI implementation has any reason to map
this memory.

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