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 B1F94C433EF for ; Mon, 31 Jan 2022 11:20:15 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE78A82F5A; Mon, 31 Jan 2022 12:20:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="gxMrBFA+"; dkim=pass (1024-bit key) header.d=armh.onmicrosoft.com header.i=@armh.onmicrosoft.com header.b="gxMrBFA+"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D670B8303A; Mon, 31 Jan 2022 12:20:10 +0100 (CET) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2060f.outbound.protection.outlook.com [IPv6:2a01:111:f400:7e1b::60f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 782C7805F9 for ; Mon, 31 Jan 2022 12:20:07 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=Grant.Likely@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jFQSEFeA5eYAluz2rfiBxo6oX9+tGHHLWsxvP5vlaGo=; b=gxMrBFA+VE8ebhM97JyYoscy4iKoJLpuTiSTovxLnhyn5ueas+gSOqWwt7sYkbLdu9IG8x1EuiXHEPMwQvGmOpM/bbFvT+XT1yXya6pGb9rh8/zMw8pc3wJ+IwQq7wLDDI2oiMjSDR6BvIzxUeg0eTymHYNLev9dBuSIVMDtv/o= Received: from DU2PR04CA0001.eurprd04.prod.outlook.com (2603:10a6:10:3b::6) by DB6PR0802MB2248.eurprd08.prod.outlook.com (2603:10a6:4:85::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.18; Mon, 31 Jan 2022 11:20:04 +0000 Received: from DB5EUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3b:cafe::cf) by DU2PR04CA0001.outlook.office365.com (2603:10a6:10:3b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.20 via Frontend Transport; Mon, 31 Jan 2022 11:20:04 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT029.mail.protection.outlook.com (10.152.20.131) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15 via Frontend Transport; Mon, 31 Jan 2022 11:20:04 +0000 Received: ("Tessian outbound 826a6d8e58c3:v113"); Mon, 31 Jan 2022 11:20:04 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 6f19018daa82f695 X-CR-MTA-TID: 64aa7808 Received: from ac02fcfd7d9a.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 79424863-D445-48E0-A1FA-9244CC08C70C.1; Mon, 31 Jan 2022 11:19:53 +0000 Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ac02fcfd7d9a.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 31 Jan 2022 11:19:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQEvDAShr6j1xgPEmbhBCmUlIkH71GkW/6e2U7aebKsOTb9nCJ2y8kTy16dxKxO+QOH8h8JJZtK+0OrgeXtEPDb1iDNBY4zuqLVyaqrWXs0e9/v1ddoqoewxgF8bYrphMrvPe0n0O+84SrihTkbrYUH/39t8tVlLE/QkWCFvRFOVXnHuZHZhyY5shJGGEE24TiJdWb14dXcy77cDB+HFA4mNLL1Sej4Tg96w1P31ezZ84ZHHQ3jxbZ2nulJxkxK4DcLFSZV0C5Zs5hclSHIxZ+oHSeEoiw0bgeFIPlJ5mhSldfqjpuqQcRJtX2yE7MkSHoJnSHYFsRnyFahI5ITRuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=jFQSEFeA5eYAluz2rfiBxo6oX9+tGHHLWsxvP5vlaGo=; b=dTZJok7aLDx6VB3ow+2LMhdTnnjx80f5HWr2s/v2LfhWZ1eiJ4FOP3H9N1EpPDjWPo/TY1SdAbr1SVIQhU3HUB5WwuHFHOHqLby2Yq0B8K5mEZdzmB5J5HEOxUXnrmKGViXYUrRHVeopwqq1+GW0DY/UaQjcCOIXSSGT0SlY6+kmNpL/QYe+3GHnbam17TWAA0jzdvzuGVJQYt5M8XhLleDIoHz0MFxoJ+sdpVVabpH4KwFQXoEL21ORUHzQvcMcT7YSCQaBv0Mz57wMWWY3uVUA4WgtudHvSNMUehniXh8zClPy9usDxthK5lLBqj9zr5ChtprjrZ1jC/ROvjeArg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=jFQSEFeA5eYAluz2rfiBxo6oX9+tGHHLWsxvP5vlaGo=; b=gxMrBFA+VE8ebhM97JyYoscy4iKoJLpuTiSTovxLnhyn5ueas+gSOqWwt7sYkbLdu9IG8x1EuiXHEPMwQvGmOpM/bbFvT+XT1yXya6pGb9rh8/zMw8pc3wJ+IwQq7wLDDI2oiMjSDR6BvIzxUeg0eTymHYNLev9dBuSIVMDtv/o= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB9PR08MB6809.eurprd08.prod.outlook.com (2603:10a6:10:2ae::5) by AM0PR08MB4164.eurprd08.prod.outlook.com (2603:10a6:208:12c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Mon, 31 Jan 2022 11:19:50 +0000 Received: from DB9PR08MB6809.eurprd08.prod.outlook.com ([fe80::b07c:aaa2:bdd9:3248]) by DB9PR08MB6809.eurprd08.prod.outlook.com ([fe80::b07c:aaa2:bdd9:3248%3]) with mapi id 15.20.4930.022; Mon, 31 Jan 2022 11:19:50 +0000 Message-ID: <4bbb4e3a-e521-6dac-d7a7-8f031b611896@arm.com> Date: Mon, 31 Jan 2022 11:19:46 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1 Subject: Re: [PATCH 2/2] efi_loader: Reset system after CapsuleUpdate on disk Content-Language: en-US To: Masami Hiramatsu , u-boot@lists.denx.de Cc: Patrick Delaunay , Patrice Chotard , Heinrich Schuchardt , Alexander Graf , AKASHI Takahiro , Simon Glass , Bin Meng , Ilias Apalodimas , Jose Marinho , Tom Rini , Etienne Carriere , Sughosh Ganu , Paul Liu References: <164362071931.312714.14793570668139727572.stgit@localhost> <164362073982.312714.10153796355309762567.stgit@localhost> From: Grant Likely In-Reply-To: <164362073982.312714.10153796355309762567.stgit@localhost> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: LO2P265CA0151.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:9::19) To DB9PR08MB6809.eurprd08.prod.outlook.com (2603:10a6:10:2ae::5) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e50afd88-ea7f-4494-1a3c-08d9e4aba0fc X-MS-TrafficTypeDiagnostic: AM0PR08MB4164:EE_|DB5EUR03FT029:EE_|DB6PR0802MB2248:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 1qSuPqxExy4G733p5HVOTV7kRFBNnSdCuF8ct1FayApIXx/L6yoz1NTcKMfF+OJaZuSbNWQ64ntJbLq8DBZOS2kULuLRHBqTYA5es6X5LSSY8X8qO1VNoXyNe0nAA7wThWV5/ObIeC496JYjmR1iGGV0XyxIAbjm370nbdbj7VqRevZWATONUs/4uff7mwIich8X3FOnQogZF8VIQr+lEDV3bALAJNOPFRa/OV4NWYI8QUJGhnqBsVJTuLT7TOCIagrPX97++BBA4SqNbLQWpfU8zVQKsHjxFNT7lHvr86w8rVs6zxEdGwp+0oNhNsHff54Ocw8itF1zbuc3zyRXsg8MYCvRrNfD5JDqlKQguM03pBELu010lOjb92iUwJi/3OBX7HeEUTGQmAOKG7dQ4++bQNnaE3My7hrIHaa5FTlWsXzGs108uL6kTAVFNE3cdk9UA1C+Ft6SKKTvtYDj9/zXXFnrg8cbi10dHkAZOYZpKt4enb6J0n8YQhNW/pGXkfqwDMxLHKM1rB0D/4sqXu3vGCNRSFNxrtxJFfb2l7hEMh+/LuWU8KwmFGK9k+6VniEKUv1B5iWJ5rypgtYS9N2jKtCZ3r0uW2U//UGK88Q6S+XLJJF0NOGF59lRt/u1AAprqf3dy+cuUUoXOmaUsiKVFE2NhxW+hBKHp6eIoPDwsejqm014avpVZnP2wwzLgXdtNsX6+zYoN5+EuUtMMyZsNx3UopwJd8meSh3y8uuLqJkIrp3iLyUJ4XjBF9K5q/QaVaZalProg5NV1xG40g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR08MB6809.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(31686004)(2616005)(8936002)(66476007)(66946007)(83380400001)(66556008)(86362001)(8676002)(4326008)(38100700002)(38350700002)(31696002)(36756003)(26005)(186003)(6486002)(52116002)(53546011)(6512007)(6506007)(6666004)(5660300002)(44832011)(316002)(54906003)(2906002)(508600001)(7416002)(45980500001)(43740500002)(20210929001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB4164 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f54a58a7-000a-40ff-b358-08d9e4ab989c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ENw+Xp6kxZiKfLIgVcxcZkTMndPrUUHhRwRDs0Xt5bvDOPL7YIpasO63S7ZVo1gIXL6VaiszEHbZsDbxDgSn8nnfbSPm+2Lq4HwAmLXPIuL3dA1fKfAk1uwzzWw35QRsu3vNivPOU49leJJdTxraIEgkRr7Za6RdNGigpwJjAfoBQG+Peu4PsJKDC8CZV19ixYpmP+4lsvH66UlVQDUkyY2IcoOZh9bpSBDk/eHNX7oyItkKs1gviNyYA2uFXd6QyJ0KDj+LnWFXjz750KwPcwacgAS8aeGKJiblsC5K93zGpIrcy2WBDXkXk38D4k7yLapZWxaVKZ1xPnmD27rJ8q8OROm6+HnlsP5DkR1meTWyzaVQDpCrcZ894uMsTxONY3q883nVS49arF1hhubMqdFTA239wt6wSbRYByj0vyCVdGKCNxKJuxBqnBEMbz7AjJm+65uWWfv2HtSQjf7a0YZqx0OeGiMM+ATT/+QSaswpUCmV03uasASzvsdxr+vrm8RbgT+nKqqOVJafx/Py0yUgmEOfuc0yxQH8MYD6GjIwh8vTEVsmCtO91ANMkg0ZmqI9JFg6VCX1Fh5RZDZGnjJNtHUCCct4Y3OsEhFXAJXWfNeiL/dbZDr+XDKPClM+mlGsHPb4YmHi+A0z24FU+cp1qB/CeipDvbO0W9Pfd5YeKYhT1rHPPN8Gx5P68+1NVlwPd8FpKyzcZdHLMayL+Q== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(107886003)(6486002)(47076005)(31686004)(54906003)(83380400001)(36860700001)(508600001)(81166007)(356005)(2906002)(316002)(5660300002)(6512007)(6506007)(36756003)(70586007)(186003)(44832011)(26005)(31696002)(86362001)(6666004)(40460700003)(2616005)(82310400004)(53546011)(336012)(8936002)(8676002)(70206006)(4326008)(43740500002)(20210929001); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jan 2022 11:20:04.0977 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e50afd88-ea7f-4494-1a3c-08d9e4aba0fc X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2248 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 On 31/01/2022 09:19, Masami Hiramatsu wrote: > Add a config option to reset system soon after processing capsule update > on disk. This is required in UEFI specification 2.9 Section 8.5.5 > "Delivery of Capsules via file on Mass Storage device" as; > > In all cases that a capsule is identified for processing the system = is > restarted after capsule processing is completed. > > Signed-off-by: Masami Hiramatsu Is there known use cases for making this an option? Feels a bit like option creep that is too easy to choose the wrong setting. Otherwise, this looks good to me. g. > --- > lib/efi_loader/Kconfig | 10 ++++++++++ > lib/efi_loader/efi_capsule.c | 9 +++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig > index 24f9a2bb75..db05c3ad90 100644 > --- a/lib/efi_loader/Kconfig > +++ b/lib/efi_loader/Kconfig > @@ -146,6 +146,16 @@ config EFI_IGNORE_OSINDICATIONS > without setting the EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPP= ORTED > flag in variable OsIndications. > > +config EFI_RESET_AFTER_CAPSULE_ON_DISK > + bool "Reset right after CapsuleUpdate on-disk" > + depends on EFI_CAPSULE_ON_DISK > + default y > + help > + UEFI specification requests the system to be restarted after caps= ule > + processing is complete. This implements that, but for some reason= , > + if you want to keep the (old) system running after the capsule up= date > + on-disk, you can say 'n' here. > + > config EFI_CAPSULE_ON_DISK_EARLY > bool "Initiate capsule-on-disk at U-Boot boottime" > depends on EFI_CAPSULE_ON_DISK > diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c > index 98dab1c6f5..44d4fa2f82 100644 > --- a/lib/efi_loader/efi_capsule.c > +++ b/lib/efi_loader/efi_capsule.c > @@ -1142,6 +1142,15 @@ efi_status_t efi_launch_capsules(void) > free(files[i]); > free(files); > > + /* > + * UEFI spec requires to reset system after complete processing cap= sule > + * update on the storage. > + */ > + if (IS_ENABLED(CONFIG_EFI_RESET_AFTER_CAPSULE_ON_DISK)) { > + log_info("Restarting the system to boot the updated firmwar= e.\n"); > + do_reset(NULL, 0, 0, NULL); > + } > + > if (IS_ENABLED(CONFIG_EFI_ESRT)) { > /* Rebuild the ESRT to reflect any updated FW images. */ > ret =3D efi_esrt_populate(); > IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.