]> git.proxmox.com Git - mirror_edk2.git/commit - MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
MdeModulePkg/DxeIplPeim: reserve page 0 for NULL pointer detection
authorJian J Wang <devel@edk2.groups.io>
Wed, 6 Nov 2019 21:13:32 +0000 (21:13 +0000)
committerJian J Wang <jian.j.wang@intel.com>
Sat, 9 Nov 2019 02:59:56 +0000 (10:59 +0800)
commitf9d0e5daa058f0cf4caa8edad0dfa2a3a390f1b0
tree62b0ec3b72a397648939a184dda1f4f143aae74c
parentf55c76b301f15d287b58cd86dd59be978dc753a3
MdeModulePkg/DxeIplPeim: reserve page 0 for NULL pointer detection

When a boot loader examines the memory map, it can see that location 0
is available memory. If it chooses to use that memory, and
PcdNullPointerDetectionPropertyMask is enabled, use of memory in page 0
will cause an exception. This does occur when running the memtest86
program.

Leaving page 0 available is for legacy support purpose. Since we have
deprecated the support of legacy, the solution is just reserving it so
that it cannot be allocated for other uses.

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1885
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
MdeModulePkg/Core/DxeIplPeim/X64/DxeLoadFunc.c