diff options
author | Min Xu <min.m.xu@intel.com> | 2021-10-18 13:06:59 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-04-02 08:15:12 +0000 |
commit | bec9104201296e4161862a18f0ce3a3d376e68de (patch) | |
tree | c59ca3a7034275dd1424359e3fe8cf5988857d5e | |
parent | 6b27c11690e7c093fa5670e854d10308c847a75d (diff) | |
download | edk2-bec9104201296e4161862a18f0ce3a3d376e68de.tar.gz edk2-bec9104201296e4161862a18f0ce3a3d376e68de.tar.bz2 edk2-bec9104201296e4161862a18f0ce3a3d376e68de.zip |
MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set
RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
If IA32_ERER.NXE has already been set, skip setting it again.
Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
-rw-r--r-- | MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c index 1ebab27820..a451ca1604 100644 --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c @@ -179,9 +179,11 @@ EnableExecuteDisableBit ( {
UINT64 MsrRegisters;
- MsrRegisters = AsmReadMsr64 (0xC0000080);
- MsrRegisters |= BIT11;
- AsmWriteMsr64 (0xC0000080, MsrRegisters);
+ MsrRegisters = AsmReadMsr64 (0xC0000080);
+ if ((MsrRegisters & BIT11) == 0) {
+ MsrRegisters |= BIT11;
+ AsmWriteMsr64 (0xC0000080, MsrRegisters);
+ }
}
/**
|