audk/UefiCpuPkg/Library
Zhou Jianfeng 30a25f2778 UefiCpuPkg: Reduce and optimize access to attribute
This commit is to reduce and optimize access to
attribute in CpuPageTableLib.

Unreasonable writing to attribute of page table may
leads to expection.
The assembly code for C code Pnle->Bits.Present =
Attribute->Bits.Present looks like:
   and dword [rcx], 0xfffffffe
   and eax, 0x1
   or [rcx], eax
In case Pnle->Bits.Present and Attribute->Bits.Present
is 1, Pnle->Bits.Present will be set to 0 for short
time(2 instructions) which is unexpected. If some other
core is accessing the page, it may leads to expection.
This change reduce and optimize access to attribute of
page table, attribute of page table is set only when it
need to be changed.

Signed-off-by: Zhou Jianfeng <jianfeng.zhou@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
2024-02-06 08:51:48 +00:00
..
BaseRiscV64CpuExceptionHandlerLib UefiCpuPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
BaseRiscV64CpuTimerLib UefiCpuPkg: RISC-V: TimerLib: Fix delay function to use 64-bit 2023-06-15 05:32:51 +00:00
BaseRiscVMmuLib UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode 2023-10-17 07:44:25 +00:00
BaseXApicLib UefiCpuPkg/BaseXApic[X2]ApicLib: Implements AMD extended cpu topology 2024-01-31 13:08:29 +00:00
BaseXApicX2ApicLib UefiCpuPkg/BaseXApic[X2]ApicLib: Implements AMD extended cpu topology 2024-01-31 13:08:29 +00:00
CcExitLibNull OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib 2022-11-14 04:55:34 +00:00
CpuCacheInfoLib UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CpuCommonFeaturesLib UefiCpuPkg: Update PT code to support enable collect performance 2023-04-26 09:19:51 +00:00
CpuExceptionHandlerLib UefiCpuPkg: Update code to be more C11 compliant by using __func__ 2023-04-10 14:19:57 +00:00
CpuPageTableLib UefiCpuPkg: Reduce and optimize access to attribute 2024-02-06 08:51:48 +00:00
CpuTimerLib UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MicrocodeLib UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
MmSaveStateLib UefiCpuPkg: Uses gMmst in MmSaveStateLib 2023-07-17 09:43:43 +00:00
MpInitLib UefiCpuPkg: set EXTENDED_PROCESSOR_INFORMATION to 0 2024-01-09 16:31:57 +00:00
MpInitLibUp UefiCpuPkg: Check lower 24 bits of ProcessorNumber 2024-01-09 16:31:57 +00:00
MtrrLib UefiCpuPkg/MtrrUnitTest: Add Unit test of setting/getting memory 2023-10-09 08:22:02 +00:00
PlatformSecLibNull UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
RegisterCpuFeaturesLib UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-07 10:42:38 +00:00
SecPeiDxeTimerLibUefiCpu UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmCpuFeaturesLib UefiCpuPkg: Removes SmmCpuFeaturesReadSaveStateRegister 2023-07-03 03:01:10 +00:00
SmmCpuPlatformHookLibNull UefiCpuPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
SmmCpuRendezvousLib UefiCpuPkg: Extend SMM CPU Service with rendezvous support. 2022-03-04 05:44:42 +00:00
SmmCpuSyncLib UefiCpuPkg: Implements SmmCpuSyncLib library instance 2023-12-20 02:30:56 +00:00