]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelSiliconPkg/Vtd: Support CSM usage.
authorJiewen Yao <jiewen.yao@intel.com>
Mon, 4 Sep 2017 08:43:35 +0000 (16:43 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Wed, 6 Sep 2017 04:11:08 +0000 (12:11 +0800)
Remove zero address check in IoMmuMap.
The reason is that a CSM legacy driver may use legacy memory for DMA.
As such, the legacyBios need allow below 1M to the legacy device.

This patch also fixed some typo.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
IntelSiliconPkg/IntelVTdDxe/BmDma.c
IntelSiliconPkg/IntelVTdDxe/TranslationTable.c

index 5dcee003cfc3035b01d667c40f13c2d03fc1d476..7a5f3619a47d6c3e5403c44b4d58286a75bdcc82 100644 (file)
@@ -77,14 +77,14 @@ IoMmuMap (
   EFI_PHYSICAL_ADDRESS                              DmaMemoryTop;\r
   BOOLEAN                                           NeedRemap;\r
 \r
-  DEBUG ((DEBUG_VERBOSE, "IoMmuMap: ==> 0x%08x - 0x%08x (%x)\n", HostAddress, NumberOfBytes, Operation));\r
-\r
-  if (HostAddress == NULL || NumberOfBytes == NULL || DeviceAddress == NULL ||\r
+  if (NumberOfBytes == NULL || DeviceAddress == NULL ||\r
       Mapping == NULL) {\r
     DEBUG ((DEBUG_ERROR, "IoMmuMap: %r\n", EFI_INVALID_PARAMETER));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
+  DEBUG ((DEBUG_VERBOSE, "IoMmuMap: ==> 0x%08x - 0x%08x (%x)\n", HostAddress, *NumberOfBytes, Operation));\r
+\r
   //\r
   // Make sure that Operation is valid\r
   //\r
@@ -135,7 +135,7 @@ IoMmuMap (
     if (NeedRemap) {\r
       //\r
       // Common Buffer operations can not be remapped.  If the common buffer\r
-      // if above 4GB, then it is not possible to generate a mapping, so return\r
+      // is above 4GB, then it is not possible to generate a mapping, so return\r
       // an error.\r
       //\r
       DEBUG ((DEBUG_ERROR, "IoMmuMap: %r\n", EFI_UNSUPPORTED));\r
index cd3111ce363d64dfc0076a587906a61c38b3dc9f..ccecc9520cf35cc5ae6da4f15be4f907d361df69 100644 (file)
@@ -891,7 +891,7 @@ SetAccessAttribute (
 \r
   SecondLevelPagingEntry = NULL;\r
 \r
-  DEBUG ((DEBUG_INFO,"SetAccessAttribute (S%04x B%02x D%02x F%02x) (0x%016lx - 0x%08x, %x)\n", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function, BaseAddress, (UINTN)Length, IoMmuAccess));\r
+  DEBUG ((DEBUG_VERBOSE,"SetAccessAttribute (S%04x B%02x D%02x F%02x) (0x%016lx - 0x%08x, %x)\n", Segment, SourceId.Bits.Bus, SourceId.Bits.Device, SourceId.Bits.Function, BaseAddress, (UINTN)Length, IoMmuAccess));\r
 \r
   VtdIndex = FindVtdIndexByPciDevice (Segment, SourceId, &ExtContextEntry, &ContextEntry);\r
   if (VtdIndex == (UINTN)-1) {\r