summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorJian J Wang <jian.j.wang@intel.com>2018-01-18 15:29:01 +0800
committerStar Zeng <star.zeng@intel.com>2018-01-22 09:22:45 +0800
commitfe5adb77df646808f471a62cc91a672d9d4ef32c (patch)
treeded86e640439e19656af72dda91523e167da9935 /UefiCpuPkg
parent7ce3491760eb4097e8c1b5b0e6c928dcf2c2a692 (diff)
downloadedk2-fe5adb77df646808f471a62cc91a672d9d4ef32c.tar.gz
edk2-fe5adb77df646808f471a62cc91a672d9d4ef32c.tar.bz2
edk2-fe5adb77df646808f471a62cc91a672d9d4ef32c.zip
UefiCpuPkg/CpuDxe: fix bad boot performance
If features like memory profile, protection and heap guard are enabled, a lot of more memory page attributes update actions will happen than usual. An unnecessary sync of CR0.WP setting among APs will then cause worse performance in memory allocation action. Removing the calling of SyncMemoryPageAttributesAp() in function DisableReadOnlyPageWriteProtect and EnableReadOnlyPageWriteProtect can fix this problem. In DEBUG build case, the boot performance can be boosted from 11 minute to 6 minute. Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com> (cherry picked from commit 0dbb0f1a5ce6a9ec5213c85e5d4244cf5b061417)
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/CpuDxe/CpuPageTable.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/UefiCpuPkg/CpuDxe/CpuPageTable.c b/UefiCpuPkg/CpuDxe/CpuPageTable.c
index 90d9823838..a33ac5519e 100644
--- a/UefiCpuPkg/CpuDxe/CpuPageTable.c
+++ b/UefiCpuPkg/CpuDxe/CpuPageTable.c
@@ -597,7 +597,6 @@ DisableReadOnlyPageWriteProtect (
)
{
AsmWriteCr0 (AsmReadCr0() & ~BIT16);
- SyncMemoryPageAttributesAp (SyncCpuDisableWriteProtection);
}
/**
@@ -609,7 +608,6 @@ EnableReadOnlyPageWriteProtect (
)
{
AsmWriteCr0 (AsmReadCr0() | BIT16);
- SyncMemoryPageAttributesAp (SyncCpuEnableWriteProtection);
}
/**