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 D6CADECAAD1 for ; Wed, 31 Aug 2022 22:05:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231484AbiHaWFI (ORCPT ); Wed, 31 Aug 2022 18:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230215AbiHaWFH (ORCPT ); Wed, 31 Aug 2022 18:05:07 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 10F3813F52 for ; Wed, 31 Aug 2022 15:05:04 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 46E6BED1; Wed, 31 Aug 2022 15:05:10 -0700 (PDT) Received: from [192.168.122.164] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 974773F71A; Wed, 31 Aug 2022 15:05:03 -0700 (PDT) Message-ID: Date: Wed, 31 Aug 2022 17:05:03 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v4 6/9] arm64: efi: enable generic EFI compressed boot Content-Language: en-US To: Ard Biesheuvel , linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, "James E.J. Bottomley" , Matthew Garrett , Peter Jones , Ilias Apalodimas , Heinrich Schuchardt , AKASHI Takahiro , Palmer Dabbelt , Atish Patra , Arnd Bergmann , Huacai Chen , Xi Ruoyao , Lennart Poettering References: <20220827083850.2702465-1-ardb@kernel.org> <20220827083850.2702465-7-ardb@kernel.org> From: Jeremy Linton In-Reply-To: <20220827083850.2702465-7-ardb@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Hi, On 8/27/22 03:38, Ard Biesheuvel wrote: > Wire up the generic EFI zboot support for arm64. Thanks for this series, its very helpful when using a boot manager that isn't grub (ex: systemd-boot, ipxe, etc) since those boot managers have the expectation that they are simply executing efi images. Given how large some of the uncompressed images get, and having a half dozen of them on a machine isn't ideal. So this series solves that problem, as well as cleans up some of the less than ideal grubisms that aren't needed on !x86 platforms. So, I've been testing this series with a clean (as in grub/grubby/etc was never near the system) systemd-boot, which now works given the fixes to the initrd= option. It seems that the resulting boot path is noticeably faster as well. Given I've been testing both gziped and Lz4'ed images it could just be the latter option is faster, or it could be grubs decompressor/load sequence is just slow. That said, I think there are a couple build tweaks in order. First, I would expect that just a normal 'make' (rather than 'make vmlinuz.efi') would make the resulting image when ZBOOT is enabled . Then I would expect 'make install' (or maybe a new 'make ezinstall?') to pass the new compressed efi to the installkernel utility. The install option would work without changes if the make pass just renames/creates the resulting vmlinuz.efi as Image. So.. there are a bunch of choices here, but my assumption is that the ZBOOT changes the resulting image, and the normal make/make install sequence just does the right thing. So, now the fun bit. At the moment my shim->grub->efi-stubbed kernel path (which is the default fedora/rhel sequence) appears to be broken if I swap the compressed image (not the .gz version) in for a normal decompressed kernel. That appears to be a grub bug in fedora at the moment, but I've not fully tracked it down. I was going to test secure boot, but the above problem has temporary stalled that, and I'm still cleaning up a few things on the sd-boot side (there isn't a shim in the path) before that is a workable testing path for anything other than a test signed kernel. Thanks again for this, its extremely helpful. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/Makefile | 4 ++-- > arch/arm64/boot/Makefile | 6 ++++++ > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 6d9d4a58b898..92676ccc6363 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -153,10 +153,10 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a > boot := arch/arm64/boot > KBUILD_IMAGE := $(boot)/Image.gz > > -all: Image.gz > +all: $(notdir $(KBUILD_IMAGE)) > > > -Image: vmlinux > +Image vmlinuz.efi: vmlinux > $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ > > Image.%: Image > diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile > index a0e3dedd2883..c65aee088410 100644 > --- a/arch/arm64/boot/Makefile > +++ b/arch/arm64/boot/Makefile > @@ -38,3 +38,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE > > $(obj)/Image.zst: $(obj)/Image FORCE > $(call if_changed,zstd) > + > +EFI_ZBOOT_PAYLOAD := Image > +EFI_ZBOOT_BFD_TARGET := elf64-littleaarch64 > +EFI_ZBOOT_MACH_TYPE := ARM64 > + > +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9E637ECAAD1 for ; Wed, 31 Aug 2022 22:06:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wXrPEKJcd3hQndFS2sxpFAJXr4QmEeFD8VIxy3TLqv8=; b=YNjla7fCH90+Ec hjR5AhnJmvmEBuqPzuI/aVRMDB61a43BwtgaN6/ejJHMsr9LwPI5161tIxPBOOLOxItHWSgvCKXyF TQ8dYas8HTqfJ1rgE7lJ3D3HrXWPxfyZdlZ7kru2ulPy+eISBovyHLFh+Vh16Di4cFqweNrO4ABLL yiTsTJ39hPdEzLwFipioqClJLyHGbnlUtFT5CRWOoraITswNgb7g6+ouh9CBqk+6GbYRSjOeZGtd5 +OozIAMpg57gq1+bFnZG7mMOh3oYBufNjH1EL5KEkKsNFlrIWyPrzemDBq2OVGK9xDH0MQaoX3cRc E/XdJtHwAdkLuUH0zHqA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTVpj-008SeF-3j; Wed, 31 Aug 2022 22:05:15 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oTVpf-008Sd5-Ms for linux-arm-kernel@lists.infradead.org; Wed, 31 Aug 2022 22:05:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 46E6BED1; Wed, 31 Aug 2022 15:05:10 -0700 (PDT) Received: from [192.168.122.164] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 974773F71A; Wed, 31 Aug 2022 15:05:03 -0700 (PDT) Message-ID: Date: Wed, 31 Aug 2022 17:05:03 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH v4 6/9] arm64: efi: enable generic EFI compressed boot Content-Language: en-US To: Ard Biesheuvel , linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, "James E.J. Bottomley" , Matthew Garrett , Peter Jones , Ilias Apalodimas , Heinrich Schuchardt , AKASHI Takahiro , Palmer Dabbelt , Atish Patra , Arnd Bergmann , Huacai Chen , Xi Ruoyao , Lennart Poettering References: <20220827083850.2702465-1-ardb@kernel.org> <20220827083850.2702465-7-ardb@kernel.org> From: Jeremy Linton In-Reply-To: <20220827083850.2702465-7-ardb@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220831_150511_892711_2568F6AF X-CRM114-Status: GOOD ( 25.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On 8/27/22 03:38, Ard Biesheuvel wrote: > Wire up the generic EFI zboot support for arm64. Thanks for this series, its very helpful when using a boot manager that isn't grub (ex: systemd-boot, ipxe, etc) since those boot managers have the expectation that they are simply executing efi images. Given how large some of the uncompressed images get, and having a half dozen of them on a machine isn't ideal. So this series solves that problem, as well as cleans up some of the less than ideal grubisms that aren't needed on !x86 platforms. So, I've been testing this series with a clean (as in grub/grubby/etc was never near the system) systemd-boot, which now works given the fixes to the initrd= option. It seems that the resulting boot path is noticeably faster as well. Given I've been testing both gziped and Lz4'ed images it could just be the latter option is faster, or it could be grubs decompressor/load sequence is just slow. That said, I think there are a couple build tweaks in order. First, I would expect that just a normal 'make' (rather than 'make vmlinuz.efi') would make the resulting image when ZBOOT is enabled . Then I would expect 'make install' (or maybe a new 'make ezinstall?') to pass the new compressed efi to the installkernel utility. The install option would work without changes if the make pass just renames/creates the resulting vmlinuz.efi as Image. So.. there are a bunch of choices here, but my assumption is that the ZBOOT changes the resulting image, and the normal make/make install sequence just does the right thing. So, now the fun bit. At the moment my shim->grub->efi-stubbed kernel path (which is the default fedora/rhel sequence) appears to be broken if I swap the compressed image (not the .gz version) in for a normal decompressed kernel. That appears to be a grub bug in fedora at the moment, but I've not fully tracked it down. I was going to test secure boot, but the above problem has temporary stalled that, and I'm still cleaning up a few things on the sd-boot side (there isn't a shim in the path) before that is a workable testing path for anything other than a test signed kernel. Thanks again for this, its extremely helpful. > > Signed-off-by: Ard Biesheuvel > --- > arch/arm64/Makefile | 4 ++-- > arch/arm64/boot/Makefile | 6 ++++++ > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile > index 6d9d4a58b898..92676ccc6363 100644 > --- a/arch/arm64/Makefile > +++ b/arch/arm64/Makefile > @@ -153,10 +153,10 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a > boot := arch/arm64/boot > KBUILD_IMAGE := $(boot)/Image.gz > > -all: Image.gz > +all: $(notdir $(KBUILD_IMAGE)) > > > -Image: vmlinux > +Image vmlinuz.efi: vmlinux > $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ > > Image.%: Image > diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile > index a0e3dedd2883..c65aee088410 100644 > --- a/arch/arm64/boot/Makefile > +++ b/arch/arm64/boot/Makefile > @@ -38,3 +38,9 @@ $(obj)/Image.lzo: $(obj)/Image FORCE > > $(obj)/Image.zst: $(obj)/Image FORCE > $(call if_changed,zstd) > + > +EFI_ZBOOT_PAYLOAD := Image > +EFI_ZBOOT_BFD_TARGET := elf64-littleaarch64 > +EFI_ZBOOT_MACH_TYPE := ARM64 > + > +include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel