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 <Library/BaseLib.h>
|
---|
11 | #include <Uefi/UefiBaseType.h>
|
---|
12 |
|
---|
13 | /**
|
---|
14 | The TDCALL instruction causes a VM exit to the Intel TDX module. It is
|
---|
15 | used to call guest-side Intel TDX functions, either local or a TD exit
|
---|
16 | to the host VMM, as selected by Leaf.
|
---|
17 | Leaf functions are described at <https://software.intel.com/content/
|
---|
18 | www/us/en/develop/articles/intel-trust-domain-extensions.html>
|
---|
19 |
|
---|
20 | @param[in] Leaf Leaf number of TDCALL instruction
|
---|
21 | @param[in] Arg1 Arg1
|
---|
22 | @param[in] Arg2 Arg2
|
---|
23 | @param[in] Arg3 Arg3
|
---|
24 | @param[in,out] Results Returned result of the Leaf function
|
---|
25 |
|
---|
26 | @return EFI_SUCCESS
|
---|
27 | @return Other See individual leaf functions
|
---|
28 | **/
|
---|
29 | UINTN
|
---|
30 | EFIAPI
|
---|
31 | TdCall (
|
---|
32 | IN UINT64 Leaf,
|
---|
33 | IN UINT64 Arg1,
|
---|
34 | IN UINT64 Arg2,
|
---|
35 | IN UINT64 Arg3,
|
---|
36 | IN OUT VOID *Results
|
---|
37 | )
|
---|
38 | {
|
---|
39 | return EFI_UNSUPPORTED;
|
---|
40 | }
|
---|
41 |
|
---|
42 | /**
|
---|
43 | TDVMALL is a leaf function 0 for TDCALL. It helps invoke services from the
|
---|
44 | host VMM to pass/receive information.
|
---|
45 |
|
---|
46 | @param[in] Leaf Number of sub-functions
|
---|
47 | @param[in] Arg1 Arg1
|
---|
48 | @param[in] Arg2 Arg2
|
---|
49 | @param[in] Arg3 Arg3
|
---|
50 | @param[in] Arg4 Arg4
|
---|
51 | @param[in,out] Results Returned result of the sub-function
|
---|
52 |
|
---|
53 | @return EFI_SUCCESS
|
---|
54 | @return Other See individual sub-functions
|
---|
55 |
|
---|
56 | **/
|
---|
57 | UINTN
|
---|
58 | EFIAPI
|
---|
59 | TdVmCall (
|
---|
60 | IN UINT64 Leaf,
|
---|
61 | IN UINT64 Arg1,
|
---|
62 | IN UINT64 Arg2,
|
---|
63 | IN UINT64 Arg3,
|
---|
64 | IN UINT64 Arg4,
|
---|
65 | IN OUT VOID *Results
|
---|
66 | )
|
---|
67 | {
|
---|
68 | return EFI_UNSUPPORTED;
|
---|
69 | }
|
---|
70 |
|
---|
71 | /**
|
---|
72 | Probe if TD is enabled.
|
---|
73 |
|
---|
74 | @return TRUE TD is enabled.
|
---|
75 | @return FALSE TD is not enabled.
|
---|
76 | **/
|
---|
77 | BOOLEAN
|
---|
78 | EFIAPI
|
---|
79 | TdIsEnabled (
|
---|
80 | )
|
---|
81 | {
|
---|
82 | return FALSE;
|
---|
83 | }
|
---|