summaryrefslogtreecommitdiff
path: root/BaseTools/Source
diff options
context:
space:
mode:
authorZhou Jianfeng <jianfeng.zhou@intel.com>2024-02-02 22:20:09 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-06 08:51:48 +0000
commit30a25f277821a1c8a168f6f3050721aa13f44b8d (patch)
treee71ba5c0b1d5c59ae8e55fb39365600920cc9642 /BaseTools/Source
parent056b4bf74bf5cfa2c0c9c5e44a7c5f3f461d17c0 (diff)
downloadedk2-30a25f277821a1c8a168f6f3050721aa13f44b8d.zip
edk2-30a25f277821a1c8a168f6f3050721aa13f44b8d.tar.gz
edk2-30a25f277821a1c8a168f6f3050721aa13f44b8d.tar.bz2
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>
Diffstat (limited to 'BaseTools/Source')
0 files changed, 0 insertions, 0 deletions