From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web10.202.1572931315864373542 for ; Mon, 04 Nov 2019 21:21:56 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=NEnB7QXi; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.27/8.16.0.27) with SMTP id xA55Lf9i017792; Mon, 4 Nov 2019 21:21:54 -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=7JIQRyGM9caX/JmEf2MzMWpzfJUq9Hxig9m37nPYln4=; b=NEnB7QXiN7o7OAG5k8bHCQKVeTBPNF5YGsJnwD2tFgkbdi0HeSiXfZaVtWb+NZzlFBSa AJKzu0JgwfmXeA63w73O9fpy5tehA8EElfxr3givKaZeByuGCtG9f9IPqEVJOd933dRn hwvZFZy1/hjJzZYxl48BRjbs+M708XFoDX76wkFbPmScZgFHXOSLvrk4XwnX4E8j4MO2 8sn8ty+WL5WF8sfLLgBXZUgPiayYX3QEysyyUpm1MAF1vqcbECOqYkyFQqADTXHcAQAz BMGAHEkHM3NxoZiy0JmiMOvf7KD9gc7q2PInBOO8/zso4Qs/lBt56TgPQxZtdE4UqM9C UQ== Received: from ma1-mtap-s01.corp.apple.com (ma1-mtap-s01.corp.apple.com [17.40.76.5]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 2w18svrdt1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Mon, 04 Nov 2019 21:21:54 -0800 Received: from nwk-mmpp-sz09.apple.com (nwk-mmpp-sz09.apple.com [17.128.115.80]) by ma1-mtap-s01.corp.apple.com (Oracle Communications Messaging Server 8.0.2.4.20190507 64bit (built May 7 2019)) with ESMTPS id <0Q0H00450DKFTN70@ma1-mtap-s01.corp.apple.com>; Mon, 04 Nov 2019 21:21:54 -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 <0Q0H00B00DJD1600@nwk-mmpp-sz09.apple.com>; Mon, 04 Nov 2019 21:21:53 -0800 (PST) X-Va-A: X-Va-T-CD: e1119bc19f8d105617641102bcecd1ce X-Va-E-CD: be490e393b9a0fc46442780b7330e634 X-Va-R-CD: 080c83ebb59fdc40182a21f863857514 X-Va-CD: 0 X-Va-ID: d395b1c4-d5c8-4d25-ac56-d00cc80f0db5 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: 99383c68-46c4-4721-aa0d-6ff533771b99 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 <0Q0H00N4QDKE29A0@nwk-mmpp-sz09.apple.com>; Mon, 04 Nov 2019 21:21:52 -0800 (PST) Sender: afish@apple.com From: "Andrew Fish" Message-id: <6766B443-E14A-4F57-984E-5A865FB22CC9@apple.com> MIME-version: 1.0 (Mac OS X Mail 13.0 \(3594.4.17\)) Subject: Re: [edk2-devel] [PATCH] Support skipping automatic BM enumeration Date: Mon, 04 Nov 2019 23:21:49 -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> 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=_E51F3EBA-931F-4FBD-8DC4-8A7950BF6C2B" --Apple-Mail=_E51F3EBA-931F-4FBD-8DC4-8A7950BF6C2B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Ashish, Just to be clear on your definition of enumerate. In this case it means th= e Boot Manager lib that is just one of may implementations a platform could= use to manage its boot options. 3rd party code, or an OS boot loader could= try to boot your handle since by definition of the UEFI spec it is a boota= ble device.=20 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 then jus= t pass that buffer into gBS->LoadImage ()? Thanks, Andrew Fish > On Nov 4, 2019, at 11:06 PM, Ashish Singhal wr= ote: >=20 > 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 > Cc: Ni, Ray ; Laszlo Ersek ; Wang, = Jian J ; Wu, Hao A ; Gao, Zhicha= o ; 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 > > 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 > 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 > -----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 > 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 > Ashish Singhal (1): > MdeModulePkg/UefiBootManagerLib: Support skipping BM enumeration >=20 > .../Include/Protocol/SkipBmAutoEnumerate.h | 25 ++++++++++++++ > MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c | 40 > +++++++++++++++++++++- >=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=_E51F3EBA-931F-4FBD-8DC4-8A7950BF6C2B Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Ashish,

Just to be clear on your definition o= f enumerate. In this case it means the Boot Manager lib that is just one of= may implementations a platform could use to manage its boot options. 3rd p= arty code, or an OS boot loader could try to boot your handle since by defi= nition of the UEFI spec it is a bootable device. 

The simple answer is if you don't wan= t 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 optio= nal Source Buffer so you can just add a custom protocol and call your proto= col to get a memory buffer and then just pass that buffer into gBS->= ;LoadImage ()?

Th= anks,

Andrew Fish=

On Nov 4, 2019, at 11:06 PM, Ashish Singhal <ashishsingha@nvidia.com> wro= te:

Hello Andrew,
 
= On my platform, I am installing Load File protocol on a handle which I do n= ot want to be auto enumerated by boot manager. In order to achieve this, I = submitted this match on edk2 side and have installed gEdkiiSkipBmAutoEnumer= ateProtocolGuid on the same handle to achieve this on platform side. If the= re is a different way to achieve what I am trying to do, please let me know= and I would be happy to adopt that.
 
Thanks
Ashish=
&nb= sp;
From: afish@apple.com <afish@apple.com>=  
Sent: Monday, November 4, 2019 10:01 PM
= To: devel@edk2.groups.io; A= shish Singhal <ash= ishsingha@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 <zhichao.gao@intel.com>; Mike Kinney <= ;michael.d.kinney@= intel.com>
Subject: Re: [edk2-devel] [PATCH] Support skipping= automatic BM enumeration
 
On Nov 4, = 2019, at 9:24 PM, Ashish Singhal <ashish= singha@nvidia.com> wrote:
 
Hi Ray,

I did not se= e any example with which one can tell BDS not to enumerate a boot option. C= an 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?

 
=
Ashish,
 
Are you asking for example c= ode, or reasons that you would not want to enumerate something as bootable?=  
 
Most likely if you want to have a platform policy to add=  gEdkiiSkipBmAutoEnumerateProtocolGuid you are going to need an EFI Dr= iver Model driver to add it to the handle based on some platform policy. Th= is is the only way you can filter based on things getting connected at diff= erent times during boot. 
 
=
Thanks,
 = ;
Andrew Fish<= o:p class=3D"">
 


Thanks
Ashish

-----Original Message-----
From: Ni, Ray <
ray.ni@intel.com> 
Sent: Monday, Novem= ber 4, 2019 7:42 PM
To: Laszlo Ersek <
lersek@redhat.com>; devel= @edk2.groups.io; Ashish Singhal <ashishsingha@nvidia.com>; Wang, Jian J= <jian.j.wang@intel.com<= /a>>; Wu, Hao A <hao.a.wu@i= ntel.com>; Gao, Zhichao <zhichao.gao@intel.com>
Cc: Kinn= ey, Michael D <
michael.d.k= inney@intel.com>
Subject: RE: [edk2-devel] = [PATCH] Support skipping automatic BM enumeration

+ Mike

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.

Thanks,
Ray


-----Original Message-----
From: Laszlo Ersek <lersek@redhat.c= om>
Sent: Thursday, October 31, 2019 6:15 PM
To: devel@edk2.groups.io; ashishsingha@nvidia.com= ; Wang, Jian J 
<jian.j.wang@intel.com>; Wu,= Hao A <hao.a.wu@intel.com>; Ni, Ray 

<ray.ni@intel.com>; Gao, Zhichao <zhichao.gao@intel.com>
Subject: Re: [= edk2-devel] [PATCH] Support skipping automatic BM 
enumeration

+Ray, +Zhichao

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

Than= ks
Laszlo

On 10/30/19 04:47, Ash= ish Singhal wrote:

Right now, any and every handle with a B= lockIO or SimpleFileSystem 
or LoadFile protocol installed on the system is used to en= umerate BM 
automatically. There may be cases where on a platform, some of these 
are not desirab= le to be enumerated automatically. This patch adds 
support for skipping this automati= c enumeration if on the same 
handle, a new protocol defined as EdkiiSkipBmAutoEnumera= te is found 
to be
installed.

<= /span>

Ashish Singhal (1): MdeModulePkg/UefiBootManagerLib: Support skipping BM enu= meration

.../Include/Protocol/SkipBmAutoEnumer= ate.h         | 25 ++++++++++++++MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c   |= 40
+++++++++++++++++++++-

.../Library/UefiBoo= tManagerLib/InternalBm.h        |  = 1 +
.../UefiBootManagerLib/UefiBootManagerLib.inf   = ;   |  1 +
MdeModulePkg/MdeModulePkg.dec =             &nb= sp;        |  3 ++
5 files changed, 69 insertions(+), 1 deletion(-)  create mode 
100644 MdeModul= ePkg/Include/Protocol/SkipBmAutoEnumerate.h


<= br class=3D"">-------------------------------------------------------------= ----------------------
This email message is for the sole use= of the intended recipient(s) and may contain
confidential in= formation.  Any unauthorized review, use, disclosure or distributionis prohibited.  If you are not the intended recipient, pl= ease contact the sender by
reply email and destroy all copies= of the original message.
-----------------------------------= ------------------------------------------------


--Apple-Mail=_E51F3EBA-931F-4FBD-8DC4-8A7950BF6C2B--