mirror of https://github.com/acidanthera/audk.git
OvmfPkg: Add support to perform SEV-ES initialization
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198 When SEV-ES is enabled, then SEV is also enabled. Add support to the SEV initialization function to also check for SEV-ES being enabled, and if enabled, set the SEV-ES enabled PCD (PcdSevEsIsEnabled). Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
0afa1d08f1
commit
cf845a749a
|
@ -607,6 +607,9 @@
|
||||||
# Set memory encryption mask
|
# Set memory encryption mask
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
||||||
|
|
||||||
|
# Set SEV-ES defaults
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|0
|
||||||
|
|
||||||
!if $(SMM_REQUIRE) == TRUE
|
!if $(SMM_REQUIRE) == TRUE
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
||||||
|
|
|
@ -619,6 +619,9 @@
|
||||||
# Set memory encryption mask
|
# Set memory encryption mask
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
||||||
|
|
||||||
|
# Set SEV-ES defaults
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|0
|
||||||
|
|
||||||
!if $(SMM_REQUIRE) == TRUE
|
!if $(SMM_REQUIRE) == TRUE
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
||||||
|
|
|
@ -617,6 +617,9 @@
|
||||||
# Set memory encryption mask
|
# Set memory encryption mask
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPteMemoryEncryptionAddressOrMask|0x0
|
||||||
|
|
||||||
|
# Set SEV-ES defaults
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled|0
|
||||||
|
|
||||||
!if $(SMM_REQUIRE) == TRUE
|
!if $(SMM_REQUIRE) == TRUE
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35TsegMbytes|8
|
||||||
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase|FALSE
|
||||||
|
|
|
@ -21,6 +21,27 @@
|
||||||
|
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
Initialize SEV-ES support if running as an SEV-ES guest.
|
||||||
|
|
||||||
|
**/
|
||||||
|
STATIC
|
||||||
|
VOID
|
||||||
|
AmdSevEsInitialize (
|
||||||
|
VOID
|
||||||
|
)
|
||||||
|
{
|
||||||
|
RETURN_STATUS PcdStatus;
|
||||||
|
|
||||||
|
if (!MemEncryptSevEsIsEnabled ()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PcdStatus = PcdSetBoolS (PcdSevEsIsEnabled, TRUE);
|
||||||
|
ASSERT_RETURN_ERROR (PcdStatus);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
||||||
Function checks if SEV support is available, if present then it sets
|
Function checks if SEV support is available, if present then it sets
|
||||||
|
@ -103,4 +124,9 @@ AmdSevInitialize (
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check and perform SEV-ES initialization if required.
|
||||||
|
//
|
||||||
|
AmdSevEsInitialize ();
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuBootLogicalProcessorNumber
|
||||||
gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize
|
gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize
|
||||||
|
gUefiCpuPkgTokenSpaceGuid.PcdSevEsIsEnabled
|
||||||
|
|
||||||
[FixedPcd]
|
[FixedPcd]
|
||||||
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
|
||||||
|
|
Loading…
Reference in New Issue