OvmfPkg/EmuVariableFvbRuntimeDxe: stop using PcdVariableStoreSize
In commit 62f43f7c19
, we set PcdVariableStoreSize to the same value as
PcdFlashNvStorageVariableSize (which in turn comes from VARS_LIVE_SIZE in
"OvmfPkg.fdf.inc").
This equality between both PCDs is a false requirement from
EmuVariableFvbRuntimeDxe. FVB drivers should use
PcdFlashNvStorageVariableSize for supporting non-volatile variables (even
if they happen to be kept in RAM only), along the other PcdFlashNvStorage*
PCDs. Whereas PcdVariableStoreSize is for variables that are volatile at
the gRT->SetVariable() / gRT->GetVariable() API level.
(PlatformPei too bases the preallocation for EmuVariableFvbRuntimeDxe on
PcdFlashNvStorageFtwSpareSize.)
Replace PcdVariableStoreSize in EmuVariableFvbRuntimeDxe with the
same-value PcdFlashNvStorageVariableSize. This means no change in
behavior, and it allows us to increase PcdVariableStoreSize in a later
patch without disturbing EmuVariableFvbRuntimeDxe (or PlatformPei).
Cc: Anthony Perard <anthony.perard@citrix.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Gary Ching-Pang Lin <glin@suse.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Julien Grall <julien.grall@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gary Lin <glin@suse.com>
Tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
@@ -665,7 +665,7 @@ InitializeFvAndVariableStoreHeaders (
|
|||||||
|
|
||||||
// UINT32 Size;
|
// UINT32 Size;
|
||||||
(
|
(
|
||||||
FixedPcdGet32 (PcdVariableStoreSize) -
|
FixedPcdGet32 (PcdFlashNvStorageVariableSize) -
|
||||||
OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, VarHdr)
|
OFFSET_OF (FVB_FV_HDR_AND_VARS_TEMPLATE, VarHdr)
|
||||||
),
|
),
|
||||||
|
|
||||||
@@ -733,7 +733,7 @@ FvbInitialize (
|
|||||||
ASSERT (FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) %
|
ASSERT (FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize) %
|
||||||
EMU_FVB_BLOCK_SIZE == 0);
|
EMU_FVB_BLOCK_SIZE == 0);
|
||||||
if (
|
if (
|
||||||
(PcdGet32 (PcdVariableStoreSize) +
|
(PcdGet32 (PcdFlashNvStorageVariableSize) +
|
||||||
PcdGet32 (PcdFlashNvStorageFtwWorkingSize)
|
PcdGet32 (PcdFlashNvStorageFtwWorkingSize)
|
||||||
) >
|
) >
|
||||||
EMU_FVB_NUM_SPARE_BLOCKS * EMU_FVB_BLOCK_SIZE
|
EMU_FVB_NUM_SPARE_BLOCKS * EMU_FVB_BLOCK_SIZE
|
||||||
@@ -788,7 +788,7 @@ FvbInitialize (
|
|||||||
//
|
//
|
||||||
// Initialize the Fault Tolerant Write data area
|
// Initialize the Fault Tolerant Write data area
|
||||||
//
|
//
|
||||||
SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdVariableStoreSize));
|
SubPtr = (VOID*) ((UINT8*) Ptr + PcdGet32 (PcdFlashNvStorageVariableSize));
|
||||||
PcdStatus = PcdSet32S (PcdFlashNvStorageFtwWorkingBase,
|
PcdStatus = PcdSet32S (PcdFlashNvStorageFtwWorkingBase,
|
||||||
(UINT32)(UINTN) SubPtr);
|
(UINT32)(UINTN) SubPtr);
|
||||||
ASSERT_RETURN_ERROR (PcdStatus);
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
@@ -58,12 +58,11 @@
|
|||||||
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_PRODUCED
|
||||||
|
|
||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
|
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase
|
||||||
|
Reference in New Issue
Block a user