summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/MdeModulePkg.uni
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-09-15 07:49:12 +0000
committerlzeng14 <lzeng14@Edk2>2015-09-15 07:49:12 +0000
commit960f2d533b08b43188d35a4aa32d5a8044a45da4 (patch)
tree22212f6da5d9ac8a91b141fb6b51123b9fe8b845 /MdeModulePkg/MdeModulePkg.uni
parent2c55a81a0a94656d88dbd8ed56b37c5a53f5e20f (diff)
downloadedk2-960f2d533b08b43188d35a4aa32d5a8044a45da4.tar.gz
edk2-960f2d533b08b43188d35a4aa32d5a8044a45da4.tar.bz2
edk2-960f2d533b08b43188d35a4aa32d5a8044a45da4.zip
MdeModulePkg PiDxeS3BootScriptLib: Remove a hidden assumption.
What to do: 1. Remove a hidden assumption "No SMM driver writes BootScript between SmmReadyToLock and S3SleepEntryCallback". 1.1. Use SmmExitBootServices and SmmLegacyBoot notification to record AtRuntime flag. 1.2. Use mBootScriptDataBootTimeGuid LockBox to save boot time boot script data to handle potential INSERT boot script at runtime in SMM. 2. Do not depend on OS to help restore ACPINvs data and use EfiReservedMemoryType instead of EfiACPIMemoryNVS. 2.1. Use mBootScriptSmmPrivateDataGuid LockBox to save boot script SMM private data with BackFromS3 = TRUE at runtime. S3 resume will help restore it to tell the Library the system is back from S3. Why to do: 1. The hidden assumption "No SMM driver writes BootScript between SmmReadyToLock and S3SleepEntryCallback" will cause confusion to the library's consumer and block the usage of "SMM driver writes BootScript after SmmReadyToLock". So Remove the assumption. 2. In original code, there might be a corner case that malicious code patch ACPINvs boot TableLength field same as SMM boot script. So that it can skip the table restore. The impact is that BootScript in SMM may be overridden by malicious code. -------------------- CopyMem ((VOID*)&TableHeader, (VOID*)mS3BootScriptTablePtr->TableBase, sizeof(EFI_BOOT_SCRIPT_TABLE_HEADER)); if (mS3BootScriptTablePtr->TableLength + sizeof(EFI_BOOT_SCRIPT_TERMINATE) != TableHeader.TableLength) { // TableLength is in NVS ...... // // NOTE: We should NOT use TableHeader.TableLength, because it is already updated to be whole length. // mS3BootScriptTablePtr->TableLength = (UINT32)(mLockBoxLength - sizeof(EFI_BOOT_SCRIPT_TERMINATE)); ? This line can be skipped. -------------------- So use EfiReservedMemoryType instead of EfiACPIMemoryNVS as the code has been updated to not depend on OS to help restore ACPINvs data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18467 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/MdeModulePkg.uni')
-rw-r--r--MdeModulePkg/MdeModulePkg.unibin183916 -> 184014 bytes
1 files changed, 0 insertions, 0 deletions
diff --git a/MdeModulePkg/MdeModulePkg.uni b/MdeModulePkg/MdeModulePkg.uni
index 9db6e58e16..b1fd210d2b 100644
--- a/MdeModulePkg/MdeModulePkg.uni
+++ b/MdeModulePkg/MdeModulePkg.uni
Binary files differ