#include <Guid/SystemNvDataGuid.h>\r
#include <Guid/VariableFormat.h>\r
#include <OvmfPlatforms.h>\r
+#include <Library/TdxLib.h>\r
\r
#include <Library/PlatformInitLib.h>\r
\r
UINT16 BootCpuCount = 0;\r
UINT32 MaxCpuCount;\r
\r
+ if (TdIsEnabled ()) {\r
+ BootCpuCount = (UINT16)TdVCpuNum ();\r
+ MaxCpuCount = TdMaxVCpuNum ();\r
+\r
+ if (BootCpuCount > MaxCpuCount) {\r
+ DEBUG ((DEBUG_ERROR, "%a: Failed with BootCpuCount (%d) more than MaxCpuCount(%u) \n", __func__, BootCpuCount, MaxCpuCount));\r
+ ASSERT (FALSE);\r
+ }\r
+\r
+ PlatformInfoHob->PcdCpuMaxLogicalProcessorNumber = MaxCpuCount;\r
+ PlatformInfoHob->PcdCpuBootLogicalProcessorNumber = BootCpuCount;\r
+ return;\r
+ }\r
+\r
//\r
// Try to fetch the boot CPU count.\r
//\r
AmdSvsmLib|UefiCpuPkg/Library/AmdSvsmLibNull/AmdSvsmLibNull.inf\r
BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf\r
CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf\r
+ TdxLib|MdePkg/Library/TdxLib/TdxLib.inf\r
TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLibNull.inf\r
\r
[LibraryClasses.common.SEC]\r