TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <IndustryStandard/Tdx.h>
#include <Uefi/UefiBaseType.h>
#include <Library/TdxLib.h>
#include <Library/BaseMemoryLib.h>
Go to the source code of this file.
Macros | |
#define | TDX_ACCEPTPAGE_MAX_RETRIED 3 |
#define | INVALID_ACCEPT_PAGELEVEL ARRAY_SIZE(mTdxAcceptPageLevelMap) |
Functions | |
UINT32 | GetGpaPageLevel (UINT32 PageSize) |
EFI_STATUS EFIAPI | TdAcceptPages (IN UINT64 StartAddress, IN UINT64 NumberOfPages, IN UINT32 PageSize) |
Variables | |
UINT64 | mNumberOfDuplicatedAcceptedPages |
UINT32 | mTdxAcceptPageLevelMap [2] |
Unaccepted memory is a special type of private memory. In Td guest TDCALL [TDG.MEM.PAGE.ACCEPT] is invoked to accept the unaccepted memory before use it.
Copyright (c) 2020 - 2021, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file AcceptPages.c.
#define INVALID_ACCEPT_PAGELEVEL ARRAY_SIZE(mTdxAcceptPageLevelMap) |
Definition at line 30 of file AcceptPages.c.
#define TDX_ACCEPTPAGE_MAX_RETRIED 3 |
Definition at line 21 of file AcceptPages.c.
UINT32 GetGpaPageLevel | ( | UINT32 | PageSize | ) |
This function gets the PageLevel according to the input page size.
[in] | PageSize | Page size |
Definition at line 40 of file AcceptPages.c.
EFI_STATUS EFIAPI TdAcceptPages | ( | IN UINT64 | StartAddress, |
IN UINT64 | NumberOfPages, | ||
IN UINT32 | PageSize | ||
) |
This function accept a pending private page, and initialize the page to all-0 using the TD ephemeral private key.
Sometimes TDCALL [TDG.MEM.PAGE.ACCEPT] may return TDX_EXIT_REASON_PAGE_SIZE_MISMATCH. It indicates the input PageLevel is not workable. In this case we need to try to fallback to a smaller PageLevel if possible.
[in] | StartAddress | Guest physical address of the private page to accept. [63:52] and [11:0] must be 0. |
[in] | NumberOfPages | Number of the pages to be accepted. |
[in] | PageSize | GPA page size. Only accept 2M/4K size. |
Definition at line 74 of file AcceptPages.c.
UINT64 mNumberOfDuplicatedAcceptedPages |
Definition at line 19 of file AcceptPages.c.
UINT32 mTdxAcceptPageLevelMap[2] |
Definition at line 25 of file AcceptPages.c.