Make ZSTD a real option via ZSTDIO.

It looks like the intent was to allow ZSTD support to be
compiled into the kernel with options ZSTDIO. But it doesn't look
like that was ever implemented or I'm missing how to do it.

I did a cursory audit of kernel config files and made a decision to
enable ZSTDIO in riscv GENERIC and mips MALTA configurations.  All other
kernel configurations already had this option in their kernel configs
but they didn't do anything useful as the feature was declared as
"standard" prior to this.

Reviewed by:	cem allanjude
Differential Revision:	https://reviews.freebsd.org/D16007
This commit is contained in:
sbruno 2018-07-05 17:07:23 +00:00
parent 784ef2f335
commit 8d923deebe
5 changed files with 24 additions and 18 deletions

View File

@ -635,22 +635,22 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional ngatm_uni \
contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
# Zstd
contrib/zstd/lib/freebsd/zstd_kmalloc.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/common/zstd_common.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/common/fse_decompress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/common/entropy_common.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/common/error_private.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/common/xxhash.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_compress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/fse_compress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/huf_compress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_double_fast.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_fast.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_lazy.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_ldm.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_opt.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/decompress/zstd_decompress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/decompress/huf_decompress.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/freebsd/zstd_kmalloc.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/zstd_common.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/fse_decompress.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/entropy_common.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/error_private.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/common/xxhash.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_compress.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/fse_compress.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/huf_compress.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_double_fast.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_fast.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_lazy.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_ldm.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/compress/zstd_opt.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/decompress/zstd_decompress.c optional zstdio compile-with ${ZSTD_C}
contrib/zstd/lib/decompress/huf_decompress.c optional zstdio compile-with ${ZSTD_C}
# Blake 2
contrib/libb2/blake2b-ref.c optional crypto | ipsec | ipsec_support \
compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function"

View File

@ -113,4 +113,4 @@ cddl/dev/dtrace/mips/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
cddl/dev/fbt/mips/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
# Zstd
contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C}

View File

@ -63,4 +63,4 @@ riscv/riscv/unwind.c optional ddb | kdtrace_hooks | stack
riscv/riscv/vm_machdep.c standard
# Zstd
contrib/zstd/lib/freebsd/zstd_kfreebsd.c standard compile-with ${ZSTD_C}
contrib/zstd/lib/freebsd/zstd_kfreebsd.c optional zstdio compile-with ${ZSTD_C}

View File

@ -45,6 +45,9 @@ options INVARIANT_SUPPORT #Extra sanity checks of internal structures, required
#options WITNESS #Enable checks to detect deadlocks and cycles
#options WITNESS_SKIPSPIN #Don't run witness on spinlocks for speed
# Kernel dump features.
options ZSTDIO # zstd-compressed kernel and user dumps
device loop
device ether
device le

View File

@ -116,6 +116,9 @@ options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones
# options EARLY_PRINTF
# options VERBOSE_SYSINIT
# Kernel dump features.
options ZSTDIO # zstd-compressed kernel and user dumps
# Pseudo devices.
device loop # Network loopback
device random # Entropy device