19 PLATFORM_SECURITY_VERSION_VNEXTCS,
20 PLATFORM_SECURITY_ROLE_PLATFORM_REFERENCE,
21 { L
"OVMF (Qemu Q35)" },
22 VIRT_HSTI_SECURITY_FEATURE_SIZE,
31 VirtHstiSetSupported (&mHstiQ35, 0, VIRT_HSTI_BYTE0_SMM_SMRAM_LOCK);
32 VirtHstiSetSupported (&mHstiQ35, 0, VIRT_HSTI_BYTE0_SMM_SECURE_VARS_FLASH);
39VirtHstiQemuQ35Verify (
43 if (VirtHstiIsSupported (&mHstiQ35, 0, VIRT_HSTI_BYTE0_SMM_SMRAM_LOCK)) {
44 CHAR16 *ErrorMsg =
NULL;
48 SmramVal =
PciRead8 (DRAMC_REGISTER_Q35 (MCH_SMRAM));
49 EsmramcVal =
PciRead8 (DRAMC_REGISTER_Q35 (MCH_ESMRAMC));
51 if (!(EsmramcVal & MCH_ESMRAMC_T_EN)) {
52 ErrorMsg = L
"q35 smram access is open";
53 }
else if (!(SmramVal & MCH_SMRAM_D_LCK)) {
54 ErrorMsg = L
"q35 smram config is not locked";
57 VirtHstiTestResult (ErrorMsg, 0, VIRT_HSTI_BYTE0_SMM_SMRAM_LOCK);
60 if (VirtHstiIsSupported (&mHstiQ35, 0, VIRT_HSTI_BYTE0_SMM_SECURE_VARS_FLASH)) {
61 CHAR16 *ErrorMsg =
NULL;
63 switch (VirtHstiQemuFirmwareFlashCheck (
PcdGet32 (PcdOvmfFlashNvStorageVariableBase))) {
64 case QEMU_FIRMWARE_FLASH_WRITABLE:
65 ErrorMsg = L
"qemu vars pflash is not secure";
69 VirtHstiTestResult (ErrorMsg, 0, VIRT_HSTI_BYTE0_SMM_SECURE_VARS_FLASH);
UINT8 EFIAPI PciRead8(IN UINTN Address)
#define PcdGet32(TokenName)
#define FeaturePcdGet(TokenName)