xz_wrap.sh: Adjust arch-specific options for better compression.

Use LZMA2 options that match the arch-specific alignment of instructions.
This change reduces compressed kernel size 0-2 % depending on the arch.
On 1-byte-aligned x86 it makes no difference and on 4-byte-aligned archs
it helps the most.

Use the ARM-Thumb filter for ARM-Thumb2 kernels. This reduces compressed
kernel size about 5 %. Previously such kernels were compressed using
the ARM filter which didn't do anything useful with ARM-Thumb2 code.

Add BCJ filter support for ARM64 and RISC-V. On ARM64 the compressed
kernel size is reduced about 5 % and on RISC-V by 7-8 %. These require
new enough version of the xz tool. With an old xz version a message is
printed to standard error and compression is done without the filter.

Update lib/decompress_unxz.c to match the changes to xz_wrap.sh.

Thanks to Jubin Zhong for pointing out that CONFIG_THUMB2_KERNEL
should be used to detect which BCJ filter is used on 32-bit ARM.

    https://lore.kernel.org/lkml/1637379771-39449-1-git-send-email-zhongjubin@huawei.com/

It never got merged into Linux. That patch sourced the whole auto.conf
file as a shell script instead of using grep like is done in this commit.
2 files changed
tree: c330df4ed7828de8ef163538e3260863a036eabc
  1. linux/
  2. userspace/
  3. .gitattributes
  4. .gitignore
  5. AUTHORS
  6. COPYING
  7. README