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:   Sat, 22 Aug 2020 12:20:17 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Nick Desaulniers' <ndesaulniers@...gle.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Arvind Sankar <nivedita@...m.mit.edu>,
        Masahiro Yamada <masahiroy@...nel.org>
CC:     Rasmus Villemoes <linux@...musvillemoes.dk>,
        Dávid Bolvanský <david.bolvansky@...il.com>,
        "Eli Friedman" <efriedma@...cinc.com>,
        "H. Peter Anvin" <hpa@...or.com>,
        "Andrew Morton" <akpm@...ux-foundation.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Michal Marek <michal.lkml@...kovi.net>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        "Kees Cook" <keescook@...omium.org>,
        Tony Luck <tony.luck@...el.com>,
        Dmitry Vyukov <dvyukov@...gle.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Joe Perches <joe@...ches.com>,
        Joel Fernandes <joel@...lfernandes.org>,
        Daniel Axtens <dja@...ens.net>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        Alexandru Ardelean <alexandru.ardelean@...log.com>,
        Yury Norov <yury.norov@...il.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Daniel Kiper <daniel.kiper@...cle.com>,
        Bruce Ashfield <bruce.ashfield@...il.com>,
        Marco Elver <elver@...gle.com>,
        "Vamshi K Sthambamkadi" <vamshi.k.sthambamkadi@...il.com>
Subject: RE: [PATCH 0/4] -ffreestanding/-fno-builtin-* patches

> For more context for folks at home eating popcorn and enjoying the
> show: https://github.com/ClangBuiltLinux/linux/issues/876#issuecomment-613049480.
> And that was specifically with KASAN enabled and doesn't appear to be
> common behavior in clang otherwise (higher threshold). Why the
> heuristics change for when it seems to be more profitable to roll
> assignment of contiguous members of the same struct to the same value
> into a memset, and 2 longs seems to be the threshold for KASAN, I
> don't know.  But I agree that should be fixed on the compiler side,
> which is why I haven't been pushing the kernel workaround.

Given x86 has is a simple 3-instruction loop for memset
that will do 1 write/clock (the max on current cpu) I
doubt it is ever worth not inlining memset().
The only real special case is lengths < 8.

For KASAN I wonder if something is stopping it inlining memset()?
So what usually happens is the two stores get converted to memset()
and then the memset() gets inlined back to two stores?

OTOH all this faffing for memset and memcpy is probably a
waste of time.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists