]> git.proxmox.com Git - mirror_edk2.git/commit
UefiCpuPkg/PiSmmCpuDxeSmm:Fix PF issue caused by smm page table code
authorTan, Dun <dun.tan@intel.com>
Tue, 3 Jan 2023 05:56:17 +0000 (13:56 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 3 Jan 2023 06:41:11 +0000 (06:41 +0000)
commitb670700ddf5eb1dd958d60eb4f2a51e0636206f9
treea0dd7fc968848ecf918a2ab40abc037a54b01f2c
parentbbd30066e137c036db140b6e58e6e172e2827eb3
UefiCpuPkg/PiSmmCpuDxeSmm:Fix PF issue caused by smm page table code

When setting new page table pool to RO, only disable/enable WP when
Cr0.WP has been set to 1 to fix potential PF caused by b822be1a20
(UefiCpuPkg/PiSmmCpuDxeSmm: Introduce page table pool mechanism).
With previous code, if someone want to modify the page table and
Cr0.WP has been cleared before modify page table, Cr0.WP may be set
to 1 again since new pool may be generated during this process
Then PF fault may happens.

Signed-off-by: Dun Tan <dun.tan@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/SmmCpuMemoryManagement.c