]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to fix hang
authorRuiyu Ni <ruiyu.ni@intel.com>
Mon, 23 Oct 2017 05:11:40 +0000 (13:11 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Mon, 23 Oct 2017 07:49:04 +0000 (15:49 +0800)
ClearMasks and OrMasks are not 8-byte aligned.
But SetMem64 requires the input address is 8-byte aligned.
If the input is not 8-byte aligned, assertion is hit.
Use SetMem instead.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
UefiCpuPkg/Library/MtrrLib/MtrrLib.c

index 200becdd4a2500eb3145788bc2f97a19a47c3aae..8e46e46cd437de8c418d88c5afc7fed761fb9ac4 100644 (file)
@@ -2123,8 +2123,8 @@ MtrrLibSetBelow1MBMemoryAttribute (
   //\r
   // (Value & ~0 | 0) still equals to (Value)\r
   //\r
   //\r
   // (Value & ~0 | 0) still equals to (Value)\r
   //\r
-  SetMem64 (ClearMasks, sizeof (ClearMasks), 0);\r
-  SetMem64 (OrMasks, sizeof (OrMasks), 0);\r
+  SetMem (ClearMasks, sizeof (ClearMasks), 0);\r
+  SetMem (OrMasks, sizeof (OrMasks), 0);\r
 \r
   MsrIndex = (UINT32)-1;\r
   while ((BaseAddress < BASE_1MB) && (Length != 0)) {\r
 \r
   MsrIndex = (UINT32)-1;\r
   while ((BaseAddress < BASE_1MB) && (Length != 0)) {\r