public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelSiliconPkg IntelVTdPmrPei: Use HostAddressWidth in DMAR correctly
@ 2018-01-16 10:52 Star Zeng
  2018-01-17  1:09 ` Yao, Jiewen
  0 siblings, 1 reply; 2+ messages in thread
From: Star Zeng @ 2018-01-16 10:52 UTC (permalink / raw)
  To: edk2-devel; +Cc: Star Zeng, Jiewen Yao

According to VTd spec, HostAddressWidth + 1 should be used as the real
host address width value.

Host Address Width:
This field indicates the maximum DMA physical
addressability supported by this platform. The
system address map reported by the BIOS
indicates what portions of this addresses are
populated.
The Host Address Width (HAW) of the platform is
computed as (N+1), where N is the value
reported in this field. For example, for a platform
supporting 40 bits of physical addressability, the
value of 100111b is reported in this field.

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/IntelVTdPmrPei/IntelVTdPmrPei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
index 7147a19f538a..aae482a0385b 100644
--- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
+++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
@@ -677,7 +677,7 @@ InitVTdPmrForAll (
   LowBottom = 0;
   LowTop = 0;
   HighBottom = 0;
-  HighTop = LShiftU64 (1, VTdInfo->HostAddressWidth);
+  HighTop = LShiftU64 (1, VTdInfo->HostAddressWidth + 1);
 
   Status = SetDmaProtectedRange (
              VTdInfo,
-- 
2.7.0.windows.1



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

* Re: [PATCH] IntelSiliconPkg IntelVTdPmrPei: Use HostAddressWidth in DMAR correctly
  2018-01-16 10:52 [PATCH] IntelSiliconPkg IntelVTdPmrPei: Use HostAddressWidth in DMAR correctly Star Zeng
@ 2018-01-17  1:09 ` Yao, Jiewen
  0 siblings, 0 replies; 2+ messages in thread
From: Yao, Jiewen @ 2018-01-17  1:09 UTC (permalink / raw)
  To: Zeng, Star, edk2-devel@lists.01.org

Reviewed-by: Jiewen.yao@intel.com

> -----Original Message-----
> From: Zeng, Star
> Sent: Tuesday, January 16, 2018 6:52 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [PATCH] IntelSiliconPkg IntelVTdPmrPei: Use HostAddressWidth in
> DMAR correctly
> 
> According to VTd spec, HostAddressWidth + 1 should be used as the real
> host address width value.
> 
> Host Address Width:
> This field indicates the maximum DMA physical
> addressability supported by this platform. The
> system address map reported by the BIOS
> indicates what portions of this addresses are
> populated.
> The Host Address Width (HAW) of the platform is
> computed as (N+1), where N is the value
> reported in this field. For example, for a platform
> supporting 40 bits of physical addressability, the
> value of 100111b is reported in this field.
> 
> 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/IntelVTdPmrPei/IntelVTdPmrPei.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> index 7147a19f538a..aae482a0385b 100644
> --- a/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> +++ b/IntelSiliconPkg/Feature/VTd/IntelVTdPmrPei/IntelVTdPmrPei.c
> @@ -677,7 +677,7 @@ InitVTdPmrForAll (
>    LowBottom = 0;
>    LowTop = 0;
>    HighBottom = 0;
> -  HighTop = LShiftU64 (1, VTdInfo->HostAddressWidth);
> +  HighTop = LShiftU64 (1, VTdInfo->HostAddressWidth + 1);
> 
>    Status = SetDmaProtectedRange (
>               VTdInfo,
> --
> 2.7.0.windows.1



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

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

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 10:52 [PATCH] IntelSiliconPkg IntelVTdPmrPei: Use HostAddressWidth in DMAR correctly Star Zeng
2018-01-17  1:09 ` Yao, Jiewen

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