summaryrefslogtreecommitdiff
path: root/IntelSiliconPkg
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2017-09-04 16:43:35 +0800
committerJiewen Yao <jiewen.yao@intel.com>2017-09-06 12:11:08 +0800
commit94fb621d370e7397e988038f28eede05b40ee6e5 (patch)
tree260d0e40e19ab65c64ea351814e50c0d7999d9d3 /IntelSiliconPkg
parent7d8e8474f98bcefc6cc18914c995b04fa8a7e39d (diff)
downloadedk2-94fb621d370e7397e988038f28eede05b40ee6e5.zip
edk2-94fb621d370e7397e988038f28eede05b40ee6e5.tar.gz
edk2-94fb621d370e7397e988038f28eede05b40ee6e5.tar.bz2
IntelSiliconPkg/Vtd: Support CSM usage.
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>
Diffstat (limited to 'IntelSiliconPkg')
-rw-r--r--IntelSiliconPkg/IntelVTdDxe/BmDma.c8
-rw-r--r--IntelSiliconPkg/IntelVTdDxe/TranslationTable.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/IntelSiliconPkg/IntelVTdDxe/BmDma.c b/IntelSiliconPkg/IntelVTdDxe/BmDma.c
index 5dcee00..7a5f361 100644
--- a/IntelSiliconPkg/IntelVTdDxe/BmDma.c
+++ b/IntelSiliconPkg/IntelVTdDxe/BmDma.c
@@ -77,14 +77,14 @@ IoMmuMap (
EFI_PHYSICAL_ADDRESS DmaMemoryTop;
BOOLEAN NeedRemap;
- DEBUG ((DEBUG_VERBOSE, "IoMmuMap: ==> 0x%08x - 0x%08x (%x)\n", HostAddress, NumberOfBytes, Operation));
-
- if (HostAddress == NULL || NumberOfBytes == NULL || DeviceAddress == NULL ||
+ if (NumberOfBytes == NULL || DeviceAddress == NULL ||
Mapping == NULL) {
DEBUG ((DEBUG_ERROR, "IoMmuMap: %r\n", EFI_INVALID_PARAMETER));
return EFI_INVALID_PARAMETER;
}
+ DEBUG ((DEBUG_VERBOSE, "IoMmuMap: ==> 0x%08x - 0x%08x (%x)\n", HostAddress, *NumberOfBytes, Operation));
+
//
// Make sure that Operation is valid
//
@@ -135,7 +135,7 @@ IoMmuMap (
if (NeedRemap) {
//
// Common Buffer operations can not be remapped. If the common buffer
- // if above 4GB, then it is not possible to generate a mapping, so return
+ // is above 4GB, then it is not possible to generate a mapping, so return
// an error.
//
DEBUG ((DEBUG_ERROR, "IoMmuMap: %r\n", EFI_UNSUPPORTED));
diff --git a/IntelSiliconPkg/IntelVTdDxe/TranslationTable.c b/IntelSiliconPkg/IntelVTdDxe/TranslationTable.c
index cd3111c..ccecc95 100644
--- a/IntelSiliconPkg/IntelVTdDxe/TranslationTable.c
+++ b/IntelSiliconPkg/IntelVTdDxe/TranslationTable.c
@@ -891,7 +891,7 @@ SetAccessAttribute (
SecondLevelPagingEntry = NULL;
- 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));
+ 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));
VtdIndex = FindVtdIndexByPciDevice (Segment, SourceId, &ExtContextEntry, &ContextEntry);
if (VtdIndex == (UINTN)-1) {