Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4308815pxf; Tue, 30 Mar 2021 04:52:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLhUIVW2WKBNDEf58meOlSXNxdZmC9FeYnnlNFTtv2MT79FY9rWm1FAHQx5n8hfcCeanOz X-Received: by 2002:a17:906:1519:: with SMTP id b25mr32841006ejd.254.1617105123220; Tue, 30 Mar 2021 04:52:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617105123; cv=none; d=google.com; s=arc-20160816; b=L5RHUY5ExrGlfDu8I0Bm+Vo7xhU6wpGjvmcAGo/CIL/crzLjugxUJ0x1MlJV6JTrme AcuCdVYYb1ovb/1Pc7EbjUNBHySsZ0zREgtGCLzn6OjIGkV8NT9veTlvpAbX0DVeNK+G 9l+YOLzss2txFwVncyPLMRdOs6rThsiEcmIeXMRRocD6PV7xpZAckKaeCOX3Na4lHX2n bwNB7vgt2WcdcdA3K6k0dzVxdYwq7xN/g9DlhRri5lKNUlhzqEPUxNDS9LXh1pP5SB4y X/uG2uTAv+I6CNpbOLYukewGgpzmHuQuCA7aslFnNcDQUFmDYKXWF23NXpVK7UGQAEjC b3ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2qLsWX1x+rTNov0mLCK2bfYYZ/19Z9kvWQ6aFEEfiuk=; b=g/4D5O28lA9MUxEj1u1lwoHBpfRPeHXNAAK3bJgkv+cT53I86/st1TBrFlgA7n9LJE VeEPjPVOKwbK6o23ysy/BqojnwK3+HCkkgmq2cNWl6VCronAEhsenQZc/vLxSo7gwtbv bZB1Lnfk0gtAD3OWjFRCsv9mBVohYJ7ghqRgRnFtn7eCQ/WSNDq3JCobQHnVRK3KqCtj 6qthYaqmmC+S6VAhyPyPnPQDwY5jWJiskTyrHi8FQwMXmrwBJiRgHQWUs03jkKXIlLII Lp8LpU0NCrgQGmN8tCAqJOmtF4vNzevL/OgMKZdBEAxSjR+YJzemM+yDplxLii35VK46 zGVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@natalenko.name header.s=dkim-20170712 header.b=YlB63PuC; 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=natalenko.name Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si14517723eje.459.2021.03.30.04.51.40; Tue, 30 Mar 2021 04:52:03 -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=@natalenko.name header.s=dkim-20170712 header.b=YlB63PuC; 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=natalenko.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231622AbhC3Lui (ORCPT + 99 others); Tue, 30 Mar 2021 07:50:38 -0400 Received: from vulcan.natalenko.name ([104.207.131.136]:51662 "EHLO vulcan.natalenko.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbhC3Lu2 (ORCPT ); Tue, 30 Mar 2021 07:50:28 -0400 Received: from localhost (kaktus.kanapka.ml [151.237.229.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by vulcan.natalenko.name (Postfix) with ESMTPSA id C253DA097EB; Tue, 30 Mar 2021 13:50:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=natalenko.name; s=dkim-20170712; t=1617105023; 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: in-reply-to:in-reply-to:references:references; bh=2qLsWX1x+rTNov0mLCK2bfYYZ/19Z9kvWQ6aFEEfiuk=; b=YlB63PuC7AhJe1TaGiPRB3Ogxf1xILpkhnnXiqsDMkHcW25lbskYWW/C3XVCAI5vBiWGYL 8YoPpUxZDgVwqsaAksG/vB6iNGCxzgaaamIrvlbvzNE7HD3amFmOCbW9Lz0LhzYuiFY9CV HKhXCYnZYjUt6pEo8vQiLdH6ZEpDAiA= Date: Tue, 30 Mar 2021 13:50:23 +0200 From: Oleksandr Natalenko To: Piotr Gorski Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, Masahiro Yamada , Michal Marek , Andrew Morton , Kees Cook , Nathan Chancellor , Daniel Borkmann , Valentin Schneider , "Jan Alexander Steffens (heftig)" , Nick Terrell , David Howells , Johannes Weiner Subject: Re: [PATCH] init: add support for zstd compressed modules Message-ID: <20210330115023.qt742qsdekwiroey@spock.localdomain> References: <20210330113235.2767216-1-lucjan.lucjanov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210330113235.2767216-1-lucjan.lucjanov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 01:32:35PM +0200, Piotr Gorski wrote: > kmod 28 supports modules compressed in zstd format so let's add this possibility to kernel. > > Signed-off-by: Piotr Gorski > --- > Makefile | 7 +++++-- > init/Kconfig | 9 ++++++--- > 2 files changed, 11 insertions(+), 5 deletions(-) > > diff --git a/Makefile b/Makefile > index 5160ff8903c1..82f4f4cc2955 100644 > --- a/Makefile > +++ b/Makefile > @@ -1156,8 +1156,8 @@ endif # INSTALL_MOD_STRIP > export mod_strip_cmd > > # CONFIG_MODULE_COMPRESS, if defined, will cause module to be compressed > -# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP > -# or CONFIG_MODULE_COMPRESS_XZ. > +# after they are installed in agreement with CONFIG_MODULE_COMPRESS_GZIP, > +# CONFIG_MODULE_COMPRESS_XZ, or CONFIG_MODULE_COMPRESS_ZSTD. > > mod_compress_cmd = true > ifdef CONFIG_MODULE_COMPRESS > @@ -1167,6 +1167,9 @@ ifdef CONFIG_MODULE_COMPRESS > ifdef CONFIG_MODULE_COMPRESS_XZ > mod_compress_cmd = $(XZ) --lzma2=dict=2MiB -f > endif # CONFIG_MODULE_COMPRESS_XZ > + ifdef CONFIG_MODULE_COMPRESS_ZSTD > + mod_compress_cmd = $(ZSTD) -T0 --rm -f -q > + endif # CONFIG_MODULE_COMPRESS_ZSTD > endif # CONFIG_MODULE_COMPRESS > export mod_compress_cmd > > diff --git a/init/Kconfig b/init/Kconfig > index 8c2cfd88f6ef..86a452bc2747 100644 > --- a/init/Kconfig > +++ b/init/Kconfig > @@ -2250,8 +2250,8 @@ config MODULE_COMPRESS > bool "Compress modules on installation" > help > > - Compresses kernel modules when 'make modules_install' is run; gzip or > - xz depending on "Compression algorithm" below. > + Compresses kernel modules when 'make modules_install' is run; gzip, > + xz, or zstd depending on "Compression algorithm" below. > > module-init-tools MAY support gzip, and kmod MAY support gzip and xz. > > @@ -2273,7 +2273,7 @@ choice > This determines which sort of compression will be used during > 'make modules_install'. > > - GZIP (default) and XZ are supported. > + GZIP (default), XZ, and ZSTD are supported. > > config MODULE_COMPRESS_GZIP > bool "GZIP" > @@ -2281,6 +2281,9 @@ config MODULE_COMPRESS_GZIP > config MODULE_COMPRESS_XZ > bool "XZ" > > +config MODULE_COMPRESS_ZSTD > + bool "ZSTD" > + > endchoice > > config MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS > -- > 2.31.0.97.g1424303384 > Great! Reviewed-by: Oleksandr Natalenko This works perfectly fine in Arch Linux if accompanied by the following mkinitcpio amendment: [1]. I'm also Cc'ing other people from get_maintainers output just to make this submission more visible. Thanks. [1] https://github.com/archlinux/mkinitcpio/pull/43 -- Oleksandr Natalenko (post-factum)