mirror of
https://github.com/acidanthera/audk.git
synced 2025-08-18 08:08:09 +02:00
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>
37 lines
700 B
C
37 lines
700 B
C
/** @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);
|
|
}
|