Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Laszlo Ersek f98f5ec304 UefiCpuPkg: S3Resume2Pei: align return stacks explicitly
S3RestoreConfig2() can optionally stack-switch to the SMM S3 Resume Entry
Point and ask it to transfer to S3ResumeExecuteBootScript().

Similarly, S3ResumeExecuteBootScript() stack-switches explicitly to the
boot script executor, and asks it to transfer to S3ResumeBootOs().

Currently the stack pointers specified for the SMM S3 Resume Entry Point
and the boot script executor to use for returning are derived from
addresses of the first local variables in S3RestoreConfig2() and
S3ResumeExecuteBootScript(), respectively.

Since (theoretically) the stack grows down as local variables are defined
and functions are called, the idea is presumably to allow the respective
callee to overwrite the caller's local variables. (The callees in
question can never return normally, only by explicit stack switching.)

Taking the address of "Status" is less portable than optimal however.
Compilers are free to juggle local variables at build time as they
please, including order and alignment on the stack. For example, when the
code is built for 64-bit PEI with gcc-4.8.2, the address of "Status"
trips up the alignment assertion in SwitchStack().

Let's align the address of "Status" down to CPU_STACK_ALIGNMENT
explicitly. If a compiler ensures such alignment and places "Status" at
the highest address automatically, then this change has no effect.
Otherwise, we'll prepare ReturnStackPointer values that (a) are correctly
aligned, (b) preserve the same amount or more (but never less) from the
caller's local variables than before, which should be safe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed by: Jiewen Yao <Jiewen.Yao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14977 6f19259b-4bc3-4df7-8a09-765794883524
2013-12-13 03:22:33 +00:00
AppPkg Enable the build command override the .DSC file contents to enable debug output and specify which debug messages are displayed. An example: 2013-11-19 02:37:37 +00:00
ArmPkg ARM Packages: Removed 'inline' keyword 2013-12-10 16:39:54 +00:00
ArmPlatformPkg ARM Packages: Removed 'inline' keyword 2013-12-10 16:39:54 +00:00
BaseTools Sync BaseTool trunk (version r2610) into EDKII BaseTools. 2013-11-18 07:41:21 +00:00
BeagleBoardPkg ArmPlatformPkg: Fix and Implement ArmPlatformGetPrimaryCoreMpId 2013-12-06 16:11:34 +00:00
Conf Adding top-level Conf directory for next generation of EDK II build infrastructure tools. 2007-06-20 19:33:23 +00:00
CryptoPkg Fixed one typo in MathRShiftU64.S stub implementation; Add one digest algorithm registration to make sure the underlying algorithm is available for the default OpenSSL software PRNG implementation. 2013-11-19 02:57:19 +00:00
DuetPkg Fix Duet hang/reboot issue due to the NULL instance of CpuExceptionHandlerLib is used. 2013-11-26 05:41:34 +00:00
EdkCompatibilityPkg Follow UEFI spec to add the definition for EFI_SPECIFICATION_VERSION, and update other table version to refer to it. Remove the “/D TIANO_RELEASE_VERSION=0x00080006” option in Nt32Pkg DSC file, since it’s not used in source code. 2013-11-26 07:36:29 +00:00
EdkShellBinPkg EdkShellBinPkg: Added AArch64 EdkShellPkg binary and Updated Arm binary 2013-09-24 11:43:02 +00:00
EdkShellPkg Follow UEFI spec to add the definition for EFI_SPECIFICATION_VERSION, and update other table version to refer to it. Remove the “/D TIANO_RELEASE_VERSION=0x00080006” option in Nt32Pkg DSC file, since it’s not used in source code. 2013-11-26 07:36:29 +00:00
EmbeddedPkg EmbeddedPkg/EmbeddedPkg.dec: Defined default values for PcdPrePiCpuMemorySize & PcdPrePiCpuIoSize 2013-11-28 21:40:14 +00:00
EmulatorPkg EmulatorPkg: Use FaultTolerantWritePei driver. 2013-07-03 09:24:07 +00:00
FatBinPkg Fix a bug in Fat driver that it asserts when OpenEx/ReadEx/WriteEx is about to return failure. 2013-11-29 03:04:16 +00:00
IntelFrameworkModulePkg Add additional check mRuntimeSmbiosEntryPoint == NULL to avoid K9 error. 2013-12-11 08:53:19 +00:00
IntelFrameworkPkg Fill the ImageHandle and DriverBindingHandle field of Driver Binding Protocol before installing the Driver Binding Protocol instance. 2013-07-10 02:06:49 +00:00
MdeModulePkg MdeModulePkg/XhciDxe: Fix ICC compiler build warning. 2013-12-13 01:43:27 +00:00
MdePkg 1. Add ISCSI iBFT CHAP types to IScsiBootFirmwareTable.h. 2013-12-10 09:14:39 +00:00
NetworkPkg 1. Add ISCSI iBFT CHAP types to IScsiBootFirmwareTable.h. 2013-12-10 09:14:39 +00:00
Nt32Pkg Follow UEFI spec to add the definition for EFI_SPECIFICATION_VERSION, and update other table version to refer to it. Remove the “/D TIANO_RELEASE_VERSION=0x00080006” option in Nt32Pkg DSC file, since it’s not used in source code. 2013-11-26 07:36:29 +00:00
Omap35xxPkg EmbeddedPkg: Introduced a separate SerialPortExtLib library 2013-03-12 00:40:11 +00:00
OptionRomPkg OptionRomPkg: Corrected path for the FtdiUsbSerialDxe.inf in OptionRomPkg.dsc 2013-11-01 17:01:23 +00:00
OvmfPkg OvmfPkg: Virtio drivers: fix incorrect casts in init functions 2013-12-12 17:28:05 +00:00
PcAtChipsetPkg Fix PciHostBridge driver to return success for EfiPciHostBridgeEndEnumeration to fix OVMF boot no display issue. 2013-07-22 07:35:51 +00:00
PerformancePkg Refine the select language logic. 2013-09-05 05:39:57 +00:00
SecurityPkg Correct INF file to make module pass ICC compiler. 2013-12-11 08:22:43 +00:00
ShellBinPkg ShellBinPkg: Update ARM and AArch64 Binaries with svn 14706 ShellPkg sources 2013-09-24 10:22:32 +00:00
ShellPkg ShellPkg: add API for determining operation type 2013-12-13 00:13:59 +00:00
SourceLevelDebugPkg Correct INF file to make module pass ICC compiler. 2013-12-11 08:22:43 +00:00
StdLib StdLib: Update Copyright Notices. 2013-12-10 22:16:57 +00:00
StdLibPrivateInternalFiles EADK (StdLib, AppPkg, StdLibPrivateInternalFiles): Update ReadMe.txt in all packages. 2013-10-24 23:14:10 +00:00
UefiCpuPkg UefiCpuPkg: S3Resume2Pei: align return stacks explicitly 2013-12-13 03:22:33 +00:00
UnixPkg UnixPkg: Remove UnixPkg files (It is replaced by EmulatorPkg) 2013-07-29 21:09:55 +00:00
BuildNotes2.txt Update to new SVN URL in readme.txt 2013-06-08 05:26:39 +00:00
edksetup.bat Update edksetup.bat to check VS2012 2013-09-04 07:41:04 +00:00
edksetup.sh Correct copyright year 2011-02-16 12:21:31 +00:00