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

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)
 

Detailed Description

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.

Function Documentation

◆ BuildPageStateBuffer()

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.

◆ InternalSetPageState()

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.

◆ MemoryStateToGhcbOp()

STATIC UINTN MemoryStateToGhcbOp ( IN SEV_SNP_PAGE_STATE  State)

Definition at line 27 of file SnpPageStateChangeInternal.c.

◆ PageStateChange()

STATIC VOID PageStateChange ( IN SNP_PAGE_STATE_CHANGE_INFO Info)

Definition at line 192 of file SnpPageStateChangeInternal.c.

◆ PageStateChangeVmgExit()

STATIC VOID PageStateChangeVmgExit ( IN GHCB *  Ghcb,
IN SNP_PAGE_STATE_ENTRY Start,
IN UINT16  Count 
)

Definition at line 138 of file SnpPageStateChangeInternal.c.

◆ SnpPageStateFailureTerminate()

VOID SnpPageStateFailureTerminate ( VOID  )

Definition at line 45 of file SnpPageStateChangeInternal.c.