From patchwork Wed Feb 16 06:15:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masami Hiramatsu X-Patchwork-Id: 543040 Delivered-To: patch@linaro.org Received: by 2002:ac0:e142:0:0:0:0:0 with SMTP id r2csp1090503imn; Tue, 15 Feb 2022 22:16:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV4CumeV2/gDEIohEaf5pa3B7h7nh4XDsfCWn1XI/RlZ2ZuLH+Pl75LDqaflZGEDm7iMHZ X-Received: by 2002:a17:907:234c:b0:6cd:7ca0:8423 with SMTP id we12-20020a170907234c00b006cd7ca08423mr1113250ejb.218.1644992160743; Tue, 15 Feb 2022 22:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644992160; cv=none; d=google.com; s=arc-20160816; b=DWjP8FfEaKklE11l0u1n/iiNGXHumipA7eHEItAvQCc7bTbySXgo7H6rb+OFffAT38 Rh+0k4e3bTEOFj76UvifT6FOnjQ/GnArS0YbvLMZLUOOPVROU3AlQn7E10nB/1hiqQkB XS/LW2Skjehxh+qISCFdygEgGwYyM5Yzp4BFzoLCuKu68lifeXe5p7vluo6kgx6UIUHU HVr0PTjIlL70ljhzNCn7immPFogQYC5E3dX1klW93TlzWv6YjPzoWvG4CF5iVj7voANE /SEThPnwHVQFqGMSVqhfp9VVNpGRQpYjmKThI8TUDgb4RJ3b9TEnCjX7erC026ICNZeq yhkg== 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=XU/XvCB5GBh7rbgCYtx1g1/zzRC3wTTXfCCp8nOMpvY=; b=JkrHkBZoVhNVm878+yZfB8LSFxfw0IBOM2ZMdnO/Nui7km//2ED4ycG6Ujm/GOa6gD dZtEvJuzRSetsW/893yqWdcaqXQ/g2H0gTJ+AkvfcrH2nIBeWBrrMa1gM6HA3OXx9V9T B3dor9Yeu6Vhk9OqbnC71kRWxGF6QPpKJ3a7vxhEPKql4lpizOkkTQdYxqoU2XtzFM6w 0Fj4JSjYfeJXvSb1Pf+C4gq3KKxsdVJXd1i/o2g0/7PbVdi4H+XEfBnaLww4ob36Gv0F +ou8j02BcbrwcRbM1h8WblSRTSvYBz76yvLiK7TD+pBt1r+3OxlsHQCEaipZNZv+0lGU Oa+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=oLO+zBg4; 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 qo14si1743192ejb.870.2022.02.15.22.16.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:16:00 -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=oLO+zBg4; 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 99B5183A5A; Wed, 16 Feb 2022 07:15:58 +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="oLO+zBg4"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7F7F183A41; Wed, 16 Feb 2022 07:15:54 +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-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 904E2839EB for ; Wed, 16 Feb 2022 07:15:48 +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-pl1-x62e.google.com with SMTP id u12so1201640plf.13 for ; Tue, 15 Feb 2022 22:15:48 -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=XU/XvCB5GBh7rbgCYtx1g1/zzRC3wTTXfCCp8nOMpvY=; b=oLO+zBg4knlJ3UhFeFyHVGR4eDqJJdjjpR1qqzyB5am0CYSF5WbrOAhRAlnKxteLIq oB/vbVBGVNogMcsm8CLyco6ansbUJA/GFEpvs6QNqemqPQQSjmeqeKOBVTfoU3gum5// h1BIq7zEArdfuzAWB3ll0+LjgXQCCtZOgzsJgaDxyKY+9GHZHHMRonMs1/rm+bTgtxEH W37c4q6abocOnUQPYszuvIZR6jcvJOUjgBtYE45k2lJIS/k/R2gArT8RnjrJlHW3ix4W uigYUt0CrZePOJ+gGUuWmiE1TB/eqFIGyEc2xp80viStbVPAjjibqhq3SMzXqtF3XMEN NEAg== 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=XU/XvCB5GBh7rbgCYtx1g1/zzRC3wTTXfCCp8nOMpvY=; b=pxGKITqA5L+WnJ2SyNLexDaVQQy7EEvftusljQwODnKLKzkSgciWQ+Q0rrEmmGdaXj aubHCjTaBqKi4/1XAPH8G0Av59S7MGWsO4EUHQPW3Q7hLap29bD/2jqD9MwiTkp/VBGN mGDJYRTodeQSB1pBih14LAgdXr0MKo5Agj3YO/qW41xW34BocJwqHLjuMmAdN8lgf66E EyXipC6ozaqqLpw+MB6gXBGsNFkgp/lSkguNDgWTj+1SzFLIedoEetNKf4d+IMr4lHL8 zBf4tbLGqPHDxWeXrCa4CcMrp4ElEvrbqoJ251vzXzagnlc7ODHczIfmlTYY43Ra9FQz WG0g== X-Gm-Message-State: AOAM5323M0kHTHU1+dcf6hGRMEIFW9cd8xkY04pR/X02C6NnBwt42gEY sVaVC3EO9miEzoIo9lY9DQSx79HHZMXalw== X-Received: by 2002:a17:902:e8c2:b0:14d:80cb:dbc with SMTP id v2-20020a170902e8c200b0014d80cb0dbcmr1092043plg.142.1644992146638; Tue, 15 Feb 2022 22:15:46 -0800 (PST) Received: from localhost.localdomain (113x37x226x201.ap113.ftth.ucom.ne.jp. [113.37.226.201]) by smtp.gmail.com with ESMTPSA id a9sm1644421pfl.124.2022.02.15.22.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Feb 2022 22:15:46 -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 v5 1/4] efi_loader: use efi_update_capsule_firmware() for capsule on disk Date: Wed, 16 Feb 2022 15:15:42 +0900 Message-Id: <164499214202.688621.9498927693969899089.stgit@localhost> X-Mailer: git-send-email 2.25.1 In-Reply-To: <164499213192.688621.17382243642029677399.stgit@localhost> References: <164499213192.688621.17382243642029677399.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 Since the efi_update_capsule() represents the UpdateCapsule() runtime service, it has to handle the capsule flags and update ESRT. However the capsule-on-disk doesn't need to care about such things. Thus, the capsule-on-disk should use the efi_capsule_update_firmware() directly instead of calling efi_update_capsule(). This means the roles of the efi_update_capsule() and capsule-on-disk are different. We have to keep the efi_update_capsule() for providing runtime service API at boot time. Suggested-by: AKASHI Takahiro Signed-off-by: Masami Hiramatsu Reviewed-by: Heinrich Schuchardt --- Changes in v4: - Update patch description. --- 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 f4519c7317..d8141176df 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]);