summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/IntelTdx
diff options
context:
space:
mode:
authorMin M Xu <min.m.xu@intel.com>2022-07-07 10:51:20 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-09-06 06:03:45 +0000
commit1b1c58ab32c30d32ba7d037c0ea1da198c1b372b (patch)
treecd61b7b8df12f2f9837f8334457e9236b36339bf /OvmfPkg/IntelTdx
parentc4bc1a9498f4e176cefaeba3211287b444a53882 (diff)
downloadedk2-1b1c58ab32c30d32ba7d037c0ea1da198c1b372b.tar.gz
edk2-1b1c58ab32c30d32ba7d037c0ea1da198c1b372b.tar.bz2
edk2-1b1c58ab32c30d32ba7d037c0ea1da198c1b372b.zip
OvmfPkg: Update CcProbeLib to DxeCcProbeLib
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3974 CcProbeLib once was designed to probe the Confidential Computing guest type by checking the PcdOvmfWorkArea. But this memory is allocated with either EfiACPIMemoryNVS or EfiBootServicesData. It cannot be accessed after ExitBootService. Please see the detailed analysis in BZ#3974. To fix this issue, CcProbeLib is redesigned as 2 implementation: - SecPeiCcProbeLib - DxeCcProbeLib In SecPeiCcProbeLib we check the CC guest type by reading the PcdOvmfWorkArea. Because it is used in SEC / PEI and we don't worry about the issues in BZ#3974. In DxeCcProbeLib we cache the GuestType in Ovmf work area in a variable. After that the Guest type is returned with the cached value. So that we don't need to worry about the access to Ovmf work area after ExitBootService. The reason why we probe CC guest type in 2 different ways is the global varialbe. Global variable cannot be used in SEC/PEI and CcProbe is called very frequently. Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'OvmfPkg/IntelTdx')
-rw-r--r--OvmfPkg/IntelTdx/IntelTdxX64.dsc3
1 files changed, 2 insertions, 1 deletions
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 71b1cf8e70..1a7ecd503e 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -140,7 +140,7 @@
PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf
PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf
PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf
- CcProbeLib|OvmfPkg/Library/CcProbeLib/CcProbeLib.inf
+ CcProbeLib|OvmfPkg/Library/CcProbeLib/DxeCcProbeLib.inf
IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf
OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf
SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
@@ -234,6 +234,7 @@
HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf
PrePiLib|EmbeddedPkg/Library/PrePiLib/PrePiLib.inf
PeilessStartupLib|OvmfPkg/Library/PeilessStartupLib/PeilessStartupLib.inf
+ CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
[LibraryClasses.common.DXE_CORE]
HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf