From patchwork Sat Sep 10 08:11:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 605122 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 8C212C6FA83 for ; Sat, 10 Sep 2022 08:12:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229700AbiIJIMy (ORCPT ); Sat, 10 Sep 2022 04:12:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229688AbiIJIMj (ORCPT ); Sat, 10 Sep 2022 04:12:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B3E4868AC; Sat, 10 Sep 2022 01:12:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D592C60C01; Sat, 10 Sep 2022 08:12:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C67DC4347C; Sat, 10 Sep 2022 08:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662797554; bh=GuY8276n/eRax8D4bN0N+JvUa77cwpfHICfgt9doQ1c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=stQqAy1gyraU9bRDfAFnVamiw1VRMdBu7IPx1EvA2EDnWH61QnCkVGJ8NLhEA89G+ F9Rr5CJygeXjkOpesQ2vptfRolRDOcuFAPe6fqVqH1DDio0rpXZE9zkE4PMBGNp5gJ 2SL2ghVUEA2OH8MMOzkjPxmjcQ64xmioza/6Ft9SkKAR01bPfykYvNDup6L439jDMA lX1DDRYsRCd7Ow58H9qqf/559otFyk9xjh/v/kHbdprLgAE8vUJSbpfMDLHuc+vprv bnhWGdzgE/muly+j9rIhvLcSM9MnYnSGW2wGWIrBgfzhKz4Zu7KhHlpgTrkC5BQ0sw 9Wf7zXkf5KQ1g== From: Ard Biesheuvel To: linux-efi@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , "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 , Jeremy Linton , Will Deacon , Catalin Marinas Subject: [PATCH v5 6/8] arm64: efi: enable generic EFI compressed boot Date: Sat, 10 Sep 2022 10:11:50 +0200 Message-Id: <20220910081152.2238369-7-ardb@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220910081152.2238369-1-ardb@kernel.org> References: <20220910081152.2238369-1-ardb@kernel.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1642; i=ardb@kernel.org; h=from:subject; bh=GuY8276n/eRax8D4bN0N+JvUa77cwpfHICfgt9doQ1c=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjHEbF8hJQ56ln/A/CC0taX3RBGiOeGIn/epSviNNT QJsSLjyJAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYxxGxQAKCRDDTyI5ktmPJL8EDA CTUabsOcQV2xcWs4ccVK9JFyN0ArpMIc1LF7Ms9VYhLgxfPjQeZKNqdd2P7EU/Bvap6NsAwP85miC+ T5oXg9W6gGNd5hZ4bun9/72wXu1F1x+icitwh0nyFzeUcCUsaWpESFV9JWjgCKbewl3XIcmgDMqrlU O9GDST5OloaKjDFI2dhu1QeJYlqfclvyms/+AE9DOMvVWVEstMaTLvht0ols+p/82V0pdWxOB+oC7b zRfp+EZanT+oqL7CCIzqWQVPf3KIJaVhKTTd8PXduutM9t4C7+0o1W8RqLUrFHCVcLTJqGSP341sng 0Vd016ChIJqsNQxZUOBEPWODEyXmghiLCKNq3LHRXKoAy4tRg757PBPUzTtGtJ0B9wnnVDC1S2/pq8 Yqgqdul0Ge0ZCJgaRU9Su4iHwbbZObmaCGFh/t/BEhG9CKaK/s0J+cJNh3KBoD5MeLyovsbbh+KjKz lem/Xo2Av03S1nfBB+YA+AU2Gu/FIIrDR3AqsI2EdnH7k= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org Wire up the generic EFI zboot support for arm64. Signed-off-by: Ard Biesheuvel Acked-by: Catalin Marinas --- arch/arm64/Makefile | 9 +++++++-- arch/arm64/boot/.gitignore | 1 + arch/arm64/boot/Makefile | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 6d9d4a58b898..a82bb3599094 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -151,12 +151,17 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a # Default target when executing plain make boot := arch/arm64/boot + +ifeq ($(CONFIG_EFI_ZBOOT),) KBUILD_IMAGE := $(boot)/Image.gz +else +KBUILD_IMAGE := $(boot)/vmlinuz.efi +endif -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/.gitignore b/arch/arm64/boot/.gitignore index 9a7a9009d43a..af5dc61f8b43 100644 --- a/arch/arm64/boot/.gitignore +++ b/arch/arm64/boot/.gitignore @@ -1,3 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only Image Image.gz +vmlinuz* 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