{"id":2228249,"url":"http://patchwork.ozlabs.org/api/1.1/patches/2228249/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20260424173151.371134-6-harsimransingh.tungal@arm.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/1.1/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<20260424173151.371134-6-harsimransingh.tungal@arm.com>","date":"2026-04-24T17:31:44","name":"[05/12] efi_loader: move runtime GetVariable() helpers to efi_variable.c","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"cf813c644b2545f0a3221e32c79d20864f130983","submitter":{"id":88701,"url":"http://patchwork.ozlabs.org/api/1.1/people/88701/?format=json","name":"Harsimran Singh Tungal","email":"harsimransingh.tungal@arm.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20260424173151.371134-6-harsimransingh.tungal@arm.com/mbox/","series":[{"id":501471,"url":"http://patchwork.ozlabs.org/api/1.1/series/501471/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=501471","date":"2026-04-24T17:31:50","name":"arm64: FF-A runtime transport for EFI variables","version":1,"mbox":"http://patchwork.ozlabs.org/series/501471/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2228249/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2228249/checks/","tags":{},"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256\n header.s=foss header.b=i/WKAm+X;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)","phobos.denx.de;\n dmarc=fail (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de","phobos.denx.de;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n unprotected) header.d=arm.com header.i=@arm.com header.b=\"i/WKAm+X\";\n\tdkim-atps=neutral","phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=arm.com","phobos.denx.de;\n spf=pass smtp.mailfrom=harsimransingh.tungal@arm.com"],"Received":["from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4g2yPn6ydFz1yHS\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 26 Apr 2026 04:03:57 +1000 (AEST)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id D835584488;\n\tSat, 25 Apr 2026 20:02:46 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id F1FBB842BF; Sat, 25 Apr 2026 19:01:49 +0200 (CEST)","from foss.arm.com (foss.arm.com [217.140.110.172])\n by phobos.denx.de (Postfix) with ESMTP id B9983842E7\n for <u-boot@lists.denx.de>; Sat, 25 Apr 2026 19:01:45 +0200 (CEST)","from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2D2A335A5;\n Fri, 24 Apr 2026 10:32:39 -0700 (PDT)","from e132995.arm.com (unknown [10.57.64.144])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1969E3F7B4;\n Fri, 24 Apr 2026 10:32:42 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2","DKIM-Signature":"v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss;\n t=1777051964; bh=0a15qjw+44DBsHYjlJiF9rDHaoet15SkszhUkAL89RI=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=i/WKAm+Xiyb+uoYr0SB16tQV0/xEHr7myiz8Dtwd1Mxsv1i/OLZr65pWTyVeSgJvT\n fbBym0gc+XuSDz78Zl79cvePs7iHuijdfYBfHDtrIJfJ4ZaNoVd/wALrW3CXN7Fz2V\n iCU+CiUZE2pbBE7OIAwwLqFZodfTQs8bfZ/fS8Vw=","From":"Harsimran Singh Tungal <harsimransingh.tungal@arm.com>","To":"u-boot@lists.denx.de","Cc":"Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>,\n Tom Rini <trini@konsulko.com>,\n Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n Heinrich Schuchardt <xypron.glpk@gmx.de>,\n Hugues Kamba Mpiana <hugues.kambampiana@arm.com>,\n Simon Glass <sjg@chromium.org>,\n Harsimran Singh Tungal <harsimransingh.tungal@arm.com>","Subject":"[PATCH 05/12] efi_loader: move runtime GetVariable() helpers to\n efi_variable.c","Date":"Fri, 24 Apr 2026 18:31:44 +0100","Message-Id":"<20260424173151.371134-6-harsimransingh.tungal@arm.com>","X-Mailer":"git-send-email 2.34.1","In-Reply-To":"<20260424173151.371134-1-harsimransingh.tungal@arm.com>","References":"<20260424173151.371134-1-harsimransingh.tungal@arm.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","X-Mailman-Approved-At":"Sat, 25 Apr 2026 20:02:44 +0200","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.39","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<https://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>","X-Virus-Scanned":"clamav-milter 0.103.8 at phobos.denx.de","X-Virus-Status":"Clean"},"content":"Consolidate runtime GetVariable helpers to avoid duplicates\n\nThe functions efi_get_variable_runtime() and\nefi_get_next_variable_name_runtime() were implemented in\nefi_variable_tee.c as part of the FF-A runtime variable handling work.\nHowever, default implementations for these same runtime helpers also\nexist in efi_var_common.c. This results in duplicate symbol definitions.\nTo resolve the conflict and centralize the runtime API, this patch moves\nthe default implementations of the two runtime GetVariable() helpers\nfrom efi_var_common.c to efi_variable.c. This ensures that:\n\n - only a single definition of each runtime helper exists,\n - backend-specific implementations can override these cleanly,\n - the EFI runtime variable service table continues to reference the\n   correct functions.\n\nNo functional changes are introduced; this is a structural cleanup to\navoid build-time conflicts and consolidate EFI runtime variable support\nin the appropriate file.\n\nSigned-off-by: Harsimran Singh Tungal <harsimransingh.tungal@arm.com>\n---\n lib/efi_loader/efi_var_common.c | 24 ------------------------\n lib/efi_loader/efi_variable.c   | 24 ++++++++++++++++++++++++\n 2 files changed, 24 insertions(+), 24 deletions(-)","diff":"diff --git a/lib/efi_loader/efi_var_common.c b/lib/efi_loader/efi_var_common.c\nindex d63c2d1b1cd..7cbf098c64a 100644\n--- a/lib/efi_loader/efi_var_common.c\n+++ b/lib/efi_loader/efi_var_common.c\n@@ -173,30 +173,6 @@ efi_status_t EFIAPI efi_query_variable_info(\n \treturn EFI_EXIT(ret);\n }\n \n-efi_status_t __efi_runtime EFIAPI\n-efi_get_variable_runtime(u16 *variable_name, const efi_guid_t *guid,\n-\t\t\t u32 *attributes, efi_uintn_t *data_size, void *data)\n-{\n-\tefi_status_t ret;\n-\n-\tret = efi_get_variable_mem(variable_name, guid, attributes, data_size,\n-\t\t\t\t   data, NULL, EFI_VARIABLE_RUNTIME_ACCESS);\n-\n-\t/* Remove EFI_VARIABLE_READ_ONLY flag */\n-\tif (attributes)\n-\t\t*attributes &= EFI_VARIABLE_MASK;\n-\n-\treturn ret;\n-}\n-\n-efi_status_t __efi_runtime EFIAPI\n-efi_get_next_variable_name_runtime(efi_uintn_t *variable_name_size,\n-\t\t\t\t   u16 *variable_name, efi_guid_t *guid)\n-{\n-\treturn efi_get_next_variable_name_mem(variable_name_size, variable_name,\n-\t\t\t\t\t      guid, EFI_VARIABLE_RUNTIME_ACCESS);\n-}\n-\n /**\n  * efi_set_secure_state - modify secure boot state variables\n  * @secure_boot:\tvalue of SecureBoot\ndiff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c\nindex 9923936c1b5..f2e0e1ad4e2 100644\n--- a/lib/efi_loader/efi_variable.c\n+++ b/lib/efi_loader/efi_variable.c\n@@ -579,6 +579,30 @@ efi_set_variable_runtime(u16 *variable_name, const efi_guid_t *vendor,\n \treturn EFI_SUCCESS;\n }\n \n+efi_status_t __efi_runtime EFIAPI\n+efi_get_variable_runtime(u16 *variable_name, const efi_guid_t *guid,\n+\t\t\t u32 *attributes, efi_uintn_t *data_size, void *data)\n+{\n+\tefi_status_t ret;\n+\n+\tret = efi_get_variable_mem(variable_name, guid, attributes, data_size,\n+\t\t\t\t   data, NULL, EFI_VARIABLE_RUNTIME_ACCESS);\n+\n+\t/* Remove EFI_VARIABLE_READ_ONLY flag */\n+\tif (attributes)\n+\t\t*attributes &= EFI_VARIABLE_MASK;\n+\n+\treturn ret;\n+}\n+\n+efi_status_t __efi_runtime EFIAPI\n+efi_get_next_variable_name_runtime(efi_uintn_t *variable_name_size,\n+\t\t\t\t   u16 *variable_name, efi_guid_t *guid)\n+{\n+\treturn efi_get_next_variable_name_mem(variable_name_size, variable_name,\n+\t\t\t\t\t      guid, EFI_VARIABLE_RUNTIME_ACCESS);\n+}\n+\n /**\n  * efi_variables_boot_exit_notify() - notify ExitBootServices() is called\n  */\n","prefixes":["05/12"]}