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:   Wed, 4 Oct 2023 18:37:52 +0200
From:   Ingo Molnar <mingo@...nel.org>
To:     Uros Bizjak <ubizjak@...il.com>
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Andy Lutomirski <luto@...nel.org>,
        Nadav Amit <namit@...are.com>, Brian Gerst <brgerst@...il.com>,
        Denys Vlasenko <dvlasenk@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH 4/4] x86/percpu: Use C for percpu read/write accessors


* Uros Bizjak <ubizjak@...il.com> wrote:

> The percpu code mostly uses inline assembly. Using segment qualifiers
> allows to use C code instead, which enables the compiler to perform
> various optimizations (e.g. propagation of memory arguments). Convert
> percpu read and write accessors to C code, so the memory argument can
> be propagated to the instruction that uses this argument.
> 
> Some examples of propagations:
> 
> a) into sign/zero extensions:
> 
>  110b54:       65 0f b6 05 00 00 00    movzbl %gs:0x0(%rip),%eax
>  11ab90:       65 0f b6 15 00 00 00    movzbl %gs:0x0(%rip),%edx
>  14484a:       65 0f b7 35 00 00 00    movzwl %gs:0x0(%rip),%esi
>  1a08a9:       65 0f b6 43 78          movzbl %gs:0x78(%rbx),%eax
>  1a08f9:       65 0f b6 43 78          movzbl %gs:0x78(%rbx),%eax
> 
>  4ab29a:       65 48 63 15 00 00 00    movslq %gs:0x0(%rip),%rdx
>  4be128:       65 4c 63 25 00 00 00    movslq %gs:0x0(%rip),%r12
>  547468:       65 48 63 1f             movslq %gs:(%rdi),%rbx
>  5474e7:       65 48 63 0a             movslq %gs:(%rdx),%rcx
>  54d05d:       65 48 63 0d 00 00 00    movslq %gs:0x0(%rip),%rcx

Could you please also quote a 'before' assembly sequence, at least once
per group of propagations?

Ie. readers will be able to see what kind of code generation changes
result in this kind of text size reduction:

>    text    data     bss     dec     hex filename
> 25508862        4386540  808388 30703790        1d480ae vmlinux-vanilla.o
> 25500922        4386532  808388 30695842        1d461a2 vmlinux-new.o

Thanks,

	Ingo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ