Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1356773pxf; Fri, 9 Apr 2021 06:33:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPa0JyicFIJb6IJGVzFvz32L9jHLJ4uvlQiIbGVFAPgSPNF8HvzWxC34Qv4NLjCAgAo6/M X-Received: by 2002:a17:90a:eacc:: with SMTP id ev12mr3939396pjb.159.1617975186762; Fri, 09 Apr 2021 06:33:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617975186; cv=none; d=google.com; s=arc-20160816; b=mN4vt07imLg1fxtqvB85hRWVWx6q7JwX/cc8vKYGBH0eeoc6X3DFaIDWo7D/QsdVjT aHcUTCFbXRlOLOTHUOUPxJ3T355kqcaTyVIV31r74ZBpbtiWTwh0EglQJDPZ8lSe2KTo sc1xU2RvzGScmL/6QzBXgVpwcL1YeipatvaQLIWtUVf3AMhgfs60T3Y0Z7fkdicy7G9p qiduxiNtdbDMwVbHYmgOxvHoSaJj+aWrin1nA0by6p/DfuSi6BVr0Rju8UBAva0rXbPG nGSaw3p3NwRlaqYZym40xVv3+G9vtWqEfLvBqWH9Rjz9eu4u9LRuwhJBevdGtalX1nLl yymA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature:dkim-signature; bh=O760yRcwt7n2sx3necIavnUPiURJl6AJeR9OvM52rLk=; b=mksaxKX+/0iK8W+SgWO2cVclJJYk52FRRfrpgPynSl6WADAtNV8gMw5IlJnwL8Bx8r VFOiK5h1IIv5CgVxSDGBLSXhwkxEKSZT5BdZWYOfj5/MBbeCjAqHDZQWF1N/MMdqsWpe 5OMAXmsZxdPR4qAdKzJgjqOPkQJ42PcldNglzw4Y1tb9bSGcDOAfL3bSfx5guuhqb0KB i9fQp2QUqoXjw59F3HXUKnFsYqNNUZ5xPcbGOH3oSH4QmwnLWiRTRbHHdWCqDEme0ga4 q1nOB560WGHTw1ZrsiBO6uFWYNFkNazm3aE1Sy5bI/pQysvHQfRdjrZL06KtXsEXRcBZ EkpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=pXEdTHuV; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=Zxue1oUl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si3508258pfv.33.2021.04.09.06.32.53; Fri, 09 Apr 2021 06:33:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=pXEdTHuV; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=Zxue1oUl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=mailbox.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232286AbhDINb1 (ORCPT + 99 others); Fri, 9 Apr 2021 09:31:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231599AbhDINb0 (ORCPT ); Fri, 9 Apr 2021 09:31:26 -0400 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050::465:103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64ED8C061761; Fri, 9 Apr 2021 06:31:13 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4FGzYC47VgzQjx3; Fri, 9 Apr 2021 15:31:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-transfer-encoding:content-type:content-type:mime-version :subject:subject:references:in-reply-to:message-id:from:from :date:date:received; s=mail20150812; t=1617975065; bh=PpPDzBaifE tkZlonBqPbEjzUn9F7Q+H3PT2vmw7Iq6g=; b=pXEdTHuVxVuIm3izAYfatWmUPb aLszVGub/YPRwnVpX6uc6xierFdDd2llm74OTw6P2P7lylaCfGfATbN/AMpRMyH0 HadnWiSdlT+ARvAHkqi4PJ5mc+AzIrejCqZoij4RtlFQUuYbxH1VTDeblXXAPNqF z2hrN9qgdB77g5El2viQFJX5RfjaT88Q11tujW9a5inuRJ/W6Pn+ajkNXaDxJmCV zLnCifCt25p035P65JlzFi5lcDN+p4LL6ehvuPMMpTflqYk31LS+IazOEYKhK+Wh LCWTmSnFJ/+XhJexnXLT/L+Ydsrumkibl9wg6IjOcGYV9ZfKcOOLBb3TjHmA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1617975069; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O760yRcwt7n2sx3necIavnUPiURJl6AJeR9OvM52rLk=; b=Zxue1oUlDfb31XU4iqR077EoGeFsFjtf4tU4eeJ/axI+NkE621XNUiTbO7gMewHcKXWtFO mmCr8q8JHnTUE3qCN3dfZ2ZRksL7hfNCqpeS/63Xyi+0797dKXvOcN6VNN11yAG0jAhxg+ B7nZ4VmmcfL3Pg3IJtLHWUp7q5E80xjfcwdobs/2nMxubyJvxVYNdkfKj6RFXxJWlC1uui nBK6ryjoxVjK3tm3Z/q8u7IlsLTCgLLLQRSNaMTZK350zJO1ZdI+5APZqdeqUCUptr2V8O F/pUOvz2pwmDLHkQD28BX7dNotJIdyCww/5yD86litUr1saj8O1QfrYZiaYzCQ== X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id uBq6-GA7m_3V; Fri, 9 Apr 2021 15:31:05 +0200 (CEST) Date: Fri, 9 Apr 2021 15:31:05 +0200 (CEST) From: torvic9@mailbox.org To: "linux-kbuild@vger.kernel.org" , "masahiroy@kernel.org" Cc: "linux-kernel@vger.kernel.org" , =?UTF-8?Q?Piotr_G=C3=B3rski?= Message-ID: <1637052983.69379.1617975065141@office.mailbox.org> In-Reply-To: <1557177615.69331.1617974903770@office.mailbox.org> References: <1557177615.69331.1617974903770@office.mailbox.org> Subject: [PATCH 2/2] kbuild: allow setting zstd compression level for kernel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-MBO-SPAM-Probability: X-Rspamd-Score: -2.44 / 15.00 / 15.00 X-Rspamd-Queue-Id: A99C1186A X-Rspamd-UID: 2aadda Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In a similar way to the first patch in this series, add another Kconfig option that allows setting the zstd compression level for the kernel as well. This enables users to choose either a compression level between 1 and 19, or instead use the highest possible level (ultra-22). Also add '-T0' parameter in both cases. Signed-off-by: Tor Vic --- arch/x86/boot/compressed/Makefile | 5 +++++ init/Kconfig | 19 +++++++++++++++++++ scripts/Makefile.lib | 4 ++-- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index e0bc3988c..59ed10c61 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -130,8 +130,13 @@ $(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE $(call if_changed,lzo) $(obj)/vmlinux.bin.lz4: $(vmlinux.bin.all-y) FORCE $(call if_changed,lz4) +ifdef CONFIG_KERNEL_ZSTD_ULTRA $(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE $(call if_changed,zstd22) +else +$(obj)/vmlinux.bin.zst: $(vmlinux.bin.all-y) FORCE + $(call if_changed,zstd) +endif suffix-$(CONFIG_KERNEL_GZIP) := gz suffix-$(CONFIG_KERNEL_BZIP2) := bz2 diff --git a/init/Kconfig b/init/Kconfig index 15bb02c24..1d3c5eebf 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -321,6 +321,25 @@ config KERNEL_UNCOMPRESSED endchoice +menu "ZSTD compression options" + depends on KERNEL_ZSTD + +config KERNEL_ZSTD_LEVEL + int "Compression level (1-19)" + range 1 19 + default 19 + help + Choose a compression level for zstd kernel compression. + Default is 19. + +config KERNEL_ZSTD_LEVEL_ULTRA + bool "Ultra compression" + help + Selecting this overrides the chosen compression level and enables + the highest possible compression level for zstd (ultra-22). + +endmenu + config DEFAULT_INIT string "Default init path" default "" diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index a4fbaf888..aa29b97fb 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -455,10 +455,10 @@ quiet_cmd_xzmisc = XZMISC $@ # be used because it would require zstd to allocate a 128 MB buffer. quiet_cmd_zstd = ZSTD $@ - cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@ + cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -$(CONFIG_KERNEL_ZSTD_LEVEL) -T0; $(size_append); } > $@ quiet_cmd_zstd22 = ZSTD22 $@ - cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@ + cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra -T0; $(size_append); } > $@ # ASM offsets # --------------------------------------------------------------------------- -- 2.31.1