IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue
[mirror_edk2.git] / IntelSiliconPkg / Feature / VTd / IntelVTdDxe / TranslationTable.c
index cecb5d2..7bdc4a5 100644 (file)
@@ -286,9 +286,13 @@ CreateSecondLevelPagingEntry (
   if (SecondLevelPagingEntry == NULL) {\r
     return NULL;\r
   }\r
-  SecondLevelPagingEntry = CreateSecondLevelPagingEntryTable (VtdIndex, SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess);\r
-  if (SecondLevelPagingEntry == NULL) {\r
-    return NULL;\r
+\r
+  if (mAbove4GMemoryLimit != 0) {\r
+    ASSERT (mAbove4GMemoryLimit > BASE_4GB);\r
+    SecondLevelPagingEntry = CreateSecondLevelPagingEntryTable (VtdIndex, SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess);\r
+    if (SecondLevelPagingEntry == NULL) {\r
+      return NULL;\r
+    }\r
   }\r
 \r
   return SecondLevelPagingEntry;\r