Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Laszlo Ersek 7e8329267e OvmfPkg/EmuVariableFvbRuntimeDxe: change block size to 4KB
EmuVariableFvbRuntimeDxe currently produces a Firmware Volume Block
protocol that is based on a block map of two blocks, each block having
PcdFlashNvStorageFtwSpareSize for size.

(The total size is 2 * PcdFlashNvStorageFtwSpareSize.)

FaultTolerantWriteDxe in turn expects the block size to be a power of two.

In the 4MB build of OVMF, PcdFlashNvStorageFtwSpareSize is 264KB, which is
not a power of two. In order to equip EmuVariableFvbRuntimeDxe for this
build, shrink the block size to 4KB (EFI_PAGE_SIZE), and grow the block
count from 2 to EFI_SIZE_TO_PAGES(2 * PcdFlashNvStorageFtwSpareSize). The
total size remains

  2 * PcdFlashNvStorageFtwSpareSize
  --------------------------------- * EFI_PAGE_SIZE
            EFI_PAGE_SIZE

Right now EmuVariableFvbRuntimeDxe open-codes the block count of 2 in
various limit checks, so introduce a few new macros:
- EMU_FVB_NUM_TOTAL_BLOCKS, for the LHS of the above product,
- EMU_FVB_NUM_SPARE_BLOCKS for the half of that.

Also rework the FVB protocol members to support an arbitrary count of
blocks.

Keep the invariant intact that the first half of the firmware volume hosts
the variable store and the FTW working block, and that the second half
maps the FTW spare area.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=527
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Gary Lin <glin@suse.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-05-18 23:38:45 +02:00
AppPkg AppPkg/Applications/Python/PyMod-2.7.2: Replace non-ascii characters 2017-04-10 08:34:08 +08:00
ArmPkg ArmPkg: copy/paste fixes in ARM ArmHvcLib/ArmSmcLib 2017-04-13 10:58:28 +01:00
ArmPlatformPkg ArmPlatformPkg/NorFlashDxe: correct NumOfLba vararg type in EraseBlocks() 2017-05-18 23:18:05 +02:00
ArmVirtPkg ArmPlatformPkg,ArmVirtPkg: delete redundant PL031 functions 2017-05-10 14:28:37 +01:00
BaseTools BaseTools: Fix the bug for CArray PCD override in command line 2017-05-12 13:36:20 +08:00
BeagleBoardPkg BeagleBoardPkg: add missing BootLogoLib resolution 2017-03-31 11:43:22 +01:00
Conf EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
CorebootModulePkg CorebootPayloadPkg/CbSupportPei: Fix the memory map issue 2016-11-17 14:49:11 -08:00
CorebootPayloadPkg CorebootPayloadPkg: Use EfiEventGroupSignal from UefiLib 2017-01-20 15:55:41 +08:00
CryptoPkg CryptoPkg: Update package version to 0.97 2017-05-05 11:29:22 +08:00
DuetPkg DuetPkg: Add SortLib/UefiBootManagerLib 2017-03-20 14:48:18 +08:00
EdkCompatibilityPkg EdkCompatibilityPkg: Fix some typos of "according" 2017-02-08 14:49:21 +08:00
EdkShellBinPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EdkShellPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg EmbeddedPkg: import EfiTimeBaseLib (as TimeBaseLib) 2017-05-10 14:28:14 +01:00
EmulatorPkg EmulatorPkg/FvbServicesRuntimeDxe: correct NumOfLba vararg type in EraseBlocks() 2017-05-18 23:38:45 +02:00
FatBinPkg FatBinPkg: New EnhancedFatDxe binaries for IA32, X64, EBC and IPF 2017-04-07 13:14:20 +08:00
FatPkg FatPkg: Refine casting expression result to bigger size 2017-03-06 14:33:21 +08:00
IntelFrameworkModulePkg IntelFrameworkModulePkg/IdeBusDxe: Fix undefined behavior in signed left shift 2017-04-13 08:59:24 +08:00
IntelFrameworkPkg IntelFrameworkPkg/UefiLib: Avoid mis-calculate of graphic console size 2017-04-14 13:16:12 +08:00
IntelFsp2Pkg IntelFsp2Pkg: Convert files to CRLF line ending 2017-04-06 15:42:56 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg: Convert files to CRLF line ending 2017-04-06 15:43:08 +08:00
IntelFspPkg IntelFspPkg: Fix typos in comments 2016-10-24 09:26:28 +08:00
IntelFspWrapperPkg IntelFspWrapperPkg: Refine casting expression result to bigger size 2017-03-06 14:33:23 +08:00
IntelSiliconPkg IntelSiliconPkg: Fix format issues 2016-12-20 10:51:16 +08:00
MdeModulePkg MdeModulePkg/PciHostBridgeDxe: Fix EBC build failure 2017-05-18 16:44:26 +08:00
MdePkg MdePkg DxeServicesLib: Handle potential NULL FvHandle 2017-05-08 08:57:03 +08:00
NetworkPkg NetworkPkg/IScsiDxe: Switch IP4 configuration policy to Static before DHCP 2017-05-11 10:52:50 +08:00
Nt32Pkg Nt32Pkg/SnpNt32Dxe: Fix hang issue when multiple network interfaces existed 2017-05-09 14:32:16 +08:00
Omap35xxPkg ArmPkg: remove unused PcdArmUncachedMemoryMask PCD 2017-02-27 16:18:29 +00:00
OptionRomPkg OptionRomPkg: Fix calling convention issue for UndiRuntiumeDxe driver. 2017-04-24 10:10:45 +08:00
OvmfPkg OvmfPkg/EmuVariableFvbRuntimeDxe: change block size to 4KB 2017-05-18 23:38:45 +02:00
PcAtChipsetPkg PcAtChipsetPkg: Refine casting expression result to bigger size 2017-03-06 14:33:24 +08:00
PerformancePkg PerformancePkg Dp_App: Handle "/" separator in debug path for GCC build 2017-03-16 11:08:44 +08:00
QuarkPlatformPkg QuarkPlatformPkg/PlatformBootManagerLib: use new UefiShellFileGuid definition 2017-03-22 15:43:57 +00:00
QuarkSocPkg QuarkSocPkg: Remove use of IntelFrameworkModulePkg legacy libs 2016-12-02 15:59:19 +00:00
SecurityPkg SecurityPkg: Add TCG Spec info to TCG related modules 2017-05-11 16:20:05 +08:00
ShellBinPkg ShellBinPkg: Ia32/X64 Shell binary update. 2017-05-12 14:51:10 +08:00
ShellPkg ShellPkg/memmap: Dump memory map information for all memory types 2017-05-12 10:50:51 +08:00
SignedCapsulePkg SignedCapsulePkg: Convert files to CRLF line ending 2017-04-06 15:43:14 +08:00
SourceLevelDebugPkg PeCoffGetEntryPointLib: Fix spelling issue 2017-04-26 08:58:18 +08:00
StdLib StdLib: GCC 6 build fixes 2017-04-28 17:06:59 +01:00
StdLibPrivateInternalFiles StdLib: Clarify and improve comments. 2016-01-06 00:31:42 +00:00
UefiCpuPkg UefiCpuPkg/PiSmmCpuDxeSmm: Fix logic check error 2017-05-11 16:33:27 +08:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
Vlv2DeviceRefCodePkg Vlv2DeviceRefCodePkg: Fixed thermal issue. 2017-02-08 15:32:39 +08:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg: Fix build failure by adding UefiBootManagerLib 2017-04-01 13:20:11 +08:00
.gitignore EDK II: Add .gitignore 2014-10-14 16:08:15 +00:00
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Edk2Setup.bat Edk2Setup.bat: Fix build errors from VS tools PREFIX ENV missing 2016-11-05 09:10:58 +08:00
Maintainers.txt Maintainers.txt: Update maintainers for MdeModulePkg 2017-05-04 08:32:38 +08:00
edksetup.bat edksetup.bat: make sure BASE_TOOLS_PATH be set correctly 2016-10-26 13:45:45 +08:00
edksetup.sh edksetup.sh, BaseTools/BuildEnv: add --reconfig support 2016-10-24 13:53:16 +01:00