audk/MdeModulePkg
Mike Turner ada905ab5c MdeModulePkg DxeCore: Fix for missing Memory Attributes Table (MAT) update
The Fpdt driver (FirmwarePerformanceDxe) saves a memory address across
reboots, and then does an AllocatePage for that memory address.
If, on this boot, that memory comes from a Runtime memory bucket,
the MAT table is not updated. This causes Windows to boot into Recovery.

This patch blocks the memory manager from changing the page
from a special bucket to a different memory type.  Once the buckets are
allocated, we freeze the memory ranges for the OS, and fragmenting
the special buckets will cause errors resuming from hibernate (S4).

The references to S4 here are the use case that fails.  This
failure is root caused to an inconsistent behavior of the
core memory services themselves when type AllocateAddress is used.

The main issue is apparently with the UEFI memory map -- the UEFI memory
map reflects the pre-allocated bins, but the actual allocations at fixed
addresses may go out of sync with that. Everything else, such as:
- EFI_MEMORY_ATTRIBUTES_TABLE (page protections) being out of sync,
- S4 failing
are just symptoms / consequences.

This patch is cherry pick from Project Mu:
a9be767d9b
With the minor change,
1. Update commit message format to keep the message in 80 characters one line.
2. Remove // MU_CHANGE comments in source code.
3. Update comments style to follow edk2 style.

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
Acked-by: Hao A Wu <hao.a.wu@intel.com>
2019-08-20 19:53:31 +08:00
..
Application MdeModulePkg/CapsuleApp: Improve comparisons in CapsuleOnDisk.c 2019-08-15 09:10:13 +08:00
Bus MdeModulePkg/UfsPassThruDxe: Implement EDKII_UFS_HC_PLATFORM_PROTOCOL 2019-08-13 10:54:35 +08:00
Core MdeModulePkg DxeCore: Fix for missing Memory Attributes Table (MAT) update 2019-08-20 19:53:31 +08:00
Include NetworkPkg: Move Dpc.h from MdeModulePkg to NetworkPkg 2019-08-15 16:42:43 +08:00
Library MdeModulePkg/DxeCapsuleLibFmp: Improve comparisons in CapsuleOnDisk.c 2019-08-15 09:10:57 +08:00
Logo MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
Universal MdeModulePkg: Add missing header files in INF files 2019-08-13 17:16:14 +08:00
MdeModulePkg.dec MdeModulePkg/MdeModulePkg.dec: Remove gEfiDpcProtocolGuid 2019-08-15 16:42:43 +08:00
MdeModulePkg.dsc MdeModulePkg: Remove RecoveryLib.h and PeiRecoveryLibNull 2019-08-05 10:09:01 +08:00
MdeModulePkg.uni MdeModulePkg/DxeIpl: Introduce PCD PcdUse5LevelPageTable 2019-08-09 08:52:08 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00