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.web09.1561.1576058086223091033 for ; Wed, 11 Dec 2019 01:54:46 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0248989595=sunnywang@hpe.com) Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xBB9rjb0021109; Wed, 11 Dec 2019 09:54:43 GMT Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 2wtq2ctw1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 11 Dec 2019 09:54:43 +0000 Received: from G4W9120.americas.hpqcorp.net (exchangepmrr1.us.hpecorp.net [16.210.21.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 3AC98B9; Wed, 11 Dec 2019 09:54:42 +0000 (UTC) Received: from G9W8455.americas.hpqcorp.net (2002:10d8:a15e::10d8:a15e) by G4W9120.americas.hpqcorp.net (2002:10d2:150f::10d2:150f) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 11 Dec 2019 09:54:41 +0000 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (15.241.52.11) by G9W8455.americas.hpqcorp.net (16.216.161.94) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 11 Dec 2019 09:54:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OvqjjXaq1+hEqIqsw4ktsrf8HXxJPbpZWUC+U+r5diqSqjHHxc52ES6n0zrZezmYtlmI6+mlgG7pLSLZZuJkhEmxRxveZm1HqrBAf7wDgz6Iel891mg6blvKmqxXoklC4xOI3MOe0XcwTEcqgY3JUapejMlUdojUYp4JljKp/durazmIf7ablcyfxsti7aszjAqNuG9WrA1DcxmjJfzKe8KpKd7PzY+PasIsXWq7GbZ03XW0pgqS6DDl0Hju1ixlHFW+e8Xr71auI0nr3Kr2cVdeL0sljbSrCW3Il1K29i5FBKEa4BDNb5p+ycSANQoWkArQ9O9fdkQE3+wnR9PYOA== 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=IIH1R/wnkbJ3IdU39q1zfJILLf4IP7v9MBQxKbigxyk=; b=FiPu1m4l0L58Qc9pbZLxc5jyJxqlmMzM2BpOUeXeRRGKG+ZTzKsqbF0YmND0y/GSgByQUlY3rjLdDuLFiWH/qbVYBzfkaU7LE0nC4dQGNCCsZtcobdUgayRYnGtNa6Qq22VL+jQwzwIHVQ3tuAyg+TLTZsbgowzXVBNOP8TXpjRHPfFxDs0mw6fM2M56W0XqOGjKHsko6slo/O/yT5t0NRuM8q2WHh3srna+wH4KSXUBVCeQs6/zQjDkLPfMEkl/nTVkcMncU5qMczA41mZflU6Osrs2U/q5nRAYOZ8YWcCQWMurGrmeT9fB45eTEqR5mSztWyV3MRJ88KuCEESd7A== 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 DF4PR8401MB1307.NAMPRD84.PROD.OUTLOOK.COM (10.169.93.143) by DF4PR8401MB0732.NAMPRD84.PROD.OUTLOOK.COM (10.169.85.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2516.13; Wed, 11 Dec 2019 09:54:39 +0000 Received: from DF4PR8401MB1307.NAMPRD84.PROD.OUTLOOK.COM ([fe80::7969:cbbd:6156:5fb4]) by DF4PR8401MB1307.NAMPRD84.PROD.OUTLOOK.COM ([fe80::7969:cbbd:6156:5fb4%4]) with mapi id 15.20.2516.018; Wed, 11 Dec 2019 09:54:39 +0000 From: "Wang, Sunny (HPS SW)" To: "discuss@edk2.groups.io" , "jbrasen@nvidia.com" , "Ni, Ray" , "devel@edk2.groups.io" , Laszlo Ersek , "afish@apple.com" CC: Ashish Singhal , "Wang, Jian J" , "Wu, Hao A" , "Gao, Zhichao" , "Kinney, Michael D" , "Spottswood, Jason" , "Wiginton, Scott" , "Wei, Kent (HPS SW)" , "Wang, Sunny (HPS SW)" Subject: Re: [edk2-discuss] [edk2-devel] [PATCH] Support skipping automatic BM enumeration Thread-Topic: [edk2-discuss] [edk2-devel] [PATCH] Support skipping automatic BM enumeration Thread-Index: AQHVjtTKjT2odVGWsUe/aBeUuow/Tad0il+AgAddNoCAAAvIgIAAGuwAgAABkACAAARWgIAABc2AgAAJNQCAAD03AIAAdMEAgAAS2wCAABdaAIAAX/eAgAAHpICAABRhAIAACWCAgADZk4CAAMcwAIAALqiAgAAAuACAAAVNAIAArpsAgAF/VICABSEYAIAAEOcAgAAAlACAAsvrAIAAfLYAgAD6E4CAKRqigIAAcA2A Date: Wed, 11 Dec 2019 09:54:39 +0000 Message-ID: References: <37D801DD-41E8-452E-9F24-ADF52BFDB676@apple.com> <72ce1d71-2a65-a6c0-1dd8-7628429c5a3c@redhat.com> <746A8D5E-DC45-4D39-9C4D-97A10BE2E0B0@apple.com> <734D49CCEBEEF84792F5B80ED585239D5C35125E@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C352ECA@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C352F7C@SHSMSX104.ccr.corp.intel.com> ,<897d405a-b164-773c-5784-47fb8c4f9040@redhat.com> ,<734D49CCEBEEF84792F5B80ED585239D5C358AD3@SHSMSX104.ccr.corp.intel.com>, <734D49CCEBEEF84792F5B80ED585239D5C35DF72@SHSMSX104.ccr.corp.intel.com>, In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [16.242.247.139] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: a798d991-bd58-4ed3-a196-08d77e20235d x-ms-traffictypediagnostic: DF4PR8401MB0732: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:800; x-forefront-prvs: 024847EE92 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(376002)(366004)(396003)(39860400002)(346002)(51444003)(199004)(189003)(13464003)(53754006)(186003)(45080400002)(8936002)(9686003)(478600001)(19627235002)(2906002)(966005)(33656002)(81156014)(7416002)(81166006)(8676002)(71200400001)(86362001)(64756008)(7696005)(30864003)(54906003)(4326008)(66946007)(6506007)(5660300002)(52536014)(53546011)(55016002)(110136005)(66446008)(316002)(66556008)(26005)(76116006)(66476007)(559001)(579004);DIR:OUT;SFP:1102;SCL:1;SRVR:DF4PR8401MB0732;H:DF4PR8401MB1307.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: hpe.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Mz3+RXAQAt2benNF3N3KkVO+ZIjjOHhgDAtekezwyIBS6xW2v8K4KYBcFNxrtWglKqaicS82RlLe9i/7+zq1T/hgc2r0Q2idP2uoKCCu2ETO+DaIotL9EFLeGuMbck+FiH1CwD6kWxWOl98O5tKWu/IZFLzM8ZHIlpYCdt3B9kdYPz0VzQkhlxr1epoa075ecVAF6q98GME349Ln7CkLH6EWqfU+7KROchZB2O1ygKWlJ4u+h7apDyYPBYctFVfkBFZPYiZ4lVuKFo4rm9/4V/uTFC76J9AbwLKaqPy3Vl9C7NPXQIOwderjVrmEQIZbAisJCOONdZmmHEIGF53WAH0MNxde3PQUsr+i1zA6iwuI5ab7O2OFLW+eOaI+glvspxEXNxkepwc29rC5JURToBHzBGvk67GvyfqCWvBGaAgtKmst4q8oF3ZMnZU6OJH9aI9uFyMU7ihNguCMDe82mRFPCzTpKFkRkRhc/E9yFvrz0L8SjOMQ59B1ZHI1p+MEvcOKlm5mM1dNFp8lsqMXZSycrwvFSSxjyJ8zJrM0pHZHKYFxf3P6TXVsApZpfsFLuzFc/YZhdFYGGiu/VePXbQ== X-MS-Exchange-CrossTenant-Network-Message-Id: a798d991-bd58-4ed3-a196-08d77e20235d X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Dec 2019 09:54:39.1787 (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: JnHDhPTumaORl/kKihCtnGGvVI4H+2LE7FOJccTyThKPUeZN6N1H75A8k8A0vZbSP7XNFNxLqjJ1NsMC3/FCBw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0732 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 4 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.95,18.0.572 definitions=2019-12-11_02:2019-12-11,2019-12-11 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 spamscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 mlxscore=0 priorityscore=1501 impostorscore=0 phishscore=0 mlxlogscore=999 clxscore=1011 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912110086 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all,=20 Since I can't attend the design meeting (EMEA), I would like to add some u= se cases and a suggestion for your guys' reference before this topic being = discussed: We had similar needs (use cases) as Ashish like the following, so making t= his code change would be definitely good for system vendors like us.=20 - Disabling a specific boot option like a PXE boot option for a sp= ecific NIC port. - Hiding a partition that is used for special purpose rather than = booting. =20 If we don't have a strong reason to prevent creating a platform hook funct= ion (solution 5), I will prefer to use it because it is the simplest soluti= on and can be easily extended and maintained. Also, solution 5 is our curre= nt implementation. We can even contribute our implementation to EDK2 if you= guys need it. Moreover, if we finally choose solution 5, I will prefer to = create a new platform library instead of adding a new function into the Pla= tformBootManagerLib, and let this new platform library only be called by Ue= fiBootManagerLib. This would avoid a potential circular dependency problem.= For solutions 1, 2, 3, and 4, if I understand them correctly, they all req= uire making changes in the EfiBootManagerRefreshAllBootOption callers. UiAp= p may not be the only application to call EfiBootManagerRefreshAllBootOptio= n, so this may cause additional maintenance effort. However, if we still ne= ed to choose a solution other than solution 5, can we make the change direc= tly in EfiBootManagerRefreshAllBootOption instead of UiApp?=20 By the way, if we still need to discuss this further at a meeting, I will = be at the other design meeting (APAC). Regards, Sunny Wang -----Original Message----- From: discuss@edk2.groups.io [mailto:discuss@edk2.groups.io] On Behalf Of = Jeff Brasen Sent: Wednesday, December 11, 2019 4:46 AM To: Ni, Ray ; devel@edk2.groups.io; Laszlo Ersek ; afish@apple.com; discuss@edk2.groups.io Cc: Ashish Singhal ; Wang, Jian J ; Wu, Hao A ; Gao, Zhichao ; Kinney, Michael D Subject: Re: [edk2-discuss] [edk2-devel] [PATCH] Support skipping automati= c BM enumeration Can we discuss this at the design meeting this week (12/12)? Thanks, Jeff ________________________________ From: Jeff Brasen Sent: Thursday, November 14, 2019 10:04 AM To: Ni, Ray ; devel@edk2.groups.io ; Laszlo Ersek ; afish@apple.com Cc: Ashish Singhal ; Wang, Jian J ; Wu, Hao A ; Gao, Zhichao ; Kinney, Michael D Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n Yes, I think that would be good. Summarizing everything in this thread Problem: Platform needs to customize the boot options, this can be done fo= r normal boot but the UiApp calls EfiBootManagerRefreshAllBootOption in a c= ouple places. Potential solutions: 1 - Define new PCD and event group if PCD is set true then signal event in= stead of calling EfiBootManagerRefreshAllBootOption in UiApp 2 - Add new function to boot manager library and replace call to EfiBootMa= nagerRefreshAllBootOption in UiApp (need to coordinate rollout with updates= to all platform. 3 - Add new protocol with new function, if supported call this otherwise c= all EfiBootManagerRefreshAllBootOption as is done now 4 - For 2/3 use generic function so we don't need new APIs for future exp= ansion 5 - Update EfiBootManagerRefreshAllBootOption to call platform specific fu= nction. Thanks, Jeff From: Ni, Ray Sent: Wednesday, November 13, 2019 7:09 PM To: devel@edk2.groups.io; Jeff Brasen ; Laszlo Ersek <= lersek@redhat.com>; afish@apple.com Cc: Ashish Singhal ; Wang, Jian J ; Wu, Hao A ; Gao, Zhichao ; Kinney, Michael D Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n Jeff, I think it's a good topic that we could discuss in the open design meeting= . Are you ok to present the problem you have and discuss the potential solut= ions in that meeting? https://github.com/tianocore/tianocore.github.io/wiki/Design-Meeting Thanks, Ray From: devel@edk2.groups.io > On Behalf Of Jeff Brasen Sent: Thursday, November 14, 2019 2:43 AM To: Ni, Ray >; devel@edk2.groups= .io; Laszlo Ersek >; afish@apple.com Cc: Ashish Singhal >; Wang, Jian J >; Wu,= Hao A >; Gao, Zhichao >; Kinney, Michael D > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n Thinking about this more I think we could do this with a PCD and a new gro= up event without having to define any new function interfaces. We could change UiApp and BootManagerMenuApp (and any others that are rele= vant) from EfiBootManagerRefreshAllBootOption (); to if (FeaturePcdGet (PcdEventBasedRefreshAllBootOptionSupport) { EFI_EVENT Event; gBS->CreateEventEx ( 0, 0, NULL, NULL, &gEventBasedRefreshGuid, &Event )= ; gBS->SignalEvent (Event); gBS->CloseEvent (Event); } else { EfiBootManagerRefreshAllBootOption (); } Then a platform that wants to do this on its own would just set this pcd a= nd create a group event and do what it needs to do there. Thanks, Jeff ________________________________ From: Jeff Brasen > Sent: Monday, November 11, 2019 5:00 PM To: Ni, Ray >; devel@edk2.groups= .io >; Laszlo Ersek >; afis= h@apple.com > Cc: Ashish Singhal >; Wang, Jian J >; Wu,= Hao A >; Gao, Zhichao >; Kinney, Michael D > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n I am not sure a PCD would work (unless I am missing something) We do want = to do a connect all and re-enumerate in UiApp but we need the platform code= to be involved in that process. Thanks, Jeff ________________________________ From: Ni, Ray > Sent: Monday, November 11, 2019 4:58 PM To: devel@edk2.groups.io >; Jeff Brasen >; Laszlo Ersek >; afish@apple.com > Cc: Ashish Singhal >; Wang, Jian J >; Wu,= Hao A >; Gao, Zhichao >; Kinney, Michael D > Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n Jeff, If adding a PCD to control UiApp can meet the real needs, I prefer to do i= n that way instead of adding new APIs to PlatformBootManagerLib. Thanks, Ray From: devel@edk2.groups.io > On Behalf Of Jeff Brasen Sent: Tuesday, November 12, 2019 6:58 AM To: Laszlo Ersek >; Ni, Ray >; devel@edk2.groups.io; afish@apple.com Cc: Ashish Singhal >; Wang, Jian J >; Wu,= Hao A >; Gao, Zhichao >; Kinney, Michael D > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n If we are concerned about deploying this and breaking builds we could do t= his via a new protocol instead. In that case though we would leave the old = default behavior in the code to handle platforms that didn't implement the = new protocol, so this might not be the cleanest way to deploy this. We could also look at adding a generic platform boot hook function (either= as a library function or protocol) if we wanted to limit the number of dis= ruption on new customization hooks. Something like EFI_STATUS PlatformBootNotify (CONST EFI_GUID *NotificationType, VOID *Con= textData OPTIONAL) Where Notification type describes where we are that we want platform to po= tentially handle and ContextData is per type caller allocated data that pro= vides additional in/out data. This has the same issue of leaving the curren= t default behavior in place for unsupported types as well as being a less t= han specific function to describe. Thanks, Jeff ________________________________ From: Laszlo Ersek > Sent: Friday, November 8, 2019 9:37 AM To: Jeff Brasen >; Ni, Ray <= ray.ni@intel.com>; devel@edk2.groups.io >; afi= sh@apple.com > Cc: Ashish Singhal >; Wang, Jian J >; Wu,= Hao A >; Gao, Zhichao >; Kinney, Michael D > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeratio= n On 11/07/19 18:46, Jeff Brasen wrote: > Fixing UiApp seems reasonable, I do think we would want a hook to the pl= atform library in here as the enumeration that occurs in the UiApp is inten= ded to do a full enumeration of the system and there may be platform specif= ics to how that occurs. Fully agreed -- entering UiApp should expose everything bootable in the sy= stem, unless (perhaps) PlatformBootManagerLib specifically thinks otherwise= . Of course, then we arrive (again) at the problem that a call in UefiBootMa= nagerLib, to a *new* PlatformBootManagerLib API, will break tens of out-of-= tree platforms. :) I think that can be prevented, as follows; but it will take quite some tim= e: - introduce the new function declaration in "PlatformBootManagerLib.h", - modify all platforms (in tree and out of tree) to implement (define) the= new function, - call the new function from UefiBootManagerLib For some history / background on this kind of problem, I suggest reading through: https://bugzilla.tianocore.org/show_bug.cgi?id=3D982=20 Thanks, Laszlo > From: Ni, Ray > > Sent: Thursday, November 7, 2019 12:21 AM > To: devel@edk2.groups.io; Jeff Brasen=20 > >;=20 > afish@apple.com > Cc: Ashish Singhal=20 > >; Laszlo=20 > Ersek >; Wang, Jian J=20 > >; Wu, Hao A=20 > >; Gao, Zhichao=20 > >; Kinney, Michael= =20 > D > > Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > I treat the issue in this way: > > 1. Platform Boot Manager library does a good job. It doesn't always c= all RefreshAll() API to auto-create the boot options > 2. But UiApp doesn't. It constantly call RefreshAll(). > > Do you think that we can fix UiApp instead? For example, introducing a P= CD to control the boot option refresh behavior? > > Thanks, > Ray > > From:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>=20 > oups.io%3cmailto:devel@edk2.groups.io>>> On Behalf Of Jeff Brasen > Sent: Thursday, November 7, 2019 3:02 PM > To: Ni, Ray=20 > ilto:ray.ni@intel.com>>>; afish@apple.com > Cc:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>; Ashish Singhal=20 > ingha@nvidia.com%3cmailto:ashishsingha@nvidia.com>>>; Laszlo Ersek=20 > cmailto:lersek@redhat.com>>>; Wang, Jian J=20 > @intel.com%3cmailto:jian.j.wang@intel.com>>>; Wu, Hao A=20 > m%3cmailto:hao.a.wu@intel.com>>>; Gao, Zhichao=20 > @intel.com%3cmailto:zhichao.gao@intel.com>>>; Kinney, Michael D=20 > ichael.d.kinney@intel.com%3cmailto:michael.d.kinney@intel.com>>> > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > The issue is there are some auto created options we do not want on our p= latform. > Get Outlook for=20 > Android ei36&d=3DDwIF-g&c=3DC5b8zRQO1miGmBeVZ2LFWg&r=3DZ9cLgEMdGZCI1_R0bW6KqOAGz= CXLJ > UR24f8N3205AYw&m=3DtNOWNYcrAfOGKuSMyGZvQ46qeU3yiXGlPkDQK70Nshw&s=3DV7Nc8= Wt > ostFCvj8E2KL2RcggpHj8sblqsBrdrabOuoE&e=3D > > > ________________________________ > From: Ni, Ray=20 > ilto:ray.ni@intel.com>>> > Sent: Wednesday, November 6, 2019 11:59:31 PM > To: Jeff Brasen=20 > m%3cmailto:jbrasen@nvidia.com>>>;=20 > afish@apple.com=20 > o:afish@apple.com>>> > Cc:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>=20 > oups.io%3cmailto:devel@edk2.groups.io>>>; Ashish Singhal=20 > ingha@nvidia.com%3cmailto:ashishsingha@nvidia.com>>>; Laszlo Ersek=20 > cmailto:lersek@redhat.com>>>; Wang, Jian J=20 > @intel.com%3cmailto:jian.j.wang@intel.com>>>; Wu, Hao A=20 > m%3cmailto:hao.a.wu@intel.com>>>; Gao, Zhichao=20 > @intel.com%3cmailto:zhichao.gao@intel.com>>>; Kinney, Michael D=20 > ichael.d.kinney@intel.com%3cmailto:michael.d.kinney@intel.com>>> > Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > > Jeff, > > RefreshAllBootOption() only modifies/creates the auto-created boot optio= ns. For the boot options created by platform boot manager library, they sta= y with no one touches. And all auto-created boot options are appended in th= e end of boot option list (through BootOrder). > > > > From: Jeff Brasen=20 > m%3cmailto:jbrasen@nvidia.com>>> > Sent: Thursday, November 7, 2019 12:13 PM > To: afish@apple.com; Ni, Ray=20 > ilto:ray.ni@intel.com>>> > Cc:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>; Ashish Singhal=20 > ingha@nvidia.com%3cmailto:ashishsingha@nvidia.com>>>; Laszlo Ersek=20 > cmailto:lersek@redhat.com>>>; Wang, Jian J=20 > @intel.com%3cmailto:jian.j.wang@intel.com>>>; Wu, Hao A=20 > m%3cmailto:hao.a.wu@intel.com>>>; Gao, Zhichao=20 > @intel.com%3cmailto:zhichao.gao@intel.com>>>; Kinney, Michael D=20 > ichael.d.kinney@intel.com%3cmailto:michael.d.kinney@intel.com>>> > Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > > > As the suggestions below made sense, we updated our platform boot manage= r library to behave in this manner and for normal boots everything works we= ll. However the UiApp and boot maintenance applications in EDK2 also call E= fiBootManagerRefreshAllBootOption() when ever a user goes into the menu whi= ch will re-create the skipped boot options with no place for the platform c= ode to intervene. > > > > What about a solution where we add a new Platform library function that = allows for override of the behavior of BmEnumerateBootOptions? For example,= either a function or protocol that takes the same parameters as this funct= ion and only if it returns NULL then we continue to the default enumeration= code. Or a function call inserted at the end that would modify the load o= ption array after the system does the standard enumeration. > > > > -Jeff > > > > From: afish@apple.com=20 > o:afish@apple.com>>> > Sent: Wednesday, November 6, 2019 9:20 AM > To: Ni, Ray=20 > ilto:ray.ni@intel.com>>> > Cc:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>; Jeff Brasen=20 > m%3cmailto:jbrasen@nvidia.com>>>; Ashish Singhal=20 > ingha@nvidia.com%3cmailto:ashishsingha@nvidia.com>>>; Laszlo Ersek=20 > cmailto:lersek@redhat.com>>>; Wang, Jian J=20 > @intel.com%3cmailto:jian.j.wang@intel.com>>>; Wu, Hao A=20 > m%3cmailto:hao.a.wu@intel.com>>>; Gao, Zhichao=20 > @intel.com%3cmailto:zhichao.gao@intel.com>>>; Mike Kinney=20 > ichael.d.kinney@intel.com%3cmailto:michael.d.kinney@intel.com>>> > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > > > Ray, > > > > Is there an obvious hook point we could point Jeff and Ashish at? > > > > Long term it would be a good idea to have a Wiki page to give some guida= nce on how to customize the BDS. > > > > Thanks, > > > > Andrew Fish > > > > On Nov 5, 2019, at 9:20 PM, Ni, Ray >> wrote: > > > > Andrew, > > I agree with your opinion. > > It's expected that Platform Boot Manager lib calls EfiBootManagerRefresh= AllBootOption() only in full configuration boot path. > > The full configuration boot path is chosen when hardware changes=20 > happen. So it's not expected EfiBootManagerRefresh...() be called in eve= ry boot. > > So you could: > > 1. Delete the auto-created option pointing to LoadFile instance > 2. Create your own one with customized description. > > > > > > From: afish@apple.com=20 > o:afish@apple.com>>> > Sent: Wednesday, November 6, 2019 10:47 AM > To:=20 > devel@edk2.groups.io ups.io%3cmailto:devel@edk2.groups.io>>;=20 > jbrasen@nvidia.com > Cc: Ashish Singhal=20 > ingha@nvidia.com%3cmailto:ashishsingha@nvidia.com>>>; Laszlo Ersek=20 > cmailto:lersek@redhat.com>>>; Ni, Ray=20 > ilto:ray.ni@intel.com>>>; Wang, Jian J=20 > @intel.com%3cmailto:jian.j.wang@intel.com>>>; Wu, Hao A=20 > m%3cmailto:hao.a.wu@intel.com>>>; Gao, Zhichao=20 > @intel.com%3cmailto:zhichao.gao@intel.com>>>; Kinney, Michael D=20 > ichael.d.kinney@intel.com%3cmailto:michael.d.kinney@intel.com>>> > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration > > > > > > > > On Nov 5, 2019, at 7:34 PM, Jeff Brasen >> wrot= e: > > > > Wouldn't having a variable that we create and delete on every boot put u= nnecessary stress on the SPI-NOR that the variable store lives on? > What about the alternative approach where we allow the platform code to = modify the attributes of the auto created variable to disable it with hidde= n/!active but still match for detection purposes so that it doesn't delete = and recreate the modified variable each boot? That way all the logic on wha= t to disable can still be in the platform code and all the existing logic i= n the boot manager can stay basically the same? > > What changes every boot that forces the variable to need to get modified= ? > > I would assume the NOR driver is smart enough to not update a variable t= hat is not changing. > > The custom BDS could could only create the variable for this device if i= t does not exist. > > [JB] The current flow with no changes in the boot manager would be as=20 > follows > > > > 1. Scan for instance of the boot option in the variables > 2. It will not be found, so create a new boot option store it to a va= riable and update BootOrder > 3. Platform code runs creates the options for the boot option it want= s and writes those to variable store > 4. Delete/disable the boot option in the variable store > > > > When you reboot it won't find the variable so 1/2/4 will re-occur > > > > The code that does this (1/2) is EfiBootManagerRefreshAllBootOption in= =20 > BmBoot.c > > > > If you modify the variable to disable it with hidden/not active it would= delete that and create a new one as well as the code wouldn't recognize th= at is the same boot option. > > > > If however we modify EfiBootManagerFindLoadOption to not compare the att= ributes (at least allow for differences in active and hidden) then the when= it refreshes every thing it would see the match and not delete/create a ne= w variable in the store and thus we wouldn't have changes every boot. > > > > > > Jeff, > > > > Sorry if I'm a little off on the sequence of things as the platform I wo= rk on day to day has a custom BDS and does not use this library..... I thou= gh the patch changed BmEnumerateBootOptions(), so that is going to change h= ow EfiBootManagerRefreshAllBootOption() works. I'd also point out the patch= as given is invalid as it changed the behavior of the public library API f= or EfiBootManagerRefreshAllBootOption() [1] so for the patch to be valid it= would need to change the comments to reflect the new behavior. This is kin= d of what Laszlo's technical debt comment was about. > > > > I think Laszlo advocated having the BDS platform specific code make sure= the boot variables are in the correct state. That should happen before the= Boot Manager code runs, and it is not clear to me why the Boot Manager co= uld would need to run if you have a valid EFI nvram variable to boot from. > > > > I think the question is how is your use case different than the boot var= iable that Windows installs? If it works kind of the same way then the answ= er is to have the BDS platform specific code write the boot variable. > > > > > > [1] > > /** > > The function creates boot options for all possible bootable medias in = the following order: > > 1. Removable BlockIo - The boot option only points to the r= emovable media > > device, like USB key, DVD, Floppy et= c. > > 2. Fixed BlockIo - The boot option only points to a Fix= ed blockIo device, > > like HardDisk. > > 3. Non-BlockIo SimpleFileSystem - The boot option points to a device= =20 > supporting > > SimpleFileSystem Protocol, but not= =20 > supporting BlockIo > > protocol. > > 4. LoadFile - The boot option points to the media = supporting > > LoadFile protocol. > > Reference: UEFI Spec chapter 3.3 Boot Option Variables Default Boot=20 > Behavior > > > > The function won't delete the boot option not added by itself. > > **/ > > VOID > > EFIAPI > > EfiBootManagerRefreshAllBootOption ( > > VOID > > ); > > > > Thanks, > > > > Andrew Fish > > > > Thanks, > > Andrew Fish > > Thanks, > > Jeff > > ________________________________ > > This email message is for the sole use of the intended recipient(s) and = may contain confidential information. Any unauthorized review, use, disclo= sure or distribution is prohibited. If you are not the intended recipient,= please contact the sender by reply email and destroy all copies of the ori= ginal message. > > ________________________________ > > >