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 B03F320886D98 for ; Sun, 17 Feb 2019 20:11:59 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Feb 2019 20:11:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,383,1544515200"; d="scan'208";a="321197960" Received: from mmdandap-mobl1.amr.corp.intel.com (HELO jljusten-skl.amr.corp.intel.com) ([10.254.8.66]) by fmsmga005.fm.intel.com with ESMTP; 17 Feb 2019 20:11:57 -0800 From: Jordan Justen To: edk2-devel@lists.01.org Cc: Jordan Justen , Liu Yu , Andrew Fish , Anthony Perard , Ard Biesheuvel , Hao Wu , Jian J Wang , Julien Grall , Laszlo Ersek , Ray Ni , Star Zeng Date: Sun, 17 Feb 2019 20:11:31 -0800 Message-Id: <20190218041141.21363-1-jordan.l.justen@intel.com> X-Mailer: git-send-email 2.20.0.rc1 MIME-Version: 1.0 Subject: [PATCH 00/10] Fix PEI Core issue during TemporaryRamMigration 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 04:11:59 -0000 Content-Transfer-Encoding: 8bit https://github.com/jljusten/edk2.git temp-ram-support This series fixes an issue that, while rare, is possible based on the way the TemporaryRamSupport PPI is defined along with how it is used by the PEI Core. Liu Yu reported a boot issue with EmulatorPkg, which I believe was caused by this issue. The details of the issue are described in the commit message of the "MdeModePkg/Core/Pei: Add code path to allow assembly temp-ram migration" patch. Along with this, I added a few Temporary RAM patches for EmulatorPkg and OvmfPkg. Cc: Liu Yu Cc: Andrew Fish Cc: Anthony Perard Cc: Ard Biesheuvel Cc: Hao Wu Cc: Jian J Wang Cc: Julien Grall Cc: Laszlo Ersek Cc: Ray Ni Cc: Star Zeng Jordan Justen (10): EmulatorPkg/build.sh: Fix missing usage of -b BUILDTARGET parameter EmulatorPkg/Unix/Host: Use PcdInitValueInTempStack to init temp-ram EmulatorPkg/Sec: Replace assembly temp-ram support with C code EmulatorPkg/Sec: Disable optimizations for TemporaryRamMigration function OvmfPkg/Sec: Swap TemporaryRam Stack and Heap locations OvmfPkg/Sec: Disable optimizations for TemporaryRamMigration MdeModePkg/Core/Pei: Add code path to allow assembly temp-ram migration MdeModulePkg/Core/Pei: Use assembly for X64 TemporaryRamMigration MdeModulePkg/Core/Pei: Use assembly for IA32 TemporaryRamMigration OvmfPkg/Sec: Fill Temp Ram after TemporaryRamMigration EmulatorPkg/Sec/Ia32/SwitchRam.S | 95 ------------------- EmulatorPkg/Sec/Ia32/SwitchRam.asm | 94 ------------------ EmulatorPkg/Sec/Ia32/TempRam.c | 65 ------------- EmulatorPkg/Sec/Sec.c | 76 ++++++++++++++- EmulatorPkg/Sec/Sec.inf | 13 +-- EmulatorPkg/Sec/X64/SwitchRam.S | 72 -------------- EmulatorPkg/Sec/X64/SwitchRam.asm | 76 --------------- EmulatorPkg/Unix/Host/Host.c | 2 +- EmulatorPkg/Unix/Host/Host.inf | 1 + EmulatorPkg/build.sh | 10 +- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 59 ++++++++---- .../Dispatcher/Ia32/TemporaryRamMigration.S | 72 ++++++++++++++ .../Ia32/TemporaryRamMigration.nasm | 78 +++++++++++++++ .../Pei/Dispatcher/TemporaryRamMigration.c | 52 ++++++++++ .../Dispatcher/X64/TemporaryRamMigration.S | 69 ++++++++++++++ .../Dispatcher/X64/TemporaryRamMigration.nasm | 75 +++++++++++++++ MdeModulePkg/Core/Pei/PeiMain.h | 52 ++++++++++ MdeModulePkg/Core/Pei/PeiMain.inf | 14 +++ OvmfPkg/Sec/Ia32/SecEntry.nasm | 2 +- OvmfPkg/Sec/SecMain.c | 59 ++++++++---- OvmfPkg/Sec/X64/SecEntry.nasm | 2 +- 21 files changed, 577 insertions(+), 461 deletions(-) delete mode 100644 EmulatorPkg/Sec/Ia32/SwitchRam.S delete mode 100644 EmulatorPkg/Sec/Ia32/SwitchRam.asm delete mode 100644 EmulatorPkg/Sec/Ia32/TempRam.c delete mode 100644 EmulatorPkg/Sec/X64/SwitchRam.S delete mode 100644 EmulatorPkg/Sec/X64/SwitchRam.asm create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.S create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/Ia32/TemporaryRamMigration.nasm create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/TemporaryRamMigration.c create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/X64/TemporaryRamMigration.S create mode 100644 MdeModulePkg/Core/Pei/Dispatcher/X64/TemporaryRamMigration.nasm -- 2.20.0.rc1