From patchwork Sat Jul 6 19:46:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1128525 X-Patchwork-Delegate: xypron.glpk@gmx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="BlzZHav1"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45h2Q74yCkz9sN4 for ; Sun, 7 Jul 2019 05:50:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 4354FC21DA1; Sat, 6 Jul 2019 19:48:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 833C5C21C6A; Sat, 6 Jul 2019 19:47:11 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BD308C21C2C; Sat, 6 Jul 2019 19:47:05 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lists.denx.de (Postfix) with ESMTPS id 99F51C21C51 for ; Sat, 6 Jul 2019 19:47:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1562442422; bh=yaJBZ26OQsN+oIwte1OYycoVUv1mMbAG94yaEIgIM1U=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=BlzZHav1GTPwm6XSczqmbe1DgvNBgzBlX/nwd5S95PP/cT/pxPPrZkcr869CSMxAf GxfatJtY2ztY4RfuUykU1IOUBMWVTTI8ZdmmFHnWWwDb7PrktjM8jlFO0fRLbU7FfE UMvCBxL1/blV0LkyA4rMh8n4SmGUbyAMZgLOdOfU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([84.118.159.3]) by mail.gmx.com (mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MbKXI-1i2Tze2Cfs-00IjrR; Sat, 06 Jul 2019 21:47:02 +0200 From: Heinrich Schuchardt To: Alexander Graf , AKASHI Takahiro Date: Sat, 6 Jul 2019 21:46:24 +0200 Message-Id: <20190706194634.3349-4-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190706194634.3349-1-xypron.glpk@gmx.de> References: <20190706194634.3349-1-xypron.glpk@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:fy+gGCiiheoKUKDMJ7+LnCWRtq8QwASFA2IUREPEVUyLqKtheGJ pTuUISm0OPE8p4JUtNtrBqZAx1pP998jHzQXVEREbeoy5Xhp3mzmzjXWhWus31fpnQUuwtx TmoCYeZAp370YNnXB+In36j+4WH5OzYfsJ9XgNva/Bi92javLs6AbXLncJEVJQEXEKKy22X +Zlg3nt61esyy4/oLVnQg== X-UI-Out-Filterresults: notjunk:1; V03:K0:0nhT0V6La1E=:5p9JtPio4WXgiVj1W8bDwt JHU7NF3PheFzTgIHuN7C+Cj0Wunn2rlXTYNEP1CStkvS/aoWzr0xvOC3z7bZWKWHJLktsxdw8 V6KeYn2pday00yoYalfHb07umkCRjYW4r6e76WGRl18KmAXi6rPXcgb9fnkLnyV6UjRSRMJHS OytJJT/sRqdzTgYXeQjNskeJkmxOJ0kyvZ0U2pwQpmUdj3m6ic4Ljy3euvx+Ns9rFaJ01OWGK mhihS8RTMKGhVVN+rq344YrnZImmTT6FOavWy6PxHlu81yxuhjK3m6VFfdpqplJ0c6ZDUW7km +wTG+MJNiAkhYnTGUlS28xNqrlBMP9LyTYRNfu0zEUtYnSfUAxKwzd7RiGVI4aAYjm7V+Rk9E yx5E29/3vVXo5U/KTNdysDSHMU6UAHDIdF28MBotI6UGvznwgBT7DK/nVTGM9nRndUzzfOCNc Xiq6/sJQ/BrqoTgErB8LISGNp+18AO5sB5cwbDlGLYgENrAUcFjnadpEtNSw5FSBtMZzB5TYg 0JcAKPSv4nZ4GP/3XEiqqraJDryjzj0II+35imBQUPY246cDa8TL0r++RAGwUY9lXlFlroZpe vZSn3FztdYmOMhfZqyypD0luEjXY1/LDbumhFoq6SEup4QkaujOOjAR5RaUGYHTS4nlNij/UI o7TABqcS3rdSjVQVBCnrRMxdiHr1hvFA0REi9MV+Thj2V/bB6nTzcc5ZJyuCyLwUtjEKw+iG5 R1o+35C84qDZ7kSne+5kMxToHaWn/hF7EpMRZtXaDAByfVMmvlnxu8dy7F/cjlUJKll5yNGGM H9NV7xMOTuVUU3coQqMUv3XJvDC/rkTqurk7L0AK2V/LfRHU8uezNPRfizm8mtMZ1hTfJdGpg 3KdjnCWLDfNjzzueRFRTQTT4dSIVkaEJXFo4vlpLuyhwTU60GRhheO5nvFK8wO+sA99j50Wot wPbZKS/UBES9W3PNMDW+L6q0qkHQL2gO5EZFtTPCcpawExVBI2ImJnm0K4XTfVBfievA0puz1 THVPdKhPwgbejviO81TeHhDpgUoNozXniIsxbxscmaPOUo1jmgfKSrH4OaGpGcYxjJ/Ql32Ma xnrhFueXrKphr0= Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v3 03/13] efi_loader: remove NULL entries from runtime detach list X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Some entries in the system table are set to NULL in ExitBootServices(). We had them in the runtime detach list to avoid relocation of NULL. Let's instead assign the pointers dynamically in efi_initialize_system_table() to avoid the relocation entry. Signed-off-by: Heinrich Schuchardt --- v3 new patch --- lib/efi_loader/efi_boottime.c | 13 +++++++++---- lib/efi_loader/efi_runtime.c | 16 ---------------- 2 files changed, 9 insertions(+), 20 deletions(-) -- 2.20.1 diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index e62410c57f..bf2df80c83 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -3620,11 +3620,7 @@ struct efi_system_table __efi_runtime_data systab = { }, .fw_vendor = firmware_vendor, .fw_revision = FW_VERSION << 16 | FW_PATCHLEVEL << 8, - .con_in = &efi_con_in, - .con_out = &efi_con_out, - .std_err = &efi_con_out, .runtime = &efi_runtime_services, - .boottime = &efi_boot_services, .nr_tables = 0, .tables = NULL, }; @@ -3644,6 +3640,15 @@ efi_status_t efi_initialize_system_table(void) sizeof(struct efi_configuration_table), (void **)&systab.tables); + /* + * These entries will be set to NULL in ExitBootServices(). To avoid + * relocation in SetVirtualAddressMap(), set them dynamically. + */ + systab.con_in = &efi_con_in; + systab.con_out = &efi_con_out; + systab.std_err = &efi_con_out; + systab.boottime = &efi_boot_services; + /* Set CRC32 field in table headers */ efi_update_table_header_crc32(&systab.hdr); efi_update_table_header_crc32(&efi_runtime_services.hdr); diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index dd91880ad6..c56230cad3 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -408,22 +408,6 @@ static const struct efi_runtime_detach_list_struct efi_runtime_detach_list[] = { }, { .ptr = &efi_runtime_services.set_time, .patchto = &efi_set_time, - }, { - /* Clean up system table */ - .ptr = &systab.con_in, - .patchto = NULL, - }, { - /* Clean up system table */ - .ptr = &systab.con_out, - .patchto = NULL, - }, { - /* Clean up system table */ - .ptr = &systab.std_err, - .patchto = NULL, - }, { - /* Clean up system table */ - .ptr = &systab.boottime, - .patchto = NULL, }, { .ptr = &efi_runtime_services.get_variable, .patchto = &efi_device_error,