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