audk/UefiCpuPkg/PiSmmCpuDxeSmm
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
..
Ia32 UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm 2022-08-15 05:15:43 +00:00
X64 UefiCpuPkg: Bug fix in 5LPage handling 2022-12-08 10:04:24 +00:00
CpuS3.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuService.c UefiCpuPkg: Extend SMM CPU Service with rendezvous support. 2022-03-04 05:44:42 +00:00
CpuService.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MpService.c UefiCpuPkg: Check SMM Delayed/Blocked AP Count 2022-12-08 10:04:24 +00:00
PiSmmCpuDxeSmm.c UefiCpuPkg: Check SMM Delayed/Blocked AP Count 2022-12-08 10:04:24 +00:00
PiSmmCpuDxeSmm.h UefiCpuPkg: Check SMM Delayed/Blocked AP Count 2022-12-08 10:04:24 +00:00
PiSmmCpuDxeSmm.inf UefiCpuPkg: Extend SMM CPU Service with rendezvous support. 2022-03-04 05:44:42 +00:00
PiSmmCpuDxeSmm.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PiSmmCpuDxeSmmExtra.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
SmmCpuMemoryManagement.c UefiCpuPkg/PiSmmCpuDxeSmm: Remove mInternalCr3 in PiSmmCpuDxeSmm 2022-08-15 05:15:43 +00:00
SmmMp.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmMp.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmProfile.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmProfile.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmProfileInternal.h UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmramSaveState.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SyncTimer.c UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00