In current MP implementation, BSP and AP shares the same exception configuration. Stack switch required by Stack Guard feature needs that BSP and AP have their own configuration. This patch adds code to ask BSP and AP to do exception handler initialization separately. Since AP is not supposed to do memory allocation, all memory needed to setup stack switch will be reserved in BSP and pass to AP via new API EFI_STATUS EFIAPI InitializeCpuExceptionHandlersEx ( IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL ); Following two new PCDs are introduced to configure how to setup new stack for specified exception handlers. gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Suggested-by: Ayellet Wolman <ayellet.wolman@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Jeff Fan <vanjeff_919@hotmail.com> Reviewed-by: Jiewen.yao@intel.com
93 lines
2.5 KiB
INI
93 lines
2.5 KiB
INI
## @file
|
|
# CPU driver installs CPU Architecture Protocol and CPU MP protocol.
|
|
#
|
|
# Copyright (c) 2008 - 2017, Intel Corporation. All rights reserved.<BR>
|
|
# Copyright (c) 2017, AMD Incorporated. 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
|
|
# http://opensource.org/licenses/bsd-license.php
|
|
#
|
|
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
#
|
|
##
|
|
|
|
[Defines]
|
|
INF_VERSION = 0x00010005
|
|
BASE_NAME = CpuDxe
|
|
MODULE_UNI_FILE = CpuDxe.uni
|
|
FILE_GUID = 1A1E4886-9517-440e-9FDE-3BE44CEE2136
|
|
MODULE_TYPE = DXE_DRIVER
|
|
VERSION_STRING = 1.0
|
|
ENTRY_POINT = InitializeCpu
|
|
|
|
[Packages]
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
UefiCpuPkg/UefiCpuPkg.dec
|
|
|
|
[LibraryClasses]
|
|
BaseLib
|
|
BaseMemoryLib
|
|
CpuLib
|
|
DebugLib
|
|
DxeServicesTableLib
|
|
MemoryAllocationLib
|
|
MtrrLib
|
|
UefiBootServicesTableLib
|
|
UefiDriverEntryPoint
|
|
LocalApicLib
|
|
UefiCpuLib
|
|
UefiLib
|
|
CpuExceptionHandlerLib
|
|
HobLib
|
|
ReportStatusCodeLib
|
|
MpInitLib
|
|
TimerLib
|
|
|
|
[Sources]
|
|
CpuDxe.c
|
|
CpuDxe.h
|
|
CpuGdt.c
|
|
CpuGdt.h
|
|
CpuMp.c
|
|
CpuMp.h
|
|
CpuPageTable.h
|
|
CpuPageTable.c
|
|
|
|
[Sources.IA32]
|
|
Ia32/CpuAsm.asm
|
|
Ia32/CpuAsm.nasm
|
|
Ia32/CpuAsm.S
|
|
|
|
[Sources.X64]
|
|
X64/CpuAsm.asm
|
|
X64/CpuAsm.nasm
|
|
X64/CpuAsm.S
|
|
|
|
[Protocols]
|
|
gEfiCpuArchProtocolGuid ## PRODUCES
|
|
gEfiMpServiceProtocolGuid ## PRODUCES
|
|
|
|
[Guids]
|
|
gIdleLoopEventGuid ## CONSUMES ## Event
|
|
gEfiVectorHandoffTableGuid ## SOMETIMES_CONSUMES ## SystemTable
|
|
|
|
[Ppis]
|
|
gEfiSecPlatformInformation2PpiGuid ## UNDEFINED # HOB
|
|
gEfiSecPlatformInformationPpiGuid ## UNDEFINED # HOB
|
|
|
|
[Pcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ## CONSUMES
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard ## CONSUMES
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuStackSwitchExceptionList ## CONSUMES
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuKnownGoodStackSize ## CONSUMES
|
|
|
|
[Depex]
|
|
TRUE
|
|
|
|
[UserExtensions.TianoCore."ExtraFiles"]
|
|
CpuDxeExtra.uni
|