[SLOF] [Qemu-ppc] [PATCH v4] board-qemu: add private hcall to inform host on "phandle" update

Mark Cave-Ayland mark.cave-ayland at ilande.co.uk
Thu Sep 28 16:49:36 AEST 2017

On 28/09/17 06:56, Thomas Huth wrote:

> On 28.09.2017 06:24, David Gibson wrote:
>> On Wed, Sep 27, 2017 at 12:26:09PM +0200, Thomas Huth wrote:
>>> On 27.09.2017 11:30, Segher Boessenkool wrote:
>>>> On Wed, Sep 27, 2017 at 04:15:43PM +1000, David Gibson wrote:
>>>>> 2. At quiesce time, SLOF will linearize it's current version of the DT
>>>>>    and submit it to H_UPDATE_DT
>>>> That will work.  It's a big hammer, but that also means it will solve
>>>> many related future problems.  I like it :-)
>>> ... it's likely just yet another slow-down to the boot process.
>>> Linearizing the whole DT in Forth might take a while, I guess.
>> Do we have to do it in forth?  We could make a C extension to do this,
>> no?
> The device tree lives in Forth, so even if you write the code that
> creates the FDT in C, you have to call back into Forth for each and
> every node and property that you find along the tree. I'm pretty sure it
> won't perform extremely fast...
> Anyway, to give you a number: The FDT->OF-DT conversion (fdt.fs)
> currently takes 350 ms when running SLOF on my Laptop with TCG. I guess
> the other way round will be a bit slower (since the device tree lookup
> has to search through the Forth dictionaries), so I guess we will have
> something around 0.5 seconds in the end. If that slowdown during quiesce
> is acceptable, then go for it! If not, it might be better to search a
> different solution instead.

Yeah I don't think this will be an issue. In OpenBIOS each device node
is modelled by a Forth struct with the children, peers and properties
modelled as linked lists (the phandle is actually the pointer to this

I'm not that familiar with SLOF at source level, but if it does the same
then it's not too difficult to model the same structure but in C. Add in
some generic linked list traversal routines to iterate over the DT and
its properties and you should be good.



More information about the SLOF mailing list