From 89f7ed8b29f6a88a8fb78d6fb2c92b4f7edf42d2 Mon Sep 17 00:00:00 2001 From: "Lou, Yun" Date: Thu, 16 Sep 2021 17:27:12 +0800 Subject: UefiCpuPkg: Prevent from re-initializing CPU features during S3 resume REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3621 REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3631 Current CPU feature initialization design: During normal boot, CpuFeaturesPei module (inside FSP) initializes the CPU features. During S3 boot, CpuFeaturesPei module does nothing, and CpuSmm driver (in SMRAM) initializes CPU features instead. This code change prevents CpuSmm driver from re-initializing CPU features during S3 resume if CpuFeaturesPei module has done the same initialization. In addition, EDK2 contains DxeIpl PEIM that calls S3RestoreConfig2 PPI during S3 boot and this PPI eventually calls CpuSmm driver (in SMRAM) to initialize the CPU features, so "EDK2 + FSP" does not have the CPU feature initialization issue during S3 boot. But "coreboot" does not contain DxeIpl PEIM and the issue appears, unless "PcdCpuFeaturesInitOnS3Resume" is set to TRUE. Signed-off-by: Jason Lou Reviewed-by: Ray Ni Cc: Eric Dong Cc: Laszlo Ersek Cc: Rahul Kumar --- UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf') diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf index 76b1462996..0e88071c70 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf @@ -4,7 +4,7 @@ # This SMM driver performs SMM initialization, deploy SMM Entry Vector, # provides CPU specific services in SMM. # -# Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2009 - 2021, Intel Corporation. All rights reserved.
# Copyright (c) 2017, AMD Incorporated. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -134,6 +134,7 @@ gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmCodeAccessCheckEnable ## CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmSyncMode ## CONSUMES gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmShadowStackSize ## SOMETIMES_CONSUMES + gUefiCpuPkgTokenSpaceGuid.PcdCpuFeaturesInitOnS3Resume ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiS3Enable ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdNullPointerDetectionPropertyMask ## CONSUMES -- cgit v1.2.3