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.20; helo=mga02.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 51948202E5CC4 for ; Mon, 23 Oct 2017 00:08:18 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Oct 2017 00:12:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,421,1503385200"; d="scan'208";a="912645401" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 23 Oct 2017 00:12:00 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Oct 2017 00:12:00 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 23 Oct 2017 00:11:59 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.175]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Mon, 23 Oct 2017 15:11:57 +0800 From: "Dong, Eric" To: "Ni, Ruiyu" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to fix hang Thread-Index: AQHTS717doALXxebi0KBtQMLM7se6qLxBN9g Date: Mon, 23 Oct 2017 07:11:56 +0000 Message-ID: References: <20171023051205.197944-1-ruiyu.ni@intel.com> In-Reply-To: <20171023051205.197944-1-ruiyu.ni@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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 07:08:18 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Eric Dong > -----Original Message----- > From: Ni, Ruiyu > Sent: Monday, October 23, 2017 1:12 PM > To: edk2-devel@lists.01.org > Cc: Dong, Eric > Subject: [PATCH] UefiCpuPkg/MtrrLib: Use SetMem instead of SetMem64 to > fix hang >=20 > 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. >=20 > 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(-) >=20 > 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); >=20 > MsrIndex =3D (UINT32)-1; > while ((BaseAddress < BASE_1MB) && (Length !=3D 0)) { > -- > 2.12.2.windows.2