From patchwork Sat Sep 10 08:11:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 12972460 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 6BD1EC6FA82 for ; Sat, 10 Sep 2022 08:13:55 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CPe5oF0AkFZxF0OXVfLPPh5y4ylhOyke2CsnXGanedI=; b=KnbkdDbH+9IgQr AOjme+6fkb6S+CIqdHFkHv+mn3yWjtiwjfBCz8DS1+QEG6a90FUVgH4QpyCPMRGk9hyvM1RGCrjID Uj5DToSaOwOitaTRDHVNhzGEU8N0qiJAeMG0SyjtVVBVoR2WO5Qhd8kqg1Wf8UP+M0HjEaUEptdC8 K9W4njA2/fYIfBzsN432SNlUE9uCgWUul4Wskd43RrIbTZveHUQwdwLAFJa7XUtpbnxhCVN5IcwDS 5gTnA+euVrJEH646y5oSng2ZMBEvKBXkplkWLjhfpmswdvDoGhrLKll01USRC8Zyuty60zbDyle83 dWc/BDgQAaAjwJQHR3yA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWvbg-008bpI-RD; Sat, 10 Sep 2022 08:12:52 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oWvbG-008bgY-Rs for linux-arm-kernel@lists.infradead.org; Sat, 10 Sep 2022 08:12:28 +0000 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 758296113B; Sat, 10 Sep 2022 08:12:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D78CC43470; Sat, 10 Sep 2022 08:12:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662797545; bh=g/I6o9WvdVeu651t6tHQYfn5T0sdMdzkuDqxO4VZTTI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6BDG4zuXErcAex2A+ofxL0X2YoAXmMkHlazxWcCc70Jn0zA+t00UK2NYdKI3q5fr huspjjJZDDRC9W1AORn+WZz7JxO8FHOP/aZQB4mvr3BVK0W2O7xwprzhVl9q2haAKG wWgRtZnRu5SzQ8c5J4o2oIl6RThQfY8mj2PWs3jv5TPpCaSNF/GFIRSB/xMegkjmo5 HsmZo1jypL99TYN2zazsAhP23URzrA90mPcwAn1er1LSWBZtri2Z/dL0nNpO/O1ORx 54E2WF7X6z4P3lQ2n2TRErMcSVthEskjgi6E9TmEpMc0Cz2uywWRRyEIDRXQC9T5sG R1e5kvL6QmqGw== 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 4/8] efi/libstub: move efi_system_table global var into separate object Date: Sat, 10 Sep 2022 10:11:48 +0200 Message-Id: <20220910081152.2238369-5-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=2060; i=ardb@kernel.org; h=from:subject; bh=g/I6o9WvdVeu651t6tHQYfn5T0sdMdzkuDqxO4VZTTI=; b=owEB7QES/pANAwAKAcNPIjmS2Y8kAcsmYgBjHEbCNL1atc4I2i0tRtLuRVST/HeZTmrvSg+het3P F6fdon6JAbMEAAEKAB0WIQT72WJ8QGnJQhU3VynDTyI5ktmPJAUCYxxGwgAKCRDDTyI5ktmPJN7YC/ 9d9a5dml0iPwavL1S9T1eoDHB+HjhSEklW8IifC+Xym1/vbziUDkCUv99qCpw7pF4cEoOfOglg9Or3 Y0tKzFNlr6ZmmpiUmFUbzIjairVQnJ7GHGrd/ApSwbEilP6+gTJAqAWkjzMKo4kHrEAOweQjFfYfRx RB9KUvetl4EU0bwjrFXScnD4Exk7NUCstgdXlEry+n1LOsePBxM7ipv+OQ23i2rOji0mguMyJLtH2X qWSY+wLj2hvv0VqlE+sft2duWdcOrXrtQIlN4SkowSs7n+OobfexmmklH1t2hW76Yv2QplpD/1dZWy jRTlbogkTyO9yRO+h32B4MA3gUUZsuwxyO+RaTklZ26AFtkRetObAg8vyb32RZ8I5qgLPNHx7OQHcb YtsGJKIqGldWJETSbAGTT23I3S+cu3MeAPOdPLUFvdef4Zvv/7W91L5ohhcBGfmmcbyCrLyzzXXLfx K6EaATEeutHflepm5Wx53Xm/Ik2rDmH1C4O3TceUb/ckk= X-Developer-Key: i=ardb@kernel.org; a=openpgp; fpr=F43D03328115A198C90016883D200E9CA6329909 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220910_011227_001879_16ABDE5D X-CRM114-Status: GOOD ( 15.49 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org To avoid pulling in the wrong object when using the libstub static library to build the decompressor, define efi_system_table in a separate compilation unit. Signed-off-by: Ard Biesheuvel --- drivers/firmware/efi/libstub/Makefile | 3 ++- drivers/firmware/efi/libstub/efi-stub.c | 2 -- drivers/firmware/efi/libstub/systable.c | 8 ++++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index 98045cfa46dc..8d98efcf4473 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -57,7 +57,8 @@ KCOV_INSTRUMENT := n lib-y := efi-stub-helper.o gop.o secureboot.o tpm.o \ file.o mem.o random.o randomalloc.o pci.o \ skip_spaces.o lib-cmdline.o lib-ctype.o \ - alignedmem.o relocate.o vsprintf.o + alignedmem.o relocate.o vsprintf.o \ + systable.o # include the stub's generic dependencies from lib/ when building for ARM/arm64 efi-deps-y := fdt_rw.c fdt_ro.c fdt_wip.c fdt.c fdt_empty_tree.c fdt_sw.c diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index 4bf751484e8b..57ea04378087 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -57,8 +57,6 @@ static u64 virtmap_base = EFI_RT_VIRTUAL_BASE; static bool flat_va_mapping = (EFI_RT_VIRTUAL_OFFSET != 0); -const efi_system_table_t *efi_system_table; - static struct screen_info *setup_graphics(void) { efi_guid_t gop_proto = EFI_GRAPHICS_OUTPUT_PROTOCOL_GUID; diff --git a/drivers/firmware/efi/libstub/systable.c b/drivers/firmware/efi/libstub/systable.c new file mode 100644 index 000000000000..91d016b02f8c --- /dev/null +++ b/drivers/firmware/efi/libstub/systable.c @@ -0,0 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include +#include + +#include "efistub.h" + +const efi_system_table_t *efi_system_table;