]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/Core/Dxe: Remove extra connects for UEFI Applications
authorMichael D Kinney <michael.d.kinney@intel.com>
Tue, 7 Nov 2017 00:57:36 +0000 (16:57 -0800)
committerMichael D Kinney <michael.d.kinney@intel.com>
Mon, 13 Nov 2017 17:56:49 +0000 (09:56 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=765

The UEFI Specification Boot Services chapter, StartImage() service,
EFF 1.10 Extension requires extra calls to ConnectController()
if a UEFI Driver produces handles. The DXE Core is performing these
extra calls to ConnectController() without evaluating the ImageType.

A filter is added to not make extra calls to ConnectController()
if the ImageType is EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION.

Without this filter, extra calls to ConnectController() may be
performed by UEFI Applications or a UEFI Shell Applications that
also call ConnectController().

Cc: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
MdeModulePkg/Core/Dxe/Image/Image.c

index 4e22aa6dc7e39506a6ae6bc49ab64b70b7100fbb..c49ddfcc81d16cae42ff0f315dfe8fc405c8d6bf 100644 (file)
@@ -1703,9 +1703,17 @@ CoreStartImage (
   mCurrentImage = LastImage;\r
 \r
   //\r
-  // Go connect any handles that were created or modified while the image executed.\r
+  // UEFI Specification - StartImage() - EFI 1.10 Extension\r
+  // To maintain compatibility with UEFI drivers that are written to the EFI\r
+  // 1.02 Specification, StartImage() must monitor the handle database before\r
+  // and after each image is started. If any handles are created or modified\r
+  // when an image is started, then EFI_BOOT_SERVICES.ConnectController() must\r
+  // be called with the Recursive parameter set to TRUE for each of the newly\r
+  // created or modified handles before StartImage() returns.\r
   //\r
-  CoreConnectHandlesByKey (HandleDatabaseKey);\r
+  if (Image->Type != EFI_IMAGE_SUBSYSTEM_EFI_APPLICATION) {\r
+    CoreConnectHandlesByKey (HandleDatabaseKey);\r
+  }\r
 \r
   //\r
   // Handle the image's returned ExitData\r