Is there any good documentation for how the Fault Tolerant Write is supposed to 
work?

I understand that NV storage, FTW working space and FTW spare space are 
supposed to be in the same Firmware Volume.

I'm having trouble deciphering how big the FTW working and spare areas should 
be in relation to the NV storage space.

Also, in a bunch of places, it looks like the code was written such that the 
working space must fit within one block size.  What happens if need space 
spanning multiple blocks?  Below are parts from two functions that end in an 
ASSERT because only one block gets read and returns an error when the requested 
FVB->Read input size is larger than one block of data.

MdeModulePkg/Universal/FaultTolerantDxe/UpdateWorkingBlock.c

EFI_STATUS
WorkSpaceRefresh (
  IN EFI_FTW_DEVICE  *FtwDevice
  )
{
  EFI_STATUS                      Status;
  UINTN                           Length;
  UINTN                           RemainingSpaceSize;
.
.
.
  //
  // Read from working block
  //
  Length = FtwDevice->FtwWorkSpaceSize;
  Status = FtwDevice->FtwFvBlock->Read (
                                    FtwDevice->FtwFvBlock,
                                    FtwDevice->FtwWorkSpaceLba,
                                    FtwDevice->FtwWorkSpaceBase,
                                    &Length,
                                    FtwDevice->FtwWorkSpace
                                    );
  if (EFI_ERROR (Status)) {
    return EFI_ABORTED;
  }
When Length > one block, Return EFI_ABORTED because 
FtwDevice->FtwFvBlock->Read() returns EFI_BAD_BUFFER_SIZE as specified in PI 
1.3 Vol3 3.4.2 EFI_FIRMWARE_VOLUME_BLOCK2_PROTOCOL.Read()



MdeModulePkg/Universal/FaultTolerantWriteDxe/FtwMisc.c

EFI_STATUS
InitFtwProtocol (
  IN OUT EFI_FTW_DEVICE               *FtwDevice
  )
{
.
.
.
  //
  // Refresh the working space data from working block
  //
  Status = WorkSpaceRefresh (FtwDevice);
  ASSERT_EFI_ERROR (Status);

ASSERT because EFI_ABORTED returned.

Garrett Kirkendall   [Description: Description: Description: purple]
SMTS Firmware Engineer | AMD Technology & Engineering
7171 Southwest Parkway, Austin, TX 78735 USA
[Description: Description: Description: image004]   
facebook<https://www.facebook.com/AMD>  |  amd.com<http://www.amd.com/>

<<inline: image003.png>>

<<inline: image002.png>>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to