diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c index 50614f32c3..69a04dfb23 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.c @@ -1121,9 +1121,6 @@ FindSmramInfo ( *SmrrBase = (UINT32)CurrentSmramRange->CpuStart; *SmrrSize = (UINT32)CurrentSmramRange->PhysicalSize; - // - // Extend *SmrrBase/*SmrrSize to include adjacent SMRAM ranges - // do { Found = FALSE; for (Index = 0; Index < mSmmCpuSmramRangeCount; Index++) { @@ -1435,20 +1432,14 @@ PerformRemainingTasks ( SetMemMapAttributes (); // - // Do not protect memory outside SMRAM when SMM static page table is not enabled. + // For outside SMRAM, we only map SMM communication buffer or MMIO. // - if (mCpuSmmStaticPageTable) { + SetUefiMemMapAttributes (); - // - // For outside SMRAM, we only map SMM communication buffer or MMIO. - // - SetUefiMemMapAttributes (); - - // - // Set page table itself to be read-only - // - SetPageTableAttributes (); - } + // + // Set page table itself to be read-only + // + SetPageTableAttributes (); // // Configure SMM Code Access Check feature if available.