We have discovered a case where Dispatch() will fail to dispatch pending SMM 
drivers. It happens when a FV contains only pending SMM drivers, but no pending 
DXE drivers and Dispatch() is called. The offending code is in CoreDispatcher()

CoreDispatcher ()
{
    ...
    ReturnStatus = EFI_NOT_FOUND;
    do {           // Dispatcher_Loop

     Dispatch DXE modules;
     if any module is dispatched, ReturnStatus is set to EFI_SUCCESS;
     ...

    //
    // Now DXE Dispatcher finished one round of dispatch, signal an event group
    // so that SMM Dispatcher get chance to dispatch SMM Drivers which depend
    // on UEFI protocols
    //
    if (!EFI_ERROR (ReturnStatus)) {
      CoreSignalEvent (DxeDispatchEvent);           // trigger SMM dispatcher
    }
    ...
   }
   ...
  }
}

The existing logic only dispatches SMM modules if a DXE module was dispatched. 
This works well for most use cases, since there are always a mixture of DXE and 
SMM drivers. But in specialized FVs (or in some other specialized cases), if 
there are only SMM drivers, none will be launched. I believe the solution is to 
force the SMM dispatcher to run at least once, perhaps by using a BOOLEAN that 
is initially set to FALSE (SmmDriverDispatched) and then adding that as an || 
condition to the bolded line above.

Regards,

Tim

------------------------------------------------------------------------------
Introducing Performance Central, a new site from SourceForge and 
AppDynamics. Performance Central is your source for news, insights, 
analysis and resources for efficient Application Performance Management. 
Visit us today!
http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to