Re: Extending /memreserve/ to allow defining descriptions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sat, Mar 04, 2017 at 01:40:39PM -0800, Florian Fainelli wrote:
> Hello,
> 
> I am considering extending the /memreserve node syntax with the ability
> to pass a description string that would be describing what kind of
> memory is being reserved here, e:g:
> 
> /memreserve/ 0x0 0x10000 type = "psci"
> 
> The rationale would be for a client program to be able to list these
> reserved regions e.g: from /proc/iomem in a way that could be made
> available to other applications.
> 
> What do you think?

Suggestions like this have come up before, and I think it's a bad
idea.

First of all, note that it's not merely a matter of extending the dtc
syntax - you'd need to add a way of encoding the extra labels into the
flattened format as well.

Second, the reserve list as a separate piece of the flattened tree
exists for one reason: to allow really early boot code to exclude
memory regions it needs to without having to parse the flat tree.
Labels and other additional information doesn't help that purpose.
BenH (who created the flattened tree format) has opined that having
memory reserves as a separate structure (rather than properties within
the tree) was probably a design error.

Most fundamentally, there isn't always a clear 1:1 correspondance
between each memory region and a single specific purpose.  For
example, firmware could reserve a single region which is uses for
several purposes.

What you could do is to add properties within the device tree further
annotating the reservations, with the extra structure essentially just
acting as an easy-to-parse summary of that.  In fact I know that POWER
systems firmware use 'reserved-ranges' and 'reserved-names' properties
for this.  I don't know if anyone else has adopted that though.

I would certainly be willing to look at patches to have dtc verify the
/memreserve/ statements against such properties, or to autogenerate
the reserved table from the properties, instead of from explicit
/memreserve/ statements.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]

  Powered by Linux