[edk2-devel] [PATCH 1/1] ShellPkg: Do not connect handles without device paths

Ni, Ray ray.ni at intel.com
Mon Jan 13 11:56:58 UTC 2020


We shouldn't assume that a DriverBindingStart() can only start on a handle with device path installed. DevicePath protocol is just a special protocol.
It's possible that a bus driver starts on a host controller handle and creates multiple children, each with only a Specific_IO protocol installed.
Certain device driver can start on the children handle and open the Specific_IO protocol BY_DRIVER.
I am not sure if certain today's network drivers may work like this. It's allowed per UEFI spec.

Thanks,
Ray

> -----Original Message-----
> From: vit9696 <vit9696 at protonmail.com>
> Sent: Monday, January 13, 2020 5:20 PM
> To: Gao, Zhichao <zhichao.gao at intel.com>
> Cc: devel at edk2.groups.io; Ni, Ray <ray.ni at intel.com>
> Subject: Re: [edk2-devel] [PATCH 1/1] ShellPkg: Do not connect handles without device paths
> 
> Hi,
> 
> ‘Freeze’ means it is hung up forever, and we believe it is caused by an invalid memory access in the firmware code.
> 
> Using loading command with ‘-nc’ (no connect) will work fine, but that is kind of expected, as the issue is caused exactly by
> the connect logic.
> 
> We do not believe it is possible for device controller to exist without a device path protocol in the wild. Would you please
> provide an example? If there is something we do not know about, I can imagine introducing a PCD for this logic.
> 
> Best wishes,
> Vitaly
> 
> > 13 янв. 2020 г., в 11:11, Gao, Zhichao <zhichao.gao at intel.com> написал(а):
> >
> >
> > Hi,
> >
> > What does 'freeze' mean? System blocked for a while or it hung up forever?
> >
> > The change would affect the operation of the 'load' command. If some drivers need to connect to the device controller
> but it doesn't have a device path protocol, the behavior of 'load' may be incorrect.
> > Is the option '-nc' working for your request?
> >
> > Thanks,
> > Zhichao
> >
> >> -----Original Message-----
> >> From: devel at edk2.groups.io [mailto:devel at edk2.groups.io] On Behalf Of
> >> Vitaly Cheptsov via Groups.Io
> >> Sent: Monday, January 13, 2020 5:39 AM
> >> To: devel at edk2.groups.io
> >> Subject: [edk2-devel] [PATCH 1/1] ShellPkg: Do not connect handles without
> >> device paths
> >>
> >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2460
> >>
> >> Doing this reduces the amount of needless work during device connection
> >> and resolves issues with firmwares that freeze when connecting handles
> >> without device paths.
> >>
> >> Signed-off-by: Vitaly Cheptsov <vit9696 at protonmail.com>
> >> ---
> >> ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c | 4 ++--
> >> 1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
> >> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
> >> index b6e7c952fa..083aac0dba 100644
> >> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
> >> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Load.c
> >> @@ -32,8 +32,8 @@ ConnectAllEfi (
> >>   UINTN       Index;
> >>
> >>   Status = gBS->LocateHandleBuffer (
> >> -                  AllHandles,
> >> -                  NULL,
> >> +                  ByProtocol,
> >> +                  &gEfiDevicePathProtocolGuid,
> >>                   NULL,
> >>                   &HandleCount,
> >>                   &HandleBuffer
> >> --
> >> 2.21.0 (Apple Git-122.2)
> >>
> >>
> >> -=-=-=-=-=-=
> >> Groups.io Links: You receive all messages sent to this group.
> >>
> >> View/Reply Online (#53170): https://edk2.groups.io/g/devel/message/53170
> >> Mute This Topic: https://groups.io/mt/69653841/1768756
> >> Group Owner: devel+owner at edk2.groups.io
> >> Unsubscribe: https://edk2.groups.io/g/devel/unsub
> >> [zhichao.gao at intel.com]
> >> -=-=-=-=-=-=
> >


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#53188): https://edk2.groups.io/g/devel/message/53188
Mute This Topic: https://groups.io/mt/69653841/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list