Re: [PATCH v3 1/2] x86/purgatory: do not use __builtin_memcpy and __builtin_memset

2019-07-24 Thread Vaibhav Rustagi
On Wed, Jul 24, 2019 at 3:33 AM Thomas Gleixner wrote: > > On Tue, 23 Jul 2019, Nick Desaulniers wrote: > > Instead, reuse an implementation from arch/x86/boot/compressed/string.c > > if we define warn as a symbol. Also, Clang may lower memcmp's that > > compare against 0 to bcmp's, so add a small

Re: [PATCH v3 1/2] x86/purgatory: do not use __builtin_memcpy and __builtin_memset

2019-07-24 Thread Thomas Gleixner
On Tue, 23 Jul 2019, Nick Desaulniers wrote: > Instead, reuse an implementation from arch/x86/boot/compressed/string.c > if we define warn as a symbol. Also, Clang may lower memcmp's that > compare against 0 to bcmp's, so add a small definition, too. See also: > commit 5f074f3e192f ("lib/string.c:

[PATCH v3 1/2] x86/purgatory: do not use __builtin_memcpy and __builtin_memset

2019-07-23 Thread Nick Desaulniers
Implementing memcpy and memset in terms of __builtin_memcpy and __builtin_memset is problematic. GCC at -O2 will replace calls to the builtins with calls to memcpy and memset (but will generate an inline implementation at -Os). Clang will replace the builtins with these calls regardless of optimi