audk/UefiCpuPkg/Library/CpuPageTableLib
Dun Tan 839bd17973 UefiCpuPkg:fix issue when splitting paging entry
This patch is to fix issue when splitting leaf paging
entry in CpuPageTableLib code.

In previous code, before we assign the new child paging
structure address to the content of splitted paging entry,
PageTableLibSetPnle() is called to make sure the bit7 is
set to 0, which indicate the previous leaf entry is
changed to non-leaf entry now. There is a gap between
we change the bit7 and we assign the new child paging
structure address to the content of the splitted paging
entry. If the address of code execution or data access
happens to be in the range covered by the splitted paging
entry, this gap may cause issue.

In this patch, we prepare the new paging entry content
value in a local variable and assign the value to the
splitted paging entry at once. The volatile keyword
is used to ensure that no optimization will occur in
compilation.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
Cc: Zhou Jianfeng <jianfeng.zhou@intel.com>
2024-06-04 12:38:54 +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:fix issue when splitting paging entry 2024-06-04 12:38:54 +00:00
CpuPageTableParse.c UefiCpuPkg/CpuPageTableLib: Enable PAE paging 2023-03-27 08:21:58 +00:00