]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuDxe: fix bad boot performance
authorJian J Wang <jian.j.wang@intel.com>
Thu, 18 Jan 2018 07:29:01 +0000 (15:29 +0800)
committerStar Zeng <star.zeng@intel.com>
Fri, 19 Jan 2018 06:16:12 +0000 (14:16 +0800)
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>
UefiCpuPkg/CpuDxe/CpuPageTable.c

index 90d9823838138955f32613464d06de9395e507a5..a33ac5519e68cb733f334ceef264e103ce4293eb 100644 (file)
@@ -597,7 +597,6 @@ DisableReadOnlyPageWriteProtect (
   )\r
 {\r
   AsmWriteCr0 (AsmReadCr0() & ~BIT16);\r
-  SyncMemoryPageAttributesAp (SyncCpuDisableWriteProtection);\r
 }\r
 \r
 /**\r
@@ -609,7 +608,6 @@ EnableReadOnlyPageWriteProtect (
   )\r
 {\r
   AsmWriteCr0 (AsmReadCr0() | BIT16);\r
-  SyncMemoryPageAttributesAp (SyncCpuEnableWriteProtection);\r
 }\r
 \r
 /**\r