]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelSiliconPkg/Feature/VTd/IntelVTdDxe/IntelVTdDxe.c
IntelSiliconPkg IntelVTdDxe: Support early SetAttributes()
[mirror_edk2.git] / IntelSiliconPkg / Feature / VTd / IntelVTdDxe / IntelVTdDxe.c
index 570b47cf73647a8b0e7e270a5f07847b2649c001..841a5a9264aa9b6f040502fcd772be9923d57daa 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Intel VTd driver.\r
 \r
-  Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2017 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -231,6 +231,14 @@ VTdSetAttribute (
   DEBUG ((DEBUG_VERBOSE, "PCI(S%x.B%x.D%x.F%x) ", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function));\r
   DEBUG ((DEBUG_VERBOSE, "(0x%lx~0x%lx) - %lx\n", DeviceAddress, Length, IoMmuAccess));\r
 \r
+  if (mAcpiDmarTable == NULL) {\r
+    //\r
+    // Record the entry to driver global variable.\r
+    // As such once VTd is activated, the setting can be adopted.\r
+    //\r
+    return RequestAccessAttribute (Segment, SourceId, DeviceAddress, Length, IoMmuAccess);\r
+  }\r
+\r
   PERF_CODE (\r
     AsciiSPrint (PerfToken, sizeof(PerfToken), "S%04xB%02xD%02xF%01x", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function);\r
     Identifier = (Segment << 16) | SourceId.Uint16;\r