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]
Message-ID: <59edf022-45a7-3cee-a7e7-4b6480e9b679@huawei.com>
Date:   Mon, 7 Nov 2022 16:01:27 +0800
From:   "Leizhen (ThunderTown)" <thunder.leizhen@...wei.com>
To:     David Laight <David.Laight@...LAB.COM>,
        Josh Poimboeuf <jpoimboe@...nel.org>,
        Jiri Kosina <jikos@...nel.org>,
        Miroslav Benes <mbenes@...e.cz>,
        Petr Mladek <pmladek@...e.com>,
        Joe Lawrence <joe.lawrence@...hat.com>,
        "live-patching@...r.kernel.org" <live-patching@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Jiri Olsa <jolsa@...nel.org>,
        Kees Cook <keescook@...omium.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        "Luis Chamberlain" <mcgrof@...nel.org>,
        "linux-modules@...r.kernel.org" <linux-modules@...r.kernel.org>,
        Steven Rostedt <rostedt@...dmis.org>,
        "Ingo Molnar" <mingo@...hat.com>
Subject: Re: [PATCH v8 4/9] kallsyms: Reduce the memory occupied by
 kallsyms_seqs_of_names[]



On 2022/11/2 20:00, David Laight wrote:
> From: Zhen Lei
>> Sent: 02 November 2022 08:49
>>
>> kallsyms_seqs_of_names[] records the symbol index sorted by address, the
>> maximum value in kallsyms_seqs_of_names[] is the number of symbols. And
>> 2^24 = 16777216, which means that three bytes are enough to store the
>> index. This can help us save (1 * kallsyms_num_syms) bytes of memory.
> 
> You can get the compiler to do the 'heavy lifting' for you.
> 
> struct uint24 {
>     unsigned int val24:24;
> } __attribute__((packed));

This method depends on byte order. If the byte order of the tool is
different from that of the kernel, it's a problem. For example,
cross-compile PowerPC kernel on x86.

> 
> struct uint24 table[1024];
> 
> works fine.
> 
> 	David
> 
> -
> Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
> Registration No: 1397386 (Wales)
> 
> 
> .
> 

-- 
Regards,
  Zhen Lei

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ