TianoCore EDK2 master
AmdSev.c File Reference
#include "MpLib.h"
#include <Library/VmgExitLib.h>

Go to the source code of this file.

Functions

STATIC UINT16 GetProtectedMode16CS (VOID)
 
STATIC UINT16 GetProtectedMode32CS (VOID)
 
VOID MpInitLibSevEsAPReset (IN GHCB *Ghcb, IN CPU_MP_DATA *CpuMpData)
 
VOID AllocateSevEsAPMemory (IN OUT CPU_MP_DATA *CpuMpData)
 
VOID SetSevEsJumpTable (IN UINTN SipiVector)
 
VOID SevEsPlaceApHlt (CPU_MP_DATA *CpuMpData)
 
VOID FillExchangeInfoDataSevEs (IN volatile MP_CPU_EXCHANGE_INFO *ExchangeInfo)
 

Detailed Description

CPU MP Initialize helper function for AMD SEV.

Copyright (c) 2021, AMD Inc. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file AmdSev.c.

Function Documentation

◆ AllocateSevEsAPMemory()

VOID AllocateSevEsAPMemory ( IN OUT CPU_MP_DATA CpuMpData)

Allocate the SEV-ES AP jump table buffer.

Parameters
[in,out]CpuMpDataThe pointer to CPU MP Data structure.

Definition at line 131 of file AmdSev.c.

◆ FillExchangeInfoDataSevEs()

VOID FillExchangeInfoDataSevEs ( IN volatile MP_CPU_EXCHANGE_INFO ExchangeInfo)

The function fills the exchange data for the AP.

Parameters
[in]ExchangeInfoThe pointer to CPU Exchange Data structure

Definition at line 249 of file AmdSev.c.

◆ GetProtectedMode16CS()

STATIC UINT16 GetProtectedMode16CS ( VOID  )

Get Protected mode code segment with 16-bit default addressing from current GDT table.

Returns
Protected mode 16-bit code segment value.

Definition at line 21 of file AmdSev.c.

◆ GetProtectedMode32CS()

STATIC UINT16 GetProtectedMode32CS ( VOID  )

Get Protected mode code segment with 32-bit default addressing from current GDT table.

Returns
Protected mode 32-bit code segment value.

Definition at line 57 of file AmdSev.c.

◆ MpInitLibSevEsAPReset()

VOID MpInitLibSevEsAPReset ( IN GHCB *  Ghcb,
IN CPU_MP_DATA CpuMpData 
)

Reset an AP when in SEV-ES mode.

If successful, this function never returns.

Parameters
[in]GhcbPointer to the GHCB
[in]CpuMpDataPointer to CPU MP Data

Definition at line 95 of file AmdSev.c.

◆ SetSevEsJumpTable()

VOID SetSevEsJumpTable ( IN UINTN  SipiVector)

Program the SEV-ES AP jump table buffer.

Parameters
[in]SipiVectorThe SIPI vector used for the AP Reset

Definition at line 147 of file AmdSev.c.

◆ SevEsPlaceApHlt()

VOID SevEsPlaceApHlt ( CPU_MP_DATA CpuMpData)

The function puts the AP in halt loop.

Parameters
[in]CpuMpDataThe pointer to CPU MP Data structure.

Definition at line 196 of file AmdSev.c.