If PcdDxeNxMemoryProtectionPolicy is set to enable protection for memory
of EfiReservedMemoryType, the BIOS will hang at a page fault exception
triggered by BootScriptExecutorDxe.
The root cause is that this driver will allocate memory of
EfiReservedMemoryType and relocate itself into this new memory. Since
EfiReservedMemoryType of memory is marked non-executable, re-start this
driver after relocation will cause exception. The fix is removing the NX
attribute after memory allocation.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
(cherry picked from commit 6a3094c996
)
97 lines
2.7 KiB
INI
97 lines
2.7 KiB
INI
## @file
|
|
# Boot Script Executor Module
|
|
#
|
|
# This is a standalone Boot Script Executor. Standalone means it does not
|
|
# depends on any PEI or DXE service.
|
|
#
|
|
# Copyright (c) 2006 - 2016, 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 = BootScriptExecutorDxe
|
|
MODULE_UNI_FILE = BootScriptExecutorDxe.uni
|
|
FILE_GUID = FA20568B-548B-4b2b-81EF-1BA08D4A3CEC
|
|
MODULE_TYPE = DXE_DRIVER
|
|
VERSION_STRING = 1.0
|
|
|
|
ENTRY_POINT = BootScriptExecutorEntryPoint
|
|
|
|
#
|
|
# The following information is for reference only and not required by the build tools.
|
|
#
|
|
# VALID_ARCHITECTURES = IA32 X64
|
|
#
|
|
|
|
[Sources]
|
|
ScriptExecute.h
|
|
ScriptExecute.c
|
|
|
|
[Sources.X64]
|
|
X64/SetIdtEntry.c
|
|
X64/S3Asm.nasm
|
|
X64/S3Asm.asm
|
|
X64/S3Asm.S
|
|
|
|
[Sources.Ia32]
|
|
IA32/SetIdtEntry.c
|
|
IA32/S3Asm.nasm
|
|
IA32/S3Asm.asm
|
|
IA32/S3Asm.S
|
|
|
|
[Packages]
|
|
MdePkg/MdePkg.dec
|
|
MdeModulePkg/MdeModulePkg.dec
|
|
|
|
[LibraryClasses]
|
|
PcdLib
|
|
BaseMemoryLib
|
|
UefiDriverEntryPoint
|
|
BaseLib
|
|
S3BootScriptLib
|
|
PeCoffLib
|
|
DxeServicesLib
|
|
UefiBootServicesTableLib
|
|
CacheMaintenanceLib
|
|
UefiLib
|
|
DebugAgentLib
|
|
LockBoxLib
|
|
CpuExceptionHandlerLib
|
|
DevicePathLib
|
|
DxeServicesTableLib
|
|
|
|
[Guids]
|
|
gEfiBootScriptExecutorVariableGuid ## PRODUCES ## UNDEFINED # SaveLockBox
|
|
gEfiBootScriptExecutorContextGuid ## PRODUCES ## UNDEFINED # SaveLockBox
|
|
gEdkiiMemoryProfileGuid ## SOMETIMES_CONSUMES ## GUID # Locate protocol
|
|
|
|
[Protocols]
|
|
## NOTIFY
|
|
## CONSUMES
|
|
gEfiDxeSmmReadyToLockProtocolGuid
|
|
|
|
[FeaturePcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## CONSUMES
|
|
|
|
[Pcd]
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdUse1GPageTable ## SOMETIMES_CONSUMES
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMemoryProfilePropertyMask ## CONSUMES
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES
|
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ## CONSUMES
|
|
|
|
[Depex]
|
|
gEfiLockBoxProtocolGuid
|
|
|
|
[UserExtensions.TianoCore."ExtraFiles"]
|
|
BootScriptExecutorDxeExtra.uni
|