From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.2964.1592381777190207022 for ; Wed, 17 Jun 2020 01:16:17 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0437836f39=sunnywang@hpe.com) Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 05H8DOZ1007065; Wed, 17 Jun 2020 08:16:13 GMT Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0a-002e3701.pphosted.com with ESMTP id 31q69su4n2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jun 2020 08:16:12 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id D285D60; Wed, 17 Jun 2020 08:16:11 +0000 (UTC) Received: from G4W9329.americas.hpqcorp.net (16.208.32.99) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 08:16:11 +0000 Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G4W9329.americas.hpqcorp.net (2002:10d0:2063::10d0:2063) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 17 Jun 2020 08:16:10 +0000 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (15.241.52.10) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Wed, 17 Jun 2020 08:16:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AlFbkN1NyyzEwdll0vtNEJM5GcByjPHiDEkp+Srhk/LUoz85cgv5OV2qLgXUARuJ8V5GzeCIjAwu8zdmvXi7/kz5Z6PI7/vAmh9iMnh5n2Dk3GpHCei5BIITDfLnuBzaYWLFV4OwLlJZUSlTJGuozzP0CBUPc7IIEIJVeiOI6FB2Hhq3mPKjxbds3/reG8bJTbqDzCxEMI00xESY5LoCVBQWUcFnh32tpDGx/9KBHaFhBkrWrjpj7hTgPP2HhapGg/hGfg30iA9y9wc6SGDH0DUO3aRDn0P8bLedstKUNpETADhUSLQe9QO7ATL3OD+LKZjEv3s7RNypfO7k8ruuQQ== 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-SenderADCheck; bh=Q689+dLGCYTZm9NrR/sDglB+jKzHjMiqxAuT0ijbcWY=; b=UU/mw1VHcGhCDb/MZVg5YzeCNVgV+uIS/nKES0PRJx4L41QZCKnxHhTRk2oQ7dMNxzxpYIxurvznOyLeuCzN9rMbY7KwfLhSJDYqQ3/iKzsL9Gw2M+QwusyQPFFEBTXFBCpbzXuGNE740TsDYa0a6AtuT66hsmgEX/7uqFVGcbCa3Ntg691SM96PL2XYiV3MLUDBMookJbfXw4QuiKnNWAzavHaSpV+0CTcFQFfV0dBCGMTbeEOKQYJksIUC/xlYzK+ZRgYZBxs85pKp0oV5A5pO72S6Y394FBVFQ9gaJzwwqfXAkbTIaeerAybGI5Wa1CMRMJBOJK609nLT9ReD2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Received: from DF4PR8401MB0585.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7609::21) by DF4PR8401MB0972.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3109.21; Wed, 17 Jun 2020 08:16:08 +0000 Received: from DF4PR8401MB0585.NAMPRD84.PROD.OUTLOOK.COM ([fe80::69d6:52d6:4ce6:c317]) by DF4PR8401MB0585.NAMPRD84.PROD.OUTLOOK.COM ([fe80::69d6:52d6:4ce6:c317%7]) with mapi id 15.20.3088.029; Wed, 17 Jun 2020 08:16:08 +0000 From: "Wang, Sunny (HPS SW)" To: "devel@edk2.groups.io" , "pete@akeo.ie" CC: "zhichao.gao@intel.com" , "ray.ni@intel.com" , "ard.biesheuvel@arm.com" , "leif@nuviainc.com" , "Wang, Sunny (HPS SW)" Subject: Re: [edk2-devel] [edk2][PATCH 1/1] MdeModulePkg/UefiBootManagerLib: Signal ReadyToBoot on platform recovery Thread-Topic: [edk2-devel] [edk2][PATCH 1/1] MdeModulePkg/UefiBootManagerLib: Signal ReadyToBoot on platform recovery Thread-Index: AQHWQ8SRyuuzMtsGq0a7PmrvMf1PKajcZk7Q Date: Wed, 17 Jun 2020 08:16:08 +0000 Message-ID: References: <20200616095622.2820-1-pete@akeo.ie> <20200616095622.2820-2-pete@akeo.ie> In-Reply-To: <20200616095622.2820-2-pete@akeo.ie> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; x-originating-ip: [220.129.195.89] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: c427dcfc-c307-404a-3606-08d81296b02b x-ms-traffictypediagnostic: DF4PR8401MB0972: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1360; x-forefront-prvs: 04371797A5 x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: sQSlhvSV2XBQ+EiFE6JpvXLP9jsL6ciWN2EhsPy4olGQE9BN+2QQ8UVE3LrnuKv7kdk98TdMIV7q7OiF6GKl4rizYa1ST3Kgvo6Rehj9vtw2/t/p+ukOadVJIb/fwBS5AK9rHh6gwyvgjt9HUAUtmXA4lmduFQOBZZWEO/lcPMnkiHILZungbo4nELFv8LQJzIm46nF2vOGOzIy8kS5o5W+2jrjYmwMlVveWllPWZGrXqIPPyDa0xc5ShPAgtUPy7Vozx02xEapfloaQxTEsVP+8BsH0RJmBhj49w2Ik56okEX0Y4uNyo0leouInvY/t7CCL9DHmBNApGt0TwxXsQnS5szTC01gi2KFWyEzfoG3r6LXUpstiHAwbFHaQXfeV/MakbluDzJbpcYvurZ/mlA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0585.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFTY:;SFS:(6029001)(366004)(136003)(39860400002)(346002)(376002)(396003)(52536014)(83380400001)(54906003)(316002)(2906002)(4326008)(110136005)(186003)(478600001)(26005)(5660300002)(86362001)(8676002)(7696005)(76116006)(66556008)(33656002)(64756008)(66446008)(66946007)(66476007)(966005)(6506007)(53546011)(9686003)(71200400001)(8936002)(55016002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata: FZSXBkWSqdnxh8RCGyW13dnlbf5O9P7G94aGrivLnwDzNCSp5ENYzfTxHm8PweAuddICHjnuVW29W49PNUE8va2B7jc9GgYkYpTvKNHx+TNhMNhmrUdcCFqOevSQuOIEFfwUrc9AqCqjvG+sL7rr3PKRi+uT/EGZ0Xridy4zc8Bhm1gJlFQG+DJwSh5KVC71xcKzptDvkQ86wv1NlL90TK/sBD8SH8wWPVMSHzqbIidR2Jk1T13c7IHa4aTntIi1guzb7xPQE1Lnd8QCDDWb1y7TLhCBUr0oRpVr/BSpwYxVdN7m4rcZbarbSjWQI8znXKqlZmKMob8pgFIk0Q9CbCp/BvFDzb0VMed7Eqdy0LkSXzlPh+QKA2oKg+gblQZvHMH+IQ9hy+Qqo0tb8tg/XY7tNp3qcYON9IPMLMHiJetLd4oRQ/cCMnjF4BYJfCFhaJv1nk3CPSQNxKIn9gKNEzyhPyXnCUSo+/g7zQwWjlhcxJ79GRJUMP4hIoQ0A45l X-MS-Exchange-CrossTenant-Network-Message-Id: c427dcfc-c307-404a-3606-08d81296b02b X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Jun 2020 08:16:08.1172 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: cnwNhvxzT60i58H06UbcXDwHpOpjcwyAnXJmLnR3/anOoed3KcqnGGgy/NDCkrkHWpcfQnpYbbjv+BUN3St1OQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0972 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 3 URL's were un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216,18.0.687 definitions=2020-06-16_13:2020-06-16,2020-06-16 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 lowpriorityscore=0 bulkscore=0 priorityscore=1501 spamscore=0 adultscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 malwarescore=0 impostorscore=0 mlxscore=0 cotscore=-2147483648 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006170065 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Pete.=20 Since the EfiBootManagerProcessLoadOption is called by ProcessLoadOptions = as well, your change would also cause some unexpected behavior like: 1. Signal one more ReadyToBoot for the PlatformRecovery option which is an= application that calls EfiBootManagerBoot() to launch its recovered boot o= ption. 2. Signal ReadyToBoot for SysPrep#### or Driver#### that is not really a "= boot" option.=20 =09 To solve your problem, creating a PlatformRecovery option with the smalles= t option number and using it instead of default one (with short-form File P= ath Media Device Path) looks like a simpler solution. By the way, I also checked the UEFI specification. It looks making sense t= o only signal ReadyToBoot for boot option (Boot####). Therefore, your chang= e may also require specification change. Regards, Sunny Wang -----Original Message----- From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Pete= Batard Sent: Tuesday, June 16, 2020 5:56 PM To: devel@edk2.groups.io Cc: zhichao.gao@intel.com; ray.ni@intel.com; ard.biesheuvel@arm.com; leif@= nuviainc.com Subject: [edk2-devel] [edk2][PATCH 1/1] MdeModulePkg/UefiBootManagerLib: S= ignal ReadyToBoot on platform recovery Currently, the ReadyToBoot event is only signaled when a formal Boot Manag= er option is executed (in BmBoot.c -> EfiBootManagerBoot ()). However, with the introduction of Platform Recovery in UEFI 2.5, which may= lead to the execution of a boot loader that has similar requirements to a = regular one, yet is not launched as a Boot Manager option, it also becomes = necessary to signal ReadyToBoot when a Platform Recovery boot loader runs. Especially, this can be critical to ensuring that the graphical console is= actually usable during platform recovery, as some platforms do rely on the= ConsolePrefDxe driver, which only performs console initialization after Re= adyToBoot is triggered. This patch fixes that behaviour by calling EfiSignalEventReadyToBoot () in= EfiBootManagerProcessLoadOption (), which is the function that sets up the= platform recovery boot process. Signed-off-by: Pete Batard --- MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c b/MdeM= odulePkg/Library/UefiBootManagerLib/BmLoadOption.c index 89372b3b97b8..117f1f5b124c 100644 --- a/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c +++ b/MdeModulePkg/Library/UefiBootManagerLib/BmLoadOption.c @@ -1376,6 +1376,15 @@ EfiBootManagerProcessLoadOption ( return EFI_SUCCESS; } =20 + // + // Signal the EVT_SIGNAL_READY_TO_BOOT event when we are about to load = and execute the boot option. + // + EfiSignalEventReadyToBoot (); + // + // Report Status Code to indicate ReadyToBoot was signalled // + REPORT_STATUS_CODE (EFI_PROGRESS_CODE, (EFI_SOFTWARE_DXE_BS_DRIVER |=20 + EFI_SW_DXE_BS_PC_READY_TO_BOOT_EVENT)); + // // Load and start the load option. // -- 2.21.0.windows.1