audk/UefiCpuPkg
Robert Guenzel 1c75bf3c21 UefiCpuPkg: Bug fix in 5LPage handling
When build in DEBUG, the code asserts that 5LPage support is there
when the physical address width is larger than 48.
In a RELEASE build it will just force LA57 to 1 in CR4
even if CPUID(7).ECX[16] says it is not supported.

UefiCpuPkg: Bug fix in 5LPage handling

The hang (in the ASSERT) in DEBUG is not warranted as there are
legal configurations with CPUID(7).ECX[16](==LA57)=0
and with a physical address width of larger than 48 (like 52).

This is also supported by this code:
https://github.com/tianocore/edk2/blob/master/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c#L221
There (as long as physical address width is smaller or equal to 52)
any address width above 48 will be reduced to 48 and the
system can and will work without 5LPaging.

The forced setting of LA57 in CR4 (in the absence of LA57 in CPUID(7).ECX)
is a spec violation and should not happen.

Hence the proposed fix
a) removes the assert.
b) only returns TRUE from Is5LevelPagingNeeded if 5LPaging is actually
   supported by HW.

Signed-off-by: Robert Guenzel <robert.guenzel@intel.com>
2022-12-08 10:04:24 +00:00
..
Application/Cpuid UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuDxe UefiCpuPkg: Enhance logic in InitializeMpExceptionStackSwitchHandlers 2022-08-31 04:23:55 +00:00
CpuFeatures UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuIo2Dxe UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuIo2Smm UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuIoPei UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuMpPei UefiCpuPkg: Enhance logic in InitializeMpExceptionStackSwitchHandlers 2022-08-31 04:23:55 +00:00
CpuS3DataDxe UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Include OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib 2022-11-14 04:55:34 +00:00
Library OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib 2022-11-14 04:55:34 +00:00
MicrocodeMeasurementDxe UefiCpuPkg: Extend measurement of microcode patches to TPM 2021-12-24 09:08:20 +00:00
PiSmmCommunication UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
PiSmmCpuDxeSmm UefiCpuPkg: Bug fix in 5LPage handling 2022-12-08 10:04:24 +00:00
ResetVector UefiCpuPkg/ResetVector:Add Option to reserve 4K region at 4GB 2022-11-11 06:20:12 +00:00
SecCore UefiCpuPkg: Update SEC_IDT_TABLE struct 2022-07-14 18:13:44 +00:00
SecMigrationPei UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
Test UefiCpuPkg/Test: develop UEFI App and dynamic cmd for MP services UT 2022-12-08 10:04:24 +00:00
Universal/Acpi/S3Resume2Pei UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
UefiCpuPkg.ci.yaml UefiCpuPkg: Add R8/R9 etc in EccCheck ExceptionList 2022-10-17 08:03:06 +00:00
UefiCpuPkg.dec OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib 2022-11-14 04:55:34 +00:00
UefiCpuPkg.dsc UefiCpuPkg/Test: develop UEFI App and dynamic cmd for MP services UT 2022-12-08 10:04:24 +00:00
UefiCpuPkg.uni UefiCpuPkg: Add PCD to control SMRR enable & SmmFeatureControl support 2022-08-31 04:23:55 +00:00
UefiCpuPkgExtra.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00