UefiCpuPkg/MpInitLib: Use SEV-SNP AP Creation NAE event to launch APs
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 Use the SEV-SNP AP Creation NAE event to create and launch APs under SEV-SNP. This capability will be advertised in the SEV Hypervisor Feature Support PCD (PcdSevEsHypervisorFeatures). Cc: Michael Roth <michael.roth@amd.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Min Xu <min.m.xu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Erdem Aktas <erdemaktas@google.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Acked-by: Ray Ni <ray.ni@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
This commit is contained in:
committed by
mergify[bot]
parent
67484aed69
commit
06544455d0
@@ -15,6 +15,7 @@
|
||||
|
||||
#include <Register/Intel/Cpuid.h>
|
||||
#include <Register/Amd/Cpuid.h>
|
||||
#include <Register/Amd/Ghcb.h>
|
||||
#include <Register/Intel/Msr.h>
|
||||
#include <Register/Intel/LocalApic.h>
|
||||
#include <Register/Intel/Microcode.h>
|
||||
@@ -150,6 +151,7 @@ typedef struct {
|
||||
UINT8 PlatformId;
|
||||
UINT64 MicrocodeEntryAddr;
|
||||
UINT32 MicrocodeRevision;
|
||||
SEV_ES_SAVE_AREA *SevEsSaveArea;
|
||||
} CPU_AP_DATA;
|
||||
|
||||
//
|
||||
@@ -294,6 +296,7 @@ struct _CPU_MP_DATA {
|
||||
|
||||
BOOLEAN SevEsIsEnabled;
|
||||
BOOLEAN SevSnpIsEnabled;
|
||||
BOOLEAN UseSevEsAPMethod;
|
||||
UINTN SevEsAPBuffer;
|
||||
UINTN SevEsAPResetStackStart;
|
||||
CPU_MP_DATA *NewCpuMpData;
|
||||
@@ -799,4 +802,45 @@ FillExchangeInfoDataSevEs (
|
||||
IN volatile MP_CPU_EXCHANGE_INFO *ExchangeInfo
|
||||
);
|
||||
|
||||
/**
|
||||
Issue RMPADJUST to adjust the VMSA attribute of an SEV-SNP page.
|
||||
|
||||
@param[in] PageAddress
|
||||
@param[in] VmsaPage
|
||||
|
||||
@return RMPADJUST return value
|
||||
**/
|
||||
UINT32
|
||||
SevSnpRmpAdjust (
|
||||
IN EFI_PHYSICAL_ADDRESS PageAddress,
|
||||
IN BOOLEAN VmsaPage
|
||||
);
|
||||
|
||||
/**
|
||||
Create an SEV-SNP AP save area (VMSA) for use in running the vCPU.
|
||||
|
||||
@param[in] CpuMpData Pointer to CPU MP Data
|
||||
@param[in] CpuData Pointer to CPU AP Data
|
||||
@param[in] ApicId APIC ID of the vCPU
|
||||
**/
|
||||
VOID
|
||||
SevSnpCreateSaveArea (
|
||||
IN CPU_MP_DATA *CpuMpData,
|
||||
IN CPU_AP_DATA *CpuData,
|
||||
UINT32 ApicId
|
||||
);
|
||||
|
||||
/**
|
||||
Create SEV-SNP APs.
|
||||
|
||||
@param[in] CpuMpData Pointer to CPU MP Data
|
||||
@param[in] ProcessorNumber The handle number of specified processor
|
||||
(-1 for all APs)
|
||||
**/
|
||||
VOID
|
||||
SevSnpCreateAP (
|
||||
IN CPU_MP_DATA *CpuMpData,
|
||||
IN INTN ProcessorNumber
|
||||
);
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user