From patchwork Tue Feb 1 08:32:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 538941 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp643277imr; Tue, 1 Feb 2022 00:33:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzWy4JBIQQSMT+m+1gBvUUjQ5uch7BYbF6UrPVD4NWyMIC1RHaQbENTKnMHGtldeXCRtpPu X-Received: by 2002:a17:906:99c5:: with SMTP id s5mr19563094ejn.190.1643704396068; Tue, 01 Feb 2022 00:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643704396; cv=none; d=google.com; s=arc-20160816; b=0X4uxC51SennN/BaYP5tMjtB0dco0ltr1Yzjul+F2dV63uhXPygLYPzyOlH3QlXMqo 6YTyjqDM9aNKLvdAXBu6lmq1q+OCBKJX+HGbvZO1DXBcJ1gJzb6tPNUVx1q2+JTOO+Sr K2FuVkjFmitU99O9RQpJsqEkyRWk58WvzJEZOwzO65brC+xbZiWdH+m7y2lhkKSp4a76 Dh5L0W5bpVvHk4pAMeUq0LynZYt7jdkabFF++hbNlxDmcjP+I0Q6rnJKALve824TZNXk lW4KhzHryVFZIP7DQjfyq2HFP6i93dJKhBKz8w5FSOLZcza/WQtM2AkOYKKvSU14+3lW Pwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AAtbDeyE8ikmcxoVlcn/3HRcyUbC5QLBVM246s2VLvo=; b=txyDRwHKr3lwdUFeXIArQKI+JVz3vEESQOw4yA2GF8XV/bydQFxRj/yWl4d2bfxtok yUkwUK1wIavpUDV92kSrtssQmf6QmbSgYvbyyizkT+tPIv/e0TYQGF5MfTKHRfVdo69q HtzCrKXc7SnKQWrdIVdUlxl1irbLM4AX2SMTy2APS3RNo1+a5CKQmV1YnXiHwfNdztCR 7IhF77oGoddtA6qqzgN3/2R+nfdIMx2LVvFjw9Lf/6UzKmXQcdUXy4ghWzXIahT6GDI8 GjhGl7ueZ05wqn/sxiQlwRRiFRpsf/GA9kmnojW47Gnf06lgBk16rE2MXvo6emiqP04B Efjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ED6mU5Io; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id jg24si10940938ejc.380.2022.02.01.00.33.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 00:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ED6mU5Io; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 25DC881EE7; Tue, 1 Feb 2022 09:33:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ED6mU5Io"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1896981221; Tue, 1 Feb 2022 09:33:09 +0100 (CET) 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, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 36E6D80F9E for ; Tue, 1 Feb 2022 09:33:06 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=masami.hiramatsu@linaro.org Received: by mail-pf1-x434.google.com with SMTP id i186so12731134pfe.0 for ; Tue, 01 Feb 2022 00:33:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=AAtbDeyE8ikmcxoVlcn/3HRcyUbC5QLBVM246s2VLvo=; b=ED6mU5IoIfb37pIcLj1lnPZnEliR4MDR3mIp3XhvcE4PaszjZokuKMdOzFCm+2ddPX SBnFMW6irZ/13AC5KixF4btLyePi1dP+gXT7ngGVutoHEITuzM3Q+N6kL951k48+7hXm dU10rttWmVdbyD8xI05e+br/NZIvDHy+QBK6uROhhflt+aKNp8ou4vGOXmXT+DuZKEjm 32DmCkg1WOWPjfS4aZdWxjNCBTj+ROhsOsNTvZ12UAvCe/4fqg9mta/3KwsTynpH8VV4 FrS5Uz9D6xmFSPZBl2dknuxXtIrWS6WrfanPmoS3DFSmpQqk82feZhDSkn8SmKEOi/nL JC2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=AAtbDeyE8ikmcxoVlcn/3HRcyUbC5QLBVM246s2VLvo=; b=hL2ygGSqngdwBwBfIIP1VM0+9o+J5T0LlEeEpF3V0Hyu7nkVQAtI3qqa1Nh6RQSdhx 4g3/wihP1GES14odM0K3dhXa7TGzppEyrCLnRRtg0a9MwZa4W7JnU20gVJAD2l/C88TF AJBJQzzN96gLrzkXCnkWf/8JOJwZrRz4iWIvbDTSHAkdz4Qi+dQZU8ev0lw6XhtXtKfd WT+v0TZRtlIFPTHEsm+fa2XlRxSi5kNW59jzLMEyI6fIEyzyUVQd1lg90g2fT1+ZCaFG 2XFpUNdfWPpsnepR+MS+UG9YJMwCoewTbTRjdiSjL/HoCCsmtkaOnB9AoaUdzfeCCEgU 8abw== X-Gm-Message-State: AOAM532aOTBYxh+1mllip91LNl1+laVuAgKCsj9RL6NZrPJKT7xK1MlY 4I23DDwruWdYpciCNU03rLIsEvfIyrtYzw== X-Received: by 2002:a62:a512:: with SMTP id v18mr23709672pfm.42.1643704384318; Tue, 01 Feb 2022 00:33:04 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id g18sm1854287pju.7.2022.02.01.00.33.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 00:33:03 -0800 (PST) From: Masami Hiramatsu To: u-boot@lists.denx.de Cc: Masami Hiramatsu , Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Grant Likely , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu Subject: [PATCH v2 1/2] efi_loader: Avoid using efi_update_capsule() from update capsule on disk Date: Tue, 1 Feb 2022 17:32:59 +0900 Message-Id: <164370437972.365087.4761473791973948840.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164370436957.365087.15139421656192351360.stgit@localhost> References: <164370436957.365087.15139421656192351360.stgit@localhost> User-Agent: StGit/0.19 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean The efi_update_capsule() may have to handle the capsule flags as an UEFI runtime and boottime service, but the capsule-on-disk process doesn't. Thus, the capsule-on-disk should use the efi_capsule_update_firmware() directly instead of efi_update_capsule(). Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu --- Changes in v2: - Fix to pass correct pointer to efi_capsule_update_firmware - Remove ESRT generation, because this part anyway will be removed next patch. --- lib/efi_loader/efi_capsule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index 4463ae00fd..1ec7ea29ff 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1118,7 +1118,7 @@ efi_status_t efi_launch_capsules(void) index = 0; ret = efi_capsule_read_file(files[i], &capsule); if (ret == EFI_SUCCESS) { - ret = EFI_CALL(efi_update_capsule(&capsule, 1, 0)); + ret = efi_capsule_update_firmware(capsule); if (ret != EFI_SUCCESS) log_err("Applying capsule %ls failed\n", files[i]);