OvmfPkg/VirtHstiDxe: add code flash check
Detects qemu config issue: code pflash is writable. Checked for both PC and Q35. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Konstantin Kostiuk <kkostiuk@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
ddc43e7a41
commit
506740982b
36
OvmfPkg/VirtHstiDxe/QemuCommon.c
Normal file
36
OvmfPkg/VirtHstiDxe/QemuCommon.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/** @file
|
||||
|
||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||
|
||||
**/
|
||||
|
||||
#include <Library/BaseLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
|
||||
#include "VirtHstiDxe.h"
|
||||
|
||||
VOID
|
||||
VirtHstiQemuCommonInit (
|
||||
VIRT_ADAPTER_INFO_PLATFORM_SECURITY *VirtHsti
|
||||
)
|
||||
{
|
||||
VirtHstiSetSupported (VirtHsti, 0, VIRT_HSTI_BYTE0_READONLY_CODE_FLASH);
|
||||
}
|
||||
|
||||
VOID
|
||||
VirtHstiQemuCommonVerify (
|
||||
VOID
|
||||
)
|
||||
{
|
||||
CHAR16 *ErrorMsg;
|
||||
|
||||
switch (VirtHstiQemuFirmwareFlashCheck (PcdGet32 (PcdBfvBase))) {
|
||||
case QEMU_FIRMWARE_FLASH_WRITABLE:
|
||||
ErrorMsg = L"qemu code pflash is writable";
|
||||
break;
|
||||
default:
|
||||
ErrorMsg = NULL;
|
||||
}
|
||||
|
||||
VirtHstiTestResult (ErrorMsg, 0, VIRT_HSTI_BYTE0_READONLY_CODE_FLASH);
|
||||
}
|
Reference in New Issue
Block a user