From patchwork Tue May 31 07:15:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sughosh Ganu X-Patchwork-Id: 577442 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:330b:0:0:0:0 with SMTP id f11csp888862mag; Tue, 31 May 2022 00:16:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYbfqe/yb1gB8IdAoq7bqxjsz3UliOO96FVOavVSFIoYSzS/kXu6/+RspE+NBRu1wcZ/PE X-Received: by 2002:a05:6e02:b22:b0:2d1:564e:919b with SMTP id e2-20020a056e020b2200b002d1564e919bmr30219027ilu.208.1653981389254; Tue, 31 May 2022 00:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653981389; cv=none; d=google.com; s=arc-20160816; b=rAQBfgl/FgJaJQltyEo1+qqlHIjZXSTRrPpP/IT7RTHnszn28w6uPIuEv6nn+pXVHY Z1/mF4mdegUsp/nhK7id9KGkupooeHM4034tf3opgSN+QeNQqoFL3LX8VjrRA3YFfKY7 9Xbyy1CFoojNcOIw9kdnd2O7zwZx9ERydKXviECbJOjHI6PB2EhEeyAd8khujFmY26K0 K4SQgDcsi+lW/inCQhS5QHEHixO6vonWpFLlacMrwBgoOvQ4/j1rI459iS7zdGzGpSVK aiIppiAcxXMMvi3KpVRUiCLjmRdRq2sg2fp/XJbAzoQT1V1keCvcwLyjfRrvyeV0JZ8y VNZA== 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=XGs4v1KexPkxtd9b8L1eD0fNREtUQujPO0/rCAJi0GE=; b=DOKK+1wux+htUk5QRbjQ2DcWwG5XRTWv2jHeZKITL+zIKzvlw+kw0CqDfTYkPw94lp gLvGCXaZ8YZPeUjRi6fRYsYLPUVFi6TiTp8rniI2/uvw3KJnuQyRrHcsNPYAZEwDghzr ruRoElPqncRz3JJKfBmW9KPo5gGeTti1qTTfYcPo8sgu5l7cCJdOzCkrln6TVBUl9VRV aysq01Sd75Up2Gm15uFolfb2CBFwxuVeDjXq/RKKguzpitDJxqUVAMawAgldzAd7trLn H3vf1PgPb1FjwhQb1wIGIDs4sRZ5mwywlcHoL52ez+RjNt4afVJDS6lxWjGefWnHFeO+ zjag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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. [85.214.62.61]) by mx.google.com with ESMTPS id u3-20020a056e021a4300b002d2f318d865si2363945ilv.113.2022.05.31.00.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 May 2022 00:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 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 A6FB4843E2; Tue, 31 May 2022 09:16:12 +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 2CB5F843BE; Tue, 31 May 2022 09:16:02 +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 55A39843BE for ; Tue, 31 May 2022 09:15:58 +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 C4AD823A; Tue, 31 May 2022 00:15:57 -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 14E8F3F766; Tue, 31 May 2022 00:15:55 -0700 (PDT) From: Sughosh Ganu To: u-boot@lists.denx.de Cc: Heinrich Schuchardt , Ilias Apalodimas , Takahiro Akashi , Sughosh Ganu Subject: [PATCH 2/3] EFI: Do not read OsIndications variable if EFI_IGNORE_OSINDICATIONS is enabled Date: Tue, 31 May 2022 12:45:34 +0530 Message-Id: <20220531071535.219661-3-sughosh.ganu@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220531071535.219661-1-sughosh.ganu@linaro.org> References: <20220531071535.219661-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. Move the check to see if the config symbol is enabled at the beginning of the function. If the config is enabled, return a success code without checking for the existence of the variable. Signed-off-by: Sughosh Ganu --- lib/efi_loader/efi_capsule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index c76a5f3570..0ea21dc168 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -1062,6 +1062,9 @@ static efi_status_t check_run_capsules(void) efi_uintn_t size; efi_status_t r; + if (IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS)) + return EFI_SUCCESS; + size = sizeof(os_indications); r = efi_get_variable_int(u"OsIndications", &efi_global_variable_guid, NULL, &size, &os_indications, NULL); @@ -1082,8 +1085,6 @@ static efi_status_t check_run_capsules(void) if (r != EFI_SUCCESS) log_err("Setting %ls failed\n", L"OsIndications"); return EFI_SUCCESS; - } else if (IS_ENABLED(CONFIG_EFI_IGNORE_OSINDICATIONS)) { - return EFI_SUCCESS; } else { return EFI_NOT_FOUND; }