linux/lib/zstd
Nick Terrell 6d25a633ea lib: Prepare zstd for preboot environment, improve performance
These changes are necessary to get the build to work in the preboot
environment, and to get reasonable performance:

- Remove a double definition of the CHECK_F macro when the zstd
  library is amalgamated.

- Switch ZSTD_copy8() to __builtin_memcpy(), because in the preboot
  environment on x86 gcc can't inline `memcpy()` otherwise.

- Limit the gcc hack in ZSTD_wildcopy() to the broken gcc version. See
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81388.

ZSTD_copy8() and ZSTD_wildcopy() are in the core of the zstd hot loop.
So outlining these calls to memcpy(), and having an extra branch are very
detrimental to performance.

Signed-off-by: Nick Terrell <terrelln@fb.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20200730190841.2071656-2-nickrterrell@gmail.com
2020-07-31 11:49:07 +02:00
..
bitstream.h lib: zstd: Mark expected switch fall-throughs 2019-04-08 18:39:18 -05:00
compress.c lib: zstd: Mark expected switch fall-throughs 2019-04-08 18:39:18 -05:00
decompress.c lib: zstd: Mark expected switch fall-throughs 2019-04-08 18:39:18 -05:00
entropy_common.c
error_private.h
fse_compress.c
fse_decompress.c lib: Prepare zstd for preboot environment, improve performance 2020-07-31 11:49:07 +02:00
fse.h
huf_compress.c lib: zstd: Mark expected switch fall-throughs 2019-04-08 18:39:18 -05:00
huf_decompress.c
huf.h
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
mem.h lib/zstd/mem.h: replace __inline by inline 2019-09-15 19:42:16 +02:00
zstd_common.c
zstd_internal.h lib: Prepare zstd for preboot environment, improve performance 2020-07-31 11:49:07 +02:00
zstd_opt.h