On Wed, Oct 02, 2013 at 08:47:06AM -0700, Andrew Fish wrote: [...] > > [PcdsDynamicDefault] > > > > gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > > > > Per the DSC document, the above line sets PcdFlashNvStorageFtwSpareBase > > to 0 as initial value. > > > > Then EmuVariableFvbRuntimeDxe which is loaded right before FTWDxe sets > > that value to > > SubPtr = (VOID*) ((UINT8*) Ptr + EMU_FVB_BLOCK_SIZE); > > PcdSet32 (PcdFlashNvStorageFtwSpareBase, (UINT32)(UINTN) SubPtr); > > > > Ptr is the value in PcdEmuVariableNvStoreReserved, which is pre-set > > to 0 and initialized in PlatformPei. The reserved address is dynamically > > allocated. The allocation doesn't guarantee to be EMU_FV_BLOCK_SIZE > > aligned. So I'm suspecting there's a bug in EmuVariableFvbRuntimeDxe. > > > > Maybe the original allocation should be aligned? >
There doesn't seem to be a parameter to specify the alignment of allocated memory block and the comments in code say that the alignment is 4KiB. Digging deeper into code, that allocation in PlatformPei is clearly dedicated to FtwSpareSpace. I think the code to allocate 2*EMU_FV_BLOCK_SIZE bytes memory region is to leave leeway for later code to do alignment. So I believe my patch is correct. I will submit a formal patch shortly. Thanks Wei. ------------------------------------------------------------------------------ October Webinars: Code for Performance Free Intel webinars can help you accelerate application performance. Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk _______________________________________________ edk2-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/edk2-devel
