audk/UefiCpuPkg
Michael Kinney 0d4c1db81a 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
2015-10-30 17:32:27 +00:00
..
CpuDxe UefiCpuPkg: CpuDxe: Update GDT to be consistent with DxeIplPeim 2015-10-30 17:32:27 +00:00
CpuIo2Dxe UefiCpuPkg: Convert non DOS format files to DOS format 2014-09-03 08:48:53 +00:00
CpuIo2Smm UefiCpuPkg: Convert non DOS format files to DOS format 2014-09-03 08:48:53 +00:00
CpuIoPei UefiCpuPkg: Convert non DOS format files to DOS format 2014-09-03 08:48:53 +00:00
CpuMpPei UefiCpuPkg: Add Cpuid.h include files for CPUID related defines 2015-10-19 19:09:15 +00:00
Include UefiCpuPkg: Add CPU Hot Plug Data include file 2015-10-19 19:12:18 +00:00
Library UefiCpuPkg: SmmCpuFeaturesLib: Add MSR_SMM_FEATURE_CONTROL support 2015-10-28 07:16:38 +00:00
PiSmmCommunication UefiCpuPkg: Add SMM Communication PPI and Handler Modules 2015-10-19 19:09:33 +00:00
PiSmmCpuDxeSmm UefiCpuPkg: PiSmmCpuDxeSmm: Replace PcdSet## with PcdSet##S 2015-10-27 16:15:03 +00:00
ResetVector UefiCpuPkg: Convert non DOS format files to DOS format 2014-09-03 08:48:53 +00:00
SecCore UefiCpuPkg: Add SecCore module 2015-10-19 19:10:14 +00:00
Universal/Acpi/S3Resume2Pei UefiCpuPkg S3Resume2Pei: Fix ASSERT in WriteToOsS3PerformanceData 2015-07-13 01:24:24 +00:00
Contributions.txt */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
License.txt Update copyright format 2012-04-24 06:49:39 +00:00
UefiCpuPkg.dec UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
UefiCpuPkg.dsc UefiCpuPkg: PiSmmCpuDxeSmm: Remove unused references to SmmLib 2015-10-26 16:40:52 +00:00
UefiCpuPkg.uni UefiCpuPkg: Add PiSmmCpuDxeSmm module no IA32/X64 files 2015-10-19 19:12:53 +00:00
UefiCpuPkgExtra.uni UefiCpuPkg: INF/DEC file updates to EDK II packages 2014-08-28 05:12:05 +00:00