2 Initialize Intel TDX support.
4 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
11 #include <Library/BaseLib.h>
12 #include <Library/DebugLib.h>
13 #include <Library/HobLib.h>
14 #include <Library/BaseMemoryLib.h>
15 #include <Library/MemoryAllocationLib.h>
16 #include <IndustryStandard/Tdx.h>
17 #include <IndustryStandard/QemuFwCfg.h>
18 #include <Library/QemuFwCfgLib.h>
19 #include <Library/PeiServicesLib.h>
20 #include <Library/TdxLib.h>
21 #include <Library/PlatformInitLib.h>
23 #include <ConfidentialComputingGuestAttr.h>
27 This Function checks if TDX is available, if present then it sets
28 the dynamic PCDs for Tdx guest.
36 RETURN_STATUS PcdStatus
;
38 if (!TdIsEnabled ()) {
42 PcdStatus
= PcdSet64S (PcdConfidentialComputingGuestAttr
, CCAttrIntelTdx
);
43 ASSERT_RETURN_ERROR (PcdStatus
);
45 PcdStatus
= PcdSet64S (PcdTdxSharedBitMask
, TdSharedPageMask ());
46 ASSERT_RETURN_ERROR (PcdStatus
);
48 PcdStatus
= PcdSetBoolS (PcdSetNxForStack
, TRUE
);
49 ASSERT_RETURN_ERROR (PcdStatus
);