TianoCore EDK2 master
Loading...
Searching...
No Matches
TdInfo.c File Reference

Go to the source code of this file.

Functions

BOOLEAN GetTdInfo (VOID)
 
UINT64 EFIAPI TdSharedPageMask (VOID)
 
UINT32 EFIAPI TdMaxVCpuNum (VOID)
 
UINT32 EFIAPI TdVCpuNum (VOID)
 

Variables

UINT64 mTdSharedPageMask = 0
 
UINT32 mTdMaxVCpuNum = 0
 
UINT32 mTdVCpuNum = 0
 
BOOLEAN mTdDataReturned = FALSE
 

Detailed Description

Fetch the Tdx info.

Copyright (c) 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TdInfo.c.

Function Documentation

◆ GetTdInfo()

BOOLEAN GetTdInfo ( VOID  )

This function call TDCALL_TDINFO to get the TD_RETURN_DATA. If the TDCALL is successful, populate below variables:

  • mTdSharedPageMask
  • mTdMaxVCpunum
  • mTdVCpuNum
  • mTdDataReturned
Returns
TRUE The TDCALL is successful and above variables are populated.
FALSE The TDCALL is failed. Above variables are not set.

Definition at line 34 of file TdInfo.c.

◆ TdMaxVCpuNum()

UINT32 EFIAPI TdMaxVCpuNum ( VOID  )

This function gets the maximum number of Virtual CPUs that are usable for Td Guest.

Returns
maximum Virtual CPUs number

Definition at line 87 of file TdInfo.c.

◆ TdSharedPageMask()

UINT64 EFIAPI TdSharedPageMask ( VOID  )

This function gets the Td guest shared page mask.

The guest indicates if a page is shared using the Guest Physical Address (GPA) Shared (S) bit. If the GPA Width(GPAW) is 48, the S-bit is bit-47. If the GPAW is 52, the S-bit is bit-51.

Returns
Shared page bit mask

Definition at line 68 of file TdInfo.c.

◆ TdVCpuNum()

UINT32 EFIAPI TdVCpuNum ( VOID  )

This function gets the number of Virtual CPUs that are usable for Td Guest.

Returns
Virtual CPUs number

Definition at line 106 of file TdInfo.c.

Variable Documentation

◆ mTdDataReturned

BOOLEAN mTdDataReturned = FALSE

Definition at line 20 of file TdInfo.c.

◆ mTdMaxVCpuNum

UINT32 mTdMaxVCpuNum = 0

Definition at line 18 of file TdInfo.c.

◆ mTdSharedPageMask

UINT64 mTdSharedPageMask = 0

Definition at line 17 of file TdInfo.c.

◆ mTdVCpuNum

UINT32 mTdVCpuNum = 0

Definition at line 19 of file TdInfo.c.