History log of /device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8a4b243578e565d97939b79d88ba348832e37d15 16-Oct-2015 Laszlo Ersek <lersek@redhat.com> MdeModulePkg: FaultTolerantWriteDxe: mellow DEBUGs about workspace reinit

The IsValidWorkSpace() function checks if the working block header of the
workspace is valid. A mismatch detected by this function is not
necessarily an error; it can happen with an as-yet unwritten flash chip,
which is e.g. common and normal when a new ArmVirtQemu virtual machine is
booted. Therefore downgrade the message emitted by IsValidWorkSpace() from
EFI_D_ERROR to EFI_D_INFO, and change the wording from "error" to
"mismatch".

The only caller of IsValidWorkSpace(), InitFtwProtocol(), handles all of
the following cases:

(1) IsValidWorkSpace() succeeds for the working block -- this is normal
operation,

(2) IsValidWorkSpace() fails for the working block, but succeeds for the
spare block -- InitFtwProtocol() then restores the working block from
the spare block,

(3) IsValidWorkSpace() fails for both the working and spare blocks --
InitFtwProtocol() reinitializes the full workspace.

In cases (2) and (3), InitFtwProtocol() logs additional messages about the
branch taken. Their current level is EFI_D_ERROR, but the messages are
arguably informative, not necessarily error reports.

Downgrade these messages from EFI_D_ERROR to EFI_D_INFO, so that they
don't clutter the debug output when the PcdDebugPrintErrorLevel mask only
enables EFI_D_ERROR (i.e., in a "silent" build).

These messages have annoyed / confused users; see for example:
- https://bugzilla.redhat.com/show_bug.cgi?id=1270279

Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Drew Jones <drjones@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18619 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
0d3edd9d26300256a19472fbf82e090bbab3b5b4 10-Oct-2014 Star Zeng <star.zeng@intel.com> MdeModulePkg FaultTolerantWriteDxe: Remove assumptions below in FTW driver.
1. Work space and spare block must be in a FVB with FV header.
Updated to work space and spare block could be in independent FVBs that are without FV header.
2. NV region, work space and spare block must have same BlockSize.
Updated to NV region, work space and spare block could have different BlockSize.
3. Works space size must be <= one block size.
Update to work space size could be <= one block size (not span blocks) or > one block size (block size aligned).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16201 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
4e1005eca7186cbe61aaae09108f6fdf29959f22 28-Jul-2014 Eric Dong <eric.dong@intel.com> Update code to support VS2013 tool chain.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15695 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
2c4b18e09590e50c95b95fd485144d00b3b7f39f 11-Jul-2013 Star Zeng <star.zeng@intel.com> MdeModulePkg: Add the alignment check for FTW spare area address and length, and add the check for PcdFlashNvStorageVariableSize <= PcdFlashNvStorageFtwSpareSize.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14463 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
3e02ebb2bbe0fd4da880511b1f35951e1c4b8404 03-Jul-2013 Star Zeng <star.zeng@intel.com> MdeModulePkg: Variable drivers robustly handle crashes during Reclaim().

PEI variable implementation checks only the variable header signature for validity. This does not seem robust if system crash occurred during previous Reclaim() operation. If the crash occurred while FTW was rewriting the variable FV, the signature could be valid even though the rest of the FV isn't valid.
Solution: Add a FaultTolerantWritePei driver to check and provide the FTW last write status, then PEI variable and early phase(before FTW protocol ready) of DXE variable can check the status and determine if all or partial variable data has been backed up in spare block, and then use the backed up data.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14454 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
0f199272f77504a4bee3466ac331a0e5b0f6605c 07-Jun-2013 Star Zeng <star.zeng@intel.com> Use right LBA to get the backed up WorkSpace in spare block.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14398 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
05cfd5f286a695ab765231f279527b588e4c460d 21-Dec-2012 lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> Initialize a local work space header to be used by IsValidWorkSpace() and InitWorkSpaceHeader() to avoid executing code(gBS->CalculateCrc32 ()) outside SMRAM while inside SMM.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14012 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
d26c7e82f2bf80dd2a64b61fee33a3f3f5e01d5a 14-Sep-2012 lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> Fix the issue that FTW driver fail to reclaim WorkSpace.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Hengyan Tao <hengyan.tao@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13732 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
fe92f438ac860a09e57a2a6a37c1a1d8b6539321 11-May-2012 lzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524> The code line where judges if offset exceed the FTW work space boundary, in some special situations where there are so many records, the offset may happen to be just equal to FtwWorkSpaceSize. And then FtwHead will be updated to be outside of work space wrongly, and cause the system to hang in this driver.

Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Guo Dong <guo.dong@intel.com>

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13307 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
32732a333ae22cc0283c09df947d7b8bad50144e 15-Dec-2010 gdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524> Update inappropriate comments.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11170 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
8a2d49964e371b1715beb3225fde47edfcaa51ca 10-Dec-2010 gdong1 <gdong1@6f19259b-4bc3-4df7-8a09-765794883524> Add SMM Variable implementation.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11151 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
e5eed7d3641d71d7ea539e5379ea9c6a5cd97004 24-Apr-2010 hhtian <hhtian@6f19259b-4bc3-4df7-8a09-765794883524> Update the copyright notice format

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10418 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
4601f3745591b04f7bb4d3508f77bba031c9d2a6 24-Mar-2009 eric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524> correct a wrong offset arithmetic, replace EFI_FAULT_TOLERANT_WRITE_HEADER with EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER. It will cause FTW write operation break.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7931 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c
85e923a52851b242f8fc9f937c1fad7ce51246ee 04-Mar-2009 lgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524> Add full version FaultTolerantWrite Dxe driver.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7787 6f19259b-4bc3-4df7-8a09-765794883524
/device/linaro/bootloader/edk2/MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c