public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "PierreGondois" <pierre.gondois@arm.com>
To: devel@edk2.groups.io, sami.mujawar@arm.com
Cc: Alexei.Fedorov@arm.com, Matteo.Carlini@arm.com,
	Ben.Adderson@arm.com, steven.price@arm.com,
	Lorenzo.Pieralisi@arm.com, nd@arm.com
Subject: Re: [edk2-devel] [PATCH v2 8/8] DynamicTablesPkg: IORT generator updates for Rev E.b spec
Date: Mon, 18 Oct 2021 17:17:09 +0100	[thread overview]
Message-ID: <4f401d55-d08b-ead3-a4fc-24f969009c71@arm.com> (raw)
In-Reply-To: <20210617095538.93280-9-sami.mujawar@arm.com>

Hi Sami,

With the small modification:

Reviewed-by: Pierre Gondois <pierre.gondois@arm.com>

On 6/17/21 10:55, Sami Mujawar via groups.io wrote:
> Bugzilla: 3458 - Add support IORT Rev E.b specification updates
>           (https://bugzilla.tianocore.org/show_bug.cgi?id=3458)
>
> The IO Remapping Table, Platform Design Document, Revision E.b,
> Feb 2021 (https://developer.arm.com/documentation/den0049/)
> introduces the following updates, collectively including the
> updates and errata fixes to Rev E and Rev E.a:
>   - increments the IORT table revision to 3.
>   - updates the node definition to add an 'Identifier' field.
>   - adds definition of node type 6 - Reserved Memory Range node.
>   - adds definition for Memory Range Descriptors.
>   - adds flag to indicate PRI support for root complexes.
>   - adds flag to indicate if the root complex supports forwarding
>     of PASID information on translated transactions to the SMMU.
>
> Therefore, update the IORT generator to:
>   - increment IORT table revision count to 3.
>   - populate Identifier filed if revision is greater than 2.
>   - add support to populate Reserved Memory Range nodes and
>     the Memory range descriptors.
>   - add validation to check that the Identifier field is
>     unique.
>
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
>
> Notes:
>     v2:
>      - The macro EFI_ACPI_IO_REMAPPING_TABLE_REVISION was set to   [SAMI]
>        Rev 0 as setting to Rev 3 will break existing platforms.
>        Therefore, set the max supported IORT generator revision
>        to 3.
>
>  DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 661 ++++++++++++++++++--
>  DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h |   5 +-
>  2 files changed, 624 insertions(+), 42 deletions(-)
>
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
> index 9ccf72594db378878d4e3abbafe98e749d9963da..9b687f0165e6136f2f24749d27dee27edaff1b31 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c
> @@ -5,8 +5,8 @@
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>    @par Reference(s):
> -  - IO Remapping Table, Platform Design Document,
> -    Document number: ARM DEN 0049D, Issue D, March 2018
> +  - IO Remapping Table, Platform Design Document, Revision E.b, Feb 2021
> +    (https://developer.arm.com/documentation/den0049/)
>  
>  **/
>  
[snip]
> +
>        // Ids for SMMUv3 node
>        IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuV3Node +
>                      SmmuV3Node->Node.IdReference);
> @@ -1417,6 +1616,7 @@ AddSmmuV3Nodes (
>      @param [in]     This             Pointer to the table Generator.
>      @param [in]     CfgMgrProtocol   Pointer to the Configuration Manager
>                                       Protocol Interface.
> +    @param [in]     AcpiTableInfo    Pointer to the ACPI table info structure.
>      @param [in]     Iort             Pointer to IORT table structure.
>      @param [in]     NodesStartOffset Offset for the start of the PMCG Nodes.
>      @param [in]     NodeList         Pointer to an array of PMCG Node Objects.
> @@ -1431,6 +1631,7 @@ EFI_STATUS
>  AddPmcgNodes (
>    IN      CONST ACPI_TABLE_GENERATOR                  * CONST This,
>    IN      CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL  * CONST CfgMgrProtocol,
> +  IN      CONST CM_STD_OBJ_ACPI_TABLE_INFO            * CONST AcpiTableInfo,
>    IN      CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE       *       Iort,
>    IN      CONST UINT32                                        NodesStartOffset,
>    IN      CONST CM_ARM_PMCG_NODE                      *       NodeList,
> @@ -1465,12 +1666,18 @@ AddPmcgNodes (
>      // Populate the node header
>      PmcgNode->Node.Type = EFI_ACPI_IORT_TYPE_PMCG;
>      PmcgNode->Node.Length = (UINT16)NodeLength;
> -    PmcgNode->Node.Revision = 1;
> -    PmcgNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
>      PmcgNode->Node.NumIdMappings = NodeList->IdMappingCount;
>      PmcgNode->Node.IdReference = (NodeList->IdMappingCount == 0) ?
>        0 : sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE);
>  
> +    if (AcpiTableInfo->AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REV3) {
> +      PmcgNode->Node.Revision = 1;
> +      PmcgNode->Node.Identifier = EFI_ACPI_RESERVED_DWORD;
> +    } else {
> +      PmcgNode->Node.Revision = 2;
> +      PmcgNode->Node.Identifier = NodeList->Identifier;
> +    }
> +
>      // PMCG specific data
>      PmcgNode->Base = NodeList->BaseAddress;
>      PmcgNode->OverflowInterruptGsiv = NodeList->OverflowInterrupt;
> @@ -1494,8 +1701,19 @@ AddPmcgNodes (
>        return Status;
>      }
>  
> -    if ((NodeList->IdMappingCount > 0) &&
> -        (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
> +    if (NodeList->IdMappingCount > 0) {
> +      if (NodeList->IdMappingToken == CM_NULL_TOKEN) {
> +        Status = EFI_INVALID_PARAMETER;
> +        DEBUG ((
> +          DEBUG_ERROR,
> +          "ERROR: IORT: Invalid Id Mapping token,"
> +          " Token = 0x%x, Status =%r\n",
> +          NodeList->IdMappingToken,
> +          Status
> +          ));
> +        return Status;
> +      }
> +

As this is not related to the RevE spec update, could it be done in:

[PATCH v2 6/8] DynamicTablesPkg: IORT set reference to interrupt array
if present

This is also done at other places.

>        // Ids for PMCG node
>        IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)PmcgNode +
>                      PmcgNode->Node.IdReference);
> @@ -1526,6 +1744,273 @@ AddPmcgNodes (
>    return EFI_SUCCESS;
>  }
>  

[snip]

Regards,

Pierre


  reply	other threads:[~2021-10-18 16:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17  9:55 [PATCH v2 0/8] IORT Rev E.b specification updates Sami Mujawar
2021-06-17  9:55 ` [PATCH v2 1/8] MdePkg: Fix IORT header file include guard Sami Mujawar
2021-06-17 18:19   ` Michael D Kinney
2021-06-21 11:08     ` [edk2-devel] " Sami Mujawar
2021-06-17  9:55 ` [PATCH v2 2/8] MdePkg: IORT header update for IORT Rev E.b spec Sami Mujawar
2021-06-28  7:53   ` Gao, Zhichao
2021-10-15 14:45   ` [edk2-devel] " PierreGondois
2021-06-17  9:55 ` [PATCH v2 3/8] ShellPkg: Acpiview: Abbreviate field names to preserve alignment Sami Mujawar
2021-06-28  7:53   ` Gao, Zhichao
2021-10-15 13:33   ` [edk2-devel] " PierreGondois
2021-06-17  9:55 ` [PATCH v2 4/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.b spec Sami Mujawar
2021-06-28  7:53   ` Gao, Zhichao
2021-06-17  9:55 ` [PATCH v2 5/8] DynamicTablesPkg: IORT set reference to Id array only if present Sami Mujawar
2021-10-15 15:22   ` [edk2-devel] " PierreGondois
2021-06-17  9:55 ` [PATCH v2 6/8] DynamicTablesPkg: IORT set reference to interrupt array " Sami Mujawar
2021-10-18 15:48   ` [edk2-devel] " PierreGondois
2021-06-17  9:55 ` [PATCH v2 7/8] DynamicTablesPkg: Update ArmNameSpaceObjects for IORT Rev E.b Sami Mujawar
2021-10-18 15:59   ` [edk2-devel] " PierreGondois
2021-10-18 16:00   ` PierreGondois
2021-06-17  9:55 ` [PATCH v2 8/8] DynamicTablesPkg: IORT generator updates for Rev E.b spec Sami Mujawar
2021-10-18 16:17   ` PierreGondois [this message]
2021-06-18  0:49 ` 回复: [edk2-devel] [PATCH v2 0/8] IORT Rev E.b specification updates gaoliming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4f401d55-d08b-ead3-a4fc-24f969009c71@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox