From mboxrd@z Thu Jan 1 00:00:00 1970 From: Albert ARIBAUD Date: Thu, 17 Oct 2013 11:48:47 +0200 Subject: [U-Boot] fdt performance In-Reply-To: <525F8284.4000304@caviumnetworks.com> References: <525F8284.4000304@caviumnetworks.com> Message-ID: <20131017114847.5e3262c2@lilith> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Aaron, On Wed, 16 Oct 2013 23:24:04 -0700, Aaron Williams wrote: > Hi all, > > In our bootloader based off of 2013.07 we make extensive use of the flat > device tree. In profiling our bootloader in our simulator I found that > the function eating up the most time is fdt_next_tag. Looking at it, > especially fdt_offset_ptr, it looks like there is a lot of room for > improvement especially in the skip name section. > > Some of the checks in fdt_offset_ptr also look useless, such as if > ((offset + len) < offset) which will always be false, or > if (p + len < p) > > len is always positive. I guess these tests are to catch corruption cases where the pointer plus length wrap around the address space. Granted, this is far from perfect protection, but still, it makes some sense. In any case, if you found places where the code can be optimized, feel free to directly post a patch! (you can still put notes and comments below the '---' line) > -Aaron Amicalement, -- Albert.