mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
UefiCpuPkg/PiSmmCpu: Allow SMM access-out when static paging is OFF
Commit c60d36b4d1ee1f69b7cca897d3621dfa951895c2 * UefiCpuPkg/SmmCpu: Block access-out only when static paging is used updated page fault handler to treat SMM access-out as allowed address when static paging is not used. But that commit is not complete because the page table is still updated in SetUefiMemMapAttributes() for non-SMRAM memory. When SMM code accesses non-SMRAM memory, page fault is still generated. This patch skips to update page table for non-SMRAM memory and page table itself. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
This commit is contained in:
parent
520a1e60de
commit
30f6148546
@ -1121,6 +1121,9 @@ FindSmramInfo (
|
|||||||
*SmrrBase = (UINT32)CurrentSmramRange->CpuStart;
|
*SmrrBase = (UINT32)CurrentSmramRange->CpuStart;
|
||||||
*SmrrSize = (UINT32)CurrentSmramRange->PhysicalSize;
|
*SmrrSize = (UINT32)CurrentSmramRange->PhysicalSize;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Extend *SmrrBase/*SmrrSize to include adjacent SMRAM ranges
|
||||||
|
//
|
||||||
do {
|
do {
|
||||||
Found = FALSE;
|
Found = FALSE;
|
||||||
for (Index = 0; Index < mSmmCpuSmramRangeCount; Index++) {
|
for (Index = 0; Index < mSmmCpuSmramRangeCount; Index++) {
|
||||||
@ -1431,6 +1434,11 @@ PerformRemainingTasks (
|
|||||||
//
|
//
|
||||||
SetMemMapAttributes ();
|
SetMemMapAttributes ();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Do not protect memory outside SMRAM when SMM static page table is not enabled.
|
||||||
|
//
|
||||||
|
if (mCpuSmmStaticPageTable) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// For outside SMRAM, we only map SMM communication buffer or MMIO.
|
// For outside SMRAM, we only map SMM communication buffer or MMIO.
|
||||||
//
|
//
|
||||||
@ -1440,6 +1448,7 @@ PerformRemainingTasks (
|
|||||||
// Set page table itself to be read-only
|
// Set page table itself to be read-only
|
||||||
//
|
//
|
||||||
SetPageTableAttributes ();
|
SetPageTableAttributes ();
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Configure SMM Code Access Check feature if available.
|
// Configure SMM Code Access Check feature if available.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user