- Jan 27, 2025
-
-
Giovanni Cabiddu authored
Make the function ZSTD_compressSequencesAndLiterals() available in kernel space. This will be used by Intel QAT driver. Additionally, (1) expose the function ZSTD_CCtx_setParameter(), which is required to set parameters before calling ZSTD_compressSequencesAndLiterals(), (2) update the build process to include `compress/zstd_preSplit.o` and (3) replace `asm/unaligned.h` with `linux/unaligned.h`. Signed-off-by:
Giovanni Cabiddu <giovanni.cabiddu@intel.com>
-
- Dec 29, 2024
-
-
Yann Collet authored
naming convention: Type names should start with a Capital letter (after the prefix)
-
- Jun 14, 2024
-
-
Elliot Gorokhovsky authored
-
- Nov 17, 2023
-
-
Nick Terrell authored
ZSTD_resetDStream() is deprecated and replaced by ZSTD_DCtx_reset(). This removes deprecation warnings from the kernel build. This change is a no-op, see the docs suggesting this replacement. https://github.com/facebook/zstd/blob/fcbf2fde9ac7ce1562c7b3a394350e764bcb580f/lib/zstd.h#L2655-L2663
-
Nick Terrell authored
Linux started providing intptr_t in <linux/types.h> so we no longer need to define it here. https://lkml.kernel.org/r/ed66b9e4-1fb7-45be-9bb9-d4bc291c691f@p183
-
- Jun 15, 2023
-
-
Yann Collet authored
-
- Mar 08, 2023
-
-
Nick Terrell authored
Backport upstream fix of the assert definition. This code is currently unused, and can be enabled for testing, which is why it wasn't caught. https://lore.kernel.org/lkml/20230129131436.1343228-1-j.neuschaefer@gmx.net/
-
- Feb 12, 2023
-
-
Yonatan Komornik authored
* Fixes zstd-dll build (https://github.com/facebook/zstd/issues/3492): - Adds pool.o and threading.o dependency to the zstd-dll target - Moves custom allocation functions into header to avoid needing to add dependency on common.o - Adds test target for zstd-dll - Adds github workflow that buildis zstd-dll
-
- Feb 09, 2023
-
-
Danielle Rozenblit authored
-
- Jan 20, 2023
-
-
Nick Terrell authored
Remove all Huffman functions that aren't used by zstd.
-
- Jan 04, 2023
-
-
Danielle Rozenblit authored
-
- Dec 20, 2022
-
-
Danielle Rozenblit authored
-
W. Felix Handte authored
``` for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do sed -i '/Copyright .* \(Yann Collet\)\|\(Meta Platforms\)/ s/Copyright .*/Copyright (c) Meta Platforms, Inc. and affiliates./' $f; done git checkout HEAD -- build/VS2010/libzstd-dll/libzstd-dll.rc build/VS2010/zstd/zstd.rc tests/test-license.py contrib/linux-kernel/test/include/linux/xxhash.h examples/streaming_compression_thread_pool.c lib/legacy/zstd_v0*.c lib/legacy/zstd_v0*.h nano ./programs/windres/zstd.rc nano ./build/VS2010/zstd/zstd.rc nano ./build/VS2010/libzstd-dll/libzstd-dll.rc ```
-
W. Felix Handte authored
Apparently it's better. Somehow. ``` for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do echo $f; sed -i 's/\-present/-2022/' $f; done g co HEAD -- build/meson/ ```
-
W. Felix Handte authored
``` for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora -o -path ./tests/regression/data-cache -o -path ./tests/regression/cache \) -prune -o -type f); do sed -i 's/\-2021/-present/' $f; done g co HEAD -- .github/workflows/dev-short-tests.yml # fix bad match ```
-
W. Felix Handte authored
``` for f in $(find . \( -path ./.git -o -path ./tests/fuzz/corpora \) -prune -o -type f); do sed -i 's/Facebook, Inc\./Meta Platforms, Inc. and affiliates./' $f; done ```
-
- Dec 16, 2022
-
-
Nick Terrell authored
1. Follow the scheme introduced in PR #2501 for both `zdict.h` and `zstd_errors.h`. 2. If the `*_VISIBLE` macro isn't set, but the `*_VISIBILITY` macro is, use that. Also make this change for `zstd.h`, since we probably shouldn't have changed that macro name without backward compatibility in the first place. 3. Change all references to `*_VISIBILITY` to `*_VISIBLE`. Fixes #3359.
-
- Dec 15, 2022
-
-
Alex Xu (Hello71) authored
Instead of using packed attribute hack, just use aligned attribute. It improves code generation on armv6 and armv7, and slightly improves code generation on aarch64. GCC generates identical code to regular aligned access on ARMv6 for all versions between 4.5 and trunk, except GCC 5 which is buggy and generates the same (bad) code as packed access: https://gcc.godbolt.org/z/hq37rz7sb
-
- Dec 14, 2022
-
-
Danielle Rozenblit authored
-
- Dec 13, 2022
-
-
Nick Terrell authored
Newer gcc versions were getting smart and omitting the `memset()`. Get around this issue by outlining the `memset()` into a different function. This test is still hacky, but it works...
-
- Oct 27, 2022
-
-
Danielle Rozenblit authored
-
- Oct 22, 2022
-
-
Nick Terrell authored
Disable ASM in the kernel for now. It requires a few changes & setup to get working. Instead of doing it in a zstd version update, I'd prefer to package that change as a single patch, and propose it separately from the version update. This makes the version update easier, and reduces some risk.
-
Nick Terrell authored
The zstd_common module was added upstream in commit https://github.com/torvalds/linux/commit/637a642f5ca5e850186bb64ac75ebb0f124b458d. But the kernel specific code was inlined into the library. This commit switches it to use the out of line method that we use for the other modules.
-
- Oct 18, 2022
-
-
Miguel Ojeda authored
Add a `--spdx` option to the freestanding script to prefix files with a line like (for `.c` files): // SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause or (for `.h` and `.S` files): /* SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause */ Given the style of the line to be used depends on the extension, a simple `sed` insert command would not work. It also skips the file if an existing SPDX line is there, as well as raising an error if an unexpected SPDX line appears anywhere else in the file, as well as for unexpected file extensions. I double-checked that all currently generated files appear to be license as expected with: grep -LRF 'This source code is licensed under both the BSD-style license (found in the' linux/lib/zstd grep -LRF 'LICENSE file in the root directory of this source tree) and the GPLv2 (found' linux/lib/zstd but somebody knowledgable on the licensing of the project should double-check this is the intended case. Fixes: https://github.com/facebook/zstd/issues/3293 Signed-off-by:
Miguel Ojeda <ojeda@kernel.org> Signed-off-by:
Miguel Ojeda <ojeda@kernel.org>
-
- Mar 10, 2022
-
-
Cyber Knight authored
- As referenced by Nick Terrelln ~ the ZSTD maintainer in the linux kernel, making zstd_reset_cstream() functionally identical to ZSTD_resetCStream() would be the perfect way to fix the warning without touching any core functions or breaking other parts of the code. Suggested-by:
Nick Terrell <terrelln@fb.com> Signed-off-by:
Cyber Knight <cyberknight755@gmail.com>
-
- Mar 08, 2022
-
-
Cyber Knight authored
- The previous patch throws the following warning: ../linux/lib/zstd/zstd_compress_module.c: In function ‘zstd_reset_cstream’: ../linux/lib/zstd/zstd_compress_module.c:136:34: error: enum conversion when passing argument 2 of ‘ZSTD_CCtx_reset’ is invalid in C++ [-Werror=c++-compat] 136 | return ZSTD_CCtx_reset(cstream, pledged_src_size); | ^~~~~~~~~~~~~~~~ In file included from ../linux/include/linux/zstd.h:26, from ../linux/lib/zstd/zstd_compress_module.c:15: ../linux/include/linux/zstd_lib.h:501:20: note: expected ‘ZSTD_ResetDirective’ {aka ‘enum <anonymous>’} but argument is of type ‘long long unsigned int’ 501 | ZSTDLIB_API size_t ZSTD_CCtx_reset(ZSTD_CCtx* cctx, ZSTD_ResetDirective reset); | ^~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Since we have a choice to either use ZSTD_CCtx_reset or ZSTD_CCtx_setPledgedSrcSize instead of ZSTD_resetCStream, let's switch to ZSTD_CCtx_setPledgedSrcSize to not have any unnecessary warns alongside the kernel build and CI test build. Signed-off-by:
Cyber Knight <cyberknight755@gmail.com>
-
- Mar 07, 2022
-
-
Cyber Knight authored
- This fixes the below warning: ../lib/zstd/zstd_compress_module.c: In function 'zstd_reset_cstream': ../lib/zstd/zstd_compress_module.c:136:9: warning: 'ZSTD_resetCStream' is deprecated [-Wdeprecated-declarations] 136 | return ZSTD_resetCStream(cstream, pledged_src_size); | ^~~~~~ In file included from ../include/linux/zstd.h:26, from ../lib/zstd/zstd_compress_module.c:15: ../include/linux/zstd_lib.h:2277:8: note: declared here 2277 | size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pledgedSrcSize); | ^~~~~~~~~~~~~~~~~ ZSTD_resetCstream is deprecated and zstd_CCtx_reset is suggested to use hence let's switch to it. Signed-off-by:
Cyber Knight <cyberknight755@gmail.com>
-
- Jan 18, 2022
-
-
Nick Terrell authored
* Add `-Wa,--noexecstack` to both `ASFLAGS` and `CFLAGS` * Pass `ASFLAGS` to `.S` compilation instead of `CFLAGS` Fixes #3006.
-
- Dec 14, 2021
-
-
Norbert Lange authored
To make code more expressive, add U8 and S8 typedefs
-
- Dec 03, 2021
-
-
Nick Terrell authored
Move portability macros to `lib/common/portability_macros.h`. This file only contains platform/feature detection (e.g. 0/1 macros). This file is shared between C and ASM code, so it cannot include any C code. Rename `HUF_` ASM macros to be `ZSTD_` prefixed, and move to the new header. Restrict `ZSTD_ASM_SUPPORTED` to `__GNUC__`, because we need the GAS assembler. Finally, only include the ASM code if we are actually going to use it. This disables it on all Windows platforms, which should resolve the problem brought up in Issue #2789.
-
- Nov 16, 2021
-
-
Nick Terrell authored
It is no longer necessary to get good performance, there is only a small speed difference between -O2 and -O3, so just stick to the default of -O2. I've measured neutral compression speed and a ~3% decompression speed loss in userspace with clang & gcc. I've also measured neutral compression speed and a ~1% decompression speed loss in the kernel benchmarks. This also fixes the stack space usage on parisc. The compiler was buggy for -O3 and used ~3KB of stack space for several functions. With -O2 the problem is completely resolved, and stack space is back to a few hundred bytes. Additionally, we get a large code size win on gcc: | Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) | |----------|----------------|---------------|---------------| | gcc-11 | 952754 | 738954 | -213800 | | clang-12 | 976290 | 938826 | -37464 |
-
Nick Terrell authored
The optimal parser is unlikely to be used in the linux kernel in practice. There is no reason these functions should be force inlined, since we aren't gaining anything, and are losing build size. | Compiler | Before (Bytes) | After (Bytes) | Delta (Bytes) | |----------|----------------|---------------|---------------| | gcc-11 | 1142090 | 952754 | -189336 | | clang-12 | 1228402 | 976290 | -252112 | This is a temporary solution pending the resolution of PR #2862 in the `dev` branch.
-
- Sep 24, 2021
-
-
Nick Terrell authored
Test the kernel build with the standard warnings enabled so that we don't miss issues like fixed in PR #2802. Stacked on top of PR #2802 so CI passes, so it includes the fix. But, I won't merge until it is merged, so @solbjorn gets the credit for the fix.
-
- Sep 23, 2021
-
-
Nick Terrell authored
Switch to a macro `ZSTD_FALLTHROUGH;` instead of a comment. On supported compilers this uses an attribute, otherwise it becomes a comment. This is necessary to be compatible with clang's `-Wfall-through`, and gcc's `-Wfall-through=2` which don't support comments. Without this the linux build emits a bunch of warnings. Also add a test to CI to ensure that we don't regress.
-
Alexander Lobakin authored
Commit a5f2c455 ("Huffman ASM") added a new ASM source file, but it wasn't added to the kernel Makefile despite that it received support for Huffman ASM according to the internal definitions. This leads to undefined references, as huf_decompress.o now calls those ASM functions. Add it to the list of sources when building inside the kernel tree. Kbuild can handle .S files just fine, so none additional rules needed. Fixes: a5f2c455 ("Huffman ASM") Signed-off-by:
Alexander Lobakin <alobakin@pm.me>
-
Alexander Lobakin authored
Linux 5.15 introduces a new Kconfig option, CONFIG_WERROR, which forces -Werror for the entire kernel. Current in-kernel ZSTD implementation uses functions deprecated in 1.5.0, and thus fails on -Wdeprecated-declarations. Turn this particular error into warning to be able to build the kernel with CONFIG_WERROR. I'm not disabling them completely to make sure they'll be visible and [hopefully] fixed sooner or later. Signed-off-by:
Alexander Lobakin <alobakin@pm.me>
-
senhuang42 authored
-
Nick Terrell authored
Instead of calling `ZSTD_compress_advanced()` and `ZSTD_initCStream_advanced()`, which each take a `ZSTD_parameters` by value, use the new advanced API. Stack usage went from 2024 -> 1944.
-
- Sep 22, 2021
-
-
Nick Terrell authored
Correctly identify that we are GPL v2+ or BSD 3 clause, as pointed out in issue #2663.
-
- Sep 20, 2021
-
-
Nick Terrell authored
-