From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 3BBCB81D65 for ; Thu, 3 Nov 2016 20:28:24 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 03 Nov 2016 20:28:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,442,1473145200"; d="scan'208";a="897561690" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga003.jf.intel.com with ESMTP; 03 Nov 2016 20:28:26 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 3 Nov 2016 20:28:25 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.206]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.104]) with mapi id 14.03.0248.002; Fri, 4 Nov 2016 11:28:23 +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: AQHSNkHtn8xB55OhG0C8cEg5aKYWoqDIKncg Date: Fri, 4 Nov 2016 03:28:22 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B49EA48@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 03:28:24 -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