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-=wiB6LHPmnG7=RWNuQYY9=jCY0EmaJ7thRBEFOfDO09dfw@mail.gmail.com>
Date:   Wed, 18 Oct 2023 09:12:45 -0700
From:   Linus Torvalds <torvalds@...ux-foundation.org>
To:     Uros Bizjak <ubizjak@...il.com>
Cc:     Nadav Amit <namit@...are.com>,
        "the arch/x86 maintainers" <x86@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Andy Lutomirski <luto@...nel.org>,
        Brian Gerst <brgerst@...il.com>,
        Denys Vlasenko <dvlasenk@...hat.com>,
        "H . Peter Anvin" <hpa@...or.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: [PATCH v2 -tip] x86/percpu: Use C for arch_raw_cpu_ptr()

On Wed, 18 Oct 2023 at 06:15, Uros Bizjak <ubizjak@...il.com> wrote:
>
> Attached is the prototype patch that works for me (together with
> Linus' FPU switching patch).

That looks reasonable, but I think the separate compilation unit is
unnecessary, and I still absolutely hate how that const_pcpu_hot thing
is declared twice (your patch does it in both current.h and in
percpu-hot.c).

How about we just do the whole alias as a linker thing instead? So the
same way that we just do

    jiffies = jiffies_64;

in our arch/x86/kernel/vmlinux.lds.S file, we could just do

    const_pcpu_hot = pcpu_hot;

in there.

Then, as far as the compiler is concerned, we just have

    DECLARE_PER_CPU_ALIGNED(
        const struct pcpu_hot __percpu_seg_override,
        const_pcpu_hot)

and the compiler doesn't know that it's aliased to anything else.

And please do that declaration in just *one* place.

                 Linus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ