[edk2] [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.

Jiewen Yao posted 3 patches 7 years, 3 months ago
[edk2] [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.
Posted by Jiewen Yao 7 years, 3 months ago
We notice that there is real usage in PEI to show
the graphic output. As such we need report RMRR table
in PEI to let VTdPmrPei driver skip the IGD UMA region.

Now the VTD_INFO PPI uses the same DMAR data structure.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 IntelSiliconPkg/Include/Ppi/VtdInfo.h | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/IntelSiliconPkg/Include/Ppi/VtdInfo.h b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
index e8be63f..a0a6f9c 100644
--- a/IntelSiliconPkg/Include/Ppi/VtdInfo.h
+++ b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
@@ -17,22 +17,26 @@
 #ifndef __VTD_INFO_PPI_H__
 #define __VTD_INFO_PPI_H__
 
+#include <IndustryStandard/Acpi.h>
+#include <IndustryStandard/DmaRemappingReportingTable.h>
+
 #define EDKII_VTD_INFO_PPI_GUID \
     { \
       0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 0xaf, 0x2b, 0x25, 0x68, 0x4a } \
     }
 
-typedef struct _EDKII_VTD_INFO_PPI  EDKII_VTD_INFO_PPI;
-
-#define EDKII_VTD_INFO_PPI_REVISION 0x00010000
-
-struct _EDKII_VTD_INFO_PPI {
-  UINT64                                  Revision;
-  UINT8                                   HostAddressWidth;
-  UINT8                                   Reserved[3];
-  UINT32                                  VTdEngineCount;
-  UINT64                                  VTdEngineAddress[1];
-};
+//
+// VTD info PPI just use same data structure as DMAR table.
+//
+// The reported information must include what is needed in PEI phase, e.g.
+//   the VTd engine (such as DRHD)
+//   the reserved DMA address in PEI for eary graphic (such as RMRR for graphic UMA)
+//
+// The reported information can be and might be a subset of full DMAR table, e.g.
+//   if some data is not avaiable (such as ANDD),
+//   if some data is not needed (such as RMRR for legacy USB).
+//
+typedef EFI_ACPI_DMAR_HEADER EDKII_VTD_INFO_PPI;
 
 extern EFI_GUID gEdkiiVTdInfoPpiGuid;
 
-- 
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.
Posted by Zeng, Star 7 years, 3 months ago
I think we'd better to add #include <IndustryStandard/Acpi.h> in DmaRemappingReportingTable.h, but not VtdInfo.h.

Thanks,
Star
-----Original Message-----
From: Yao, Jiewen 
Sent: Sunday, September 17, 2017 2:07 PM
To: edk2-devel@lists.01.org
Cc: Zeng, Star <star.zeng@intel.com>
Subject: [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.

We notice that there is real usage in PEI to show the graphic output. As such we need report RMRR table in PEI to let VTdPmrPei driver skip the IGD UMA region.

Now the VTD_INFO PPI uses the same DMAR data structure.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
---
 IntelSiliconPkg/Include/Ppi/VtdInfo.h | 26 +++++++++++---------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/IntelSiliconPkg/Include/Ppi/VtdInfo.h b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
index e8be63f..a0a6f9c 100644
--- a/IntelSiliconPkg/Include/Ppi/VtdInfo.h
+++ b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
@@ -17,22 +17,26 @@
 #ifndef __VTD_INFO_PPI_H__
 #define __VTD_INFO_PPI_H__
 
+#include <IndustryStandard/Acpi.h>
+#include <IndustryStandard/DmaRemappingReportingTable.h>
+
 #define EDKII_VTD_INFO_PPI_GUID \
     { \
       0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 0xaf, 0x2b, 0x25, 0x68, 0x4a } \
     }
 
-typedef struct _EDKII_VTD_INFO_PPI  EDKII_VTD_INFO_PPI;
-
-#define EDKII_VTD_INFO_PPI_REVISION 0x00010000
-
-struct _EDKII_VTD_INFO_PPI {
-  UINT64                                  Revision;
-  UINT8                                   HostAddressWidth;
-  UINT8                                   Reserved[3];
-  UINT32                                  VTdEngineCount;
-  UINT64                                  VTdEngineAddress[1];
-};
+//
+// VTD info PPI just use same data structure as DMAR table.
+//
+// The reported information must include what is needed in PEI phase, e.g.
+//   the VTd engine (such as DRHD)
+//   the reserved DMA address in PEI for eary graphic (such as RMRR for graphic UMA)
+//
+// The reported information can be and might be a subset of full DMAR table, e.g.
+//   if some data is not avaiable (such as ANDD),
+//   if some data is not needed (such as RMRR for legacy USB).
+//
+typedef EFI_ACPI_DMAR_HEADER EDKII_VTD_INFO_PPI;
 
 extern EFI_GUID gEdkiiVTdInfoPpiGuid;
 
--
2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.
Posted by Yao, Jiewen 7 years, 3 months ago
Agree!

> -----Original Message-----
> From: Zeng, Star
> Sent: Wednesday, September 20, 2017 2:30 PM
> To: Yao, Jiewen <jiewen.yao@intel.com>; edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>
> Subject: RE: [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.
> 
> I think we'd better to add #include <IndustryStandard/Acpi.h> in
> DmaRemappingReportingTable.h, but not VtdInfo.h.
> 
> Thanks,
> Star
> -----Original Message-----
> From: Yao, Jiewen
> Sent: Sunday, September 17, 2017 2:07 PM
> To: edk2-devel@lists.01.org
> Cc: Zeng, Star <star.zeng@intel.com>
> Subject: [PATCH 1/3] IntelSiliconPkg/VTdInfoPpi: Let it follow DMAR table.
> 
> We notice that there is real usage in PEI to show the graphic output. As such we
> need report RMRR table in PEI to let VTdPmrPei driver skip the IGD UMA region.
> 
> Now the VTD_INFO PPI uses the same DMAR data structure.
> 
> Cc: Star Zeng <star.zeng@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.1
> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
> ---
>  IntelSiliconPkg/Include/Ppi/VtdInfo.h | 26 +++++++++++---------
>  1 file changed, 15 insertions(+), 11 deletions(-)
> 
> diff --git a/IntelSiliconPkg/Include/Ppi/VtdInfo.h
> b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
> index e8be63f..a0a6f9c 100644
> --- a/IntelSiliconPkg/Include/Ppi/VtdInfo.h
> +++ b/IntelSiliconPkg/Include/Ppi/VtdInfo.h
> @@ -17,22 +17,26 @@
>  #ifndef __VTD_INFO_PPI_H__
>  #define __VTD_INFO_PPI_H__
> 
> +#include <IndustryStandard/Acpi.h>
> +#include <IndustryStandard/DmaRemappingReportingTable.h>
> +
>  #define EDKII_VTD_INFO_PPI_GUID \
>      { \
>        0x8a59fcb3, 0xf191, 0x400c, { 0x97, 0x67, 0x67, 0xaf, 0x2b, 0x25, 0x68,
> 0x4a } \
>      }
> 
> -typedef struct _EDKII_VTD_INFO_PPI  EDKII_VTD_INFO_PPI;
> -
> -#define EDKII_VTD_INFO_PPI_REVISION 0x00010000
> -
> -struct _EDKII_VTD_INFO_PPI {
> -  UINT64                                  Revision;
> -  UINT8                                   HostAddressWidth;
> -  UINT8                                   Reserved[3];
> -  UINT32                                  VTdEngineCount;
> -  UINT64                                  VTdEngineAddress[1];
> -};
> +//
> +// VTD info PPI just use same data structure as DMAR table.
> +//
> +// The reported information must include what is needed in PEI phase, e.g.
> +//   the VTd engine (such as DRHD)
> +//   the reserved DMA address in PEI for eary graphic (such as RMRR for
> graphic UMA)
> +//
> +// The reported information can be and might be a subset of full DMAR table,
> e.g.
> +//   if some data is not avaiable (such as ANDD),
> +//   if some data is not needed (such as RMRR for legacy USB).
> +//
> +typedef EFI_ACPI_DMAR_HEADER EDKII_VTD_INFO_PPI;
> 
>  extern EFI_GUID gEdkiiVTdInfoPpiGuid;
> 
> --
> 2.7.4.windows.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel