From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6A56C433FE for ; Sun, 1 May 2022 11:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346095AbiEALcG (ORCPT ); Sun, 1 May 2022 07:32:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43054 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346155AbiEALcB (ORCPT ); Sun, 1 May 2022 07:32:01 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FEA46D3BD; Sun, 1 May 2022 04:28:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=j2MeoyDNnhtCNI4diPE6KeBtDiVOdWvq3i/pv7roOCY=; b=rh8fo1F7nz7o0sWw61t+nRCLI5 jZ65Mk+l9VOd49fIcfWlmEIDUA2lSnZLqtyWv7QK3OE/Q2H+gpW0K5mvoTwzqkvVI8d478PlhBGJd N8Z7YjkL/7UhYNr2/hZR2ATgsy5kQWJurEwA6dvZ5Qk25xMKqGTCbRzWxAsN8IBWaD8gnN4pBQul5 uaEiMMiXjErxBo5SgMhSAFHCahNYoBkNptOVT0I9aYIs4jNrFpuWBd2vfI0SQCoWP7P5Ie1TLjh6m 5zgw3JAtOlyXomqSary+dknNeLBB0IQ4dMisBYpRSloi6OCTiCe6TA6NjTqGIVIt5nycfecnzXbHe HfmrqEAg==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58472) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nl7kV-0006CR-Vh; Sun, 01 May 2022 12:28:23 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1nl7kQ-0003qP-21; Sun, 01 May 2022 12:28:18 +0100 Date: Sun, 1 May 2022 12:28:18 +0100 From: "Russell King (Oracle)" To: Huacai Chen Cc: Arnd Bergmann , Huacai Chen , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Xuefeng Li , Yanteng Si , Guo Ren , Xuerui Wang , Jiaxun Yang , Linux ARM , Catalin Marinas , Will Deacon , linux-riscv , Paul Walmsley , Palmer Dabbelt , Albert Ou , Ard Biesheuvel , linux-efi Subject: Re: [PATCH V9 21/24] LoongArch: Add zboot (compressed kernel) support Message-ID: References: <20220430090518.3127980-1-chenhuacai@loongson.cn> <20220430090518.3127980-22-chenhuacai@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Russell King (Oracle) Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Sun, May 01, 2022 at 04:46:50PM +0800, Huacai Chen wrote: > Hi, Russell, > > On Sun, May 1, 2022 at 2:35 PM Russell King (Oracle) > wrote: > > > > On Sun, May 01, 2022 at 01:22:25PM +0800, Huacai Chen wrote: > > > Hi, Arnd, > > > > > > On Sat, Apr 30, 2022 at 7:02 PM Arnd Bergmann wrote: > > > > > > > > On Sat, Apr 30, 2022 at 11:05 AM Huacai Chen wrote: > > > > > > > > > > This patch adds zboot (self-extracting compressed kernel) support, all > > > > > existing in-kernel compressing algorithm and efistub are supported. > > > > > > > > > > Signed-off-by: Huacai Chen > > > > > > > > I have no objections to adding a decompressor in principle, and > > > > the implementation seems reasonable. However, I think we should try to > > > > be consistent between architectures. On both arm64 and riscv, the > > > > maintainers decided to not include a decompressor and instead leave > > > > it up to the boot loader to decompress the kernel and enter it from there. > > > X86, ARM32 and MIPS already support self-extracting kernel, and in > > > 5.17 we even support self-extracting modules. So I think a > > > self-extracting kernel is better than a pure compressed kernel. > > > > FYI, kernel modules are not self-extracting. They don't contain the code > > to do the decompression - that is contained within the kernel, and it is > > the kernel that does the decompression. The userspace tooling tells the > > kernel that the module is compressed. > I call "self-extracting" here means we don't need out-of-kernel help: > kernel decompress doesn't need the bootloader, module decompress > doesn't need kmod. As I understand it, it does require out-of-kernel help. The module loading program needs to pass in to the finit_module syscall a flag to tell the kernel to decompress it. See the MODULE_INIT_COMPRESSED_FILE flag. So it's definitely not "self-extracting" by any sense of "self". My definition of "self-extracting" is where a program contains the extractor inside the same image, and when the program is run, it performs the extraction using code contained within the image itself. Your definition would mean a gzipped kernel binary would be able to be called "self-extracting" if the boot loader decompresses it. This is definitely not "self-extracting" in my book. Sorry to be such a pedant. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!