public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue
@ 2018-01-17 11:56 Star Zeng
  2018-01-17 11:59 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2018-01-17 11:56 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jiewen Yao

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>
---
 IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
index cecb5d23efbf..7f64d5e418f6 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
@@ -286,11 +286,14 @@ 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;
 }
 
-- 
2.7.0.windows.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue
  2018-01-17 11:56 [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue Star Zeng
@ 2018-01-17 11:59 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2018-01-17 11:59 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org

Good catch.

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Wednesday, January 17, 2018 7:57 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] 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>
> ---
>  IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
> b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
> index cecb5d23efbf..7f64d5e418f6 100644
> --- a/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
> +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdDxe/TranslationTable.c
> @@ -286,11 +286,14 @@ 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;
>  }
> 
> --
> 2.7.0.windows.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-17 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-17 11:56 [PATCH] IntelSiliconPkg IntelVTdDxe: Fix DMA does not work issue Star Zeng
2018-01-17 11:59 ` Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox