[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH] PPC: E500: Generate device tree on r
From: |
Alexander Graf |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH] PPC: E500: Generate device tree on reset |
Date: |
Tue, 23 Jul 2013 23:56:32 +0200 |
On 23.07.2013, at 23:55, Scott Wood wrote:
> On 07/23/2013 04:44:02 PM, Alexander Graf wrote:
>> Am 23.07.2013 um 23:19 schrieb Scott Wood <address@hidden>:
>> > On 07/23/2013 04:15:59 PM, Alexander Graf wrote:
>> >> On 23.07.2013, at 21:38, Scott Wood wrote:
>> >> > On 07/22/2013 10:28:17 AM, Alexander Graf wrote:
>> >> >> Today we generate the device tree once on machine initialization and
>> >> >> then
>> >> >> store the finalized blob in memory to reload it on reset.
>> >> >> This is bad for 2 reasons. First we potentially waste a bunch of RAM
>> >> >> for no
>> >> >> good reason, as we have all information required to regenerate the
>> >> >> device
>> >> >> tree available anyways.
>> >> >> The second reason is even more important. On machine init when we
>> >> >> generate
>> >> >> the device tree for the first time, we don't have all of the devices
>> >> >> fully
>> >> >> initialized yet. But the device tree needs to potentially walk devices
>> >> >> to
>> >> >> put information about them into the device tree.
>> >> >
>> >> > If you can't produce the entire device tree at init time, how can you
>> >> > calculate its size with a dry run?
>> >> >
>> >> > Device trees are generally pretty small; couldn't we just set a maximum
>> >> > size and allocate that much space?
>> >> It's what we do, unless we load it from the disk. In that case we take
>> >> the fdt size from disk.
>> >
>> > So why do we need the dry run stuff?
>> Because dumpdtb otherwise generates a halfway complete dtb on the first dry
>> pass as device realization is yet incomplete :).
>
> What I mean is why have a first pass at all?
Ah, you mean we should just always limit ourselves to the 8MB we reserve for
the device tree? That would work, yes.
Alex
Re: [Qemu-ppc] [Qemu-devel] [PATCH] PPC: E500: Generate device tree on reset, Alexey Kardashevskiy, 2013/07/23