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:
Gerd Hoffmann
2024-04-22 12:47:28 +02:00
committed by mergify[bot]
parent ddc43e7a41
commit 506740982b
4 changed files with 55 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define VIRT_HSTI_BYTE0_SMM_SMRAM_LOCK BIT0
#define VIRT_HSTI_BYTE0_SMM_SECURE_VARS_FLASH BIT1
#define VIRT_HSTI_BYTE0_READONLY_CODE_FLASH BIT2
typedef struct {
// ADAPTER_INFO_PLATFORM_SECURITY
@@ -67,6 +68,18 @@ VirtHstiQemuPCVerify (
VOID
);
/* QemuCommon.c */
VOID
VirtHstiQemuCommonInit (
VIRT_ADAPTER_INFO_PLATFORM_SECURITY *VirtHsti
);
VOID
VirtHstiQemuCommonVerify (
VOID
);
/* Flash.c */
#define QEMU_FIRMWARE_FLASH_UNKNOWN 0