From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F56BC11F6A for ; Thu, 1 Jul 2021 01:55:26 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 451D561469 for ; Thu, 1 Jul 2021 01:55:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 451D561469 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0F2D182C60; Thu, 1 Jul 2021 03:55:23 +0200 (CEST) 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="IX1AB1eP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 63F1B83164; Thu, 1 Jul 2021 03:55:21 +0200 (CEST) Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) (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 EB01182BFB for ; Thu, 1 Jul 2021 03:55:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pg1-x536.google.com with SMTP id a2so4671509pgi.6 for ; Wed, 30 Jun 2021 18:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=0VuGPmVJ0mu4TDZrVxmafmxOD+ESWc7apIXM/uIY68w=; b=IX1AB1ePwqx+vHdXD4Zbk9LJzSYZi0AGvdEg1AE8zCoKaeWwH843t8sB1Xe4UkThsN tuS1ZK4/dXf9FbKYdJlphIP19UV6Ltt3A4zrj91NR8IxvQid/ONcQNe7lkXlDiot21yP 2p0xgNkHBqK0unCXteTG3Zrr5bPrvgTSYKoiTulw9tJcHj3wno8ko5eCR4HYZ81CKU3g KaFF3PFdSaZQYqOlNJH6r7DRUB1hYIB1z+tQ2EIdWpbrSdkXi+ulu/7WENo+dt3Dm8P6 J+4Thc6bkCKjlZF3LkYEmK5MXDiUYgsdT2hiBi9fPMB+x8HRvfvthGSOg1nFV5NVmlgg k4pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=0VuGPmVJ0mu4TDZrVxmafmxOD+ESWc7apIXM/uIY68w=; b=mR13wI41V0Vj//3eyiiV3tuw0u2MehizB26E9+6qLYVpvvWN7vP7MeRbCx/2pGEwvT rKxrvnqWPeWjP3dMD/IA0lkZBtjkP91xIJlapoYekx8SqKvPUDr1n3vTTyBiDfGikbIF /zurWmXOZEw8/s8XINC6ZVDFxVbbgSAQWqwDfieKenkwxE3Q+QuZLjxva4d1ITL7rOlA IF/Rm3V0s8SNMYxzUz+YeOz7YK3pzzyIvkxwd5legm/MIaOkyWN/NPafP6lN88eZALcH crqgHaN2G47d+3UibvzXuQjfrRLqweZ8vFCCJPA02VFFhYyCj3FNjQ0xe/8vNZYGqGV5 7acw== X-Gm-Message-State: AOAM5305Ka1NF2QDCiKNc7dAOziVBtT/2I9TcFgJxsBHm1bXv2w0jOtC dthlGqc0WxNqb99U3bxxP880NQ== X-Google-Smtp-Source: ABdhPJzzhNYh396CwxwhCDu1DeHqdQ0IkTD/a0VgIYb7x+LH93d6MFm9UWApoAyPxliyCXJBCCAJ1Q== X-Received: by 2002:aa7:8392:0:b029:2db:4a7:d866 with SMTP id u18-20020aa783920000b02902db04a7d866mr38450029pfm.66.1625104516049; Wed, 30 Jun 2021 18:55:16 -0700 (PDT) Received: from laputa (p3dd30534.tkyea130.ap.so-net.ne.jp. [61.211.5.52]) by smtp.gmail.com with ESMTPSA id s126sm23124792pfb.164.2021.06.30.18.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Jun 2021 18:55:15 -0700 (PDT) Date: Thu, 1 Jul 2021 10:55:12 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas Subject: Re: [PATCH v2 1/2] efi_loader: fix set_capsule_result() Message-ID: <20210701015512.GA33154@laputa> Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , u-boot@lists.denx.de, Alexander Graf , Ilias Apalodimas References: <20210630153116.26756-1-xypron.glpk@gmx.de> <20210630153116.26756-2-xypron.glpk@gmx.de> <20210701004909.GA7183@laputa> <3A4AF309-5C9F-4019-9390-B51D94FF58E4@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3A4AF309-5C9F-4019-9390-B51D94FF58E4@gmx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On Thu, Jul 01, 2021 at 03:20:48AM +0200, Heinrich Schuchardt wrote: > Am 1. Juli 2021 02:49:09 MESZ schrieb AKASHI Takahiro : > >NAK. For example, > >On Wed, Jun 30, 2021 at 05:31:15PM +0200, Heinrich Schuchardt wrote: > >> The log category must be LOG_CATEGORY LOGC_EFI. This one above and > >> efi_set_variable() should be called with EFI_CALL(). Use > >> efi_set_variable_int() instead. and this are mutually irrelevant. > >> A log text "Updating ..." if SetVariable() fails does not make sense > >for a > >> variable that is not required to be preexisting. This change is also irrelevant. > >> CapsuleLast should always be immediately updated. > > > >As I said to your v1 in [1], > > > >You are trying to fix several irrelevant issues here. > > Why do you think the changes are irrelevant? No question. -Takahiro Akashi > >Please split them into separate patches as you have always > >asked me before. > > Splitting does not change relevance. > > Do you want to play tit for tat? > > Best regards > > Heinrich > > > > >[1] https://lists.denx.de/pipermail/u-boot/2021-June/453148.html > > > >-Takahiro Akashi > > > > > > > >> Signed-off-by: Heinrich Schuchardt > >> --- > >> v2: > >> don't update OsIndications in set_capsule_result() > >> update CapsuleLast immediately > >> --- > >> lib/efi_loader/efi_capsule.c | 39 > >+++++++++++++++++++----------------- > >> 1 file changed, 21 insertions(+), 18 deletions(-) > >> > >> diff --git a/lib/efi_loader/efi_capsule.c > >b/lib/efi_loader/efi_capsule.c > >> index 2c37a0d97b..f87ef2a514 100644 > >> --- a/lib/efi_loader/efi_capsule.c > >> +++ b/lib/efi_loader/efi_capsule.c > >> @@ -6,6 +6,8 @@ > >> * Author: AKASHI Takahiro > >> */ > >> > >> +#define LOG_CATEGORY LOGC_EFI > >> + > >> #include > >> #include > >> #include > >> @@ -95,13 +97,25 @@ void set_capsule_result(int index, struct > >efi_capsule_header *capsule, > >> else > >> memset(&result.capsule_processed, 0, sizeof(time)); > >> result.capsule_status = return_status; > >> - ret = efi_set_variable(variable_name16, &efi_guid_capsule_report, > >> - EFI_VARIABLE_NON_VOLATILE | > >> - EFI_VARIABLE_BOOTSERVICE_ACCESS | > >> - EFI_VARIABLE_RUNTIME_ACCESS, > >> - sizeof(result), &result); > >> - if (ret) > >> - log_err("EFI: creating %ls failed\n", variable_name16); > >> + ret = efi_set_variable_int(variable_name16, > >&efi_guid_capsule_report, > >> + EFI_VARIABLE_NON_VOLATILE | > >> + EFI_VARIABLE_BOOTSERVICE_ACCESS | > >> + EFI_VARIABLE_RUNTIME_ACCESS, > >> + sizeof(result), &result, false); > >> + if (ret != EFI_SUCCESS) { > >> + log_err("Setting %ls failed\n", variable_name16); > >> + return; > >> + } > >> + > >> + /* Variable CapsuleLast must not include terminating 0x0000 */ > >> + ret = efi_set_variable_int(L"CapsuleLast", > >&efi_guid_capsule_report, > >> + EFI_VARIABLE_READ_ONLY | > >> + EFI_VARIABLE_NON_VOLATILE | > >> + EFI_VARIABLE_BOOTSERVICE_ACCESS | > >> + EFI_VARIABLE_RUNTIME_ACCESS, > >> + 22, variable_name16, false); > >> + if (ret != EFI_SUCCESS) > >> + log_err("Setting %ls failed\n", L"CapsuleLast"); > >> } > >> > >> #ifdef CONFIG_EFI_CAPSULE_FIRMWARE_MANAGEMENT > >> @@ -988,7 +1002,6 @@ efi_status_t efi_launch_capsules(void) > >> struct efi_capsule_header *capsule = NULL; > >> u16 **files; > >> unsigned int nfiles, index, i; > >> - u16 variable_name16[12]; > >> efi_status_t ret; > >> > >> if (!check_run_capsules()) > >> @@ -1045,16 +1058,6 @@ efi_status_t efi_launch_capsules(void) > >> free(files[i]); > >> free(files); > >> > >> - /* CapsuleLast */ > >> - efi_create_indexed_name(variable_name16, sizeof(variable_name16), > >> - "Capsule", index - 1); > >> - efi_set_variable_int(L"CapsuleLast", &efi_guid_capsule_report, > >> - EFI_VARIABLE_READ_ONLY | > >> - EFI_VARIABLE_NON_VOLATILE | > >> - EFI_VARIABLE_BOOTSERVICE_ACCESS | > >> - EFI_VARIABLE_RUNTIME_ACCESS, > >> - 22, variable_name16, false); > >> - > >> return ret; > >> } > >> #endif /* CONFIG_EFI_CAPSULE_ON_DISK */ > >> -- > >> 2.30.2 > >> >