]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/PiSmmCpuDxeSmm/SmmProfile.c
UefiCpuPkg/PiSmmCpuDxeSmm: fix 2M->4K page splitting regression for PDEs
[mirror_edk2.git] / UefiCpuPkg / PiSmmCpuDxeSmm / SmmProfile.c
index c5131526f0c638555f922792938c0b0d02f04226..c47b5573e366bf5e8b4f56e9496d0e739d605e41 100644 (file)
@@ -657,11 +657,9 @@ InitPaging (
             Pt = AllocatePageTableMemory (1);\r
             ASSERT (Pt != NULL);\r
 \r
-            *Pd = (UINTN) Pt | IA32_PG_RW | IA32_PG_P;\r
-\r
             // Split it\r
-            for (PtIndex = 0; PtIndex < SIZE_4KB / sizeof(*Pt); PtIndex++, Pt++) {\r
-              *Pt = Address + ((PtIndex << 12) | mAddressEncMask | PAGE_ATTRIBUTE_BITS);\r
+            for (PtIndex = 0; PtIndex < SIZE_4KB / sizeof(*Pt); PtIndex++) {\r
+              Pt[PtIndex] = Address + ((PtIndex << 12) | mAddressEncMask | PAGE_ATTRIBUTE_BITS);\r
             } // end for PT\r
             *Pd = (UINT64)(UINTN)Pt | mAddressEncMask | PAGE_ATTRIBUTE_BITS;\r
           } // end if IsAddressSplit\r