Re: [PATCH v3 1/8] lib: prepare zstd for preboot environment

From: Petr Malat
Date: Thu Mar 26 2020 - 11:40:52 EST


Hi Nick,
I finally got some time to review your patch, here are my comments:

On Wed, Mar 25, 2020 at 12:58:42PM -0700, Nick Terrell wrote:
> * Don't export symbols if ZSTD_PREBOOT is defined.
I'm not sure if this is needed. When I worked on my patch, I have found that
all exporting and modinfo macros generate symbols in modinfo and discard.ksym
sections, which are then dropped by the vmlinux linker script, thus one
will get the same binary independently if he puts this change in or not.

I'm not sure if this is intentional as there is also __DISABLE_EXPORTS define,
which should be used by a decompressor (according to comments in export.h).

> * 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.
No comments to the rest.
Petr