lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aM_T9mtmEdAGNpLi@probook>
Date: Sun, 21 Sep 2025 10:31:21 +0000
From: J. Neuschäfer <j.ne@...teo.net>
To: Simon Glass <sjg@...omium.org>
Cc: linux-arm-kernel@...ts.infradead.org, Tom Rini <trini@...sulko.com>,
	Ahmad Fatoum <a.fatoum@...gutronix.de>,
	J . Neuschäfer <j.ne@...teo.net>,
	Masahiro Yamada <masahiroy@...nel.org>,
	Nicolas Schier <nicolas@...sle.eu>,
	Chen-Yu Tsai <wenst@...omium.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] scripts/make_fit: Speed up operation

On Fri, Sep 19, 2025 at 04:46:25PM -0600, Simon Glass wrote:
> The kernel is likely at least 16MB so we may as well use that as a step
> size when reallocating space for the FIT in memory. Pack the FIT at the
> end, so there is no wasted space.
> 
> This reduces the time to pack by an order of magnitude, or so.
> 
> Signed-off-by: Simon Glass <sjg@...omium.org>
> 
> ---
> 
> (no changes since v1)
> 
>  scripts/make_fit.py | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/make_fit.py b/scripts/make_fit.py
> index b4caa127d2c3..904f45088978 100755
> --- a/scripts/make_fit.py
> +++ b/scripts/make_fit.py
> @@ -100,7 +100,7 @@ def setup_fit(fsw, name):
>          fsw (libfdt.FdtSw): Object to use for writing
>          name (str): Name of kernel image
>      """
> -    fsw.INC_SIZE = 65536
> +    fsw.INC_SIZE = 16 << 20
>      fsw.finish_reservemap()
>      fsw.begin_node('')
>      fsw.property_string('description', f'{name} with devicetree set')
> @@ -330,10 +330,12 @@ def build_fit(args):
>  
>          entries.append([model, compat, files_seq])
> 

> -    finish_fit(fsw, entries)
> +    finish_fit(fsw, entries, bool(args.ramdisk))

It seems like this line should rather go into the previous patch.

>  
>      # Include the kernel itself in the returned file count
> -    return fsw.as_fdt().as_bytearray(), seq + 1, size
> +    fdt = fsw.as_fdt()
> +    fdt.pack()
> +    return fdt.as_bytearray(), seq + 1, size

The rest looks good to me. Easy optimization, big win :)


Best regards,
J. Neuschäfer

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ