diff options
author | Jian J Wang <jian.j.wang@intel.com> | 2018-09-03 10:56:07 +0800 |
---|---|---|
committer | Jian J Wang <jian.j.wang@intel.com> | 2018-09-10 09:28:28 +0800 |
commit | 0a0d5296e448fc350de1594c49b9c0deff7fad60 (patch) | |
tree | b4435228c7f87ce13f3180e9247b1898e5c18fc7 /UefiCpuPkg/CpuMpPei/CpuMpPei.h | |
parent | e09b6b5953db38db87b84c80a2e95a82a1c91020 (diff) | |
download | edk2-0a0d5296e448fc350de1594c49b9c0deff7fad60.tar.gz edk2-0a0d5296e448fc350de1594c49b9c0deff7fad60.tar.bz2 edk2-0a0d5296e448fc350de1594c49b9c0deff7fad60.zip |
UefiCpuPkg/CpuMpPei: support stack guard feature
This feature is the same as Stack Guard enabled in driver CpuDxe but
applies to PEI phase. Due to the specialty in PEI module dispatching,
this driver is changed to do the actual initialization in notify
callback of event gEfiPeiMemoryDiscoveredPpiGuid. This can let the
stack guard apply to as most PEI drivers as possible.
To let Stack Guard work, some simple page table management code are
introduced to setup Guard page at base of stack for each processor.
Cc: Eric Dong <eric.dong@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: "Ware, Ryan R" <ryan.r.ware@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Diffstat (limited to 'UefiCpuPkg/CpuMpPei/CpuMpPei.h')
-rw-r--r-- | UefiCpuPkg/CpuMpPei/CpuMpPei.h | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/UefiCpuPkg/CpuMpPei/CpuMpPei.h b/UefiCpuPkg/CpuMpPei/CpuMpPei.h index aae56658ec..d097a66aa8 100644 --- a/UefiCpuPkg/CpuMpPei/CpuMpPei.h +++ b/UefiCpuPkg/CpuMpPei/CpuMpPei.h @@ -1,7 +1,7 @@ /** @file
Definitions to install Multiple Processor PPI.
- Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -402,4 +402,41 @@ SecPlatformInformation2 ( OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2
);
+/**
+ Initializes MP and exceptions handlers.
+
+ @param PeiServices The pointer to the PEI Services Table.
+
+ @retval EFI_SUCCESS MP was successfully initialized.
+ @retval others Error occurred in MP initialization.
+
+**/
+EFI_STATUS
+InitializeCpuMpWorker (
+ IN CONST EFI_PEI_SERVICES **PeiServices
+ );
+
+/**
+ Enabl/setup stack guard for each processor if PcdCpuStackGuard is set to TRUE.
+
+ Doing this in the memory-discovered callback is to make sure the Stack Guard
+ feature to cover as most PEI code as possible.
+
+ @param[in] PeiServices General purpose services available to every PEIM.
+ @param[in] NotifyDescriptor The notification structure this PEIM registered on install.
+ @param[in] Ppi The memory discovered PPI. Not used.
+
+ @retval EFI_SUCCESS The function completed successfully.
+ @retval others There's error in MP initialization.
+**/
+EFI_STATUS
+EFIAPI
+MemoryDiscoveredPpiNotifyCallback (
+ IN EFI_PEI_SERVICES **PeiServices,
+ IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
+ IN VOID *Ppi
+ );
+
+extern EFI_PEI_NOTIFY_DESCRIPTOR mPostMemNotifyList[];
+
#endif
|