audk/UefiCpuPkg/CpuDxe
Ray Ni 313d86c956 UefiCpuPkg/CpuDxe: Guarantee GDT is below 4GB
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3233

GDT needs to be allocated below 4GB in 64bit environment
because AP needs it for entering to protected mode.
CPU running in big real mode cannot access above 4GB GDT.

But CpuDxe driver contains below code:
  gdt = AllocateRuntimePool (sizeof (GdtTemplate) + 8);
  .....
  gdtPtr.Base = (UINT32)(UINTN)(VOID*) gdt;

The AllocateRuntimePool() may allocate memory above 4GB.
Thus, we cannot use AllocateRuntimePool (), instead,
we should use AllocatePages() to make sure GDT is below 4GB space.

Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
2021-03-18 01:11:23 +00:00
..
Ia32 UefiCpuPkg/CpuDxe: clean up PAGE_TABLE_LIB_PAGING_CONTEXT usage. 2019-09-25 14:29:24 +08:00
X64 UefiCpuPkg/CpuDxe: Fix boot error 2021-01-12 06:35:30 +00:00
CpuDxe.c UefiCpuPkg: Add New Memory Attributes 2020-07-15 14:58:25 +00:00
CpuDxe.h UefiCpuPkg: Add New Memory Attributes 2020-07-15 14:58:25 +00:00
CpuDxe.inf UefiCpuPkg/CpuDxe: clean up PAGE_TABLE_LIB_PAGING_CONTEXT usage. 2019-09-25 14:29:24 +08:00
CpuDxe.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
CpuDxeExtra.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
CpuGdt.c UefiCpuPkg/CpuDxe: Guarantee GDT is below 4GB 2021-03-18 01:11:23 +00:00
CpuGdt.h UefiCpuPkg: Add a 16-bit protected mode code segment descriptor 2020-08-17 02:46:39 +00:00
CpuMp.c UefiCpuPkg/CpuDxe: Fix few typos 2020-02-10 22:30:07 +00:00
CpuMp.h UefiCpuPkg/CpuDxe: Fix few typos 2020-02-10 22:30:07 +00:00
CpuPageTable.c UefiCpuPkg: Add New Memory Attributes 2020-07-15 14:58:25 +00:00
CpuPageTable.h UefiCpuPkg/CpuDxe: Fix few typos 2020-02-10 22:30:07 +00:00