audk/UefiCpuPkg/Library
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
..
AmdSvsmLibNull UefiCpuPkg/AmdSvsmLib: Create the AmdSvsmLib library to support an SVSM 2024-04-17 18:30:03 +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: Support Svpbmt extension 2024-04-08 05:43:59 +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/Library: Cleanup debug message in LmceSupport 2024-04-30 07:15:46 +00:00
CpuExceptionHandlerLib UefiCpuPkg: Add CPU exception library for LoongArch 2024-04-16 06:00:32 +00:00
CpuMmuLib UefiCpuPkg: Add CpuMmuLib to UefiCpuPkg 2024-04-16 06:00:32 +00:00
CpuPageTableLib UefiCpuPkg:fix issue when splitting paging entry 2024-06-04 12:38:54 +00:00
CpuTimerLib UefiCpuPkg: Add LoongArch64 CPU Timer instance 2024-04-16 06:00:32 +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:Relocate AP to new safe buffer in PeiMpLib 2024-06-04 07:40:27 +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/Library: Support to get processor extended info 2024-05-08 08:17:31 +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
SmmRelocationLib UefiCpuPkg/SmmRelocationLib: Add library instance for AMD 2024-05-08 01:53:58 +00:00