SecurityPkg Variable: Remove mStorageData buffer allocation and use Scratch buffer instead to reduce SMRAM consumption.
It can reduce MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxHardwareErrorVariableSize)) size of SMRAM consumption. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14855 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -48,14 +48,6 @@ CONST UINT8 mRsaE[] = { 0x01, 0x00, 0x01 };
|
||||
//
|
||||
VOID *mHashCtx = NULL;
|
||||
|
||||
//
|
||||
// Pointer to runtime buffer.
|
||||
// For "Append" operation to an existing variable, a read/modify/write operation
|
||||
// is supported by firmware internally. Reserve runtime buffer to cache previous
|
||||
// variable data in runtime phase because memory allocation is forbidden in virtual mode.
|
||||
//
|
||||
VOID *mStorageArea = NULL;
|
||||
|
||||
//
|
||||
// The serialization of the values of the VariableName, VendorGuid and Attributes
|
||||
// parameters of the SetVariable() call and the TimeStamp component of the
|
||||
@@ -191,14 +183,6 @@ AutenticatedVariableServiceInitialize (
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Reserved runtime buffer for "Append" operation in virtual mode.
|
||||
//
|
||||
mStorageArea = AllocateRuntimePool (MAX (PcdGet32 (PcdMaxVariableSize), PcdGet32 (PcdMaxHardwareErrorVariableSize)));
|
||||
if (mStorageArea == NULL) {
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
//
|
||||
// Prepare runtime buffer for serialized data of time-based authenticated
|
||||
// Variable, i.e. (VariableName, VendorGuid, Attributes, TimeStamp, Data).
|
||||
|
Reference in New Issue
Block a user