Re: Virtualization difficulty -- phandles

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



On Mon, Jul 17, 2017 at 06:47:07PM -0700, Cyril Novikov wrote:
> On 7/14/2017 3:58 AM, Mark Rutland wrote:
> 
> > > Would it be possible to add metadata properties to the binary FDT
> > > format, which would identify other property cells that are in fact
> > > phandles? It could be a per-node property or a single root node
> > > property, up to you guys. DTC would then automatically generate the
> > > metadata property along with the phandle property when compiling the
> > > DTS.
> > 
> > Unfortunately, even ignoring the above, this metadata isn't likely to be
> > reliable, as after compilation, other agents (e.g. the bootloader) may
> > modify the FDT, without updating the metadata that they are not aware
> > of.
> 
> Well, it depends on the design of said metadata. For example, imagine a node
> property named ".dependencies", which simply lists all phandles referenced
> by other properties in the same node. I would be very surprised if the
> bootloader does something that breaks that. It would require a major
> intervention into the FDT.

Well, I don't want to invent a new encoding if we can possibly avoid
it.  The current encoding used for overlay generation looks like this

/ {
	target: node@0 {
	};
	node@1 {
		ref = <&target>;
	};
	__local_fixups__ = {
		node@1 {
			ref = <0>;
		};
	};
};

Basically, __local_fixups__  has a subtree which paralells the main
tree.  Each property found under __local_fixups__ is a list of offsets
at which phandle references appear in the corresponding property in
the main tree.

That seems like it would survive most likely bootloader
transformations as well, I think.

> Even if they do, like I said in my reply to David, we don't strive to
> achieve a full automation, so it's probably tolerable. Oh well, we've missed
> some dependencies. It's still better than what we have now.

Ok.  I'm tentatively convinced that it's worth adding a switch to dtc
to generate __local_fixups__even for a non-plugin source.

Next step is for someone to propose a concrete patch.

-- 
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