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] [thread-next>] [day] [month] [year] [list]
Date: Sat, 9 Mar 2024 14:14:49 +0800
From: "liuyuntao (F)" <liuyuntao12@...wei.com>
To: Arnd Bergmann <arnd@...db.de>, <linux-arm-kernel@...ts.infradead.org>,
	<linux-kernel@...r.kernel.org>, Ard Biesheuvel <ardb@...nel.org>, Fangrui
 Song <maskray@...gle.com>
CC: Russell King <linux@...linux.org.uk>, Andrew Davis <afd@...com>, Andrew
 Morton <akpm@...ux-foundation.org>, "Kirill A. Shutemov"
	<kirill.shutemov@...ux.intel.com>, Geert Uytterhoeven
	<geert+renesas@...der.be>, Jonathan Corbet <corbet@....net>, Mike Rapoport
	<rppt@...nel.org>, Rob Herring <robh@...nel.org>, Thomas Gleixner
	<tglx@...utronix.de>, Linus Walleij <linus.walleij@...aro.org>,
	<llvm@...ts.linux.dev>
Subject: Re: [PATCH-next v2] arm32: enable HAVE_LD_DEAD_CODE_DATA_ELIMINATION



On 2024/3/8 21:15, Arnd Bergmann wrote:
> On Thu, Mar 7, 2024, at 16:12, Yuntao Liu wrote:
>> The current arm32 architecture does not yet support the
>> HAVE_LD_DEAD_CODE_DATA_ELIMINATION feature. arm32 is widely used in
>> embedded scenarios, and enabling this feature would be beneficial for
>> reducing the size of the kernel image.
>>
>> In order to make this work, we keep the necessary tables by annotating
>> them with KEEP, also it requires further changes to linker script to KEEP
>> some tables and wildcard compiler generated sections into the right place.
>>
>> It boots normally with defconfig, vexpress_defconfig and tinyconfig.
>>
>> The size comparison of zImage is as follows:
>> defconfig       vexpress_defconfig      tinyconfig
>> 5137712         5138024                 424192          no dce
>> 5032560         4997824                 298384          dce
>> 2.0%            2.7%                    29.7%           shrink
>>
>> When using smaller config file, there is a significant reduction in the
>> size of the zImage.
>>
>> We also tested this patch on a commercially available single-board
>> computer, and the comparison is as follows:
>> a15eb_config
>> 2161384         no dce
>> 2092240         dce
>> 3.2%            shrink
>>
>> The zImage size has been reduced by approximately 3.2%, which is 70KB on
>> 2.1M.
>>
>> Signed-off-by: Yuntao Liu <liuyuntao12@...wei.com>
> 
> I've retested with both gcc-13 and clang-18, and so no
> more build issues. Your previous version already worked
> fine for me.
> 
> I did some tests combining this with CONFIG_TRIM_UNUSED_KSYMS,
> which showed a significant improvement as expected. I also
> tried combining it with an experimental CONFIG_LTO_CLANG
> patch, but that did not show any further improvements.
> 

Thanks for the tests, CONFIG_LD_DEAD_CODE_DATA_ELIMINATION and 
CONFIG_TRIM_UNUSED_KSYMS do indeed result in a significant improvement.
I found that arm32 still doesn't support CONFIG_LTO_CLANG. I've done 
some work on it, but without success. I'd like to learn more about the 
CONFIG_LTO_CLANG patch. Do you have any relevant links?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ