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.120, mailfrom: dandan.bi@intel.com) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by groups.io with SMTP; Mon, 12 Aug 2019 19:04:22 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Aug 2019 19:04:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,379,1559545200"; d="scan'208";a="327538898" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 12 Aug 2019 19:04:21 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) 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:04:21 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 12 Aug 2019 19:04:20 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.250]) with mapi id 14.03.0439.000; Tue, 13 Aug 2019 10:04:18 +0800 From: "Dandan Bi" 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++ Thread-Topic: [PATCH 1/1] MdeModulePkg/DxeIplPeim: Relocate the operation of PageMapLevel5Entry++ Thread-Index: AQHVUNalOy4wUBPuEEO9hYR4r932i6b4VAUw Date: Tue, 13 Aug 2019 02:04:18 +0000 Message-ID: <3C0D5C461C9E904E8F62152F6274C0BB40C3E114@SHSMSX104.ccr.corp.intel.com> References: <20190812062444.14572-1-shenglei.zhang@intel.com> In-Reply-To: <20190812062444.14572-1-shenglei.zhang@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: dandan.bi@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----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. 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(-) >=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++; > } >=20 > for ( IndexOfPml4Entries =3D 0 > -- > 2.18.0.windows.1