[edk2-devel] [PATCH v4 2/2] IntelSiliconPkg/VTd: Add PCD flag for select pre-boot DMA protection Driver

Sheng Wei posted 2 patches 5 months, 2 weeks ago

[edk2-devel] [PATCH v4 2/2] IntelSiliconPkg/VTd: Add PCD flag for select pre-boot DMA protection Driver

Posted by Sheng Wei 5 months, 2 weeks ago
gIntelSiliconPkgTokenSpaceGuid.PcdVtdDmarPeiEnable is added for select
 pre-boot DMA protection driver in PEI phase.
IntelVTdPmrPei driver is used to do the pre-boot DMA protection by PMR.
IntelVTdDmarPei driver is used to do the pre-boot DMA protection by DMAR.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3095

Signed-off-by: Sheng Wei <w.sheng@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jenny Huang <jenny.huang@intel.com>
Cc: Feng Roger <roger.feng@intel.com>
Reviewed-by: Jenny Huang <jenny.huang@intel.com>
---
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec | 7 +++++++
 Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
index 4a2cbca5..b386080a 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dec
@@ -84,6 +84,12 @@
   # @Prompt Shadow all microcode update patches.
   gIntelSiliconPkgTokenSpaceGuid.PcdShadowAllMicrocode|FALSE|BOOLEAN|0x00000006
 
+  ## Declares the VTd PEI driver to protect DMA.<BR><BR>
+  #   TRUE:  Use DMAR to protect DMA at PEI phase
+  #   FALSE: Use PMR to protect DMA at PEI phase
+  # @Prompt The VTd PEI driver to protect DMA.
+  gIntelSiliconPkgTokenSpaceGuid.PcdVtdDmarPeiEnable|FALSE|BOOLEAN|0x00000007
+
 [PcdsFixedAtBuild, PcdsPatchableInModule]
   ## Error code for VTd error.<BR><BR>
   #  EDKII_ERROR_CODE_VTD_ERROR = (EFI_IO_BUS_UNSPECIFIED | (EFI_OEM_SPECIFIC | 0x00000000)) = 0x02008000<BR>
@@ -121,3 +127,4 @@
   # @Prompt The VTd PEI DMA buffer size for S3.
   gIntelSiliconPkgTokenSpaceGuid.PcdVTdPeiDmaBufferSizeS3|0x00200000|UINT32|0x00000004
 
+
diff --git a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
index 029b9156..6feb5a99 100644
--- a/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
+++ b/Silicon/Intel/IntelSiliconPkg/IntelSiliconPkg.dsc
@@ -80,7 +80,11 @@
   IntelSiliconPkg/Feature/PcieSecurity/IntelPciDeviceSecurityDxe/IntelPciDeviceSecurityDxe.inf
   IntelSiliconPkg/Feature/PcieSecurity/SamplePlatformDevicePolicyDxe/SamplePlatformDevicePolicyDxe.inf
   IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.inf
+!if gIntelSiliconPkgTokenSpaceGuid.PcdVtdDmarPeiEnable == TRUE
+  IntelSiliconPkg/Feature/VTd/IntelVTdDmarPei/IntelVTdDmarPei.inf
+!else
   IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.inf
+!endif
   IntelSiliconPkg/Feature/VTd/PlatformVTdSampleDxe/PlatformVTdSampleDxe.inf
   IntelSiliconPkg/Feature/VTd/PlatformVTdInfoSamplePei/PlatformVTdInfoSamplePei.inf
   IntelSiliconPkg/Feature/Capsule/MicrocodeUpdateDxe/MicrocodeUpdateDxe.inf
-- 
2.16.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#69787): https://edk2.groups.io/g/devel/message/69787
Mute This Topic: https://groups.io/mt/79470032/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-