]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Core/Dxe/Mem/Page.c
Guarantee that free memory in the 4K page starting at address 0 is always cleared...
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Mar 2013 21:20:07 +0000 (21:20 +0000)
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 22 Mar 2013 21:20:07 +0000 (21:20 +0000)
commitd436d5ca0936b1be59bd60087cd0b6e0d2e08d76
tree8c04dcdc442b7881f835327d7d558223d39def74
parent9a34087280a857eb0b80ff27d0efabc540b36f99
Guarantee that free memory in the 4K page starting at address 0 is always cleared to 0.  The algorithm is to clear page zero if it is registered with the DXE Core with type EfiConventionalMemory, and to also clear page zero if it is freed using the UEFI Boot Service FreePages().  This patch improves OS compatibility for OSes that may evaluate page 0 for legacy data structures.  Before this patch, free memory may contain random values which induces random boot failures for some OSes.  This patch may also help find NULL pointer bugs sooner because all of the fields in a data structure dereferenced through NULL will also be NULL now.

Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14218 6f19259b-4bc3-4df7-8a09-765794883524
MdeModulePkg/Core/Dxe/Mem/Page.c