audk/UefiCpuPkg/Library/CpuPageTableLib
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
..
UnitTest UefiCpuPkg/CpuPageTableLib/TestCase: Refine test case for PAE paging. 2023-12-06 05:30:55 +00:00
CpuPageTable.h UefiCpuPkg/CpuPageTableLib: Enable PAE paging 2023-03-27 08:21:58 +00:00
CpuPageTableLib.inf UefiCpuPkg: Create CpuPageTableLib for manipulating X86 paging structs 2022-08-09 07:08:05 +00:00
CpuPageTableMap.c UefiCpuPkg: Reduce and optimize access to attribute 2024-02-06 08:51:48 +00:00
CpuPageTableParse.c UefiCpuPkg/CpuPageTableLib: Enable PAE paging 2023-03-27 08:21:58 +00:00