mirror of https://github.com/acidanthera/audk.git
OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Do not use flash with SEV-SNP
SEV-SNP does not support the use of the Qemu flash device as SEV-SNP guests are started using the Qemu -bios option instead of the Qemu -drive if=pflash option. Perform runtime detection of SEV-SNP and exit early from the Qemu flash device initialization, indicating the Qemu flash device is not present. SEV-SNP guests will use the emulated variable support. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
This commit is contained in:
parent
a6f1433e95
commit
f0d2bc3ab2
|
@ -259,6 +259,14 @@ QemuFlashInitialize (
|
||||||
VOID
|
VOID
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
// The SNP model does not provide for QEMU flash device support, so exit
|
||||||
|
// early before attempting to initialize any QEMU flash device support.
|
||||||
|
//
|
||||||
|
if (MemEncryptSevSnpIsEnabled ()) {
|
||||||
|
return EFI_UNSUPPORTED;
|
||||||
|
}
|
||||||
|
|
||||||
mFlashBase = (UINT8 *)(UINTN)PcdGet32 (PcdOvmfFdBaseAddress);
|
mFlashBase = (UINT8 *)(UINTN)PcdGet32 (PcdOvmfFdBaseAddress);
|
||||||
mFdBlockSize = PcdGet32 (PcdOvmfFirmwareBlockSize);
|
mFdBlockSize = PcdGet32 (PcdOvmfFirmwareBlockSize);
|
||||||
ASSERT (PcdGet32 (PcdOvmfFirmwareFdSize) % mFdBlockSize == 0);
|
ASSERT (PcdGet32 (PcdOvmfFirmwareFdSize) % mFdBlockSize == 0);
|
||||||
|
|
Loading…
Reference in New Issue