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: <28B9471C-4FB0-4AB0-81DD-4885C3645E95@vmware.com>
Date:   Wed, 18 Oct 2023 16:03:01 +0000
From:   Nadav Amit <namit@...are.com>
To:     Uros Bizjak <ubizjak@...il.com>
CC:     Linus Torvalds <torvalds@...ux-foundation.org>,
        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 Oct 18, 2023, at 6:17 PM, Uros Bizjak <ubizjak@...il.com> wrote:
> 
> I am more thinking of moving the ifdeffery to percpu.h, something like
> the attached part of the patch. This would handle all current and
> future stable percpu variables.

I think that for consistency this_cpu_read_stable() should always be an
rvalue, so instead of:

> #define this_cpu_read_stable(pcp)	const_##pcp

You would use a statement expression:

#define this_cpu_read_stable(pcp)	({ const_##pcp; })

This would match the other (existing/fallback) definition of
this_cpu_read_stable.

Having said that, I am not sure what other usages you have in mind.
“current” is a pretty obvious straight forward case with considerable
impact on code generation. There may be additional variables, but it is
likely that there would be more functions/TU in which they would not be
constant and would require more refined techniques to avoid mistakes
such as the use of stale cached values.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ