Closed kenlautner closed 1 month ago
All modified and coverable lines are covered by tests :white_check_mark:
Please upload report for BASE (
release/202405@6664692
). Learn more about missing BASE report.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
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.
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
How This Was Tested
Tested on Intel physical platforms that were hitting a paging split issue and ones that weren't having any problems. With this fix both platforms are able to boot correctly.
Integration Instructions
N/A