From patchwork Wed Jun 1 18:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 577793 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:8f0c:0:0:0:0 with SMTP id mq12csp833763mab; Wed, 1 Jun 2022 11:01:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySr9dVYtkLQh7qQXAGa0u/CLNH7eQrFkemiwKxpugO4mLT7OjaVlG5+k6Qi13NOmKs6kmY X-Received: by 2002:a05:6e02:4a1:b0:2d3:a778:f0f1 with SMTP id e1-20020a056e0204a100b002d3a778f0f1mr829382ils.212.1654106494844; Wed, 01 Jun 2022 11:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654106494; cv=none; d=google.com; s=arc-20160816; b=beTdZHBMQVUt3s9f7XdmYIM1dJJV7A8luJ5triMadPhTUUr8wLEtJjBfz27avzoZy4 3UU1zkzjeMeLqBBOme0vkShDZhuBSp8QQeQutH4XfE60cdPllKjZ9SFbuhLA87bHkeKT 9YGNOkxBPLB44FXgl/iFfNU9EdNS8/wQ3BLYuItz121HX0/oH6sIAVwO7LDiAhaSj6PB 8hHkIChRhxkgzwnSAc5eclrnuN1frymZ9QebgYm8y5nmpIOZbrGTSkJcW9Czfjy9VlIH bRFFLQct1nQvC0mIVTVqn78sayGbhEAQVntaTHtaVT7j5qURxTxXi+8cIfn+mmgm6c7V 7OrQ== 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:references:in-reply-to:message-id:date:subject:cc:to :from; bh=gS8iTyZjRJRL9BGeq8/j3NgTGV9iVMiTHq3ly0FLP3c=; b=G7clLeZrTGVMfdyXSri2qmAj/PMCrv2i2fq6ocp1WVTUh+yf89fpUw250iM+Ard4qD DkUys01LTg7sptrV3VAi8uqCvaWBLyY96L+CQ8/s1/CS6FP5nsaGQ571kchIDXm14lT/ g4Q/BdMeVLyCbZLPBdqhT62TOwwPFER6L0Sy975kg1/pcazu9WlqJOYuhv/JFOuGJqJl QsqtLa01onyOd5eLwqWKdHKsEXZa674z9n1UKB6MKmjvtdWRPkaAJDT5S1YefHlz3NWx fXETTLwBY8Z0HosR5U4jth7Xl1qjpQVNoqqsAfDV42ApymALw2/WAQcrHJtHBP7xRO/3 3jog== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 v40-20020a05663835a800b00330b30137bdsi2656829jal.42.2022.06.01.11.01.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:01:34 -0700 (PDT) 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; 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=fail (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 5D09F842F8; Wed, 1 Jun 2022 20:01:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 26EEB842C3; Wed, 1 Jun 2022 20:01:08 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_SOFTFAIL,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 390DA842D4 for ; Wed, 1 Jun 2022 20:01:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sughosh.ganu@linaro.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C83DD6E; Wed, 1 Jun 2022 11:01:04 -0700 (PDT) Received: from a076522.blr.arm.com (a076522.blr.arm.com [10.162.16.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DE1D23F766; Wed, 1 Jun 2022 11:01:02 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Sughosh Ganu Subject: [PATCH v2 2/4] EFI: Do not consider OsIndications variable if CONFIG_EFI_IGNORE_OSINDICATIONS is enabled Date: Wed, 1 Jun 2022 23:30:39 +0530 Message-Id: <20220601180041.340240-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220601180041.340240-1-sughosh.ganu@linaro.org> References: <20220601180041.340240-1-sughosh.ganu@linaro.org> 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_IGNORE_OSINDICATIONS config symbol was introduced as a mechanism to have capsule updates work even on platforms where the SetVariable runtime service was not supported. The current logic requires the OsIndications variable to have been set to a 64 bit value even when the EFI_IGNORE_OSINDICATIONS config is enabled. Return an error code on not being able to read the variable only when EFI_IGNORE_OSINDICATIONS is not enabled. Signed-off-by: Sughosh Ganu --- Changes since V1: * Read the OsIndications variable, if present and clear the EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED flag even if the CONFIG_EFI_IGNORE_OSINDICATIONS config is enabled. lib/efi_loader/efi_capsule.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index c76a5f3570..a6b98f066a 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1058,14 +1058,15 @@ static void efi_capsule_scan_done(void) */ static efi_status_t check_run_capsules(void) { - u64 os_indications; + u64 os_indications = 0x0; efi_uintn_t size; efi_status_t r; size = sizeof(os_indications); r = efi_get_variable_int(u"OsIndications", &efi_global_variable_guid, NULL, &size, &os_indications, NULL); - if (r != EFI_SUCCESS || size != sizeof(os_indications)) + if (!IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS) && + (r != EFI_SUCCESS || size != sizeof(os_indications))) return EFI_NOT_FOUND; if (os_indications & @@ -1084,7 +1085,7 @@ static efi_status_t check_run_capsules(void) return EFI_SUCCESS; } else if (IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS)) { return EFI_SUCCESS; - } else { + } else { return EFI_NOT_FOUND; } }