From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C79E4202E5CC4 for ; Sun, 22 Oct 2017 22:08:25 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2017 22:12:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,421,1503385200"; d="scan'208";a="141119395" Received: from ray-dev.ccr.corp.intel.com ([10.239.9.7]) by orsmga004.jf.intel.com with ESMTP; 22 Oct 2017 22:12:07 -0700 From: Ruiyu Ni To: edk2-devel@lists.01.org Cc: Eric Dong Date: Mon, 23 Oct 2017 13:12:05 +0800 Message-Id: <20171023051205.197944-1-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 Subject: [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to fix hang X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 05:08:25 -0000 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 Cc: Eric Dong --- UefiCpuPkg/Library/MtrrLib/MtrrLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c index 200becdd4a..8e46e46cd4 100644 --- a/UefiCpuPkg/Library/MtrrLib/MtrrLib.c +++ b/UefiCpuPkg/Library/MtrrLib/MtrrLib.c @@ -2123,8 +2123,8 @@ MtrrLibSetBelow1MBMemoryAttribute ( // // (Value & ~0 | 0) still equals to (Value) // - SetMem64 (ClearMasks, sizeof (ClearMasks), 0); - SetMem64 (OrMasks, sizeof (OrMasks), 0); + SetMem (ClearMasks, sizeof (ClearMasks), 0); + SetMem (OrMasks, sizeof (OrMasks), 0); MsrIndex = (UINT32)-1; while ((BaseAddress < BASE_1MB) && (Length != 0)) { -- 2.12.2.windows.2