[edk2-devel] [PATCH v2 05/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5

Sami Mujawar posted 11 patches 1 year ago
There is a newer version of this series
[edk2-devel] [PATCH v2 05/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5
Posted by Sami Mujawar 1 year ago
The ACPI 6.5 specification updates the MADT table to add
a new field to GICC for specifying the TRBE interrupt and
also adds support for Online Capable flag to the GICC flags.

The Online Capable flags should be passed transparently
through as specified in the CM_ARM_GICC_INFO.Flags field
and only require the MADT table revision to be setup to
6 to reflect the ACPI 6.5 specification.

The TRBE field needs to be appropriately setup in the
GICC structure.

Therefore, update the MADT generator to reflect the
above updates required for supporting ACPI 6.5

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
---

Notes:
    v2:
    - TRBE interrupt not set correctly for ACPI 6.4  [Jeshua]
    - Fixed issue with setting TRBE interrupt        [Sami]
      Ref: https://edk2.groups.io/g/devel/message/107427

 DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++++++++---------
 1 file changed, 46 insertions(+), 37 deletions(-)

diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
index 2102a59faf498eaab7777c509443461ada999610..97be08b5f5b967944a351f834c3bc3f1ee5029b6 100644
--- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
+++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
@@ -1,11 +1,11 @@
 /** @file
   MADT Table Generator
 
-  Copyright (c) 2017 - 2020, ARM Limited. All rights reserved.
+  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
   @par Reference(s):
-  - ACPI 6.3 Specification - January 2019
+  - ACPI 6.5 Specification - Aug 29, 2022
 
 **/
 
@@ -82,7 +82,7 @@ GET_OBJECT_LIST (
   );
 
 /** This function updates the GIC CPU Interface Information in the
-    EFI_ACPI_6_3_GIC_STRUCTURE structure.
+    EFI_ACPI_6_5_GIC_STRUCTURE structure.
 
   @param [in]  Gicc       Pointer to GIC CPU Interface structure.
   @param [in]  GicCInfo   Pointer to the GIC CPU Interface Information.
@@ -91,7 +91,7 @@ GET_OBJECT_LIST (
 STATIC
 VOID
 AddGICC (
-  IN        EFI_ACPI_6_3_GIC_STRUCTURE  *CONST  Gicc,
+  IN        EFI_ACPI_6_5_GIC_STRUCTURE  *CONST  Gicc,
   IN  CONST CM_ARM_GICC_INFO            *CONST  GicCInfo,
   IN  CONST UINT8                               MadtRev
   )
@@ -100,9 +100,9 @@ AddGICC (
   ASSERT (GicCInfo != NULL);
 
   // UINT8 Type
-  Gicc->Type = EFI_ACPI_6_3_GIC;
+  Gicc->Type = EFI_ACPI_6_5_GIC;
   // UINT8 Length
-  Gicc->Length = sizeof (EFI_ACPI_6_3_GIC_STRUCTURE);
+  Gicc->Length = sizeof (EFI_ACPI_6_5_GIC_STRUCTURE);
   // UINT16 Reserved
   Gicc->Reserved = EFI_ACPI_RESERVED_WORD;
 
@@ -148,6 +148,15 @@ AddGICC (
     // in EFI_ACPI_6_2_GIC_STRUCTURE.
     Gicc->SpeOverflowInterrupt = 0;
   }
+
+  // UINT16  TrbeInterrupt
+  if (MadtRev > EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) {
+    Gicc->TrbeInterrupt = GicCInfo->TrbeInterrupt;
+  } else {
+    // Setting TrbeInterrupt to 0 ensures backward compatibility with
+    // ACPI 6.4
+    Gicc->TrbeInterrupt = 0;
+  }
 }
 
 /**
@@ -214,7 +223,7 @@ IsAcpiUidEqual (
 STATIC
 EFI_STATUS
 AddGICCList (
-  IN  EFI_ACPI_6_3_GIC_STRUCTURE  *Gicc,
+  IN  EFI_ACPI_6_5_GIC_STRUCTURE  *Gicc,
   IN  CONST CM_ARM_GICC_INFO      *GicCInfo,
   IN        UINT32                GicCCount,
   IN  CONST UINT8                 MadtRev
@@ -252,7 +261,7 @@ AddGICCList (
 STATIC
 VOID
 AddGICD (
-  EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE  *CONST  Gicd,
+  EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE  *CONST  Gicd,
   CONST CM_ARM_GICD_INFO                  *CONST  GicDInfo
   )
 {
@@ -260,9 +269,9 @@ AddGICD (
   ASSERT (GicDInfo != NULL);
 
   // UINT8 Type
-  Gicd->Type = EFI_ACPI_6_3_GICD;
+  Gicd->Type = EFI_ACPI_6_5_GICD;
   // UINT8 Length
-  Gicd->Length = sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE);
+  Gicd->Length = sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE);
   // UINT16 Reserved
   Gicd->Reserved1 = EFI_ACPI_RESERVED_WORD;
   // UINT32 Identifier
@@ -289,15 +298,15 @@ AddGICD (
 STATIC
 VOID
 AddGICMsiFrame (
-  IN  EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE  *CONST  GicMsiFrame,
+  IN  EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE  *CONST  GicMsiFrame,
   IN  CONST CM_ARM_GIC_MSI_FRAME_INFO       *CONST  GicMsiFrameInfo
   )
 {
   ASSERT (GicMsiFrame != NULL);
   ASSERT (GicMsiFrameInfo != NULL);
 
-  GicMsiFrame->Type                = EFI_ACPI_6_3_GIC_MSI_FRAME;
-  GicMsiFrame->Length              = sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE);
+  GicMsiFrame->Type                = EFI_ACPI_6_5_GIC_MSI_FRAME;
+  GicMsiFrame->Length              = sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE);
   GicMsiFrame->Reserved1           = EFI_ACPI_RESERVED_WORD;
   GicMsiFrame->GicMsiFrameId       = GicMsiFrameInfo->GicMsiFrameId;
   GicMsiFrame->PhysicalBaseAddress = GicMsiFrameInfo->PhysicalBaseAddress;
@@ -316,7 +325,7 @@ AddGICMsiFrame (
 STATIC
 VOID
 AddGICMsiFrameInfoList (
-  IN  EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE  *GicMsiFrame,
+  IN  EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE  *GicMsiFrame,
   IN  CONST CM_ARM_GIC_MSI_FRAME_INFO       *GicMsiFrameInfo,
   IN        UINT32                          GicMsiFrameCount
   )
@@ -337,15 +346,15 @@ AddGICMsiFrameInfoList (
 STATIC
 VOID
 AddGICRedistributor (
-  IN  EFI_ACPI_6_3_GICR_STRUCTURE   *CONST  Gicr,
+  IN  EFI_ACPI_6_5_GICR_STRUCTURE   *CONST  Gicr,
   IN  CONST CM_ARM_GIC_REDIST_INFO  *CONST  GicRedistributorInfo
   )
 {
   ASSERT (Gicr != NULL);
   ASSERT (GicRedistributorInfo != NULL);
 
-  Gicr->Type                      = EFI_ACPI_6_3_GICR;
-  Gicr->Length                    = sizeof (EFI_ACPI_6_3_GICR_STRUCTURE);
+  Gicr->Type                      = EFI_ACPI_6_5_GICR;
+  Gicr->Length                    = sizeof (EFI_ACPI_6_5_GICR_STRUCTURE);
   Gicr->Reserved                  = EFI_ACPI_RESERVED_WORD;
   Gicr->DiscoveryRangeBaseAddress =
     GicRedistributorInfo->DiscoveryRangeBaseAddress;
@@ -361,7 +370,7 @@ AddGICRedistributor (
 STATIC
 VOID
 AddGICRedistributorList (
-  IN  EFI_ACPI_6_3_GICR_STRUCTURE   *Gicr,
+  IN  EFI_ACPI_6_5_GICR_STRUCTURE   *Gicr,
   IN  CONST CM_ARM_GIC_REDIST_INFO  *GicRInfo,
   IN        UINT32                  GicRCount
   )
@@ -382,15 +391,15 @@ AddGICRedistributorList (
 STATIC
 VOID
 AddGICInterruptTranslationService (
-  IN  EFI_ACPI_6_3_GIC_ITS_STRUCTURE  *CONST  GicIts,
+  IN  EFI_ACPI_6_5_GIC_ITS_STRUCTURE  *CONST  GicIts,
   IN  CONST CM_ARM_GIC_ITS_INFO       *CONST  GicItsInfo
   )
 {
   ASSERT (GicIts != NULL);
   ASSERT (GicItsInfo != NULL);
 
-  GicIts->Type                = EFI_ACPI_6_3_GIC_ITS;
-  GicIts->Length              = sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE);
+  GicIts->Type                = EFI_ACPI_6_5_GIC_ITS;
+  GicIts->Length              = sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE);
   GicIts->Reserved            = EFI_ACPI_RESERVED_WORD;
   GicIts->GicItsId            = GicItsInfo->GicItsId;
   GicIts->PhysicalBaseAddress = GicItsInfo->PhysicalBaseAddress;
@@ -407,7 +416,7 @@ AddGICInterruptTranslationService (
 STATIC
 VOID
 AddGICItsList (
-  IN  EFI_ACPI_6_3_GIC_ITS_STRUCTURE  *GicIts,
+  IN  EFI_ACPI_6_5_GIC_ITS_STRUCTURE  *GicIts,
   IN  CONST CM_ARM_GIC_ITS_INFO       *GicItsInfo,
   IN        UINT32                    GicItsCount
   )
@@ -470,7 +479,7 @@ BuildMadtTable (
   UINT32                     GicRedistOffset;
   UINT32                     GicItsOffset;
 
-  EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER  *Madt;
+  EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER  *Madt;
 
   ASSERT (This != NULL);
   ASSERT (AcpiTableInfo != NULL);
@@ -602,22 +611,22 @@ BuildMadtTable (
     goto error_handler;
   }
 
-  TableSize = sizeof (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER);
+  TableSize = sizeof (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER);
 
   GicCOffset = TableSize;
-  TableSize += (sizeof (EFI_ACPI_6_3_GIC_STRUCTURE) * GicCCount);
+  TableSize += (sizeof (EFI_ACPI_6_5_GIC_STRUCTURE) * GicCCount);
 
   GicDOffset = TableSize;
-  TableSize += (sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount);
+  TableSize += (sizeof (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount);
 
   GicMSIOffset = TableSize;
-  TableSize   += (sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE) * GicMSICount);
+  TableSize   += (sizeof (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE) * GicMSICount);
 
   GicRedistOffset = TableSize;
-  TableSize      += (sizeof (EFI_ACPI_6_3_GICR_STRUCTURE) * GicRedistCount);
+  TableSize      += (sizeof (EFI_ACPI_6_5_GICR_STRUCTURE) * GicRedistCount);
 
   GicItsOffset = TableSize;
-  TableSize   += (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount);
+  TableSize   += (sizeof (EFI_ACPI_6_5_GIC_ITS_STRUCTURE) * GicItsCount);
 
   // Allocate the Buffer for MADT table
   *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
@@ -633,7 +642,7 @@ BuildMadtTable (
     goto error_handler;
   }
 
-  Madt = (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table;
+  Madt = (EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table;
 
   DEBUG ((
     DEBUG_INFO,
@@ -659,7 +668,7 @@ BuildMadtTable (
   }
 
   Status = AddGICCList (
-             (EFI_ACPI_6_3_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset),
+             (EFI_ACPI_6_5_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset),
              GicCInfo,
              GicCCount,
              Madt->Header.Revision
@@ -674,13 +683,13 @@ BuildMadtTable (
   }
 
   AddGICD (
-    (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset),
+    (EFI_ACPI_6_5_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset),
     GicDInfo
     );
 
   if (GicMSICount != 0) {
     AddGICMsiFrameInfoList (
-      (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset),
+      (EFI_ACPI_6_5_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset),
       GicMSIInfo,
       GicMSICount
       );
@@ -688,7 +697,7 @@ BuildMadtTable (
 
   if (GicRedistCount != 0) {
     AddGICRedistributorList (
-      (EFI_ACPI_6_3_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset),
+      (EFI_ACPI_6_5_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset),
       GicRedistInfo,
       GicRedistCount
       );
@@ -696,7 +705,7 @@ BuildMadtTable (
 
   if (GicItsCount != 0) {
     AddGICItsList (
-      (EFI_ACPI_6_3_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset),
+      (EFI_ACPI_6_5_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset),
       GicItsInfo,
       GicItsCount
       );
@@ -764,9 +773,9 @@ ACPI_TABLE_GENERATOR  MadtGenerator = {
   // Generator Description
   L"ACPI.STD.MADT.GENERATOR",
   // ACPI Table Signature
-  EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
+  EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE,
   // ACPI Table Revision supported by this Generator
-  EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
+  EFI_ACPI_6_5_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
   // Minimum supported ACPI Table Revision
   EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION,
   // Creator ID
-- 
'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108592): https://edk2.groups.io/g/devel/message/108592
Mute This Topic: https://groups.io/mt/101335844/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 05/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5
Posted by PierreGondois 1 year ago
Hi Sami,

On 9/13/23 14:49, Sami Mujawar wrote:
> The ACPI 6.5 specification updates the MADT table to add
> a new field to GICC for specifying the TRBE interrupt and
> also adds support for Online Capable flag to the GICC flags.
> 
> The Online Capable flags should be passed transparently
> through as specified in the CM_ARM_GICC_INFO.Flags field
> and only require the MADT table revision to be setup to
> 6 to reflect the ACPI 6.5 specification.
> 
> The TRBE field needs to be appropriately setup in the
> GICC structure.
> 
> Therefore, update the MADT generator to reflect the
> above updates required for supporting ACPI 6.5
> 
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
> ---
> 
> Notes:
>      v2:
>      - TRBE interrupt not set correctly for ACPI 6.4  [Jeshua]
>      - Fixed issue with setting TRBE interrupt        [Sami]
>        Ref: https://edk2.groups.io/g/devel/message/107427
> 
>   DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++++++++---------
>   1 file changed, 46 insertions(+), 37 deletions(-)
> 
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> index 2102a59faf498eaab7777c509443461ada999610..97be08b5f5b967944a351f834c3bc3f1ee5029b6 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> @@ -1,11 +1,11 @@
>   /** @file
>     MADT Table Generator
>   
> -  Copyright (c) 2017 - 2020, ARM Limited. All rights reserved.
> +  Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
>     SPDX-License-Identifier: BSD-2-Clause-Patent
>   
>     @par Reference(s):
> -  - ACPI 6.3 Specification - January 2019
> +  - ACPI 6.5 Specification - Aug 29, 2022
>   
>   **/
>   
> @@ -82,7 +82,7 @@ GET_OBJECT_LIST (
>     );
>   
>   /** This function updates the GIC CPU Interface Information in the
> -    EFI_ACPI_6_3_GIC_STRUCTURE structure.
> +    EFI_ACPI_6_5_GIC_STRUCTURE structure.
>   
>     @param [in]  Gicc       Pointer to GIC CPU Interface structure.
>     @param [in]  GicCInfo   Pointer to the GIC CPU Interface Information.
> @@ -91,7 +91,7 @@ GET_OBJECT_LIST (
>   STATIC
>   VOID
>   AddGICC (
> -  IN        EFI_ACPI_6_3_GIC_STRUCTURE  *CONST  Gicc,
> +  IN        EFI_ACPI_6_5_GIC_STRUCTURE  *CONST  Gicc,
>     IN  CONST CM_ARM_GICC_INFO            *CONST  GicCInfo,
>     IN  CONST UINT8                               MadtRev
>     )
> @@ -100,9 +100,9 @@ AddGICC (
>     ASSERT (GicCInfo != NULL);
>   
>     // UINT8 Type
> -  Gicc->Type = EFI_ACPI_6_3_GIC;
> +  Gicc->Type = EFI_ACPI_6_5_GIC;
>     // UINT8 Length
> -  Gicc->Length = sizeof (EFI_ACPI_6_3_GIC_STRUCTURE);
> +  Gicc->Length = sizeof (EFI_ACPI_6_5_GIC_STRUCTURE);
>     // UINT16 Reserved
>     Gicc->Reserved = EFI_ACPI_RESERVED_WORD;
>   
> @@ -148,6 +148,15 @@ AddGICC (
>       // in EFI_ACPI_6_2_GIC_STRUCTURE.
>       Gicc->SpeOverflowInterrupt = 0;
>     }
> +
> +  // UINT16  TrbeInterrupt
> +  if (MadtRev > EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) {
> +    Gicc->TrbeInterrupt = GicCInfo->TrbeInterrupt;
> +  } else {
> +    // Setting TrbeInterrupt to 0 ensures backward compatibility with
> +    // ACPI 6.4
> +    Gicc->TrbeInterrupt = 0;

I'm not sure this is necessary as the Gicc struct should be 0-ed,

Regards,
Pierre


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108983): https://edk2.groups.io/g/devel/message/108983
Mute This Topic: https://groups.io/mt/101335844/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v2 05/11] DynamicTablesPkg: Update MADT generator for ACPI 6.5
Posted by Sami Mujawar 1 year ago
Hi Pierre,

Thank you for the review feedback.

Please see my response inline marked [SAMI].

Regards,

Sami Mujawar

On 22/09/2023, 09:53, "Pierre Gondois" <pierre.gondois@arm.com <mailto:pierre.gondois@arm.com>> wrote:


Hi Sami,


On 9/13/23 14:49, Sami Mujawar wrote:
> The ACPI 6.5 specification updates the MADT table to add
> a new field to GICC for specifying the TRBE interrupt and
> also adds support for Online Capable flag to the GICC flags.
> 
> The Online Capable flags should be passed transparently
> through as specified in the CM_ARM_GICC_INFO.Flags field
> and only require the MADT table revision to be setup to
> 6 to reflect the ACPI 6.5 specification.
> 
> The TRBE field needs to be appropriately setup in the
> GICC structure.
> 
> Therefore, update the MADT generator to reflect the
> above updates required for supporting ACPI 6.5
> 
> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com <mailto:sami.mujawar@arm.com>>
> ---
> 
> Notes:
> v2:
> - TRBE interrupt not set correctly for ACPI 6.4 [Jeshua]
> - Fixed issue with setting TRBE interrupt [Sami]
> Ref: https://edk2.groups.io/g/devel/message/107427 <https://edk2.groups.io/g/devel/message/107427>
> 
> DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c | 83 +++++++++++---------
> 1 file changed, 46 insertions(+), 37 deletions(-)
> 
> diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> index 2102a59faf498eaab7777c509443461ada999610..97be08b5f5b967944a351f834c3bc3f1ee5029b6 100644
> --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c
> @@ -1,11 +1,11 @@
> /** @file
> MADT Table Generator
> 
> - Copyright (c) 2017 - 2020, ARM Limited. All rights reserved.
> + Copyright (c) 2017 - 2023, Arm Limited. All rights reserved.
> SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @par Reference(s):
> - - ACPI 6.3 Specification - January 2019
> + - ACPI 6.5 Specification - Aug 29, 2022
> 
> **/
> 
> @@ -82,7 +82,7 @@ GET_OBJECT_LIST (
> );
> 
> /** This function updates the GIC CPU Interface Information in the
> - EFI_ACPI_6_3_GIC_STRUCTURE structure.
> + EFI_ACPI_6_5_GIC_STRUCTURE structure.
> 
> @param [in] Gicc Pointer to GIC CPU Interface structure.
> @param [in] GicCInfo Pointer to the GIC CPU Interface Information.
> @@ -91,7 +91,7 @@ GET_OBJECT_LIST (
> STATIC
> VOID
> AddGICC (
> - IN EFI_ACPI_6_3_GIC_STRUCTURE *CONST Gicc,
> + IN EFI_ACPI_6_5_GIC_STRUCTURE *CONST Gicc,
> IN CONST CM_ARM_GICC_INFO *CONST GicCInfo,
> IN CONST UINT8 MadtRev
> )
> @@ -100,9 +100,9 @@ AddGICC (
> ASSERT (GicCInfo != NULL);
> 
> // UINT8 Type
> - Gicc->Type = EFI_ACPI_6_3_GIC;
> + Gicc->Type = EFI_ACPI_6_5_GIC;
> // UINT8 Length
> - Gicc->Length = sizeof (EFI_ACPI_6_3_GIC_STRUCTURE);
> + Gicc->Length = sizeof (EFI_ACPI_6_5_GIC_STRUCTURE);
> // UINT16 Reserved
> Gicc->Reserved = EFI_ACPI_RESERVED_WORD;
> 
> @@ -148,6 +148,15 @@ AddGICC (
> // in EFI_ACPI_6_2_GIC_STRUCTURE.
> Gicc->SpeOverflowInterrupt = 0;
> }
> +
> + // UINT16 TrbeInterrupt
> + if (MadtRev > EFI_ACPI_6_4_MULTIPLE_APIC_DESCRIPTION_TABLE_REVISION) {
> + Gicc->TrbeInterrupt = GicCInfo->TrbeInterrupt;
> + } else {
> + // Setting TrbeInterrupt to 0 ensures backward compatibility with
> + // ACPI 6.4
> + Gicc->TrbeInterrupt = 0;


I'm not sure this is necessary as the Gicc struct should be 0-ed,
[SAMI] Yes, I think we do not need to zero this field as the memory allocated for the MADT table in BuildMadtTable() is allocated using AllocateZeroPool().
I can drop the else condition.
[/SAMI]

Regards,
Pierre





-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108985): https://edk2.groups.io/g/devel/message/108985
Mute This Topic: https://groups.io/mt/101335844/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-