From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jordan.l.justen@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 0FA42202E5309 for ; Sun, 17 Feb 2019 18:45:28 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2019 18:45:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,382,1544515200"; d="scan'208";a="116975565" Received: from mmdandap-mobl1.amr.corp.intel.com (HELO localhost) ([10.254.8.66]) by orsmga006.jf.intel.com with ESMTP; 17 Feb 2019 18:45:27 -0800 MIME-Version: 1.0 In-Reply-To: <848819df-1225-3660-00af-80bf95122ae6@Intel.com> References: <1274938c-dfdb-d6da-8caa-9fc6674eb1b1@Intel.com> <155030827034.1052.16419444135424097946@jljusten-skl> <848819df-1225-3660-00af-80bf95122ae6@Intel.com> To: "Ni, Ray" , Andrew Fish , Laszlo Ersek , Liu Yu From: Jordan Justen Cc: "edk2-devel@lists.01.org" Message-ID: <155045792639.20549.10652194945643646136@jljusten-skl> User-Agent: alot/0.8 Date: Sun, 17 Feb 2019 18:45:26 -0800 Subject: Re: EmulatorPkg Unix Host Segmentation fault. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2019 02:45:28 -0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 2019-02-17 18:25:01, Ni, Ray wrote: > Jordan, > > Study the PeiCore migration logic a bit more, I found since PeiCore > > knows the exact size of new stack in permanent memory, it migrates > > old stack to the top of new stack. > > But the migration logic in above C code (since it doesn't know the > > size of new stack, CopySize is the size of temporary memory) may copy = > > the old stack to the middle in new stack. >=20 > Maybe your new RamMigration2 PPI needs to carry both the old and new=20 > stack/heap location and size. > It helps: > 1. migrate the old stack to top of new stack (instead of middle of new=20 > stack). > 2. potentially reduce the size of memory that needs to be copied. >=20 > TemporaryRamMigration ( > IN CONST EFI_PEI_SERVICES **PeiServices, > IN EFI_PHYSICAL_ADDRESS TemporaryStackBase, > IN EFI_PHYSICAL_ADDRESS PermanentStackSize, > IN EFI_PHYSICAL_ADDRESS TemporaryHeapBase, > IN EFI_PHYSICAL_ADDRESS PermanentHeapSize, > IN TEMPORARY_RAM_MIGRATION_CALLBACK Callback, > IN VOID *Context > ) Hmm. I'll think about that for the new PPI. > Before the finalize of PI spec change regarding the RamMigration2=20 > change, I prefer to fix the EmulatorPkg boot crash ASAP using the > OVMF-like solution. > If you agree, I will send out the patch to let you review. You are right that it will take more time for a new PPI. But, I have almost finished my patches to fix the PEI Core with the old PPI. I'll try to send them out tonight. -Jordan