From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3A15881CCC for ; Thu, 3 Nov 2016 21:49:13 -0700 (PDT) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP; 03 Nov 2016 21:49:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,442,1473145200"; d="scan'208";a="27631808" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga004.jf.intel.com with ESMTP; 03 Nov 2016 21:49:14 -0700 Received: from fmsmsx153.amr.corp.intel.com (10.18.125.6) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Nov 2016 21:49:14 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX153.amr.corp.intel.com (10.18.125.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Nov 2016 21:49:14 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Fri, 4 Nov 2016 12:49:10 +0800 From: "Gao, Liming" To: "Fan, Jeff" , "edk2-devel@lists.01.org" CC: "Tian, Feng" , "Kinney, Michael D" Thread-Topic: [PATCH 3/3] MdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS Thread-Index: AQHSNkHtn8xB55OhG0C8cEg5aKYWoqDIQQWA Date: Fri, 4 Nov 2016 04:49:09 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B49EA8A@shsmsx102.ccr.corp.intel.com> References: <20161104021902.17364-1-jeff.fan@intel.com> <20161104021902.17364-4-jeff.fan@intel.com> In-Reply-To: <20161104021902.17364-4-jeff.fan@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 3/3] MdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Nov 2016 04:49:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Fan, Jeff > Sent: Friday, November 04, 2016 10:19 AM > To: edk2-devel@lists.01.org > Cc: Tian, Feng ; Gao, Liming ; > Kinney, Michael D > Subject: [PATCH 3/3] MdeModulePkg/DxeIplPeim: UINTN used wrongly for > EFI_PHYSICAL_ADDRESS >=20 > PeiServicesAllocatePages () will output sizeof (EFI_PHYSICAL_ADDRESS) > value. > IdtTableForX64 is sizeof (UINTN) local variable. It will overwrite other = local > variable. >=20 > This issue is found when we dump BaseOfStack value. >=20 > Cc: Feng Tian > Cc: Liming Gao > Cc: Michael Kinney > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Jeff Fan > --- > MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c > b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c > index 6ec51ff..8f6a97a 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c > +++ b/MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c > @@ -280,7 +280,7 @@ HandOffToDxeCore ( > Status =3D PeiServicesAllocatePages ( > EfiBootServicesData, > EFI_SIZE_TO_PAGES(sizeof (X64_IDT_TABLE) + SizeOfTemplate= * > IDT_ENTRY_COUNT), > - (EFI_PHYSICAL_ADDRESS *) &IdtTableForX64 > + &VectorAddress > ); > ASSERT_EFI_ERROR (Status); >=20 > @@ -288,6 +288,7 @@ HandOffToDxeCore ( > // Store EFI_PEI_SERVICES** in the 4 bytes immediately preceding IDT= to > avoid that > // it may not be gotten correctly after IDT register is re-written. > // > + IdtTableForX64 =3D (X64_IDT_TABLE *) (UINTN) VectorAddress; > IdtTableForX64->PeiService =3D GetPeiServicesTablePointer (); >=20 > VectorAddress =3D (EFI_PHYSICAL_ADDRESS) (UINTN) (IdtTableForX64 + 1= ); > -- > 2.9.3.windows.2