Received: from eggs.gnu.org ([140.186.70.92]:59897) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R4DQr-000729-UK for qemu-devel@nongnu.org; Thu, 15 Sep 2011 11:00:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R4DQp-0003Ez-4z for qemu-devel@nongnu.org; Thu, 15 Sep 2011 11:00:53 -0400 References: <1315989802-18753-1-git-send-email-agraf@suse.de> <1315989802-18753-29-git-send-email-agraf@suse.de> <20110915031932.GU9025@yookeroo.fritz.box> <25DA59E2-0AA8-486E-A129-2016EAC99CC6@suse.de> <20110915110335.GW9025@yookeroo.fritz.box> In-Reply-To: <20110915110335.GW9025@yookeroo.fritz.box> Mime-Version: 1.0 (iPhone Mail 8G4) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <01BC9A60-F030-4F96-ACB9-141108F4A1AD@suse.de> From: Alexander Graf Date: Thu, 15 Sep 2011 17:00:41 +0200 Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH 28/58] device tree: give dt more size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: "qemu-ppc@nongnu.org" , qemu-devel Developers Am 15.09.2011 um 13:03 schrieb David Gibson : > On Thu, Sep 15, 2011 at 09:37:48AM +0200, Alexander Graf wrote: >>=20 >> On 15.09.2011, at 05:19, David Gibson wrote: >>=20 >>> On Wed, Sep 14, 2011 at 10:42:52AM +0200, Alexander Graf wrote: >>>> We currently load a device tree blob and then just take its size x2 to >>>> account for modifications we do inside. While this is nice and great, >>>> it fails when we have a small device tree as blob and lots of nodes add= ed >>>> in machine init code. >>>>=20 >>>> So for now, just make it 20k bigger than it was before. We maybe want t= o >>>> be more clever about this later. >>>=20 >>> In fact, one of the few things I can think of that might justify >>> qemu's "abstraction" of the libfdt interface, is that the wrappers >>> could be modified to detect -FDT_ERR_NOSPACE and realloc() >>> appropriately. >>=20 >> Oh, yeah, that sounds like a very good idea! >>=20 >>> Otherwise the wrappers, which are limited and not notably simpler to >>> use than the raw libfdt functions seem pretty pointless to me. >>>=20 >>> Not that I'm biased as the author of libfdt or anything :). >>=20 >> I agree that the wrappers are not all that overly useful atm. I was >> actually very close to just ripping them out completely instead of >> extending them for new functionality. I did have the feeling that >> wrapping libfdt would give us a few benefits, maybe even the chance >> of getting rid of #ifdefs in target code. >=20 > Hrm, maybe. Can't really see it. Of course, my preference would be > to get rid of those #ifdefs by embedding libfdt in qemu so it's always > there. It's a library and should be treated that way. But yeah, I'm inclined to fai= l configure for ppc when libfdt can't be found too. >=20 >> Could you please put this on your todo list? We should probably >> force every target code in QEMU to only use the wrappers and >> dynamically realloc() in them. >=20 > Uh, sure, but it's a long list and it won't be near the top. >=20 > The wrappers would need to be a lot more extensive to do this. I use > libfdt directly in the spapr code for a reason. Expensiveness is not too bad here, no? It should still be fast. Also, I'm perfectly fine with this being low on the list. Alex >=20