On 10 December 2014 at 11:40, Laszlo Ersek lersek@redhat.com wrote:
The dtb that QEMU exports at the moment is 64KB in size (FDT_MAX_SIZE in "device_tree.c"). See
qemu-system-aarch64 -M virt -machine dumpdtb=virt.dtb
I'm sure you've noticed that; I'll assume that your first new BuildGuidHob() call failed. That's because the BuildGuidHob() function in "MdePkg/Library/PeiHobLib/HobLib.c" limits the size to
(0xFFF8 - sizeof (EFI_HOB_GUID_TYPE)))
Which is why you probably added fdt_pack().
The 64KB DTB that qemu currently exports for the virt machtype carries actually less than 5KB of payload, the rest is padding (for in-place updates I guess), which fdt_pack() trims in-place.
Hmm. That seems like a bug in QEMU to me -- we should probably be trimming down the dtb we create ourselves. In any case I wouldn't recommend making an guest assumptions about the presence or absence of that padding or whether it might end up more than 64K in future.
-- PMM