Skip to content

Commit 7cc7c52

Browse files
mxu9mergify[bot]
authored andcommitted
OvmfPkg: Set default Pci PCDs in Tdx guest
In previous implementation below Pci related PCDs were set based on the ResourceDescriptor passed in TdHob. - PcdPciMmio64Base / PcdPciMmio64Size - PcdPciMmio32Base / PcdPciMmio32Size - PcdPciIoBase / PcdPciIoSize The PCDs will not be set if TdHob doesn't include these information. This patch set the PCDs with the information initialized in PlatformInitLib by default. Then TdxDxe will check the ResourceDescriptor in TdHob and reset them if they're included. Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
1 parent 1b1c58a commit 7cc7c52

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

OvmfPkg/TdxDxe/TdxDxe.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,20 +68,20 @@ SetPcdSettings (
6868
PcdStatus = PcdSet64S (PcdTdxSharedBitMask, TdSharedPageMask ());
6969
ASSERT_RETURN_ERROR (PcdStatus);
7070
DEBUG ((DEBUG_INFO, "TdxSharedBitMask=0x%llx\n", PcdGet64 (PcdTdxSharedBitMask)));
71-
} else {
72-
PcdStatus = PcdSet64S (PcdPciMmio64Base, PlatformInfoHob->PcdPciMmio64Base);
73-
ASSERT_RETURN_ERROR (PcdStatus);
74-
PcdStatus = PcdSet64S (PcdPciMmio64Size, PlatformInfoHob->PcdPciMmio64Size);
75-
ASSERT_RETURN_ERROR (PcdStatus);
76-
PcdStatus = PcdSet64S (PcdPciMmio32Base, PlatformInfoHob->PcdPciMmio32Base);
77-
ASSERT_RETURN_ERROR (PcdStatus);
78-
PcdStatus = PcdSet64S (PcdPciMmio32Size, PlatformInfoHob->PcdPciMmio32Size);
79-
ASSERT_RETURN_ERROR (PcdStatus);
80-
PcdStatus = PcdSet64S (PcdPciIoBase, PlatformInfoHob->PcdPciIoBase);
81-
ASSERT_RETURN_ERROR (PcdStatus);
82-
PcdStatus = PcdSet64S (PcdPciIoSize, PlatformInfoHob->PcdPciIoSize);
83-
ASSERT_RETURN_ERROR (PcdStatus);
8471
}
72+
73+
PcdStatus = PcdSet64S (PcdPciMmio64Base, PlatformInfoHob->PcdPciMmio64Base);
74+
ASSERT_RETURN_ERROR (PcdStatus);
75+
PcdStatus = PcdSet64S (PcdPciMmio64Size, PlatformInfoHob->PcdPciMmio64Size);
76+
ASSERT_RETURN_ERROR (PcdStatus);
77+
PcdStatus = PcdSet64S (PcdPciMmio32Base, PlatformInfoHob->PcdPciMmio32Base);
78+
ASSERT_RETURN_ERROR (PcdStatus);
79+
PcdStatus = PcdSet64S (PcdPciMmio32Size, PlatformInfoHob->PcdPciMmio32Size);
80+
ASSERT_RETURN_ERROR (PcdStatus);
81+
PcdStatus = PcdSet64S (PcdPciIoBase, PlatformInfoHob->PcdPciIoBase);
82+
ASSERT_RETURN_ERROR (PcdStatus);
83+
PcdStatus = PcdSet64S (PcdPciIoSize, PlatformInfoHob->PcdPciIoSize);
84+
ASSERT_RETURN_ERROR (PcdStatus);
8585
}
8686

8787
/**

0 commit comments

Comments
 (0)