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: <CAHk-=wh3np3kEJ-D4OZC2nHGuY7crkTw6kefGkUYaerSpUP3Gw@mail.gmail.com>
Date: Tue, 6 May 2025 12:41:50 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Ard Biesheuvel <ardb@...nel.org>
Cc: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org, x86@...nel.org, 
	Ingo Molnar <mingo@...nel.org>
Subject: Re: [RFC PATCH 3/3] x86/boot: Use alternatives based selector for
 5-level paging constants

On Tue, 6 May 2025 at 12:15, Ard Biesheuvel <ardb@...nel.org> wrote:
>
> First of all, that would mean calling into even more C code from the
> 1:1 mapping of memory,

Not a lot, actually.

When I did the runtime-const stuff, I refused to use the alternatives
code, because it was called much too late and was much too
complicated.

So I just did an early fixup by hand - in the place where the variable
was actually changed. Exactly so that you had *consistency*.

It's literally four lines of code that gets inlined.

See runtime_const_fixup().

And I just checked. Those four lines of code generate seven *instructions*:

  .LBB80_4:
        movq    $__start_runtime_ptr_dentry_hashtable, %rcx
  .LBB80_6:                               # =>This Inner Loop Header: Depth=1
        cmpq    $__stop_runtime_ptr_dentry_hashtable, %rcx
        jae     .LBB80_7
  # %bb.5:                                #   in Loop: Header=BB80_6 Depth=1
        movslq  (%rcx), %rdx
        movq    %rax, (%rcx,%rdx)
        addq    $4, %rcx
        jmp     .LBB80_6

that's literally what that

        runtime_const_init(ptr, dentry_hashtable);

generates in dcache_init_early() for me.

Seriously, this is *trivial*.

                Linus

             Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ