]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1) Change location of DEBUG() macro that prints the name of the FFS file being evalua...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Dec 2010 21:55:14 +0000 (21:55 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Mon, 6 Dec 2010 21:55:14 +0000 (21:55 +0000)
2) Change location of DEBUG() macro that prints the name of the FFS file being evaluated by the SMM Dispatcher to eliminate a duplicate print.
3) Remove all references and processing of SOR from the PiSmmCore.  Treat use of SOR in the dependency expression of an SMM Driver as an invalid depex opcode.
4) Remove all references for an SMM Driver being in the "Untrusted" state from the PiSmmCore.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11127 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Core/Dxe/Dispatcher/Dependency.c
MdeModulePkg/Core/PiSmmCore/Dependency.c
MdeModulePkg/Core/PiSmmCore/Dispatcher.c
MdeModulePkg/Core/PiSmmCore/PiSmmCore.h

index 0ec9690890a2121bcd2b48698aceb445786efa35..1d8a57b87984f655cbbfa0c6620efce1885b2579 100644 (file)
@@ -220,8 +220,6 @@ CoreIsSchedulable (
   EFI_GUID    DriverGuid;\r
   VOID        *Interface;\r
 \r
-  DEBUG ((DEBUG_DISPATCH, "Evaluate DXE DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
-\r
   Operator = FALSE;\r
   Operator2 = FALSE;\r
 \r
@@ -233,6 +231,8 @@ CoreIsSchedulable (
     return FALSE;\r
   }\r
 \r
+  DEBUG ((DEBUG_DISPATCH, "Evaluate DXE DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
+\r
   if (DriverEntry->Depex == NULL) {\r
     //\r
     // A NULL Depex means treat the driver like an UEFI 2.0 thing.\r
index 4bf8502cf8be7aac6e9a3d15c1ab72fefc777bb7..44f693ac83ad25216b9a9baf2117ff986fec4f88 100644 (file)
@@ -161,8 +161,7 @@ PopBool (
 /**\r
   This is the POSTFIX version of the dependency evaluator.  This code does\r
   not need to handle Before or After, as it is not valid to call this\r
-  routine in this case. The SOR is just ignored and is a nop in the grammer.\r
-  POSTFIX means all the math is done on top of the stack.\r
+  routine in this case. POSTFIX means all the math is done on top of the stack.\r
 \r
   @param  DriverEntry           DriverEntry element to update.\r
 \r
@@ -183,8 +182,6 @@ SmmIsSchedulable (
   EFI_GUID    DriverGuid;\r
   VOID        *Interface;\r
 \r
-  DEBUG ((DEBUG_DISPATCH, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
-  \r
   Operator = FALSE;\r
   Operator2 = FALSE;\r
 \r
@@ -196,6 +193,8 @@ SmmIsSchedulable (
     return FALSE;\r
   }\r
 \r
+  DEBUG ((DEBUG_DISPATCH, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
+  \r
   if (DriverEntry->Depex == NULL) {\r
     //\r
     // A NULL Depex means that the SMM driver is not built correctly.  \r
@@ -239,21 +238,6 @@ SmmIsSchedulable (
       //\r
       DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Unexpected BEFORE or AFTER opcode)\n"));\r
       ASSERT (FALSE);\r
-    case EFI_DEP_SOR:\r
-      //\r
-      // These opcodes can only appear once as the first opcode.  If it is found\r
-      // at any other location, then the dependency expression evaluates to FALSE\r
-      //\r
-      if (Iterator != DriverEntry->Depex) {\r
-        DEBUG ((DEBUG_DISPATCH, "  SOR\n"));\r
-        DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE (Unexpected SOR opcode)\n"));\r
-        return FALSE;\r
-      }\r
-      DEBUG ((DEBUG_DISPATCH, "  SOR                                             = Requested\n"));\r
-      //\r
-      // Otherwise, it is the first opcode and should be treated as a NOP.\r
-      //\r
-      break;\r
 \r
     case EFI_DEP_PUSH:\r
       //\r
index d83224e322aa33dd05394852f8bcd6df23a49087..3ed464e938399d982958b4f535070e5d48ee65cd 100644 (file)
@@ -2,7 +2,7 @@
   SMM Driver Dispatcher.\r
 \r
   Step #1 - When a FV protocol is added to the system every driver in the FV\r
-            is added to the mDiscoveredList. The SOR, Before, and After Depex are\r
+            is added to the mDiscoveredList. The Before, and After Depex are\r
             pre-processed as drivers are added to the mDiscoveredList. If an Apriori\r
             file exists in the FV those drivers are addeded to the\r
             mScheduledQueue. The mFvHandleList is used to make sure a\r
@@ -26,7 +26,6 @@
   is the state diagram for the DXE dispatcher\r
 \r
   Depex - Dependency Expresion.\r
-  SOR   - Schedule On Request - Don't schedule if this bit is set.\r
 \r
   Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available \r
@@ -644,10 +643,8 @@ SmmLoadImage (
 \r
 /**\r
   Preprocess dependency expression and update DriverEntry to reflect the\r
-  state of  Before, After, and SOR dependencies. If DriverEntry->Before\r
-  or DriverEntry->After is set it will never be cleared. If SOR is set\r
-  it will be cleared by SmmSchedule(), and then the driver can be\r
-  dispatched.\r
+  state of  Before and After dependencies. If DriverEntry->Before\r
+  or DriverEntry->After is set it will never be cleared. \r
 \r
   @param  DriverEntry           DriverEntry element to update .\r
 \r
@@ -662,11 +659,7 @@ SmmPreProcessDepex (
   UINT8  *Iterator;\r
 \r
   Iterator = DriverEntry->Depex;\r
-  if (*Iterator == EFI_DEP_SOR) {\r
-    DriverEntry->Unrequested = TRUE;\r
-  } else {\r
-    DriverEntry->Dependent = TRUE;\r
-  }\r
+  DriverEntry->Dependent = TRUE;\r
 \r
   if (*Iterator == EFI_DEP_BEFORE) {\r
     DriverEntry->Before = TRUE;\r
@@ -735,8 +728,8 @@ SmmGetDepexSectionAndPreProccess (
     }\r
   } else {\r
     //\r
-    // Set Before, After, and Unrequested state information based on Depex\r
-    // Driver will be put in Dependent or Unrequested state\r
+    // Set Before and After state information based on Depex\r
+    // Driver will be put in Dependent state\r
     //\r
     SmmPreProcessDepex (DriverEntry);\r
     DriverEntry->DepexProtocolError = FALSE;\r
@@ -745,54 +738,6 @@ SmmGetDepexSectionAndPreProccess (
   return Status;\r
 }\r
 \r
-/**\r
-  Check every driver and locate a matching one. If the driver is found, the Unrequested\r
-  state flag is cleared.\r
-\r
-  @param  FirmwareVolumeHandle  The handle of the Firmware Volume that contains\r
-                                the firmware  file specified by DriverName.\r
-  @param  DriverName            The Driver name to put in the Dependent state.\r
-\r
-  @retval EFI_SUCCESS           The DriverName was found and it's SOR bit was\r
-                                cleared\r
-  @retval EFI_NOT_FOUND         The DriverName does not exist or it's SOR bit was\r
-                                not set.\r
-\r
-**/\r
-EFI_STATUS\r
-SmmSchedule (\r
-  IN  EFI_HANDLE  FirmwareVolumeHandle,\r
-  IN  EFI_GUID    *DriverName\r
-  )\r
-{\r
-  LIST_ENTRY            *Link;\r
-  EFI_SMM_DRIVER_ENTRY  *DriverEntry;\r
-\r
-  //\r
-  // Check every driver\r
-  //\r
-  for (Link = mDiscoveredList.ForwardLink; Link != &mDiscoveredList; Link = Link->ForwardLink) {\r
-    DriverEntry = CR(Link, EFI_SMM_DRIVER_ENTRY, Link, EFI_SMM_DRIVER_ENTRY_SIGNATURE);\r
-    if (DriverEntry->FvHandle == FirmwareVolumeHandle &&\r
-        DriverEntry->Unrequested &&\r
-        CompareGuid (DriverName, &DriverEntry->FileName)) {\r
-      //\r
-      // Move the driver from the Unrequested to the Dependent state\r
-      //\r
-      DriverEntry->Unrequested  = FALSE;\r
-      DriverEntry->Dependent    = TRUE;\r
-\r
-      DEBUG ((DEBUG_DISPATCH, "Schedule FFS(%g) - EFI_SUCCESS\n", DriverName));\r
-\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-  \r
-  DEBUG ((DEBUG_DISPATCH, "Schedule FFS(%g) - EFI_NOT_FOUND\n", DriverName));\r
-  \r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
 /**\r
   This is the main Dispatcher for SMM and it exits when there are no more\r
   drivers to run. Drain the mScheduledQueue and load and start a PE\r
@@ -856,22 +801,11 @@ SmmDispatcher (
         // Update the driver state to reflect that it's been loaded\r
         //\r
         if (EFI_ERROR (Status)) {\r
-\r
-          if (Status == EFI_SECURITY_VIOLATION) {\r
-            //\r
-            // Take driver from Scheduled to Untrused state\r
-            //\r
-            DriverEntry->Untrusted = TRUE;\r
-          } else {\r
-            //\r
-            // The SMM Driver could not be loaded, and do not attempt to load or start it again.\r
-            // Take driver from Scheduled to Initialized.\r
-            //\r
-            // This case include the Never Trusted state if EFI_ACCESS_DENIED is returned\r
-            //\r
-            DriverEntry->Initialized  = TRUE;\r
-          }\r
-\r
+          //\r
+          // The SMM Driver could not be loaded, and do not attempt to load or start it again.\r
+          // Take driver from Scheduled to Initialized.\r
+          //\r
+          DriverEntry->Initialized  = TRUE;\r
           DriverEntry->Scheduled = FALSE;\r
           RemoveEntryList (&DriverEntry->ScheduledLink);\r
 \r
@@ -930,12 +864,6 @@ SmmDispatcher (
           SmmInsertOnScheduledQueueWhileProcessingBeforeAndAfter (DriverEntry);\r
           ReadyToRun = TRUE;\r
         }\r
-      } else {\r
-        if (DriverEntry->Unrequested) {\r
-          DEBUG ((DEBUG_DISPATCH, "Evaluate SMM DEPEX for FFS(%g)\n", &DriverEntry->FileName));\r
-          DEBUG ((DEBUG_DISPATCH, "  SOR                                             = Not Requested\n"));\r
-          DEBUG ((DEBUG_DISPATCH, "  RESULT = FALSE\n"));\r
-        }\r
       }\r
     }\r
   } while (ReadyToRun);\r
@@ -1131,7 +1059,7 @@ SmmFvToDevicePath (
 /**\r
   Add an entry to the mDiscoveredList. Allocate memory to store the DriverEntry,\r
   and initilize any state variables. Read the Depex from the FV and store it\r
-  in DriverEntry. Pre-process the Depex to set the SOR, Before and After state.\r
+  in DriverEntry. Pre-process the Depex to set the Before and After state.\r
   The Discovered list is never free'ed and contains booleans that represent the\r
   other possible SMM driver states.\r
 \r
index 9562e982ed086569b58a1308392fa6a3b87ec410..5cd123705600b0e5ad67add6a3c058ae7ec42f52 100644 (file)
@@ -80,9 +80,7 @@ typedef struct {
   EFI_GUID                        BeforeAfterGuid;\r
 \r
   BOOLEAN                         Dependent;\r
-  BOOLEAN                         Unrequested;\r
   BOOLEAN                         Scheduled;\r
-  BOOLEAN                         Untrusted;\r
   BOOLEAN                         Initialized;\r
   BOOLEAN                         DepexProtocolError;\r
 \r
@@ -702,8 +700,7 @@ SmmRemoveInterfaceFromProtocol (
 /**\r
   This is the POSTFIX version of the dependency evaluator.  This code does\r
   not need to handle Before or After, as it is not valid to call this\r
-  routine in this case. The SOR is just ignored and is a nop in the grammer.\r
-  POSTFIX means all the math is done on top of the stack.\r
+  routine in this case. POSTFIX means all the math is done on top of the stack.\r
 \r
   @param  DriverEntry           DriverEntry element to update.\r
 \r