VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/UefiCpuPkg/Include/Library/AmdSvsmLib.h@ 105681

Last change on this file since 105681 was 105670, checked in by vboxsync, 9 months ago

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, bugref:4643

  • Property svn:eol-style set to native
File size: 2.3 KB
Line 
1/** @file
2 Public header file for the AmdSvsmLib.
3
4 This library class defines some routines used for invoking an SVSM when the
5 guest is not running at VMPL0.
6
7 Copyright (C) 2024, Advanced Micro Devices, Inc. All rights reserved.<BR>
8 SPDX-License-Identifier: BSD-2-Clause-Patent
9
10**/
11
12#ifndef AMD_SVSM_LIB_H_
13#define AMD_SVSM_LIB_H_
14
15#include <Protocol/DebugSupport.h>
16#include <Register/Amd/Ghcb.h>
17
18/**
19 Report the presence of an Secure Virtual Services Module (SVSM).
20
21 Determines the presence of an SVSM.
22
23 @retval TRUE An SVSM is present
24 @retval FALSE An SVSM is not present
25
26**/
27BOOLEAN
28EFIAPI
29AmdSvsmIsSvsmPresent (
30 VOID
31 );
32
33/**
34 Report the VMPL level at which the SEV-SNP guest is running.
35
36 Determines the VMPL level at which the guest is running. If an SVSM is
37 not present, then it must be VMPL0, otherwise return what is reported
38 by the SVSM.
39
40 @return The VMPL level
41
42**/
43UINT8
44EFIAPI
45AmdSvsmSnpGetVmpl (
46 VOID
47 );
48
49/**
50 Report the Calling Area address (CAA) for the BSP of the SEV-SNP guest.
51
52 If an SVSM is present, the CAA for the BSP is returned.
53
54 @return The CAA
55
56**/
57UINT64
58EFIAPI
59AmdSvsmSnpGetCaa (
60 VOID
61 );
62
63/**
64 Perform a PVALIDATE operation for the page ranges specified.
65
66 Validate or rescind the validation of the specified pages.
67
68 @param[in] Info Pointer to a page state change structure
69
70**/
71VOID
72EFIAPI
73AmdSvsmSnpPvalidate (
74 IN SNP_PAGE_STATE_CHANGE_INFO *Info
75 );
76
77/**
78 Perform an RMPADJUST operation to alter the VMSA setting of a page.
79
80 Add or remove the VMSA attribute for a page.
81
82 @param[in] Vmsa Pointer to an SEV-ES save area page
83 @param[in] ApicId APIC ID associated with the VMSA
84 @param[in] SetVmsa Boolean indicator as to whether to set or
85 or clear the VMSA setting for the page
86
87 @retval EFI_SUCCESS RMPADJUST operation successful
88 @retval EFI_UNSUPPORTED Operation is not supported
89 @retval EFI_INVALID_PARAMETER RMPADJUST operation failed, an invalid
90 parameter was supplied
91
92**/
93EFI_STATUS
94EFIAPI
95AmdSvsmSnpVmsaRmpAdjust (
96 IN SEV_ES_SAVE_AREA *Vmsa,
97 IN UINT32 ApicId,
98 IN BOOLEAN SetVmsa
99 );
100
101#endif
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette