audk/UefiCpuPkg
Ruiyu Ni 13a47cf925 UefiCpuPkg/MtrrLib: Fix a bug that may wrongly set memory <1MB to UC
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1481

Today's MtrrLib contains a bug, for example:
 when the original cache setting is WB for [0xF_0000, 0xF_8000) and,
 a new request to set [0xF_0000, 0xF_4000) to WP,
 the cache setting for [0xF_4000, 0xF_8000) is reset to UC.

The reason is when MtrrLibSetBelow1MBMemoryAttribute() is called the
WorkingFixedSettings doesn't contain the actual MSR value stored in
hardware, but when writing the fixed MTRRs, the code logic assumes
WorkingFixedSettings contains the actual MSR value.

The new fix is to change MtrrLibSetBelow1MBMemoryAttribute() to
calculate the correct ClearMasks[] and OrMasks[], and use them
directly when writing the fixed MTRRs.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>
2019-02-19 17:14:34 +08:00
..
Application/Cpuid UefiCpuPkg/Cpuid: Add code to support new definition. 2018-12-10 15:33:50 +08:00
CpuDxe UefiCpuPkg/CpuDxe: prevent recursive calling of InitializePageTablePool 2018-10-26 10:30:34 +08:00
CpuFeatures UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuIo2Dxe UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
CpuIo2Smm UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
CpuIoPei UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
CpuMpPei UefiCpuPkg/CpuMpPei: fix vs2012 build error 2018-09-26 10:20:33 +08:00
CpuS3DataDxe UefiCpuPkg/CpuS3DataDxe: Keep old data if value already existed. 2018-10-22 11:19:48 +08:00
Include UefiCpuPkg: Merge StuffRsb.inc files into one in UefiCpuPkg/Include 2019-01-02 09:45:29 +08:00
Library UefiCpuPkg/MtrrLib: Fix a bug that may wrongly set memory <1MB to UC 2019-02-19 17:14:34 +08:00
PiSmmCommunication
PiSmmCpuDxeSmm UefiCpuPkg: Merge StuffRsb.inc files into one in UefiCpuPkg/Include 2019-01-02 09:45:29 +08:00
ResetVector UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00
SecCore UefiCpuPkg/SecCore: Support EFI_PEI_CORE_FV_LOCATION_PPI 2019-02-15 17:54:22 +08:00
Universal/Acpi/S3Resume2Pei UefiCpuPkg/S3Resume2Pei: check 64BIT_WAKE_F in FACS.OSPMFlags. 2019-01-15 13:17:26 +08:00
UefiCpuPkg.dec
UefiCpuPkg.dsc UefiCpuPkg: Removing ipf which is no longer supported from edk2. 2018-06-29 16:19:52 +08:00
UefiCpuPkg.uni
UefiCpuPkgExtra.uni UefiCpuPkg: Clean up source files 2018-06-28 11:19:53 +08:00