summaryrefslogtreecommitdiffstats
path: root/IntelFrameworkPkg
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-05-09 17:36:06 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-05-21 12:47:10 +0800
commit1e35fcc9ee8b6b991535d9d6731d0e04169b99c0 (patch)
tree3d52b37f2ba73eebb07cf04c3173d6bf899ea01a /IntelFrameworkPkg
parent7ebad830d6ab61f0395f6f4bae4156664bbd8086 (diff)
downloadedk2-1e35fcc9ee8b6b991535d9d6731d0e04169b99c0.tar.gz
edk2-1e35fcc9ee8b6b991535d9d6731d0e04169b99c0.tar.bz2
edk2-1e35fcc9ee8b6b991535d9d6731d0e04169b99c0.zip
MdePkg/SmmPeriodicSmiLib: Get Periodic SMI Context More Robustly
The PeriodicSmiDispatchFunction() in SmmPeriodicSmiLib may assert with "Bad CR signature". Currently, the SetActivePeriodicSmiLibraryHandler() function (invoked at the beginning of the PeriodicSmiDispatchFunction() function) attempts to locate the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure pointer for the current periodic SMI from a given EFI_SMM_PERIODIC_TIMER_REGISTER_CONTEXT (RegiserContext) structure pointer (using the CR macro). The RegisterContext structure pointer passed to the PeriodicSmiDispatchFunction() is assumed to point to the same RegisterContext structure address given to the SmmPeriodicTimerDispatch2 protocol Register() API in PeriodicSmiEnable(). However, certain SmmPeriodicTimerDispatch2 implementation may copy the RegisterContext to a local buffer and pass that address as the context to PeriodicSmiDispatchFunction() in which case usage of the CR macro to find the parent structure base fails. The patch uses the LookupPeriodicSmiLibraryHandler() function to find the PERIODIC_SMI_LIBRARY_HANDLER_CONTEXT structure pointer. This works even in this scenario since the DispatchHandle returned from the SmmPeriodicTimerDispatch2 Register() function uniquely identifies that registration. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'IntelFrameworkPkg')
0 files changed, 0 insertions, 0 deletions