Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-06-17 Thread David Gibson
On Wed, May 09, 2018 at 12:23:49PM +0100, Peter Maydell wrote: > On 9 May 2018 at 06:32, David Gibson wrote: > > On Sun, May 06, 2018 at 04:04:02PM +0100, Peter Maydell wrote: > >> On 6 May 2018 at 14:39, David Gibson wrote: > >> > Although, that said, I'll re-iterate that I think qemu's fdt >

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-09 Thread Peter Maydell
On 9 May 2018 at 06:32, David Gibson wrote: > On Sun, May 06, 2018 at 04:04:02PM +0100, Peter Maydell wrote: >> On 6 May 2018 at 14:39, David Gibson wrote: >> > Although, that said, I'll re-iterate that I think qemu's fdt >> >

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-08 Thread David Gibson
On Sun, May 06, 2018 at 04:04:02PM +0100, Peter Maydell wrote: > On 6 May 2018 at 14:39, David Gibson wrote: > > Well, I'm biased of course, but I think we'd be better off just > > ditching the wrapper. In its present form it is so limited as to not > > really add

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-06 Thread Peter Maydell
On 6 May 2018 at 14:39, David Gibson wrote: > Well, I'm biased of course, but I think we'd be better off just > ditching the wrapper. In its present form it is so limited as to not > really add any value. If it was rewritten to do something useful > (e.g. handling

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-06 Thread David Gibson
On Sun, May 06, 2018 at 01:23:30PM +0100, Peter Maydell wrote: > On 5 May 2018 at 22:59, Michael Clark wrote: > > Okay, so an alternative is to call fdt_pack() and then fdt_totalsize(). > > Thanks! > > > > QEMU has its own wrapper around libfdt and neither the fdt_pack() nor > >

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-06 Thread David Gibson
On Sun, May 06, 2018 at 09:59:50AM +1200, Michael Clark wrote: > On Sat, May 5, 2018 at 11:48 PM, David Gibson > wrote: > > > On Sat, May 05, 2018 at 11:44:25AM +0100, Peter Maydell wrote: > > > cc'ing David -- is this the best way to do this? > > > > > > (It would

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-06 Thread Peter Maydell
On 5 May 2018 at 22:59, Michael Clark wrote: > Okay, so an alternative is to call fdt_pack() and then fdt_totalsize(). > Thanks! > > QEMU has its own wrapper around libfdt and neither the fdt_pack() nor > fdt_totalsize() functions are exposed. > > Some architecture use only the

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-05 Thread Michael Clark
FYI - I've dropped this patch to qemu/include/sysemu/device_tree.h and qemu/device_tree.c in favor of calling fdt_pack() and fdt_totalsize(). On Sun, May 6, 2018 at 9:59 AM, Michael Clark wrote: > > > On Sat, May 5, 2018 at 11:48 PM, David Gibson

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-05 Thread Michael Clark
On Sat, May 5, 2018 at 11:48 PM, David Gibson wrote: > On Sat, May 05, 2018 at 11:44:25AM +0100, Peter Maydell wrote: > > cc'ing David -- is this the best way to do this? > > > > (It would be nicer if libfdt would just dynamically > > reallocate the buffer as needed,

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-05 Thread David Gibson
On Sat, May 05, 2018 at 11:44:25AM +0100, Peter Maydell wrote: > cc'ing David -- is this the best way to do this? > > (It would be nicer if libfdt would just dynamically > reallocate the buffer as needed, That's a deliberate design tradeoff. Because it's designed to be embeddable in really

Re: [Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-05 Thread Peter Maydell
cc'ing David -- is this the best way to do this? (It would be nicer if libfdt would just dynamically reallocate the buffer as needed, and then tell you the final size, rather than having to specify a maximum buffer size up front, but given the API we have a "tell me how big this thing actually

[Qemu-devel] [PATCH] device_tree: Add qemu_fdt_totalsize function

2018-05-03 Thread Michael Clark
Currently the device-tree create_device_tree function returns the size of the allocated device tree buffer however there is no way to get the actual amount of buffer space used by the device-tree. 14ec3cbd7c1e31dca4d23f028100c8f43e156573 increases the FDT_MAX_SIZE to 1 MiB. This creates an issue