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>
This commit is contained in:
Jian J Wang 2018-01-18 15:29:01 +08:00 committed by Star Zeng
parent 425d25699b
commit 0dbb0f1a5c
1 changed files with 0 additions and 2 deletions

View File

@ -597,7 +597,6 @@ DisableReadOnlyPageWriteProtect (
)
{
AsmWriteCr0 (AsmReadCr0() & ~BIT16);
SyncMemoryPageAttributesAp (SyncCpuDisableWriteProtection);
}
/**
@ -609,7 +608,6 @@ EnableReadOnlyPageWriteProtect (
)
{
AsmWriteCr0 (AsmReadCr0() | BIT16);
SyncMemoryPageAttributesAp (SyncCpuEnableWriteProtection);
}
/**