2015-11-30 19:46:27 +01:00
|
|
|
## @file
|
|
|
|
# The CPU specific programming for PiSmmCpuDxeSmm module.
|
|
|
|
#
|
2023-02-16 07:16:33 +01:00
|
|
|
# Copyright (c) 2009 - 2023, Intel Corporation. All rights reserved.<BR>
|
2018-03-01 18:55:09 +01:00
|
|
|
#
|
2019-04-04 01:06:33 +02:00
|
|
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
2015-11-30 19:46:27 +01:00
|
|
|
#
|
|
|
|
##
|
|
|
|
|
|
|
|
[Defines]
|
|
|
|
INF_VERSION = 0x00010005
|
|
|
|
BASE_NAME = SmmCpuFeaturesLib
|
|
|
|
MODULE_UNI_FILE = SmmCpuFeaturesLib.uni
|
|
|
|
FILE_GUID = AC9991BE-D77A-464C-A8DE-A873DB8A4836
|
|
|
|
MODULE_TYPE = DXE_SMM_DRIVER
|
|
|
|
VERSION_STRING = 1.0
|
|
|
|
LIBRARY_CLASS = SmmCpuFeaturesLib
|
|
|
|
CONSTRUCTOR = SmmCpuFeaturesLibConstructor
|
|
|
|
|
|
|
|
[Sources]
|
|
|
|
SmmCpuFeaturesLib.c
|
|
|
|
|
|
|
|
[Packages]
|
|
|
|
MdePkg/MdePkg.dec
|
2015-11-30 19:46:42 +01:00
|
|
|
OvmfPkg/OvmfPkg.dec
|
2015-11-30 19:46:27 +01:00
|
|
|
UefiCpuPkg/UefiCpuPkg.dec
|
|
|
|
|
|
|
|
[LibraryClasses]
|
|
|
|
BaseLib
|
2015-11-30 19:46:37 +01:00
|
|
|
BaseMemoryLib
|
2015-11-30 19:46:27 +01:00
|
|
|
DebugLib
|
2018-03-01 20:59:12 +01:00
|
|
|
MemEncryptSevLib
|
2021-03-12 07:26:52 +01:00
|
|
|
MemoryAllocationLib
|
OvmfPkg/SEV: don't manage the lifecycle of the SMRAM at the default SMBASE
When OVMF runs in a SEV guest, the initial SMM Save State Map is
(1) allocated as EfiBootServicesData type memory in OvmfPkg/PlatformPei,
function AmdSevInitialize(), for preventing unintended information
sharing with the hypervisor;
(2) decrypted in AmdSevDxe;
(3) re-encrypted in OvmfPkg/Library/SmmCpuFeaturesLib, function
SmmCpuFeaturesSmmRelocationComplete(), which is called by
PiSmmCpuDxeSmm right after initial SMBASE relocation;
(4) released to DXE at the same location.
The SMRAM at the default SMBASE is a superset of the initial Save State
Map. The reserved memory allocation in InitializeRamRegions(), from the
previous patch, must override the allocating and freeing in (1) and (4),
respectively. (Note: the decrypting and re-encrypting in (2) and (3) are
unaffected.)
In AmdSevInitialize(), only assert the containment of the initial Save
State Map, in the larger area already allocated by InitializeRamRegions().
In SmmCpuFeaturesSmmRelocationComplete(), preserve the allocation of the
initial Save State Map into OS runtime, as part of the allocation done by
InitializeRamRegions(). Only assert containment.
These changes only affect the normal boot path (the UEFI memory map is
untouched during S3 resume).
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Message-Id: <20200129214412.2361-9-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-09-20 17:07:43 +02:00
|
|
|
PcdLib
|
2021-03-12 07:26:52 +01:00
|
|
|
SafeIntLib
|
2015-11-30 19:46:37 +01:00
|
|
|
SmmServicesTableLib
|
2018-03-01 20:59:12 +01:00
|
|
|
UefiBootServicesTableLib
|
2023-02-16 07:16:33 +01:00
|
|
|
HobLib
|
|
|
|
|
|
|
|
[Guids]
|
|
|
|
gSmmBaseHobGuid ## CONSUMES
|
OvmfPkg/SEV: don't manage the lifecycle of the SMRAM at the default SMBASE
When OVMF runs in a SEV guest, the initial SMM Save State Map is
(1) allocated as EfiBootServicesData type memory in OvmfPkg/PlatformPei,
function AmdSevInitialize(), for preventing unintended information
sharing with the hypervisor;
(2) decrypted in AmdSevDxe;
(3) re-encrypted in OvmfPkg/Library/SmmCpuFeaturesLib, function
SmmCpuFeaturesSmmRelocationComplete(), which is called by
PiSmmCpuDxeSmm right after initial SMBASE relocation;
(4) released to DXE at the same location.
The SMRAM at the default SMBASE is a superset of the initial Save State
Map. The reserved memory allocation in InitializeRamRegions(), from the
previous patch, must override the allocating and freeing in (1) and (4),
respectively. (Note: the decrypting and re-encrypting in (2) and (3) are
unaffected.)
In AmdSevInitialize(), only assert the containment of the initial Save
State Map, in the larger area already allocated by InitializeRamRegions().
In SmmCpuFeaturesSmmRelocationComplete(), preserve the allocation of the
initial Save State Map into OS runtime, as part of the allocation done by
InitializeRamRegions(). Only assert containment.
These changes only affect the normal boot path (the UEFI memory map is
untouched during S3 resume).
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Message-Id: <20200129214412.2361-9-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-09-20 17:07:43 +02:00
|
|
|
|
|
|
|
[Pcd]
|
2021-03-12 07:26:52 +01:00
|
|
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber
|
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress
|
OvmfPkg/SEV: don't manage the lifecycle of the SMRAM at the default SMBASE
When OVMF runs in a SEV guest, the initial SMM Save State Map is
(1) allocated as EfiBootServicesData type memory in OvmfPkg/PlatformPei,
function AmdSevInitialize(), for preventing unintended information
sharing with the hypervisor;
(2) decrypted in AmdSevDxe;
(3) re-encrypted in OvmfPkg/Library/SmmCpuFeaturesLib, function
SmmCpuFeaturesSmmRelocationComplete(), which is called by
PiSmmCpuDxeSmm right after initial SMBASE relocation;
(4) released to DXE at the same location.
The SMRAM at the default SMBASE is a superset of the initial Save State
Map. The reserved memory allocation in InitializeRamRegions(), from the
previous patch, must override the allocating and freeing in (1) and (4),
respectively. (Note: the decrypting and re-encrypting in (2) and (3) are
unaffected.)
In AmdSevInitialize(), only assert the containment of the initial Save
State Map, in the larger area already allocated by InitializeRamRegions().
In SmmCpuFeaturesSmmRelocationComplete(), preserve the allocation of the
initial Save State Map into OS runtime, as part of the allocation done by
InitializeRamRegions(). Only assert containment.
These changes only affect the normal boot path (the UEFI memory map is
untouched during S3 resume).
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1512
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Message-Id: <20200129214412.2361-9-lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-09-20 17:07:43 +02:00
|
|
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase
|