TianoCore EDK2 master
|
#include <Uefi/UefiBaseType.h>
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/MemEncryptSevLib.h>
#include <Library/DebugLib.h>
#include <Library/CcExitLib.h>
#include <Library/AmdSvsmLib.h>
#include <Register/Amd/Ghcb.h>
#include <Register/Amd/Msr.h>
#include <Register/Amd/Svsm.h>
#include "SnpPageStateChange.h"
Go to the source code of this file.
Functions | |
STATIC UINTN | MemoryStateToGhcbOp (IN SEV_SNP_PAGE_STATE State) |
VOID | SnpPageStateFailureTerminate (VOID) |
STATIC EFI_PHYSICAL_ADDRESS | BuildPageStateBuffer (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN EFI_PHYSICAL_ADDRESS EndAddress, IN SEV_SNP_PAGE_STATE State, IN BOOLEAN UseLargeEntry, IN SNP_PAGE_STATE_CHANGE_INFO *Info, IN UINTN InfoSize) |
STATIC VOID | PageStateChangeVmgExit (IN GHCB *Ghcb, IN SNP_PAGE_STATE_ENTRY *Start, IN UINT16 Count) |
STATIC VOID | PageStateChange (IN SNP_PAGE_STATE_CHANGE_INFO *Info) |
VOID | InternalSetPageState (IN EFI_PHYSICAL_ADDRESS BaseAddress, IN UINTN NumPages, IN SEV_SNP_PAGE_STATE State, IN BOOLEAN UseLargeEntry, IN VOID *PscBuffer, IN UINTN PscBufferSize) |
SEV-SNP Page Validation functions.
Copyright (c) 2021 - 2024, AMD Incorporated. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file SnpPageStateChangeInternal.c.
STATIC EFI_PHYSICAL_ADDRESS BuildPageStateBuffer | ( | IN EFI_PHYSICAL_ADDRESS | BaseAddress, |
IN EFI_PHYSICAL_ADDRESS | EndAddress, | ||
IN SEV_SNP_PAGE_STATE | State, | ||
IN BOOLEAN | UseLargeEntry, | ||
IN SNP_PAGE_STATE_CHANGE_INFO * | Info, | ||
IN UINTN | InfoSize | ||
) |
Definition at line 68 of file SnpPageStateChangeInternal.c.
VOID InternalSetPageState | ( | IN EFI_PHYSICAL_ADDRESS | BaseAddress, |
IN UINTN | NumPages, | ||
IN SEV_SNP_PAGE_STATE | State, | ||
IN BOOLEAN | UseLargeEntry, | ||
IN VOID * | PscBuffer, | ||
IN UINTN | PscBufferSize | ||
) |
The function is used to set the page state when SEV-SNP is active. The page state transition consist of changing the page ownership in the RMP table, and using the PVALIDATE instruction to update the Validated bit in RMP table.
When the UseLargeEntry is set to TRUE, then function will try to use the large RMP entry (whevever possible).
Definition at line 225 of file SnpPageStateChangeInternal.c.
Definition at line 27 of file SnpPageStateChangeInternal.c.
STATIC VOID PageStateChange | ( | IN SNP_PAGE_STATE_CHANGE_INFO * | Info | ) |
Definition at line 192 of file SnpPageStateChangeInternal.c.
STATIC VOID PageStateChangeVmgExit | ( | IN GHCB * | Ghcb, |
IN SNP_PAGE_STATE_ENTRY * | Start, | ||
IN UINT16 | Count | ||
) |
Definition at line 138 of file SnpPageStateChangeInternal.c.
VOID SnpPageStateFailureTerminate | ( | VOID | ) |
Definition at line 45 of file SnpPageStateChangeInternal.c.