summaryrefslogtreecommitdiff
path: root/UefiCpuPkg/CpuMpPei
diff options
context:
space:
mode:
authorZhiguang Liu <zhiguang.liu@intel.com>2024-01-10 13:39:42 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-02-22 03:28:55 +0000
commitc10e5703fece76810cad7a5c27914b545def91ff (patch)
treee3477d2d921062a2f5ec0694a688e8c5f8413923 /UefiCpuPkg/CpuMpPei
parent2f4b07b668323122a363eee87a2348f4a738bc8c (diff)
downloadedk2-c10e5703fece76810cad7a5c27914b545def91ff.zip
edk2-c10e5703fece76810cad7a5c27914b545def91ff.tar.gz
edk2-c10e5703fece76810cad7a5c27914b545def91ff.tar.bz2
UefiCpuPkg/CpuMpPei: Don't write CR3 in ConvertMemoryPageToNotPresent
The purpose of writing CR3 in ConvertMemoryPageToNotPresent is just to flush TLB, because CR3 won't be changed in function ConvertMemoryPageToNotPresent. After ConvertMemoryPageToNotPresent, there is always a flush TLB function. Also, because ConvertMemoryPageToNotPresent in called in a loop, to improve performance, there is no need to flush TLB inside ConvertMemoryPageToNotPresent. Just flushing TLB after the loop is enough. Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
Diffstat (limited to 'UefiCpuPkg/CpuMpPei')
-rw-r--r--UefiCpuPkg/CpuMpPei/CpuPaging.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/UefiCpuPkg/CpuMpPei/CpuPaging.c b/UefiCpuPkg/CpuMpPei/CpuPaging.c
index 15c7015..b923d9b 100644
--- a/UefiCpuPkg/CpuMpPei/CpuPaging.c
+++ b/UefiCpuPkg/CpuMpPei/CpuPaging.c
@@ -76,7 +76,8 @@ AllocatePageTableMemory (
/**
This function modifies the page attributes for the memory region specified
- by BaseAddress and Length to not present.
+ by BaseAddress and Length to not present. This function only change page
+ table, but not flush TLB. Caller have the responsbility to flush TLB.
Caller should make sure BaseAddress and Length is at page boundary.
@@ -167,7 +168,6 @@ ConvertMemoryPageToNotPresent (
}
ASSERT_EFI_ERROR (Status);
- AsmWriteCr3 (PageTable);
return Status;
}