IntelSiliconPkg/IntelVtd: Consume VTd policy PCD
authorJiewen Yao <jiewen.yao@intel.com>
Mon, 4 Sep 2017 01:50:25 +0000 (09:50 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Thu, 7 Sep 2017 13:35:06 +0000 (21:35 +0800)
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
IntelSiliconPkg/IntelVTdDxe/DmaProtection.c
IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.c
IntelSiliconPkg/IntelVTdDxe/IntelVTdDxe.inf

index 82ed4d2..f5de01f 100644 (file)
@@ -437,8 +437,11 @@ OnExitBootServices (
 {\r
   DEBUG ((DEBUG_INFO, "Vtd OnExitBootServices\n"));\r
   DumpVtdRegsAll ();\r
-  DisableDmar ();\r
-  DumpVtdRegsAll ();\r
+\r
+  if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT1) == 0) {\r
+    DisableDmar ();\r
+    DumpVtdRegsAll ();\r
+  }\r
 }\r
 \r
 /**\r
index 24b88c3..64693a8 100644 (file)
@@ -352,6 +352,10 @@ IntelVTdInitialize (
   EFI_STATUS  Status;\r
   EFI_HANDLE  Handle;\r
 \r
+  if ((PcdGet8(PcdVTdPolicyPropertyMask) & BIT0) == 0) {\r
+    return EFI_UNSUPPORTED;\r
+  }\r
+\r
   InitializeDmaProtection ();\r
 \r
   Handle = NULL;\r
index 697932e..d45fd67 100644 (file)
@@ -73,6 +73,9 @@
   gEfiPciEnumerationCompleteProtocolGuid      ## CONSUMES\r
   gEdkiiPlatformVTdPolicyProtocolGuid         ## SOMETIMES_CONSUMES\r
 \r
+[Pcd]\r
+  gIntelSiliconPkgTokenSpaceGuid.PcdVTdPolicyPropertyMask   ## CONSUMES\r
+\r
 [Depex]\r
   gEfiPciRootBridgeIoProtocolGuid AND\r
   gEfiAcpiSdtProtocolGuid\r