public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0
@ 2022-07-06  9:03 robert.kowalewski
  2022-07-07  1:43 ` 回复: " gaoliming
  2022-07-07  7:17 ` Sheng Wei
  0 siblings, 2 replies; 3+ messages in thread
From: robert.kowalewski @ 2022-07-06  9:03 UTC (permalink / raw)
  To: devel; +Cc: Michael D Kinney, Liming Gao, Zhiguang Liu, Jenny Huang,
	Sheng Wei

Updated DMAR definitions accordingly to changes in Intel(R) Virtualization
Technology for Directed I/O (VT-D) Architecture Specification ver4.0.

Added new definition of remapping structure - SIDP. The SoC Integrated
Device Property (SIDP) reporting structure identifies devices that have
special properties and that may put restrictions on how system software
must configure remapping structures that govern such devices in a platform
where remapping hardware is enabled.

Updated DRHD definition - field 'reserved' is replaced with 'Size'.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3978

Signed-off-by: Robert Kowalewski <robert.kowalewski@intel.com>

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Jenny Huang <jenny.huang@intel.com>
Cc: Sheng Wei <w.sheng@intel.com>
---
 .../DmaRemappingReportingTable.h              | 46 +++++++++++++++----
 1 file changed, 38 insertions(+), 8 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
index 193e4bced5..00588ff234 100644
--- a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
+++ b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
@@ -2,12 +2,12 @@
   DMA Remapping Reporting (DMAR) ACPI table definition from Intel(R)
   Virtualization Technology for Directed I/O (VT-D) Architecture Specification.
 
-  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Revision Reference:
     - Intel(R) Virtualization Technology for Directed I/O (VT-D) Architecture
-      Specification v3.2, Dated October 2020.
+      Specification v4.0, Dated June 2022.
       https://software.intel.com/content/dam/develop/external/us/en/documents/vt-directed-io-spec.pdf
 
   @par Glossary:
@@ -41,6 +41,7 @@
 #define EFI_ACPI_DMAR_TYPE_RHSA  0x03
 #define EFI_ACPI_DMAR_TYPE_ANDD  0x04
 #define EFI_ACPI_DMAR_TYPE_SATC  0x05
+#define EFI_ACPI_DMAR_TYPE_SIDP  0x06
 ///@}
 
 ///
@@ -56,6 +57,12 @@
 #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_IOAPIC                 0x03
 #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_MSI_CAPABLE_HPET       0x04
 #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_ACPI_NAMESPACE_DEVICE  0x05
+
+#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_NESTED_NOTALLOWED  BIT0
+#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PWSNP_NOTALLOWED   BIT1
+#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PGSNP_NOTALLOWED   BIT2
+#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_HARDENED       BIT3
+#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_REQUIRED       BIT4
 ///@}
 
 ///
@@ -83,11 +90,12 @@ typedef struct {
 /// Device Scope Structure is defined in section 8.3.1
 ///
 typedef struct {
-  UINT8     Type;
-  UINT8     Length;
-  UINT16    Reserved2;
-  UINT8     EnumerationId;
-  UINT8     StartBusNumber;
+  UINT8    Type;
+  UINT8    Length;
+  UINT8    Flags;
+  UINT8    Reserved;
+  UINT8    EnumerationId;
+  UINT8    StartBusNumber;
 } EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER;
 
 /**
@@ -111,7 +119,14 @@ typedef struct {
     - Bits[7:1] Reserved.
   **/
   UINT8     Flags;
-  UINT8     Reserved;
+
+  /**
+    - Bits[3:0]: Indicates the size of the remapping hardware register set for
+                 this remapping unit. If the value in this field is N, the size
+                 of the register set is 2^N 4 KB pages
+    - Bits[7:4]: Reserved.
+  **/
+  UINT8     Size;
   ///
   /// The PCI Segment associated with this unit.
   ///
@@ -249,6 +264,20 @@ typedef struct {
   UINT16    SegmentNumber;
 } EFI_ACPI_DMAR_SATC_HEADER;
 
+/**
+  SoC Integrated Device Property (SIDP) Reporting Structure is defined in
+  section 8.9.
+**/
+typedef struct {
+  EFI_ACPI_DMAR_STRUCTURE_HEADER    Header;
+
+  UINT16                            Reserved;
+  ///
+  /// The PCI Segment associated with this SIDP structure.
+  ///
+  UINT16                            SegmentNumber;
+} EFI_ACPI_DMAR_SIDP_HEADER;
+
 /**
   DMA Remapping Reporting Structure Header as defined in section 8.1
   This header will be followed by list of Remapping Structures listed below
@@ -258,6 +287,7 @@ typedef struct {
     - Remapping Hardware Static Affinity (RHSA)
     - ACPI Name-space Device Declaration (ANDD)
     - SoC Integrated Address Translation Cache reporting (SATC)
+    - SoC Integrated Device Property reporting (SIDP)
   These structure types must by reported in numerical order.
   i.e., All remapping structures of type 0 (DRHD) enumerated before remapping
   structures of type 1 (RMRR), and so forth.
-- 
2.32.0.windows.1

---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.


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

* 回复: [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0
  2022-07-06  9:03 [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0 robert.kowalewski
@ 2022-07-07  1:43 ` gaoliming
  2022-07-07  7:17 ` Sheng Wei
  1 sibling, 0 replies; 3+ messages in thread
From: gaoliming @ 2022-07-07  1:43 UTC (permalink / raw)
  To: 'Robert Kowalewski', devel
  Cc: 'Michael D Kinney', 'Zhiguang Liu',
	'Jenny Huang', 'Sheng Wei'

Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

> -----邮件原件-----
> 发件人: Robert Kowalewski <robert.kowalewski@intel.com>
> 发送时间: 2022年7月6日 21:48
> 收件人: devel@edk2.groups.io
> 抄送: Michael D Kinney <michael.d.kinney@intel.com>; Liming Gao
> <gaoliming@byosoft.com.cn>; Zhiguang Liu <zhiguang.liu@intel.com>; Jenny
> Huang <jenny.huang@intel.com>; Sheng Wei <w.sheng@intel.com>
> 主题: [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec
> ver4.0
> 
> Updated DMAR definitions accordingly to changes in Intel(R) Virtualization
> Technology for Directed I/O (VT-D) Architecture Specification ver4.0.
> 
> Added new definition of remapping structure - SIDP. The SoC Integrated
> Device Property (SIDP) reporting structure identifies devices that have
> special properties and that may put restrictions on how system software
> must configure remapping structures that govern such devices in a platform
> where remapping hardware is enabled.
> 
> Updated DRHD definition - field 'reserved' is replaced with 'Size'.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3978
> 
> Signed-off-by: Robert Kowalewski <robert.kowalewski@intel.com>
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Jenny Huang <jenny.huang@intel.com>
> Cc: Sheng Wei <w.sheng@intel.com>
> ---
>  .../DmaRemappingReportingTable.h              | 46
> +++++++++++++++----
>  1 file changed, 38 insertions(+), 8 deletions(-)
> 
> diff --git
> a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> index 193e4bced5..00588ff234 100644
> --- a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> +++ b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> @@ -2,12 +2,12 @@
>    DMA Remapping Reporting (DMAR) ACPI table definition from Intel(R)
>    Virtualization Technology for Directed I/O (VT-D) Architecture
> Specification.
> 
> -  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2016 - 2022, Intel Corporation. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>    @par Revision Reference:
>      - Intel(R) Virtualization Technology for Directed I/O (VT-D)
Architecture
> -      Specification v3.2, Dated October 2020.
> +      Specification v4.0, Dated June 2022.
> 
> https://software.intel.com/content/dam/develop/external/us/en/documents
> /vt-directed-io-spec.pdf
> 
>    @par Glossary:
> @@ -41,6 +41,7 @@
>  #define EFI_ACPI_DMAR_TYPE_RHSA  0x03
>  #define EFI_ACPI_DMAR_TYPE_ANDD  0x04
>  #define EFI_ACPI_DMAR_TYPE_SATC  0x05
> +#define EFI_ACPI_DMAR_TYPE_SIDP  0x06
>  ///@}
> 
>  ///
> @@ -56,6 +57,12 @@
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_IOAPIC
> 0x03
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_MSI_CAPABLE_HPET
> 0x04
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_ACPI_NAMESPACE_DEVICE
> 0x05
> +
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_NESTED_NOTALLOWED
> BIT0
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PWSNP_NOTALLOWED
> BIT1
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PGSNP_NOTALLOWED
> BIT2
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_HARDENED
> BIT3
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_REQUIRED
> BIT4
>  ///@}
> 
>  ///
> @@ -83,11 +90,12 @@ typedef struct {
>  /// Device Scope Structure is defined in section 8.3.1
>  ///
>  typedef struct {
> -  UINT8     Type;
> -  UINT8     Length;
> -  UINT16    Reserved2;
> -  UINT8     EnumerationId;
> -  UINT8     StartBusNumber;
> +  UINT8    Type;
> +  UINT8    Length;
> +  UINT8    Flags;
> +  UINT8    Reserved;
> +  UINT8    EnumerationId;
> +  UINT8    StartBusNumber;
>  } EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER;
> 
>  /**
> @@ -111,7 +119,14 @@ typedef struct {
>      - Bits[7:1] Reserved.
>    **/
>    UINT8     Flags;
> -  UINT8     Reserved;
> +
> +  /**
> +    - Bits[3:0]: Indicates the size of the remapping hardware register
set for
> +                 this remapping unit. If the value in this field is N,
the
> size
> +                 of the register set is 2^N 4 KB pages
> +    - Bits[7:4]: Reserved.
> +  **/
> +  UINT8     Size;
>    ///
>    /// The PCI Segment associated with this unit.
>    ///
> @@ -249,6 +264,20 @@ typedef struct {
>    UINT16    SegmentNumber;
>  } EFI_ACPI_DMAR_SATC_HEADER;
> 
> +/**
> +  SoC Integrated Device Property (SIDP) Reporting Structure is defined in
> +  section 8.9.
> +**/
> +typedef struct {
> +  EFI_ACPI_DMAR_STRUCTURE_HEADER    Header;
> +
> +  UINT16                            Reserved;
> +  ///
> +  /// The PCI Segment associated with this SIDP structure.
> +  ///
> +  UINT16                            SegmentNumber;
> +} EFI_ACPI_DMAR_SIDP_HEADER;
> +
>  /**
>    DMA Remapping Reporting Structure Header as defined in section 8.1
>    This header will be followed by list of Remapping Structures listed
below
> @@ -258,6 +287,7 @@ typedef struct {
>      - Remapping Hardware Static Affinity (RHSA)
>      - ACPI Name-space Device Declaration (ANDD)
>      - SoC Integrated Address Translation Cache reporting (SATC)
> +    - SoC Integrated Device Property reporting (SIDP)
>    These structure types must by reported in numerical order.
>    i.e., All remapping structures of type 0 (DRHD) enumerated before
> remapping
>    structures of type 1 (RMRR), and so forth.
> --
> 2.32.0.windows.1
> 
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII
> Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP
> 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego
> adresata i moze zawierac informacje poufne. W razie przypadkowego
> otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale
> jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest
> zabronione.
> This e-mail and any attachments may contain confidential material for the
> sole use of the intended recipient(s). If you are not the intended
recipient,
> please contact the sender and delete all copies; any review or
distribution by
> others is strictly prohibited.




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

* Re: [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0
  2022-07-06  9:03 [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0 robert.kowalewski
  2022-07-07  1:43 ` 回复: " gaoliming
@ 2022-07-07  7:17 ` Sheng Wei
  1 sibling, 0 replies; 3+ messages in thread
From: Sheng Wei @ 2022-07-07  7:17 UTC (permalink / raw)
  To: Kowalewski, Robert, devel@edk2.groups.io
  Cc: Kinney, Michael D, Gao, Liming, Liu, Zhiguang, Huang, Jenny

Reviewed-by: Sheng Wei <w.sheng@intel.com>

The change matches the Vtd specification v 4.0


> -----Original Message-----
> From: Kowalewski, Robert <robert.kowalewski@intel.com>
> Sent: 2022年7月6日 21:48
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>; Gao, Liming
> <gaoliming@byosoft.com.cn>; Liu, Zhiguang <zhiguang.liu@intel.com>;
> Huang, Jenny <jenny.huang@intel.com>; Sheng, W <w.sheng@intel.com>
> Subject: [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d
> spec ver4.0
> 
> Updated DMAR definitions accordingly to changes in Intel(R) Virtualization
> Technology for Directed I/O (VT-D) Architecture Specification ver4.0.
> 
> Added new definition of remapping structure - SIDP. The SoC Integrated
> Device Property (SIDP) reporting structure identifies devices that have
> special properties and that may put restrictions on how system software
> must configure remapping structures that govern such devices in a platform
> where remapping hardware is enabled.
> 
> Updated DRHD definition - field 'reserved' is replaced with 'Size'.
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3978
> 
> Signed-off-by: Robert Kowalewski <robert.kowalewski@intel.com>
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Cc: Liming Gao <gaoliming@byosoft.com.cn>
> Cc: Zhiguang Liu <zhiguang.liu@intel.com>
> Cc: Jenny Huang <jenny.huang@intel.com>
> Cc: Sheng Wei <w.sheng@intel.com>
> ---
>  .../DmaRemappingReportingTable.h              | 46 +++++++++++++++----
>  1 file changed, 38 insertions(+), 8 deletions(-)
> 
> diff --git
> a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> index 193e4bced5..00588ff234 100644
> --- a/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> +++ b/MdePkg/Include/IndustryStandard/DmaRemappingReportingTable.h
> @@ -2,12 +2,12 @@
>    DMA Remapping Reporting (DMAR) ACPI table definition from Intel(R)
>    Virtualization Technology for Directed I/O (VT-D) Architecture Specification.
> 
> -  Copyright (c) 2016 - 2020, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2016 - 2022, Intel Corporation. All rights
> + reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>    @par Revision Reference:
>      - Intel(R) Virtualization Technology for Directed I/O (VT-D) Architecture
> -      Specification v3.2, Dated October 2020.
> +      Specification v4.0, Dated June 2022.
> 
> https://software.intel.com/content/dam/develop/external/us/en/documen
> ts/vt-directed-io-spec.pdf
> 
>    @par Glossary:
> @@ -41,6 +41,7 @@
>  #define EFI_ACPI_DMAR_TYPE_RHSA  0x03
>  #define EFI_ACPI_DMAR_TYPE_ANDD  0x04
>  #define EFI_ACPI_DMAR_TYPE_SATC  0x05
> +#define EFI_ACPI_DMAR_TYPE_SIDP  0x06
>  ///@}
> 
>  ///
> @@ -56,6 +57,12 @@
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_IOAPIC                 0x03
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_MSI_CAPABLE_HPET
> 0x04
>  #define EFI_ACPI_DEVICE_SCOPE_ENTRY_TYPE_ACPI_NAMESPACE_DEVICE
> 0x05
> +
> +#define
> EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_NESTED_NOTALLOWED  BIT0
> +#define
> EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PWSNP_NOTALLOWED   BIT1
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_PGSNP_NOTALLOWED
> BIT2
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_HARDENED
> BIT3
> +#define EFI_ACPI_DEVICE_SCOPE_REQ_WO_PASID_ATC_REQUIRED
> BIT4
>  ///@}
> 
>  ///
> @@ -83,11 +90,12 @@ typedef struct {
>  /// Device Scope Structure is defined in section 8.3.1  ///  typedef struct {
> -  UINT8     Type;
> -  UINT8     Length;
> -  UINT16    Reserved2;
> -  UINT8     EnumerationId;
> -  UINT8     StartBusNumber;
> +  UINT8    Type;
> +  UINT8    Length;
> +  UINT8    Flags;
> +  UINT8    Reserved;
> +  UINT8    EnumerationId;
> +  UINT8    StartBusNumber;
>  } EFI_ACPI_DMAR_DEVICE_SCOPE_STRUCTURE_HEADER;
> 
>  /**
> @@ -111,7 +119,14 @@ typedef struct {
>      - Bits[7:1] Reserved.
>    **/
>    UINT8     Flags;
> -  UINT8     Reserved;
> +
> +  /**
> +    - Bits[3:0]: Indicates the size of the remapping hardware register set for
> +                 this remapping unit. If the value in this field is N, the size
> +                 of the register set is 2^N 4 KB pages
> +    - Bits[7:4]: Reserved.
> +  **/
> +  UINT8     Size;
>    ///
>    /// The PCI Segment associated with this unit.
>    ///
> @@ -249,6 +264,20 @@ typedef struct {
>    UINT16    SegmentNumber;
>  } EFI_ACPI_DMAR_SATC_HEADER;
> 
> +/**
> +  SoC Integrated Device Property (SIDP) Reporting Structure is defined
> +in
> +  section 8.9.
> +**/
> +typedef struct {
> +  EFI_ACPI_DMAR_STRUCTURE_HEADER    Header;
> +
> +  UINT16                            Reserved;
> +  ///
> +  /// The PCI Segment associated with this SIDP structure.
> +  ///
> +  UINT16                            SegmentNumber;
> +} EFI_ACPI_DMAR_SIDP_HEADER;
> +
>  /**
>    DMA Remapping Reporting Structure Header as defined in section 8.1
>    This header will be followed by list of Remapping Structures listed below
> @@ -258,6 +287,7 @@ typedef struct {
>      - Remapping Hardware Static Affinity (RHSA)
>      - ACPI Name-space Device Declaration (ANDD)
>      - SoC Integrated Address Translation Cache reporting (SATC)
> +    - SoC Integrated Device Property reporting (SIDP)
>    These structure types must by reported in numerical order.
>    i.e., All remapping structures of type 0 (DRHD) enumerated before
> remapping
>    structures of type 1 (RMRR), and so forth.
> --
> 2.32.0.windows.1


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

end of thread, other threads:[~2022-07-07  7:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-06  9:03 [PATCH] MdePkg/include: Update DMAR definitions to Intel VT-d spec ver4.0 robert.kowalewski
2022-07-07  1:43 ` 回复: " gaoliming
2022-07-07  7:17 ` Sheng Wei

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