]> git.proxmox.com Git - mirror_edk2.git/commit - UefiCpuPkg/CpuDxe/CpuGdt.h
UefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim
authorMichael Kinney <michael.d.kinney@intel.com>
Fri, 30 Oct 2015 17:32:27 +0000 (17:32 +0000)
committermdkinney <mdkinney@Edk2>
Fri, 30 Oct 2015 17:32:27 +0000 (17:32 +0000)
commit0d4c1db81aab86963536deb8253f35546c4398ea
tree0a4f18076218a67c945db370f8c963b0c47f889e
parentcdf8c32ec169db14d4824c659159e2b6b6bed540
UefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim

The PiSmmCpuDxeSmm module makes some assumptions about GDT selectors
that are based on the GDT layout from the DxeIplPeim.  For example,
the protected mode entry code and (where appropriate) the long mode
entry code in the UefiCpuPkg/PiSmmCpuDxeSmm/*/MpFuncs.* assembly
files, which are used during S3 resume, open-code segment selector
values that depend on DxeIplPeim's GDT layout.

This updates the CpuDxe module to use the same GDT layout as the
DxeIplPeim.  This enables modules that are dispatched after
CpuDxe to find, and potentially save and restore, a GDT layout that
matches that of DxeIplPeim.  The DxeIplPeim has a 2 GDT entries for
data selectors that are identical.  These are LINEAR_SEL (GDT Offset
0x08)and LINEAR_DATA64_SEL (GDT offset 0x30).  LINEAL_SEL is used for
for IA32 DXE and the LINEAR_DATA64_SEL is used for X64 DXE. This
duplicate data selector was added to the CpuDxe module to keep the
GDT and all selectors consistent.

Using a consistent GDT also improves debug experience.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Link: http://article.gmane.org/gmane.comp.bios.edk2.devel/3568
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18710 6f19259b-4bc3-4df7-8a09-765794883524
UefiCpuPkg/CpuDxe/CpuGdt.c
UefiCpuPkg/CpuDxe/CpuGdt.h