IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue

Fix DMA does not work issue when system memory is not
greater than 4G.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Star Zeng 2018-01-17 19:33:30 +08:00
parent 9c6961d598
commit 1d4c17a6ef
1 changed files with 7 additions and 3 deletions

View File

@ -286,9 +286,13 @@ CreateSecondLevelPagingEntry (
if (SecondLevelPagingEntry == NULL) {
return NULL;
}
SecondLevelPagingEntry = CreateSecondLevelPagingEntryTable (VtdIndex, SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess);
if (SecondLevelPagingEntry == NULL) {
return NULL;
if (mAbove4GMemoryLimit != 0) {
ASSERT (mAbove4GMemoryLimit > BASE_4GB);
SecondLevelPagingEntry = CreateSecondLevelPagingEntryTable (VtdIndex, SecondLevelPagingEntry, SIZE_4GB, mAbove4GMemoryLimit, IoMmuAccess);
if (SecondLevelPagingEntry == NULL) {
return NULL;
}
}
return SecondLevelPagingEntry;