]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Library/TdxLib/TdxLibNull.c
MdePkg: Add TdxLib to wrap Tdx operations
[mirror_edk2.git] / MdePkg / Library / TdxLib / TdxLibNull.c
CommitLineData
c3001cb7
MX
1/** @file\r
2\r
3 Null stub of TdxLib\r
4\r
5 Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>\r
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
7\r
8**/\r
9\r
10#include <Uefi/UefiBaseType.h>\r
11#include <Library/TdxLib.h>\r
12\r
13/**\r
14 This function accepts a pending private page, and initialize the page to\r
15 all-0 using the TD ephemeral private key.\r
16\r
17 @param[in] StartAddress Guest physical address of the private page\r
18 to accept.\r
19 @param[in] NumberOfPages Number of the pages to be accepted.\r
20 @param[in] PageSize GPA page size. Accept 1G/2M/4K page size.\r
21\r
22 @return EFI_SUCCESS\r
23**/\r
24EFI_STATUS\r
25EFIAPI\r
26TdAcceptPages (\r
27 IN UINT64 StartAddress,\r
28 IN UINT64 NumberOfPages,\r
29 IN UINT32 PageSize\r
30 )\r
31{\r
32 return EFI_UNSUPPORTED;\r
33}\r
34\r
35/**\r
36 This function extends one of the RTMR measurement register\r
37 in TDCS with the provided extension data in memory.\r
38 RTMR extending supports SHA384 which length is 48 bytes.\r
39\r
40 @param[in] Data Point to the data to be extended\r
41 @param[in] DataLen Length of the data. Must be 48\r
42 @param[in] Index RTMR index\r
43\r
44 @return EFI_SUCCESS\r
45 @return EFI_INVALID_PARAMETER\r
46 @return EFI_DEVICE_ERROR\r
47\r
48**/\r
49EFI_STATUS\r
50EFIAPI\r
51TdExtendRtmr (\r
52 IN UINT32 *Data,\r
53 IN UINT32 DataLen,\r
54 IN UINT8 Index\r
55 )\r
56{\r
57 return EFI_UNSUPPORTED;\r
58}\r
59\r
60/**\r
61 This function gets the Td guest shared page mask.\r
62\r
63 The guest indicates if a page is shared using the Guest Physical Address\r
64 (GPA) Shared (S) bit. If the GPA Width(GPAW) is 48, the S-bit is bit-47.\r
65 If the GPAW is 52, the S-bit is bit-51.\r
66\r
67 @return Shared page bit mask\r
68**/\r
69UINT64\r
70EFIAPI\r
71TdSharedPageMask (\r
72 VOID\r
73 )\r
74{\r
75 return 0;\r
76}\r
77\r
78/**\r
79 This function gets the maximum number of Virtual CPUs that are usable for\r
80 Td Guest.\r
81\r
82 @return maximum Virtual CPUs number\r
83**/\r
84UINT32\r
85EFIAPI\r
86TdMaxVCpuNum (\r
87 VOID\r
88 )\r
89{\r
90 return 0;\r
91}\r
92\r
93/**\r
94 This function gets the number of Virtual CPUs that are usable for Td\r
95 Guest.\r
96\r
97 @return Virtual CPUs number\r
98**/\r
99UINT32\r
100EFIAPI\r
101TdVCpuNum (\r
102 VOID\r
103 )\r
104{\r
105 return 0;\r
106}\r