From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: hao.a.wu@intel.com) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by groups.io with SMTP; Mon, 12 Aug 2019 18:51:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 18:51:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,379,1559545200"; d="scan'208";a="194091162" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga001.fm.intel.com with ESMTP; 12 Aug 2019 18:51:04 -0700 Received: from fmsmsx157.amr.corp.intel.com (10.18.116.73) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 18:51:04 -0700 Received: from shsmsx108.ccr.corp.intel.com (10.239.4.97) by FMSMSX157.amr.corp.intel.com (10.18.116.73) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 18:51:03 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX108.ccr.corp.intel.com ([169.254.8.163]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 09:51:01 +0800 From: "Wu, Hao A" To: "Dong, Eric" , "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Bi, Dandan" , "Gao, Liming" , Laszlo Ersek , "Dong, Eric" Subject: Re: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++ Thread-Topic: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++ Thread-Index: AQHVUNakBfgQhoVXDEW1zQG4UQhSnqb4UScw Date: Tue, 13 Aug 2019 01:51:01 +0000 Message-ID: References: <20190812062444.14572-1-shenglei.zhang@intel.com> In-Reply-To: <20190812062444.14572-1-shenglei.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: hao.a.wu@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello Eric, Could you help to take a look at this one as well? > -----Original Message----- > From: Zhang, Shenglei > Sent: Monday, August 12, 2019 2:25 PM > To: devel@edk2.groups.io > Cc: Bi, Dandan; Gao, Liming; Wu, Hao A; Laszlo Ersek; Dong, Eric > Subject: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of > PageMapLevel5Entry++ >=20 > PageMapLevel5Entry may be uninitialized in original code, which means > uninitialized pointer will be modified at some circumstance. > So relocate the operation of PageMapLevel5Entry++ in order to make sure > the pointer could be modified only when it is uninitialized. >=20 > Cc: Dandan Bi > Cc: Liming Gao > Cc: Hao A Wu > Cc: Laszlo Ersek > Cc: Eric Dong > Signed-off-by: Shenglei Zhang > --- > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > index b40b7e0c9813..2389f3eb485b 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > @@ -764,7 +764,7 @@ CreateIdentityMappingPageTables ( >=20 > for ( IndexOfPml5Entries =3D 0 > ; IndexOfPml5Entries < NumberOfPml5EntriesNeeded > - ; IndexOfPml5Entries++, PageMapLevel5Entry++) { > + ; IndexOfPml5Entries++) { > // > // Each PML5 entry points to a page of PML4 entires. > // So lets allocate space for them and fill them in in the > IndexOfPml4Entries loop. > @@ -780,6 +780,7 @@ CreateIdentityMappingPageTables ( > PageMapLevel5Entry->Uint64 =3D (UINT64) (UINTN) PageMapLevel4Entry= | > AddressEncMask; > PageMapLevel5Entry->Bits.ReadWrite =3D 1; > PageMapLevel5Entry->Bits.Present =3D 1; > + PageMapLevel5Entry++; > } I think the change is fine, Reviewed-by: Hao A Wu Best Regards, Hao Wu >=20 > for ( IndexOfPml4Entries =3D 0 > -- > 2.18.0.windows.1