From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from nwk-aaemail-lapp01.apple.com (nwk-aaemail-lapp01.apple.com [17.151.62.66]) by mx.groups.io with SMTP id smtpd.web10.514.1572934544761959764 for ; Mon, 04 Nov 2019 22:15:45 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=WWGwYI3u; spf=pass (domain: apple.com, ip: 17.151.62.66, mailfrom: afish@apple.com) Received: from pps.filterd (nwk-aaemail-lapp01.apple.com [127.0.0.1]) by nwk-aaemail-lapp01.apple.com (8.16.0.27/8.16.0.27) with SMTP id xA56CTCS045171; Mon, 4 Nov 2019 22:15:43 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=sender : from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=Cqw2d3quhcKkKS2qEE5SwlAAjegamaPQMypS+bdlJco=; b=WWGwYI3uYWyxBnGgvZPy4YhY0KoZz9MHO96BnXAYo7KHhzU6Lh6n5IiwuttD85HiT+Oq 4EVLxm2aRsGDM7jPNKh5f3HJkVeIGhfaWWAuXzDzGVzMlHHA3MYSq/EXzHjDcHnmNTmI FsRMVtPgJTa3BHeBmCf2A9GMb4woqzv4h/bdaRunUgXABeMyynzENoZC9sLLMlAxu03T M+GpeR6Sdf6XZqidUvkV8opr8o1ygi769OxlmuXNMZiNvBpYeVJ8xCXzqjAPChs14oPI fWcLMIXVv0THyQaUXGrD3Tw/OVM5ywMSrOJF9twvNp3nW3pNgiC/YbdzEHquctiaS23g FQ== Received: from ma1-mtap-s02.corp.apple.com (ma1-mtap-s02.corp.apple.com [17.40.76.6]) by nwk-aaemail-lapp01.apple.com with ESMTP id 2w18r89983-6 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 04 Nov 2019 22:15:43 -0800 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by ma1-mtap-s02.corp.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPS id <0Q0H001DZG25BB90@ma1-mtap-s02.corp.apple.com>; Mon, 04 Nov 2019 22:15:41 -0800 (PST) Received: from process_milters-daemon.nwk-mmpp-sz09.apple.com by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) id <0Q0H00100FY8FQ00@nwk-mmpp-sz09.apple.com>; Mon, 04 Nov 2019 22:15:41 -0800 (PST) X-V-A: X-V-T-CD: e1119bc19f8d105617641102bcecd1ce X-V-E-CD: be490e393b9a0fc46442780b7330e634 X-V-R-CD: 080c83ebb59fdc40182a21f863857514 X-V-CD: 0 X-V-ID: 3fbfe7b5-fe00-49d7-bd0d-8aa763e365aa X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-05_01:,, signatures=0 Received: from [17.235.75.204] (unknown [17.235.75.204]) by nwk-mmpp-sz09.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPSA id <0Q0H00CWYG1XYVB0@nwk-mmpp-sz09.apple.com>; Mon, 04 Nov 2019 22:15:34 -0800 (PST) Sender: afish@apple.com From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration Date: Tue, 05 Nov 2019 00:15:32 -0600 In-reply-to: Cc: "devel@edk2.groups.io" , "Ni, Ray" , Laszlo Ersek , "Wang, Jian J" , "Wu, Hao A" , "Gao, Zhichao" , Mike Kinney To: Ashish Singhal References: <1b91c052-f64c-1dca-98ff-a2777afd7f77@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5C34F98A@SHSMSX104.ccr.corp.intel.com> <6766B443-E14A-4F57-984E-5A865FB22CC9@apple.com> X-Mailer: Apple Mail (2.3594.4.17) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-11-05_01:,, signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_55387461-D0B3-420D-BE9E-C3448E1A26CC" --Apple-Mail=_55387461-D0B3-420D-BE9E-C3448E1A26CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Nov 4, 2019, at 11:42 PM, Ashish Singhal wr= ote: >=20 > Hi Andrew, > > I have a use case where I install Load File protocol on a handle and wan= t to expose that as a boot option through platform boot manager driver as I= need it to have a custom description and custom option data along with it.= This is the reason I submitted this patch so that someone can keep using e= dk2 uefi boot manager library and not expose a boot option if desired using= this new protocol. In my use case, I use the load file protocol to be able= to load kernel packaged in a proprietary manner for my platform and want t= o use custom optional data to provide kernel command line and custom descri= ption to identify the boot option. > > Please suggest the best way for this and I would make necessary changes = at my end. > Ashish, Can you just have the BDS add the boot variable with the extra info you ne= ed? That way it would be handled in the BM lib as an existing nvram variabl= e? You could also edit any existing variables that point to your Load File = to make sure they follow the rules you care about?=20 It is legal from an UEFI spec point of view for a platform to edit the nvr= am boot variables based on platform boot policy.=20 Thanks, Andrew Fish > Thanks > Ashish > > From: afish@apple.com =20 > Sent: Monday, November 4, 2019 10:22 PM > To: Ashish Singhal > Cc: devel@edk2.groups.io; Ni, Ray ; Laszlo Ersek ; Wang, Jian J ; Wu, Hao A ; Gao, Zhichao ; Mike Kinney > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumerat= ion > > Ashish, > > Just to be clear on your definition of enumerate. In this case it means = the Boot Manager lib that is just one of may implementations a platform cou= ld use to manage its boot options. 3rd party code, or an OS boot loader cou= ld try to boot your handle since by definition of the UEFI spec it is a boo= table device.=20 > > The simple answer is if you don't want your device to boot in normal cas= es, then don't add a Load File Protocol to your handle? What problem are yo= u trying to solve? > > gBS->LoadImage () supports an optional Source Buffer so you can just add= a custom protocol and call your protocol to get a memory buffer and then j= ust pass that buffer into gBS->LoadImage ()? > > Thanks, > > Andrew Fish >=20 >=20 > On Nov 4, 2019, at 11:06 PM, Ashish Singhal > wrote: > > Hello Andrew, > > On my platform, I am installing Load File protocol on a handle which I d= o not want to be auto enumerated by boot manager. In order to achieve this,= I submitted this match on edk2 side and have installed gEdkiiSkipBmAutoEnu= merateProtocolGuid on the same handle to achieve this on platform side. If = there is a different way to achieve what I am trying to do, please let me k= now and I would be happy to adopt that. > > Thanks > Ashish > > From: afish@apple.com >=20 > Sent: Monday, November 4, 2019 10:01 PM > To: devel@edk2.groups.io ; Ashish Singhal <= ashishsingha@nvidia.com > > Cc: Ni, Ray >; Laszlo Ersek <= lersek@redhat.com >; Wang, Jian J >; Wu, Hao A >; Gao, Zhichao >; Mike Kinney > > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumerat= ion > > On Nov 4, 2019, at 9:24 PM, Ashish Singhal > wrote: > > Hi Ray, >=20 > I did not see any example with which one can tell BDS not to enumerate a= boot option. Can you please point me to an example where a protocol (Block= IO, Simple FS or Load File) does not get enumerated as a boot option? >=20 >=20 > > Ashish, > > Are you asking for example code, or reasons that you would not want to e= numerate something as bootable?=20 > > Most likely if you want to have a platform policy to add gEdkiiSkipBmAut= oEnumerateProtocolGuid you are going to need an EFI Driver Model driver to = add it to the handle based on some platform policy. This is the only way yo= u can filter based on things getting connected at different times during bo= ot.=20 > > Thanks, > > Andrew Fish > >=20 >=20 >=20 > Thanks > Ashish >=20 > -----Original Message----- > From: Ni, Ray >=20 > Sent: Monday, November 4, 2019 7:42 PM > To: Laszlo Ersek >; devel@e= dk2.groups.io ; Ashish Singhal >; Wang, Jian J >; Wu, Hao A >; Gao, Zhichao > > Cc: Kinney, Michael D > > Subject: RE: [edk2-devel] [PATCH] Support skipping automatic BM enumerat= ion >=20 > + Mike >=20 > With the UEFI driver model, if a device is not needed by booting, it can= skip the connecting. > Then I do not see a need of the new protocol. >=20 > Thanks, > Ray >=20 >=20 >=20 > -----Original Message----- > From: Laszlo Ersek > > Sent: Thursday, October 31, 2019 6:15 PM > To: devel@edk2.groups.io ; ashishsingha@nvi= dia.com ; Wang, Jian J=20 > >; Wu, Hao A >; Ni, Ray=20 > >; Gao, Zhichao > > Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM=20 > enumeration >=20 > +Ray, +Zhichao >=20 > (although, the actual patch seems to be missing from the posting) >=20 > Thanks > Laszlo >=20 > On 10/30/19 04:47, Ashish Singhal wrote: >=20 >=20 > Right now, any and every handle with a BlockIO or SimpleFileSystem=20 > or LoadFile protocol installed on the system is used to enumerate BM=20 > automatically. There may be cases where on a platform, some of these=20 > are not desirable to be enumerated automatically. This patch adds=20 > support for skipping this automatic enumeration if on the same=20 > handle, a new protocol defined as EdkiiSkipBmAutoEnumerate is found=20 > to be > installed. >=20 >=20 >=20 > Ashish Singhal (1): > MdeModulePkg/UefiBootManagerLib: Support skipping BM enumeration >=20 > .../Include/Protocol/SkipBmAutoEnumerate.h | 25 ++++++++++++++ > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 40 > +++++++++++++++++++++- >=20 >=20 > .../Library/UefiBootManagerLib/InternalBm.h | 1 + > .../UefiBootManagerLib/UefiBootManagerLib.inf | 1 + > MdeModulePkg/MdeModulePkg.dec | 3 ++ > 5 files changed, 69 insertions(+), 1 deletion(-) create mode=20 > 100644 MdeModulePkg/Include/Protocol/SkipBmAutoEnumerate.h >=20 >=20 >=20 > ------------------------------------------------------------------------= ----------- > This email message is for the sole use of the intended recipient(s) and = may contain > confidential information. Any unauthorized review, use, disclosure or d= istribution > is prohibited. If you are not the intended recipient, please contact th= e sender by > reply email and destroy all copies of the original message. > ------------------------------------------------------------------------= ----------- >=20 >=20 --Apple-Mail=_55387461-D0B3-420D-BE9E-C3448E1A26CC Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii
On Nov 4,= 2019, at 11:42 PM, Ashish Singhal <ashishsingha@nvidia.com> wrote:

Hi Andr= ew,
=  
I have a use case where I ins= tall Load File protocol on a handle and want to expose that as a boot optio= n through platform boot manager driver as I need it to have a custom descri= ption and custom option data along with it. This is the reason I submitted = this patch so that someone can keep using edk2 uefi boot manager library an= d not expose a boot option if desired using this new protocol. In my use ca= se, I use the load file protocol to be able to load kernel packaged in a pr= oprietary manner for my platform and want to use custom optional data to pr= ovide kernel command line and custom description to identify the boot optio= n.
&= nbsp;
Please suggest the best way fo= r this and I would make necessary changes at my end.<= /div>
 

Ashish,

Can you just have the BDS add the boot variable with the = extra info you need? That way it would be handled in the BM lib as an exist= ing nvram variable? You could also edit any existing variables that point t= o your Load File to make sure they follow the rules you care about? 

It is legal from an UEFI spec point of v= iew for a platform to edit the nvram boot variables based on platform boot = policy. 

Thanks,

Andrew Fish


Thanks
Ashish=
&nb= sp;
From: afish@apple.com <afish@apple.com>=  
Sent: Monday, November 4, 2019 10:22 PM
= To: Ash= ish Singhal <ashis= hsingha@nvidia.com>
Cc: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>; Wang,= Jian J <jian.j.wang= @intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>; Mike Kinney &l= t;michael.d.kinney= @intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skippin= g automatic BM enumeration
 
Ashish,
 
Just to be clear on your definition of enumerate. In th= is case it means the Boot Manager lib that is just one of may implementatio= ns a platform could use to manage its boot options. 3rd party code, or an O= S boot loader could try to boot your handle since by definition of the UEFI= spec it is a bootable device. 
 
The simple answer is if you= don't want your device to boot in normal cases, then don't add a Load File= Protocol to your handle? What problem are you trying to solve?
 
gBS->LoadImage () supports an optional Source Buffer so you can just = add a custom protocol and call your protocol to get a memory buffer and the= n just pass that buffer into gBS->LoadImage ()?
&= nbsp;
Thanks,<= o:p class=3D"">
 
Andrew Fish


On Nov 4, 2019, at 11:06 PM, Ashis= h Singhal <ashishsingha@nvidia.com&g= t; wrote:
 
Hello Andrew,
 
On my platform, I am installing Loa= d File protocol on a handle which I do not want to be auto enumerated by bo= ot manager. In order to achieve this, I submitted this match on edk2 side a= nd have installed gEdkiiSkipBmAutoEnumerateProtocolGuid on the same handle = to achieve this on platform side. If there is a different way to achieve wh= at I am trying to do, please let me know and I would be happy to adopt that= .
 
Thanks
=
Ashish
 
From:=  = afish@apple.com <<= a href=3D"mailto:afish@apple.com" style=3D"color: purple; text-decoration: = underline;" class=3D"">afish@apple.com> 
Sent: Monday, November 4, 2019 10:01 PM
To: <= /span>devel@edk2.groups.io; Ashish Singhal= <ashishsingha@nvidia.com>
Cc: Ni, Ray <ray.ni@intel.com>; Laszlo = Ersek <lersek@redhat.com>; Wang, Jian J= <jian.j.wang@intel.com>; Wu, Hao A= <hao.a.wu@intel.com>; Gao, Zhichao &l= t;zhichao.gao@intel.com>; Mike Kinney = <michael.d.kinney@intel.com>Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enume= ration
 
On Nov 4, 2019, at 9:24 PM, Ashish Singhal <ashishsingha@nv= idia.com> wrote:
 
Hi Ray= ,

I did not see any example with which one can= tell BDS not to enumerate a boot option. Can you please point me to an exa= mple where a protocol (Block IO, Simple FS or Load File) does not get enume= rated as a boot option?


=
 
Ashish= ,
 
Are you asking for= example code, or reasons that you would not want to enumerate something as= bootable? 
 
=
Mos= t likely if you want to have a platform policy to add gEdkiiSkipBmAuto= EnumerateProtocolGuid you are going to need an EFI Driver Model driver to a= dd it to the handle based on some platform policy. This is the only way you= can filter based on things getting connected at different times during boo= t. 
 
=
Thanks,
 
Andrew Fish
 



Thanks
Ashish

-----Original Message-----
From: Ni, Ray <
ray.ni@intel.com&g= t; 
Sent: M= onday, November 4, 2019 7:42 PM
To: Laszlo Ersek <
<= a href=3D"mailto:lersek@redhat.com" style=3D"color: purple; text-decoration= : underline;" class=3D"">lersek@redhat.com>; devel@edk2.groups.io; A= shish Singhal <ashishsingha@nvidia.com>; Wang, Jian J <= jian.j.wang@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Gao, Zhichao <zhichao.gao@intel.com<= /a>>
Cc: Kinney, Michael D <
michael.d.kinney@intel.com= >
Subject: RE: [edk2-devel] [PATCH] Support skippin= g automatic BM enumeration

+ Mike

With the UEFI driver model, if a device is not needed by b= ooting, it can skip the connecting.
Then I do not see a need = of the new protocol.

Thanks,
Ray=



-----O= riginal Message-----
From: Laszlo Ersek <lersek@redhat.com= >
Sent: Thursday, October 31, 2019 6:15 PM
To: devel@edk2.groups.io; ashishsingha@nv= idia.com; Wang, Jian J&nbs= p;
<jian.j.wang@intel.com>; Wu, Hao A = <ha= o.a.wu@intel.com>; Ni, Ray 
<ray.ni@intel.com>; Gao, Zhichao &l= t;z= hichao.gao@intel.com>
Subject: Re: [edk2-devel]= [PATCH] Support skipping automatic BM 
enumeration

+Ray,= +Zhichao

(although, the actual patch seems to= be missing from the posting)

Thanks
Laszlo

On 10/30/19 04:47, Ashish Singha= l wrote:


Right now, an= y and every handle with a BlockIO or SimpleFileSystem 
or LoadFile protocol installed = on the system is used to enumerate BM=  
automatically. There may be cases where on a pl= atform, some of these are not desirable to be enumerated automatically. This patch ad= ds 
support= for skipping this automatic enumeration if on the same 
handle, a new protocol define= d as EdkiiSkipBmAutoEnumerate is found 
to be
=
installed.



Ashish Sin= ghal (1):
 MdeModulePkg/UefiBootManagerLib: Support skip= ping BM enumeration

.../Include/Protocol/SkipB= mAutoEnumerate.h         | 25 +++++= +++++++++
MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c &n= bsp; | 40
+++++++++++++++++++++-


<= blockquote style=3D"margin-top: 5pt; margin-bottom: 5pt;" class=3D"">

.../Library/UefiBootManagerLib/InternalBm.h &n= bsp;      |  1 +
.../UefiB= ootManagerLib/UefiBootManagerLib.inf      |  = 1 +
MdeModulePkg/MdeModulePkg.dec     &nb= sp;            =     |  3 ++
5 files changed, 69 inse= rtions(+), 1 deletion(-)  create mode 
100644 MdeModulePkg/Include/Protocol/SkipB= mAutoEnumerate.h

=


------------------------------------------------------------------------= -----------
This email message is for the sole use of the int= ended recipient(s) and may contain
confidential information. =  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contac= t the sender by
reply email and destroy all copies of the ori= ginal message.
----------------------------------------------= -------------------------------------

<= /div>

--Apple-Mail=_55387461-D0B3-420D-BE9E-C3448E1A26CC--