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.43, mailfrom: eric.dong@intel.com) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by groups.io with SMTP; Mon, 12 Aug 2019 19:17:20 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 19:17:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,379,1559545200"; d="scan'208";a="187633274" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga002.jf.intel.com with ESMTP; 12 Aug 2019 19:17:19 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 19:17:19 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.19]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.204]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 10:17:17 +0800 From: "Dong, Eric" To: "Bi, Dandan" , "Zhang, Shenglei" , "devel@edk2.groups.io" CC: "Gao, Liming" , "Wu, Hao A" , Laszlo Ersek 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: AQHVUNal0ifMOeOoBUu6z2wVVJrw0Kb3zwoAgACJkrA= Date: Tue, 13 Aug 2019 02:17:15 +0000 Message-ID: References: <20190812062444.14572-1-shenglei.zhang@intel.com> <3C0D5C461C9E904E8F62152F6274C0BB40C3E114@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <3C0D5C461C9E904E8F62152F6274C0BB40C3E114@SHSMSX104.ccr.corp.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 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Agree with Dandan's comments. With that update, Reviewed-by: Eric Dong > -----Original Message----- > From: Bi, Dandan > Sent: Tuesday, August 13, 2019 10:04 AM > To: Zhang, Shenglei ; devel@edk2.groups.io > Cc: Gao, Liming ; Wu, Hao A ; > Laszlo Ersek ; Dong, Eric > Subject: RE: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the > operation of PageMapLevel5Entry++ >=20 > > -----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++ > > > > 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. > I think "uninitialized" here should be a typo, you may mean "initialized"= . > Please update it before commit. > I have no other comments for this patch. > Reviewed-by: Dandan Bi >=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(-) > > > > 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 ( > > > > 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++; > > } > > > > for ( IndexOfPml4Entries =3D 0 > > -- > > 2.18.0.windows.1