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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 581A1EB64DD for ; Fri, 21 Jul 2023 04:48:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 86BA6867D1; Fri, 21 Jul 2023 06:48:47 +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="ca+6ac4e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2D3ED867B2; Fri, 21 Jul 2023 06:48:46 +0200 (CEST) Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) (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 DFF4686202 for ; Fri, 21 Jul 2023 06:48:42 +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-pl1-x62d.google.com with SMTP id d9443c01a7336-1b867f9198dso3196115ad.0 for ; Thu, 20 Jul 2023 21:48:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689914921; x=1690519721; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=X9/7B/0MCf2BZIY3PAvziue2nff9MWw3oMpO10RbKtE=; b=ca+6ac4esVCCdeYya2Pgxe5Rt6J38avHgbktl8ui1sI58jC74OsIoL4O+kb/92kvRG Gc+5BL7R1He3ZJzO5EyZnqB43WhH0lyOBXVkehXcP2b3TWzKFv+dHSmAIxMhhjmwOSep dSK/zSUzn8FOdPIHps/s4a+zK8U8s1Z8mxbyxR4FAtqkQWbiEbRWvaf5uMV9Dzd/ZXGp IfHCmfUuQ8LXLbCUfkIhqfwbOFwy0jjyH1G/8GRI4I+Q2wLylIZudY+Rr1vuhWApvcAl ndxwpJdHIvry1zOWQipCdIuOO3SU6dfLPhWp0ebPx5keW0tZh0SFyWdgQnobjUt+Vpps r09Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689914921; x=1690519721; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X9/7B/0MCf2BZIY3PAvziue2nff9MWw3oMpO10RbKtE=; b=kpXpqJc0ZW1/q1ZtdrHAsP8kqq7kJyZnqWfqijlT8Zem2I3WTI5ZDfxeIImcoh5bfR SomcmRjd1vCKZpteBiq2M77nmTNc7oUTp/aslwwHhDfoPOVXrqf3mNxvARLuLrJ8kYKt DLCRyJ2KO4OcQAkz6rf9aMLqg8jrJnZJGDNgyMOrZOR9CoRwt2y6s++KPeSk1qPJ/6bW 46i/reIHq92+mE1pMALzRel1eKvVMqpMIARYUZrrYSADUGj/orOwA+aSfNOmusj6Pene i0oRO8gzWDExniIE0LZ0DzVok8PkNo30JrQIhLZEDqCor2cJnqtaUi0l6+BgihDunbX6 dqtA== X-Gm-Message-State: ABy/qLauVLz110yHsStSsapRsN74G+B22cTI+rfWySAy47LL2WqP4V1c rJQlfn+SLZjO3xj8UpVn6/C3HQ== X-Google-Smtp-Source: APBJJlEhQvS7F5UmzvPfCyx7HjgUHDPaeqUNfdyIl+h7MewOsx9uMoZPXk0EmWh2xvk8rNhDhGZ99g== X-Received: by 2002:a17:903:22ce:b0:1b8:2ba0:c9a8 with SMTP id y14-20020a17090322ce00b001b82ba0c9a8mr1261085plg.2.1689914920987; Thu, 20 Jul 2023 21:48:40 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:b318:bb04:4abc:715e]) by smtp.gmail.com with ESMTPSA id c7-20020a170902d48700b001b80b342f61sm2273255plg.268.2023.07.20.21.48.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 21:48:40 -0700 (PDT) Date: Fri, 21 Jul 2023 13:48:36 +0900 From: AKASHI Takahiro To: Heinrich Schuchardt Cc: Sughosh Ganu , Ilias Apalodimas , u-boot@lists.denx.de, git@xilinx.com, Michal Simek Subject: Re: [PATCH] efi_loader: Allow also empty capsule to be process Message-ID: Mail-Followup-To: AKASHI Takahiro , Heinrich Schuchardt , Sughosh Ganu , Ilias Apalodimas , u-boot@lists.denx.de, git@xilinx.com, Michal Simek References: <9f2b578b-9e10-bf3a-2ce5-229f64b37fd3@amd.com> <7e87e112-1668-83c7-6faf-b2c4dca24b56@amd.com> <2b980833-f401-5f68-683f-b81d7469dcfe@amd.com> <72032712-63e9-fc79-245b-a67383962e54@gmx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <72032712-63e9-fc79-245b-a67383962e54@gmx.de> 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.8 at phobos.denx.de X-Virus-Status: Clean On Thu, Jul 20, 2023 at 10:42:10PM +0200, Heinrich Schuchardt wrote: > On 7/20/23 11:48, Sughosh Ganu wrote: > > On Thu, 20 Jul 2023 at 14:56, Michal Simek wrote: > > > > > > > > > > > > On 7/20/23 10:45, Sughosh Ganu wrote: > > > > On Thu, 20 Jul 2023 at 13:26, Michal Simek wrote: > > > > > > > > > > > > > > > > > > > > On 7/20/23 08:36, Sughosh Ganu wrote: > > > > > > On Thu, 20 Jul 2023 at 11:37, Michal Simek wrote: > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > On 7/20/23 07:49, AKASHI Takahiro wrote: > > > > > > > > Hi, > > > > > > > > > > > > > > > > On Wed, Jul 19, 2023 at 08:28:41AM +0200, Michal Simek wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > On 7/18/23 17:41, Heinrich Schuchardt wrote: > > > > > > > > > > On 13.07.23 16:35, Michal Simek wrote: > > > > > > > > > > > Empty capsule are also allowed to be process. Without it updated images > > > > > > > > > > > can't change their Image Acceptance state from no to yes. > > > > > > > > > > > > > > > > > > > > Is there any documentation describing the usage of empty capsule to set > > > > > > > > > > the image acceptance state? > > > > > > > > > > > > > > > > > > I actually don't know about documentation. I was talking to Ilias to make > > > > > > > > > sure that documentation is up2date because there are missing couple of > > > > > > > > > things there. > > > > > > > > > > > > > > > > Sughosh should have more to say here about A/B update. > > > > > > > > > > > > > > > > > I am testing A/B update and if you setup oemflags to 0x8000 then capsules > > > > > > > > > are not automatically accepted and waiting for acceptance capsule to be > > > > > > > > > passed. > > > > > > > > > When I tested it I found out that they are not process that's why I created > > > > > > > > > this patch. > > > > > > > > > > > > > > > > The path you tried to modify is only executed by "efidebug capsule update" > > > > > > > > or more specifically via the runtime service, UPDATE_CAPSULE. > > > > > > > > > > > > > > > > But this API is NOT officially supported in the current capsule implementation > > > > > > > > (at least, in my initial intention). > > > > > > > > The only way to invoke capsule updates is to reboot the system. > > > > > > > > If you want to test A/B update, please do the reboot. > > > > > > > > > > > > > > I realized that to get full flow you need to use capsule update on disk to get > > > > > > > all functionalities. But it is very impractical. Actually I would expect via > > > > > > > efidebug you should be able to perform all steps as capsule update performs when > > > > > > > you do reboot. > > > > > > > I would also understand that via efidebug you are not able to apply any capsule > > > > > > > but I don't think it is right that you can apply just update capsules but not > > > > > > > empty capsules. I would understand none or all but not something in the middle. > > > > > > > > > > > > The A/B update functionality requires using the capsule-on-disk > > > > > > functionality for performing the updates. This is also mentioned in > > > > > > the fwu_updates.rst document. You should be able to apply empty > > > > > > capsules even with the 'efidebug disk-update' command. > > > > > > > > > > Yes this is working fine. > > > > > > > > > > ZynqMP> efidebug capsule disk-update > > > > > ##### > > > > > Applying capsule capsule1.bin succeeded. > > > > > ######################### > > > > > Applying capsule capsule2.bin succeeded. > > > > > Reboot after firmware update. > > > > > > > > > > I tested it also with empty capsules which are also process properly. > > > > > > > > > > > I have never > > > > > > used the 'efidebug capsule update' command, so I'm not sure if that is > > > > > > supported. Like Takahiro mentioned, if you place the capsules(genuine > > > > > > or empty) under the /EFI/UpdateCapsule/ directory, the update should > > > > > > happen automatically, since the fwu update feature also enables the > > > > > > EFI_CAPSULE_ON_DISK_EARLY config. > > > > > > > > > > Yes that's work fine on production systems. > > > > > But from my point of view there shouldn't be really a problem to also apply > > > > > empty capsule via efidebug capsule update to be able to see that steps and > > > > > changes in mdata structure without performing reset. > > > > > > > > The 'efidebug capsule update' command calls the efi_update_capsule > > > > function, which implements the UpdateCapsule runtime service call. The > > > > initial versions of my fwu patches were indeed adding support for this > > > > path, but one of the review comments was to restrict support only for > > > > the capsule-on-disk path when performing the update in u-boot, since > > > > we are not using the runtime call in u-boot. > > > > > > I don't think this is a valid argument. As I said I would understand if there is > > > no interface for any capsule. It means having support for both or none is IMHO > > > the way we should support. > > > Can you please point me to that discussion? > > > > There is mention of the point in this discussion [1]. Even this thread > > has Takahiro mention the point he is making above, that maybe there > > shouldn't be the efi_update_capsule function. > > > > -sughosh > > Hello Sugosh, > > fwu_empty_capsule() detects an empty capsule as one with a GUID > fwu_guid_os_request_fw_revert or fwu_guid_os_request_fw_accept. > > I am not aware of a requirement in the UEFI specification to treat > capsules read from file in a different way than capsules passed via > UpdateCapsule(). Is there any reason why UpdateCapsule() should not > process an empty capsule when called from a boot-time EFI application? Here is a story behind efi_update_capsule(): === commit a6aafce494ab Author: Masami Hiramatsu Date: Wed Feb 16 15:15:42 2022 +0900 efi_loader: use efi_update_capsule_firmware() for capsule on disk === I still believe that this is a valid change, but we should have moved 'capsule->capsule_guid' check into efi_update_capsule_firmware() at the same time. -Takahiro Akashi > Best regards > > Heinrich > > > > > [1] - https://lists.denx.de/pipermail/u-boot/2022-February/473891.html >