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; Tue, 06 Aug 2019 23:18:35 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 23:18:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,356,1559545200"; d="scan'208";a="198552937" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga004.fm.intel.com with ESMTP; 06 Aug 2019 23:18:35 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 6 Aug 2019 23:18:35 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 6 Aug 2019 23:18:34 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 6 Aug 2019 23:18:34 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.112]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.62]) with mapi id 14.03.0439.000; Wed, 7 Aug 2019 14:18:33 +0800 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Kinney, Michael D" CC: "Justen, Jordan L" , Andrew Fish , "Ni, Ray" Subject: Re: [edk2-devel] [Patch 1/3] EmulatorPkg: Fix VS20xx IA32 boot failure Thread-Topic: [edk2-devel] [Patch 1/3] EmulatorPkg: Fix VS20xx IA32 boot failure Thread-Index: AQHVTNd+Rm75Bk+rO0iAi4yFu3ogK6bvMWIg Date: Wed, 7 Aug 2019 06:18:32 +0000 Message-ID: References: <20190807042028.21988-1-michael.d.kinney@intel.com> <20190807042028.21988-2-michael.d.kinney@intel.com> In-Reply-To: <20190807042028.21988-2-michael.d.kinney@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 > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Michael D Kinney > Sent: Wednesday, August 07, 2019 12:20 PM > To: devel@edk2.groups.io > Cc: Justen, Jordan L; Andrew Fish; Ni, Ray > Subject: [edk2-devel] [Patch 1/3] EmulatorPkg: Fix VS20xx IA32 boot fail= ure >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D2056 >=20 > The IA32 build of the EmulatorPkg for VS20xx does not boot > because the default value of PCD PcdPeiServicesTablePage > is set for X64 Windows Host environments. If the > EmulatorPkg is build for an IA32 Windows Host environment, > then set this PCD to 0x13000000 that can be mapped into a > 32-bit user process. Hello Mike, I have a question for this patch. For the main() function within file EmulatorPkg/Win/Host/WinHost.c, I saw the below codes: EmuMagicPage =3D (VOID *)(UINTN)(FixedPcdGet64 (PcdPeiServicesTablePage)= & MAX_UINTN); if (EmuMagicPage !=3D NULL) { UINT64 Size; Status =3D WinNtOpenFile ( NULL, SIZE_4KB, 0, &EmuMagicPage, &Size ); if (EFI_ERROR (Status)) { SecPrint ("ERROR : Could not allocate PeiServicesTablePage @ %p\n", = EmuMagicPage); return EFI_DEVICE_ERROR; } } My understanding is that the WinNtOpenFile() function call is attempting to map the address specified by 'EmuMagicPage'. For IA32 case, the value in 'EmuMagicPage' here has already been truncated (0x03000000). If the WinNtOpenFile() call returned successfully, the address should be mapped. Is it the case that even if WinNtOpenFile() returns with no error, the specified address (0x03000000) is not actually being mapped? Best Regards, Hao Wu >=20 > Cc: Jordan Justen > Cc: Andrew Fish > Cc: Ray Ni > Signed-off-by: Michael D Kinney > --- > EmulatorPkg/EmulatorPkg.dsc | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc > index ea8b6ce76e..c4ec10d1d8 100644 > --- a/EmulatorPkg/EmulatorPkg.dsc > +++ b/EmulatorPkg/EmulatorPkg.dsc > @@ -4,7 +4,7 @@ > # The Emulation Platform can be used to debug individual modules, prior= to > creating > # a real platform. This also provides an example for how an DSC is crea= ted. > # > -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. > +# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved. > # Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved. > # > # SPDX-License-Identifier: BSD-2-Clause-Patent > @@ -225,6 +225,10 @@ [PcdsFixedAtBuild] > # 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM > gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1 >=20 > +!if "IA32" in $(ARCH) && "MSFT" in $(FAMILY) > + gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x13000000 > +!endif > + > [PcdsDynamicDefault.common.DEFAULT] > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase64|0 >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase64| > 0 > -- > 2.21.0.windows.1 >=20 >=20 >=20