]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: sync PcdVariableStoreSize with PcdFlashNvStorageVariableSize
authorLaszlo Ersek <lersek@redhat.com>
Fri, 5 May 2017 01:31:32 +0000 (03:31 +0200)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 18 May 2017 08:12:58 +0000 (10:12 +0200)
"MdeModulePkg/MdeModulePkg.dec" declares PcdVariableStoreSize like this:

> The size of volatile buffer. This buffer is used to store VOLATILE
> attribute variables.

There is no inherent reason why the size of the volatile variable store
should match the same of the non-volatile variable store. Indeed flash
variables in the 4MB build work fine without this equality.

However, OvmfPkg/EmuVariableFvbRuntimeDxe uses PcdVariableStoreSize to
initialize the non-volatile VARIABLE_STORE_HEADER too. (Presumably based
on the fact that ultimately that storage will not be permanent.) When
using EmuVariableFvbRuntimeDxe in the 4MB build, the mismatch between the
two mentioned PCDs (which is apparent through EmuVariableFvbRuntimeDxe's
VARIABLE_STORE_HEADER) triggers an assertion in the variable driver:

> ASSERT MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c(3772):
> mNvVariableCache->Size == VariableStoreLength

Bringing PcdVariableStoreSize in sync with PcdFlashNvStorageVariableSize
fixes this. It also happens to ensure a volatile store size in the 4MB
build that equals the non-volatile store size, which likely doesn't hurt
for symmetry.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Fixes: b24fca05751f8222acf264853709012e0ab7bf49
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/OvmfPkgIa32.dsc
OvmfPkg/OvmfPkgIa32X64.dsc
OvmfPkg/OvmfPkgX64.dsc

index 8f8d3472102abeca765af95fd87fe8183f70d1b7..64427716c53c40f1e6059c26d60257b801060789 100644 (file)
 !if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 !endif\r
 !if $(FD_SIZE_IN_KB) == 4096\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x8400\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x8400\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x40000\r
 !endif\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0\r
 \r
index fd554f8f375cb1287bc61d4bb63fd6b0dc9c7399..887964cd27c2774a75040073dea1b9e6c6be4bf2 100644 (file)
 !if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 !endif\r
 !if $(FD_SIZE_IN_KB) == 4096\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x8400\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x8400\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x40000\r
 !endif\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0\r
 \r
index 3bcd488fc7a8ae6b790860e25e63f1b2b8440582..dc5fea3577d43037d326d5eeee956a1ea0207724 100644 (file)
 !if ($(FD_SIZE_IN_KB) == 1024) || ($(FD_SIZE_IN_KB) == 2048)\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x2800\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 !endif\r
 !if $(FD_SIZE_IN_KB) == 4096\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x8400\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdMaxAuthVariableSize|0x8400\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0x40000\r
 !endif\r
-  gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000\r
 \r
   gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0\r
 \r