From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755761AbdJJV16 (ORCPT ); Tue, 10 Oct 2017 17:27:58 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:36840 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751701AbdJJV15 (ORCPT ); Tue, 10 Oct 2017 17:27:57 -0400 Smtp-Origin-Hostprefix: dev From: Nick Terrell Smtp-Origin-Hostname: dev10183.prn2.facebook.com To: Nick Terrell CC: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , , , , Chris Mason , Yann Collet , Rene Rebe Smtp-Origin-Cluster: prn2c22 Subject: [PATCH 0/2] Add support for ZSTD-compressed kernel Date: Tue, 10 Oct 2017 14:22:42 -0700 Message-ID: <20171010212244.1659577-1-terrelln@fb.com> X-Mailer: git-send-email 2.9.5 X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-10_06:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patch set adds support for a ZSTD-compressed kernel and ramdisk images in the kernel boot process. It only integrates the support with x86, though the first patch is generic to all architectures. Zstandard requires slightly more memory during the kernel decompression on x86 (192 KB vs 64 KB), and the memory usage is independent of the window size. Zstandard requires memory proprortional to the window size used during compression for decompressing the ramdisk image, since streaming mode is used. Newer versions of zstd (1.3.2+) list the window size of a file with `zstd -lv '. The absolute maximum amount of memory required is just over 8 MB. Thanks, Nick Terrell Nick Terrell (2): lib: Add support for ZSTD-compressed kernel x86: Add support for ZSTD-compressed kernel Documentation/x86/boot.txt | 6 +- arch/x86/Kconfig | 1 + arch/x86/boot/compressed/Makefile | 5 +- arch/x86/boot/compressed/misc.c | 4 + arch/x86/boot/header.S | 8 +- arch/x86/include/asm/boot.h | 6 +- include/linux/decompress/unzstd.h | 26 +++ init/Kconfig | 14 +- lib/Kconfig | 4 + lib/Makefile | 1 + lib/decompress.c | 5 + lib/decompress_unzstd.c | 341 ++++++++++++++++++++++++++++++++++++++ lib/xxhash.c | 21 ++- lib/zstd/decompress.c | 2 + lib/zstd/fse_decompress.c | 9 +- scripts/Makefile.lib | 15 ++ usr/Kconfig | 22 +++ 17 files changed, 465 insertions(+), 25 deletions(-) create mode 100644 include/linux/decompress/unzstd.h create mode 100644 lib/decompress_unzstd.c -- 2.9.5