Revision: 14806
          http://sourceforge.net/p/edk2/code/14806
Author:   jljusten
Date:     2013-10-29 06:02:46 +0000 (Tue, 29 Oct 2013)
Log Message:
-----------
OvmfPkg/PlatformPei: emulated NV storage must be EfiRuntimeServicesData

SVN r14770 ("OvmfPkg/PlatformPei: correctly align emulated NV storage")
made sure the emulated NV storage was allocated with correct alignment.

However, the AllocateRuntimePool() -> AllocateAlignedPages() change
flipped the memory type from EfiRuntimeServicesData to
EfiBootServicesData. This causes variable services to access freed storage
at runtime. It crashes Windows 2008 R2 early at boot, for example.

Keep the alignment, but restore the memory type to EfiRuntimeServicesData,
by calling AllocateAlignedRuntimePages().

These helper functions are implemeted and documented in
"MdePkg/Library/PeiMemoryAllocationLib/MemoryAllocationLib.c".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>

Revision Links:
--------------
    http://sourceforge.net/p/edk2/code/14770
    http://sourceforge.net/p/edk2/code/2

Modified Paths:
--------------
    trunk/edk2/OvmfPkg/PlatformPei/Platform.c

Modified: trunk/edk2/OvmfPkg/PlatformPei/Platform.c
===================================================================
--- trunk/edk2/OvmfPkg/PlatformPei/Platform.c   2013-10-29 01:31:02 UTC (rev 
14805)
+++ trunk/edk2/OvmfPkg/PlatformPei/Platform.c   2013-10-29 06:02:46 UTC (rev 
14806)
@@ -287,7 +287,7 @@
   //
   VariableStore =
     (EFI_PHYSICAL_ADDRESS)(UINTN)
-      AllocateAlignedPages (
+      AllocateAlignedRuntimePages (
         EFI_SIZE_TO_PAGES (2 * PcdGet32 (PcdFlashNvStorageFtwSpareSize)),
         PcdGet32 (PcdFlashNvStorageFtwSpareSize)
         );

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to